From: Joey Schulze Date: Sun, 28 Feb 2010 18:40:41 +0000 (+0100) Subject: Support option values as strings as well X-Git-Tag: 2010-06-02_customer~159 X-Git-Url: https://git.infodrom.org/?p=misc%2Fkostenrechnung;a=commitdiff_plain;h=a18d09c18a7d9b50caeb8c8f9d0905569ba13653;ds=inline Support option values as strings as well --- diff --git a/ajax/ajax.php b/ajax/ajax.php index a5a8a12..5095ca6 100644 --- a/ajax/ajax.php +++ b/ajax/ajax.php @@ -74,7 +74,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') { + } elseif ($info['type'] == 'number' || ($info['type'] == 'select' && $info['options_string'] !== true)) { if (empty($_POST[$field]) && $info['null'] === true) $update[] = sprintf("%s=NULL", $field); else @@ -123,7 +123,7 @@ function insert($mask) if ($info['type'] == 'boolean') { $fields[] = $field; $values[] = $_POST[$field] == 'on'?1:0; - } elseif ($info['type'] == 'number' || $info['type'] == 'select') { + } elseif ($info['type'] == 'number' || ($info['type'] == 'select' && $info['options_string'] !== true)) { $fields[] = $field; if (empty($_POST[$field]) && $info['null'] === true) $values[] = 'NULL'; diff --git a/masks/sys_mask.php b/masks/sys_mask.php index 70707b4..09a9110 100644 --- a/masks/sys_mask.php +++ b/masks/sys_mask.php @@ -82,6 +82,7 @@ $mask = array( 'name' => 'Dateiname', 'type' => 'select', 'options' => discover_masks(), + 'options_string' => true, ), 'title' => array( 'name' => 'Beschreibung',