diff options
author | Go MAEDA <maeda@farend.jp> | 2019-05-08 08:57:31 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2019-05-08 08:57:31 +0000 |
commit | 391a9469d1c9b72f14114a6019a4c19d499ee389 (patch) | |
tree | 2b8bab72c502bd9ce3de568bb1cbdc862f19259b | |
parent | 86ca2e282a6dcac22bfbf693d1aed0de3a09804b (diff) | |
download | redmine-391a9469d1c9b72f14114a6019a4c19d499ee389.tar.gz redmine-391a9469d1c9b72f14114a6019a4c19d499ee389.zip |
Allow a bigger range for the gantt timeline (#14654).
Patch by Yuichi HARADA.
git-svn-id: http://svn.redmine.org/redmine/trunk@18136 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/views/gantts/show.html.erb | 2 | ||||
-rw-r--r-- | app/views/settings/_issues.html.erb | 2 | ||||
-rw-r--r-- | config/locales/en.yml | 1 | ||||
-rw-r--r-- | config/settings.yml | 3 | ||||
-rw-r--r-- | lib/redmine/helpers/gantt.rb | 2 |
5 files changed, 8 insertions, 2 deletions
diff --git a/app/views/gantts/show.html.erb b/app/views/gantts/show.html.erb index 216c10061..476c86025 100644 --- a/app/views/gantts/show.html.erb +++ b/app/views/gantts/show.html.erb @@ -61,7 +61,7 @@ </p> <p class="buttons"> - <%= number_field_tag 'months', @gantt.months, :min => 1, :max => 24, :autocomplete => false %> + <%= number_field_tag 'months', @gantt.months, :min => 1, :max => Setting.gantt_months_limit.to_i, :autocomplete => false %> <%= l(:label_months_from) %> <%= select_month(@gantt.month_from, :prefix => "month", :discard_type => true) %> <%= select_year(@gantt.year_from, :prefix => "year", :discard_type => true) %> diff --git a/app/views/settings/_issues.html.erb b/app/views/settings/_issues.html.erb index 17e8ca99b..b4e50d8e3 100644 --- a/app/views/settings/_issues.html.erb +++ b/app/views/settings/_issues.html.erb @@ -22,6 +22,8 @@ <p><%= setting_text_field :issues_export_limit, :size => 6 %></p> <p><%= setting_text_field :gantt_items_limit, :size => 6 %></p> + +<p><%= setting_text_field :gantt_months_limit, :size => 6 %></p> </div> <fieldset class="box"> diff --git a/config/locales/en.yml b/config/locales/en.yml index 79f47cb6c..50f75877a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -447,6 +447,7 @@ en: setting_commit_logtime_enabled: Enable time logging setting_commit_logtime_activity_id: Activity for logged time setting_gantt_items_limit: Maximum number of items displayed on the gantt chart + setting_gantt_months_limit: Maximum number of months displayed on the gantt chart setting_issue_group_assignment: Allow issue assignment to groups setting_default_issue_start_date_to_creation_date: Use current date as start date for new issues setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/settings.yml b/config/settings.yml index 4ae9c7487..0d13e57a1 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -105,6 +105,9 @@ feeds_limit: gantt_items_limit: format: int default: 500 +gantt_months_limit: + format: int + default: 24 # Maximum size of files that can be displayed # inline through the file viewer (in KB) file_max_size_displayed: diff --git a/lib/redmine/helpers/gantt.rb b/lib/redmine/helpers/gantt.rb index ac2b34e3d..12c5044f6 100644 --- a/lib/redmine/helpers/gantt.rb +++ b/lib/redmine/helpers/gantt.rb @@ -67,7 +67,7 @@ module Redmine zoom = (options[:zoom] || User.current.pref[:gantt_zoom]).to_i @zoom = (zoom > 0 && zoom < 5) ? zoom : 2 months = (options[:months] || User.current.pref[:gantt_months]).to_i - @months = (months > 0 && months < 25) ? months : 6 + @months = (months > 0 && months < Setting.gantt_months_limit.to_i + 1) ? months : 6 # Save gantt parameters as user preference (zoom and months count) if (User.current.logged? && (@zoom != User.current.pref[:gantt_zoom] || @months != User.current.pref[:gantt_months])) |