Merge branch 'storageareas' of github.com:ConnorTechnology/ZoneMinder into storageareas

This commit is contained in:
Isaac Connor 2017-09-12 11:03:16 -04:00
commit 7b1142bee6
12 changed files with 148 additions and 81 deletions

View File

@ -58,6 +58,7 @@ RUN apt-get update \
php-mysql \ php-mysql \
vlc-data \ vlc-data \
yasm \ yasm \
zip \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Copy local code into our container # Copy local code into our container

View File

@ -286,6 +286,31 @@ CREATE TABLE `Logs` (
KEY `TimeKey` (`TimeKey`) KEY `TimeKey` (`TimeKey`)
) ENGINE=@ZM_MYSQL_ENGINE@; ) 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` -- Table structure for table `MonitorPresets`
-- --

42
db/zm_update-1.31.4.sql Normal file
View File

@ -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;

View File

@ -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 || : 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 # 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 # Use the system cacert file rather then the one bundled with CakePHP
%{__rm} -f %{buildroot}%{_datadir}/zoneminder/www/api/lib/Cake/Config/cacert.pem %{__rm} -f %{buildroot}%{_datadir}/zoneminder/www/api/lib/Cake/Config/cacert.pem

View File

@ -72,25 +72,25 @@ possible, this should run at more or less constant speed.
#include "zm_monitor.h" #include "zm_monitor.h"
void Usage() { void Usage() {
fprintf( stderr, "zmc -d <device_path> or -r <proto> -H <host> -P <port> -p <path> or -f <file_path> or -m <monitor_id>\n" ); fprintf(stderr, "zmc -d <device_path> or -r <proto> -H <host> -P <port> -p <path> or -f <file_path> or -m <monitor_id>\n");
fprintf( stderr, "Options:\n" ); fprintf(stderr, "Options:\n");
#if defined(BSD) #if defined(BSD)
fprintf( stderr, " -d, --device <device_path> : For local cameras, device to access. E.g /dev/bktr0 etc\n" ); fprintf(stderr, " -d, --device <device_path> : For local cameras, device to access. E.g /dev/bktr0 etc\n");
#else #else
fprintf( stderr, " -d, --device <device_path> : For local cameras, device to access. E.g /dev/video0 etc\n" ); fprintf(stderr, " -d, --device <device_path> : For local cameras, device to access. E.g /dev/video0 etc\n");
#endif #endif
fprintf( stderr, " -f, --file <file_path> : For local images, jpg file to access.\n" ); fprintf(stderr, " -f, --file <file_path> : For local images, jpg file to access.\n");
fprintf( stderr, " -m, --monitor <monitor_id> : For sources associated with a single monitor\n" ); fprintf(stderr, " -m, --monitor <monitor_id> : For sources associated with a single monitor\n");
fprintf( stderr, " -h, --help : This screen\n" ); fprintf(stderr, " -h, --help : This screen\n");
fprintf( stderr, " -v, --version : Report the installed version of ZoneMinder\n" ); fprintf(stderr, " -v, --version : Report the installed version of ZoneMinder\n");
exit( 0 ); exit(0);
} }
int main( int argc, char *argv[] ) { int main(int argc, char *argv[]) {
self = argv[0]; self = argv[0];
srand( getpid() * time( 0 ) ); srand(getpid() * time(0));
const char *device = ""; const char *device = "";
const char *protocol = ""; const char *protocol = "";
@ -116,13 +116,12 @@ int main( int argc, char *argv[] ) {
while (1) { while (1) {
int option_index = 0; int option_index = 0;
int c = getopt_long (argc, argv, "d:H:P:p:f:m:h:v", long_options, &option_index); int c = getopt_long(argc, argv, "d:H:P:p:f:m:h:v", long_options, &option_index);
if (c == -1) { if ( c == -1 ) {
break; break;
} }
switch (c) switch (c) {
{
case 'd': case 'd':
device = optarg; device = optarg;
break; break;
@ -154,61 +153,61 @@ int main( int argc, char *argv[] ) {
} }
} }
if (optind < argc) { if ( optind < argc ) {
fprintf( stderr, "Extraneous options, " ); fprintf(stderr, "Extraneous options, ");
while (optind < argc) while ( optind < argc )
printf ("%s ", argv[optind++]); printf("%s ", argv[optind++]);
printf ("\n"); printf("\n");
Usage(); 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 ) { 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(); Usage();
exit( 0 ); exit(0);
} }
if ( modes < 1 ) { 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(); Usage();
exit( 0 ); exit(0);
} }
char log_id_string[32] = ""; char log_id_string[32] = "";
if ( device[0] ) { if ( device[0] ) {
const char *slash_ptr = strrchr( device, '/' ); const char *slash_ptr = strrchr(device, '/');
snprintf( log_id_string, sizeof(log_id_string), "zmc_d%s", slash_ptr?slash_ptr+1:device ); snprintf(log_id_string, sizeof(log_id_string), "zmc_d%s", slash_ptr?slash_ptr+1:device);
} else if ( host[0] ) { } 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] ) { } else if ( file[0] ) {
const char *slash_ptr = strrchr( file, '/' ); const char *slash_ptr = strrchr(file, '/');
snprintf( log_id_string, sizeof(log_id_string), "zmc_f%s", slash_ptr?slash_ptr+1:file ); snprintf(log_id_string, sizeof(log_id_string), "zmc_f%s", slash_ptr?slash_ptr+1:file);
} else { } 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(); zmLoadConfig();
logInit( log_id_string ); logInit(log_id_string);
hwcaps_detect(); hwcaps_detect();
Monitor **monitors = 0; Monitor **monitors = 0;
int n_monitors = 0; int n_monitors = 0;
#if ZM_HAS_V4L #if ZM_HAS_V4L
if ( device[0] ) { if ( device[0] ) {
n_monitors = Monitor::LoadLocalMonitors( device, monitors, Monitor::CAPTURE ); n_monitors = Monitor::LoadLocalMonitors(device, monitors, Monitor::CAPTURE);
} else } else
#endif // ZM_HAS_V4L #endif // ZM_HAS_V4L
if ( host[0] ) { if ( host[0] ) {
if ( !port ) if ( !port )
port = "80"; 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] ) { } else if ( file[0] ) {
n_monitors = Monitor::LoadFileMonitors( file, monitors, Monitor::CAPTURE ); n_monitors = Monitor::LoadFileMonitors(file, monitors, Monitor::CAPTURE);
} else { } else {
Monitor *monitor = Monitor::Load( monitor_id, true, Monitor::CAPTURE ); Monitor *monitor = Monitor::Load(monitor_id, true, Monitor::CAPTURE);
if ( monitor ) { if ( monitor ) {
monitors = new Monitor *[1]; monitors = new Monitor *[1];
monitors[0] = monitor; monitors[0] = monitor;
@ -217,25 +216,25 @@ int main( int argc, char *argv[] ) {
} }
if ( !n_monitors ) { if ( !n_monitors ) {
Error( "No monitors found" ); Error("No monitors found");
exit ( -1 ); exit(-1);
} }
Info( "Starting Capture version %s", ZM_VERSION ); Info("Starting Capture version %s", ZM_VERSION);
zmSetDefaultTermHandler(); zmSetDefaultTermHandler();
zmSetDefaultDieHandler(); zmSetDefaultDieHandler();
sigset_t block_set; sigset_t block_set;
sigemptyset( &block_set ); sigemptyset(&block_set);
sigaddset( &block_set, SIGUSR1 ); sigaddset(&block_set, SIGUSR1);
sigaddset( &block_set, SIGUSR2 ); sigaddset(&block_set, SIGUSR2);
monitors[0]->setStartupTime( (time_t)time(NULL) ); monitors[0]->setStartupTime((time_t)time(NULL));
if ( monitors[0]->PrimeCapture() < 0 ) { if ( monitors[0]->PrimeCapture() < 0 ) {
Error( "Failed to prime capture of initial monitor" ); Error("Failed to prime capture of initial monitor");
exit( -1 ); exit(-1);
} }
long *capture_delays = new long[n_monitors]; long *capture_delays = new long[n_monitors];
@ -251,15 +250,15 @@ int main( int argc, char *argv[] ) {
int result = 0; int result = 0;
struct timeval now; struct timeval now;
struct DeltaTimeval delta_time; struct DeltaTimeval delta_time;
while( !zm_terminate ) { while ( !zm_terminate ) {
sigprocmask( SIG_BLOCK, &block_set, 0 ); sigprocmask(SIG_BLOCK, &block_set, 0);
for ( int i = 0; i < n_monitors; i++ ) { for ( int i = 0; i < n_monitors; i++ ) {
long min_delay = MAXINT; long min_delay = MAXINT;
gettimeofday( &now, NULL ); gettimeofday(&now, NULL);
for ( int j = 0; j < n_monitors; j++ ) { for ( int j = 0; j < n_monitors; j++ ) {
if ( last_capture_times[j].tv_sec ) { 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 ) if ( monitors[i]->GetState() == Monitor::ALARM )
next_delays[j] = alarm_capture_delays[j]-delta_time.delta; next_delays[j] = alarm_capture_delays[j]-delta_time.delta;
else else
@ -276,38 +275,38 @@ int main( int argc, char *argv[] ) {
if ( next_delays[i] <= min_delay || next_delays[i] <= 0 ) { if ( next_delays[i] <= min_delay || next_delays[i] <= 0 ) {
if ( monitors[i]->PreCapture() < 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; zm_terminate = true;
result = -1; result = -1;
break; break;
} }
if ( monitors[i]->Capture() < 0 ) { 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; zm_terminate = true;
result = -1; result = -1;
break; break;
} }
if ( monitors[i]->PostCapture() < 0 ) { 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; zm_terminate = true;
result = -1; result = -1;
break; break;
} }
if ( next_delays[i] > 0 ) { if ( next_delays[i] > 0 ) {
gettimeofday( &now, NULL ); gettimeofday(&now, NULL);
DELTA_TIMEVAL( delta_time, now, last_capture_times[i], DT_PREC_3 ); DELTA_TIMEVAL(delta_time, now, last_capture_times[i], DT_PREC_3);
long sleep_time = next_delays[i]-delta_time.delta; long sleep_time = next_delays[i]-delta_time.delta;
if ( sleep_time > 0 ) { 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 ); gettimeofday(&(last_capture_times[i]), NULL);
} // end if next_delay <= min_delay || next_delays[i] <= 0 ) } // end if next_delay <= min_delay || next_delays[i] <= 0 )
} // end foreach n_monitors } // end foreach n_monitors
sigprocmask( SIG_UNBLOCK, &block_set, 0 ); sigprocmask(SIG_UNBLOCK, &block_set, 0);
} // end while ! zm_terminate } // end while ! zm_terminate
for ( int i = 0; i < n_monitors; i++ ) { for ( int i = 0; i < n_monitors; i++ ) {
delete monitors[i]; delete monitors[i];
} }

View File

@ -1 +1 @@
1.31.3 1.31.4

View File

@ -61,6 +61,7 @@ var focusWindow = <?php echo !empty($focusWindow)?'true':'false' ?>;
var imagePrefix = "<?php echo viewImagePath( "", '&' ) ?>"; var imagePrefix = "<?php echo viewImagePath( "", '&' ) ?>";
var auth_hash;
<?php if ( ZM_OPT_USE_AUTH && ZM_AUTH_HASH_LOGINS ) { ?> <?php if ( ZM_OPT_USE_AUTH && ZM_AUTH_HASH_LOGINS ) { ?>
var auth_hash = '<?php echo isset($_SESSION['AuthHash']) ? $_SESSION['AuthHash'] : ''; ?>'; auth_hash = '<?php echo isset($_SESSION['AuthHash']) ? $_SESSION['AuthHash'] : ''; ?>';
<?php } ?> <?php } ?>

View File

@ -135,7 +135,7 @@ if ( canEdit( 'Events' ) ) {
<?php <?php
} // end if can edit Events } // end if can edit Events
if ( $Event->DefaultVideo() ) { ?> if ( $Event->DefaultVideo() ) { ?>
<div id="downloadEventFile"><a href="<?php echo $Event->getStreamSrc()?>">Download MP4</a></div> <div id="downloadEventFile"><a href="<?php echo $Event->getStreamSrc(array('mode'=>'mp4'))?>">Download MP4</a></div>
<?php <?php
} // end if Event->DefaultVideo } // end if Event->DefaultVideo
?> ?>
@ -220,7 +220,7 @@ if ( ZM_WEB_STREAM_METHOD == 'mpeg' && ZM_MPEG_LIVE_FORMAT ) {
</div> </div>
<div id="eventImagePanel"> <div id="eventImagePanel">
<div id="eventImageFrame"> <div id="eventImageFrame">
<img id="eventImage" src="graphics/transparent.gif" alt=""/> <img id="eventImage" src="graphics/transparent.png" alt=""/>
<div id="eventImageBar"> <div id="eventImageBar">
<div id="eventImageClose"><input type="button" value="<?php echo translate('Close') ?>" onclick="hideEventImage()"/></div> <div id="eventImageClose"><input type="button" value="<?php echo translate('Close') ?>" onclick="hideEventImage()"/></div>
<div id="eventImageStats" class="hidden"><input type="button" value="<?php echo translate('Stats') ?>" onclick="showFrameStats()"/></div> <div id="eventImageStats" class="hidden"><input type="button" value="<?php echo translate('Stats') ?>" onclick="showFrameStats()"/></div>

View File

@ -455,7 +455,7 @@ function checkFrames( eventId, frameId, loadImage ) {
for ( var fid = loFid; fid <= hiFid; fid++ ) { for ( var fid = loFid; fid <= hiFid; fid++ ) {
if ( !$('eventThumb'+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 ); } ); img.addEvent( 'click', function() { eventData['frames'][fid] = null; checkFrames( eventId, fid ); } );
frameQuery( eventId, fid, loadImage && (fid == frameId) ); frameQuery( eventId, fid, loadImage && (fid == frameId) );
var imgs = $('eventThumbs').getElements( 'img' ); var imgs = $('eventThumbs').getElements( 'img' );

View File

@ -94,7 +94,7 @@ function previewEvent( eventId, frameId ) {
if ( event['frames'] ) { if ( event['frames'] ) {
if ( event['frames'][frameId] ) { if ( event['frames'][frameId] ) {
showEventDetail( event['frames'][frameId]['html'] ); 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; var videoName = event.DefaultVideo;
loadEventImage( imagePath, eventId, frameId, event.Width, event.Height, event.Frames/event.Length, videoName, event.Length, event.StartTime, monitors[event.MonitorId]); loadEventImage( imagePath, eventId, frameId, event.Width, event.Height, event.Frames/event.Length, videoName, event.Length, event.StartTime, monitors[event.MonitorId]);
return; return;

View File

@ -498,7 +498,7 @@ if ( canEdit( 'Monitors' ) ) {
<?php <?php
} // end if canEdit('Monitors') } // end if canEdit('Monitors')
?> ?>
<h2><?php echo translate('Monitor') ?> - <?php echo validHtmlStr($monitor->Name()) ?><?php if ( !empty($monitor->Id()) ) { ?> (<?php echo $monitor->Id()?>)<?php } ?></h2> <h2><?php echo translate('Monitor') ?> - <?php echo validHtmlStr($monitor->Name()) ?><?php if ( $monitor->Id() ) { ?> (<?php echo $monitor->Id()?>)<?php } ?></h2>
</div> </div>
<div id="content"> <div id="content">
<ul class="tabList"> <ul class="tabList">
@ -702,19 +702,19 @@ switch ( $tab ) {
} }
?> ?>
</select></td></tr> </select></td></tr>
<tr><td><?php echo translate('Enabled') ?></td><td><input type="checkbox" name="newMonitor[Enabled]" value="1"<?php if ( !empty($monitor->Enabled()) ) { ?> checked="checked"<?php } ?>/></td></tr> <tr><td><?php echo translate('Enabled') ?></td><td><input type="checkbox" name="newMonitor[Enabled]" value="1"<?php if ( $monitor->Enabled() ) { ?> checked="checked"<?php } ?>/></td></tr>
<tr> <tr>
<td><?php echo translate('LinkedMonitors') ?></td> <td><?php echo translate('LinkedMonitors') ?></td>
<td> <td>
<select name="monitorIds" size="4" multiple="multiple" onchange="updateLinkedMonitors( this )"> <select name="monitorIds" size="4" multiple="multiple" onchange="updateLinkedMonitors( this )">
<?php <?php
$monitors = dbFetchAll( 'select Id,Name from Monitors order by Sequence asc' ); $monitors = dbFetchAll( 'select Id,Name from Monitors order by Sequence asc' );
if ( !empty($monitor->LinkedMonitors()) ) if ( $monitor->LinkedMonitors() )
$monitorIds = array_flip( explode( ',', $monitor->LinkedMonitors()) ); $monitorIds = array_flip( explode( ',', $monitor->LinkedMonitors()) );
else else
$monitorIds = array(); $monitorIds = array();
foreach ( $monitors as $linked_monitor ) { foreach ( $monitors as $linked_monitor ) {
if ( (empty($monitor->Id()) || ($monitor->Id()!= $linked_monitor['Id'])) && visibleMonitor( $linked_monitor['Id'] ) ) { if ( (!$monitor->Id() || ($monitor->Id()!= $linked_monitor['Id'])) && visibleMonitor( $linked_monitor['Id'] ) ) {
?> ?>
<option value="<?php echo $linked_monitor['Id'] ?>"<?php if ( array_key_exists( $linked_monitor['Id'], $monitorIds ) ) { ?> selected="selected"<?php } ?>><?php echo validHtmlStr($linked_monitor['Name']) ?></option> <option value="<?php echo $linked_monitor['Id'] ?>"<?php if ( array_key_exists( $linked_monitor['Id'], $monitorIds ) ) { ?> selected="selected"<?php } ?>><?php echo validHtmlStr($linked_monitor['Name']) ?></option>
<?php <?php
@ -826,7 +826,7 @@ switch ( $tab ) {
?> ?>
<tr><td><?php echo translate('RemoteProtocol') ?></td><td><?php echo htmlSelect( "newMonitor[Protocol]", $remoteProtocols, $monitor->Protocol(), "updateMethods( this );if(this.value=='rtsp'){\$('RTSPDescribe').setStyle('display','table-row');}else{\$('RTSPDescribe').hide();}" ); ?></td></tr> <tr><td><?php echo translate('RemoteProtocol') ?></td><td><?php echo htmlSelect( "newMonitor[Protocol]", $remoteProtocols, $monitor->Protocol(), "updateMethods( this );if(this.value=='rtsp'){\$('RTSPDescribe').setStyle('display','table-row');}else{\$('RTSPDescribe').hide();}" ); ?></td></tr>
<?php <?php
if ( empty($monitor->Protocol()) || $monitor->Protocol() == 'http' ) { if ( !$monitor->Protocol() || $monitor->Protocol() == 'http' ) {
?> ?>
<tr><td><?php echo translate('RemoteMethod') ?></td><td><?php echo htmlSelect( "newMonitor[Method]", $httpMethods, $monitor->Method() ); ?></td></tr> <tr><td><?php echo translate('RemoteMethod') ?></td><td><?php echo htmlSelect( "newMonitor[Method]", $httpMethods, $monitor->Method() ); ?></td></tr>
<?php <?php
@ -877,7 +877,7 @@ switch ( $tab ) {
<?php <?php
if ( $monitor->Type() == 'Remote' ) { if ( $monitor->Type() == 'Remote' ) {
?> ?>
<tr id="RTSPDescribe"<?php if ( $monitor->Protocol()!= 'rtsp' ) { echo ' style="display:none;"'; } ?>><td><?php echo translate('RTSPDescribe') ?>&nbsp;(<?php echo makePopupLink( '?view=optionhelp&amp;option=OPTIONS_RTSPDESCRIBE', 'zmOptionHelp', 'optionhelp', '?' ) ?>) </td><td><input type="checkbox" name="newMonitor[RTSPDescribe]" value="1"<?php if ( !empty($monitor->RTSPDescribe()) ) { ?> checked="checked"<?php } ?>/></td></tr> <tr id="RTSPDescribe"<?php if ( $monitor->Protocol()!= 'rtsp' ) { echo ' style="display:none;"'; } ?>><td><?php echo translate('RTSPDescribe') ?>&nbsp;(<?php echo makePopupLink( '?view=optionhelp&amp;option=OPTIONS_RTSPDESCRIBE', 'zmOptionHelp', 'optionhelp', '?' ) ?>) </td><td><input type="checkbox" name="newMonitor[RTSPDescribe]" value="1"<?php if ( $monitor->RTSPDescribe() ) { ?> checked="checked"<?php } ?>/></td></tr>
<?php <?php
} }
break; break;
@ -887,7 +887,7 @@ switch ( $tab ) {
<tr><td><?php echo translate('SaveJPEGs') ?></td><td><select name="newMonitor[SaveJPEGs]"><?php foreach ( $savejpegopts as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $monitor->SaveJPEGs() ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr> <tr><td><?php echo translate('SaveJPEGs') ?></td><td><select name="newMonitor[SaveJPEGs]"><?php foreach ( $savejpegopts as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $monitor->SaveJPEGs() ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
<tr><td><?php echo translate('VideoWriter') ?></td><td><select name="newMonitor[VideoWriter]"><?php foreach ( $videowriteropts as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $monitor->VideoWriter() ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr> <tr><td><?php echo translate('VideoWriter') ?></td><td><select name="newMonitor[VideoWriter]"><?php foreach ( $videowriteropts as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $monitor->VideoWriter() ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
<tr><td><?php echo translate('OptionalEncoderParam') ?></td><td><textarea name="newMonitor[EncoderParameters]" rows="4" cols="36"><?php echo validHtmlStr($monitor->EncoderParameters()) ?></textarea></td></tr> <tr><td><?php echo translate('OptionalEncoderParam') ?></td><td><textarea name="newMonitor[EncoderParameters]" rows="4" cols="36"><?php echo validHtmlStr($monitor->EncoderParameters()) ?></textarea></td></tr>
<tr><td><?php echo translate('RecordAudio') ?></td><td><input type="checkbox" name="newMonitor[RecordAudio]" value="1"<?php if ( !empty($monitor->RecordAudio()) ) { ?> checked="checked"<?php } ?>/></td></tr> <tr><td><?php echo translate('RecordAudio') ?></td><td><input type="checkbox" name="newMonitor[RecordAudio]" value="1"<?php if ( $monitor->RecordAudio() ) { ?> checked="checked"<?php } ?>/></td></tr>
<?php <?php
break; break;
case 'timestamp' : case 'timestamp' :
@ -915,12 +915,12 @@ switch ( $tab ) {
case 'control' : case 'control' :
{ {
?> ?>
<tr><td><?php echo translate('Controllable') ?></td><td><input type="checkbox" name="newMonitor[Controllable]" value="1"<?php if ( !empty($monitor->Controllable()) ) { ?> checked="checked"<?php } ?>/></td></tr> <tr><td><?php echo translate('Controllable') ?></td><td><input type="checkbox" name="newMonitor[Controllable]" value="1"<?php if ( $monitor->Controllable() ) { ?> checked="checked"<?php } ?>/></td></tr>
<tr><td><?php echo translate('ControlType') ?></td><td><?php echo buildSelect( "newMonitor[ControlId]", $controlTypes, 'loadLocations( this )' ); ?><?php if ( canEdit( 'Control' ) ) { ?>&nbsp;<a href="#" onclick="createPopup( '?view=controlcaps', 'zmControlCaps', 'controlcaps' );"><?php echo translate('Edit') ?></a><?php } ?></td></tr> <tr><td><?php echo translate('ControlType') ?></td><td><?php echo buildSelect( "newMonitor[ControlId]", $controlTypes, 'loadLocations( this )' ); ?><?php if ( canEdit( 'Control' ) ) { ?>&nbsp;<a href="#" onclick="createPopup( '?view=controlcaps', 'zmControlCaps', 'controlcaps' );"><?php echo translate('Edit') ?></a><?php } ?></td></tr>
<tr><td><?php echo translate('ControlDevice') ?></td><td><input type="text" name="newMonitor[ControlDevice]" value="<?php echo validHtmlStr($monitor->ControlDevice()) ?>" size="32"/></td></tr> <tr><td><?php echo translate('ControlDevice') ?></td><td><input type="text" name="newMonitor[ControlDevice]" value="<?php echo validHtmlStr($monitor->ControlDevice()) ?>" size="32"/></td></tr>
<tr><td><?php echo translate('ControlAddress') ?></td><td><input type="text" name="newMonitor[ControlAddress]" value="<?php echo validHtmlStr($monitor->ControlAddress()) ?>" size="32"/></td></tr> <tr><td><?php echo translate('ControlAddress') ?></td><td><input type="text" name="newMonitor[ControlAddress]" value="<?php echo validHtmlStr($monitor->ControlAddress()) ?>" size="32"/></td></tr>
<tr><td><?php echo translate('AutoStopTimeout') ?></td><td><input type="text" name="newMonitor[AutoStopTimeout]" value="<?php echo validHtmlStr($monitor->AutoStopTimeout()) ?>" size="4"/></td></tr> <tr><td><?php echo translate('AutoStopTimeout') ?></td><td><input type="text" name="newMonitor[AutoStopTimeout]" value="<?php echo validHtmlStr($monitor->AutoStopTimeout()) ?>" size="4"/></td></tr>
<tr><td><?php echo translate('TrackMotion') ?></td><td><input type="checkbox" name="newMonitor[TrackMotion]" value="1"<?php if ( !empty($monitor->TrackMotion()) ) { ?> checked="checked"<?php } ?>/></td></tr> <tr><td><?php echo translate('TrackMotion') ?></td><td><input type="checkbox" name="newMonitor[TrackMotion]" value="1"<?php if ( $monitor->TrackMotion() ) { ?> checked="checked"<?php } ?>/></td></tr>
<?php <?php
$return_options = array( $return_options = array(
'-1' => translate('None'), '-1' => translate('None'),
@ -987,7 +987,7 @@ switch ( $tab ) {
</tr> </tr>
<tr> <tr>
<td><?php echo translate('Exif') ?>&nbsp;(<?php echo makePopupLink( '?view=optionhelp&amp;option=OPTIONS_EXIF', 'zmOptionHelp', 'optionhelp', '?' ) ?>) </td> <td><?php echo translate('Exif') ?>&nbsp;(<?php echo makePopupLink( '?view=optionhelp&amp;option=OPTIONS_EXIF', 'zmOptionHelp', 'optionhelp', '?' ) ?>) </td>
<td><input type="checkbox" name="newMonitor[Exif]" value="1"<?php if ( !empty($monitor->Exif()) ) { ?> checked="checked"<?php } ?>/></td> <td><input type="checkbox" name="newMonitor[Exif]" value="1"<?php if ( $monitor->Exif() ) { ?> checked="checked"<?php } ?>/></td>
</tr> </tr>
<?php <?php
break; break;
@ -1000,7 +1000,6 @@ switch ( $tab ) {
<input type="submit" value="<?php echo translate('Save') ?>"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled="disabled"<?php } ?>/> <input type="submit" value="<?php echo translate('Save') ?>"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled="disabled"<?php } ?>/>
<input type="button" value="<?php echo translate('Cancel') ?>" onclick="closeWindow()"/> <input type="button" value="<?php echo translate('Cancel') ?>" onclick="closeWindow()"/>
</div> </div>
</form> </form>
</div> </div>
</div> </div>

View File

@ -710,7 +710,7 @@ xhtmlHeaders(__FILE__, translate('Timeline') );
<div id="topPanel" class="graphWidth"> <div id="topPanel" class="graphWidth">
<div id="imagePanel"> <div id="imagePanel">
<div id="image" class="imageHeight"> <div id="image" class="imageHeight">
<img id="imageSrc" class="imageWidth" src="graphics/transparent.gif" alt="<?php echo translate('ViewEvent') ?>" title="<?php echo translate('ViewEvent') ?>"/> <img id="imageSrc" class="imageWidth" src="graphics/transparent.png" alt="<?php echo translate('ViewEvent') ?>" title="<?php echo translate('ViewEvent') ?>"/>
<?php <?php
if ( 0 ) { if ( 0 ) {
//due to chrome bug, has to enable https://code.google.com/p/chromium/issues/detail?id=472300 //due to chrome bug, has to enable https://code.google.com/p/chromium/issues/detail?id=472300
@ -852,7 +852,7 @@ foreach( array_keys($monEventSlots) as $monitorId ) {
foreach( array_keys($monEventSlots) as $monitorId ) { foreach( array_keys($monEventSlots) as $monitorId ) {
?> ?>
<span class="keyEntry"><?php echo $monitors[$monitorId]['Name'] ?> <span class="keyEntry"><?php echo $monitors[$monitorId]['Name'] ?>
<img id="keyBox<?php echo $monitorId ?>" class="keyBox monitorColour<?php echo $monitorId ?>" src="graphics/transparent.gif" alt="<?php echo $monitors[$monitorId]['Name'] ?>"/> <img id="keyBox<?php echo $monitorId ?>" class="keyBox monitorColour<?php echo $monitorId ?>" src="graphics/transparent.png" alt="<?php echo $monitors[$monitorId]['Name'] ?>"/>
</span> </span>
<?php <?php
} }