Index: openacs-4/packages/simulation/www/simbuild/role-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simbuild/role-delete.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/simulation/www/simbuild/role-delete.tcl 2 Dec 2003 17:24:32 -0000 1.2 +++ openacs-4/packages/simulation/www/simbuild/role-delete.tcl 16 Dec 2003 18:34:00 -0000 1.3 @@ -6,7 +6,7 @@ } { {confirm_p:boolean "f"} role_id:integer - {return_url "."} + {return_url ""} } set package_id [ad_conn package_id] @@ -19,16 +19,21 @@ or st.recipient = :role_id " ] +workflow::role::get -role_id $role_id -array role_array +set name $role_array(pretty_name) +set workflow_id $role_array(workflow_id) + +if { [empty_string_p $return_url] } { + set return_url [export_vars -base template-edit { workflow_id }] +} + if { [template::util::is_true $confirm_p] || $num_of_tasks == 0 } { - permission::require_write_permission -object_id $role_id - simulation::role::delete -role_id $role_id + permission::require_write_permission -object_id $workflow_id + simulation::role::edit -operation "delete" -role_id $role_id ad_returnredirect $return_url } -workflow::role::get -role_id $role_id -array role_array -set name $role_array(pretty_name) -set workflow_id $role_array(workflow_id) -workflow::get -workflow_id $workflow_id -array sim_template_array +workflow::get -workflow_id $workflow_id -array sim_template_array set page_title "Delete $name" set context [list [list "." "Sim Templates"] [list "template-edit?workflow_id=$workflow_id" "$sim_template_array(pretty_name)"] $page_title]