Index: openacs-4/packages/project-manager/lib/customer-group-list.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/lib/customer-group-list.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/project-manager/lib/customer-group-list.xql 5 Oct 2005 18:24:24 -0000 1.1 +++ openacs-4/packages/project-manager/lib/customer-group-list.xql 30 Oct 2005 14:35:35 -0000 1.2 @@ -21,7 +21,7 @@ and proj.item_id = pa.project_id and pa.party_id in ([template::util::tcl_to_sql_list $group_members_list]) and proj.customer_id = :customer_id - and [template::list::page_where_clause -name "members"] + [template::list::page_where_clause -and -name "members"] [template::list::orderby_clause -orderby -name "members"] Index: openacs-4/packages/project-manager/lib/mail-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/lib/mail-portlet.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/project-manager/lib/mail-portlet.tcl 14 Oct 2005 17:58:35 -0000 1.2 +++ openacs-4/packages/project-manager/lib/mail-portlet.tcl 30 Oct 2005 14:35:35 -0000 1.3 @@ -6,6 +6,12 @@ # @author Viaro Networks www.viaro.net # @creation-date 2005-05-01 +foreach optional_param {page page_size show_filters_p elements} { + if {![info exists $optional_param]} { + set $optional_param {} + } +} + set default_layout_url [parameter::get -parameter DefaultPortletLayoutP] set dotlrn_installed_p [apm_package_installed_p dotlrn] Index: openacs-4/packages/project-manager/lib/projects.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/lib/projects.tcl,v diff -u -r1.25 -r1.26 --- openacs-4/packages/project-manager/lib/projects.tcl 21 Oct 2005 17:16:12 -0000 1.25 +++ openacs-4/packages/project-manager/lib/projects.tcl 30 Oct 2005 14:35:35 -0000 1.26 @@ -268,7 +268,7 @@ user_space_p [list] \ is_observer_p [list \ label "[_ project-manager.Observer]" \ - values { {"[_ project-manager.True]" t } { "[_ project-manager.False]" f} } \ + values { {"[_ acs-kernel.common_True]" t } { "[_ acs-kernel.common_False]" f} } \ where_clause { $user_space_clause } ] \ previous_status_f [list \ @@ -277,8 +277,8 @@ where_clause { $previous_status_where_clause } ] \ current_package_f [list \ - label "[_ project-manager.Package]" \ - values {{"[_ project-manager.All]" 1} {"[_ project-manager.Current]" $pm_package_id}} \ + label "[_ project-manager.Package_Instance]" \ + values {{"[_ acs-kernel.common_All]" 1} {"[_ project-manager.Current]" $pm_package_id}} \ ] \ ] Index: openacs-4/packages/project-manager/lib/subprojects.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/lib/subprojects.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/project-manager/lib/subprojects.tcl 4 Sep 2005 12:25:26 -0000 1.5 +++ openacs-4/packages/project-manager/lib/subprojects.tcl 30 Oct 2005 14:35:35 -0000 1.6 @@ -25,7 +25,7 @@ } if {![exists_and_not_null fmt]} { - set fmt "%x" + set fmt "%X" } if {![exists_and_not_null row_list]} { set row_list {project_name {} planned_end_date {} actual_hours_completed {}} Index: openacs-4/packages/project-manager/lib/tasks-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/lib/tasks-postgresql.xql,v diff -u -r1.13 -r1.14 --- openacs-4/packages/project-manager/lib/tasks-postgresql.xql 27 Oct 2005 22:57:18 -0000 1.13 +++ openacs-4/packages/project-manager/lib/tasks-postgresql.xql 30 Oct 2005 14:35:35 -0000 1.14 @@ -28,8 +28,8 @@ t.actual_hours_worked, s.status_type, s.description as status_description, - t.is_lead_p, - t.is_observer_p, + r.is_lead_p, + r.is_observer_p, t.priority, t.party_id, t.parent_id, @@ -51,20 +51,17 @@ tr.actual_hours_worked, tr.parent_id, tr.revision_id, - pr.is_observer_p, tr.description, - tr.priority, - pr.is_lead_p - from pm_tasks_revisionsx tr, pm_task_assignment ta, cr_items ci, pm_roles pr, - -- Select only tasks where you are participating in a certain role. - (select distinct task_id from pm_task_assignment where party_id = :user_id) my_tasks - where ta.task_id = tr.item_id - -- We need to join again with the role, as we are supposed to get all the participants - -- This is not good... We should probably get them in the TCL view.. - and ta.role_id = pr.role_id - and ci.live_revision = tr.revision_id and - tr.item_id = my_tasks.task_id - $done_clause) t, + tr.priority + from cr_items ci, pm_tasks_revisionsx tr + LEFT JOIN + pm_task_assignment ta ON tr.item_id = ta.task_id + -- get only live revisions + where ci.live_revision = tr.revision_id + [template::list::page_where_clause -and -name "tasks" -key "tr.item_id"]) t + LEFT JOIN + pm_roles r + ON t.role_id = r.role_id, pm_tasks_active ti, pm_task_status s, cr_items cp, @@ -78,43 +75,14 @@ where ppm.object_id = ti.task_id and ppm.privilege = 'read' and ppm.party_id = :user_id) - [template::list::filter_where_clauses -and -name tasks] [template::list::orderby_clause -name tasks -orderby] - SELECT t.item_id as task_item_id, - t.parent_id as project_item_id, - t.title, - to_char(t.end_date,'YYYY-MM-DD HH24:MI:SS') as end_date, - to_char(t.earliest_start,'YYYY-MM-DD HH24:MI:SS') as earliest_start, - t.earliest_start - current_date as days_to_earliest_start, - to_char(t.earliest_start,'J') as earliest_start_j, - to_char(t.earliest_finish,'YYYY-MM-DD HH24:MI:SS') as earliest_finish, - t.earliest_finish - current_date as days_to_earliest_finish, - to_char(t.latest_start,'YYYY-MM-DD HH24:MI:SS') as latest_start, - t.latest_start - current_date as days_to_latest_start, - to_char(t.latest_start,'J') as latest_start_j, - to_char(current_date,'J') as today_j, - to_char(t.latest_finish,'YYYY-MM-DD HH24:MI:SS') as latest_finish, - 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, - t.percent_complete, - t.estimated_hours_work, - t.estimated_hours_work_min, - t.estimated_hours_work_max, - t.actual_hours_worked, - s.status_type, - s.description as status_description, - t.is_lead_p, - t.is_observer_p, - t.priority, - t.party_id, - o.title as project_name + SELECT t.item_id as task_item_id FROM (select tr.item_id, ta.party_id, @@ -132,20 +100,21 @@ tr.actual_hours_worked, tr.parent_id, tr.revision_id, - pr.is_observer_p, tr.description, - tr.priority, - pr.is_lead_p - from pm_tasks_revisionsx tr, pm_task_assignment ta, cr_items ci, pm_roles pr, - -- Select only tasks where you are participating in a certain role. - (select distinct task_id from pm_task_assignment where party_id = :user_id) my_tasks - where ta.task_id = tr.item_id - -- We need to join again with the role, as we are supposed to get all the participants - -- This is not good... We should probably get them in the TCL view.. - and ta.role_id = pr.role_id - and ci.live_revision = tr.revision_id and - tr.item_id = my_tasks.task_id - $done_clause) t, + tr.priority + from cr_items ci, pm_tasks_revisionsx tr + LEFT JOIN + pm_task_assignment ta ON tr.item_id = ta.task_id, pm_roles r + -- get only live revisions + where ci.live_revision = tr.revision_id + and ta.role_id = r.role_id + $observer_clause + $done_clause + and exists (select 1 from acs_object_party_privilege_map ppm + where ppm.object_id = tr.item_id + and ppm.privilege = 'read' + and ppm.party_id = :user_id) + ) t, pm_tasks_active ti, pm_task_status s, cr_items cp, @@ -155,10 +124,6 @@ t.item_id = ti.task_id and ti.status = s.status_id and cp.live_revision = o.object_id - and exists (select 1 from acs_object_party_privilege_map ppm - where ppm.object_id = ti.task_id - and ppm.privilege = 'read' - and ppm.party_id = :user_id) [template::list::filter_where_clauses -and -name tasks] [template::list::orderby_clause -name tasks -orderby] Index: openacs-4/packages/project-manager/lib/tasks.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/lib/tasks.tcl,v diff -u -r1.29 -r1.30 --- openacs-4/packages/project-manager/lib/tasks.tcl 27 Oct 2005 22:57:18 -0000 1.29 +++ openacs-4/packages/project-manager/lib/tasks.tcl 30 Oct 2005 14:35:35 -0000 1.30 @@ -122,7 +122,7 @@ if {[regexp {([0-9]+)} $searchterm match query_digits]} { set search_term_where " (upper(t.title) like upper('%$searchterm%') - or t.item_id = :query_digits) " + or t.task_item_id = :query_digits) " } else { set search_term_where " upper(t.title) like upper('%$searchterm%')" } @@ -149,15 +149,28 @@ set project_item_clause [pm::project::get_list_of_open -object_package_id $filter_package_id] } -if { [exists_and_not_null subproject_tasks]} { +if { [exists_and_not_null subproject_tasks] && [exists_and_not_null project_item_id]} { set subprojects_list [db_list get_subprojects { } ] lappend subprojects_list $project_item_id set project_item_where_clause "t.parent_id in ([template::util::tcl_to_sql_list $subprojects_list])" - } else { set project_item_where_clause "t.parent_id = :project_item_id" } +# Shall we display only items where we are an observer ? +if {[exists_and_not_null is_observer_p]} { + switch $is_observer_p { + f { + set observer_clause "and r.is_observer_p = 'f' and ta.party_id = :user_id" + } + t { + set observer_clause "and r.is_observer_p = 't' and ta.party_id = :user_id" + } + } +} else { + set observer_clause "" +} + set filters [list \ searchterm [list \ label "[_ project-manager.Search_1]" \ @@ -178,8 +191,7 @@ ] \ is_observer_p [list \ label "[_ project-manager.Observer]" \ - values { {"[_ project-manager.True]" t} { "[_ project-manager.False]" f} } \ - where_clause "r.is_observer_p = :is_observer_p" + values { {#project-manager.Player# f} {#project-manager.Watcher# t} } \ ] \ party_id [list \ label "[_ project-manager.People]" \ @@ -296,7 +308,7 @@ } title { label "[_ project-manager.Subject_1]" - display_template {@tasks.title@@tasks.title@} + display_template {@tasks.title@@tasks.title@} } parent_task_id { label "[_ project-manager.Dep]"