DataObjects/Core_locking.php
[Pman.Core] / DataObjects / Projects.php
index 9434759..e9fa870 100644 (file)
@@ -67,7 +67,8 @@ class Pman_Core_DataObjects_Projects extends DB_DataObject
     }
 
     function toEventString() {
-        return $this->name;
+        $c = $this->client();
+        return ($c->id ? $c->toEventString() : '??'). ':' . $this->name;
     }
     
     /**
@@ -145,10 +146,12 @@ class Pman_Core_DataObjects_Projects extends DB_DataObject
         }
         
         if (!empty($q['query']['distinct_client_id'])) {
+          // DB_DataObjecT::debuglevel(1);
             $this->selectAdd();
             $this->selectAdd('distinct(client_id)');
+            $this->selectAs(DB_DataObject::factory('Companies'), 'client_id_%s','join_client_id_id');
             $this->groupBy('client_id');
-            
+             
         }
         
         // this is clipping related..  -- we should have an API for addons like this.. (and docs)
@@ -289,8 +292,8 @@ class Pman_Core_DataObjects_Projects extends DB_DataObject
     }
     
     
-    function toRooArray($f='%s') {
-        $ret = parent::toArray($f);
+    function toRooArray($req= array()) {
+        $ret = parent::toArray();
         // sor tout 
         $ret['countrylist'] = $this->I18toArray('c',$ret['countries']);
         $ret['languagelist'] = $this->I18toArray('l',$ret['languages']);
@@ -346,6 +349,13 @@ class Pman_Core_DataObjects_Projects extends DB_DataObject
     }
     
     
+    function client()
+    {
+        $c = DB_DataObject::factory('Companies');
+        $c->get($this->client_id);
+        return $c;
+    }
+    
     /**
      * check who is trying to access this. false == access denied..
      */