Index: openacs-4/packages/project-manager-portlet/lib/projects-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager-portlet/lib/projects-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/project-manager-portlet/lib/projects-postgresql.xql 25 Aug 2005 19:46:03 -0000 1.4 +++ openacs-4/packages/project-manager-portlet/lib/projects-postgresql.xql 15 Sep 2005 22:43:53 -0000 1.5 @@ -24,7 +24,7 @@ and i.parent_id = f.folder_id $extra_role_where_clause $extra_query - and f.package_id in ($package_ids)) proj + ) proj where exists (select 1 from acs_object_party_privilege_map ppm where ppm.object_id = proj.project_id and ppm.privilege = 'read' Index: openacs-4/packages/project-manager-portlet/lib/projects.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager-portlet/lib/projects.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/project-manager-portlet/lib/projects.tcl 25 Aug 2005 19:46:03 -0000 1.5 +++ openacs-4/packages/project-manager-portlet/lib/projects.tcl 15 Sep 2005 22:43:53 -0000 1.6 @@ -35,16 +35,22 @@ } set community_id [dotlrn_community::get_community_id] + +#ad_return_complaint 1 $package_ids + if { [empty_string_p $community_id] } { set user_space_p 1 set extra_role_tables "pm_project_assignment pa,pm_roles pr," - set extra_role_where_clause " and pa.project_id = p.item_id + set extra_role_where_clause " + and pa.project_id = p.item_id and pa.role_id = pr.role_id - and pa.party_id = :user_id" + and 1 = ( select 1 from dual where pa.party_id = :user_id or :user_id in ( select object_id_two from acs_rels where object_id_one = pa.party_id + and rel_type = 'membership_rel')) + " } else { set user_space_p 0 set extra_role_tables "" - set extra_role_where_clause "" + set extra_role_where_clause "and f.package_id in ($package_ids)" } # --------------------------------------------------------------- # Index: openacs-4/packages/project-manager-portlet/lib/tasks-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager-portlet/lib/tasks-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/project-manager-portlet/lib/tasks-postgresql.xql 25 Aug 2005 19:46:03 -0000 1.4 +++ openacs-4/packages/project-manager-portlet/lib/tasks-postgresql.xql 15 Sep 2005 22:43:53 -0000 1.5 @@ -22,9 +22,6 @@ t.latest_finish - current_date as days_to_latest_finish, to_char(t.end_date,'YYYY-MM-DD HH24:MI:SS') as end_date, t.end_date - current_date as days_to_end_date, - u.person_id, - u.first_names, - u.last_name, t.percent_complete, t.estimated_hours_work, t.estimated_hours_work_min, @@ -34,6 +31,7 @@ s.description as status_description, r.is_lead_p, t.priority, + t.party_id, p.title as project_name FROM (select tr.item_id, @@ -55,10 +53,6 @@ tr.priority from pm_tasks_revisionsx tr, pm_task_assignment ta, pm_roles pr where ta.task_id = tr.item_id and ta.role_id = pr.role_id $extra_query) t - LEFT JOIN - persons u - ON - t.party_id = u.person_id LEFT JOIN pm_roles r ON t.role_id = r.role_id, Index: openacs-4/packages/project-manager-portlet/lib/tasks.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager-portlet/lib/tasks.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/project-manager-portlet/lib/tasks.tcl 25 Aug 2005 19:46:03 -0000 1.4 +++ openacs-4/packages/project-manager-portlet/lib/tasks.tcl 15 Sep 2005 22:43:53 -0000 1.5 @@ -170,7 +170,8 @@ # We need to filter by the user if a party_id is given if {[exists_and_not_null party_id]} { - set party_where_clause "and t.party_id = :party_id" + set party_where_clause "and 1 = ( select 1 from dual where t.party_id = :user_id or :user_id in ( + select object_id_two from acs_rels where object_id_one = t.party_id and rel_type = 'membership_rel'))" } else { set party_where_clause "" } @@ -255,7 +256,7 @@ } party_id { label "[_ project-manager.Who]" - display_template { @tasks.first_names@ @tasks.last_name@
+ display_template { @tasks.name@
} } role { @@ -321,8 +322,8 @@ } last_name { label "[_ project-manager.Who]" - display_template { - @tasks.first_names@ @tasks.last_name@
+ display_template { + @tasks.name@
} } } \ @@ -354,9 +355,32 @@ set count 0 set more_p 0 +# We ge the package_id of the pm instance to get the value of the parameter -db_multirow -extend {item_url earliest_start_pretty earliest_finish_pretty end_date_pretty latest_start_pretty latest_finish_pretty slack_time edit_url hours_remaining days_remaining actual_days_worked my_user_id user_url base_url task_close_url project_url} tasks tasks {} { +set pm_package_id [dotlrn_community::get_package_id_from_package_key \ + -package_key "project-manager" \ + -community_id [dotlrn_community::get_community_id]] +set assign_group_p [parameter::get -parameter "AssignGroupP" -default 0 -package_id $pm_package_id] + +db_multirow -extend {item_url earliest_start_pretty earliest_finish_pretty end_date_pretty latest_start_pretty latest_finish_pretty slack_time edit_url hours_remaining days_remaining actual_days_worked my_user_id user_url base_url task_close_url project_url name} tasks tasks {} { + + if { $assign_group_p } { + # We are going to show all asignees including groups + if { [catch {set name [person::name -person_id $party_id] } err] } { + # person::name give us an error so its probably a group so we get + # the title + set name [group::title -group_id $party_id] + } + } else { + if { [catch {set name [person::name -person_id $party_id] } err] } { + # person::name give us an error so its probably a group, here we don't want + # to show any group so we just continue the multirow + continue + } + } + + incr count if { [string equal $count 26] } { set more_p 1 @@ -415,7 +439,7 @@ } set my_user_id $user_id set user_url [export_vars \ - -base "${contacts_url}contact" {{party_id $person_id}}] + -base "${contacts_url}contact" {{party_id $party_id}}] acs_object::get -object_id $task_item_id -array task_array set base_url [lindex [site_node::get_url_from_object_id -object_id $task_array(package_id)] 0]