update back end index list

This commit is contained in:
spen 2014-07-25 15:04:57 +08:00
parent ca2b66a210
commit 39386930ef
2 changed files with 18 additions and 3 deletions

View File

@ -25,7 +25,12 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
@statuses = get_statuses
category_ids = @categories.collect{|t| t.id}
if is_manager? or is_admin?
@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|
format.html # index.html.erb
format.js { }
@ -70,7 +75,8 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
@tags = get_tags
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
else
# @summary_variable = @bulletin.summary_variable

View File

@ -1,4 +1,8 @@
<% set_default_index do
<%
@unit_field = User.get_member_list_attribute_field("staff","unit")
set_default_index do
objects @bulletins
quick_edit_link type: 'edit',
link: 'edit_panel_announcement_back_end_bulletin_path'
@ -49,6 +53,11 @@
translation: 'last_modified',
hide: 'phone',
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',
values: @statuses,
translation: 'status'