Index: openacs-4/contrib/packages/project-manager/www/task-one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-one.tcl,v diff -u -r1.22.2.7 -r1.22.2.8 --- openacs-4/contrib/packages/project-manager/www/task-one.tcl 27 Feb 2004 22:46:13 -0000 1.22.2.7 +++ openacs-4/contrib/packages/project-manager/www/task-one.tcl 6 Mar 2004 00:29:24 -0000 1.22.2.8 @@ -27,10 +27,11 @@ orderby_dependency2:optional } -properties { + notification_chunk:onevalue task_info:onerow project_item_id:onevalue project_id:onevalue - context_bar:onevalue + context:onevalue write_p:onevalue create_p:onevalue revisions:multirow @@ -43,15 +44,18 @@ watcher_term:onevalue comments:onevalue comments_link:onevalue + use_uncertain_completion_times_p:onevalue } -validate { task_id_exists { if {![info exists task_id]} { - set task_id [db_string get_task_id { }] + set task_id [pm::task::get_item_id \ + -task_id $task_revision_id] } } revision_id_exists { if {![info exists task_revision_id]} { - set task_revision_id [db_string get_revision_id { }] + set task_revision_id [pm::task::get_revision_id \ + -task_item_id $task_id] } } } @@ -65,10 +69,11 @@ set assignee_term [parameter::get -parameter "AssigneeName" -default "Assignee"] set watcher_term [parameter::get -parameter "WatcherName" -default "Watcher"] set project_term [parameter::get -parameter "ProjectName" -default "Project"] +set use_uncertain_completion_times_p [parameter::get -parameter "UseUncertainCompletionTimesP" -default "1"] db_1row get_project_ids { } -set context_bar [ad_context_bar "one?project_item_id=$project_item_id $project_term" "View"] +set context [list "one?project_item_id=$project_item_id $project_term" "View"] # the unique identifier for this package @@ -87,21 +92,39 @@ set write_p [permission::permission_p -object_id $package_id -privilege write] set create_p [permission::permission_p -object_id $package_id -privilege create] + + # Task info ---------------------------------------------------------- db_1row task_query { } -column_array task_info set task_info(description) [ad_text_to_html -- $task_info(description)] if {[exists_and_not_null task_info(earliest_start_j)]} { - if {$task_info(earliest_start_j) < $task_info(today_j)} { - set task_info(slack_time) "[expr $task_info(latest_start_j) - $task_info(today_j)] days" - } else { - set task_info(slack_time) "[expr $task_info(latest_start_j) - $task_info(earliest_start_j)] days" - } -} else { - set task_info(slack_time) "n/a" + set task_info(slack_time) [pm::task::slack_time \ + -earliest_start_j $task_info(earliest_start_j) \ + -today_j $task_info(today_j) \ + -latest_start_j $task_info(latest_start_j)] } +set logger_project [pm::project::get_logger_project \ + -project_item_id $project_item_id] +set logger_variable_id [logger::variable::get_default_variable_id] + +set log_url "[ad_conn package_url]log?project_id=$logger_project&pm_project_id=$project_item_id&pm_task_id=$task_id" + +set log_note "Task logged time listed below" + +# ------------------ +# Notifications info +# ------------------ +set notification_chunk [notification::display::request_widget \ + -type pm_task_notif \ + -object_id $task_id \ + -pretty_name "$task_info(task_title)" \ + -url "[ad_conn url]?[ad_conn query]" \ + ] + + # Task Revisions, using list-builder --------------------------------- template::list::create \ @@ -142,7 +165,7 @@ default_value revision_id,desc } \ -orderby_name orderby_revisions \ - -main_class { + -sub_class { narrow } \ -filters { @@ -165,7 +188,7 @@ template::list::create \ -name dependency \ -multirow dependency \ - -key task_id \ + -key d_task_id \ -elements { dependency_type { label "Type" @@ -184,7 +207,7 @@ } } - task_id { + d_task_id { label "Task" display_col task_title link_url_col item_url @@ -203,7 +226,7 @@ end_date {orderby end_date} } \ -orderby_name orderby_dependency \ - -main_class { + -sub_class { narrow } \ -filters { @@ -217,15 +240,15 @@ db_multirow -extend { item_url } dependency dependency_query { } { - set item_url [export_vars -base "task-one" -override {{task_id $parent_task_id}} { task_id }] + set item_url [export_vars -base "task-one" -override {{task_id $parent_task_id}} { task_id $d_task_id }] } # Dependency info (dependency other task have on this task) ------ template::list::create \ -name dependency2 \ -multirow dependency2 \ - -key task_id \ + -key d_task_id \ -elements { dependency_type { label "Type" @@ -244,10 +267,10 @@ } } - task_id { + d_task_id { label "Task" display_col task_title - link_url_eval {task-one?task_id=$task_id} + link_url_eval {task-one?task_id=$d_task_id} link_html { title "View this task" } } percent_complete { @@ -263,7 +286,7 @@ end_date {orderby end_date} } \ -orderby_name orderby_dependency2 \ - -main_class { + -sub_class { narrow } \ -filters { @@ -303,7 +326,7 @@ display_template "@people.one_line@" } } \ - -main_class { + -sub_class { narrow } \ -filters { @@ -319,10 +342,10 @@ } \ -orderby_name orderby_people \ -html { + width 100% } - db_multirow -extend { item_url } subproject task_people_query { } {