ydu announcement approval fix
This commit is contained in:
parent
51efaa6d6b
commit
bf1060d1eb
|
@ -95,7 +95,8 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||||
# GET /bulletins/1/edit
|
# GET /bulletins/1/edit
|
||||||
def edit
|
def edit
|
||||||
@bulletin = Bulletin.find(params[:id])
|
@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
|
redirect_to :action => :index
|
||||||
else
|
else
|
||||||
# @summary_variable = @bulletin.summary_variable
|
# @summary_variable = @bulletin.summary_variable
|
||||||
|
@ -137,11 +138,11 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||||
|
|
||||||
@bulletin.create_user_id = current_user.id
|
@bulletin.create_user_id = current_user.id
|
||||||
@bulletin.update_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_checked = true
|
||||||
@bulletin.is_rejected = false
|
@bulletin.is_rejected = false
|
||||||
@bulletin.de_pending
|
@bulletin.de_pending
|
||||||
end
|
# end
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @bulletin.save
|
if @bulletin.save
|
||||||
|
@ -221,11 +222,11 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
|
||||||
if @bulletin.update_attributes(params[:bulletin])
|
if @bulletin.update_attributes(params[:bulletin])
|
||||||
if(is_manager? || is_admin?)
|
# if(is_manager? || is_admin?)
|
||||||
@bulletin.is_checked = true
|
@bulletin.is_checked = true
|
||||||
@bulletin.is_rejected = false
|
@bulletin.is_rejected = false
|
||||||
@bulletin.de_pending!
|
@bulletin.de_pending!
|
||||||
end
|
# end
|
||||||
# if (params[:bulletin][:is_checked] == "false")
|
# if (params[:bulletin][:is_checked] == "false")
|
||||||
# @bulletin.is_rejected = true
|
# @bulletin.is_rejected = true
|
||||||
# @bulletin.save!
|
# @bulletin.save!
|
||||||
|
@ -251,7 +252,9 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||||
# DELETE /bulletins/1
|
# DELETE /bulletins/1
|
||||||
# DELETE /bulletins/1.xml
|
# DELETE /bulletins/1.xml
|
||||||
def destroy
|
def destroy
|
||||||
|
|
||||||
@bulletin = Bulletin.find(params[:id])
|
@bulletin = Bulletin.find(params[:id])
|
||||||
|
|
||||||
# @bulletin.bulletin_files.destroy
|
# @bulletin.bulletin_files.destroy
|
||||||
@bulletin.destroy
|
@bulletin.destroy
|
||||||
|
|
||||||
|
@ -261,6 +264,8 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||||
# format.xml { head :ok }
|
# format.xml { head :ok }
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# def top_edit
|
# def top_edit
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
<div class="quick-edit">
|
<div class="quick-edit">
|
||||||
<ul class="nav nav-pills hide">
|
<ul class="nav nav-pills hide">
|
||||||
<% if (bulletin.create_user_id == current_or_guest_user.id) || is_manager? %>
|
<% if (bulletin.create_user_id == current_or_guest_user.id) || is_manager? %>
|
||||||
<% if current_or_guest_user.admin? || (!bulletin.is_rejected? && !bulletin.is_checked?) %>
|
<%# if current_or_guest_user.admin? || (!bulletin.is_rejected? && !bulletin.is_checked?) %>
|
||||||
<li><%= link_to t(:edit), edit_panel_announcement_back_end_bulletin_path(bulletin) %></li>
|
<li><%= link_to t(:edit), edit_panel_announcement_back_end_bulletin_path(bulletin) %></li>
|
||||||
<li class="dropdown">
|
<li class="dropdown">
|
||||||
<a href="#" data-toggle="dropdown" class="dropdown-toggle"><%= t(:quick_edit) %><b class="caret"></b></a>
|
<a href="#" data-toggle="dropdown" class="dropdown-toggle"><%= t(:quick_edit) %><b class="caret"></b></a>
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
<li><%#= link_to t(:file_), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'files'), :remote => true %></li>
|
<li><%#= link_to t(:file_), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'files'), :remote => true %></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<%# end %>
|
||||||
|
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<% if show_delete_link(bulletin) %>
|
<% if show_delete_link(bulletin) %>
|
||||||
|
|
Loading…
Reference in New Issue