Index: openacs-4/packages/project-manager/lib/projects-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/lib/projects-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/project-manager/lib/projects-postgresql.xql 30 Jul 2005 00:26:33 -0000 1.4 +++ openacs-4/packages/project-manager/lib/projects-postgresql.xql 23 Aug 2005 16:37:50 -0000 1.5 @@ -47,11 +47,11 @@ ctg.deprecated_p = 'f') c ON p.item_id = c.object_id, cr_items i, - cr_folders f + cr_folders f, + pm_roles pr WHERE p.project_id = i.live_revision and i.parent_id = f.folder_id - and f.package_id = :package_id and exists (select 1 from acs_object_party_privilege_map ppm where ppm.object_id = p.project_id and ppm.privilege = 'read' Index: openacs-4/packages/project-manager/lib/projects.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/lib/projects.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/project-manager/lib/projects.adp 10 Aug 2005 17:20:24 -0000 1.5 +++ openacs-4/packages/project-manager/lib/projects.adp 23 Aug 2005 16:37:50 -0000 1.6 @@ -15,6 +15,7 @@ @category_select;noquote@ + 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.14 -r1.15 --- openacs-4/packages/project-manager/lib/projects.tcl 11 Aug 2005 17:07:24 -0000 1.14 +++ openacs-4/packages/project-manager/lib/projects.tcl 23 Aug 2005 16:37:50 -0000 1.15 @@ -6,9 +6,10 @@ # @cvs-id $Id$ set required_param_list [list package_id] -set optional_param_list [list orderby status_id searchterm bulk_p action_p filter_p base_url end_date_f] -set optional_unset_list [list assignee_id date_range] +set optional_param_list [list orderby status_id searchterm bulk_p action_p filter_p base_url end_date_f user_space_p] +set optional_unset_list [list assignee_id date_range is_observer_p] +set user_id [ad_conn user_id] foreach required_param $required_param_list { if {![info exists $required_param]} { return -code error "$required_param is a required parameter." @@ -33,6 +34,12 @@ set format "normal" } +if [empty_string_p $user_space_p] { + set user_space_p 0 +} +# This indicates that it came from the user space +# So we check that the user has lead or player role +# to show the projects. # --------------------------------------------------------------- # @@ -201,6 +208,45 @@ set actions [list "Project: $community_name" "$base_url"] } +if { $user_space_p } { + set user_space_clause "pa.role_id = pr.role_id and pr.is_observer_p = :is_observer_p" +} else { + set user_space_clause "pa.role_id = pr.role_id and pr.is_observer_p = :is_observer_p and f.package_id = :package_id" +} + +set filters [list \ + searchterm [list \ + label "[_ project-manager.Search_1]" \ + where_clause {$search_term_where} + ] \ + date_range [list \ + label "[_ project-manager.Planned_end_date]" \ + where_clause {$p_range_where} + ] \ + status_id [list \ + label "[_ project-manager.Status_1]" \ + values {[pm::status::project_status_select]} \ + where_clause {$status_where_clause} \ + ] \ + assignee_id [list \ + label "[_ project-manager.Assignee]" \ + values {$assignees_filter} \ + where_clause {pa.party_id = :assignee_id} + ] \ + category_id [list \ + label Categories \ + where_clause {c.category_id = [join [value_if_exists category_id] ","]} + ] \ + user_space_p [list] \ + is_observer_p [list \ + label "[_ project-manager.Observer]" \ + values { {True t } { False f} } \ + where_clause { $user_space_clause } + ] \ + ] + + + template::list::create \ -name "projects_${package_id}" \ -multirow projects_${package_id} \ @@ -240,36 +286,16 @@ label "[_ project-manager.Status_1]" display_template "#project-manager.Closed##project-manager.Open#" } + planned_end_date { + label "[_ project-manager.Planned_end_date]" + } } \ -actions $actions \ -bulk_actions $bulk_actions \ -sub_class { narrow } \ - -filters { - searchterm { - label "[_ project-manager.Search_1]" - where_clause {$search_term_where} - } - date_range { - label "[_ project-manager.Planned_end_date]" - where_clause {$p_range_where} - } - status_id { - label "[_ project-manager.Status_1]" - values {[pm::status::project_status_select]} - where_clause {$status_where_clause} - } - assignee_id { - label "[_ project-manager.Assignee]" - values {$assignees_filter} - where_clause {pa.party_id = :assignee_id} - } - category_id { - label Categories - where_clause {c.category_id = [join [value_if_exists category_id] ","]} - } - } \ + -filters $filters \ -orderby { default_value $default_orderby project_name { @@ -327,8 +353,7 @@ width 100% } -db_multirow -extend { item_url } "projects_${package_id}" project_folders { -} { +db_multirow -extend { item_url } "projects_${package_id}" project_folders " " { set earliest_finish_date [lc_time_fmt $earliest_finish_date $fmt] set latest_finish_date [lc_time_fmt $latest_finish_date $fmt] set item_url [export_vars -base "${base_url}one" {project_item_id}] 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.6 -r1.7 --- openacs-4/packages/project-manager/lib/tasks-postgresql.xql 11 Aug 2005 07:53:44 -0000 1.6 +++ openacs-4/packages/project-manager/lib/tasks-postgresql.xql 23 Aug 2005 16:37:50 -0000 1.7 @@ -40,6 +40,8 @@ p.title as project_name, ar.object_id_two as logger_project FROM + pm_roles pr, + pm_task_assignment pa, (select tr.item_id, ta.party_id, ta.role_id, @@ -102,6 +104,8 @@ select distinct task_item_id from (SELECT t.item_id as task_item_id FROM + pm_roles pr, + pm_task_assignment pa, (select tr.item_id, ta.party_id, ta.role_id, Index: openacs-4/packages/project-manager/lib/tasks.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/lib/tasks.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/project-manager/lib/tasks.adp 26 May 2005 09:34:27 -0000 1.1 +++ openacs-4/packages/project-manager/lib/tasks.adp 23 Aug 2005 16:37:50 -0000 1.2 @@ -13,16 +13,16 @@ - +
#project-manager.Search#
@hidden_vars;noquote@
- +
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.14 -r1.15 --- openacs-4/packages/project-manager/lib/tasks.tcl 15 Aug 2005 10:00:20 -0000 1.14 +++ openacs-4/packages/project-manager/lib/tasks.tcl 23 Aug 2005 16:37:50 -0000 1.15 @@ -4,7 +4,7 @@ set required_param_list [list] set optional_param_list [list orderby searchterm status_id page bulk_p actions_p base_url watcher_p page_num] -set optional_unset_list [list party_id role_id project_item_id instance_id] +set optional_unset_list [list party_id role_id project_item_id instance_id is_observer_p] foreach required_param $required_param_list { if {![info exists $required_param]} { @@ -42,7 +42,6 @@ set package_id [ad_conn package_id] } - # --------------------------------------------------------------- # Hide finished tasks. This should be added as a filter, but I did not @@ -98,7 +97,7 @@ if {![exists_and_not_null status_id]} { set status_where_clause "" } else { - set status_where_clause {ts.status = :status_id} + set status_where_clause {ti.status = :status_id} } # permissions @@ -138,6 +137,15 @@ set elements [list task_item_id title slack_time role latest_start latest_finish status_type remaining worked project_item_id percent_complete log_url edit_url] } + +set is_observer_clause "t.item_id = pa.task_id and pa.role_id = pr.role_id and pr.is_observer_p = :is_observer_p" + +if ![info exist instance_id] { + set project_item_clause [pm::project::get_list_of_open] +} else { + set project_item_clause [pm::project::get_list_of_open -object_package_id $package_id] +} + set filters [list \ searchterm [list \ label "[_ project-manager.Search_1]" \ @@ -150,12 +158,17 @@ ] \ project_item_id [list \ label "[_ project-manager.Project_1]" \ - values {[pm::project::get_list_of_open]} \ + values { $project_item_clause } \ where_clause "t.parent_id = :project_item_id" ] \ instance_id [list \ where_clause "p.object_package_id = :instance_id" ] \ + is_observer_p [list \ + label "[_ project-manager.Observer]" \ + values { {True t} {False f} } \ + where_clause "$is_observer_clause" + ]\ ] # Setup the actions, so we can append the rest later on @@ -166,7 +179,6 @@ set actions [list] } - foreach element $elements { # Special treatement for days / hours @@ -213,7 +225,7 @@ ] } else { set element "party_id" - lappend filters [list party_id [list \ + lappend filters [list parties_id [list \ label "[_ project-manager.People]" \ values "[pm::task::assignee_filter_select \ -status_id $status_id]" \ @@ -225,6 +237,7 @@ append row_list "$element {}\n" } + if {$bulk_p == 1} { set bulk_actions [list "[_ project-manager.Log_hours]" "${base_url}log-bulk" "[_ project-manager.lt_Log_hours_for_several]" "[_ project-manager.Edit_tasks]" "${base_url}task-add-edit" "[_ project-manager.Edit_multiple_tasks]"] set bulk_action_export_vars [list [list return_url]] Index: openacs-4/packages/project-manager/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/index.adp,v diff -u -r1.6 -r1.7 --- openacs-4/packages/project-manager/www/index.adp 10 Aug 2005 17:19:50 -0000 1.6 +++ openacs-4/packages/project-manager/www/index.adp 23 Aug 2005 16:36:31 -0000 1.7 @@ -5,4 +5,4 @@ #project-manager.Projects# @context;noquote@ - \ No newline at end of file + \ No newline at end of file Index: openacs-4/packages/project-manager/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/index.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/project-manager/www/index.tcl 10 Aug 2005 17:19:50 -0000 1.7 +++ openacs-4/packages/project-manager/www/index.tcl 23 Aug 2005 16:36:31 -0000 1.8 @@ -24,6 +24,8 @@ category_id:multiple,optional {format "normal"} {assignee_id ""} + {user_space_p "0"} + {is_observer_p ""} } -properties { @@ -51,8 +53,8 @@ set context [list] # the unique identifier for this package -set package_id [ad_conn package_id] set user_id [ad_maybe_redirect_for_registration] +set package_id [ad_conn package_id] # permissions permission::require_permission -party_id $user_id -object_id $package_id -privilege read @@ -278,5 +280,4 @@ list::write_output -name projects - # ------------------------- END OF FILE ------------------------- # Index: openacs-4/packages/project-manager/www/tasks.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/tasks.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/project-manager/www/tasks.adp 30 Jul 2005 00:26:33 -0000 1.4 +++ openacs-4/packages/project-manager/www/tasks.adp 23 Aug 2005 16:36:31 -0000 1.5 @@ -7,10 +7,11 @@ @passed_project_item_id@ - + +
- +
Index: openacs-4/packages/project-manager/www/tasks.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/tasks.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/project-manager/www/tasks.tcl 30 Jul 2005 00:26:33 -0000 1.5 +++ openacs-4/packages/project-manager/www/tasks.tcl 23 Aug 2005 16:36:31 -0000 1.6 @@ -27,6 +27,8 @@ {page_size 25} role_id:optional {project_item_id ""} + {instance_id ""} + {is_observer_p ""} } -properties { task_term:onevalue context:onevalue Index: openacs-4/packages/project-manager-portlet/lib/projects.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager-portlet/lib/projects.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/project-manager-portlet/lib/projects.adp 12 Aug 2005 22:31:21 -0000 1.1 +++ openacs-4/packages/project-manager-portlet/lib/projects.adp 23 Aug 2005 16:41:59 -0000 1.2 @@ -18,5 +18,16 @@ - - + +
+
+ + + #project-manager-portlet.More# + + + #project-manager-portlet.More# + + +
+
\ No newline at end of file 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.2 -r1.3 --- openacs-4/packages/project-manager-portlet/lib/projects.tcl 15 Aug 2005 09:21:01 -0000 1.2 +++ openacs-4/packages/project-manager-portlet/lib/projects.tcl 23 Aug 2005 16:41:59 -0000 1.3 @@ -34,11 +34,16 @@ set format "normal" } +set community_id [dotlrn_community::get_community_id] +if { [empty_string_p $community_id] } { + set user_space_p 1 +} else { + set user_space_p 0 +} - # --------------------------------------------------------------- # -set _package_id $package_id +set package_id $package_id template::multirow create pm_packages "list_id" "contact_column" "community_name" set c_row 0 @@ -245,8 +250,16 @@ width 100% } +set count 0 +set more_p 0 + db_multirow -extend { item_url } "projects" project_folders { } { + incr count + if {[string equal $count 26] } { + set more_p 1 + break + } set earliest_finish_date [lc_time_fmt $earliest_finish_date $fmt] set latest_finish_date [lc_time_fmt $latest_finish_date $fmt] set item_url [export_vars -base "${base_url}one" {project_item_id}] @@ -269,7 +282,6 @@ set portal_info_url [lindex $base_url 0] } - } 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.2 -r1.3 --- openacs-4/packages/project-manager-portlet/lib/tasks-postgresql.xql 13 Aug 2005 15:18:47 -0000 1.2 +++ openacs-4/packages/project-manager-portlet/lib/tasks-postgresql.xql 23 Aug 2005 16:41:59 -0000 1.3 @@ -73,19 +73,25 @@ i.item_id = d.task_id, pm_tasks_active ti, pm_task_status s, - pm_projectsx p + pm_projectsx p, + pm_task_assignment pa, + pm_roles pr WHERE t.parent_id = p.item_id and t.revision_id = i.live_revision and t.item_id = ti.task_id and ti.status = s.status_id + and pa.task_id = t.item_id + and pa.role_id = pr.role_id + $extra_query $party_where_clause 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) $done_clause [template::list::filter_where_clauses -and -name tasks] + order by end_date desc Index: openacs-4/packages/project-manager-portlet/lib/tasks.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager-portlet/lib/tasks.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/project-manager-portlet/lib/tasks.adp 12 Aug 2005 22:31:21 -0000 1.1 +++ openacs-4/packages/project-manager-portlet/lib/tasks.adp 23 Aug 2005 16:41:59 -0000 1.2 @@ -1,7 +1,20 @@ + +
+ +
#project-manager-portlet.More#
+
+ +
+ #project-manager-portlet.More# +
+
+
+
+
#project-manager.Search#
@@ -30,3 +43,10 @@
+
+#project-manager-portlet.my_tasks# | +#project-manager-portlet.pool_tasks# + + (#project-manager-portlet.clear#) + +

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.2 -r1.3 --- openacs-4/packages/project-manager-portlet/lib/tasks.tcl 13 Aug 2005 15:18:47 -0000 1.2 +++ openacs-4/packages/project-manager-portlet/lib/tasks.tcl 23 Aug 2005 16:41:59 -0000 1.3 @@ -3,7 +3,7 @@ # role_id set required_param_list [list] -set optional_param_list [list searchterm status_id page bulk_p actions_p base_url] +set optional_param_list [list searchterm status_id page bulk_p actions_p base_url is_observer_p] set optional_unset_list [list party_id role_id project_item_id instance_id] foreach required_param $required_param_list { @@ -42,6 +42,11 @@ set package_id [ad_conn package_id] } +if { ![empty_string_p $is_observer_p] } { + set extra_query "and pr.is_observer_p = :is_observer_p" +} else { + set extra_query "" +} # --------------------------------------------------------------- @@ -128,7 +133,7 @@ # Get the rows to display if {![exists_and_not_null elements]} { - set elements [list task_item_id title slack_time role latest_start latest_finish status_type remaining worked project_item_id percent_complete edit_url] + set elements [list task_item_id title slack_time role latest_start latest_finish planned_end_date status_type remaining worked project_item_id percent_complete edit_url] } set filters [list \ @@ -350,8 +355,19 @@ } } + +set count 0 +set more_p 0 + + 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 {} { + incr count + if { [string equal $count 26] } { + set more_p 1 + break + } + set item_url [export_vars \ -base "task-one" {{task_id $task_item_id}}] Index: openacs-4/packages/project-manager-portlet/www/project-manager-task-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager-portlet/www/project-manager-task-portlet.adp,v diff -u -r1.8 -r1.9 --- openacs-4/packages/project-manager-portlet/www/project-manager-task-portlet.adp 12 Aug 2005 22:32:34 -0000 1.8 +++ openacs-4/packages/project-manager-portlet/www/project-manager-task-portlet.adp 23 Aug 2005 16:43:13 -0000 1.9 @@ -1 +1 @@ - + Index: openacs-4/packages/project-manager-portlet/www/project-manager-task-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager-portlet/www/project-manager-task-portlet.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/project-manager-portlet/www/project-manager-task-portlet.tcl 13 Aug 2005 15:18:47 -0000 1.7 +++ openacs-4/packages/project-manager-portlet/www/project-manager-task-portlet.tcl 23 Aug 2005 16:43:13 -0000 1.8 @@ -2,6 +2,7 @@ } { {watcher_p 0} {page_num 0} + {is_observer_p ""} } # daily? set daily_p [parameter::get -parameter "UseDayInsteadOfHour" -default "f"] @@ -24,10 +25,10 @@ set base_url "project-manager/" set pm_package_id [dotlrn_community::get_package_id_from_package_key -package_key "project-manager" -community_id $community_id] set party_id "" - set elements "task_item_id title role latest_finish status_type project_item_id edit_url" + set elements "task_item_id title role end_date status_type project_item_id edit_url" } else { - set elements "task_item_id title latest_finish status_type project_item_id edit_url" + set elements "task_item_id title end_date status_type project_item_id edit_url" set party_id [ad_conn user_id] set base_url "" set pm_package_id ""