Project

General

Profile

Patch #14318 » 0002-modif-watchers.patch

Jonathan Griffon, 2021-11-17 16:53

View differences:

redmine-4.2.3/app/controllers/watchers_controller.rb → app/controllers/watchers_controller.rb
def users_for_new_watcher
scope = nil
if params[:q].blank? && @project.present?
scope = @project.principals.assignable_watchers
scope = @project.users
else
scope = Principal.assignable_watchers.limit(100)
scope = User.all.limit(100)
end
users = scope.sorted.like(params[:q]).to_a
if @watchables && @watchables.size == 1
watchable_object = @watchables.first
users -= watchable_object.watcher_users
if watchable_object.respond_to?(:visible?)
users.reject! {|user| user.is_a?(User) && !watchable_object.visible?(user)}
end
users -= @watchables.first.watcher_users
end
users
end
(15-15/15)