From 0c2edfef4a5fda8b99a571dc939e0be341c1258a Mon Sep 17 00:00:00 2001 From: stan Date: Mon, 1 Sep 2008 14:03:52 +0000 Subject: [PATCH] Corrected selection of LinkedMonitors. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2619 e3e1d417-86f3-4887-817a-d78f3d33393f --- web/skins/classic/views/js/monitor.js.php | 12 ++++++++++++ web/skins/classic/views/monitor.php | 7 ++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/web/skins/classic/views/js/monitor.js.php b/web/skins/classic/views/js/monitor.js.php index 0310a5348..bca3e12c6 100644 --- a/web/skins/classic/views/js/monitor.js.php +++ b/web/skins/classic/views/js/monitor.js.php @@ -104,6 +104,18 @@ function validateForm( form ) errors[errors.length] = ""; if ( !form.elements['newMonitor[WebColour]'].value || !form.elements['newMonitor[WebColour]'].value.match( /^[#0-9a-zA-Z]+$/ ) ) errors[errors.length] = ""; + + if ( form.elements['monitorIds'] ) + { + var monitorIds = new Array(); + for ( var i = 0; i < form.elements['monitorIds'].options.length; i++ ) + { + if ( form.elements['monitorIds'].options[i].selected ) + monitorIds[monitorIds.length] = form.elements['monitorIds'].options[i].value; + } + form.elements['newMonitor[LinkedMonitors]'].value = monitorIds.join( ',' ); + } + if ( errors.length ) { alert( errors.join( "\n" ) ); diff --git a/web/skins/classic/views/monitor.php b/web/skins/classic/views/monitor.php index b0740c1db..8fc86bfcd 100644 --- a/web/skins/classic/views/monitor.php +++ b/web/skins/classic/views/monitor.php @@ -249,6 +249,7 @@ foreach ( $tabs as $name=>$value ) + "/> - + @@ -390,7 +391,7 @@ switch ( $_REQUEST['tab'] ) -