DataObjects/Projects.php
authorAlan Knowles <alan@akbkhome.com>
Fri, 25 Feb 2011 08:38:51 +0000 (16:38 +0800)
committerAlan Knowles <alan@akbkhome.com>
Fri, 25 Feb 2011 08:38:51 +0000 (16:38 +0800)
DataObjects/Projects.php

index b8aaea2..873596e 100644 (file)
@@ -173,12 +173,20 @@ class Pman_Core_DataObjects_Projects extends DB_DataObject
             
         }
         
-        if (!empty($_REQUEST['query']['project_member_of'])) {
-            $this->whereAdd('id IN (
-                SELECT person_id from 
-                    ProjectDirectory 
-                WHERE project_id = ' . ((int) $_REQUEST['query']['project_member_of']) .')');
-            // this is also a flag to return if they are a member..
+        if (!empty($q['query']['project_member_of'])) {
+            
+            $do = DB_DataObject::Factory('ProjectDirectory')
+            $this->joinAdd('LEFT', $do);
+            $this->selectAs('ProjectDirectory.id as is_member');
+                
+                
+            )
+            if (!empty($q['query']['project_member_filter'])) {
+                $this->whereAdd('id IN (
+                    SELECT person_id from 
+                        ProjectDirectory 
+                    WHERE project_id = ' . ((int) $q['query']['project_member_of']) .')');
+                // this is also a flag to return if they are a member..
             
         }