Pman/Roo.php
[Pman.Base] / Pman / Roo.php
index 6a8f1ba..b19c4d5 100644 (file)
@@ -11,10 +11,10 @@ require_once 'Pman.php';
  * Uses these methods of the dataobjects:
  * - checkPerm('L'/'E'/'A', $authuser) - can we list the stuff
  * 
- * - applySort($au, $sortcol, $direction)
+ * - applySort($au, $sortcol, $direction) -- return false to let system do default sort code.
  * - applyFilters($_REQUEST, $authUser) -- apply any query filters on data. and hide stuff not to be seen.
- * - postListExtra - add extra column data on the results (like new messages etc.)
- * -postListFilter($data, $authUser, $request) return $data - add extra data to an object
+ * - postListExtra($_REQUEST) : array(extra_data) - add extra column data on the results (like new messages etc.)
+ * - postListFilter($data, $authUser, $request) return $data - add extra data to an object
  * 
  * - toRooSingleArray($authUser, $request) // single fetch, add data..
  * - toRooArray($request) /// toArray if you need to return different data.. for a list fetch.
@@ -44,8 +44,10 @@ class Pman_Roo extends Pman
     /**
      * GET method   Roo/TABLENAME.php 
      * -- defaults to listing data. with args.
+     *
      * 
      * !colname=....                 => colname != ....
+     * !colname[0]=... !colname[1]=... => colname NOT IN (.....) ** only supports main table at present..
      * colname[0]=... colname[1]=... => colname IN (.....) ** only supports main table at present..
      * 
      * other opts:
@@ -59,7 +61,7 @@ class Pman_Roo extends Pman
      * 
      * csvCols[0] csvCols[1]....    = .... column titles for CSV output
      * 
-     * csvTitle[0], csvTitle[1] ....  = columns to use for CSV output
+     * csvTitles[0], csvTitles[1] ....  = columns to use for CSV output
      *
      * sort        = sort column (',' comma delimited)
      * dir         = sort direction ?? in future comma delimited...
@@ -73,7 +75,8 @@ class Pman_Roo extends Pman
     function get($tab)
     {
          //  $this->jerr("Not authenticated", array('authFailure' => true));
-       //echo '<PRE>';print_R($_GET);  DB_DataObject::debuglevel(1);
+       //echo '<PRE>';print_R($_GET);
+       //DB_DataObject::debuglevel(1);
         
         $this->init(); // from pnan.
         
@@ -81,7 +84,7 @@ class Pman_Roo extends Pman
         // debugging...
         if (!empty($_GET['_post'])) {
             $_POST  = $_GET;
-            DB_DAtaObject::debuglevel(1);
+            //DB_DAtaObject::debuglevel(1);
             return $this->post($tab);
         }
         $tab = str_replace('/', '',$tab); // basic protection??
@@ -171,7 +174,7 @@ class Pman_Roo extends Pman
  
         $x->limit(
             empty($_REQUEST['start']) ? 0 : (int)$_REQUEST['start'],
-            min(empty($_REQUEST['limit']) ? 25 : (int)$_REQUEST['limit'], 1000)
+            min(empty($_REQUEST['limit']) ? 25 : (int)$_REQUEST['limit'], 5000)
         );
         
         $queryObj = clone($x);
@@ -864,6 +867,13 @@ class Pman_Roo extends Pman
             // value is an array..
             if (is_array($val) ) {
                 
+                $pref = '';
+                
+                if ($key[0] == '!') {
+                    $pref = '!';
+                    $key = substr($key,1);
+                }
+                
                 if (!in_array( $key,  array_keys($this->cols))) {
                     continue;
                 }
@@ -887,10 +897,10 @@ class Pman_Roo extends Pman
                 if (count($ar)) {
                     
                     
-                    $x->whereAddIn(
+                    $x->whereAddIn($pref . (
                         isset($this->colsJname[$key]) ? 
                             $this->colsJname[$key] :
-                            ($x->tableName(). '.'.$key),
+                            ($x->tableName(). '.'.$key)),
                         $ar, $quote ? 'string' : 'int');
                 }