From 0e20666992abcb1ee04def2e10a4abe8fa1ea49f Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 4 Jan 2019 15:43:31 -0500 Subject: [PATCH] fix eventdetail actions being in events --- web/includes/actions/eventdetail.php | 47 ++++++++++++++++++++++++++++ web/includes/actions/events.php | 16 +--------- 2 files changed, 48 insertions(+), 15 deletions(-) create mode 100644 web/includes/actions/eventdetail.php diff --git a/web/includes/actions/eventdetail.php b/web/includes/actions/eventdetail.php new file mode 100644 index 000000000..c0507776f --- /dev/null +++ b/web/includes/actions/eventdetail.php @@ -0,0 +1,47 @@ +beginTransaction(); + foreach ( getAffectedIds('markEid') as $markEid ) { + dbQuery('UPDATE Events SET Cause=?, Notes=? WHERE Id=?', + array( + $_REQUEST['newEvent']['Cause'], + $_REQUEST['newEvent']['Notes'], + $markEid + ) + ); + } + $dbConn->commit(); + $refreshParent = true; + $closePopup = true; +} +?> diff --git a/web/includes/actions/events.php b/web/includes/actions/events.php index dff69d738..10642f329 100644 --- a/web/includes/actions/events.php +++ b/web/includes/actions/events.php @@ -29,21 +29,7 @@ if ( !canEdit('Events') ) { return; } // end if ! canEdit(Events) -if ( $action == 'eventdetail' ) { - $dbConn->beginTransaction(); - foreach ( getAffectedIds('markEid') as $markEid ) { - dbQuery('UPDATE Events SET Cause=?, Notes=? WHERE Id=?', - array( - $_REQUEST['newEvent']['Cause'], - $_REQUEST['newEvent']['Notes'], - $markEid - ) - ); - } - $dbConn->commit(); - $refreshParent = true; - $closePopup = true; -} else if ( $action == 'archive' ) { +if ( $action == 'archive' ) { $dbConn->beginTransaction(); foreach( getAffectedIds('markEid') as $markEid ) { dbQuery('UPDATE Events SET Archived=? WHERE Id=?', array(1, $markEid));