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.30.2.19 -r1.30.2.20 --- openacs-4/contrib/packages/project-manager/www/one.tcl 30 Apr 2005 06:53:09 -0000 1.30.2.19 +++ openacs-4/contrib/packages/project-manager/www/one.tcl 2 May 2005 08:15:49 -0000 1.30.2.20 @@ -94,415 +94,34 @@ # the unique identifier for this package set package_id [ad_conn package_id] set package_url [ad_conn package_url] -set user_id [ad_maybe_redirect_for_registration] +set user_id [auth::require_login] # terminology and other parameters set project_term [parameter::get -parameter "ProjectName" -default "Project"] -set project_term_lower [parameter::get -parameter "projectname" -default "project"] -set task_term [parameter::get -parameter "TaskName" -default "Task"] -set use_goal_p [parameter::get -parameter "UseGoalP" -default "1"] -set hide_done_tasks_p [parameter::get -parameter "HideDoneTaskP" -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"] set use_subprojects_p [parameter::get -parameter "UseSubprojectsP" -default "0"] # permissions permission::require_permission -party_id $user_id -object_id $package_id -privilege read -set write_p [permission::permission_p -object_id $package_id -privilege write] -set create_p [permission::permission_p -object_id $package_id -privilege create] - - -set process_instance_options [pm::process::instance_options \ - -project_item_id $project_item_id \ - -process_instance_id $instance_id] - - -set process_reminder_url [export_vars -base process-reminder {instance_id project_item_id return_url}] - -if {[empty_string_p $process_instance_options]} { - set instance_html "" -} else { - - set instance_html " -
" -} - -# we do this so that the list builder templates don't add a where -# clause when instance_id is set. -if {[empty_string_p $instance_id]} { - unset instance_id -} - -# categories - -set categories [list] -set cat_list [category::get_mapped_categories $project_item_id] -foreach cat $cat_list { - lappend categories [category::get_name $cat] -} - +# Get Project Information db_1row project_query { } -column_array project -set richtext_list [list $project(description) $project(mime_type)] - -set project(description) [template::util::richtext::get_property html_value $richtext_list] - -set project_root [db_exec_plsql get_root_folder { }] - -set project(planned_start_date) [lc_time_fmt $project(planned_start_date) "%x"] -set project(planned_end_date) [lc_time_fmt $project(planned_end_date) "%x"] -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"] - -# ---------------- -# 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 "Add comment" - - -# we can also get the link to the logger instance. -set logger_url [pm::util::logger_url] -set logger_project_url "$logger_url?project_id=$project(logger_project)" - -if {![exists_and_not_null logger_variable_id]} { - set logger_variable_id [logger::project::get_primary_variable \ - -project_id $project(logger_project)] -} - -set variable_widget [logger::ui::variable_select_widget \ - -project_id $project(logger_project) \ - -current_variable_id $logger_variable_id \ - -select_name logger_variable_id] - -set variable_exports [export_vars -form -entire_form -exclude {logger_variable_id logger_days }] - -set log_url "${logger_url}log?project_id=$project(logger_project)&pm_project_id=$project_item_id&return_url=$return_url&variable_id=$logger_variable_id" - -# There is no point showing an empty listbox, which happens if the user assigns all roles to himself. Doing it this way avoids another trip to the database. -set select_list_html [pm::role::project_select_list -select_name "role_id" -project_item_id $project_item_id -party_id $user_id] -if {[string compare $select_list_html ""]} { - set assignee_add_self_widget "Add myself as " - set roles_listbox_p 1 -} else { - set roles_listbox_p 0 -} - -# Only need a 'remove myself' link if you are already assigned -set assigned_p [pm::project::assigned_p -project_item_id $project_item_id -party_id $user_id] -if {$assigned_p} { - set assignee_remove_self_url [export_vars -base project-assign-remove {project_item_id user_id return_url}] -} - -set assignee_edit_url [export_vars -base project-assign-edit {project_item_id return_url}] - -set today_ansi [clock format [clock scan today] -format "%Y-%m-%d"] -set then_ansi [clock format [clock scan "-$logger_days days"] -format "%Y-%m-%d"] - - -set day_widget "Last Days" - - +# Context Bar and Title information +set portlet_master "/packages/project-manager/lib/portlet" +set project_root [pm::util::get_root_folder -package_id $package_id] set my_title "$project_term \#$project_item_id: $project(project_name)" -set edit_url "[ad_conn package_url]add-edit?[export_url_vars project_item_id]" - -# set up context bar, needs parent_id +# set up context bar, needs project(parent_id) if {[string equal $project(parent_id) $project_root]} { set context [list "$project(project_name)"] } else { - set context [list [list "one?project_item_id=$project(parent_id)" "Parent"] "$project(project_name)"] + set parent_name [pm::util::get_project_name -project_item_id $project(parent_id)] + set context [list [list "one?project_item_id=$project(parent_id)" "$parent_name"] "$project(project_name)"] } -set processes_html [pm::process::select_html] -# Tasks, using list-builder --------------------------------- - -# Hide finished tasks. This should be added as a filter, but I did not have time to look it up in the howto.