From cfccc4b9bfcf7770c68c93e5774f019ce3b6adbb Mon Sep 17 00:00:00 2001 From: stan Date: Fri, 27 Mar 2009 09:14:54 +0000 Subject: [PATCH] Updates to event export and javascript fixes. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2814 e3e1d417-86f3-4887-817a-d78f3d33393f --- web/ajax/event.php | 6 ++++-- web/skins/classic/includes/export_functions.php | 4 ++-- web/skins/classic/views/js/export.js | 2 +- web/skins/classic/views/js/video.js | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/web/ajax/event.php b/web/ajax/event.php index 99946e70b..bb8341727 100644 --- a/web/ajax/event.php +++ b/web/ajax/event.php @@ -1,6 +1,6 @@ $exportFile ) ); else ajaxError( "Export Failed" ); @@ -81,6 +82,7 @@ if ( canView( 'Events' ) ) } } } + if ( canEdit( 'Events' ) ) { switch ( $_REQUEST['action'] ) diff --git a/web/skins/classic/includes/export_functions.php b/web/skins/classic/includes/export_functions.php index c3273448b..bd1f0030a 100644 --- a/web/skins/classic/includes/export_functions.php +++ b/web/skins/classic/includes/export_functions.php @@ -242,7 +242,7 @@ function exportFileList( $eid, $exportDetail, $exportFrames, $exportImages, $exp function exportEvents( $eids, $exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc, $exportFormat ) { - if ( canView( 'Events' ) && $eids ) + if ( canView( 'Events' ) && !empty($eids) ) { $export_root = "zmExport"; $export_listFile = "zmFileList.txt"; @@ -252,7 +252,7 @@ function exportEvents( $eids, $exportDetail, $exportFrames, $exportImages, $expo { foreach ( $eids as $eid ) { - $exportFileList = array_merge( $exportFileList, exportFileList( $eid ) ); + $exportFileList = array_merge( $exportFileList, exportFileList( $eid ), $exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc ); } } else diff --git a/web/skins/classic/views/js/export.js b/web/skins/classic/views/js/export.js index 0d3e0b0e0..82b9e8b96 100644 --- a/web/skins/classic/views/js/export.js +++ b/web/skins/classic/views/js/export.js @@ -40,7 +40,7 @@ function exportResponse( respText ) function exportEvent( form ) { var parms = 'view=request&request=event&action=export'; - parms += '&'+form.toQueryString(); + parms += '&'+$(form).toQueryString(); var query = new Ajax( thisUrl, { method: 'post', data: parms, onComplete: exportResponse } ); query.request(); $('exportProgress').removeClass( 'hidden' ); diff --git a/web/skins/classic/views/js/video.js b/web/skins/classic/views/js/video.js index a2c1c6d68..716f36cdb 100644 --- a/web/skins/classic/views/js/video.js +++ b/web/skins/classic/views/js/video.js @@ -31,7 +31,7 @@ function generateVideoResponse( respText ) function generateVideo( form ) { var parms = 'view=request&request=event&action=video'; - parms += '&'+form.toQueryString(); + parms += '&'+$(form).toQueryString(); var query = new Ajax( thisUrl, { method: 'post', data: parms, onComplete: generateVideoResponse } ); query.request(); $('videoProgress').removeClass( 'hidden' );