From c6351e6fd34b6dc3a5d69325430c57fab53957a4 Mon Sep 17 00:00:00 2001 From: stan Date: Mon, 6 Nov 2006 13:56:44 +0000 Subject: [PATCH] Bug 379 - Controllable monitors can now have control view as the default. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2033 e3e1d417-86f3-4887-817a-d78f3d33393f --- db/zm_update-1.22.2.sql | 5 +++++ web/zm_html_view_monitor.php | 16 +++++++++++++++- web/zm_html_view_watch.php | 5 +++++ web/zm_lang_en_gb.php | 1 + 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/db/zm_update-1.22.2.sql b/db/zm_update-1.22.2.sql index 83d8cd3f7..cb5bdfe34 100644 --- a/db/zm_update-1.22.2.sql +++ b/db/zm_update-1.22.2.sql @@ -12,6 +12,11 @@ alter table Filters add column Background tinyint(1) unsigned not null default 0 -- update Filters set Background = 1 where (AutoArchive = 1 or AutoVideo = 1 or AutoUpload = 1 or AutoEmail = 1 or AutoMessage = 1 or AutoExecute = 1 or AutoDelete = 1); +-- +-- Add default view column into Monitors +-- +alter table Monitors add column DefaultView enum ('Events','Control') not null default 'Events' after ReturnDelay; + -- -- These are optional, but we might as well do it now -- diff --git a/web/zm_html_view_monitor.php b/web/zm_html_view_monitor.php index bbd470cc1..65ab1c6ff 100644 --- a/web/zm_html_view_monitor.php +++ b/web/zm_html_view_monitor.php @@ -99,6 +99,7 @@ else $monitor['AlarmMaxFPS'] = ""; $monitor['FPSReportInterval'] = 1000; $monitor['RefBlendPerc'] = 7; + $monitor['DefaultView'] = 'Events'; $monitor['DefaultRate'] = '100'; $monitor['DefaultScale'] = '100'; $monitor['WebColour'] = 'red'; @@ -112,7 +113,7 @@ if ( !isset( $new_monitor ) ) } if ( !empty($preset) ) { - $result = mysql_query( "select Type, Device, Channel, Format, Host, Port, Path, Width, Height, Palette, MaxFPS, Controllable, ControlId, ControlDevice, ControlAddress, DefaultRate, DefaultScale from MonitorPresets where Id = '$preset'" ); + $result = mysql_query( "select Type, Device, Channel, Format, Host, Port, Path, Width, Height, Palette, MaxFPS, Controllable, ControlId, ControlDevice, ControlAddress, DefaultView, DefaultRate, DefaultScale from MonitorPresets where Id = '$preset'" ); if ( !$result ) die( mysql_error() ); $preset = mysql_fetch_assoc( $result ); @@ -486,6 +487,7 @@ if ( $tab != 'misc' ) + @@ -646,6 +648,18 @@ switch ( $tab ) +        diff --git a/web/zm_html_view_watch.php b/web/zm_html_view_watch.php index 232239ded..ad28a34be 100644 --- a/web/zm_html_view_watch.php +++ b/web/zm_html_view_watch.php @@ -29,6 +29,11 @@ if ( !$result ) $monitor = mysql_fetch_assoc( $result ); mysql_free_result( $result ); +if ( !isset($control) ) +{ + $control = ($monitor['DefaultView'] == 'Control'); +} + if ( !isset($scale) ) $scale = reScale( SCALE_BASE, $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE ); diff --git a/web/zm_lang_en_gb.php b/web/zm_lang_en_gb.php index 0c7b5bb0a..8efe96691 100644 --- a/web/zm_lang_en_gb.php +++ b/web/zm_lang_en_gb.php @@ -229,6 +229,7 @@ $zmSlangDay = 'Day'; $zmSlangDebug = 'Debug'; $zmSlangDefaultRate = 'Default Rate'; $zmSlangDefaultScale = 'Default Scale'; +$zmSlangDefaultView = 'Default View'; $zmSlangDeleteAndNext = 'Delete & Next'; $zmSlangDeleteAndPrev = 'Delete & Prev'; $zmSlangDelete = 'Delete';