| Class | User |
| In: |
app/models/user.rb
|
| Parent: | ActiveRecord::Base |
| Original by: | Sysphonic |
| Authors: | MORITA Shintaro |
| Copyright: | Copyright (c) 2007 MORITA Shintaro, Sysphonic. All rights reserved. |
| License: | New BSD License (See LICENSE file) |
| URL: | http://sysphonic.com/ |
User represents LOGIN-account and its personal information.
*
| AUTH_ALL | = | 'all' |
| AUTH_DESKTOP | = | 'desktop' |
| AUTH_ITEM | = | 'item' |
| AUTH_FOLDER | = | 'folder' |
| AUTH_USER | = | 'user' |
| AUTH_GROUP | = | 'group' |
| AUTH_TEAM | = | 'team' |
| AUTH_SCHEDULE | = | 'schedule' |
| AUTH_EQUIPMENT | = | 'equipment' |
| AUTH_LOG | = | 'log' |
| AUTH_RESEARCH | = | 'research' |
| AUTH_TEMPLATE | = | 'template' |
| AUTH_NAMES | = | { AUTH_ALL => _('All Authorities'), AUTH_DESKTOP => _('Desktop'), AUTH_ITEM => _('Item'), AUTH_FOLDER => _('Folder'), AUTH_USER => _('User'), AUTH_GROUP => _('Group'), AUTH_TEAM => _('Team'), AUTH_SCHEDULE => _('Schedule'), AUTH_EQUIPMENT => _('Equipment'), AUTH_LOG => _('Log'), AUTH_RESEARCH => _('Research'), AUTH_TEMPLATE => _('Template'), } |
| XORDER_MAX | = | 9999 |
| TEL_TYPE_EXTERNAL | = | _('External') |
| TEL_TYPE_INTERNAL | = | _('Internal') |
| TEL_TYPE_HOME | = | _('Home') |
| TEL_TYPE_MOBILE | = | _('Mobile') |
| HUMANIZED_ATTRIBUTE_KEY_NAMES | = | { "name" => 'User name', "password" => 'Password', "email" => 'E-mail', } |
Finds all Users in order to display with specified condition.
| con: | Condition (String without ‘where ’). If not required, specify nil. |
| return: | Array of Users. |
Gets Users who have the specified authority.
| auth: | Target authority. If any, specify nil. |
| return: | Array of Users. |
Gets String which represents the specified authority.
| auth: | Target authority. |
| return: | String which represents the specified authority. |
Gets titles from the configuration file.
| return: | Titles in the configuration file. |
Parses fields array of a CSV row.
| row: | Fields array of a CSV row. |
| return: | User instance created from specified array. |
Updates title attributes of corresponding Users.
| org_title: | Original title. |
| new_title: | New title. |
Saves official titles in the configuration file.
| titles: | Array of the official titles. |
Updates xorder attributes of all Users whose titles are the same as specified one.
| title: | Target official title. Specifiy nil if all users are to update. |
| order: | New order index. |
Checks data to import.
| mode: | Mode (‘add’ or ‘update’). |
| user_names: | Array of User names to check duplicated data. |
| return: | Array of error messages. If no error, returns []. |
Gets authorities array.
| return: | Authorities array without empty element. If no authorities, returns empty array. |
Gets Groups array to which this User belongs.
| return: | Array of Group-IDs. If no groups, returns empty array. |
Gets Profile-sheet as an Item object.
| return: | Profile-sheet as an Item object. If no profile, returns nil. |
Gets this User‘s Comment as an application for the project.
| item_id: | Item-ID of the project definition. |
| return: | Comment if exist, nil otherwise. |
Gets Teams array to which this User belongs.
| return: | Array of Team-IDs. If no teams, returns empty array. |