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

diff --git a/HISTORY b/HISTORY
index 818443c983c1c619869b9b7641443bd943ff60ab..b72e4cefd2950b69341d21b953b720dc628d8d2e 100644 (file)
--- a/HISTORY
+++ b/HISTORY
@@ -9,6 +9,7 @@ Bugs
  (Russell Smith)
 * Fix port selection for local connections (Russell Smith)
 * Fix timeouts on long running operations (Adrian Nida)
+* Allow Multiline character and character varying editing and inserting
 
 Translations
 * Japanese from Tadashi
index b3970cca0125229f0156cea077a05fd76cd296b3..0b0b8e0b21093fb427e97538252c3a1d15748419 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.250.2.1 2004/12/02 02:28:53 chriskl Exp $
+ * $Id: Postgres.php,v 1.250.2.2 2005/02/10 21:18:43 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;