DataObjects/Core_event_audit.php
[Pman.Core] / DataObjects / Projects.php
index 9514b9f..e398f61 100644 (file)
@@ -22,9 +22,9 @@ class Pman_Core_DataObjects_Projects extends DB_DataObject
     public $file_location;                   // string(254)  not_null
     public $open_date;                       // date(10)  binary
     public $open_by;                         // int(11)  not_null
+    public $close_date;                      // date(10)  binary
     public $countries;                       // string(128)  not_null
     public $languages;                       // string(128)  not_null
-    public $close_date;                      // date(10)  binary
     public $agency_id;                       // int(11)  not_null
 
     
@@ -130,7 +130,7 @@ class Pman_Core_DataObjects_Projects extends DB_DataObject
             $pr->whereAdd("Projects.type IN ('N','X')");
             $prjs = $pr->fetchAll('id');
             
-            
+            //DB_DataObject::debugLevel(1);
             $pd = DB_DataObject::factory('ProjectDirectory');
             $pd->joinAdd(DB_DataObject::factory('Projects'), 'LEFT');
             $pd->whereAdd("Projects.type NOT IN ('N','X')");
@@ -157,22 +157,7 @@ class Pman_Core_DataObjects_Projects extends DB_DataObject
         
         // this is clipping related..  -- we should have an API for addons like this.. (and docs)
         
-        if ($au->company()->comptype == 'SUPPLIER') {
-            $pr = DB_DataObject::factory('CampaignAssign');
-            $pr->supplier_id = $au->company_id;
-            $prjs = $pr->fetchAll('project_id');
-             if (count($prjs)) {
-                $this->whereAdd("
-                     (Projects.id IN (".implode(',', $prjs).")) 
-                ");
-            }  else {
-                $this->whereAdd("1=0"); // can see nothing!!!
-            }
-        }
-        if ($au->company()->comptype == 'CLIENT') {
-            $this->client_id = $au->company()->id; // can see nothing!!!
-            
-        }
+       
         
         
         
@@ -312,23 +297,7 @@ class Pman_Core_DataObjects_Projects extends DB_DataObject
             ));
         }
         return true;
-    }
-    
-    function fetchAll($k= false) {
-        if ($k !== false) {
-            $this->selectAdd();
-            $this->selectAdd($k);
-        }
-        
-        $this->find();
-        $ret = array();
-        while ($this->fetch()) {
-            $ret[] = $k === false ? clone($this) : $this->$k;
-        }
-        return $ret;
-         
-    }
-    
+    } 
     /**
      * fetch a list of user projects.
      * if you need to filter open/closed.. then add whereAdds before calling