Index: openacs-4/contrib/packages/project-manager/tcl/calendar-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/tcl/Attic/calendar-procs-postgresql.xql,v diff -u -r1.1.2.4 -r1.1.2.5 --- openacs-4/contrib/packages/project-manager/tcl/calendar-procs-postgresql.xql 13 Aug 2004 19:38:14 -0000 1.1.2.4 +++ openacs-4/contrib/packages/project-manager/tcl/calendar-procs-postgresql.xql 30 Aug 2004 18:19:13 -0000 1.1.2.5 @@ -10,50 +10,54 @@ - SELECT - ts.task_id, - ts.task_id as item_id, - ts.task_number, - t.task_revision_id, - t.title, - t.parent_id as project_item_id, - to_char(t.earliest_start,'J') as earliest_start_j, - to_char(current_timestamp,'J') as today_j, - to_char(t.latest_start,'J') as latest_start_j, - to_char(t.latest_finish,'J') as latest_finish_j, - to_char(t.latest_start,'YYYY-MM-DD HH24:MI') as latest_start, - to_char(t.latest_finish,'YYYY-MM-DD HH24:MI') as latest_finish, - t.percent_complete, - t.estimated_hours_work, - t.estimated_hours_work_min, - t.estimated_hours_work_max, - case when t.actual_hours_worked is null then 0 - else t.actual_hours_worked end as actual_hours_worked, - to_char(t.earliest_start,'YYYY-MM-DD HH24:MI') as earliest_start, - to_char(t.earliest_finish,'YYYY-MM-DD HH24:MI') as earliest_finish, - to_char(t.latest_start,'YYYY-MM-DD HH24:MI') as latest_start, - to_char(t.latest_finish,'YYYY-MM-DD HH24:MI') as latest_finish, - p.first_names || ' ' || p.last_name as full_name, - p.person_id, - s.status_type as status - FROM - pm_tasks_active ts, - pm_task_status s, - cr_items i, - pm_tasks_revisionsx t - LEFT JOIN pm_task_assignment ta - ON t.item_id = ta.task_id - LEFT JOIN persons p - ON ta.party_id = p.person_id - WHERE - ts.status = s.status_id and - ts.task_id = t.item_id and - i.item_id = t.item_id and - t.task_revision_id = i.live_revision and + SELECT + ts.task_id, + ts.task_id as item_id, + ts.task_number, + t.task_revision_id, + t.title, + t.parent_id as project_item_id, + to_char(t.earliest_start,'J') as earliest_start_j, + to_char(current_timestamp,'J') as today_j, + to_char(t.latest_start,'J') as latest_start_j, + to_char(t.latest_finish,'J') as latest_finish_j, + to_char(t.latest_start,'YYYY-MM-DD HH24:MI') as latest_start, + to_char(t.latest_finish,'YYYY-MM-DD HH24:MI') as latest_finish, + t.percent_complete, + t.estimated_hours_work, + t.estimated_hours_work_min, + t.estimated_hours_work_max, + case when t.actual_hours_worked is null then 0 + else t.actual_hours_worked end as actual_hours_worked, + to_char(t.earliest_start,'YYYY-MM-DD HH24:MI') as earliest_start, + to_char(t.earliest_finish,'YYYY-MM-DD HH24:MI') as earliest_finish, + to_char(t.latest_start,'YYYY-MM-DD HH24:MI') as latest_start, + to_char(t.latest_finish,'YYYY-MM-DD HH24:MI') as latest_finish, + p.first_names || ' ' || p.last_name || ' (' || + substring(r.one_line from 1 for 1) || ')' as full_name, + p.person_id, + s.status_type as status + FROM + pm_tasks_active ts, + pm_task_status s, + cr_items i, + pm_tasks_revisionsx t + LEFT JOIN pm_task_assignment ta + ON t.item_id = ta.task_id + LEFT JOIN persons p + ON ta.party_id = p.person_id + LEFT JOIN pm_roles r + ON ta.role_id = r.role_id + WHERE + ts.status = s.status_id and + ts.task_id = t.item_id and + i.item_id = t.item_id and + t.task_revision_id = i.live_revision and t.latest_start >= :first_of_month_date and t.latest_start <= :last_of_month_date + $hide_closed_clause ORDER BY - t.latest_start, ts.task_id, p.first_names, p.last_name + t.latest_start, ts.task_id, r.role_id, p.first_names, p.last_name Index: openacs-4/contrib/packages/project-manager/tcl/calendar-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/tcl/Attic/calendar-procs.tcl,v diff -u -r1.1.2.4 -r1.1.2.5 --- openacs-4/contrib/packages/project-manager/tcl/calendar-procs.tcl 13 Aug 2004 19:38:14 -0000 1.1.2.4 +++ openacs-4/contrib/packages/project-manager/tcl/calendar-procs.tcl 30 Aug 2004 18:19:13 -0000 1.1.2.5 @@ -17,6 +17,7 @@ ad_proc -public one_month_display { {-user_id:required} {-date ""} + {-hide_closed_p "t"} } { Creates a month widget for tasks } { @@ -36,6 +37,13 @@ set last_of_month_date "$year-$month-[dt_num_days_in_month $year $month]" set items [ns_set create] + + # do not show closed items if the user requests not to + if {[string is true $hide_closed_p]} { + set hide_closed_clause " and s.status_type = 'o' " + } else { + set hide_closed_clause "" + } set last_task_id "" set assignee_list [list] @@ -76,14 +84,16 @@ # begin setting up this calendar item set day_details "

${detail_begin}$task_id
$title${detail_end}" + # only add to the list if we want to see closed tasks append day_details "

" } Index: openacs-4/contrib/packages/project-manager/www/task-calendar.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-calendar.adp,v diff -u -r1.1.2.2 -r1.1.2.3 --- openacs-4/contrib/packages/project-manager/www/task-calendar.adp 13 Aug 2004 18:57:34 -0000 1.1.2.2 +++ openacs-4/contrib/packages/project-manager/www/task-calendar.adp 30 Aug 2004 18:19:14 -0000 1.1.2.3 @@ -4,4 +4,26 @@ @context@ @header_stuff;noquote@ - @content;noquote@ + View options + Key + +
+ + @edit_hidden_vars;noquote@ + + @calendar;noquote@ + +
+ +

View options

+ + @hide_show_closed;noquote@ + +

Key

+ +
+ +
@roles.abbreviation;noquote@
+
@roles.role;noquote@
+
+
Index: openacs-4/contrib/packages/project-manager/www/task-calendar.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-calendar.tcl,v diff -u -r1.1.2.3 -r1.1.2.4 --- openacs-4/contrib/packages/project-manager/www/task-calendar.tcl 19 Aug 2004 00:01:27 -0000 1.1.2.3 +++ openacs-4/contrib/packages/project-manager/www/task-calendar.tcl 30 Aug 2004 18:19:14 -0000 1.1.2.4 @@ -13,9 +13,11 @@ {view "month"} {date ""} {julian_date ""} + {hide_closed_p "t"} } -properties { title:onevalue context:onevalue + roles:multirow } set user_id [ad_maybe_redirect_for_registration] @@ -59,11 +61,33 @@ set return_url [ad_return_url] -set content "
[export_vars -form {return_url}]" -append content [pm::calendar::one_month_display \ - -user_id $user_id \ - -date $date \ - ] -append content "" +set edit_hidden_vars [export_vars -form {return_url}] -ad_return_template +set calendar [pm::calendar::one_month_display \ + -user_id $user_id \ + -date $date \ + -hide_closed_p $hide_closed_p \ + ] + + +if {[string is true $hide_closed_p]} { + set hide_show_closed "Show closed" + set here [export_vars -base task-calendar {{hide_closed_p f} view date julian_date}] +} else { + set hide_show_closed "Hide closed" + set here [export_vars -base task-calendar {{hide_closed_p t} view date julian_date}] +} + +# --------------------------------------------- +# make a key of list of roles and abbreviations +# --------------------------------------------- + +db_multirow roles roles_and_abbrevs { + SELECT + one_line as role, + substring(one_line from 1 for 1) as abbreviation + FROM + pm_roles +} + +