mirror of
https://github.com/redmine/redmine.git
synced 2026-03-09 22:20:55 +01:00
Add bulk lock feature to user list context menu (#40913).
Patch by Mizuki ISHIKAWA (@ishikawa999). git-svn-id: https://svn.redmine.org/redmine/trunk@22898 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -231,17 +231,22 @@ class UsersController < ApplicationController
|
||||
@users = User.logged.where(id: params[:ids]).where.not(id: User.current)
|
||||
(render_404; return) unless @users.any?
|
||||
|
||||
if params[:lock]
|
||||
@users.update_all status: User::STATUS_LOCKED
|
||||
flash[:notice] = l(:notice_successful_update)
|
||||
redirect_to users_path
|
||||
elsif params[:confirm] == I18n.t(:general_text_Yes)
|
||||
if params[:confirm] == I18n.t(:general_text_Yes)
|
||||
@users.destroy_all
|
||||
flash[:notice] = l(:notice_successful_delete)
|
||||
redirect_to users_path
|
||||
end
|
||||
end
|
||||
|
||||
def bulk_lock
|
||||
@users = User.logged.where(id: params[:ids]).where.not(id: User.current)
|
||||
(render_404; return) unless @users.any?
|
||||
|
||||
@users.update_all status: User::STATUS_LOCKED
|
||||
flash[:notice] = l(:notice_successful_update)
|
||||
redirect_to users_path
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def find_user(logged = true)
|
||||
|
||||
Reference in New Issue
Block a user