Redmine 3.4.4
This commit is contained in:
commit
64924a6376
2112 changed files with 259028 additions and 0 deletions
4
app/views/workflows/_action_menu.html.erb
Normal file
4
app/views/workflows/_action_menu.html.erb
Normal file
|
@ -0,0 +1,4 @@
|
|||
<div class="contextual">
|
||||
<%= link_to l(:button_copy), {:action => 'copy'}, :class => 'icon icon-copy' %>
|
||||
<%= link_to l(:field_summary), {:action => 'index'}, :class => 'icon icon-summary' %>
|
||||
</div>
|
49
app/views/workflows/_form.html.erb
Normal file
49
app/views/workflows/_form.html.erb
Normal file
|
@ -0,0 +1,49 @@
|
|||
<table class="list workflows transitions transitions-<%= name %>">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input[type=checkbox]')",
|
||||
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}",
|
||||
:class => 'icon-only icon-checked') %>
|
||||
<%=l(:label_current_status)%>
|
||||
</th>
|
||||
<th colspan="<%= @statuses.length %>"><%=l(:label_new_statuses_allowed)%></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<% for new_status in @statuses %>
|
||||
<td style="width:<%= 75 / @statuses.size %>%;">
|
||||
<%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input[type=checkbox].new-status-#{new_status.id}')",
|
||||
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}",
|
||||
:class => 'icon-only icon-checked') %>
|
||||
<%= new_status.name %>
|
||||
</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% for old_status in [nil] + @statuses %>
|
||||
<% next if old_status.nil? && name != 'always' %>
|
||||
<tr>
|
||||
<td class="name">
|
||||
<%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input[type=checkbox].old-status-#{old_status.try(:id) || 0}')",
|
||||
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}",
|
||||
:class => 'icon-only icon-checked') %>
|
||||
<% if old_status %>
|
||||
<% old_status_name = old_status.name %>
|
||||
<%= old_status_name %>
|
||||
<% else %>
|
||||
<% old_status_name = l(:label_issue_new) %>
|
||||
<%= content_tag('em', old_status_name) %>
|
||||
<% end %>
|
||||
</td>
|
||||
<% for new_status in @statuses -%>
|
||||
<% checked = workflows.detect {|w| w.old_status == old_status && w.new_status == new_status} %>
|
||||
<td class="<%= checked ? 'enabled' : '' %>" title="<%= old_status_name %> » <%= new_status.name %>">
|
||||
<%= transition_tag workflows, old_status, new_status, name %>
|
||||
</td>
|
||||
<% end -%>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
38
app/views/workflows/copy.html.erb
Normal file
38
app/views/workflows/copy.html.erb
Normal file
|
@ -0,0 +1,38 @@
|
|||
<%= title [l(:label_workflow), workflows_edit_path], l(:button_copy) %>
|
||||
|
||||
<%= form_tag({}, :id => 'workflow_copy_form') do %>
|
||||
<fieldset class="tabular box">
|
||||
<legend><%= l(:label_copy_source) %></legend>
|
||||
<p>
|
||||
<label><%= l(:label_tracker) %></label>
|
||||
<%= select_tag('source_tracker_id',
|
||||
content_tag('option', "--- #{l(:actionview_instancetag_blank_option)} ---", :value => '') +
|
||||
content_tag('option', "--- #{ l(:label_copy_same_as_target) } ---", :value => 'any') +
|
||||
options_from_collection_for_select(@trackers, 'id', 'name', @source_tracker && @source_tracker.id)) %>
|
||||
</p>
|
||||
<p>
|
||||
<label><%= l(:label_role) %></label>
|
||||
<%= select_tag('source_role_id',
|
||||
content_tag('option', "--- #{l(:actionview_instancetag_blank_option)} ---", :value => '') +
|
||||
content_tag('option', "--- #{ l(:label_copy_same_as_target) } ---", :value => 'any') +
|
||||
options_from_collection_for_select(@roles, 'id', 'name', @source_role && @source_role.id)) %>
|
||||
</p>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="tabular box">
|
||||
<legend><%= l(:label_copy_target) %></legend>
|
||||
<p>
|
||||
<label><%= l(:label_tracker) %></label>
|
||||
<%= select_tag 'target_tracker_ids',
|
||||
content_tag('option', "--- #{l(:actionview_instancetag_blank_option)} ---", :value => '', :disabled => true) +
|
||||
options_from_collection_for_select(@trackers, 'id', 'name', @target_trackers && @target_trackers.map(&:id)), :multiple => true %>
|
||||
</p>
|
||||
<p>
|
||||
<label><%= l(:label_role) %></label>
|
||||
<%= select_tag 'target_role_ids',
|
||||
content_tag('option', "--- #{l(:actionview_instancetag_blank_option)} ---", :value => '', :disabled => true) +
|
||||
options_from_collection_for_select(@roles, 'id', 'name', @target_roles && @target_roles.map(&:id)), :multiple => true %>
|
||||
</p>
|
||||
</fieldset>
|
||||
<%= submit_tag l(:button_copy) %>
|
||||
<% end %>
|
75
app/views/workflows/edit.html.erb
Normal file
75
app/views/workflows/edit.html.erb
Normal file
|
@ -0,0 +1,75 @@
|
|||
<%= render :partial => 'action_menu' %>
|
||||
|
||||
<%= title l(:label_workflow) %>
|
||||
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li><%= link_to l(:label_status_transitions), workflows_edit_path(:role_id => @roles, :tracker_id => @trackers), :class => 'selected' %></li>
|
||||
<li><%= link_to l(:label_fields_permissions), workflows_permissions_path(:role_id => @roles, :tracker_id => @trackers) %></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<p><%=l(:text_workflow_edit)%>:</p>
|
||||
|
||||
<%= form_tag({}, :method => 'get') do %>
|
||||
<p>
|
||||
<label><%=l(:label_role)%>:
|
||||
<%= options_for_workflow_select 'role_id[]', Role.sorted.select(&:consider_workflow?), @roles, :id => 'role_id', :class => 'expandable' %>
|
||||
</label>
|
||||
<a href="#" data-expands="#role_id"><span class="toggle-multiselect"></span></a>
|
||||
|
||||
<label><%=l(:label_tracker)%>:
|
||||
<%= options_for_workflow_select 'tracker_id[]', Tracker.sorted, @trackers, :id => 'tracker_id', :class => 'expandable' %>
|
||||
</label>
|
||||
<a href="#" data-expands="#tracker_id"><span class="toggle-multiselect"></span></a>
|
||||
|
||||
<%= submit_tag l(:button_edit), :name => nil %>
|
||||
|
||||
<%= hidden_field_tag 'used_statuses_only', '0', :id => nil %>
|
||||
<label><%= check_box_tag 'used_statuses_only', '1', @used_statuses_only %> <%= l(:label_display_used_statuses_only) %></label>
|
||||
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<% if @trackers && @roles && @statuses.any? %>
|
||||
<%= form_tag({}, :id => 'workflow_form' ) do %>
|
||||
<%= @trackers.map {|tracker| hidden_field_tag 'tracker_id[]', tracker.id, :id => nil}.join.html_safe %>
|
||||
<%= @roles.map {|role| hidden_field_tag 'role_id[]', role.id, :id => nil}.join.html_safe %>
|
||||
<%= hidden_field_tag 'used_statuses_only', params[:used_statuses_only], :id => nil %>
|
||||
<div class="autoscroll">
|
||||
<%= render :partial => 'form', :locals => {:name => 'always', :workflows => @workflows['always']} %>
|
||||
|
||||
<fieldset class="collapsible" style="padding: 0; margin-top: 0.5em;">
|
||||
<legend onclick="toggleFieldset(this);"><%= l(:label_additional_workflow_transitions_for_author) %></legend>
|
||||
<div id="author_workflows" style="margin: 0.5em 0 0.5em 0;">
|
||||
<%= render :partial => 'form', :locals => {:name => 'author', :workflows => @workflows['author']} %>
|
||||
</div>
|
||||
</fieldset>
|
||||
<%= javascript_tag "hideFieldset($('#author_workflows'))" unless @workflows['author'].present? %>
|
||||
|
||||
<fieldset class="collapsible" style="padding: 0;">
|
||||
<legend onclick="toggleFieldset(this);"><%= l(:label_additional_workflow_transitions_for_assignee) %></legend>
|
||||
<div id="assignee_workflows" style="margin: 0.5em 0 0.5em 0;">
|
||||
<%= render :partial => 'form', :locals => {:name => 'assignee', :workflows => @workflows['assignee']} %>
|
||||
</div>
|
||||
</fieldset>
|
||||
<%= javascript_tag "hideFieldset($('#assignee_workflows'))" unless @workflows['assignee'].present? %>
|
||||
</div>
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<%= javascript_tag do %>
|
||||
$("a[data-expands]").click(function(e){
|
||||
e.preventDefault();
|
||||
var target = $($(this).attr("data-expands"));
|
||||
if (target.attr("multiple")) {
|
||||
target.attr("multiple", false);
|
||||
target.find("option[value=all]").show();
|
||||
} else {
|
||||
target.attr("multiple", true);
|
||||
target.find("option[value=all]").attr("selected", false).hide();
|
||||
}
|
||||
});
|
||||
|
||||
<% end %>
|
35
app/views/workflows/index.html.erb
Normal file
35
app/views/workflows/index.html.erb
Normal file
|
@ -0,0 +1,35 @@
|
|||
<%= title [l(:label_workflow), workflows_edit_path], l(:field_summary) %>
|
||||
|
||||
<% if @roles.empty? || @trackers.empty? %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% else %>
|
||||
<div class="autoscroll">
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<% @roles.each do |role| %>
|
||||
<th>
|
||||
<%= content_tag(role.builtin? ? 'em' : 'span', role.name) %>
|
||||
</th>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @trackers.each do |tracker| -%>
|
||||
<tr>
|
||||
<td class="name"><%= tracker.name %></td>
|
||||
<% @roles.each do |role| -%>
|
||||
<% count = @workflow_counts[[tracker.id, role.id]] || 0 %>
|
||||
<td>
|
||||
<%= link_to((count > 0 ? count : content_tag(:span, nil, :class => 'icon-only icon-not-ok')),
|
||||
{:action => 'edit', :role_id => role, :tracker_id => tracker},
|
||||
:title => l(:button_edit)) %>
|
||||
</td>
|
||||
<% end -%>
|
||||
</tr>
|
||||
<% end -%>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<% end %>
|
123
app/views/workflows/permissions.html.erb
Normal file
123
app/views/workflows/permissions.html.erb
Normal file
|
@ -0,0 +1,123 @@
|
|||
<%= render :partial => 'action_menu' %>
|
||||
|
||||
<%= title l(:label_workflow) %>
|
||||
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li><%= link_to l(:label_status_transitions), workflows_edit_path(:role_id => @roles, :tracker_id => @trackers) %></li>
|
||||
<li><%= link_to l(:label_fields_permissions), workflows_permissions_path(:role_id => @roles, :tracker_id => @trackers), :class => 'selected' %></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<p><%=l(:text_workflow_edit)%>:</p>
|
||||
|
||||
<%= form_tag({}, :method => 'get') do %>
|
||||
<p>
|
||||
<label><%=l(:label_role)%>:
|
||||
<%= options_for_workflow_select 'role_id[]', Role.sorted.select(&:consider_workflow?), @roles, :id => 'role_id', :class => 'expandable' %>
|
||||
</label>
|
||||
<a href="#" data-expands="#role_id"><span class="toggle-multiselect"></a>
|
||||
|
||||
<label><%=l(:label_tracker)%>:
|
||||
<%= options_for_workflow_select 'tracker_id[]', Tracker.sorted, @trackers, :id => 'tracker_id', :class => 'expandable' %>
|
||||
</label>
|
||||
<a href="#" data-expands="#tracker_id"><span class="toggle-multiselect"></a>
|
||||
|
||||
<%= submit_tag l(:button_edit), :name => nil %>
|
||||
|
||||
<%= hidden_field_tag 'used_statuses_only', '0', :id => nil %>
|
||||
<label><%= check_box_tag 'used_statuses_only', '1', @used_statuses_only %> <%= l(:label_display_used_statuses_only) %></label>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<% if @trackers && @roles && @statuses.any? %>
|
||||
<%= form_tag({}, :id => 'workflow_form' ) do %>
|
||||
<%= @trackers.map {|tracker| hidden_field_tag 'tracker_id[]', tracker.id, :id => nil}.join.html_safe %>
|
||||
<%= @roles.map {|role| hidden_field_tag 'role_id[]', role.id, :id => nil}.join.html_safe %>
|
||||
<%= hidden_field_tag 'used_statuses_only', params[:used_statuses_only], :id => nil %>
|
||||
<div class="autoscroll">
|
||||
<table class="list workflows fields_permissions">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
</th>
|
||||
<th colspan="<%= @statuses.length %>"><%=l(:label_issue_status)%></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<% for status in @statuses %>
|
||||
<td style="width:<%= 75 / @statuses.size %>%;">
|
||||
<%= 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>
|
||||
<td class="name">
|
||||
<%= name %> <%= content_tag('span', '*', :class => 'required') if field_required?(field) %>
|
||||
</td>
|
||||
<% for status in @statuses -%>
|
||||
<td class="<%= @permissions[status.id][field].try(:join, ' ') %>" title="<%= name %> (<%= status.name %>)">
|
||||
<%= field_permission_tag(@permissions, status, field, @roles) %>
|
||||
<% unless status == @statuses.last %><a href="#" class="repeat-value">»</a><% end %>
|
||||
</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>
|
||||
<td class="name">
|
||||
<%= field.name %> <%= content_tag('span', '*', :class => 'required') if field_required?(field) %>
|
||||
</td>
|
||||
<% for status in @statuses -%>
|
||||
<td class="<%= @permissions[status.id][field.id.to_s].try(:join, ' ') %>" title="<%= field.name %> (<%= status.name %>)">
|
||||
<%= field_permission_tag(@permissions, status, field, @roles) %>
|
||||
<% unless status == @statuses.last %><a href="#" class="repeat-value">»</a><% end %>
|
||||
</td>
|
||||
<% end -%>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<%= 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);
|
||||
});
|
||||
|
||||
$("a[data-expands]").click(function(e){
|
||||
e.preventDefault();
|
||||
var target = $($(this).attr("data-expands"));
|
||||
if (target.attr("multiple")) {
|
||||
target.attr("multiple", false);
|
||||
target.find("option[value=all]").show();
|
||||
} else {
|
||||
target.attr("multiple", true);
|
||||
target.find("option[value=all]").attr("selected", false).hide();
|
||||
}
|
||||
});
|
||||
|
||||
<% end %>
|
Loading…
Add table
Add a link
Reference in a new issue