Updates to event export and javascript fixes.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2814 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2009-03-27 09:14:54 +00:00
parent 75c654e654
commit cfccc4b9bf
4 changed files with 8 additions and 6 deletions

View File

@ -1,6 +1,6 @@
<?php <?php
if ( empty($_REQUEST['id']) ) if ( empty($_REQUEST['id']) && empty($_REQUEST['eids']) )
{ {
ajaxError( "No event id(s) supplied" ); ajaxError( "No event id(s) supplied" );
} }
@ -73,7 +73,8 @@ if ( canView( 'Events' ) )
else else
$exportFormat = ''; $exportFormat = '';
if ( $exportFile = exportEvents( $_REQUEST['id'], $exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc, $exportFormat ) ) $exportIds = !empty($_REQUEST['eids'])?$_REQUEST['eids']:$_REQUEST['id'];
if ( $exportFile = exportEvents( $exportIds, $exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc, $exportFormat ) )
ajaxResponse( array( 'exportFile'=>$exportFile ) ); ajaxResponse( array( 'exportFile'=>$exportFile ) );
else else
ajaxError( "Export Failed" ); ajaxError( "Export Failed" );
@ -81,6 +82,7 @@ if ( canView( 'Events' ) )
} }
} }
} }
if ( canEdit( 'Events' ) ) if ( canEdit( 'Events' ) )
{ {
switch ( $_REQUEST['action'] ) switch ( $_REQUEST['action'] )

View File

@ -242,7 +242,7 @@ function exportFileList( $eid, $exportDetail, $exportFrames, $exportImages, $exp
function exportEvents( $eids, $exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc, $exportFormat ) function exportEvents( $eids, $exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc, $exportFormat )
{ {
if ( canView( 'Events' ) && $eids ) if ( canView( 'Events' ) && !empty($eids) )
{ {
$export_root = "zmExport"; $export_root = "zmExport";
$export_listFile = "zmFileList.txt"; $export_listFile = "zmFileList.txt";
@ -252,7 +252,7 @@ function exportEvents( $eids, $exportDetail, $exportFrames, $exportImages, $expo
{ {
foreach ( $eids as $eid ) foreach ( $eids as $eid )
{ {
$exportFileList = array_merge( $exportFileList, exportFileList( $eid ) ); $exportFileList = array_merge( $exportFileList, exportFileList( $eid ), $exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc );
} }
} }
else else

View File

@ -40,7 +40,7 @@ function exportResponse( respText )
function exportEvent( form ) function exportEvent( form )
{ {
var parms = 'view=request&request=event&action=export'; 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 } ); var query = new Ajax( thisUrl, { method: 'post', data: parms, onComplete: exportResponse } );
query.request(); query.request();
$('exportProgress').removeClass( 'hidden' ); $('exportProgress').removeClass( 'hidden' );

View File

@ -31,7 +31,7 @@ function generateVideoResponse( respText )
function generateVideo( form ) function generateVideo( form )
{ {
var parms = 'view=request&request=event&action=video'; 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 } ); var query = new Ajax( thisUrl, { method: 'post', data: parms, onComplete: generateVideoResponse } );
query.request(); query.request();
$('videoProgress').removeClass( 'hidden' ); $('videoProgress').removeClass( 'hidden' );