プロジェクト

全般

プロフィール

Vote #77751

未完了

Increase the number of sort columns in custom queries

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Issues filter_56
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
56
version_id:
0
issue_org_id:
23641
author_id:
154894
assigned_to_id:
0
comments:
2
status_id:
1
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

It would be great to be able to set more than 3 sort columns in custom queries. Maybe, 10 might be enough?

Here is a scenario to sort issues I'm going to use in my organization, it lacks the amount of sort columns:

Group issues by the priority field;

Sort by the Parent task field to visualize the issue hierarchy;

Sort by the Status field descending. The nearer an issue is to be done, the higher it should be in the list. It can help not to keep a lot of incomplete issues.

Sort by the % Done field descending due to the consideration above.

Sort by the # field ascending to order them in the creation order.


journals

--------------------------------------------------------------------------------
Anton Kalinin wrote:
> It would be great to be able to set more than 3 sort columns in custom queries. Maybe, 10 might be enough?
>
> Here is a scenario to sort issues I'm going to use in my organization, it lacks the amount of sort columns:
>
> # Group issues by the priority field;
> # Sort by the Parent task field to visualize the issue hierarchy;
> # Sort by the Status field descending. The nearer an issue is to be done, the higher it should be in the list. It can help not to keep a lot of incomplete issues.
> # Sort by the % Done field descending due to the consideration above.
> # Sort by the # field ascending to order them in the creation order.

You can change it easily in your redmine copy.

In your app/models/query.rb (changed : .slice(0, 3) to .slice(0, arg.length))
<pre>
<code class="Ruby">
def sort_criteria=(arg)
c = []
if arg.is_a?(Hash)
arg = arg.keys.sort.collect { |k| arg[k] }
end
if arg
c = arg.select { |k, o| !k.to_s.blank? }.slice(0, arg.length).collect { |k, o| [k.to_s, (o == 'desc' || o == false) ? 'desc' : 'asc'] }
end
write_attribute(:sort_criteria, c)
end
</code>
</pre>

And in app/views/queries/_form.html.erb:
change 3 to any number
<pre>
<code class="erb">
<fieldset><legend><%= l(:label_sort) %></legend>
<% 3.times do |i| %>
</code>
</pre>
--------------------------------------------------------------------------------

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0