From: Joey Schulze Date: Thu, 4 Mar 2010 21:12:59 +0000 (+0100) Subject: Handle hidden fields as if they were integers X-Git-Tag: 2010-06-02_customer~122 X-Git-Url: https://git.infodrom.org/?p=misc%2Fkostenrechnung;a=commitdiff_plain;h=800b3855b079520a13bea7c5f4c24cfbfaba5c6e;ds=sidebyside Handle hidden fields as if they were integers This might be adjusted when other values than references are stored --- diff --git a/ajax/ajax.php b/ajax/ajax.php index 9a491c8..4ab5aa2 100644 --- a/ajax/ajax.php +++ b/ajax/ajax.php @@ -80,7 +80,7 @@ function save($mask) if ($info['type'] == 'boolean') { $update[] = sprintf("%s=%d", $field, $_POST[$field] == 'on'?1:0); - } elseif ($info['type'] == 'number' || ($info['type'] == 'select' && $info['options_string'] !== true)) { + } elseif ($info['type'] == 'number' || $info['type'] == 'hidden' || ($info['type'] == 'select' && $info['options_string'] !== true)) { if (empty($_POST[$field]) && $info['null'] === true) $update[] = sprintf("%s=NULL", $field); else @@ -129,7 +129,7 @@ function insert($mask) if ($info['type'] == 'boolean') { $fields[] = $field; $values[] = $_POST[$field] == 'on'?1:0; - } elseif ($info['type'] == 'number' || ($info['type'] == 'select' && $info['options_string'] !== true)) { + } elseif ($info['type'] == 'number' || $info['type'] == 'hidden' || ($info['type'] == 'select' && $info['options_string'] !== true)) { $fields[] = $field; if (empty($_POST[$field]) && $info['null'] === true) $values[] = 'NULL';