Index: openacs-4/contrib/packages/project-manager/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/index.tcl,v diff -u -r1.13.2.1 -r1.13.2.2 --- openacs-4/contrib/packages/project-manager/www/index.tcl 20 May 2004 17:30:05 -0000 1.13.2.1 +++ openacs-4/contrib/packages/project-manager/www/index.tcl 2 Jul 2004 23:13:49 -0000 1.13.2.2 @@ -20,6 +20,7 @@ {status_id:integer,optional} category_id:multiple,optional {format "normal"} + {assignee_id:integer,optional} } -properties { context:onevalue @@ -65,75 +66,25 @@ set status_id [pm::project::default_status_open] } -# Categories are arranges into category trees. -# Set up an array for each tree. The array contains the category for each tree -db_foreach get_choices { - select - t.name as cat_name, - t.category_id as cat_id, - tm.tree_id - from - category_tree_map tm, - categories c, - category_translations t - where - c.tree_id = tm.tree_id and - c.category_id = t.category_id and - tm.object_id = :package_id and - c.deprecated_p = 'f' - order - by t.name -} { - lappend category_choices($tree_id) [list $cat_name $cat_id] -} - # We want to set up a filter for each category tree. set export_vars [export_vars -form {status_id orderby}] -set category_select "" - -foreach tree_list [db_list_of_lists get_category_trees { - select - tt.name as tree_name, - tt.tree_id - from - category_tree_map tm, - category_tree_translations tt - where - tm.object_id = :package_id and - tm.tree_id = tt.tree_id -}] { - - set tree_name [lindex $tree_list 0] - set tree_id [lindex $tree_list 1] - - if {![exists_and_not_null category_choices($tree_id)]} { - set category_choices($tree_id) [list] - } - - - - append category_select "
$export_vars $tree_name:
" +if {[exists_and_not_null category_id]} { + set temp_category_id $category_id +} else { + set temp_category_id "" } +set category_select [pm::util::category_selects \ + -export_vars $export_vars \ + -category_id $temp_category_id \ + -package_id $package_id \ + ] +set assignees_filter [pm::project::assignee_filter_select -status_id $status_id] + template::list::create \ -name projects \ -multirow projects \ @@ -168,15 +119,21 @@ } } \ -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"] \ -sub_class { narrow } \ -filters { status_id { label "Status" - values {[db_list_of_lists get_status "select description, status_id from pm_project_status order by status_type desc, description"]} + values {[pm::status::project_status_select]} where_clause {s.status_id = :status_id} } + assignee_id { + label "Assignee" + values {$assignees_filter} + where_clause {pa.party_id = :assignee_id} + } category_id { label Categories where_clause {c.category_id = [join [value_if_exists category_id] ","]} @@ -263,23 +220,9 @@ # This spits out the CSV if we happen to be in CSV layout if {[string equal $format csv]} { - #set csv [list::write_output -name pan] - #set outputheaders [ns_conn outputheaders] - #ns_set cput $outputheaders "Content-Disposition" "attachment; filename=pan.csv" - #doc_return 200 "application/text" "$csv" - # set csv [list::write_output -name projects] - - set outputheaders [ns_conn outputheaders] - ns_set cput $outputheaders "Content-Disposition" "attachment; filename=projects.xls" - - # ns_log Notice "csv: $csv" - list::write_output -name projects - # doc_return 200 application/vnd.ms-excel $csv - # ns_return 200 application/vnd.ms-excel $csv - }