Index: openacs-4/contrib/packages/project-manager/tcl/project-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/tcl/Attic/project-procs.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/contrib/packages/project-manager/tcl/project-procs.tcl 3 Jun 2004 21:32:01 -0000 1.10 +++ openacs-4/contrib/packages/project-manager/tcl/project-procs.tcl 4 Jun 2004 00:04:29 -0000 1.11 @@ -1432,3 +1432,30 @@ } +ad_proc -public pm::project::open_p { + {-project_item_id:required} +} { + Returns true if the project is open + + @author Jade Rubick (jader@bread.com) + @creation-date 2004-06-03 + + @param project_item_id + + @return 1 if open, 0 if closed + + @error +} { + set return_val [db_string get_open_or_closed { + SELECT + case when status_type = 'c' then 0 else 1 end + FROM + pm_projectsx p, + pm_project_status s + WHERE + p.status_id = s.status_id and + p.item_id = :project_item_id + } -default "0"] + + return $return_val +} Index: openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-add-edit.tcl,v diff -u -r1.34 -r1.35 --- openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl 3 Jun 2004 21:32:13 -0000 1.34 +++ openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl 4 Jun 2004 00:04:31 -0000 1.35 @@ -772,6 +772,26 @@ -number $number \ -current_number $i] + + # if the current project is closed, we need to append it to the + # list of open projects + if {![pm::project::open_p -project_item_id "$project_item_id_arr($i)"]} { + set project_options_plus [db_list_of_lists get_closed_project " + SELECT + case when o.name is null then p.title || ' -- Closed' else o.name || ' - ' || p.title || ' -- Closed' end as title, + p.item_id + FROM + pm_projectsx p LEFT JOIN + organizations o ON p.customer_id = o.organization_id + WHERE + p.item_id = $project_item_id_arr($i) + "] + + set project_options_plus [concat $project_options_plus $project_options] + } else { + set project_options_plus $project_options + } + ad_form -extend \ -name add_edit \ -form \ @@ -784,7 +804,7 @@ ] \ [list project_item_ids.$i:text(select) \ {label "Project"} \ - {options $project_options} \ + {options $project_options_plus} \ {value {$project_item_id_arr($i)}} \ ] \ [list task_item_id.$i:text(hidden) \