X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DataObjects%2FProjectDirectory.php;h=c8f3fa215f4d7e242abc6a36d5cabd62bf99770c;hb=03e2802a8a2e5fee3ff8f22abc03718fb0de9068;hp=69301603a52dfb5fddc646fd4acc18a18ca05a70;hpb=415e6a769bbe53328b27129c12fa0488b88ab8a3;p=Pman.Core diff --git a/DataObjects/ProjectDirectory.php b/DataObjects/ProjectDirectory.php index 69301603..c8f3fa21 100644 --- a/DataObjects/ProjectDirectory.php +++ b/DataObjects/ProjectDirectory.php @@ -68,19 +68,22 @@ class Pman_Core_DataObjects_ProjectDirectory extends DB_DataObject */ function projects($au) { - $c = clone ($this); if (empty($au)) { $p = DB_DataObject::Factory('Projects'); $p->get('code', '*PUBLIC'); return array($p->id); } + $c = clone ($this); if (is_array($au)) { $c->whereAddIn('person_id', $au, 'int'); } else { $c->person_id = $au->id; } + $c->selectAdd(); + // people may have multiple roles for a project.. + $c->selectAdd('distinct(project_id) as project_id'); return $c->fetchAll('project_id'); } /**