Feature #22802 » 0001-Add-the-posibility-to-set-change-the-position-of-an-.patch
| app/controllers/enumerations_controller.rb | ||
|---|---|---|
|
before_action :require_admin_or_api_request, :only => :index
|
||
|
before_action :build_new_enumeration, :only => [:new, :create]
|
||
|
before_action :find_enumeration, :only => [:edit, :update, :destroy]
|
||
|
accept_api_auth :index
|
||
|
accept_api_auth :index, :update
|
||
|
helper :custom_fields
|
||
| app/controllers/issues_controller.rb | ||
|---|---|---|
|
issue_path(@issue, previous_and_next_issue_ids_params)
|
||
|
)
|
||
|
end
|
||
|
format.js { head 200 }
|
||
|
format.api {render_api_ok}
|
||
|
end
|
||
|
else
|
||
|
respond_to do |format|
|
||
|
format.html {render :action => 'edit'}
|
||
|
format.js { head 422 }
|
||
|
format.api {render_validation_errors(@issue)}
|
||
|
end
|
||
|
end
|
||
| app/controllers/versions_controller.rb | ||
|---|---|---|
|
includes(:project, :tracker).
|
||
|
preload(:status, :priority, :fixed_version).
|
||
|
where(:tracker_id => @selected_tracker_ids, :project_id => project_ids, :fixed_version_id => @versions.map(&:id)).
|
||
|
order("#{Project.table_name}.lft, #{Tracker.table_name}.position, #{Issue.table_name}.id")
|
||
|
#order("#{Project.table_name}.lft, #{Tracker.table_name}.position, #{Issue.table_name}.id")
|
||
|
order(order_issues_by)
|
||
|
@issues_by_version = issues.group_by(&:fixed_version)
|
||
|
end
|
||
|
@versions.reject! {|version| !project_ids.include?(version.project_id) && @issues_by_version[version].blank?}
|
||
| ... | ... | |
|
@issues = @version.fixed_issues.visible.
|
||
|
includes(:status, :tracker, :priority).
|
||
|
preload(:project).
|
||
|
reorder("#{Tracker.table_name}.position, #{Issue.table_name}.id").
|
||
|
#reorder("#{Tracker.table_name}.position, #{Issue.table_name}.id").
|
||
|
reorder(order_issues_by).
|
||
|
to_a
|
||
|
end
|
||
|
format.api
|
||
| ... | ... | |
|
end
|
||
|
end
|
||
|
def order_issues_by
|
||
|
if Setting.manual_issue_position_in_versions == '1'
|
||
|
return "COALESCE(#{Issue.table_name}.position, 999999), #{Issue.table_name}.id"
|
||
|
else
|
||
|
return "#{Tracker.table_name}.position, #{Issue.table_name}.id"
|
||
|
end
|
||
|
end
|
||
|
private
|
||
|
def retrieve_selected_tracker_ids(selectable_trackers, default_trackers=nil)
|
||
| app/models/issue.rb | ||
|---|---|---|
|
acts_as_activity_provider :scope => proc {preload(:project, :author, :tracker, :status)},
|
||
|
:author_key => :author_id
|
||
|
acts_as_positioned :scope => [:fixed_version_id]
|
||
|
DONE_RATIO_OPTIONS = %w(issue_field issue_status)
|
||
|
attr_reader :transition_warning
|
||
| ... | ... | |
|
(issue.new_record? || issue.attributes_editable?(user)) &&
|
||
|
user.allowed_to?(:manage_subtasks, issue.project)
|
||
|
end)
|
||
|
safe_attributes(
|
||
|
'position',
|
||
|
:if => lambda {|issue, user| user.allowed_to?(:change_issue_position_in_version, issue.project)}
|
||
|
)
|
||
|
safe_attributes(
|
||
|
'deleted_attachment_ids',
|
||
|
:if => lambda {|issue, user| issue.attachments_deletable?(user)})
|
||
| ... | ... | |
|
# Returns the names of attributes that are journalized when updating the issue
|
||
|
def journalized_attribute_names
|
||
|
names = Issue.column_names - %w(id root_id lft rgt lock_version created_on updated_on closed_on)
|
||
|
names = Issue.column_names - %w(id root_id lft rgt lock_version position created_on updated_on closed_on)
|
||
|
if tracker
|
||
|
names -= tracker.disabled_core_fields
|
||
|
end
|
||
| app/models/issue_query.rb | ||
|---|---|---|
|
QueryColumn.new(:due_date, :sortable => "#{Issue.table_name}.due_date", :groupable => true),
|
||
|
QueryColumn.new(:estimated_hours, :sortable => "#{Issue.table_name}.estimated_hours",
|
||
|
:totalable => true),
|
||
|
QueryColumn.new(:position, :sortable => "#{Issue.table_name}.position"),
|
||
|
QueryColumn.new(
|
||
|
:total_estimated_hours,
|
||
|
:sortable =>
|
||
| ... | ... | |
|
add_available_filter "start_date", :type => :date
|
||
|
add_available_filter "due_date", :type => :date
|
||
|
add_available_filter "estimated_hours", :type => :float
|
||
|
add_available_filter "position", :type => :integer
|
||
|
if User.current.allowed_to?(:view_time_entries, project, :global => true)
|
||
|
add_available_filter "spent_time", :type => :float, :label => :label_spent_time
|
||
| app/views/settings/_issues.html.erb | ||
|---|---|---|
|
<p><%= setting_check_box :display_subprojects_issues %></p>
|
||
|
<p><%= setting_check_box :manual_issue_position_in_versions %></p>
|
||
|
<p><%= setting_select :issue_done_ratio, Issue::DONE_RATIO_OPTIONS.collect {|i| [l("setting_issue_done_ratio_#{i}"), i]} %></p>
|
||
|
<p><%= setting_multiselect :non_working_week_days, (1..7).map {|d| [day_name(d), d.to_s]}, :inline => true %></p>
|
||
| app/views/versions/index.html.erb | ||
|---|---|---|
|
<%= form_tag({}, :data => {:cm_url => issues_context_menu_path}) do -%>
|
||
|
<table class="list related-issues">
|
||
|
<caption><%= l(:label_related_issues) %></caption>
|
||
|
<% issues.each do |issue| -%>
|
||
|
<tr class="hascontextmenu <%= issue.css_classes %>">
|
||
|
<td class="checkbox"><%= check_box_tag 'ids[]', issue.id, false, :id => nil %></td>
|
||
|
<td class="assigned_to"><%= assignee_avatar(issue.assigned_to, :size => 16) %></td>
|
||
|
<td class="subject"><%= link_to_issue(issue, :project => (@project != issue.project)) %></td>
|
||
|
<td class="buttons"><%= link_to_context_menu %></td>
|
||
|
</tr>
|
||
|
<% end -%>
|
||
|
<tbody>
|
||
|
<% issues.each do |issue| -%>
|
||
|
<tr class="hascontextmenu <%= issue.css_classes %>">
|
||
|
<td class="checkbox"><%= check_box_tag 'ids[]', issue.id, false, :id => nil %></td>
|
||
|
<td class="assigned_to"><%= assignee_avatar(issue.assigned_to, :size => 16) %></td>
|
||
|
<td class="subject"><%= link_to_issue(issue, :project => (@project != issue.project)) %></td>
|
||
|
<td class="buttons"><%= link_to_context_menu %></td>
|
||
|
<% if Setting.manual_issue_position_in_versions == '1' && User.current.allowed_to?(:change_issue_position_in_version, version.project) %>
|
||
|
<td class="sortable"><%= reorder_handle(issue) %></td>
|
||
|
<% end%>
|
||
|
</tr>
|
||
|
<% end -%>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
<% end %>
|
||
|
<% end %>
|
||
| ... | ... | |
|
<% html_title(l(:label_roadmap)) %>
|
||
|
<%= context_menu %>
|
||
|
<% if Setting.manual_issue_position_in_versions == '1' && User.current.allowed_to?(:change_issue_position_in_version, @project) %>
|
||
|
<%= javascript_tag do %>
|
||
|
$(function() { $("table.related-issues tbody").positionedItems(); });
|
||
|
<% end %>
|
||
|
<% end %>
|
||
| app/views/versions/show.html.erb | ||
|---|---|---|
|
<% if @issues.present? %>
|
||
|
<%= form_tag({}, :data => {:cm_url => issues_context_menu_path}) do -%>
|
||
|
<table class="list related-issues">
|
||
|
<caption><%= l(:label_related_issues) %></caption>
|
||
|
<%- @issues.each do |issue| -%>
|
||
|
<tr class="hascontextmenu <%= issue.css_classes %>">
|
||
|
<td class="checkbox"><%= check_box_tag 'ids[]', issue.id, false, :id => nil %></td>
|
||
|
<td class="assigned_to"><%= assignee_avatar(issue.assigned_to, :size => 16) %></td>
|
||
|
<td class="subject"><%= link_to_issue(issue, :project => (@project != issue.project)) %></td>
|
||
|
<td class="buttons"><%= link_to_context_menu %></td>
|
||
|
</tr>
|
||
|
<% end %>
|
||
|
<caption><%= l(:label_related_issues) %></caption>
|
||
|
<tbody>
|
||
|
<%- @issues.each do |issue| -%>
|
||
|
<tr class="hascontextmenu <%= issue.css_classes %>">
|
||
|
<td class="checkbox"><%= check_box_tag 'ids[]', issue.id, false, :id => nil %></td>
|
||
|
<td class="assigned_to"><%= assignee_avatar(issue.assigned_to, :size => 16) %></td>
|
||
|
<td class="subject"><%= link_to_issue(issue, :project => (@project != issue.project)) %></td>
|
||
|
<td class="buttons"><%= link_to_context_menu %></td>
|
||
|
<% if Setting.manual_issue_position_in_versions == '1' && !@version.closed? && User.current.allowed_to?(:change_issue_position_in_version, @version.project) %>
|
||
|
<td class="sortable"><%= reorder_handle(issue) %></td>
|
||
|
<% end%>
|
||
|
</tr>
|
||
|
<% end %>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
<% end %>
|
||
|
<%= context_menu %>
|
||
| ... | ... | |
|
<%= call_hook :view_versions_show_bottom, :version => @version %>
|
||
|
<% html_title @version.name %>
|
||
|
<% if Setting.manual_issue_position_in_versions == '1' && !@version.closed? && User.current.allowed_to?(:change_issue_position_in_version, @version.project) %>
|
||
|
<%= javascript_tag do %>
|
||
|
$(function() { $("table.related-issues tbody").positionedItems(); });
|
||
|
<% end %>
|
||
|
<% end %>
|
||
| config/locales/en.yml | ||
|---|---|---|
|
setting_timelog_accept_future_dates: Accept time logs on future dates
|
||
|
setting_show_status_changes_in_mail_subject: Show status changes in issue mail notifications subject
|
||
|
setting_project_list_defaults: Projects list defaults
|
||
|
setting_manual_issue_position_in_versions: Enable manually set issue position in versions
|
||
|
setting_twofa: Two-factor authentication
|
||
|
permission_add_project: Create project
|
||
| ... | ... | |
|
permission_manage_related_issues: Manage related issues
|
||
|
permission_import_issues: Import issues
|
||
|
permission_log_time_for_other_users: Log spent time for other users
|
||
|
permission_change_issue_position_in_version: Change issue position in version
|
||
|
project_module_issue_tracking: Issue tracking
|
||
|
project_module_time_tracking: Time tracking
|
||
| config/locales/fr.yml | ||
|---|---|---|
|
setting_time_entry_list_defaults: Affichage par défaut de la liste des temps passés
|
||
|
setting_timelog_accept_0_hours: Autoriser la saisie de temps avec 0 heure
|
||
|
setting_timelog_max_hours_per_day: Maximum d'heures pouvant être saisies par un utilisateur sur un jour
|
||
|
setting_manual_issue_position_in_versions: Activer le positionnement manuel des tickets dans les versions
|
||
|
permission_add_project: Créer un projet
|
||
|
permission_add_subprojects: Créer des sous-projets
|
||
| ... | ... | |
|
permission_manage_subtasks: Gérer les sous-tâches
|
||
|
permission_manage_related_issues: Gérer les demandes associées
|
||
|
permission_import_issues: Importer des demandes
|
||
|
permission_change_issue_position_in_version: Changer la position d'un ticket dans une version
|
||
|
project_module_issue_tracking: Suivi des demandes
|
||
|
project_module_time_tracking: Suivi du temps passé
|
||
| config/settings.yml | ||
|---|---|---|
|
default: 'derived'
|
||
|
link_copied_issue:
|
||
|
default: 'ask'
|
||
|
manual_issue_position_in_versions:
|
||
|
default: 1
|
||
|
close_duplicate_issues:
|
||
|
default: 1
|
||
|
issue_group_assignment:
|
||
| db/migrate/20200315154300_add_issue_position.rb | ||
|---|---|---|
|
class AddIssuePosition < ActiveRecord::Migration[5.2]
|
||
|
def self.up
|
||
|
add_column :issues, :position, :integer
|
||
|
end
|
||
|
def self.down
|
||
|
remove_column :issues, :position
|
||
|
end
|
||
|
end
|
||
| lib/redmine.rb | ||
|---|---|---|
|
map.permission :view_private_notes, {}, :read => true, :require => :member
|
||
|
map.permission :set_notes_private, {}, :require => :member
|
||
|
map.permission :delete_issues, {:issues => :destroy}, :require => :member
|
||
|
map.permission :change_issue_position_in_version, {}
|
||
|
# Watchers
|
||
|
map.permission :view_issue_watchers, {}, :read => true
|
||
|
map.permission :add_issue_watchers, {:watchers => [:new, :create, :append, :autocomplete_for_user]}
|
||
| public/stylesheets/application.css | ||
|---|---|---|
|
div#roadmap .related-issues td.checkbox { display: none; }
|
||
|
div#roadmap .related-issues td.assigned_to { width:1px; white-space:nowrap; padding: 0; }
|
||
|
div#roadmap .related-issues td.assigned_to img { padding-left: 4px; padding-right: 4px;}
|
||
|
div#roadmap .related-issues td.sortable { text-align: right; }
|
||
|
div#roadmap .wiki h1:first-child { display: none; }
|
||
|
div#roadmap .wiki h1 { font-size: 120%; }
|
||
|
div#roadmap .wiki h2 { font-size: 110%; }
|
||
- « Previous
- 1
- …
- 7
- 8
- 9
- Next »