diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1b65ecd9..ed6e5163 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -59,7 +59,7 @@ class ApplicationController < ActionController::Base def set_session_expiration # http://wiki.rubyonrails.com/rails/show/HowtoChangeSessionOptions unless session == nil - return if @controller_name == 'feed' or session['noexpiry'] == "on" + return if self.controller_name == 'feed' or session['noexpiry'] == "on" # If the method is called by the feed controller (which we don't have # under session control) or if we checked the box to keep logged in on # login don't set the session expiry time. diff --git a/app/controllers/todos_controller.rb b/app/controllers/todos_controller.rb index ca1e87e9..952be857 100644 --- a/app/controllers/todos_controller.rb +++ b/app/controllers/todos_controller.rb @@ -11,6 +11,8 @@ class TodosController < ApplicationController :completed_archive, :check_deferred, :toggle_check, :toggle_star, :edit, :update, :defer, :create, :calendar, :auto_complete_for_predecessor, :remove_predecessor, :add_predecessor] + protect_from_forgery :except => :check_deferred + def index @projects = current_user.projects.find(:all, :include => [:default_context]) @contexts = current_user.contexts.find(:all) @@ -823,13 +825,13 @@ class TodosController < ApplicationController # current_users.todos.find but that broke with_scope for :limit # Exclude hidden projects from count on home page - @todos = current_user.todos.find(:all, :include => [ :project, :context, :tags ]) + @todos = current_user.todos.find(:all, :include => [ :project, :context, :tags, :pending_successors, :recurring_todo ]) # Exclude hidden projects from the home page @not_done_todos = current_user.todos.find(:all, :conditions => ['contexts.hide = ? AND (projects.state = ? OR todos.project_id IS NULL)', false, 'active'], :order => "todos.due IS NULL, todos.due ASC, todos.created_at ASC", - :include => [ :project, :context, :tags ]) + :include => [ :project, :context, :tags, :pending_successors, :recurring_todo ]) end end diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 5aa674c4..2304a8dd 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -30,11 +30,13 @@ module TodosHelper :_source_view => (@source_view.underscore.gsub(/\s+/,'_') rescue "")} url[:_tag_name] = @tag_name if @source_view == 'tag' - futuredate = (todo.show_from || todo.user.date) + days.days options = {:x_defer_alert => false, :class => "icon_defer_item" } - if todo.due && futuredate > todo.due - options[:x_defer_alert] = true - options[:x_defer_date_after_due_date] = t('todos.defer_date_after_due_date') + if todo.due + futuredate = (todo.show_from || todo.user.date) + days.days + if futuredate > todo.due + options[:x_defer_alert] = true + options[:x_defer_date_after_due_date] = t('todos.defer_date_after_due_date') + end end return link_to(image_tag_for_defer(days), url, options) @@ -375,7 +377,7 @@ module TodosHelper container_id = "p#{@original_item_project_id}empty-nd" if @remaining_in_context == 0 container_id = "tickler-empty-nd" if ( ( (@todo_was_activated_from_deferred_state || @todo_was_activated_from_pending_state) && @remaining_deferred_or_pending_count == 0) || - (@original_item_was_deferred && @remaining_deferred_or_pending_count == 0 && @todo.completed?) ) + (@original_item_was_deferred && @remaining_deferred_or_pending_count == 0 && @todo.completed?) ) container_id = "empty-d" if @completed_count && @completed_count == 0 && !@todo.completed? } page.deferred { container_id = "c#{@original_item_context_id}empty-nd" if @remaining_in_context == 0 } diff --git a/app/views/layouts/standard.html.erb b/app/views/layouts/standard.html.erb index 621ef419..3c941592 100644 --- a/app/views/layouts/standard.html.erb +++ b/app/views/layouts/standard.html.erb @@ -25,7 +25,7 @@ <% if current_user.prefs.refresh != 0 -%> setup_auto_refresh(<%= current_user.prefs["refresh"].to_i*60000 %>); <% end -%> - <% unless @controller_name == 'feed' or session['noexpiry'] == "on" -%> + <% unless controller.controller_name == 'feed' or session['noexpiry'] == "on" -%> setup_periodic_check("<%=url_for(:controller => "login", :action => "check_expiry")%>", 5*60); <% end -%> setup_periodic_check("<%=check_deferred_todos_path(:format => 'js')%>", 10*60, 'POST'); diff --git a/config/locales/nl.yml b/config/locales/nl.yml index ab5dce3a..f4f9a8a5 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -299,7 +299,7 @@ nl: added_new_next_action: Nieuwe actie toegevoegd star_action: Markeer deze actie met een ster completed_recurrence_completed: Er is geen actie na de terugkerende actie die u new verwijderd heeft. De herhaling is voltooid - defer_date_after_due_date: Uitsteldatum is na de vervaldag. Gelieve vervaldag bewerken alvorens uitstedatuml aan te passen. + defer_date_after_due_date: Uitsteldatum is na de vervaldag. Gelieve vervaldag bewerken alvorens uitsteldatum aan te passen. unable_to_add_dependency: Niet in staat om de afhankelijkheid toe te voegen done: Voltooid? star_action_with_description: markeer de actie '%{description}' met een ster