From ad9ce720fd5f3784ecb7535e38599fc364dde4be Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 6 Aug 2021 13:10:44 -0400 Subject: [PATCH] Allow specifying export Structure to get a flat zip --- web/ajax/event.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/web/ajax/event.php b/web/ajax/event.php index 9b7f86e03..03c54ada8 100644 --- a/web/ajax/event.php +++ b/web/ajax/event.php @@ -74,10 +74,15 @@ if ( canView('Events') ) { else $exportCompress = false; + if ( !empty($_REQUEST['exportStructure']) ) + $exportStructure = $_SESSION['export']['structure'] = $_REQUEST['exportStructure']; + else + $exportStructure = false; + session_write_close(); $exportIds = !empty($_REQUEST['eids']) ? $_REQUEST['eids'] : $_REQUEST['id']; - if ( $exportFile = exportEvents( + if ($exportFile = exportEvents( $exportIds, (isset($_REQUEST['connkey'])?$_REQUEST['connkey']:''), $exportDetail, @@ -87,12 +92,13 @@ if ( canView('Events') ) { $exportMisc, $exportFormat, $exportCompress, - false, # structure - (isset($_REQUEST['exportFile'])?$_REQUEST['exportFile']:''), - ) ) - ajaxResponse(array('exportFile'=>$exportFile)); - else + $exportStructure, + (!empty($_REQUEST['exportFile'])?$_REQUEST['exportFile']:'zmExport'), + )) { + ajaxResponse(array('exportFile'=>$exportFile)); + } else { ajaxError('Export Failed'); + } break; case 'download' : require_once(ZM_SKIN_PATH.'/includes/export_functions.php');