##// END OF EJS Templates
Adds a user search field with autocompleter on project members screen....
Adds a user search field with autocompleter on project members screen. User selection with checkboxes is disabled if there are more than 300 users available (#2993). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2638 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r2549:04e181b8b05d
r2549:04e181b8b05d
Show More
member.rb
52 lines | 1.6 KiB | text/x-ruby | RubyLexer
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 # redMine - project management software
# Copyright (C) 2006 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class Member < ActiveRecord::Base
belongs_to :user
belongs_to :role
belongs_to :project
validates_presence_of :role, :user, :project
validates_uniqueness_of :user_id, :scope => :project_id
Jean-Philippe Lang
Merged 0.6 branch into trunk....
r663 def validate
Jean-Philippe Lang
Merged Rails 2.2 branch. Redmine now requires Rails 2.2.2....
r2430 errors.add :role_id, :invalid if role && !role.member?
Jean-Philippe Lang
Merged 0.6 branch into trunk....
r663 end
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 def name
Jean-Philippe Lang
Removed User#display_name (replaced by User#name)....
r575 self.user.name
Jean-Philippe Lang
Localization plugin removed (replaced with GLoc)...
r12 end
Jean-Philippe Lang
Each category can now be associated to a user, so that new issues in that category are automatically assigned to that user....
r574
Jean-Philippe Lang
Adds a user search field with autocompleter on project members screen....
r2549 # Sets user by login
def user_login=(login)
login = login.to_s
unless login.blank?
if (u = User.find_by_login(login))
self.user = u
end
end
end
Jean-Philippe Lang
User display format is now configurable in administration settings....
r1089 def <=>(member)
role == member.role ? (user <=> member.user) : (role <=> member.role)
end
Jean-Philippe Lang
Each category can now be associated to a user, so that new issues in that category are automatically assigned to that user....
r574 def before_destroy
# remove category based auto assignments for this member
Jean-Philippe Lang
Fixed: error when removing a project member (postgresql and sqlite only)....
r1068 IssueCategory.update_all "assigned_to_id = NULL", ["project_id = ? AND assigned_to_id = ?", project.id, user.id]
Jean-Philippe Lang
Each category can now be associated to a user, so that new issues in that category are automatically assigned to that user....
r574 end
Jean-Philippe Lang
Initial commit...
r2 end