From 75b67dddf5b29a9c5259be3a0a49b7aa87a934ee Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Fri, 25 May 2012 09:59:39 +0800 Subject: [PATCH] Fix date bugs --- .../panel/announcement/back_end/bulletins_controller.rb | 4 ++-- .../panel/news/back_end/news_bulletins_controller.rb | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb index c7d46eb2..d11ea301 100644 --- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb +++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb @@ -135,7 +135,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController else @bulletin = Bulletin.new(params[:bulletin]) - @bulletin.deadline = nil if @bulletin.deadline < @bulletin.postdate + @bulletin.deadline = nil if (@bulletin.deadline < @bulletin.postdate rescue nil) @bulletin.create_user_id = current_user.id @bulletin.update_user_id = current_user.id @@ -244,7 +244,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController else @bulletin = Bulletin.find(params[:id]) - @bulletin.deadline = nil if @bulletin.deadline < @bulletin.postdate + @bulletin.deadline = nil if (@bulletin.deadline < @bulletin.postdate rescue nil) @bulletin.update_user_id = current_user.id diff --git a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletins_controller.rb b/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletins_controller.rb index b725da6d..b8fa7cc8 100644 --- a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletins_controller.rb +++ b/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletins_controller.rb @@ -36,7 +36,7 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController # @news_bulletins = (params[:sort] || @filter) ? get_sorted_and_filtered_news_bulletins : NewsBulletin.all.page(params[:page]).per(10) - @news_bulletins = (params[:sort] || @filter) ? get_sorted_and_filtered("news_bulletin") : NewsBulletin.all.page(params[:page]).per(10) + @news_bulletins = (params[:sort] || @filter) ? get_sorted_and_filtered("news_bulletin") : get_viewable("news_bulletin") @news_bulletin_categories = NewsBulletinCategory.all @news_bulletin_link = NewsBulletinLink.new @@ -136,7 +136,7 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController else @news_bulletin = NewsBulletin.new(params[:news_bulletin]) - @news_bulletin.deadline = nil if @news_bulletin.deadline < @news_bulletin.postdate + @news_bulletin.deadline = nil if (@news_bulletin.deadline < @news_bulletin.postdate rescue nil) @news_bulletin.create_user_id = current_user.id @news_bulletin.update_user_id = current_user.id @@ -245,7 +245,7 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController else @news_bulletin = NewsBulletin.find(params[:id]) - @news_bulletin.deadline = nil if @news_bulletin.deadline < @news_bulletin.postdate + @news_bulletin.deadline = nil if (@news_bulletin.deadline < @news_bulletin.postdate rescue nil) @news_bulletin.update_user_id = current_user.id