Page 1 of 2

event export doesn't work

Posted: Thu Feb 12, 2009 2:49 pm
by szimszon
If I click on Export I got a white page, and firebug say:

6 <link rel="shortcut icon" href="graphics/favicon.ico"/>
7 <link rel="stylesheet" href="css/reset.css" type="text/css"/>
8 <link rel="stylesheet" href="skins/classic/css/skin.css" type="text/css" media="screen"/>
9 <link rel="stylesheet" href="skins/classic/views/css/export.css" type="text/css" media="screen"/>
10 <script type="text/javascript" src="tools/mootools/mootools.js"></script>
11 <script type="text/javascript" src="js/mootools.ext.js"></script>
12 <script type="text/javascript">
13 var AJAX_TIMEOUT = 50000;
14
15 var currentView = 'export';
16 var thisUrl = "https://192.168.55.2/zm/index.php";
17 var skinPath = "skins/classic";
18
19 var canEditSystem = true;
20 var canViewSystem = true;
21
22 var refreshParent = false;
23
24 var focusWindow = true;
25 </script>
26 <script type="text/javascript">
27<br />
28<b>Parse error</b>: syntax error, unexpected T_FOREACH in <b>/srv/www/zoneminder/skins/classic/views/js/export.js.php</b> on line <b>5</b><br />

Posted: Thu Feb 12, 2009 4:20 pm
by zoneminder
Thanks for this. Fixed now and will be in next release which will be very shortly or via SVN.

Posted: Thu Feb 12, 2009 10:45 pm
by zoneminder
Fix now on SVN.

event export issues

Posted: Tue Mar 24, 2009 9:08 pm
by mcg
Hi - first post .. ZM 1.24.1 just blows me away!

However, have experienced 3 issues and fixed two (Vista, IE7, ZM 1.24.1)

js/mootools.js: innerHTML not supported in IE7 - no fix; this.fireEvent naffed too... impacts zone editing.

fixed several items to export events (excuse php 4 programming):

ajax/event.php: mods:

if ( (isset($_REQUEST['id']) && empty($_REQUEST['id'])) || (isset($_REQUEST['eids']) && empty($_REQUEST['eids'])))
{
ajaxError( "No event id(s) supplied" );
}

.
.
.
if ( $exportFile = exportEvents( $_REQUEST['eids'],$exportDetail, $exportFrames, $exportImages, $exportVideo, $ex
portMisc, $exportFormat ) )

------------------

skins/classic/views/js/export.js:
skins/classic/views/js/video.js:
change
parms += '&'+form.toQueryString();
to
parms += '&'+$(form).toQueryString();

Mootools issues with IE7 real bummer, guess I'll have to edit zones on IE 6

missed one change

Posted: Tue Mar 24, 2009 9:15 pm
by mcg
skins/classic/includes/export_functions.php
in exportEvents:

if ( is_array( $eids ) )
{
foreach ( $eids as $eid )
{
$exportFileList = array_merge( $exportFileList, exportFileList( $eid,
$exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc ) );
}
}

Posted: Thu Mar 26, 2009 4:54 pm
by zoneminder
Thanks for taking the time to come back with such a useful post including fixes. I have implemented them (or similar) here and they should be on SVN later.

I hadn't noticed the IE7 mootools issues so will have a bit of a dig around at that to see if there are any workarounds that might work. Alternatively ZM is using mootols v 1.11 and I have been looking for an excuse to migrate it up to v1.21 so this might be that excuse, especially if it fixes the issues.

Posted: Mon Mar 30, 2009 11:16 am
by zoneminder
The SVN version of ZM 1.24.1 is now using mootools 1.2.1. As far as I can tell it works correctly now in IE7 etc.

Posted: Tue Mar 31, 2009 2:12 pm
by zoneminder
A few further migration tweaks have gone in today also.

Updates?

Posted: Wed Jun 17, 2009 1:54 pm
by mcg
Hi - thanks for the updates.

Would you be able to forward the offical updates... I seem to have missed something - export fails when clicked from filter window, but works from the Event Viewer window [ IE 6 sp3 browser ]

I should test on IE 8 now too.

Re: Updates?

Posted: Sun Jul 26, 2009 8:25 pm
by pvanthony
mcg wrote:I seem to have missed something - export fails when clicked from filter window, but works from the Event Viewer window
Using version 1.24.2 and not able to export from the filter window. Is there a patch that can be downloaded to solve this problem?

Please advise.

By the way, 1.24.2 is awesome.

P.V.Anthony

Re: Updates?

Posted: Wed Jul 29, 2009 6:17 pm
by pvanthony
pvanthony wrote: Using version 1.24.2 and not able to export from the filter window. Is there a patch that can be downloaded to solve this problem?
Following the post on this thread and made some changes on the code and it works. The export works.

Here is the patch for 1.24.2.
------------ start -------------------------
# diff -ruN ./ajax/event.php.org ./ajax/event.php
--- ./ajax/event.php.org 2009-07-29 01:13:50.073354656 +0800
+++ ./ajax/event.php 2009-07-29 01:16:48.713354123 +0800
@@ -1,6 +1,6 @@
<?php

-if ( empty($_REQUEST['id']) && empty($_REQUEST['eids']) )
+if ((isset($_REQUEST['id']) && empty($_REQUEST['id'])) || (isset($_REQUEST['eids']) && empty($_REQUEST['eids'])) )
{
ajaxError( "No event id(s) supplied" );
}
--------------- end -----------------------

--------------- start ----------------------
diff -ruN ./skins/classic/includes/export_functions.php.org ./skins/classic/includes/export_functions.php
--- ./skins/classic/includes/export_functions.php.org 2009-07-29 01:26:17.430355432 +0800
+++ ./skins/classic/includes/export_functions.php 2009-07-29 01:28:05.624354257 +0800
@@ -252,7 +252,7 @@
{
foreach ( $eids as $eid )
{
- $exportFileList = array_merge( $exportFileList, exportFileList( $eid ), $exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc );
+ $exportFileList = array_merge( $exportFileList, exportFileList( $eid, $exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc ));
}
}
else
----------------end -----------------------

Hope this is useful to others.

P.V.Anthony

How to patch

Posted: Fri Jul 02, 2010 5:44 pm
by calexguest
I've never patched a file before. I tried creating a file call 'event.diff' with the code between start and end in my zoneminder directory. Then, I ran 'patch event.diff' as root and it just sits there until I escape out.

Help! Anyone!

Thanks,
Alex

Posted: Sat Jul 10, 2010 7:15 pm
by estranged1977
Can you please tell us how to use this patch???

Posted: Mon Jul 12, 2010 12:16 pm
by Fitch
Would the above patch help my problem?

http://www.zoneminder.com/forums/viewtopic.php?t=16110

and if so, I also have to ask the same question as estranged...

Posted: Wed Jul 14, 2010 7:14 pm
by Fitch
O.K, I've read up on how to patch, and I've downloaded patch (seemed a good idea at the time).

I've gone to what I hope is the correct directory, but didn't get very far (line 6 to be exact)

brafferton@cameras:~$ cd /usr/share/zoneminder/ajax
brafferton@cameras:/usr/share/zoneminder/ajax$ patch event.php event.diff
patching file event.php
patch: **** malformed patch at line 6: <?php

brafferton@cameras:/usr/share/zoneminder/ajax$



And is it going to help my specific problem - as per previous post?