Fixed issue with 'set' values.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2793 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
parent
e6530eda40
commit
f512cd91e7
|
@ -767,7 +767,7 @@ function getFormChanges( $values, $newValues, $types=false, $columns=false )
|
|||
}
|
||||
default :
|
||||
{
|
||||
if ( empty($values[$key]) || ($values[$key] != $value) )
|
||||
if ( !isset($values[$key]) || ($values[$key] != $value) )
|
||||
{
|
||||
$changes[$key] = "$key = '".dbEscape($value)."'";
|
||||
}
|
||||
|
@ -777,11 +777,21 @@ function getFormChanges( $values, $newValues, $types=false, $columns=false )
|
|||
}
|
||||
foreach( $values as $key=>$value )
|
||||
{
|
||||
if ( !empty($columns[$key]) && !empty($types[$key]) && $types[$key] == 'toggle' )
|
||||
if ( !empty($columns[$key]) )
|
||||
{
|
||||
if ( !isset($newValues[$key]) && !empty($value) )
|
||||
if ( !empty($types[$key]) )
|
||||
{
|
||||
$changes[$key] = "$key = 0";
|
||||
if ( $types[$key] == 'toggle' )
|
||||
{
|
||||
if ( !isset($newValues[$key]) && !empty($value) )
|
||||
{
|
||||
$changes[$key] = "$key = 0";
|
||||
}
|
||||
}
|
||||
else if ( $types[$key] == 'set' )
|
||||
{
|
||||
$changes[$key] = "$key = ''";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue