<%= render :partial => 'action_menu' %>

<%=l(:label_workflow)%>

<%=l(:text_workflow_edit)%>:

<% form_tag({}, :method => 'get') do %>

<%= select_tag 'role_id', options_from_collection_for_select(@roles, "id", "name", @role && @role.id) %> <%= select_tag 'tracker_id', options_from_collection_for_select(@trackers, "id", "name", @tracker && @tracker.id) %> <%= hidden_field_tag 'used_statuses_only', '0' %>

<%= submit_tag l(:button_edit), :name => nil %>

<% end %> <% if @tracker && @role && @statuses.any? %> <% form_tag({}, :id => 'workflow_form' ) do %> <%= hidden_field_tag 'tracker_id', @tracker.id %> <%= hidden_field_tag 'role_id', @role.id %>
<% for new_status in @statuses %> <% end %> <% for old_status in @statuses %> "> <% new_status_ids_allowed = old_status.find_new_statuses_allowed_to([@role], @tracker).collect(&:id) -%> <% for new_status in @statuses -%> <% end -%> <% end %>
<%=l(:label_current_status)%> <%=l(:label_new_statuses_allowed)%>
<%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('input.new-status-#{new_status.id}')", :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %> <%= new_status.name %>
<%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('input.old-status-#{old_status.id}')", :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %> <%= old_status.name %> <%= check_box_tag "issue_status[#{ old_status.id }][]", new_status.id, new_status_ids_allowed.include?(new_status.id), :class => "old-status-#{old_status.id} new-status-#{new_status.id}" %>

<%= check_all_links 'workflow_form' %>

<%= submit_tag l(:button_save) %> <% end %> <% end %> <% html_title(l(:label_workflow)) -%>