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.24 -r1.24.2.1
--- openacs-4/contrib/packages/project-manager/www/task-one.tcl 12 Mar 2004 13:44:45 -0000 1.24
+++ openacs-4/contrib/packages/project-manager/www/task-one.tcl 20 May 2004 17:30:05 -0000 1.24.2.1
@@ -16,24 +16,22 @@
@param project_item_id the item_id for the project. Used for navigational links
@param project_id the revision_id for the project. Used for navigational links
@param context_bar value for context bar creation
- @param orderby_revisions specifies how the revisions table will be sorted
@param orderby_dependency specifies how the dependencies will be sorted
@param orderby_dependency2 specifies how the dependencies will be sorted (for tasks that have dependencies on this task)
} {
task_id:integer,optional
task_revision_id:integer,optional
- orderby_revisions:optional
orderby_dependency:optional
orderby_dependency2:optional
} -properties {
+ closed_message:onevalue
notification_chunk:onevalue
task_info:onerow
project_item_id:onevalue
project_id:onevalue
context:onevalue
write_p:onevalue
create_p:onevalue
- revisions:multirow
dependency:multirow
dependency2:multirow
people:multirow
@@ -43,6 +41,7 @@
watcher_term:onevalue
comments:onevalue
comments_link:onevalue
+ print_link:onevalue
use_uncertain_completion_times_p:onevalue
} -validate {
task_id_exists {
@@ -79,21 +78,13 @@
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 [list "one?project_item_id=$project_item_id $project_term" "View"]
-
# the unique identifier for this package
set package_id [ad_conn package_id]
set user_id [ad_maybe_redirect_for_registration]
-set comments [general_comments_get_comments -print_content_p 1 -print_attachments_p 1 $task_id "[ad_conn url]?task_id=$task_id"]
-set comments_link [general_comments_create_link -object_name pm_task -link_text "Add a comment" -context_id $package_id $task_id "[ad_conn url]?task_id=$task_id"]
-
-
-
# permissions
permission::require_permission -party_id $user_id -object_id $package_id -privilege read
@@ -105,20 +96,51 @@
# Task info ----------------------------------------------------------
db_1row task_query { } -column_array task_info
-set task_info(description) [ad_text_to_html -- $task_info(description)]
+# we do this for the hours include portion
+set project_item_id $task_info(project_item_id)
+
+set context [list [list "one?project_item_id=$task_info(project_item_id)" "$task_info(project_name)"] "$task_info(task_title)"]
+
+
+set richtext_list [list $task_info(description) $task_info(mime_type)]
+
+set task_info(description) [template::util::richtext::get_property html_value $richtext_list]
+
if {[exists_and_not_null task_info(earliest_start_j)]} {
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)]
}
+if {$task_info(percent_complete) >= 100} {
+ set closed_message "-- Closed"
+} else {
+ set closed_message ""
+}
+
+
+# set link to comments
+
+set comments [general_comments_get_comments -print_content_p 1 -print_attachments_p 1 $task_id "[ad_conn url]?task_id=$task_id"]
+
+set comments_link [general_comments_create_link -object_name "$task_term: $task_info(task_title)" -link_text "Add a comment" -context_id $package_id $task_id "[ad_conn url]?task_id=$task_id"]
+
+set print_link "task-print?&task_id=$task_id&project_item_id=$task_info(project_item_id)"
+
+
+# how to get back here
+set return_url [ad_return_url -qualified]
+
+set task_edit_url "task-add-edit?my_key=1&task_id=$task_id&return_url=$return_url"
+
+
set logger_project [pm::project::get_logger_project \
- -project_item_id $project_item_id]
+ -project_item_id $task_info(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_url "[ad_conn package_url]log?project_id=$logger_project&pm_project_id=$task_info(project_item_id)&pm_task_id=$task_id"
set log_note "Task logged time listed below"
@@ -133,64 +155,6 @@
]
-# Task Revisions, using list-builder ---------------------------------
-
-template::list::create \
- -name revisions \
- -multirow revisions \
- -key revision_id \
- -elements {
- revision_id {
- label "Subject"
- display_col task_title
- link_url_col item_url
- link_html { title "View this revision" }
- display_template {@revisions.task_title@@revisions.task_title@}
- }
- description {
- label "Description"
- }
- percent_complete {
- label "Status"
- display_template "@revisions.percent_complete@\%"
- }
- actual_hours_worked {
- label "Hour to date"
- display_template "@revisions.actual_hours_worked@ hrs"
- }
- estimated_hours_work_min {
- label "Work estimate"
- display_template "@revisions.estimated_hours_work_min@ - @revisions.estimated_hours_work_max@ hrs"
- }
- end_date {
- label "Deadline"
- }
- } \
- -orderby {
- revision_id {orderby revision_id}
- percent_complete {orderby percent_complete}
- end_date {orderby end_date}
- default_value revision_id,desc
- } \
- -orderby_name orderby_revisions \
- -sub_class {
- narrow
- } \
- -filters {
- task_revision_id {}
- orderby_dependency {}
- orderby_dependency2 {}
- } \
- -html {
- width 100%
- }
-
-
-db_multirow -extend { item_url } revisions task_revisions_query {
-} {
- set item_url [export_vars -base "task-one" -override {{task_revision_id $revision_id}} -exclude {revision_id} { revision_id task_id}]
-}
-
# Dependency info ------------------------------------------------
template::list::create \
@@ -239,7 +203,6 @@
} \
-filters {
task_revision_id {}
- orderby_revisions {}
orderby_dependency2 {}
} \
-html {
@@ -299,7 +262,6 @@
} \
-filters {
task_revision_id {}
- orderby_revisions {}
orderby_dependency {}
} \
-html {
@@ -323,7 +285,7 @@
-elements {
first_names {
label {
- Who
+ Who
}
display_template {
@people.user_info@
@@ -388,7 +350,10 @@
label "LS"
}
latest_finish_pretty {
- label "ES"
+ label "LF"
+ display_template {
+ @xrefs.latest_finish_pretty@
+ }
}
} \
-sub_class {