X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DatabaseColumns.php;h=703b1fae63214b6ec28f5ca59ad321aa68903a51;hb=refs%2Fheads%2Fmaster;hp=2b632f5222aca72b1034ad17a7507f7ebb8aedba;hpb=76be7ffd8d4006b007b2f819479b924f6f6cd1bc;p=Pman.Core diff --git a/DatabaseColumns.php b/DatabaseColumns.php index 2b632f52..703b1fae 100644 --- a/DatabaseColumns.php +++ b/DatabaseColumns.php @@ -11,10 +11,10 @@ class Pman_Core_DatabaseColumns extends Pman { $au = $this->getAuthUser(); if (!$au) { - $this->jerr("Not authenticated", array('authFailure' => true)); + $this->jerror("LOGIN-NOAUTH", "Not authenticated", array('authFailure' => true)); } if (!$au->pid() ) { // not set up yet.. - $this->jerr("Not authenticated", array('authFailure' => true)); + $this->jerror("LOGIN-NOAUTH", "Not authenticated", array('authFailure' => true)); } @@ -22,7 +22,7 @@ class Pman_Core_DatabaseColumns extends Pman { return true; } - function get($table) { + function get($table, $opts = Array()) { $d = DB_DAtaObject::Factory($table); if (method_exists($d, 'availableColumns')) { $cols = $d->availableColumns(); @@ -34,6 +34,7 @@ class Pman_Core_DatabaseColumns extends Pman { $types = array(); + $tables = array(); $schemas = array($table => $d->table()); foreach($cols as $name=>$table_col) { @@ -42,8 +43,7 @@ class Pman_Core_DatabaseColumns extends Pman { $schemas[$tbl] = DB_DataObject::Factory($tbl)->table(); } $types[$name] = $schemas[$tbl][$col]; - - + $tables[$name] = $tbl; } foreach($re['join_names'] as $c=>$f) { @@ -59,6 +59,7 @@ class Pman_Core_DatabaseColumns extends Pman { 'name' => $c, 'val' => $f, 'type' => isset($types[$c]) ? $this->typeToName($types[$c]) : -1, + 'table' => isset($tables[$c]) ? $tables[$c] : "", ); }