diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2010-09-10 03:09:18 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2010-09-10 03:09:18 +0000 |
commit | 5e1c29523003f697b4ba88998c1c587881785820 (patch) | |
tree | 2a6cf2faee2f27287177ec344ddea5a0a990c8ad | |
parent | abf3ee4999050bd24ba75a53805bc7e7ac80ed0d (diff) | |
download | redmine-5e1c29523003f697b4ba88998c1c587881785820.tar.gz redmine-5e1c29523003f697b4ba88998c1c587881785820.zip |
Fixed the zoom, previous, and next links on the Gantt chart.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4074 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/helpers/issues_helper.rb | 4 | ||||
-rw-r--r-- | app/views/gantts/show.html.erb | 4 | ||||
-rw-r--r-- | lib/redmine/helpers/gantt.rb | 10 |
3 files changed, 11 insertions, 7 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 284aae91a..f1ddcfcbf 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -245,7 +245,7 @@ module IssuesHelper when :in if gantt.zoom < 4 link_to_remote(l(:text_zoom_in) + image_tag('zoom_in.png', img_attributes.merge(:alt => l(:text_zoom_in))), - {:url => gantt.params.merge(:zoom => (gantt.zoom+1)), :update => 'content'}, + {:url => gantt.params.merge(:zoom => (gantt.zoom+1)), :method => :get, :update => 'content'}, {:href => url_for(gantt.params.merge(:zoom => (gantt.zoom+1)))}) else l(:text_zoom_in) + @@ -255,7 +255,7 @@ module IssuesHelper when :out if gantt.zoom > 1 link_to_remote(l(:text_zoom_out) + image_tag('zoom_out.png', img_attributes.merge(:alt => l(:text_zoom_out))), - {:url => gantt.params.merge(:zoom => (gantt.zoom-1)), :update => 'content'}, + {:url => gantt.params.merge(:zoom => (gantt.zoom-1)), :method => :get, :update => 'content'}, {:href => url_for(gantt.params.merge(:zoom => (gantt.zoom-1)))}) else l(:text_zoom_out) + diff --git a/app/views/gantts/show.html.erb b/app/views/gantts/show.html.erb index ce8c67b26..5a64054af 100644 --- a/app/views/gantts/show.html.erb +++ b/app/views/gantts/show.html.erb @@ -169,8 +169,8 @@ if Date.today >= @gantt.date_from and Date.today <= @gantt.date_to %> <table width="100%"> <tr> -<td align="left"><%= link_to_remote ('« ' + l(:label_previous)), {:url => @gantt.params_previous, :update => 'content', :complete => 'window.scrollTo(0,0)'}, {:href => url_for(@gantt.params_previous)} %></td> -<td align="right"><%= link_to_remote (l(:label_next) + ' »'), {:url => @gantt.params_next, :update => 'content', :complete => 'window.scrollTo(0,0)'}, {:href => url_for(@gantt.params_next)} %></td> +<td align="left"><%= link_to_remote ('« ' + l(:label_previous)), {:url => @gantt.params_previous, :method => :get, :update => 'content', :complete => 'window.scrollTo(0,0)'}, {:href => url_for(@gantt.params_previous)} %></td> +<td align="right"><%= link_to_remote (l(:label_next) + ' »'), {:url => @gantt.params_next, :method => :get, :update => 'content', :complete => 'window.scrollTo(0,0)'}, {:href => url_for(@gantt.params_next)} %></td> </tr> </table> diff --git a/lib/redmine/helpers/gantt.rb b/lib/redmine/helpers/gantt.rb index 7c694022a..cec323720 100644 --- a/lib/redmine/helpers/gantt.rb +++ b/lib/redmine/helpers/gantt.rb @@ -68,17 +68,21 @@ module Redmine @date_from = Date.civil(@year_from, @month_from, 1) @date_to = (@date_from >> @months) - 1 end + + def common_params + { :controller => 'gantts', :action => 'show', :project_id => @project } + end def params - { :zoom => zoom, :year => year_from, :month => month_from, :months => months } + common_params.merge({ :zoom => zoom, :year => year_from, :month => month_from, :months => months }) end def params_previous - { :year => (date_from << months).year, :month => (date_from << months).month, :zoom => zoom, :months => months } + common_params.merge({:year => (date_from << months).year, :month => (date_from << months).month, :zoom => zoom, :months => months }) end def params_next - { :year => (date_from >> months).year, :month => (date_from >> months).month, :zoom => zoom, :months => months } + common_params.merge({:year => (date_from >> months).year, :month => (date_from >> months).month, :zoom => zoom, :months => months }) end ### Extracted from the HTML view/helpers |