X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DataObjects%2FCore_project.php;h=fe26c60c06c74fb4a8d3941f4068cb801002a697;hb=836a38e51ff6092a27f54a7f8bcd3cae54b72ad4;hp=5193f1c9d8342c01bba6bf5b91c6f2b9ff25a30f;hpb=2d960d4268aa9d56528c220a15c966923feda107;p=Pman.Core diff --git a/DataObjects/Core_project.php b/DataObjects/Core_project.php index 5193f1c9..fe26c60c 100644 --- a/DataObjects/Core_project.php +++ b/DataObjects/Core_project.php @@ -69,7 +69,7 @@ class Pman_Core_DataObjects_Core_project extends DB_DataObject function toEventString() { $c = $this->client(); - return ($c->id ? $c->toEventString() : '??'). ':' . $this->name; + return ($c && $c->id ? $c->toEventString() : '??'). ':' . $this->name; } /** @@ -272,6 +272,26 @@ class Pman_Core_DataObjects_Core_project extends DB_DataObject } + + + function client() + { + $c = DB_DataObject::factory('core_company'); + $c->get($this->client_id); + return $c; + } + + + + function team() + { + $c = DB_DataObject::factory('core_group'); + $c->get($this->team_id); + return $c; + } + + + // DEPRICATED - use userProjects function getUserProjects($au, $data='id') // COMPANY BASED!!!! @@ -282,13 +302,6 @@ class Pman_Core_DataObjects_Core_project 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.. */