To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / app / views / issues / bulk_edit.html.erb @ 1591:63650ae64bf2

History | View | Annotate | Download (8.09 KB)

1
<h2><%= @copy ? l(:button_copy) : l(:label_bulk_edit_selected_issues) %></h2>
2

    
3
<% if @saved_issues && @unsaved_issues.present? %>
4
<div id="errorExplanation">
5
  <span>
6
    <%= l(:notice_failed_to_save_issues,
7
        :count => @unsaved_issues.size,
8
        :total => @saved_issues.size,
9
        :ids => @unsaved_issues.map {|i| "##{i.id}"}.join(', ')) %>
10
  </span>
11
  <ul>
12
  <% bulk_edit_error_messages(@unsaved_issues).each do |message| %>
13
    <li><%= message %></li>
14
  <% end %>
15
  </ul>
16
</div>
17
<% end %>
18

    
19
<ul id="bulk-selection">
20
<% @issues.each do |issue| %>
21
  <%= content_tag 'li', link_to_issue(issue) %>
22
<% end %>
23
</ul>
24

    
25
<%= form_tag(bulk_update_issues_path, :id => 'bulk_edit_form') do %>
26
<%= @issues.collect {|i| hidden_field_tag('ids[]', i.id)}.join("\n").html_safe %>
27
<div class="box tabular">
28
<fieldset class="attributes">
29
<legend><%= l(:label_change_properties) %></legend>
30

    
31
<div class="splitcontentleft">
32
<% if @allowed_projects.present? %>
33
<p>
34
  <label for="issue_project_id"><%= l(:field_project) %></label>
35
  <%= select_tag('issue[project_id]',
36
                 content_tag('option', l(:label_no_change_option), :value => '') + 
37
                   project_tree_options_for_select(@allowed_projects, :selected => @target_project),
38
                 :onchange => "updateBulkEditFrom('#{escape_javascript url_for(:action => 'bulk_edit', :format => 'js')}')") %>
39
</p>
40
<% end %>
41
<p>
42
  <label for="issue_tracker_id"><%= l(:field_tracker) %></label>
43
  <%= select_tag('issue[tracker_id]',
44
                 content_tag('option', l(:label_no_change_option), :value => '') +
45
                   options_from_collection_for_select(@trackers, :id, :name, @issue_params[:tracker_id])) %>
46
</p>
47
<% if @available_statuses.any? %>
48
<p>
49
  <label for='issue_status_id'><%= l(:field_status) %></label>
50
  <%= select_tag('issue[status_id]',
51
                 content_tag('option', l(:label_no_change_option), :value => '') +
52
                   options_from_collection_for_select(@available_statuses, :id, :name, @issue_params[:status_id])) %>
53
</p>
54
<% end %>
55

    
56
<% if @safe_attributes.include?('priority_id') -%>
57
<p>
58
  <label for='issue_priority_id'><%= l(:field_priority) %></label>
59
  <%= select_tag('issue[priority_id]',
60
                 content_tag('option', l(:label_no_change_option), :value => '') +
61
                   options_from_collection_for_select(IssuePriority.active, :id, :name, @issue_params[:priority_id])) %>
62
</p>
63
<% end %>
64

    
65
<% if @safe_attributes.include?('assigned_to_id') -%>
66
<p>
67
  <label for='issue_assigned_to_id'><%= l(:field_assigned_to) %></label>
68
  <%= select_tag('issue[assigned_to_id]',
69
                 content_tag('option', l(:label_no_change_option), :value => '') +
70
                   content_tag('option', l(:label_nobody), :value => 'none', :selected => (@issue_params[:assigned_to_id] == 'none')) +
71
                   principals_options_for_select(@assignables, @issue_params[:assigned_to_id])) %>
72
</p>
73
<% end %>
74

    
75
<% if @safe_attributes.include?('category_id') -%>
76
<p>
77
  <label for='issue_category_id'><%= l(:field_category) %></label>
78
  <%= select_tag('issue[category_id]', content_tag('option', l(:label_no_change_option), :value => '') +
79
                                content_tag('option', l(:label_none), :value => 'none', :selected => (@issue_params[:category_id] == 'none')) +
80
                                options_from_collection_for_select(@categories, :id, :name, @issue_params[:category_id])) %>
81
</p>
82
<% end %>
83

    
84
<% if @safe_attributes.include?('fixed_version_id') -%>
85
<p>
86
  <label for='issue_fixed_version_id'><%= l(:field_fixed_version) %></label>
87
  <%= select_tag('issue[fixed_version_id]', content_tag('option', l(:label_no_change_option), :value => '') +
88
                                   content_tag('option', l(:label_none), :value => 'none', :selected => (@issue_params[:fixed_version_id] == 'none')) +
89
                                   version_options_for_select(@versions.sort, @issue_params[:fixed_version_id])) %>
90
</p>
91
<% end %>
92

    
93
<% @custom_fields.each do |custom_field| %>
94
  <p>
95
    <label><%= h(custom_field.name) %></label>
96
    <%= custom_field_tag_for_bulk_edit('issue', custom_field, @issues, @issue_params[:custom_field_values][custom_field.id.to_s]) %>
97
  </p>
98
<% end %>
99

    
100
<% if @copy && @attachments_present %>
101
<%= hidden_field_tag 'copy_attachments', '0' %>
102
<p>
103
  <label for='copy_attachments'><%= l(:label_copy_attachments) %></label>
104
  <%= check_box_tag 'copy_attachments', '1', params[:copy_attachments] != '0' %>
105
</p>
106
<% end %>
107

    
108
<% if @copy && @subtasks_present %>
109
<%= hidden_field_tag 'copy_subtasks', '0' %>
110
<p>
111
  <label for='copy_subtasks'><%= l(:label_copy_subtasks) %></label>
112
  <%= check_box_tag 'copy_subtasks', '1', params[:copy_subtasks] != '0' %>
113
</p>
114
<% end %>
115

    
116
<%= call_hook(:view_issues_bulk_edit_details_bottom, { :issues => @issues }) %>
117
</div>
118

    
119
<div class="splitcontentright">
120
<% if @safe_attributes.include?('is_private') %>
121
<p>
122
  <label for='issue_is_private'><%= l(:field_is_private) %></label>
123
  <%= select_tag('issue[is_private]', content_tag('option', l(:label_no_change_option), :value => '') +
124
                                content_tag('option', l(:general_text_Yes), :value => '1', :selected => (@issue_params[:is_private] == '1')) +
125
                                content_tag('option', l(:general_text_No), :value => '0', :selected => (@issue_params[:is_private] == '0'))) %>
126
</p>
127
<% end %>
128

    
129
<% if @safe_attributes.include?('parent_issue_id') && @project %>
130
<p>
131
  <label for='issue_parent_issue_id'><%= l(:field_parent_issue) %></label>
132
  <%= text_field_tag 'issue[parent_issue_id]', '', :size => 10, :value => @issue_params[:parent_issue_id] %>
133
  <label class="inline"><%= check_box_tag 'issue[parent_issue_id]', 'none', (@issue_params[:parent_issue_id] == 'none'), :id => nil, :data => {:disables => '#issue_parent_issue_id'} %><%= l(:button_clear) %></label>
134
</p>
135
<%= javascript_tag "observeAutocompleteField('issue_parent_issue_id', '#{escape_javascript auto_complete_issues_path(:project_id => @project)}')" %>
136
<% end %>
137

    
138
<% if @safe_attributes.include?('start_date') %>
139
<p>
140
  <label for='issue_start_date'><%= l(:field_start_date) %></label>
141
  <%= text_field_tag 'issue[start_date]', '', :value => @issue_params[:start_date], :size => 10 %><%= calendar_for('issue_start_date') %>
142
  <label class="inline"><%= check_box_tag 'issue[start_date]', 'none', (@issue_params[:start_date] == 'none'), :id => nil, :data => {:disables => '#issue_start_date'} %><%= l(:button_clear) %></label>
143
</p>
144
<% end %>
145

    
146
<% if @safe_attributes.include?('due_date') %>
147
<p>
148
  <label for='issue_due_date'><%= l(:field_due_date) %></label>
149
  <%= text_field_tag 'issue[due_date]', '', :value => @issue_params[:due_date], :size => 10 %><%= calendar_for('issue_due_date') %>
150
  <label class="inline"><%= check_box_tag 'issue[due_date]', 'none', (@issue_params[:due_date] == 'none'), :id => nil, :data => {:disables => '#issue_due_date'} %><%= l(:button_clear) %></label>
151
</p>
152
<% end %>
153

    
154
<% if @safe_attributes.include?('done_ratio') && Issue.use_field_for_done_ratio? %>
155
<p>
156
  <label for='issue_done_ratio'><%= l(:field_done_ratio) %></label>
157
  <%= select_tag 'issue[done_ratio]', options_for_select([[l(:label_no_change_option), '']] + (0..10).to_a.collect {|r| ["#{r*10} %", r*10] }, @issue_params[:done_ratio]) %>
158
</p>
159
<% end %>
160
</div>
161
</fieldset>
162

    
163
<fieldset>
164
<legend><%= l(:field_notes) %></legend>
165
<%= text_area_tag 'notes', @notes, :cols => 60, :rows => 10, :class => 'wiki-edit' %>
166
<%= wikitoolbar_for 'notes' %>
167
</fieldset>
168
</div>
169

    
170
<p>
171
  <% if @copy %>
172
    <%= hidden_field_tag 'copy', '1' %>
173
    <%= submit_tag l(:button_copy) %>
174
    <%= submit_tag l(:button_copy_and_follow), :name => 'follow' %>
175
  <% elsif @target_project %>
176
    <%= submit_tag l(:button_move) %>
177
    <%= submit_tag l(:button_move_and_follow), :name => 'follow' %>
178
  <% else %>
179
    <%= submit_tag l(:button_submit) %>
180
  <% end %>
181
</p>
182

    
183
<% end %>
184

    
185
<%= javascript_tag do %>
186
$(window).load(function(){
187
  $(document).on('change', 'input[data-disables]', function(){
188
    if ($(this).attr('checked')){
189
      $($(this).data('disables')).attr('disabled', true).val('');
190
    } else {
191
      $($(this).data('disables')).attr('disabled', false);
192
    }
193
  });
194
});
195
$(document).ready(function(){
196
  $('input[data-disables]').trigger('change');
197
});
198
<% end %>