Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/case.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/case.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/case.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/case.tcl 19 Nov 2001 18:27:40 -0000 1.2 @@ -10,9 +10,11 @@ case:onerow context_bar actions:multirow - workflow_img_tag + return_url } +set return_url "[ns_conn url]?[export_vars -url {case_id}]" + db_1row case_info { select case_id, acs_object.name(object_id) as object_name, @@ -30,8 +32,8 @@ template::multirow create actions url title switch $case(state) { active { - template::multirow append actions "case-state-change?[export_url_vars case_id]&action=suspend" "suspend" - template::multirow append actions "case-state-change?[export_url_vars case_id]&action=cancel" "cancel" + template::multirow append actions "case-state-change?[export_vars -url {case_id {action suspend}}]" "suspend" + template::multirow append actions "case-state-change?[export_vars -url {case_id {action cancel}}]" "cancel" } suspended { template::multirow append actions "case-state-change?[export_url_vars case_id]&action=resume" "resume" @@ -42,116 +44,13 @@ } } -set workflow_info [wf_get_workflow_net $case(workflow_key)] -array set workflow $workflow_info -wf_decorate_workflow workflow +ad_return_template -set date_format "Mon fmDDfm, YYYY HH24:MI:SS" -db_multirow current_tasks current_tasks { - select t.task_id, - t.transition_key, - t.state, - t.case_id, - tr.transition_name, - to_char(t.enabled_date, :date_format) as enabled_date_pretty - from wf_tasks t, wf_transitions tr - where t.case_id = :case_id - and t.state in ('enabled', 'started') - and tr.workflow_key = t.workflow_key - and tr.transition_key = t.transition_key - order by t.enabled_date desc -} -db_multirow old_tasks old_tasks { - select t.task_id, - t.transition_key, - t.state, - t.case_id, - tr.transition_name, - to_char(t.enabled_date, :date_format) as enabled_date_pretty - from wf_tasks t, wf_transitions tr - where t.case_id = :case_id - and t.state not in ('enabled', 'started') - and tr.workflow_key = t.workflow_key - and tr.transition_key = t.transition_key - order by t.enabled_date desc -} -##### -# -# Add marking to the graph -# -##### -foreach place_key $workflow(places) { - set workflow(place,$place_key,num_tokens) 0 -} -foreach transition_key $workflow(transitions) { - set workflow(transition,$transition_key,num_tokens) 0 -} -db_foreach tokens { - select tok.token_id, - tok.place_key, - tok.locked_task_id, - ta.transition_key - from wf_tokens tok, - wf_tasks ta - where tok.case_id = :case_id - and ta.task_id (+) = tok.locked_task_id - and tok.state in ('free', 'locked') -} { - if { [empty_string_p $transition_key] } { - incr workflow(place,$place_key,num_tokens) - } else { - incr workflow(transition,$transition_key,num_tokens) - } -} -foreach place_key $workflow(places) { - if { $workflow(place,$place_key,num_tokens) > 0 } { - append workflow(place,$place_key,place_name) "\\n[string repeat "*" $workflow(place,$place_key,num_tokens)]" - lappend workflow(selected_place_key) $place_key - } -} -foreach transition_key $workflow(transitions) { - if { $workflow(transition,$transition_key,num_tokens) > 0 } { - append workflow(transition,$transition_key,transition_name) "\\n[string repeat "*" $workflow(transition,$transition_key,num_tokens)]" - lappend workflow(selected_transition_key) $transition_key - } -} - - -db_release_unused_handles - -##### -# -# Create the workflow gif -# -##### - -if { [wf_graphviz_installed_p] } { - - set dot_text [wf_generate_dot_representation workflow] - - set tmpfile [wf_graphviz_dot_exec -to_file -output gif $dot_text] - - set width_and_height "" - if { ![catch { set image_size [ns_gifsize $tmpfile] } error] } { - if { ![empty_string_p $image_size] } { - set width_and_height "width=[lindex $image_size 0] height=[lindex $image_size 1]" - } - } - - ad_set_client_property wf wf_net_tmpfile $tmpfile - - set workflow_img_tag "\"Graphical" -} else { - set workflow_img_tag "" -} - - -ad_return_template \ No newline at end of file