Index: openacs-4/contrib/packages/project-manager/www/one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/one.tcl,v diff -u -r1.29 -r1.30 --- openacs-4/contrib/packages/project-manager/www/one.tcl 26 Feb 2004 15:15:41 -0000 1.29 +++ openacs-4/contrib/packages/project-manager/www/one.tcl 12 Mar 2004 13:44:45 -0000 1.30 @@ -1,11 +1,12 @@ ad_page_contract { - Main view page for one project. + Main view page for one project. Also shows logged time, and allows a + user to log time @author jader@bread.com, ncarroll@ee.usyd.edu.au @creation-date 2003-05-15 @cvs-id $Id$ - @return context_bar Context bar. + @return context Context bar. @return versions a multirow holding versions of the project @return live_revision the project_id of the live_revision @@ -30,7 +31,7 @@ } -properties { categories:onelist - context_bar:onevalue + context:onevalue project:multirow tasks:multirow people:multirow @@ -45,15 +46,22 @@ use_project_code_p:onevalue use_uncertain_completion_times_P:onevalue use_project_customizations_p:onevalue + task_term:onevalue + then_ansi:onevalue + edit_url:onevalue + comments:onevalue + comments_link:onevalue } -validate { project_item_id_exists { if {![exists_and_not_null project_item_id]} { - set project_item_id [db_string get_item_id { }] + set project_item_id [pm::project::get_project_item_id \ + -project_id $project_id] } } project_id_exists { if {![exists_and_not_null project_id]} { - set project_id [db_string get_project_id { }] + set project_id [pm::project::get_project_id \ + -project_item_id $project_item_id] } } } @@ -66,11 +74,20 @@ set package_id [ad_conn package_id] set user_id [ad_maybe_redirect_for_registration] +# ---------------- +# general comments +# ---------------- +set comments [general_comments_get_comments -print_content_p 1 -print_attachments_p 1 $project_item_id "[ad_conn url]?project_item_id=$project_item_id"] + +set comments_link [general_comments_create_link -object_name cr_items -link_text "Add a comment" -context_id $package_id $project_item_id "[ad_conn url]?project_item_id=$project_item_id"] + + # terminology set project_term [parameter::get -parameter "ProjectName" -default "Project"] set project_term_lower [parameter::get -parameter "projectname" -default "project"] -set use_goal_p [parameter::get -parameter "UseGoalP" -default "1"] -set use_project_code_p [parameter::get -parameter "UseUserProjectCodesP" -default "1"] +set task_term [parameter::get -parameter "TaskName" -default "Task"] +set use_goal_p [parameter::get -parameter "UseGoalP" -default "1"] +set use_project_code_p [parameter::get -parameter "UseUserProjectCodesP" -default "1"] set use_uncertain_completion_times_p [parameter::get -parameter "UseUncertainCompletionTimesP" -default "1"] set use_project_customizations_p [parameter::get -parameter "UseProjectCustomizationsP" -default "0"] @@ -80,9 +97,9 @@ set write_p [permission::permission_p -object_id $package_id -privilege write] set create_p [permission::permission_p -object_id $package_id -privilege create] + # categories - set categories [list] set cat_list [category::get_mapped_categories $project_item_id] foreach cat $cat_list { @@ -97,13 +114,25 @@ set project(estimated_finish_date) [lc_time_fmt $project(estimated_finish_date) "%x"] set project(earliest_finish_date) [lc_time_fmt $project(earliest_finish_date) "%x"] set project(latest_finish_date) [lc_time_fmt $project(latest_finish_date) "%x"] +set project(logger_variable_id) [logger::variable::get_default_variable_id] +set log_url "[ad_conn package_url]log?project_id=$project(logger_project)&pm_project_id=$project_item_id" + +set then_ansi [db_string get_now_julian "select to_char(current_timestamp - '30 days'::INTERVAL,'YYYY-MM-DD')"] + + +set log_note "Last 30 days" + + + +set edit_url "[ad_conn package_url]add-edit?[export_url_vars project_item_id]" + # set up context bar, needs parent_id if {[string equal $project(parent_id) $project_root]} { - set context_bar [ad_context_bar "View"] + set context [list "View"] } else { - set context_bar [ad_context_bar [list "one?project_item_id=$project(parent_id)" "Parent"] "View"] + set context [list [list "one?project_item_id=$project(parent_id)" "Parent"] "View"] } # Tasks, using list-builder --------------------------------- @@ -165,7 +194,7 @@ } } \ - -actions [list "Use process" $process_link "Use a process" "Projects" "index" "View list of tasks" "Tasks" "tasks" "View tasks for all projects" "Processes" "processes" "View and use processes" "Admin" "admin/" "Administration pages"]\ + -actions [list "Use process" $process_link "Use a process"] \ -bulk_actions { "Edit" "task-add-edit" "Edit tasks" } \ @@ -174,7 +203,7 @@ project_id {my_key 1} } \ - -main_class { + -sub_class { narrow } \ -filters { @@ -205,16 +234,11 @@ set latest_start_pretty [lc_time_fmt $latest_start "%x"] set latest_finish_pretty [lc_time_fmt $latest_finish "%x"] - if {[exists_and_not_null earliest_start_j]} { - if {$earliest_start_j < $today_j} { - set slack_time "[expr $latest_start_j - $today_j] days" - } else { - set slack_time "[expr $latest_start_j - $earliest_start_j] days" - } - } else { - set slack_time "n/a" - } - + set slack_time [pm::task::slack_time \ + -earliest_start_j $earliest_start_j \ + -today_j $today_j \ + -latest_start_j $latest_start_j] + } @@ -237,7 +261,7 @@ label "Hours completed" } } \ - -main_class { + -sub_class { narrow } \ -filters { @@ -280,7 +304,7 @@ label "Role" } } \ - -main_class { + -sub_class { narrow } \ -filters { @@ -316,16 +340,19 @@ -multirow versions \ -key item_id \ -elements { - project_name { - label "Subject" + project_id { + label "Version" link_url_col item_url link_html { title "View this project version" } } + project_name { + label "Subject" + } planned_end_date { label "Deadline" } } \ - -main_class { + -sub_class { narrow } \ -filters { @@ -346,7 +373,7 @@ db_multirow -extend { item_url } versions project_versions { } { - set item_url [export_vars -base "one" -override {{project_item_id $item_id}} {project_item_id}] + set item_url [export_vars -base "one" -override {{project_item_id $item_id}} {project_id}] } @@ -359,10 +386,15 @@ db_1row custom_query { } -column_array custom - # end of customizations +# ----------------------------------------------------------------- +# Logger forms and so on - shows time logged, and allows you to log +# other time +# ----------------------------------------------------------------- + + ad_return_template # ------------------------- END OF FILE ------------------------- #