Index: openacs-4/packages/project-manager/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/index.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/project-manager/www/index.tcl 30 Apr 2005 07:17:46 -0000 1.3 +++ openacs-4/packages/project-manager/www/index.tcl 26 May 2005 09:34:29 -0000 1.4 @@ -16,12 +16,12 @@ @return project_term_lower Terminology for projects (lower case) } { - orderby_project:optional + orderby:optional {status_id:integer,optional} {searchterm ""} category_id:multiple,optional {format "normal"} - {assignee_id:integer,optional} + {assignee_id ""} } -properties { context:onevalue @@ -37,22 +37,15 @@ # --------------------------------------------------------------- # -# terminology -set task_term [parameter::get -parameter "TaskName" -default "Task"] -set task_term_lower [parameter::get -parameter "taskname" -default "task"] -set project_term [parameter::get -parameter "ProjectName" -default "Project"] -set project_term_lower [parameter::get -parameter "projectname" -default "project"] - -set exporting_vars { status_id category_id assignee_id orderby_project format } +set exporting_vars { status_id category_id assignee_id orderby format } set hidden_vars [export_vars -form $exporting_vars] - # set up context bar set context [list] # the unique identifier for this package set package_id [ad_conn package_id] -set user_id [auth::require_login] +set user_id [ad_maybe_redirect_for_registration] # permissions permission::require_permission -party_id $user_id -object_id $package_id -privilege read @@ -62,24 +55,28 @@ set admin_p [permission::permission_p -object_id $package_id -privilege admin] # root CR folder -set root_folder [db_string get_root "select pm_project__get_root_folder (:package_id, 'f')"] +set root_folder [pm::util::get_root_folder -package_id $package_id] # Projects, using list-builder --------------------------------- -# set default values +# Set status if {![exists_and_not_null status_id]} { - set status_id [pm::project::default_status_open] + set status_where_clause "" + set status_id "" +} else { + set status_where_clause {p.status_id = :status_id} } - # We want to set up a filter for each category tree. set export_vars [export_vars -form {status_id orderby}] if {[exists_and_not_null category_id]} { set temp_category_id $category_id + set pass_cat $category_id } else { set temp_category_id "" + set pass_cat "" } set category_select [pm::util::category_selects \ @@ -105,17 +102,17 @@ set default_orderby [pm::project::index_default_orderby] -if {[exists_and_not_null orderby_project]} { +if {[exists_and_not_null orderby]} { pm::project::index_default_orderby \ - -set $orderby_project + -set $orderby } -# Get url of the organizations package if it has been mounted for the links on the index page. -set organizations_url [util_memoize [list site_node::get_package_url -package_key organizations]] -if {[empty_string_p $organizations_url]} { - set organization_column "@projects.customer_name@" +# Get url of the contacts package if it has been mounted for the links on the index page. +set contacts_url [util_memoize [list site_node::get_package_url -package_key contacts]] +if {[empty_string_p $contacts_url]} { + set contact_column "@projects.customer_name@" } else { - set organization_column "@projects.customer_name@" + set contact_column "@projects.customer_name@" } @@ -126,49 +123,49 @@ -key project_item_id \ -elements { project_name { - label "Project name" + label "[_ project-manager.Project_name]" link_url_col item_url - link_html { title "View this project version" } + link_html { title "[_ project-manager.lt_View_this_project_ver]" } } customer_name { - label "Customer" + label "[_ project-manager.Customer]" display_template " -$organization_column@projects.customer_name@ +$contact_column@projects.customer_name@ " } earliest_finish_date { - label "Earliest finish" + label "[_ project-manager.Earliest_finish]" display_template "@projects.earliest_finish_date@@projects.earliest_finish_date@" } latest_finish_date { - label "Latest Finish" + label "[_ project-manager.Latest_Finish]" display_template "@projects.latest_finish_date@@projects.latest_finish_date@" } actual_hours_completed { - label "Hours completed" + label "[_ project-manager.Hours_completed]" display_template "@projects.actual_hours_completed@/@projects.estimated_hours_total@" } category_id { display_template "" } } \ - -actions [list "Add project" "add-edit" "Add project" "Customers" "[site_node::get_package_url -package_key organizations]" "View customers"] \ - -bulk_actions [list "Close" "bulk-close" "Close project"] \ + -actions [list "[_ project-manager.Add_project]" "add-edit" "[_ project-manager.Add_project]" "[_ project-manager.Customers]" "[site_node::get_package_url -package_key contacts]" "[_ project-manager.View_customers]"] \ + -bulk_actions [list "[_ project-manager.Close]" "bulk-close" "[_ project-manager.Close_project]"] \ -sub_class { narrow } \ -filters { searchterm { - label "Search" + label "[_ project-manager.Search_1]" where_clause {$search_term_where} } status_id { - label "Status" + label "[_ project-manager.Status_1]" values {[pm::status::project_status_select]} - where_clause {s.status_id = :status_id} + where_clause {$status_where_clause} } assignee_id { - label "Assignee" + label "[_ project-manager.Assignee]" values {$assignees_filter} where_clause {pa.party_id = :assignee_id} } @@ -180,45 +177,45 @@ -orderby { default_value $default_orderby project_name { - label "Project name" + label "[_ project-manager.Project_name]" orderby_desc "upper(p.title) desc" orderby_asc "upper(p.title) asc" default_direction asc } customer_name { - label "Customer Name" + label "[_ project-manager.Customer_Name]" orderby_desc "upper(o.name) desc, earliest_finish_date desc" orderby_asc "upper(o.name) asc, earliest_finish_date asc" default_direction asc } category_id { - label "Categories" + label "[_ project-manager.Categories]" orderby_desc "c.category_name desc" orderby_asc "c.category_name asc" default_direction asc } earliest_finish_date { - label "Earliest finish" + label "[_ project-manager.Earliest_finish]" orderby_desc "p.earliest_finish_date desc" orderby_asc "p.earliest_finish_date asc" default_direction asc } latest_finish_date { - label "Latest finish" + label "[_ project-manager.Latest_finish]" orderby_desc "p.latest_finish_date desc" orderby_asc "p.latest_finish_date asc" default_direction asc } actual_hours_completed { - label "Hours completed" + label "[_ project-manager.Hours_completed]" orderby_desc "p.actual_hours_completed desc" orderby_asc "p.actual_hours_completed asc" default_direction asc } } \ -formats { normal { - label "Table" + label "[_ project-manager.Table]" layout table row { project_name {} @@ -230,7 +227,7 @@ } } csv { - label "CSV" + label "[_ project-manager.CSV]" output csv page_size 0 row { @@ -243,13 +240,13 @@ } } } \ - -orderby_name orderby_project \ + -orderby_name orderby \ -html { width 100% } # Note: On oracle it you get "ORA-03113: end-of-file on communication channel" -# please drop the index cat_object_map_i. Unique indexes are not allowed in organization index tables +# please drop the index cat_object_map_i. Unique indexes are not allowed in contact index tables db_multirow -extend { item_url } projects project_folders { } {