Index: openacs-4/packages/workflow/tcl/case-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/tcl/case-procs.tcl,v diff -u -r1.50 -r1.51 --- openacs-4/packages/workflow/tcl/case-procs.tcl 26 May 2017 17:41:51 -0000 1.50 +++ openacs-4/packages/workflow/tcl/case-procs.tcl 8 Apr 2018 05:35:24 -0000 1.51 @@ -1580,7 +1580,7 @@ # Is this an allowed role for this action? set allowed_roles [workflow::action::get_allowed_roles -action_id $action_id] - if { [lsearch $allowed_roles $role_id] != -1 } { + if {$role_id in $allowed_roles} { return 1 } } Index: openacs-4/packages/workflow/tcl/graph-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/tcl/graph-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/workflow/tcl/graph-procs.tcl 17 Sep 2013 19:10:34 -0000 1.3 +++ openacs-4/packages/workflow/tcl/graph-procs.tcl 8 Apr 2018 05:35:24 -0000 1.4 @@ -26,38 +26,38 @@ } { # set filename set path [acs_package_root_dir workflow] - append path /www/admin/graph + append path /www/admin/graph if {$options_array_name ne ""} { - upvar $options_array_name options + upvar $options_array_name options } - #check to see what options were passed in, init things that aren't there + #check to see what options were passed in, init things that aren't there set available_options [list "include_subject_count" "subject_term" "subject_term_pl"] set option_names [array names options] foreach opt $available_options { - - #default the value - if {[lsearch $option_names $opt] == -1} { - set options($opt) "" + + #default the value + if {$opt ni $option_names} { + set options($opt) "" } } #exchange some defaults for more descriptive values if {$options(subject_term) eq ""} { - set options(subject_term) "subject" - set options(subject_term_pl) "subjects" + set options(subject_term) "subject" + set options(subject_term_pl) "subjects" } if {$filename eq ""} { - set filename workflow_$workflow_id + set filename workflow_$workflow_id } - set current_state "" - set previous_state "" + set current_state "" + set previous_state "" if {$highlight ne ""} { set current_state [lindex $highlight 0] set previous_state [lreplace $highlight 0 0] @@ -70,32 +70,32 @@ set states [workflow::fsm::get_states -workflow_id $workflow_id] - #get the subject counts for the workflow + #get the subject counts for the workflow if {$options(include_subject_count) == 1} { - ptracker::subject::get_subject_count_in_workflow -workflow_id $workflow_id\ - -array_name "subjects_in_workflow" + ptracker::subject::get_subject_count_in_workflow -workflow_id $workflow_id\ + -array_name "subjects_in_workflow" } foreach state_id $states { - workflow::state::fsm::get -state_id $state_id -array "state_info" + workflow::state::fsm::get -state_id $state_id -array "state_info" - set num_subjects_in_state "" + set num_subjects_in_state "" if {[array exists subjects_in_workflow]} { - set subject_count 0 - if {[lsearch [array names subjects_in_workflow] $state_id] != -1} { - set subject_count $subjects_in_workflow($state_id) + set subject_count 0 + if {$state_id in [array names subjects_in_workflow]} { + set subject_count $subjects_in_workflow($state_id) } - set descriptor $options(subject_term_pl) + set descriptor $options(subject_term_pl) if {$subject_count == 1} { - set descriptor $options(subject_term) + set descriptor $options(subject_term) } - set num_subjects_in_state "($subject_count $descriptor)" + set num_subjects_in_state "($subject_count $descriptor)" } if {$state_id == $current_state} { append dot " state_$state_id \[label=\"$state_info(pretty_name) $num_subjects_in_state\", color=darkorange1\];\n" - } elseif {[lsearch $previous_state $state_id]!=-1} { + } elseif {$state_id in $previous_state} { append dot " state_$state_id \[label=\"$state_info(pretty_name) $num_subjects_in_state\", color=steelblue3\];\n" } else { append dot " state_$state_id \[label=\"$state_info(pretty_name) $num_subjects_in_state\"\];\n" @@ -104,7 +104,7 @@ set actions [workflow::action::fsm::get_ids -workflow_id $workflow_id] foreach action_id $actions { - workflow::action::get -action_id $action_id -array "action_info" + workflow::action::get -action_id $action_id -array "action_info" if {$action_info(new_state) ne ""} { if {$action_info(assigned_states) ne ""} { @@ -123,9 +123,15 @@ append dot "\}\n" set flag [catch { - template::util::write_file $path/$filename\.dot $dot - exec /usr/bin/dot -Tjpg $path/$filename\.dot -o $path/$filename\.jpg + template::util::write_file $path/$filename\.dot $dot + exec /usr/bin/dot -Tjpg $path/$filename\.dot -o $path/$filename\.jpg } errmsg] - return $flag + return $flag } + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: