Index: openacs-4/packages/simulation/lib/sim-template-tasks.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/sim-template-tasks.tcl,v diff -u -r1.34 -r1.35 --- openacs-4/packages/simulation/lib/sim-template-tasks.tcl 23 Jan 2004 14:31:56 -0000 1.34 +++ openacs-4/packages/simulation/lib/sim-template-tasks.tcl 23 Jan 2004 15:01:27 -0000 1.35 @@ -10,6 +10,9 @@ allowed_values {edit display} default_value display } + parent_action_id { + default_value {} + } } set package_id [ad_conn package_id] @@ -35,7 +38,7 @@ #------------------------------------------------------------- if { $display_mode == "edit"} { - set list_actions [list "Add a Task" [export_vars -base task-edit {workflow_id} ] {}] + set list_actions [list "Add a Task" [export_vars -base task-edit { workflow_id parent_action_id {return_url [ad_return_url] } }] {}] } else { set list_actions [list] } @@ -77,16 +80,11 @@ link_url_col assigned_role_edit_url } -lappend elements add_child_action { - label {} - display_template {} - link_url_col add_child_action_url - link_html { title "Add child task" } -} - lappend elements trigger_type { label "
Type" - display_eval {[string totitle $trigger_type]} + display_eval {[string totitle $trigger_type] [ad_decode $num_subactions "" "" "($num_subactions subtasks)"]} + link_url_col add_child_action_url + link_html { title "Edit subtasks" } } lappend elements delete { @@ -200,10 +198,12 @@ (select pretty_name from workflow_fsm_states where state_id = wfa.new_state) as new_state_pretty, - wa.trigger_type + wa.trigger_type, + (select count(*) from workflow_actions where parent_action_id = wa.action_id) as num_subactions from workflow_actions wa left outer join workflow_fsm_actions wfa on (wfa.action_id = wa.action_id) where wa.workflow_id = :workflow_id + and wa.parent_action_id [ad_decode $parent_action_id "" "is null" "= :parent_action_id"] order by wa.sort_order " { incr counter @@ -241,9 +241,12 @@ switch $trigger_type { workflow - parallel - dynamic { - set add_child_action_url [export_vars -base task-edit { workflow_id { parent_action_id $action_id } }] + set add_child_action_url [export_vars -base task-details { action_id }] + } + default { + set num_subactions {} + } } - } lappend actions $action_id }