Index: openacs-4/packages/project-manager/tcl/project-manager-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/tcl/project-manager-procs.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/project-manager/tcl/project-manager-procs.tcl 12 Mar 2006 16:54:58 -0000 1.12 +++ openacs-4/packages/project-manager/tcl/project-manager-procs.tcl 3 May 2006 18:29:19 -0000 1.13 @@ -871,3 +871,17 @@ return "${prefix}-${project_id}@[parameter::get_from_package_key -package_key acs-mail-lite -parameter BounceDomain]" } } + + +ad_proc -public pm::util::assigned_projects { + {-party_id:required} + {-status_id "1,3"} + {-role_id "1,2"} +} { + Return a list of assigned projects + @param party_id User for this this query is executed + @param status_id Status of the project. Might be a sql list + @param role_id Role the user can have in the project. Might also be a SQL list. +} { + return [db_list list_of_assigned_projects "select distinct i.item_id from pm_projects p, cr_items i, pm_project_assignment pa where p.project_id = i.latest_revision and p.status_id in ($status_id) and pa.project_id = i.item_id and pa.party_id = :party_id and pa.role_id in ($role_id)"] +} \ No newline at end of file