event export doesn't work

Forum for questions and support relating to the 1.24.x releases only.
szimszon
Posts: 26
Joined: Mon Nov 27, 2006 8:41 pm

event export doesn't work

Post 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 />
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Thanks for this. Fixed now and will be in next release which will be very shortly or via SVN.
Phil
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Fix now on SVN.
Phil
mcg
Posts: 3
Joined: Tue Mar 24, 2009 8:51 pm

event export issues

Post 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
mcg
Posts: 3
Joined: Tue Mar 24, 2009 8:51 pm

missed one change

Post 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 ) );
}
}
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post 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.
Phil
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post 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.
Phil
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

A few further migration tweaks have gone in today also.
Phil
mcg
Posts: 3
Joined: Tue Mar 24, 2009 8:51 pm

Updates?

Post 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.
pvanthony
Posts: 6
Joined: Wed May 27, 2009 2:07 am

Re: Updates?

Post 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
pvanthony
Posts: 6
Joined: Wed May 27, 2009 2:07 am

Re: Updates?

Post 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
calexguest
Posts: 1
Joined: Fri Jul 02, 2010 5:39 pm

How to patch

Post 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
estranged1977
Posts: 15
Joined: Wed Feb 17, 2010 1:57 am

Post by estranged1977 »

Can you please tell us how to use this patch???
Fitch
Posts: 105
Joined: Sat Oct 31, 2009 4:01 pm
Location: Hartlepool, U.K.

Post 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...
Fitch
Posts: 105
Joined: Sat Oct 31, 2009 4:01 pm
Location: Hartlepool, U.K.

Post 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?
Locked