You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

bulk_edit.html.erb 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <h2><%= @copy ? l(:button_copy) : l(:label_bulk_edit_selected_issues) %></h2>
  2. <ul><%= @issues.collect {|i|
  3. content_tag('li',
  4. link_to(h("#{i.tracker} ##{i.id}"),
  5. { :action => 'show', :id => i }
  6. ) + h(": #{i.subject}"))
  7. }.join("\n").html_safe %></ul>
  8. <%= form_tag({:action => 'bulk_update'}, :id => 'bulk_edit_form') do %>
  9. <%= @issues.collect {|i| hidden_field_tag('ids[]', i.id)}.join("\n").html_safe %>
  10. <div class="box tabular">
  11. <fieldset class="attributes">
  12. <legend><%= l(:label_change_properties) %></legend>
  13. <div class="splitcontentleft">
  14. <% if @allowed_projects.present? %>
  15. <p>
  16. <label for="issue_project_id"><%= l(:field_project) %></label>
  17. <%= select_tag('issue[project_id]', content_tag('option', l(:label_no_change_option), :value => '') + project_tree_options_for_select(@allowed_projects, :selected => @target_project)) %>
  18. </p>
  19. <%= observe_field :issue_project_id, :url => {:action => 'bulk_edit'},
  20. :update => 'content',
  21. :with => "Form.serialize('bulk_edit_form')" %>
  22. <% end %>
  23. <p>
  24. <label for="issue_tracker_id"><%= l(:field_tracker) %></label>
  25. <%= select_tag('issue[tracker_id]', content_tag('option', l(:label_no_change_option), :value => '') + options_from_collection_for_select(@trackers, :id, :name)) %>
  26. </p>
  27. <% if @available_statuses.any? %>
  28. <p>
  29. <label for='issue_status_id'><%= l(:field_status) %></label>
  30. <%= select_tag('issue[status_id]',content_tag('option', l(:label_no_change_option), :value => '') + options_from_collection_for_select(@available_statuses, :id, :name)) %>
  31. </p>
  32. <% end %>
  33. <p>
  34. <label for='issue_priority_id'><%= l(:field_priority) %></label>
  35. <%= select_tag('issue[priority_id]', content_tag('option', l(:label_no_change_option), :value => '') + options_from_collection_for_select(IssuePriority.active, :id, :name)) %>
  36. </p>
  37. <p>
  38. <label for='issue_assigned_to_id'><%= l(:field_assigned_to) %></label>
  39. <%= select_tag('issue[assigned_to_id]', content_tag('option', l(:label_no_change_option), :value => '') +
  40. content_tag('option', l(:label_nobody), :value => 'none') +
  41. principals_options_for_select(@assignables)) %>
  42. </p>
  43. <p>
  44. <label for='issue_category_id'><%= l(:field_category) %></label>
  45. <%= select_tag('issue[category_id]', content_tag('option', l(:label_no_change_option), :value => '') +
  46. content_tag('option', l(:label_none), :value => 'none') +
  47. options_from_collection_for_select(@categories, :id, :name)) %>
  48. </p>
  49. <p>
  50. <label for='issue_fixed_version_id'><%= l(:field_fixed_version) %></label>
  51. <%= select_tag('issue[fixed_version_id]', content_tag('option', l(:label_no_change_option), :value => '') +
  52. content_tag('option', l(:label_none), :value => 'none') +
  53. version_options_for_select(@versions.sort)) %>
  54. </p>
  55. <% @custom_fields.each do |custom_field| %>
  56. <p><label><%= h(custom_field.name) %></label> <%= custom_field_tag_for_bulk_edit('issue', custom_field, @projects) %></p>
  57. <% end %>
  58. <% if @copy && @attachments_present %>
  59. <p>
  60. <label for='copy_attachments'><%= l(:label_copy_attachments) %></label>
  61. <%= check_box_tag 'copy_attachments', '1', true %>
  62. </p>
  63. <% end %>
  64. <%= call_hook(:view_issues_bulk_edit_details_bottom, { :issues => @issues }) %>
  65. </div>
  66. <div class="splitcontentright">
  67. <% if @safe_attributes.include?('is_private') %>
  68. <p>
  69. <label for='issue_is_private'><%= l(:field_is_private) %></label>
  70. <%= select_tag('issue[is_private]', content_tag('option', l(:label_no_change_option), :value => '') +
  71. content_tag('option', l(:general_text_Yes), :value => '1') +
  72. content_tag('option', l(:general_text_No), :value => '0')) %>
  73. </p>
  74. <% end %>
  75. <% if @project && User.current.allowed_to?(:manage_subtasks, @project) %>
  76. <p>
  77. <label for='issue_parent_issue_id'><%= l(:field_parent_issue) %></label>
  78. <%= text_field_tag 'issue[parent_issue_id]', '', :size => 10 %>
  79. </p>
  80. <div id="parent_issue_candidates" class="autocomplete"></div>
  81. <%= javascript_tag "observeParentIssueField('#{auto_complete_issues_path(:project_id => @project) }')" %>
  82. <% end %>
  83. <p>
  84. <label for='issue_start_date'><%= l(:field_start_date) %></label>
  85. <%= text_field_tag 'issue[start_date]', '', :size => 10 %><%= calendar_for('issue_start_date') %>
  86. </p>
  87. <p>
  88. <label for='issue_due_date'><%= l(:field_due_date) %></label>
  89. <%= text_field_tag 'issue[due_date]', '', :size => 10 %><%= calendar_for('issue_due_date') %>
  90. </p>
  91. <% if Issue.use_field_for_done_ratio? %>
  92. <p>
  93. <label for='issue_done_ratio'><%= l(:field_done_ratio) %></label>
  94. <%= select_tag 'issue[done_ratio]', options_for_select([[l(:label_no_change_option), '']] + (0..10).to_a.collect {|r| ["#{r*10} %", r*10] }) %>
  95. </p>
  96. <% end %>
  97. </div>
  98. </fieldset>
  99. <fieldset><legend><%= l(:field_notes) %></legend>
  100. <%= text_area_tag 'notes', @notes, :cols => 60, :rows => 10, :class => 'wiki-edit' %>
  101. <%= wikitoolbar_for 'notes' %>
  102. </fieldset>
  103. </div>
  104. <p>
  105. <% if @copy %>
  106. <%= hidden_field_tag 'copy', '1' %>
  107. <%= submit_tag l(:button_copy) %>
  108. <%= submit_tag l(:button_copy_and_follow), :name => 'follow' %>
  109. <% elsif @target_project %>
  110. <%= submit_tag l(:button_move) %>
  111. <%= submit_tag l(:button_move_and_follow), :name => 'follow' %>
  112. <% else %>
  113. <%= submit_tag l(:button_submit) %>
  114. <% end %>
  115. </p>
  116. <% end %>