Index: openacs-4/contrib/packages/project-manager/tcl/role-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/tcl/Attic/role-procs.tcl,v diff -u -r1.2.2.4 -r1.2.2.5 --- openacs-4/contrib/packages/project-manager/tcl/role-procs.tcl 26 Oct 2004 01:22:27 -0000 1.2.2.4 +++ openacs-4/contrib/packages/project-manager/tcl/role-procs.tcl 20 Dec 2004 19:47:39 -0000 1.2.2.5 @@ -1,4 +1,4 @@ -# +# ad_library { @@ -36,8 +36,8 @@ @author Jade Rubick (jader@bread.com) @creation-date 2004-06-11 - @return - + @return + @error } { return [util_memoize [list pm::role::select_list_filter_not_cached] 300] @@ -46,13 +46,13 @@ ad_proc -private pm::role::select_list_filter_not_cached {} { Returns a select list. Used so pm::role::select_list can be cached. - + @author Jade Rubick (jader@bread.com) @creation-date 2004-06-11 - - @return - - @error + + @return + + @error } { return [db_list_of_lists get_roles " SELECT @@ -69,13 +69,13 @@ {-select_name:required} } { Returns a select list, suitable for use in an HTML form. - + @author Jade Rubick (jader@bread.com) @creation-date 2004-06-11 - - @return - - @error + + @return + + @error } { set select_list "" + + set select_list_options [pm::role::project_select_list_filter -project_item_id $project_item_id -party_id $party_id] + + foreach option $select_list_options { + set description [lindex $option 0] + set value [lindex $option 1] + append select_list "" + } + + append select_list "" + + return $select_list +} + + +ad_proc -public pm::role::task_select_list_filter { + -task_item_id:required + -party_id:required +} { + Returns a select list. + + @author Richard Hamilton (ricky.hamilton@btopenworld.com) + @creation-date 2004-12-18 + + @param task_item_id + + @param party_id + + @return + + @error +} { + return [util_memoize [list pm::role::task_select_list_filter_not_cached -task_item_id $task_item_id -party_id $party_id] 300] +} + + +ad_proc -private pm::role::task_select_list_filter_not_cached { + -task_item_id:required + -party_id:required +} { + Returns a select list. Used so pm::role::task_select_list can be cached. + + @author Richard Hamilton (ricky.hamilton@btopenworld.com) + @creation-date 2004-12-18 + + @param task_item_id + + @param party_id + + @return + + @error +} { + return [db_list_of_lists get_roles " + SELECT + one_line || ' (' || substring(one_line from 1 for 1) || ')' as one_line, + role_id + FROM + pm_roles as r + WHERE NOT EXISTS + (SELECT 1 + FROM + pm_task_assignment as ta + WHERE + r.role_id = ta.role_id and + ta.task_id = :task_item_id and + ta.party_id = :party_id) + ORDER BY + role_id"] +} + + +ad_proc -public pm::role::task_select_list { + {-select_name:required} + {-task_item_id:required} + {-party_id:required} +} { + Returns a select list, suitable for use in an HTML form. + + @author Jade Rubick (jader@bread.com) + @creation-date 2004-06-11 + + @return + + @error +} { + set select_list "" + + return $select_list +} + + ad_proc -public pm::role::name { -role_id:required } { Returns the one_line for the role from the role_id - + @author Jade Rubick (jader@bread.com) @creation-date 2004-09-08 - + @param role_id @return one_line @@ -115,14 +289,14 @@ -role_id:required } { Returns the one_line for the role from the role_id - + @author Jade Rubick (jader@bread.com) @creation-date 2004-09-08 @param role_id @return one_line - + @error } { return [db_string get_one_line {