Allow Multiline character and character varying editing and inserting
authormr-russ <mr-russ>
Thu, 10 Feb 2005 21:21:00 +0000 (21:21 +0000)
committermr-russ <mr-russ>
Thu, 10 Feb 2005 21:21:00 +0000 (21:21 +0000)
HISTORY
classes/database/Postgres.php

diff --git a/HISTORY b/HISTORY
index d3eec3e5ec66c3892008a34e81352ea5b5a9d08e..6c789e2537f53e7436dd3c97e156ad55cbdc1a0a 100644 (file)
--- a/HISTORY
+++ b/HISTORY
@@ -16,6 +16,7 @@ Bugs
  (Russell Smith)
 * Fix port selection for local connections
 * Fix timeouts on long running operations (Adrian Nida)
+* Allow Multiline character and character varying editing and inserting
 
 Translations
 * Japanese from Tadashi Jokagi
index bced4de1b14105885f43a0a677a64f697298221e..4d002a58b61c604bb62092fa1f530e6047342bf7 100755 (executable)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres.php,v 1.252 2005/02/06 00:34:20 mr-russ Exp $
+ * $Id: Postgres.php,v 1.253 2005/02/10 21:21:00 mr-russ Exp $
  */
 
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -256,8 +256,8 @@ class Postgres extends ADODB_base {
                foreach ($actions as $k => $v) {
                        $action_str .= " {$k}=\"" . htmlspecialchars($v) . "\"";
                }
-               
-               switch ($type) {
+
+               switch (substr($type,0,9)) {
                        case 'bool':
                        case 'boolean':
                                if ($value !== null && $value == '') $value = null;
@@ -276,15 +276,20 @@ class Postgres extends ADODB_base {
                                        echo "<input name=\"", htmlspecialchars($name), "\" value=\"", htmlspecialchars($value), "\" size=\"35\"{$action_str} />\n";
                                }                               
                                break;
-                       case 'text':
                        case 'bytea':
                                // addCSlashes converts all weird ASCII characters to octal representation,
                                // EXCEPT the 'special' ones like \r \n \t, etc.
-                               if ($type == 'bytea') $value = addCSlashes($value, "\0..\37\177..\377");
+                               $value = addCSlashes($value, "\0..\37\177..\377");
+                       case 'text':
                                echo "<textarea name=\"", htmlspecialchars($name), "\" rows=\"5\" cols=\"75\" wrap=\"virtual\"{$action_str}>\n";
                                echo htmlspecialchars($value);
                                echo "</textarea>\n";
                                break;
+                       case 'character':
+                               echo "<textarea name=\"", htmlspecialchars($name), "\" rows=\"2\" cols=\"35\" wrap=\"virtual\"{$action_str}>\n";
+                               echo htmlspecialchars($value);
+                               echo "</textarea>\n";
+                               break;
                        default:
                                echo "<input name=\"", htmlspecialchars($name), "\" value=\"", htmlspecialchars($value), "\" size=\"35\"{$action_str} />\n";
                                break;