Index: openacs-4/contrib/packages/simulation/lib/sim-template-states.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/lib/Attic/sim-template-states.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/simulation/lib/sim-template-states.tcl 9 Jan 2004 10:53:06 -0000 1.1 +++ openacs-4/contrib/packages/simulation/lib/sim-template-states.tcl 12 Jan 2004 11:31:01 -0000 1.2 @@ -29,6 +29,22 @@ Edit } } + down { + sub_class narrow + display_template { + + + + } + } + up { + sub_class narrow + display_template { + + + + } + } name { label "Name" display_col pretty_name @@ -46,14 +62,24 @@ #------------------------------------------------------------- # states db_multirow #------------------------------------------------------------- -set return_url "[ad_conn url]?[ad_conn query]" -db_multirow -extend { edit_url char_url delete_url } states select_states " +set counter 0 +db_multirow -extend { edit_url char_url delete_url up_url down_url } states select_states " select ws.state_id, - ws.pretty_name + ws.pretty_name, + ws.sort_order from workflow_fsm_states ws where ws.workflow_id = :workflow_id order by ws.sort_order " { + incr counter set edit_url [export_vars -base "[ad_conn package_url]simbuild/state-edit" { state_id }] - set delete_url [export_vars -base "[ad_conn package_url]simbuild/state-delete" { state_id return_url }] + set delete_url [export_vars -base "[ad_conn package_url]simbuild/state-delete" { state_id { return_url [ad_return_url] } }] + if { $counter > 1 } { + set up_url [export_vars -base "[ad_conn package_url]simbuild/template-object-reorder" { { type state } state_id { direction up } { return_url [ad_return_url] } }] + } + set down_url [export_vars -base "[ad_conn package_url]simbuild/template-object-reorder" { { type state } state_id { direction down } { return_url [ad_return_url] } }] } + + +# Get rid of the last down_url +set states:${counter}(down_url) {}