Patch #5790 ยป gantt.rb.diff
| lib/redmine/helpers/gantt.rb (working copy) | ||
|---|---|---|
|
@month_from = 1
|
||
|
end
|
||
|
else
|
||
|
@month_from ||= Date.today.month
|
||
|
@year_from ||= Date.today.year
|
||
|
@month_from ||= (User.current.pref[:gantt_month] || Date.today.month)
|
||
|
@year_from ||= (User.current.pref[:gantt_year] || Date.today.year)
|
||
|
end
|
||
|
|
||
|
zoom = (options[:zoom] || User.current.pref[:gantt_zoom]).to_i
|
||
| ... | ... | |
|
@months = (months > 0 && months < 25) ? 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]))
|
||
|
User.current.pref[:gantt_zoom], User.current.pref[:gantt_months] = @zoom, @months
|
||
|
User.current.preference.save
|
||
|
pref = User.current.pref
|
||
|
if User.current.logged? && (@zoom != pref[:gantt_zoom] || @months != pref[:gantt_months] || @month_from != pref[:gantt_month] || @year_from != pref[:year_from])
|
||
|
pref[:gantt_zoom], pref[:gantt_months], pref[:gantt_month], pref[:year_from] = @zoom, @months, @month_from, @year_from
|
||
|
pref.save
|
||
|
end
|
||
|
|
||
|
@date_from = Date.civil(@year_from, @month_from, 1)
|
||