Now correctly handles checkboxes in the control view.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1367 e3e1d417-86f3-4887-817a-d78f3d33393fpull/27/merge
parent
5b7f1a2085
commit
e5a90f82f1
|
@ -202,15 +202,18 @@ if ( isset($action) )
|
|||
|
||||
// Define a field type for anything that's not simple text equivalent
|
||||
$types = array(
|
||||
'Triggers' => 'set'
|
||||
'Triggers' => 'set',
|
||||
'Controllable' => 'toggle',
|
||||
);
|
||||
|
||||
$changes = getFormChanges( $monitor, $new_monitor, $types );
|
||||
$columns = getTableColumns( 'Monitors' );
|
||||
$changes = getFormChanges( $monitor, $new_monitor, $types, $columns );
|
||||
|
||||
if ( count( $changes ) )
|
||||
{
|
||||
if ( $mid > 0 )
|
||||
{
|
||||
echo( "update Monitors set ".implode( ", ", $changes )." where Id = '$mid'" );
|
||||
simpleQuery( "update Monitors set ".implode( ", ", $changes )." where Id = '$mid'" );
|
||||
if ( $changes['Name'] )
|
||||
{
|
||||
|
@ -1076,7 +1079,15 @@ if ( isset($action) )
|
|||
// Empty
|
||||
);
|
||||
|
||||
$changes = getFormChanges( $control, $new_control, $types );
|
||||
$columns = getTableColumns( 'Controls' );
|
||||
foreach ( $columns as $name=>$type )
|
||||
{
|
||||
if ( preg_match( '/^(Can|Has)/', $name ) )
|
||||
{
|
||||
$types[$name] = 'toggle';
|
||||
}
|
||||
}
|
||||
$changes = getFormChanges( $control, $new_control, $types, $columns );
|
||||
|
||||
if ( count( $changes ) )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue