Index: openacs-4/contrib/packages/simulation/lib/sim-templates.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/lib/Attic/sim-templates.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/contrib/packages/simulation/lib/sim-templates.tcl 17 Dec 2003 20:25:34 -0000 1.12 +++ openacs-4/contrib/packages/simulation/lib/sim-templates.tcl 8 Jan 2004 09:30:51 -0000 1.13 @@ -76,23 +76,27 @@ label "Ready" display_eval {[ad_decode $sim_type "ready_template" "Yes" "No"]} } - delete { + copy { sub_class narrow display_template { + Copy + } + link_url_col clone_url + link_html { title "Clone this template" } + } + delete { + sub_class narrow + link_url_col delete_url + link_html { + title "Delete this template" + onclick "return confirm('Are you sure you want to delete template @sim_templates.name@?');" + } + display_template { - Delete - } } - clone { - display_template { - Clone this template - } - - } } } } @@ -124,9 +128,13 @@ (select count(role_id) from workflow_roles where workflow_id = w.workflow_id) as role_count, - (select count(action_id) - from workflow_actions - where workflow_id = w.workflow_id) as task_count + (select count(a2.action_id) + from workflow_actions a2 + where a2.workflow_id = w.workflow_id + and not exists (select 1 + from workflow_initial_action ia2 + where ia2.workflow_id = w.workflow_id + and ia2.action_id = a2.action_id)) as task_count from workflows w, sim_simulations ss, acs_objects a @@ -142,9 +150,10 @@ set view_url [export_vars -base "[apm_package_url_from_id $package_id]simbuild/template-edit" {workflow_id} ] - set delete_url [export_vars -base "[apm_package_url_from_id $package_id]simbuild/template-delete" {workflow_id} ] - set clone_url [export_vars -base "[apm_package_url_from_id $package_id]simbuild/template-clone" {workflow_id} ] set edit_p [permission::write_permission_p -object_id $workflow_id] + + set delete_url [export_vars -base "[apm_package_url_from_id $package_id]simbuild/template-delete" {workflow_id} ] + }