From bf1060d1eb3b709a7f7e96a5d4fdd55d7767f5d9 Mon Sep 17 00:00:00 2001 From: Spen Date: Wed, 4 Sep 2013 14:54:41 +0800 Subject: [PATCH] ydu announcement approval fix --- .../announcement/back_end/bulletins_controller.rb | 15 ++++++++++----- .../back_end/bulletins/_bulletin.html.erb | 4 ++-- 2 files changed, 12 insertions(+), 7 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 e45ced1d6..fd2e454bd 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 @@ -95,7 +95,8 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController # GET /bulletins/1/edit def edit @bulletin = Bulletin.find(params[:id]) - if !current_user.admin? && (@bulletin.is_rejected? || @bulletin.is_checked?) + # if !current_user.admin? && (@bulletin.is_rejected? || @bulletin.is_checked?) + if (@bulletin.create_user_id != current_or_guest_user.id) and !is_manager? redirect_to :action => :index else # @summary_variable = @bulletin.summary_variable @@ -137,11 +138,11 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController @bulletin.create_user_id = current_user.id @bulletin.update_user_id = current_user.id - if(is_manager? || is_admin?) + # if(is_manager? || is_admin?) @bulletin.is_checked = true @bulletin.is_rejected = false @bulletin.de_pending - end + # end respond_to do |format| if @bulletin.save @@ -221,11 +222,11 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController respond_to do |format| if @bulletin.update_attributes(params[:bulletin]) - if(is_manager? || is_admin?) + # if(is_manager? || is_admin?) @bulletin.is_checked = true @bulletin.is_rejected = false @bulletin.de_pending! - end + # end # if (params[:bulletin][:is_checked] == "false") # @bulletin.is_rejected = true # @bulletin.save! @@ -251,7 +252,9 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController # DELETE /bulletins/1 # DELETE /bulletins/1.xml def destroy + @bulletin = Bulletin.find(params[:id]) + # @bulletin.bulletin_files.destroy @bulletin.destroy @@ -261,6 +264,8 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController # format.xml { head :ok } format.js end + + end # def top_edit diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb index 85b9a4bd4..553d0e2e4 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb @@ -34,7 +34,7 @@
- <% end %> + <%# end %> <% end -%> <% if show_delete_link(bulletin) %>