From d406d9549c3aea1819846c22d392a230b2b0d3d1 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 22 Aug 2017 09:47:30 -0400 Subject: [PATCH 01/12] use int instead of unsigned int. Google code style says it's right, and it gets rid of a comparison warning --- src/zm_video.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/zm_video.cpp b/src/zm_video.cpp index 7f88fa1ef..369819098 100644 --- a/src/zm_video.cpp +++ b/src/zm_video.cpp @@ -155,7 +155,7 @@ int X264MP4Writer::Open() { } /* Search SPS NAL for AVC information */ - for ( unsigned int i = 0; i < i_nals; i++ ) { + for ( int i = 0; i < i_nals; i++ ) { if ( nals[i].i_type == NAL_SPS ) { x264_profleindication = nals[i].p_payload[5]; x264_profilecompat = nals[i].p_payload[6]; @@ -467,7 +467,7 @@ void X264MP4Writer::x264encodeloop(bool bFlush) { /* Got a frame. Copy this new frame into the previous frame */ if ( frame_size > 0 ) { /* Copy the NALs and the payloads */ - for ( unsigned int i = 0; i < i_nals; i++ ) { + for ( int i = 0; i < i_nals; i++ ) { prevnals.push_back(nals[i]); prevpayload.append(nals[i].p_payload, nals[i].i_payload); } From a8cf384be931d7ed34ee233b27b42471644f169e Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Wed, 23 Aug 2017 08:48:11 -0500 Subject: [PATCH 02/12] rpm spcfile change use %{_buildshell} macro rather than hard code path to shell interpreter --- distros/redhat/zoneminder.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distros/redhat/zoneminder.spec b/distros/redhat/zoneminder.spec index d56c0cc21..fc6a0c7ab 100644 --- a/distros/redhat/zoneminder.spec +++ b/distros/redhat/zoneminder.spec @@ -166,7 +166,7 @@ too much degradation of performance. find %{buildroot} \( -name .htaccess -or -name .editorconfig -or -name .packlist -or -name .git -or -name .gitignore -or -name .gitattributes -or -name .travis.yml \) -type f -delete > /dev/null 2>&1 || : # Recursively change shebang in all relevant scripts and set execute permission -find %{buildroot}%{_datadir}/zoneminder/www/api \( -name cake -or -name cake.php \) -type f -exec sed -i 's\^#!/usr/bin/env bash$\#!/usr/bin/bash\' {} \; -exec %{__chmod} 755 {} \; +find %{buildroot}%{_datadir}/zoneminder/www/api \( -name cake -or -name cake.php \) -type f -exec sed -i 's\^#!/usr/bin/env bash$\#!%{_buildshell}\' {} \; -exec %{__chmod} 755 {} \; # Use the system cacert file rather then the one bundled with CakePHP %{__rm} -f %{buildroot}%{_datadir}/zoneminder/www/api/lib/Cake/Config/cacert.pem From a5079f205e8451b437d186098cd66a5a7bbe1b11 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 25 Aug 2017 15:35:17 -0400 Subject: [PATCH 03/12] add Manufacturers and Models Tables --- db/zm_create.sql.in | 25 ++++++++++++++++++++++++ db/zm_update-1.31.4.sql | 42 +++++++++++++++++++++++++++++++++++++++++ version | 2 +- 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 db/zm_update-1.31.4.sql diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index 0be21766b..659981407 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -286,6 +286,31 @@ CREATE TABLE `Logs` ( KEY `TimeKey` (`TimeKey`) ) ENGINE=@ZM_MYSQL_ENGINE@; +-- +-- Table structure for table `Manufacturers` +-- + +DROP TABLE IF EXISTS `Manufacturers`; +CREATE TABLE `Manufacturers` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL, + PRIMARY KEY (`Id`), + UNIQUE KEY (`Name`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `Models` +-- + +DROP TABLE IF EXISTS `Models`; +CREATE TABLE `Models` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL, + `ManufacturerId` int(10), + PRIMARY KEY (`Id`), + UNIQUE KEY (`ManufacturerId`,`Name`) +) ENGINE=@ZM_MYSQL_ENGINE@; + -- -- Table structure for table `MonitorPresets` -- diff --git a/db/zm_update-1.31.4.sql b/db/zm_update-1.31.4.sql new file mode 100644 index 000000000..cebe2b4a3 --- /dev/null +++ b/db/zm_update-1.31.4.sql @@ -0,0 +1,42 @@ +-- +-- This adds Manufacturers and Models +-- + +SET @s = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.TABLES + WHERE table_name = 'Manufacturers' + AND table_schema = DATABASE() + ) > 0, + "SELECT 'Manufacturers table exists'", + " + CREATE TABLE `Manufacturers` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL, + PRIMARY KEY (`Id`), + UNIQUE KEY (`Name`) + )" + )); + +PREPARE stmt FROM @s; +EXECUTE stmt; + +SET @s = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.TABLES + WHERE table_name = 'Models' + AND table_schema = DATABASE() + ) > 0, + "SELECT 'Models table exists'", + "CREATE TABLE `Models` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL, + `ManufacturerId` int(10), + PRIMARY KEY (`Id`), + UNIQUE KEY (`ManufacturerId`,`Name`) + )" +)); + +PREPARE stmt FROM @s; +EXECUTE stmt; + diff --git a/version b/version index d7f92f588..cca52685e 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.31.3 +1.31.4 From 35c23f5fcf1901899e75e670a648033483559fbe Mon Sep 17 00:00:00 2001 From: Stefano Probst Date: Sat, 26 Aug 2017 17:16:17 +0200 Subject: [PATCH 04/12] Add zip package to the docker image. Fix #1974 Otherwise no export of a event as ZIP file is possible. --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 964570928..08bfd406e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -58,6 +58,7 @@ RUN apt-get update \ php-mysql \ vlc-data \ yasm \ + zip \ && rm -rf /var/lib/apt/lists/* # Copy local code into our container From 7d2453e7ac7008031d446ab66507f551c3640b7d Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 4 Sep 2017 15:28:23 -0400 Subject: [PATCH 05/12] fix google code style --- src/zmc.cpp | 121 ++++++++++++++++++++++++++-------------------------- 1 file changed, 60 insertions(+), 61 deletions(-) diff --git a/src/zmc.cpp b/src/zmc.cpp index 5915d4ef5..487ddbe29 100644 --- a/src/zmc.cpp +++ b/src/zmc.cpp @@ -72,25 +72,25 @@ possible, this should run at more or less constant speed. #include "zm_monitor.h" void Usage() { - fprintf( stderr, "zmc -d or -r -H -P -p or -f or -m \n" ); + fprintf(stderr, "zmc -d or -r -H -P -p or -f or -m \n"); - fprintf( stderr, "Options:\n" ); + fprintf(stderr, "Options:\n"); #if defined(BSD) - fprintf( stderr, " -d, --device : For local cameras, device to access. E.g /dev/bktr0 etc\n" ); + fprintf(stderr, " -d, --device : For local cameras, device to access. E.g /dev/bktr0 etc\n"); #else - fprintf( stderr, " -d, --device : For local cameras, device to access. E.g /dev/video0 etc\n" ); + fprintf(stderr, " -d, --device : For local cameras, device to access. E.g /dev/video0 etc\n"); #endif - fprintf( stderr, " -f, --file : For local images, jpg file to access.\n" ); - fprintf( stderr, " -m, --monitor : For sources associated with a single monitor\n" ); - fprintf( stderr, " -h, --help : This screen\n" ); - fprintf( stderr, " -v, --version : Report the installed version of ZoneMinder\n" ); - exit( 0 ); + fprintf(stderr, " -f, --file : For local images, jpg file to access.\n"); + fprintf(stderr, " -m, --monitor : For sources associated with a single monitor\n"); + fprintf(stderr, " -h, --help : This screen\n"); + fprintf(stderr, " -v, --version : Report the installed version of ZoneMinder\n"); + exit(0); } -int main( int argc, char *argv[] ) { +int main(int argc, char *argv[]) { self = argv[0]; - srand( getpid() * time( 0 ) ); + srand(getpid() * time(0)); const char *device = ""; const char *protocol = ""; @@ -116,13 +116,12 @@ int main( int argc, char *argv[] ) { while (1) { int option_index = 0; - int c = getopt_long (argc, argv, "d:H:P:p:f:m:h:v", long_options, &option_index); - if (c == -1) { + int c = getopt_long(argc, argv, "d:H:P:p:f:m:h:v", long_options, &option_index); + if ( c == -1 ) { break; } - switch (c) - { + switch (c) { case 'd': device = optarg; break; @@ -154,61 +153,61 @@ int main( int argc, char *argv[] ) { } } - if (optind < argc) { - fprintf( stderr, "Extraneous options, " ); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); + if ( optind < argc ) { + fprintf(stderr, "Extraneous options, "); + while ( optind < argc ) + printf("%s ", argv[optind++]); + printf("\n"); Usage(); } - int modes = ( device[0]?1:0 + host[0]?1:0 + file[0]?1:0 + (monitor_id>0?1:0) ); + int modes = (device[0]?1:0 + host[0]?1:0 + file[0]?1:0 + (monitor_id > 0 ? 1 : 0)); if ( modes > 1 ) { - fprintf( stderr, "Only one of device, host/port/path, file or monitor id allowed\n" ); + fprintf(stderr, "Only one of device, host/port/path, file or monitor id allowed\n"); Usage(); - exit( 0 ); + exit(0); } if ( modes < 1 ) { - fprintf( stderr, "One of device, host/port/path, file or monitor id must be specified\n" ); + fprintf(stderr, "One of device, host/port/path, file or monitor id must be specified\n"); Usage(); - exit( 0 ); + exit(0); } char log_id_string[32] = ""; if ( device[0] ) { - const char *slash_ptr = strrchr( device, '/' ); - snprintf( log_id_string, sizeof(log_id_string), "zmc_d%s", slash_ptr?slash_ptr+1:device ); + const char *slash_ptr = strrchr(device, '/'); + snprintf(log_id_string, sizeof(log_id_string), "zmc_d%s", slash_ptr?slash_ptr+1:device); } else if ( host[0] ) { - snprintf( log_id_string, sizeof(log_id_string), "zmc_h%s", host ); + snprintf(log_id_string, sizeof(log_id_string), "zmc_h%s", host); } else if ( file[0] ) { - const char *slash_ptr = strrchr( file, '/' ); - snprintf( log_id_string, sizeof(log_id_string), "zmc_f%s", slash_ptr?slash_ptr+1:file ); + const char *slash_ptr = strrchr(file, '/'); + snprintf(log_id_string, sizeof(log_id_string), "zmc_f%s", slash_ptr?slash_ptr+1:file); } else { - snprintf( log_id_string, sizeof(log_id_string), "zmc_m%d", monitor_id ); + snprintf(log_id_string, sizeof(log_id_string), "zmc_m%d", monitor_id); } zmLoadConfig(); - logInit( log_id_string ); - + logInit(log_id_string); + hwcaps_detect(); Monitor **monitors = 0; int n_monitors = 0; #if ZM_HAS_V4L if ( device[0] ) { - n_monitors = Monitor::LoadLocalMonitors( device, monitors, Monitor::CAPTURE ); + n_monitors = Monitor::LoadLocalMonitors(device, monitors, Monitor::CAPTURE); } else #endif // ZM_HAS_V4L if ( host[0] ) { if ( !port ) port = "80"; - n_monitors = Monitor::LoadRemoteMonitors( protocol, host, port, path, monitors, Monitor::CAPTURE ); + n_monitors = Monitor::LoadRemoteMonitors(protocol, host, port, path, monitors, Monitor::CAPTURE); } else if ( file[0] ) { - n_monitors = Monitor::LoadFileMonitors( file, monitors, Monitor::CAPTURE ); + n_monitors = Monitor::LoadFileMonitors(file, monitors, Monitor::CAPTURE); } else { - Monitor *monitor = Monitor::Load( monitor_id, true, Monitor::CAPTURE ); + Monitor *monitor = Monitor::Load(monitor_id, true, Monitor::CAPTURE); if ( monitor ) { monitors = new Monitor *[1]; monitors[0] = monitor; @@ -217,25 +216,25 @@ int main( int argc, char *argv[] ) { } if ( !n_monitors ) { - Error( "No monitors found" ); - exit ( -1 ); + Error("No monitors found"); + exit(-1); } - Info( "Starting Capture version %s", ZM_VERSION ); + Info("Starting Capture version %s", ZM_VERSION); zmSetDefaultTermHandler(); zmSetDefaultDieHandler(); sigset_t block_set; - sigemptyset( &block_set ); + sigemptyset(&block_set); - sigaddset( &block_set, SIGUSR1 ); - sigaddset( &block_set, SIGUSR2 ); + sigaddset(&block_set, SIGUSR1); + sigaddset(&block_set, SIGUSR2); - monitors[0]->setStartupTime( (time_t)time(NULL) ); + monitors[0]->setStartupTime((time_t)time(NULL)); if ( monitors[0]->PrimeCapture() < 0 ) { - Error( "Failed to prime capture of initial monitor" ); - exit( -1 ); + Error("Failed to prime capture of initial monitor"); + exit(-1); } long *capture_delays = new long[n_monitors]; @@ -251,15 +250,15 @@ int main( int argc, char *argv[] ) { int result = 0; struct timeval now; struct DeltaTimeval delta_time; - while( !zm_terminate ) { - sigprocmask( SIG_BLOCK, &block_set, 0 ); + while ( !zm_terminate ) { + sigprocmask(SIG_BLOCK, &block_set, 0); for ( int i = 0; i < n_monitors; i++ ) { long min_delay = MAXINT; - gettimeofday( &now, NULL ); + gettimeofday(&now, NULL); for ( int j = 0; j < n_monitors; j++ ) { if ( last_capture_times[j].tv_sec ) { - DELTA_TIMEVAL( delta_time, now, last_capture_times[j], DT_PREC_3 ); + DELTA_TIMEVAL(delta_time, now, last_capture_times[j], DT_PREC_3); if ( monitors[i]->GetState() == Monitor::ALARM ) next_delays[j] = alarm_capture_delays[j]-delta_time.delta; else @@ -276,38 +275,38 @@ int main( int argc, char *argv[] ) { if ( next_delays[i] <= min_delay || next_delays[i] <= 0 ) { if ( monitors[i]->PreCapture() < 0 ) { - Error( "Failed to pre-capture monitor %d %d (%d/%d)", monitors[i]->Id(), monitors[i]->Name(), i+1, n_monitors ); + Error("Failed to pre-capture monitor %d %d (%d/%d)", monitors[i]->Id(), monitors[i]->Name(), i+1, n_monitors); zm_terminate = true; result = -1; break; } if ( monitors[i]->Capture() < 0 ) { - Error( "Failed to capture image from monitor %d %s (%d/%d)", monitors[i]->Id(), monitors[i]->Name(), i+1, n_monitors ); + Error("Failed to capture image from monitor %d %s (%d/%d)", monitors[i]->Id(), monitors[i]->Name(), i+1, n_monitors); zm_terminate = true; result = -1; break; } if ( monitors[i]->PostCapture() < 0 ) { - Error( "Failed to post-capture monitor %d %s (%d/%d)", monitors[i]->Id(), monitors[i]->Name(), i+1, n_monitors ); + Error("Failed to post-capture monitor %d %s (%d/%d)", monitors[i]->Id(), monitors[i]->Name(), i+1, n_monitors); zm_terminate = true; result = -1; break; } if ( next_delays[i] > 0 ) { - gettimeofday( &now, NULL ); - DELTA_TIMEVAL( delta_time, now, last_capture_times[i], DT_PREC_3 ); + gettimeofday(&now, NULL); + DELTA_TIMEVAL(delta_time, now, last_capture_times[i], DT_PREC_3); long sleep_time = next_delays[i]-delta_time.delta; if ( sleep_time > 0 ) { - usleep( sleep_time*(DT_MAXGRAN/DT_PREC_3) ); + usleep(sleep_time*(DT_MAXGRAN/DT_PREC_3)); } } - gettimeofday( &(last_capture_times[i]), NULL ); - } // end if next_delay <= min_delay || next_delays[i] <= 0 ) + gettimeofday(&(last_capture_times[i]), NULL); + } // end if next_delay <= min_delay || next_delays[i] <= 0 ) - } // end foreach n_monitors - sigprocmask( SIG_UNBLOCK, &block_set, 0 ); - } // end while ! zm_terminate + } // end foreach n_monitors + sigprocmask(SIG_UNBLOCK, &block_set, 0); + } // end while ! zm_terminate for ( int i = 0; i < n_monitors; i++ ) { delete monitors[i]; } From b56aafb16d73e3b18cdb735710352acbecba9bcd Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Mon, 4 Sep 2017 17:41:11 -0500 Subject: [PATCH 06/12] Update .travis.yml we can now build fedora 26 armhfp rpms using the container I built and hosted on hub.docker.com --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 08e086955..4a16b7eaa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,6 +30,7 @@ env: - OS=el DIST=7 - OS=fedora DIST=25 - OS=fedora DIST=26 DOCKER_REPO=knnniggett/packpack + - OS=fedora DIST=26 ARCH=armhf DOCKER_REPO=knnniggett/packpack - OS=ubuntu DIST=trusty - OS=ubuntu DIST=xenial - OS=ubuntu DIST=trusty ARCH=i386 From 9021d1203d4ba0c4a5896ab244419c4e4228ebf1 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Mon, 4 Sep 2017 19:39:09 -0500 Subject: [PATCH 07/12] Update .travis.yml we can now build fedora 25 armhfp rpms using the container I built and hosted on hub.docker.com --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 4a16b7eaa..d9f0b7eb0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,6 +29,7 @@ env: - OS=el DIST=6 ARCH=i386 DOCKER_REPO=knnniggett/packpack - OS=el DIST=7 - OS=fedora DIST=25 + - OS=fedora DIST=25 ARCH=armhf DOCKER_REPO=knnniggett/packpack - OS=fedora DIST=26 DOCKER_REPO=knnniggett/packpack - OS=fedora DIST=26 ARCH=armhf DOCKER_REPO=knnniggett/packpack - OS=ubuntu DIST=trusty From ab4eb14127a144b7de5c6cc743dae43187ae964c Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Mon, 4 Sep 2017 20:12:12 -0500 Subject: [PATCH 08/12] Update .travis.yml arm containers require arm architecture. --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index d9f0b7eb0..08e086955 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,9 +29,7 @@ env: - OS=el DIST=6 ARCH=i386 DOCKER_REPO=knnniggett/packpack - OS=el DIST=7 - OS=fedora DIST=25 - - OS=fedora DIST=25 ARCH=armhf DOCKER_REPO=knnniggett/packpack - OS=fedora DIST=26 DOCKER_REPO=knnniggett/packpack - - OS=fedora DIST=26 ARCH=armhf DOCKER_REPO=knnniggett/packpack - OS=ubuntu DIST=trusty - OS=ubuntu DIST=xenial - OS=ubuntu DIST=trusty ARCH=i386 From 42263bf39a2809a75e0acf7d0b3d79bd45b3f949 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 8 Sep 2017 12:29:10 -0400 Subject: [PATCH 09/12] pass mode when getting mp4 download link --- web/skins/classic/views/event.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/skins/classic/views/event.php b/web/skins/classic/views/event.php index 1498dcc8f..11458380e 100644 --- a/web/skins/classic/views/event.php +++ b/web/skins/classic/views/event.php @@ -135,7 +135,7 @@ if ( canEdit( 'Events' ) ) { DefaultVideo() ) { ?> - + DefaultVideo ?> From 58a9107675f6602ec78cc17ae8f6a0a22848027c Mon Sep 17 00:00:00 2001 From: ralimi Date: Sun, 10 Sep 2017 08:49:53 -0700 Subject: [PATCH 10/12] Fix incorrect links to transparent.png and index.php (#1982) * Fix install location for config files when building to alternate directory. With the previous code, we ended up with a directory structure like the following: $ find /etc/zm/conf.d/ /etc/zm/conf.d/ /etc/zm/conf.d/01-system-paths.conf /etc/zm/conf.d/conf.d /etc/zm/conf.d/conf.d/README /etc/zm/conf.d/conf.d/02-multiserver.conf * Omitted README file that should have appeared in /etc/zm/conf.d * Fix location for configs when building to alternate directory. * Fix works, but this should go on a branch instead. * Fix works, but this should go on a branch instead. * Fix location for configs when building to alternate directory. With the previous code, we ended up with a directory structure like the following: $ find /etc/zm/conf.d/ /etc/zm/conf.d/ /etc/zm/conf.d/01-system-paths.conf /etc/zm/conf.d/conf.d /etc/zm/conf.d/conf.d/README /etc/zm/conf.d/conf.d/02-multiserver.conf * Remove double quotes. This is a list of paths. * Allow SSL database connection to be secured with SSL. * Fix incorrect variable name * Fix PHP syntax errors * SSL connection parameters must also be passed in API. * Fix links pointing at transparent.gif * Use relative path to index.php instead of absolute. The installation may not be rooted at / on the server. --- web/skins/classic/views/event.php | 2 +- web/skins/classic/views/js/event.js | 2 +- web/skins/classic/views/js/timeline.js | 2 +- web/skins/classic/views/timeline.php | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/web/skins/classic/views/event.php b/web/skins/classic/views/event.php index 3c9905d21..45142246e 100644 --- a/web/skins/classic/views/event.php +++ b/web/skins/classic/views/event.php @@ -216,7 +216,7 @@ if ( ZM_WEB_STREAM_METHOD == 'mpeg' && ZM_MPEG_LIVE_FORMAT ) {
- +
diff --git a/web/skins/classic/views/js/event.js b/web/skins/classic/views/js/event.js index 8ce90d03e..25f8ae1dc 100644 --- a/web/skins/classic/views/js/event.js +++ b/web/skins/classic/views/js/event.js @@ -449,7 +449,7 @@ function checkFrames( eventId, frameId, loadImage ) { for ( var fid = loFid; fid <= hiFid; fid++ ) { if ( !$('eventThumb'+fid) ) { - var img = new Element( 'img', { 'id': 'eventThumb'+fid, 'src': 'graphics/transparent.gif', 'alt': fid, 'class': 'placeholder' } ); + var img = new Element( 'img', { 'id': 'eventThumb'+fid, 'src': 'graphics/transparent.png', 'alt': fid, 'class': 'placeholder' } ); img.addEvent( 'click', function() { eventData['frames'][fid] = null; checkFrames( eventId, fid ); } ); frameQuery( eventId, fid, loadImage && (fid == frameId) ); var imgs = $('eventThumbs').getElements( 'img' ); diff --git a/web/skins/classic/views/js/timeline.js b/web/skins/classic/views/js/timeline.js index 8210aa9e3..0c37f0284 100644 --- a/web/skins/classic/views/js/timeline.js +++ b/web/skins/classic/views/js/timeline.js @@ -94,7 +94,7 @@ function previewEvent( eventId, frameId ) { if ( event['frames'] ) { if ( event['frames'][frameId] ) { showEventDetail( event['frames'][frameId]['html'] ); - var imagePath = '/index.php?view=image&eid='+eventId+'&fid='+frameId; + var imagePath = 'index.php?view=image&eid='+eventId+'&fid='+frameId; var videoName = event.DefaultVideo; loadEventImage( imagePath, eventId, frameId, event.Width, event.Height, event.Frames/event.Length, videoName, event.Length, event.StartTime, monitors[event.MonitorId]); return; diff --git a/web/skins/classic/views/timeline.php b/web/skins/classic/views/timeline.php index 581499aff..e0426f7cb 100644 --- a/web/skins/classic/views/timeline.php +++ b/web/skins/classic/views/timeline.php @@ -700,7 +700,7 @@ xhtmlHeaders(__FILE__, translate('Timeline') );
- <?php echo translate('ViewEvent') ?> + <?php echo translate('ViewEvent') ?> - <?php echo $monitors[$monitorId]['Name'] ?> + <?php echo $monitors[$monitorId]['Name'] ?> Date: Mon, 11 Sep 2017 12:27:17 -0500 Subject: [PATCH 11/12] remove checks for empty and just check for true (#1980) Yeah I agree. I think the exists was from pre-object method days. --- web/skins/classic/views/monitor.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/web/skins/classic/views/monitor.php b/web/skins/classic/views/monitor.php index dcc76e662..fae0f4a68 100644 --- a/web/skins/classic/views/monitor.php +++ b/web/skins/classic/views/monitor.php @@ -496,7 +496,7 @@ if ( canEdit( 'Monitors' ) ) { -

- Name()) ?>Id()) ) { ?> (Id()?>)

+

- Name()) ?>Id() ) { ?> (Id()?>)

    @@ -688,19 +688,19 @@ switch ( $tab ) { } ?> - Enabled()) ) { ?> checked="checked"/> + Enabled() ) { ?> checked="checked"/> V4LMultiBuffer() == 0 ? 'checked="checked"' : '' ) ?>/> - V4LMultiBuffer()) ? 'checked="checked"' : '' ) ?>/> + V4LMultiBuffer() ? 'checked="checked"' : '' ) ?>/> @@ -812,7 +812,7 @@ switch ( $tab ) { ?> Protocol(), "updateMethods( this );if(this.value=='rtsp'){\$('RTSPDescribe').setStyle('display','table-row');}else{\$('RTSPDescribe').hide();}" ); ?> Protocol()) || $monitor->Protocol() == 'http' ) { + if ( !$monitor->Protocol() || $monitor->Protocol() == 'http' ) { ?> Method() ); ?> Type() == 'Remote' ) { ?> - Protocol()!= 'rtsp' ) { echo ' style="display:none;"'; } ?>> () RTSPDescribe()) ) { ?> checked="checked"/> + Protocol()!= 'rtsp' ) { echo ' style="display:none;"'; } ?>> () RTSPDescribe() ) { ?> checked="checked"/> - RecordAudio()) ) { ?> checked="checked"/> + RecordAudio() ) { ?> checked="checked"/> - Controllable()) ) { ?> checked="checked"/> + Controllable() ) { ?> checked="checked"/>   - TrackMotion()) ) { ?> checked="checked"/> + TrackMotion() ) { ?> checked="checked"/> translate('None'), @@ -973,7 +973,7 @@ switch ( $tab ) {  () - Exif()) ) { ?> checked="checked"/> + Exif() ) { ?> checked="checked"/> Date: Mon, 11 Sep 2017 17:05:46 -0400 Subject: [PATCH 12/12] always define auth_hash --- web/skins/classic/js/skin.js.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/skins/classic/js/skin.js.php b/web/skins/classic/js/skin.js.php index 87a76b921..d97f7eff7 100644 --- a/web/skins/classic/js/skin.js.php +++ b/web/skins/classic/js/skin.js.php @@ -61,6 +61,7 @@ var focusWindow = ; var imagePrefix = ""; +var auth_hash; -var auth_hash = ''; +auth_hash = '';