diff --git a/web/skins/classic/views/download.php b/web/skins/classic/views/download.php index 1d37d73f6..d9e8bf7e3 100644 --- a/web/skins/classic/views/download.php +++ b/web/skins/classic/views/download.php @@ -23,18 +23,25 @@ if ( !canView('Events') ) { return; } +$total_size = 0; if (isset($_SESSION['montageReviewFilter'])) { //Handles montageReview filter - $eventsSql = 'SELECT E.Id FROM Events as E WHERE 1'; + $eventsSql = 'SELECT E.Id,E.DiskSpace FROM Events as E WHERE 1'; $eventsSql .= $_SESSION['montageReviewFilter']['sql']; $results = dbQuery($eventsSql); $eids = []; while ( $event_row = dbFetchNext( $results ) ) { array_push($eids, 'eids[]='.$event_row['Id']); + $total_size += $event_row['DiskSpace']; } $_REQUEST['eids'] = $eids; - session_start(); - unset($_SESSION['montageReviewFilter']); - session_write_close(); + if ( ! count($eids) ) { + Error("No events found for download using $eventsSql"); + } + #session_start(); + #unset($_SESSION['montageReviewFilter']); + #session_write_close(); +#} else { +#Logger::Debug("NO montageReviewFilter"); } $focusWindow = true; @@ -55,7 +62,9 @@ xhtmlHeaders(__FILE__, translate('Download') ); if ( !empty($_REQUEST['eid']) ) { ?> -DiskSpace() ); } else if ( !empty($_REQUEST['eids']) ) { foreach ( $_REQUEST['eids'] as $eid ) { ?> @@ -63,6 +72,9 @@ if ( !empty($_REQUEST['eid']) ) { There are no events found. Resulting download will be empty.'; } ?> diff --git a/web/skins/classic/views/montagereview.php b/web/skins/classic/views/montagereview.php index 08fea1c93..2774cb5fd 100644 --- a/web/skins/classic/views/montagereview.php +++ b/web/skins/classic/views/montagereview.php @@ -83,6 +83,7 @@ if (isset($_REQUEST['minTime']) && isset($_REQUEST['maxTime']) && count($display } } parseFilter( $filter ); + # This is to enable the download button session_start(); $_SESSION['montageReviewFilter'] = $filter; session_write_close();