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.14 -r1.15 --- openacs-4/contrib/packages/project-manager/www/index.tcl 27 Apr 2004 00:49:29 -0000 1.14 +++ openacs-4/contrib/packages/project-manager/www/index.tcl 11 Jun 2004 20:58:19 -0000 1.15 @@ -65,75 +65,19 @@ 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 "" +set category_select [pm::util::category_selects \ + -export_vars $export_vars \ + -category_id [template::util::nvl category_id ""] \ + -package_id $package_id \ + ] -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] +# set assignees_filter [pm::project::assignee_filter_select -status_id $status_id] - if {![exists_and_not_null category_choices($tree_id)]} { - set category_choices($tree_id) [list] - } - - - - append category_select "
$export_vars $tree_name:
" -} - - template::list::create \ -name projects \ -multirow projects \ @@ -174,7 +118,7 @@ -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} } category_id { @@ -263,23 +207,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 - }