DataObjects/ProjectDirectory.php
[Pman.Core] / DataObjects / Companies.php
index 7d36505..65397c9 100644 (file)
@@ -38,8 +38,10 @@ class Pman_Core_DataObjects_Companies extends DB_DataObject
     
     function applyFilters($q, $au)
     {
+        
+        //DB_DataObject::debugLevel(1);
         $x = DB_DataObject::factory('Companies');
-        $x->isOwner = 1;
+        $x->comptype= 'OWNER';
         $x->find(true);
         
         if (!empty($q['query']['company_project_id'])) {
@@ -67,7 +69,7 @@ class Pman_Core_DataObjects_Companies extends DB_DataObject
                 SELECT distinct(company_id) FROM ProjectDirectory where project_id IN ($pids)
             ) $add" );
             
-           // DB_DataObject::debugLevel(1);
+           
             
         }
         if (!empty($q['query']['comptype'])) {
@@ -76,6 +78,13 @@ class Pman_Core_DataObjects_Companies extends DB_DataObject
             
         }
          
+         if (!empty($q['query']['province'])) {
+             $prov = $this->escape($q['query']['province']);
+            $this->whereAdd("province LIKE '$prov%'");
+            
+            
+        }
+         
     }
     function toEventString() {
         return $this->name;