diff --git a/db/zm_update-1.34.4.sql b/db/zm_update-1.34.4.sql new file mode 100644 index 000000000..2910943a0 --- /dev/null +++ b/db/zm_update-1.34.4.sql @@ -0,0 +1,5 @@ +-- +-- This updates a 1.34.3 database to 1.34.4 +-- +-- No changes required +-- diff --git a/web/skins/classic/views/js/montagereview.js b/web/skins/classic/views/js/montagereview.js index 8ec810ec4..2d482f771 100644 --- a/web/skins/classic/views/js/montagereview.js +++ b/web/skins/classic/views/js/montagereview.js @@ -1013,8 +1013,7 @@ function initPage() { $j('#maxTime').datetimepicker({ timeFormat: "HH:mm:ss", dateFormat: "yy-mm-dd", - //minDate: $j('#minTime').val(), - minDate: -7, + minDate: minTime, maxDate: +0, constrainInput: false, onClose: function(newDate, oldData) { diff --git a/web/skins/classic/views/js/montagereview.js.php b/web/skins/classic/views/js/montagereview.js.php index eab520962..4076d1dbe 100644 --- a/web/skins/classic/views/js/montagereview.js.php +++ b/web/skins/classic/views/js/montagereview.js.php @@ -50,7 +50,6 @@ if ( !$liveMode ) { $event_id = $event['Id']; $EventsById[$event_id] = $event; } - $next_frames = array(); if ( $result = dbQuery($framesSql) ) { @@ -71,7 +70,7 @@ if ( !$liveMode ) { $event['FramesById'] += array($frame['Id']=>$frame); $next_frames[$frame['EventId']] = &$event['FramesById'][$frame['Id']]; } - } + } // end if dbQuery $events_by_monitor_id = array(); @@ -203,6 +202,8 @@ echo " var numMonitors = $numMonitors; var minTimeSecs=parseInt($minTimeSecs); var maxTimeSecs=parseInt($maxTimeSecs); +var minTime='$minTime'; +var maxTime='$maxTime'; "; echo "var rangeTimeSecs=" . ( $maxTimeSecs - $minTimeSecs + 1) . ";\n"; if(isset($defaultCurrentTime)) diff --git a/web/skins/classic/views/js/video.js b/web/skins/classic/views/js/video.js index cfe2b2384..70b6c48ca 100644 --- a/web/skins/classic/views/js/video.js +++ b/web/skins/classic/views/js/video.js @@ -1,8 +1,10 @@ -function deleteVideo( index ) { +function deleteVideo( e ) { + index = e.getAttribute('data-file-index'); window.location.replace( thisUrl+'?view='+currentView+'&eid='+eventId+'&deleteIndex='+index ); } -function downloadVideo( index ) { +function downloadVideo( e ) { + index = e.getAttribute('data-file-index'); window.location.replace( thisUrl+'?view='+currentView+'&eid='+eventId+'&downloadIndex='+index ); } @@ -21,7 +23,8 @@ function generateVideoResponse( respObj, respText ) { window.location.replace( thisUrl+'?view='+currentView+'&eid='+eventId+'&generated='+((respObj.result=='Ok')?1:0) ); } -function generateVideo( form ) { +function generateVideo( ) { + form = $j('#contentForm')[0]; var parms = 'view=request&request=event&action=video'; parms += '&'+$(form).toQueryString(); var query = new Request.JSON( {url: thisUrl, method: 'post', data: parms, onSuccess: generateVideoResponse} ); diff --git a/web/skins/classic/views/js/video.js.php b/web/skins/classic/views/js/video.js.php index cd12fef7b..0ee2214f5 100644 --- a/web/skins/classic/views/js/video.js.php +++ b/web/skins/classic/views/js/video.js.php @@ -1,4 +1,4 @@ -var eventId = ''; +var eventId = 'Id() ?>'; var videoGenSuccessString = ''; var videoGenFailedString = ''; diff --git a/web/skins/classic/views/video.php b/web/skins/classic/views/video.php index ca4c46f4b..f2099a445 100644 --- a/web/skins/classic/views/video.php +++ b/web/skins/classic/views/video.php @@ -27,27 +27,25 @@ require_once('includes/Event.php'); $eid = validInt($_REQUEST['eid']); -$sql = 'SELECT E.*,M.Name AS MonitorName,M.DefaultRate,M.DefaultScale FROM Events AS E INNER JOIN Monitors AS M ON E.MonitorId = M.Id WHERE E.Id = ?'; -$sql_values = array($eid); +$event = new ZM\Event($eid); -if ( $user['MonitorIds'] ) { - $monitor_ids = explode(',', $user['MonitorIds']); - $sql .= ' AND MonitorId IN ('.implode(',', array_fill(0,count($monitor_ids),'?')).')'; - $sql_values = array_merge($sql_values, $monitor_ids); +if ( ! canView('Monitors', $event->MonitorId() ) ) { + $view = 'error'; + return; } -$event = dbFetchOne($sql, NULL, $sql_values); +$monitor = $event->Monitor(); if ( isset($_REQUEST['rate']) ) $rate = validInt($_REQUEST['rate']); else - $rate = reScale(RATE_BASE, $event['DefaultRate'], ZM_WEB_DEFAULT_RATE); + $rate = reScale(RATE_BASE, $monitor->DefaultRate(), ZM_WEB_DEFAULT_RATE); + if ( isset($_REQUEST['scale']) ) $scale = validInt($_REQUEST['scale']); else - $scale = reScale(SCALE_BASE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE); + $scale = reScale(SCALE_BASE, $monitor->DefaultScale(), ZM_WEB_DEFAULT_SCALE); -$Event = new ZM\Event($event['Id']); -$eventPath = $Event->Path(); +$event_path = $event->Path(); $videoFormats = array(); $ffmpegFormats = preg_split('/\s+/', ZM_FFMPEG_FORMATS); @@ -63,9 +61,9 @@ foreach ( $ffmpegFormats as $ffmpegFormat ) { } $videoFiles = array(); -if ( $dir = opendir($eventPath) ) { +if ( $dir = opendir($event_path) ) { while ( ($file = readdir($dir)) !== false ) { - $file = $eventPath.'/'.$file; + $file = $event_path.'/'.$file; if ( is_file($file) ) { if ( preg_match('/\.(?:'.join('|', $videoFormats).')$/', $file) ) { $videoFiles[] = $file; @@ -85,6 +83,7 @@ if ( isset($_REQUEST['downloadIndex']) ) { // can't be output buffering, as this file might be large ob_end_clean(); $downloadIndex = validInt($_REQUEST['downloadIndex']); + ZM\Error("Download $downloadIndex, file: " . $videoFiles[$downloadIndex]); header('Pragma: public'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); @@ -124,7 +123,7 @@ if ( isset($_REQUEST['showIndex']) ) { } else { ?>
- + @@ -145,7 +144,9 @@ if ( isset($_REQUEST['showIndex']) ) {
- disabled="disabled"/> +
Width(), $scale):$event->Width(); + $height = $scale?reScale($event->Height(), $scale):$event->Height(); ?> -  /  /  + + Id().'&width='.$width.'&height='.$height.'&showIndex='.$index, 'zmVideo'.$event->Id().'-'.$scale, array('videoview', $width, $height), translate('View') ); ?> +  /  + +  /  + +