Index: openacs-4/packages/workflow/tcl/role-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/tcl/role-procs.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/workflow/tcl/role-procs.tcl 10 Jan 2003 13:38:37 -0000 1.1 +++ openacs-4/packages/workflow/tcl/role-procs.tcl 14 Jan 2003 15:09:16 -0000 1.2 @@ -7,23 +7,41 @@ @cvs-id $Id$ } -namespace eval workflow::role { +namespace eval workflow::role {} - ad_proc -public add { - {-workflow_id:required} - {-short_name:required} - {-pretty_name:required} - } { - Creates a new role for a certain workflow. - - @param workflow_id - @param short_name - @param pretty_name - - @author Peter Marklund - } { - set role_id [db_nextval "wf_workflow_roles_seq"] +##### +# +# workflow::role namespace +# +##### - db_dml do_insert {} - } +ad_proc -public workflow::role::add { + {-workflow_id:required} + {-short_name:required} + {-pretty_name:required} +} { + Creates a new role for a certain workflow. + + @param workflow_id + @param short_name + @param pretty_name + + @author Peter Marklund +} { + set role_id [db_nextval "workflow_roles_seq"] + + db_dml do_insert {} } + +ad_proc -public workflow::role::get_id { + {-workflow_id:required} + {-short_name:required} +} { + Return the role_id of the role with the given short_name in the given workflow. + + @param workflow_id The ID of the workflow + @param short_name The short_name of the role + @return role_id of the desired role, or the empty string if it can't be found. +} { + return [db_string select_role_id {} -default {}] +}