Feature #559 » ro559-add_workflow_graphviz_graph-r4574.patch
| app/helpers/workflows_helper.rb (working copy) | ||
|---|---|---|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||
|
module WorkflowsHelper
|
||
|
def generate_workflow_graph(role, tracker)
|
||
|
edges = role.workflows.inject("") do |edge, workflow|
|
||
|
workflow.tracker_id == tracker.id ? "#{edge}#{workflow.old_status}->#{workflow.new_status};" : edge
|
||
|
end
|
||
|
|
||
|
"http://chart.apis.google.com/chart?cht=gv&chl=digraph{#{CGI.escape(edges.gsub(/ /, '_').toutf8)}}&chs=547x547"
|
||
|
end
|
||
|
end
|
||
| app/views/workflows/edit.rhtml (working copy) | ||
|---|---|---|
|
<% end %>
|
||
|
<% html_title(l(:label_workflow)) -%>
|
||
|
<%= image_tag(generate_workflow_graph(@role, @tracker)) if @role %>
|
||