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.6.2.8 -r1.6.2.9 --- openacs-4/contrib/packages/project-manager/tcl/project-procs.tcl 8 Oct 2004 21:25:04 -0000 1.6.2.8 +++ openacs-4/contrib/packages/project-manager/tcl/project-procs.tcl 26 Oct 2004 01:22:27 -0000 1.6.2.9 @@ -81,7 +81,7 @@ -logger_project_id:required -variable_id:required -value:required - -timestamp_ansi:required + {-timestamp_ansi ""} {-description ""} {-task_item_id ""} {-project_item_id ""} @@ -145,6 +145,10 @@ set creation_user [ad_conn user_id] } + if {[empty_string_p $timestamp_ansi]} { + set timestamp_ansi [clock format [clock seconds] -format "%Y-%m-%d"] + } + # add in the new entry logger::entry::new -entry_id $entry_id \ -project_id $logger_project_id \ @@ -157,21 +161,13 @@ # if we have a pm_task_id, then we need to note that this # entry is logged to a particular task. if {[exists_and_not_null task_item_id]} { - db_dml add_logger_map " - INSERT INTO - pm_task_logger_proj_map - (task_item_id, - logger_entry) - VALUES - (:task_item_id, - :entry_id) - " + db_dml add_task_logger_map { } set returnval [pm::task::update_hours \ -task_item_id $task_item_id \ -update_tasks_p $update_status_p] - if {[string equal $update_status_p "t"]} { + if {[string is true $update_status_p]} { pm::project::compute_status $project_item_id } } @@ -1595,7 +1591,6 @@ } - ad_proc -public pm::project::get_list_of_open { } { Returns a list of lists, of all open project ids and their names @@ -1608,28 +1603,53 @@ @error } { - set return_val [db_list_of_lists get_vals " - SELECT - case when o.name is null then p.title else o.name || ' - ' || p.title end, - p.item_id - FROM pm_projectsx p - LEFT JOIN - organizations o - ON p.customer_id = o.organization_id, - cr_items i, - pm_project_status s - WHERE - p.project_id = i.live_revision and - s.status_id = p.status_id and - s.status_type = 'o' - ORDER BY - lower(o.name), lower(p.title) - "] + set return_val [db_list_of_lists get_vals { }] return $return_val } +ad_proc -public pm::project::select_list_of_open { + {-selected ""} +} { + Returns a select list of all open project ids and their names + + @author Jade Rubick (jader@bread.com) + @creation-date 2004-10-13 + + @return html for select list of open projects + + @error +} { + # is the selected project closed? + set open_p [pm::project::open_p -project_item_id $selected] + + if {[string is false $open_p]} { + set name [pm::project::name -project_item_id $selected] + set html "" + } else { + set html "" + } + + set list_of_lists [pm::project::get_list_of_open] + + foreach lol $list_of_lists { + set name [lindex $lol 0] + set id [lindex $lol 1] + + if {[string equal $id $selected]} { + set sel "selected=\"selected\"" + } else { + set sel "" + } + + append html "\n" + } + + return $html +} + + ad_proc -public pm::project::close { {-project_item_id:required} } { @@ -1944,3 +1964,5 @@ return "[ad_url][ad_conn package_url]one?project_item_id=$project_item_id" } + +