Fixed view wizard (broken my me, oops!)
authorjollytoad <jollytoad>
Thu, 15 Jul 2004 09:35:30 +0000 (09:35 +0000)
committerjollytoad <jollytoad>
Thu, 15 Jul 2004 09:35:30 +0000 (09:35 +0000)
classes/database/Postgres73.php
views.php

index 2b1babf825311cb178cd75dd9cc7dcc23363405f..ab84b8a9e76ac709556f52d2a7ac4a49efb03201 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.129 2004/07/15 08:02:11 jollytoad Exp $
+ * $Id: Postgres73.php,v 1.130 2004/07/15 09:35:30 jollytoad Exp $
  */
 
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -957,14 +957,15 @@ class Postgres73 extends Postgres72 {
         function &getLinkingKeys($tables) {
                if (!is_array($tables)) return -1;
 
-               $tables_list = "'{$tables[0]['relname']}'";
-               $schema_list = "'{$tables[0]['nspname']}'";
-               $schema_tables_list = "'{$tables[0]['nspname']}.{$tables[0]['relname']}'";
-               for ($i = 1; $i < sizeof($tables); $i++) {
-                       $tables_list .= ", '{$tables[$i]['relname']}'";
-                       $schema_list .= ", '{$tables[$i]['nspname']}'";
-                       $schema_tables_list .= ", '{$tables[$i]['nspname']}.{$tables[$i]['relname']}'";
-               }
+               
+               $tables_list = "'{$tables[0]['schemaname']}'";
+               $schema_list = "'{$tables[0]['tablename']}'";
+               $schema_tables_list = "'{$tables[0]['schemaname']}.{$tables[0]['tablename']}'";
+               for ($i = 1; $i < sizeof($tables); $i++) {
+                       $tables_list .= ", '{$tables[$i]['tablename']}'";
+                       $schema_list .= ", '{$tables[$i]['schemaname']}'";
+                       $schema_tables_list .= ", '{$tables[$i]['schemaname']}.{$tables[$i]['tablename']}'";
+               }
                $maxDimension = 1;
 
                $sql = "
index f0896b3887623cf58e1d35dddce28212313d635e..83f9a881974cad074c2962faba6428db46e0c477 100644 (file)
--- a/views.php
+++ b/views.php
@@ -3,7 +3,7 @@
        /**
         * Manage views in a database
         *
-        * $Id: views.php,v 1.46 2004/07/13 15:24:41 jollytoad Exp $
+        * $Id: views.php,v 1.47 2004/07/15 09:35:30 jollytoad Exp $
         */
 
        // Include application functions
                $arrTables = array();
                while (!$tables->EOF) {                                         
                        $arrTmp = array();
-                       $arrTmp['schemaname'] = $tables->f['schemaname'];
-                       $arrTmp['tablename'] = $tables->f['tablename'];
+                       $arrTmp['schemaname'] = $tables->f['nspname'];
+                       $arrTmp['tablename'] = $tables->f['relname'];
                        if ($data->hasSchemas() ) { //if schemas aren't available don't show them in the interface
-                               $arrTables[$tables->f['schemaname'] . '.' . $tables->f['tablename']] = serialize($arrTmp);
+                               $arrTables[$tables->f['nspname'] . '.' . $tables->f['relname']] = serialize($arrTmp);
                        }
                        else {
-                               $arrTables[$tables->f['tablename']] = serialize($arrTmp);
+                               $arrTables[$tables->f['relname']] = serialize($arrTmp);
                        }
                        $tables->moveNext();
                }