limit length shown on comment on the 5 major objects. make it so that you can always...
authorchriskl <chriskl>
Thu, 3 Jun 2004 06:42:20 +0000 (06:42 +0000)
committerchriskl <chriskl>
Thu, 3 Jun 2004 06:42:20 +0000 (06:42 +0000)
BUGS
TODO
classes/database/Postgres.php
classes/database/Postgres73.php
domains.php
functions.php
sequences.php
tables.php
views.php

diff --git a/BUGS b/BUGS
index 4cde76bfba5f99d2a9abb453ff011299248cfa18..c55b529a26b38947f9c19e42dcd9dd5f260a2914 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -32,3 +32,4 @@ NEEDS TESTING
 * prevent the user from dropping all the superusers
 * getView() isn't schema-aware for 7.3+?
 * rename function in 7.2 and below doesn't come back to the correct function
+* 7.5 function named parameters are not supported
diff --git a/TODO b/TODO
index 8e17eb8fa6dcde841b853df4d1ee54942b785996..07f3bf1c7385bfd725453ec677d16e687b92f2a2 100644 (file)
--- a/TODO
+++ b/TODO
@@ -133,6 +133,8 @@ Settings
 Miscellaneous
 -------------
 
+* Support 7.5 functions for killing backend processes
+* Printable view of things
 * Allow simultaneous logins to different clusters (mark gibson)
 * Show comments for all objects (Dan Boren)
 * Allow setting/dropping comments for all objects (Dan Boren)
index eb50e44d71e0c48273d6f99cf7992200057cd9c0..f01531f6ce13824f0b23a95b06e9eb6938d9c462 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.219 2004/06/03 03:48:22 chriskl Exp $
+ * $Id: Postgres.php,v 1.220 2004/06/03 06:42:20 chriskl Exp $
  */
 
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -1545,9 +1545,14 @@ class Postgres extends BaseDB {
         * @return A recordset
         */
        function &getSequence($sequence) {
+               $temp = $sequence;
+               // Need both field cleaned and literal cleaned versions
                $this->fieldClean($sequence);
+               $this->clean($temp);
                
-               $sql = "SELECT sequence_name AS relname, * FROM \"{$sequence}\""; 
+               $sql = "SELECT sequence_name AS relname, *, 
+                                       (SELECT description FROM pg_description pd WHERE pd.objoid=(SELECT oid FROM pg_class WHERE relname='{$temp}')) AS seqcomment
+                                       FROM \"{$sequence}\" AS s"; 
                
                return $this->selectSet( $sql );
        }
index 193c9a3e46c6f15fb6c71bb6cf3ffdc975101e5f..b2102c606a5b1e45f2977980f09531c892b99823 100644 (file)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres73.php,v 1.115 2004/05/31 13:25:49 chriskl Exp $
+ * $Id: Postgres73.php,v 1.116 2004/06/03 06:42:20 chriskl Exp $
  */
 
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -562,12 +562,13 @@ class Postgres73 extends Postgres72 {
 
        /**
         * Returns properties of a single sequence
+        * @param $sequence Sequence name
         * @return A recordset
         */
        function &getSequence($sequence) {
                $this->fieldClean($sequence);
-               
-               $sql = "SELECT sequence_name AS relname, * FROM \"{$sequence}\""; 
+       
+               $sql = "SELECT sequence_name AS relname, *, pg_catalog.obj_description(s.tableoid, 'pg_class') AS seqcomment FROM \"{$sequence}\" AS s"; 
                
                return $this->selectSet( $sql );
        }
index 4105502d56a0c19a3d9a22ae0d677dc22403c34c..1a34c5dfb300ad2dcb76219aa7041def4ef4bcac 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * Manage domains in a database
         *
-        * $Id: domains.php,v 1.12 2004/05/31 13:25:49 chriskl Exp $
+        * $Id: domains.php,v 1.13 2004/06/03 06:42:20 chriskl Exp $
         */
 
        // Include application functions
                                echo "<td class=\"data{$id}\">", $misc->printVal($domains->f['domowner']), "</td>\n";
                                echo "<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=properties&amp;{$misc->href}&amp;domain=", urlencode($domains->f['domname']), "\">{$lang['strproperties']}</a></td>\n"; 
                                echo "<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=confirm_drop&amp;{$misc->href}&amp;domain=", urlencode($domains->f['domname']), "\">{$lang['strdrop']}</a></td>\n";
+                               // Trim long comments
+                               if (strlen($domains->f['domcomment']) > $conf['max_chars']) {
+                                       $domains->f['domcomment'] = substr($domains->f['domcomment'], 0, $conf['max_chars'] - 1) . $lang['strellipsis'];
+                               }
                                if ($conf['show_comments']) echo "<td class=\"data{$id}\">", $misc->printVal($domains->f['domcomment']), "</td>\n";
                                echo "</tr>\n";
                                $domains->moveNext();
index 2905000680b36f1f0bf0cd76944e4d31d408e54a..6407f7f90a001a610da222399c9c7c1013c659e8 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * Manage functions in a database
         *
-        * $Id: functions.php,v 1.31 2004/05/31 13:25:49 chriskl Exp $
+        * $Id: functions.php,v 1.32 2004/06/03 06:42:20 chriskl Exp $
         */
 
        // Include application functions
                                                $funcs->f[$data->fnFields['fnoid']], "&amp;type=function\">{$lang['strprivileges']}</a></td>\n";
                                }
                                else echo "<td></td>";
+                               // Trim long comments
+                               if (strlen($funcs->f['funccomment']) > $conf['max_chars']) {
+                                       $funcs->f['funccomment'] = substr($funcs->f['funccomment'], 0, $conf['max_chars'] - 1) . $lang['strellipsis'];
+                               }
                                if ($conf['show_comments']) echo "<td class=\"data{$id}\">", $misc->printVal($funcs->f['funccomment']), "</td>\n";                              
                                echo "</tr>\n";
                                $funcs->moveNext();
index 3a96b1bddcd0bc7da65f30e294c699ba260f17ca..ae14947422dc69bb873a599a45a3c8ba427cb4c6 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * Manage sequences in a database
         *
-        * $Id: sequences.php,v 1.19 2004/05/09 02:00:25 chriskl Exp $
+        * $Id: sequences.php,v 1.20 2004/06/03 06:42:20 chriskl Exp $
         */
        
        // Include application functions
                                echo "<td class=\"opbutton{$id}\">";
                                echo "<a href=\"privileges.php?{$misc->href}&amp;object=", urlencode($sequences->f[$data->sqFields['seqname']]),
                                        "&amp;type=sequence\">{$lang['strprivileges']}</td>\n";
+                               // Trim long comments
+                               if (strlen($sequences->f['seqcomment']) > $conf['max_chars']) {
+                                       $sequences->f['seqcomment'] = substr($sequences->f['seqcomment'], 0, $conf['max_chars'] - 1) . $lang['strellipsis'];
+                               }
                                if ($conf['show_comments']) echo "<td class=\"data{$id}\">", $misc->printVal($sequences->f['seqcomment']), "</td>\n";
                                echo "</tr>\n";                         
                                $sequences->movenext();
                // Fetch the sequence information
                $sequence = &$data->getSequence($_REQUEST['sequence']);         
                
-               if (is_object($sequence) && $sequence->recordCount() > 0) {                     
+               if (is_object($sequence) && $sequence->recordCount() > 0) {                                             
                        $sequence->f[$data->sqFields['iscycled']] = $data->phpBool($sequence->f[$data->sqFields['iscycled']]);
                        $sequence->f[$data->sqFields['iscalled']] = $data->phpBool($sequence->f[$data->sqFields['iscalled']]);
+
+                       // Show comment if any
+                       if ($sequence->f['seqcomment'] !== null)
+                               echo "<p class=\"comment\">", $misc->printVal($sequence->f['seqcomment']), "</p>\n";
+
                        echo "<table border=\"0\">";
                        echo "<tr><th class=\"data\">{$lang['strname']}</th><th class=\"data\">{$lang['strlastvalue']}</th>";
                        echo "<th class=\"data\">{$lang['strincrementby']}</th><th class=\"data\">{$lang['strmaxvalue']}</th>";
index 1d55290bf4f7235479ae1c346bc61117b26bf2e2..888dcc63750ea507b33761e7e2ee2f213a71ae90 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * List tables in a database
         *
-        * $Id: tables.php,v 1.52 2004/05/31 13:34:40 chriskl Exp $
+        * $Id: tables.php,v 1.53 2004/06/03 06:42:20 chriskl Exp $
         */
 
        // Include application functions
                                $status = $data->createTable($_REQUEST['name'], $_REQUEST['fields'], $_REQUEST['field'],
                                                                $_REQUEST['type'], $_REQUEST['array'], $_REQUEST['length'], $_REQUEST['notnull'], $_REQUEST['default'],
                                                                isset($_REQUEST['withoutoids']), $_REQUEST['colcomment'], $_REQUEST['tblcomment']);
+
                                if ($status == 0) {
                                        $_reload_browser = true;
                                        doDefault($lang['strtablecreated']);
                                        urlencode($tables->f[$data->tbFields['tbname']]), "\">{$lang['strempty']}</a></td>\n";
                                echo "\t<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=confirm_drop&amp;{$misc->href}&amp;table=",
                                        urlencode($tables->f[$data->tbFields['tbname']]), "\">{$lang['strdrop']}</a></td>\n";
+                               // Trim long comments
+                               if (strlen($tables->f['tablecomment']) > $conf['max_chars']) {
+                                       $tables->f['tablecomment'] = substr($tables->f['tablecomment'], 0, $conf['max_chars'] - 1) . $lang['strellipsis'];
+                               }
                                if ($conf['show_comments']) echo "\t<td class=\"data{$id}\">", $misc->printVal($tables->f['tablecomment']), "</td>\n";
                                echo "</tr>\n";
                                $tables->moveNext();
index d230d0a88aa481cb78190a71563fbe9fec6c087f..cd114e7a551b4820cb39fecd9d2b33e624340449 100644 (file)
--- a/views.php
+++ b/views.php
@@ -3,7 +3,7 @@
        /**
         * Manage views in a database
         *
-        * $Id: views.php,v 1.40 2004/05/31 13:34:40 chriskl Exp $
+        * $Id: views.php,v 1.41 2004/06/03 06:42:20 chriskl Exp $
         */
 
        // Include application functions
                                echo "<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=confselectrows&{$misc->href}&view=", urlencode($views->f[$data->vwFields['vwname']]), "\">{$lang['strselect']}</a></td>\n"; 
                                echo "<td class=\"opbutton{$id}\"><a href=\"viewproperties.php?{$misc->href}&view=", urlencode($views->f[$data->vwFields['vwname']]), "\">{$lang['strproperties']}</a></td>\n"; 
                                echo "<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=confirm_drop&{$misc->href}&view=", urlencode($views->f[$data->vwFields['vwname']]), "\">{$lang['strdrop']}</a></td>\n";
+                               // Trim long comments
+                               if (strlen($views->f[$data->vwFields['vwcomment']]) > $conf['max_chars']) {
+                                       $views->f[$data->vwFields['vwcomment']] = substr($views->f[$data->vwFields['vwcomment']], 0, $conf['max_chars'] - 1) . $lang['strellipsis'];
+                               }
                                if ($conf['show_comments']) echo "<td class=\"data{$id}\">", $misc->printVal($views->f[$data->vwFields['vwcomment']]), "</td>\n";
                                echo "</tr>\n";
                                $views->moveNext();