2012-07-15 18:12:17 +04:00
|
|
|
<%= render :partial => 'action_menu' %>
|
|
|
|
|
|
|
|
<h2><%=l(:label_workflow)%></h2>
|
|
|
|
|
|
|
|
<div class="tabs">
|
|
|
|
<ul>
|
2012-07-15 18:19:01 +04:00
|
|
|
<li><%= link_to l(:label_status_transitions), {:action => 'edit', :role_id => @role, :tracker_id => @tracker} %></li>
|
|
|
|
<li><%= link_to l(:label_fields_permissions), {:action => 'permissions', :role_id => @role, :tracker_id => @tracker}, :class => 'selected' %></li>
|
2012-07-15 18:12:17 +04:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<p><%=l(:text_workflow_edit)%>:</p>
|
|
|
|
|
|
|
|
<%= form_tag({}, :method => 'get') do %>
|
|
|
|
<p>
|
|
|
|
<label><%=l(:label_role)%>:
|
|
|
|
<%= select_tag 'role_id', options_from_collection_for_select(@roles, "id", "name", @role && @role.id) %></label>
|
|
|
|
|
|
|
|
<label><%=l(:label_tracker)%>:
|
|
|
|
<%= select_tag 'tracker_id', options_from_collection_for_select(@trackers, "id", "name", @tracker && @tracker.id) %></label>
|
|
|
|
|
|
|
|
<%= submit_tag l(:button_edit), :name => nil %>
|
2012-07-15 19:46:14 +04:00
|
|
|
|
|
|
|
<%= hidden_field_tag 'used_statuses_only', '0' %>
|
|
|
|
<label><%= check_box_tag 'used_statuses_only', '1', @used_statuses_only %> <%= l(:label_display_used_statuses_only) %></label>
|
2012-07-15 18:12:17 +04:00
|
|
|
</p>
|
|
|
|
<% 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 %>
|
2012-07-15 19:50:57 +04:00
|
|
|
<%= hidden_field_tag 'used_statuses_only', params[:used_statuses_only] %>
|
2012-07-15 18:12:17 +04:00
|
|
|
<div class="autoscroll">
|
|
|
|
<table class="list fields_permissions">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th align="left">
|
|
|
|
</th>
|
|
|
|
<th align="center" colspan="<%= @statuses.length %>"><%=l(:label_issue_status)%></th>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td></td>
|
|
|
|
<% for status in @statuses %>
|
|
|
|
<td width="<%= 75 / @statuses.size %>%" align="center">
|
|
|
|
<%=h status.name %>
|
|
|
|
</td>
|
|
|
|
<% end %>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr class="group open">
|
|
|
|
<td colspan="<%= @statuses.size + 1 %>">
|
|
|
|
<span class="expander" onclick="toggleRowGroup(this);"> </span>
|
|
|
|
<%= l(:field_core_fields) %>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<% @fields.each do |field, name| %>
|
|
|
|
<tr class="<%= cycle("odd", "even") %>">
|
|
|
|
<td>
|
2012-07-16 20:33:27 +04:00
|
|
|
<%=h name %> <%= content_tag('span', '*', :class => 'required') if field_required?(field) %>
|
2012-07-15 18:12:17 +04:00
|
|
|
</td>
|
|
|
|
<% for status in @statuses -%>
|
|
|
|
<td align="center" class="<%= @permissions[status.id][field] %>">
|
|
|
|
<%= field_permission_tag(@permissions, status, field) %>
|
2013-05-28 14:59:04 +04:00
|
|
|
<% unless status == @statuses.last %><a href="#" class="repeat-value">»</a><% end %>
|
2012-07-15 18:12:17 +04:00
|
|
|
</td>
|
|
|
|
<% end -%>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
<% if @custom_fields.any? %>
|
|
|
|
<tr class="group open">
|
|
|
|
<td colspan="<%= @statuses.size + 1 %>">
|
|
|
|
<span class="expander" onclick="toggleRowGroup(this);"> </span>
|
|
|
|
<%= l(:label_custom_field_plural) %>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<% @custom_fields.each do |field| %>
|
|
|
|
<tr class="<%= cycle("odd", "even") %>">
|
|
|
|
<td>
|
2012-07-16 20:33:27 +04:00
|
|
|
<%=h field.name %> <%= content_tag('span', '*', :class => 'required') if field_required?(field) %>
|
2012-07-15 18:12:17 +04:00
|
|
|
</td>
|
|
|
|
<% for status in @statuses -%>
|
|
|
|
<td align="center" class="<%= @permissions[status.id][field.id.to_s] %>">
|
|
|
|
<%= field_permission_tag(@permissions, status, field) %>
|
2013-05-28 14:59:04 +04:00
|
|
|
<% unless status == @statuses.last %><a href="#" class="repeat-value">»</a><% end %>
|
2012-07-15 18:12:17 +04:00
|
|
|
</td>
|
|
|
|
<% end -%>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<%= submit_tag l(:button_save) %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2013-05-28 14:59:04 +04:00
|
|
|
|
|
|
|
<%= javascript_tag do %>
|
|
|
|
$("a.repeat-value").click(function(e){
|
|
|
|
e.preventDefault();
|
|
|
|
var td = $(this).closest('td');
|
|
|
|
var selected = td.find("select").find(":selected").val();
|
|
|
|
td.nextAll('td').find("select").val(selected);
|
|
|
|
});
|
|
|
|
<% end %>
|