update back end index list
This commit is contained in:
parent
ca2b66a210
commit
39386930ef
|
@ -25,7 +25,12 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||||
@statuses = get_statuses
|
@statuses = get_statuses
|
||||||
category_ids = @categories.collect{|t| t.id}
|
category_ids = @categories.collect{|t| t.id}
|
||||||
|
|
||||||
|
if is_manager? or is_admin?
|
||||||
@bulletins = get_sorted_and_filtered("bulletin", :category_id.in => category_ids)
|
@bulletins = get_sorted_and_filtered("bulletin", :category_id.in => category_ids)
|
||||||
|
else
|
||||||
|
@bulletins = get_sorted_and_filtered("bulletin", {:category_id.in => category_ids, :create_user_id => current_user.id})
|
||||||
|
end
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # index.html.erb
|
format.html # index.html.erb
|
||||||
format.js { }
|
format.js { }
|
||||||
|
@ -70,7 +75,8 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||||
@tags = get_tags
|
@tags = get_tags
|
||||||
is_authorized_sub_manager = @bulletin.category.auth_sub_manager.authorized_user_ids rescue nil
|
is_authorized_sub_manager = @bulletin.category.auth_sub_manager.authorized_user_ids rescue nil
|
||||||
|
|
||||||
if !(is_manager? || is_admin? || is_authorized_sub_manager.include?(current_user.id))
|
if !(is_manager? || is_admin? || (is_authorized_sub_manager.include?(current_user.id) and @bulletin.create_user_id == current_user.id))
|
||||||
|
|
||||||
redirect_to :action => :index
|
redirect_to :action => :index
|
||||||
else
|
else
|
||||||
# @summary_variable = @bulletin.summary_variable
|
# @summary_variable = @bulletin.summary_variable
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<% set_default_index do
|
<%
|
||||||
|
|
||||||
|
@unit_field = User.get_member_list_attribute_field("staff","unit")
|
||||||
|
|
||||||
|
set_default_index do
|
||||||
objects @bulletins
|
objects @bulletins
|
||||||
quick_edit_link type: 'edit',
|
quick_edit_link type: 'edit',
|
||||||
link: 'edit_panel_announcement_back_end_bulletin_path'
|
link: 'edit_panel_announcement_back_end_bulletin_path'
|
||||||
|
@ -49,6 +53,11 @@
|
||||||
translation: 'last_modified',
|
translation: 'last_modified',
|
||||||
hide: 'phone',
|
hide: 'phone',
|
||||||
sort: 'last_modified'
|
sort: 'last_modified'
|
||||||
|
field db_field: 'update_user_id',
|
||||||
|
translation: 'announcement.default_widget.bulletin_create_dept',
|
||||||
|
display_option: 'User.get_member_list_attribute_value(object.create_user_id,@unit_field.id).get_value_by_locale(I18n.locale) rescue nil',
|
||||||
|
sort: 'last_modified'
|
||||||
|
|
||||||
filter_field type: 'array',
|
filter_field type: 'array',
|
||||||
values: @statuses,
|
values: @statuses,
|
||||||
translation: 'status'
|
translation: 'status'
|
||||||
|
|
Loading…
Reference in New Issue