Support boolean fields alias checkboxes
authorJoey Schulze <joey@infodrom.org>
Thu, 25 Feb 2010 16:11:09 +0000 (17:11 +0100)
committerJoey Schulze <joey@infodrom.org>
Thu, 25 Feb 2010 16:11:09 +0000 (17:11 +0100)
ajax/ajax.php

index a0580ad..a709a03 100644 (file)
@@ -13,8 +13,10 @@ function fetch($mask)
 
   $row = pg_fetch_assoc($sth);
 
-  foreach ($mask['edit']['list'] as $field => $info)
-    if (array_key_exists('format', $info))
+  foreach ($mask['edit'] as $field => $info)
+    if ($info['type'] == 'boolean')
+      $row[$field] = $row[$field]?true:false;
+    elseif (array_key_exists('format', $info))
       $row[$field] = sprintf($info['format'], $row[$field]);
 
   return $row;