Apply fixes for #848 to 1.7 branch. Fixes #848 again.

This commit is contained in:
Eric Allen 2009-04-20 14:48:46 -04:00
parent 52ed21d0c3
commit 6bccd2a6ce

View file

@ -284,7 +284,16 @@ module TodosHelper
url = {:controller => 'todos', :action => 'defer', :id => @todo.id, :days => days,
:_source_view => (@source_view.underscore.gsub(/\s+/,'_') rescue "")}
url[:_tag_name] = @tag_name if @source_view == 'tag'
link_to_remote image_tag("defer_#{days}.png", :alt => "Defer #{pluralize(days, 'day')}"), :url => url
futuredate = (@todo.show_from || @todo.user.date) + days.days
if @todo.due && futuredate > @todo.due
return link_to_function(
image_tag("defer_#{days}.png", :alt => "Defer #{pluralize(days, 'day')}"),
"alert('Defer date is after due date. Please edit and adjust due date before deferring.')")
else
return link_to_remote(
image_tag("defer_#{days}.png", :alt => "Defer #{pluralize(days, 'day')}"),
:url => url)
end
end
end