diff --git a/web/includes/actions/zone.php b/web/includes/actions/zone.php index 692dcf11d..cc7db0226 100644 --- a/web/includes/actions/zone.php +++ b/web/includes/actions/zone.php @@ -44,7 +44,7 @@ if ( !empty($_REQUEST['mid']) && canEdit('Monitors', $_REQUEST['mid']) ) { $_REQUEST['newZone']['MaxBlobPixels'] = intval(($_REQUEST['newZone']['MaxBlobPixels']*$_REQUEST['newZone']['Area'])/100); } - unset( $_REQUEST['newZone']['Points'] ); + unset($_REQUEST['newZone']['Points']); # convert these fields to integer e.g. NULL -> 0 $types = array( diff --git a/web/skins/classic/views/js/zone.js b/web/skins/classic/views/js/zone.js index cf80e8f03..8ed5d4544 100644 --- a/web/skins/classic/views/js/zone.js +++ b/web/skins/classic/views/js/zone.js @@ -371,8 +371,8 @@ function updateY( index ) { function saveChanges( element ) { var form = element.form; - if ( validateForm( form ) ) { - submitForm( form ); + if ( validateForm(form) ) { + submitForm(form); if ( form.elements['newZone[Type]'].value == 'Privacy' ) { alert( 'Capture process for this monitor will be restarted for the Privacy zone changes to take effect.' ); } diff --git a/web/skins/classic/views/zone.php b/web/skins/classic/views/zone.php index 5f03580f7..ea4ad990c 100644 --- a/web/skins/classic/views/zone.php +++ b/web/skins/classic/views/zone.php @@ -63,7 +63,7 @@ $maxY = $monitor->Height()-1; if ( !isset($newZone) ) { if ( $zid > 0 ) { - $zone = dbFetchOne( 'SELECT * FROM Zones WHERE MonitorId = ? AND Id=?', NULL, array( $monitor->Id(), $zid ) ); + $zone = dbFetchOne('SELECT * FROM Zones WHERE MonitorId = ? AND Id=?', NULL, array($monitor->Id(), $zid)); } else { $zone = array( 'Id' => 0, @@ -98,23 +98,23 @@ if ( !isset($newZone) ) { } # end if new Zone # Ensure Zone fits within the limits of the Monitor -limitPoints( $newZone['Points'], $minX, $minY, $maxX, $maxY ); +limitPoints($newZone['Points'], $minX, $minY, $maxX, $maxY); -ksort( $newZone['Points'], SORT_NUMERIC ); +ksort($newZone['Points'], SORT_NUMERIC); -$newZone['Coords'] = pointsToCoords( $newZone['Points'] ); -$newZone['Area'] = getPolyArea( $newZone['Points'] ); -$newZone['AreaCoords'] = preg_replace( '/\s+/', ',', $newZone['Coords'] ); -$selfIntersecting = isSelfIntersecting( $newZone['Points'] ); +$newZone['Coords'] = pointsToCoords($newZone['Points']); +$newZone['Area'] = getPolyArea($newZone['Points']); +$newZone['AreaCoords'] = preg_replace('/\s+/', ',', $newZone['Coords']); +$selfIntersecting = isSelfIntersecting($newZone['Points']); $focusWindow = true; $connkey = generateConnKey(); $streamSrc = ''; $streamMode = ''; # Have to do this here, because the .js.php references somethings figured out when generating the streamHTML -$StreamHTML = getStreamHTML( $monitor, array('scale'=>$scale) ); +$StreamHTML = getStreamHTML($monitor, array('scale'=>$scale)); -xhtmlHeaders(__FILE__, translate('Zone') ); +xhtmlHeaders(__FILE__, translate('Zone')); ?>
@@ -132,7 +132,7 @@ xhtmlHeaders(__FILE__, translate('Zone') );
- +
@@ -162,7 +162,7 @@ xhtmlHeaders(__FILE__, translate('Zone') ); - + @@ -216,14 +216,14 @@ xhtmlHeaders(__FILE__, translate('Zone') ); Id(), $zone['Id'] ) ); + $other_zones = dbFetchAll('SELECT * FROM Zones WHERE MonitorId = ? AND Id != ?', NULL, array($monitor->Id(), $zone['Id'])); } else { - $other_zones = dbFetchAll( 'SELECT * FROM Zones WHERE MonitorId = ?', NULL, array( $monitor->Id() ) ); + $other_zones = dbFetchAll('SELECT * FROM Zones WHERE MonitorId = ?', NULL, array($monitor->Id())); } -if ( count( $other_zones ) ) { +if ( count($other_zones) ) { $html = ''; - foreach( $other_zones as $other_zone ) { - $other_zone['AreaCoords'] = preg_replace( '/\s+/', ',', $other_zone['Coords'] ); + foreach ( $other_zones as $other_zone ) { + $other_zone['AreaCoords'] = preg_replace('/\s+/', ',', $other_zone['Coords']); $html .= ''; } echo $html; @@ -267,9 +267,11 @@ for ( $i = 0; $i < $pointCols; $i++ ) {
- - disabled="disabled"/> - + + +