Index: openacs-4/packages/workflow/tcl/action-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/tcl/action-procs.tcl,v diff -u -N -r1.28 -r1.29 --- openacs-4/packages/workflow/tcl/action-procs.tcl 23 Jan 2004 11:02:27 -0000 1.28 +++ openacs-4/packages/workflow/tcl/action-procs.tcl 23 Jan 2004 16:00:43 -0000 1.29 @@ -731,8 +731,41 @@ return $action_data(action_ids) } +ad_proc -public workflow::action::get_options { + {-workflow_id:required} +} { + Get an options list of actions for use with form builder. +} { + set result [list] + foreach action_id [workflow::action::get_ids -workflow_id $workflow_id] { + workflow::action::get -action_id $action_id -array action + lappend result [list $action(pretty_name) $action_id] + } + return $result +} +ad_proc -public workflow::action::pretty_name_unique_p { + -workflow_id:required + -pretty_name:required + {-action_id {}} +} { + Check if suggested pretty_name is unique. + + @return 1 if unique, 0 if not unique. +} { + set exists_p [db_string name_exists { + select count(*) + from workflow_actions + where workflow_id = :workflow_id + and pretty_name = :pretty_name + and (:action_id is null or action_id != :action_id) + }] + return [expr !$exists_p] +} + + + ###################################################################### # # workflow::action::fsm