From accfd1191f216d8b46f9afe266a6771001c73fb4 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Tue, 15 Sep 2020 09:20:38 -0500 Subject: [PATCH] update eventdetail modal --- web/includes/actions/eventdetail.php | 3 +-- web/skins/classic/includes/functions.php | 29 ++++++++++++------------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/web/includes/actions/eventdetail.php b/web/includes/actions/eventdetail.php index 20bd084ee..d0a05829c 100644 --- a/web/includes/actions/eventdetail.php +++ b/web/includes/actions/eventdetail.php @@ -41,7 +41,6 @@ if ( $action == 'eventdetail' ) { ); } $dbConn->commit(); - $refreshParent = true; - $closePopup = true; + $redirect = $_SERVER['HTTP_REFERER']; } ?> diff --git a/web/skins/classic/includes/functions.php b/web/skins/classic/includes/functions.php index cb9809052..2a81214b2 100644 --- a/web/skins/classic/includes/functions.php +++ b/web/skins/classic/includes/functions.php @@ -1021,7 +1021,7 @@ function getEventDetailHTML($eid='', $eids='') { $inputs = ''; $disabled = 'disabled="disabled"'; $null = ''; - + if ( !canEdit('Events') ) return; // We have to manually insert the csrf key into the form when using a modal generated via ajax call @@ -1031,22 +1031,23 @@ function getEventDetailHTML($eid='', $eids='') { $csrf_input = ''; } - if ( isset($eid) ){ // Single Event Mode - $title = translate('Event').' '.$eid.PHP_EOL; - $inputs .= ''.PHP_EOL; + if ( $eid ){ // Single Event Mode $eid = validInt($eid); + $title = translate('Event').' '.$eid.PHP_EOL; + $inputs .= ''.PHP_EOL; $newEvent = dbFetchOne('SELECT E.* FROM Events AS E WHERE E.Id = ?', NULL, array($eid)); - } elseif ( isset($eids) ) { // Multi Event Mode + } elseif ( $eids ) { // Multi Event Mode $title = translate('Events'); $sql = 'SELECT E.* FROM Events AS E WHERE '; $sqlWhere = array(); $sqlValues = array(); foreach ( $eids as $eid ) { - $inputs .= ''.PHP_EOL; + $eid = validInt($eid); + $inputs .= ''.PHP_EOL; $sqlWhere[] = 'E.Id = ?'; - $sqlValues[] = validInt($eid); + $sqlValues[] = $eid; } unset($eid); $sql .= join(' OR ', $sqlWhere); @@ -1064,8 +1065,8 @@ function getEventDetailHTML($eid='', $eids='') { } else { // Event Mode not specified - should we really proceed if neither eid nor eids is set? $title = translate('Events'); } - - $result .= '