Changeset 750
- Timestamp:
- 03/11/08 19:08:29 (10 months ago)
- Files:
-
- trunk/app/controllers/application.rb (modified) (1 diff)
- trunk/app/controllers/keyring_controller.rb (modified) (3 diffs)
- trunk/app/controllers/message_controller.rb (modified) (2 diffs)
- trunk/app/controllers/setting_controller.rb (modified) (1 diff)
- trunk/app/controllers/user_controller.rb (modified) (6 diffs)
- trunk/app/controllers/user_group_controller.rb (modified) (2 diffs)
- trunk/app/helpers/application_helper.rb (modified) (1 diff)
- trunk/app/helpers/customer_interface_helper.rb (modified) (4 diffs)
- trunk/app/helpers/task_helper.rb (modified) (1 diff)
- trunk/app/models/asset.rb (modified) (2 diffs)
- trunk/app/models/customer.rb (modified) (1 diff)
- trunk/app/models/lockable.rb (modified) (1 diff)
- trunk/app/models/notification_mailer.rb (modified) (1 diff)
- trunk/app/models/setting.rb (modified) (9 diffs)
- trunk/app/models/task.rb (modified) (1 diff)
- trunk/app/models/user.rb (modified) (2 diffs)
- trunk/app/models/user_account.rb (modified) (1 diff)
- trunk/app/views/attachment/view.rhtml (modified) (1 diff)
- trunk/app/views/layouts/customer_interface.rhtml (modified) (1 diff)
- trunk/app/views/setting/access_control.rhtml (modified) (1 diff)
- trunk/app/views/task/_display_task_event.rhtml (modified) (1 diff)
- trunk/app/views/task/_form.rhtml (modified) (1 diff)
- trunk/app/views/task/print_view.rhtml (modified) (3 diffs)
- trunk/app/views/task/view.rhtml (modified) (3 diffs)
- trunk/app/views/timeline/_display_event.rhtml (modified) (3 diffs)
- trunk/doc/manual/latex/tex/configuration_section.tex (modified) (1 diff)
- trunk/po/fi_FI/norfello_cmms.po (modified) (22 diffs)
- trunk/test/functional/setting_controller_test.rb (modified) (3 diffs)
- trunk/test/test_helper.rb (modified) (1 diff)
- trunk/test/unit/notification_mailer_test.rb (modified) (2 diffs)
- trunk/test/unit/user_test.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/app/controllers/application.rb
r749 r750 666 666 sort_sql = (@fields.collect { |f| f[2] })[@sort_column] 667 667 if params[:sort_desc] 668 sort_sql += ' DESC'668 sort_sql = sort_sql.split(',').map { |col| col + ' DESC' }.join(',') 669 669 @sort_desc = 1 670 670 end trunk/app/controllers/keyring_controller.rb
r749 r750 114 114 @keyring = Keyring.find params[:id], :readonly => true 115 115 @items_count = @keyring.users.count 116 @items = items_for_page(@keyring.users )116 @items = items_for_page(@keyring.users, :order => User.sql_order_for_login_and_name) 117 117 @title = _('Owners of keyring %s', @keyring.name) 118 118 @fields = [ [_('Login and name'), :login_and_name] ] … … 120 120 @check_name = 'remove' 121 121 @post_params = { :action => 'remove_owners', :id => @keyring.id } 122 @available_users = (User.find(:all ) - @keyring.users).collect {|p| [ p.login_and_name, p.id ]}.sort { |a,b| a.first <=> b.first}122 @available_users = (User.find(:all, :order => User.sql_order_for_login_and_name) - @keyring.users).collect {|p| [ p.login_and_name, p.id ]} 123 123 common_list(false) 124 124 end … … 137 137 138 138 info "Keyring #{keyring.name} given to user #{user.login}" 139 flash[:notice] = [_('Keyring %s given to user %s.', keyring.name, user. login_and_name), action_key_update_notice]139 flash[:notice] = [_('Keyring %s given to user %s.', keyring.name, user.name), action_key_update_notice] 140 140 end 141 141 trunk/app/controllers/message_controller.rb
r701 r750 36 36 def view 37 37 @message = Message.find_for_current_user(params[:id]) 38 sender = @message.sender. login_and_name if @message.sender38 sender = @message.sender.name if @message.sender 39 39 @title = _('Message from %s', sender || 'CMMS') 40 40 … … 53 53 else 54 54 @title = _('Send message') 55 @receiver_options = User.find(:all, :readonly => true).collect { |u| [u. login_and_name, u.id] }55 @receiver_options = User.find(:all, :readonly => true).collect { |u| [u.name, u.id] } 56 56 end 57 57 trunk/app/controllers/setting_controller.rb
r722 r750 20 20 @title = _('Edit access control settings') 21 21 22 @setting = 'enable_user_permissions' 23 @value = Setting.get(@setting) 22 @setting1 = 'user_name_format' 23 @value1 = Setting.send(@setting1) 24 @setting2 = 'enable_user_permissions' 25 @value2 = Setting.send(@setting2) 26 27 @user_name_formats = [ 28 [_('Last name, First name'), '1'], 29 [_('First name Last name'), '2'], 30 [_('Last name, First name (Username)'), '3'], 31 [_('First name Last name (Username)'), '4'], 32 [_('Username (Last name, First name)'), '5'], 33 [_('Username (First name Last name)'), '6'], 34 [_('First name'), '7'], 35 [_('First name (Username)'), '8'], 36 ] 24 37 25 38 if request.post? 26 new_value = (params[@setting] == '1') 27 if Setting.set(@setting, new_value) 39 success = true 40 41 new_value = params['user_name_format'] 42 if User::NAME_FORMATS.include?(new_value) 43 success = Setting.set(@setting1, new_value) 44 else 45 success = false 46 end 47 48 if success 49 new_value = (params[@setting2] == '1') 50 success = Setting.set(@setting2, new_value) 51 end 52 53 if success 28 54 flash[:notice] = msg_changes_saved 29 55 redirect_to(:back) # flash will stay on without this trunk/app/controllers/user_controller.rb
r723 r750 26 26 @title = _('User accounts') 27 27 @fields = [ 28 [_('Name'), :name ],29 [_('Username'), :login ]28 [_('Name'), :name, User.sql_order], 29 [_('Username'), :login, 'login'] 30 30 ] 31 31 # Render form with 'Remove' check boxes if user is authorized … … 37 37 @actions = [] 38 38 end 39 @items = items_for_page(User, :order => 'login')39 @items = items_for_page(User, :order => User.sql_order) 40 40 41 41 common_list … … 45 45 @title = _('Create new user account') 46 46 47 user_opts = User.find(:all ).collect {|u| [u.login_and_name, u.id]}47 user_opts = User.find(:all, :order => User.sql_order).collect {|u| [u.name, u.id]} 48 48 @fields = [ 49 49 [_('Username'), :text_field, 'login', { :size => 30, :maxlength => 40 } ], … … 151 151 names.push keyring.name 152 152 end 153 flash[:notice] = _('User %s removed from keyrings: %s', @user. login_and_name, names.join(','))153 flash[:notice] = _('User %s removed from keyrings: %s', @user.name, names.join(',')) 154 154 end 155 155 … … 166 166 names.push user_group.name 167 167 end 168 flash[:notice] = _('User %s removed from user groups: %s', @user. login_and_name, names.join(','))168 flash[:notice] = _('User %s removed from user groups: %s', @user.name, names.join(',')) 169 169 end 170 170 … … 301 301 end 302 302 303 @items = User.find(:all, :readonly => true, :order => 'login')303 @items = User.find(:all, :readonly => true, :order => User.sql_order) 304 304 common_list(false) 305 305 end trunk/app/controllers/user_group_controller.rb
r749 r750 97 97 if @add 98 98 if @items.empty? 99 @available_users = User.find(:all, :order => 'login').collect {|u| [u.login_and_name, u.id] }99 @available_users = User.find(:all, :order => User.sql_order_for_login_and_name).collect {|u| [u.login_and_name, u.id] } 100 100 else 101 101 user_ids = @items.collect {|u| u.id }.join(',') 102 @available_users = User.find(:all, :conditions => "NOT (id IN (#{user_ids}))", :order => 'login').collect {|u| [u.login_and_name, u.id] }102 @available_users = User.find(:all, :conditions => "NOT (id IN (#{user_ids}))", :order => User.sql_order_for_login_and_name).collect {|u| [u.login_and_name, u.id] } 103 103 end 104 104 end … … 118 118 119 119 info "User #{user.login} added to UserGroup #{user_group.name}" 120 flash[:notice] = [_('User "%s" added to group "%s".', user. login_and_name, user_group.name), update_users_notice]120 flash[:notice] = [_('User "%s" added to group "%s".', user.name, user_group.name), update_users_notice] 121 121 end 122 122 redirect_to :back trunk/app/helpers/application_helper.rb
r747 r750 502 502 return '' unless user 503 503 504 link_text = short_form ? user.name : user. login_and_name504 link_text = short_form ? user.name : user.name 505 505 return link_to(h(link_text), {:controller => 'user', :action => 'view', :id => user.id}, :class => 'user') 506 #link_title = h(user. login_and_name)506 #link_title = h(user.name) 507 507 #link = "<a href=\"/user/view/#{user.id}\" class=\"user\">#{link_title}</a>" 508 508 return link trunk/app/helpers/customer_interface_helper.rb
r739 r750 141 141 case event.event_type 142 142 when FormEvent.TYPES[:CREATED] 143 result += event_action(_('Filled out by %s', event.creator ? event.creator. login_and_name : _('Unknown')))143 result += event_action(_('Filled out by %s', event.creator ? event.creator.name : _('Unknown'))) 144 144 when FormEvent.TYPES[:MODIFIED] 145 result += event_action(_('Modified by %s', event.creator ? event.creator. login_and_name : _('Unknown')))145 result += event_action(_('Modified by %s', event.creator ? event.creator.name : _('Unknown'))) 146 146 end 147 147 return result … … 164 164 case event.event_type 165 165 when TaskEvent.TYPES[:CREATED] 166 result += event_action(_('Created by %s', event.creator ? event.creator. login_and_name : _('Unknown')))166 result += event_action(_('Created by %s', event.creator ? event.creator.name : _('Unknown'))) 167 167 when TaskEvent.TYPES[:CLOSED] 168 result += event_action(_('Closed by %s', event.creator ? event.creator. login_and_name : _('Unknown')))168 result += event_action(_('Closed by %s', event.creator ? event.creator.name : _('Unknown'))) 169 169 when TaskEvent.TYPES[:ASSIGNED] 170 result += event_action(_("Assigned to %s by %s", event.task_owner ? event.task_owner. login_and_name : _('Unknown'), event.creator ? event.creator.login_and_name : _('Unknown')))170 result += event_action(_("Assigned to %s by %s", event.task_owner ? event.task_owner.name : _('Unknown'), event.creator ? event.creator.name : _('Unknown'))) 171 171 when TaskEvent.TYPES[:ACCEPTED] 172 result += event_action(_('Accepted by %s', event.creator ? event.creator. login_and_name : _('Unknown')))172 result += event_action(_('Accepted by %s', event.creator ? event.creator.name : _('Unknown'))) 173 173 when TaskEvent.TYPES[:REOPENED] 174 result += event_action(_('Reopened by %s', event.creator ? event.creator. login_and_name : _('Unknown')))174 result += event_action(_('Reopened by %s', event.creator ? event.creator.name : _('Unknown'))) 175 175 when TaskEvent.TYPES[:COMMENTED] 176 result += event_action(_('Comment added by %s', event.creator ? event.creator. login_and_name : _('Unknown')))176 result += event_action(_('Comment added by %s', event.creator ? event.creator.name : _('Unknown'))) 177 177 end 178 178 return result … … 193 193 result = format_attachment(event.attachment, false) 194 194 result += '<br/>' 195 result += event_action(_('Uploaded by %s', event.creator ? event.creator. login_and_name : _('Unknown'))) if event.event_type == AttachmentEvent.TYPES[:CREATED]195 result += event_action(_('Uploaded by %s', event.creator ? event.creator.name : _('Unknown'))) if event.event_type == AttachmentEvent.TYPES[:CREATED] 196 196 return result 197 197 end … … 225 225 result = format_date(event.created_at, _('%Y-%m-%d'), _('%H:%M'), '<span class="date">%s</span> <span class="time">%s</span>') 226 226 result += '<br/>' 227 result += span_tag('request_updater', event.creator.nil? ? _('by %s', _('Unknown')) : _('by %s', event.creator. login_and_name))227 result += span_tag('request_updater', event.creator.nil? ? _('by %s', _('Unknown')) : _('by %s', event.creator.name)) 228 228 return result 229 229 end trunk/app/helpers/task_helper.rb
r726 r750 45 45 end 46 46 47 result += "<td>#{h(item. login_and_name)}</td>"47 result += "<td>#{h(item.name)}</td>" 48 48 49 49 if show_buttons trunk/app/models/asset.rb
r734 r750 74 74 def Asset.get_first_authorized_to_read 75 75 first = Asset.find_authorized_to_read(:first, :order => 'id') 76 raise(ActiveRecord::RecordNotFound, "#{UserAccount.current_user.class} #{UserAccount.current_user.login_and_name}is unauthorized to read any assets.") if first.nil?76 raise(ActiveRecord::RecordNotFound, "#{UserAccount.current_user.class} '#{UserAccount.current_user.login}' is unauthorized to read any assets.") if first.nil? 77 77 return first 78 78 end … … 276 276 sql[0] += 'users.type = ? AND users.id = user_groups_users.user_id AND user_groups_users.user_group_id IN (?)' 277 277 sql.push('User', self.user_groups.map {|g| g.id }) 278 sql[0] += ') ORDER BY id'278 sql[0] += ") ORDER BY #{User.sql_order}" 279 279 280 280 User.find_by_sql(sql) 281 281 else 282 options = { :order => 'id'}282 options = { :order => User.sql_order } 283 283 options[:conditions] = ['id != ?', exclude_user_id] if exclude_user_id.is_a?(Integer) 284 284 User.find(:all, options) trunk/app/models/customer.rb
r739 r750 46 46 end 47 47 48 # Method: User.sql_order 49 # ====================== 50 # Returns: 51 # -------- 52 # The customer ordering SQL clause. 53 # 54 def User.sql_order 55 'full_name' 56 end 57 48 58 # Method: asset_count 49 59 # =================== trunk/app/models/lockable.rb
r707 r750 35 35 return false unless self.is_open_for_current_user 36 36 37 _info "Locking #{self.class} id=#{self.id} for #{UserAccount.current_user.class.to_s.downcase} #{UserAccount.current_user.login_and_name}for duration: #{duration}."37 _info "Locking #{self.class} id=#{self.id} for #{UserAccount.current_user.class.to_s.downcase} '#{UserAccount.current_user.login}' for duration: #{duration}." 38 38 self.lock_user = UserAccount.current_user 39 39 self.lock_timeout = duration.from_now trunk/app/models/notification_mailer.rb
r725 r750 113 113 message = localize("Task {%i} (%s) - %s\n\n%s\n\nAsset: %s (%s)\n", task.id, task.task_type.name, task_url, task.short_description, asset.full_code, asset.name) 114 114 message += localize("Asset type: %s\n", asset.asset_type.name) if asset.asset_type 115 message += localize("Creation date: %s\nCreator: %s", format_datetime(task.created_at), task.creator. login_and_name)115 message += localize("Creation date: %s\nCreator: %s", format_datetime(task.created_at), task.creator.name) 116 116 117 117 recipients recipient trunk/app/models/setting.rb
r721 r750 5 5 # =============== 6 6 # Model that is used to save and load system settings. 7 # Each row represents a setting. A setting has a name hasa value.7 # Each row represents a setting. A setting has a name and a value. 8 8 # 9 9 # Attributes: 10 10 # ----------- 11 11 # name - Name of the setting 12 # value - Value for the setting as <String>12 # value - Value for the setting as a <String> 13 13 # value_is_string - Tells whether the setting value is string or not. 14 14 # … … 19 19 # Note: 20 20 # ----- 21 # If a new value type areneeded, add a new attribute, e.g. value_is_float,21 # If a new value type is needed, add a new attribute, e.g. value_is_float, 22 22 # and modify the set_value and get_value instance methods. 23 23 # … … 35 35 # Constant: VALUE_TO_STRING 36 36 # ========================= 37 # String representatives for non-string setting values.37 # String representatives for discreate non-string setting values. 38 38 # All setting values are saved as strings. 39 # Keep the string values unique!39 # Keep the string representative values unique! 40 40 # 41 41 VALUE_TO_STRING = { … … 55 55 # 56 56 NAMES = [ 57 'enable_user_permissions' 57 'enable_user_permissions', 58 'user_name_format' 58 59 ] 59 60 60 61 # Constant: DEFAULT_VALUES 61 62 # ======================== 62 # Default values for settings in <NAMES> - in the same order.63 # Default values for the settings in <NAMES> (in the same order). 63 64 # 64 65 DEFAULT_VALUES = [ 65 false 66 false, 67 '1' 66 68 ] 67 69 … … 71 73 # Method: Setting.load_settings 72 74 # ============================= 73 # Loads the settings in <NAMES> from database 75 # Loads the hardcoded settings in <NAMES> from the database and save them 76 # to class attributes. 74 77 # 75 78 def Setting.load_settings … … 77 80 class_variable_set('@@' + name, self.get(name)) 78 81 } 82 return # nil 79 83 end 80 84 … … 95 99 # value - Value for the setting 96 100 # 101 # Returns: 102 # -------- 103 # Returns true if the setting is succesfully saved. 104 # Otherwise returns false. 105 # 97 106 def Setting.set(name, value) 98 107 name = name.to_s … … 107 116 setting.set_value(value) 108 117 109 setting._info("Setting: '#{setting.name}' to value '#{setting.value}'") 110 return setting.save 118 if setting.save 119 setting._info("Setting: '#{setting.name}' to value '#{setting.value}'") 120 return true 121 end 122 return false 111 123 end 112 124 … … 127 139 return nil unless NAMES.include?(name) 128 140 129 # This should neverhappen since the hardcoded settings always exist.141 # This shouldn't usually happen since the hardcoded settings always exist. 130 142 # If one nevertheless doesn't the model recreates the default setting. 143 # This means that new settings are automatically set to their default 144 # values when they are requested for the first time. 131 145 Setting.set(name, DEFAULT_VALUES[NAMES.index(name)]) 132 146 return Setting.get(name) trunk/app/models/task.rb
r721 r750 267 267 for creation_date, creator, text in comments 268 268 text ||= '' 269 result.push(format_date(creation_date) + ' - ' + creator. login_and_name + ' - ' + text.gsub("\n", ' '))269 result.push(format_date(creation_date) + ' - ' + creator.name + ' - ' + text.gsub("\n", ' ')) 270 270 end 271 271 return result.join(' | ') trunk/app/models/user.rb
r725 r750 32 32 end 33 33 34 # Constant: NAME_FORMATS 35 # ====================== 36 # Holds the available name formats in the following format: 37 # { 38 # format_ID => ['name format', [:name_method, ...], SQL_order_by] 39 # } 40 # 41 NAME_FORMATS = { 42 '1' => ['%s, %s', [:last_name, :first_name], 'last_name,first_name'], 43 '2' => ['%s %s', [:first_name, :last_name], 'first_name,last_name'], 44 '3' => ['%s, %s (%s)', [:last_name, :first_name, :login], 'last_name,first_name,login'], 45 '4' => ['%s %s (%s)', [:first_name, :last_name, :login], 'first_name,last_name,login'], 46 '5' => ['%s (%s, %s)', [:login, :last_name, :first_name], 'login,last_name,first_name'], 47 '6' => ['%s (%s %s)', [:login, :first_name, :last_name], 'login,first_name,last_name'], 48 '7' => ['%s', [:first_name], 'first_name'], 49 '8' => ['%s (%s)', [:first_name, :login], 'first_name,login'], 50 } 51 52 # Method: User.current_name_format 53 # ================================ 54 # The current name format specified by the Setting.user_name_format setting 55 # and the corresponding format in NAME_FORMATS. 56 # 57 def User.current_name_format 58 NAME_FORMATS[Setting.user_name_format] 59 end 60 34 61 # Method: name 35 62 # ============ 36 # Get users name. This will overwrite the getter for the 'name' attribute 37 # which isn't used by this model. 63 # The name of the user in the format specified by the current name format setting. 64 # 65 # Retuns: 66 # ------- 67 # Formatted name string 68 # 38 69 def name 39 if self.last_name != "" 40 if self.first_name != "" 41 self.first_name + " " + self.last_name 42 else 43 self.last_name 44 end 45 elsif self.first_name != "" 46 self.first_name 47 else 48 "" 49 end 70 _name 71 end 72 73 # Method: User.sql_order 74 # ====================== 75 # The user ordering SQL clause specified by the current name format setting. 76 # 77 def User.sql_order 78 current_name_format.last 79 end 80 81 # Method; login_and_name 82 # ====================== 83 # Retuns: 84 # ------- 85 # Login and name string in the format "login (last name, first name)" 86 # 87 def login_and_name 88 _name(NAME_FORMATS['5']) 89 end 90 # Method: User.sql_order_for_login_and_name 91 # ========================================= 92 # Returns: 93 # -------- 94 # The user ordering SQL clause based on the <login_and_name> name format. 95 # 96 def User.sql_order_for_login_and_name 97 NAME_FORMATS['5'].last 50 98 end 51 99 … … 130 178 return self 131 179 end 180 181 protected 182 183 # Method: name 184 # ============ 185 # The name of the user in the given name format. When called without 186 # the format parameter, returns the name string in the format 187 # specified by the current name format setting. 188 # 189 # Parameters: 190 # ----------- 191 # format_id - The name format that is used. 192 # If nil the current name format setting is used. 193 # 194 # Retuns: 195 # ------- 196 # Formatted name string 197 # 198 # Note: 199 # ----- 200 # We can't use this method directly as the <name> method because it is 201 # an automatic field (<name> would be called with a wrong parameter). 202 # 203 def _name(format = nil) 204 format ||= User.current_name_format 205 return format.first % format[1].map { |m| self.send(m) } 206 end 132 207 end trunk/app/models/user_account.rb
r721 r750 91 91 end 92 92 93 # Method; login_and_name 94 # ====================== 95 # Retuns: 96 # ------- 97 # Login and name in format "login (name)" 98 # 99 def login_and_name 100 unless self.name == '' 101 self.login + ' (' + self.name + ')' 102 else 103 self.login 104 end 93 # Method: UserAccount.order_sql 94 # ============================= 95 # Returns the ordering SQL clause for the model. 96 # 97 def UserAccount.order_sql 98 raise NotImplementedError 105 99 end 106 100 trunk/app/views/attachment/view.rhtml
r721 r750 31 31 <tr> 32 32 <th><%= _('Creator') %></th> 33 <td><%= h(@file.creator. login_and_name) %></td>33 <td><%= h(@file.creator.name) %></td> 34 34 </tr> 35 35 <tr> trunk/app/views/layouts/customer_interface.rhtml
r712 r750 48 48 49 49 <div id="loginstatus"> 50 <div id="logged"><%= _('Logged in as') %>: <%= @show_login_name_link ? link_to(h( session[:user].login_and_name), {:action => 'edit_my_information'}, {:id => 'login_name', :title => _('My information')}) : "<span id=\"login_name\">#{h(session[:user].login_and_name)}</span>" %></div>50 <div id="logged"><%= _('Logged in as') %>: <%= @show_login_name_link ? link_to(h("#{session[:user].login} (#{session[:user].name})"), {:action => 'edit_my_information'}, {:id => 'login_name', :title => _('My information')}) : "<span id=\"login_name\">#{h(session[:user].login)}</span>" %></div> 51 51 <div id="logbutton"><%= link_to( image_tag('customer_interface/logout.jpg'), {:controller => 'user', :action => 'logout'} ) %></div> 52 52 </div> trunk/app/views/setting/access_control.rhtml
r721 r750 1 1 <%= form_tag() %> 2 2 <table class="form"> 3 <th><%= _('Enable the user permission system for assets') %></th> 4 <td><%= check_box_tag(@setting, '1', @value) %></td> 3 <tr> 4 <th><%= _('Name format for users') %></th> 5 <td><%= select_tag(@setting1, options_for_select(@user_name_formats, @value1)) %></td> 6 </tr> 7 <tr> 8 <th><%= _('Enable the user permission system for assets') %></th> 9 <td><%= check_box_tag(@setting2, '1', @value2) %></td> 10 </tr> 5 11 </table> 6 12 <%= buttons_table(_('Save changes'), {:action => 'access_control'}) %> trunk/app/views/task/_display_task_event.rhtml
r511 r750 4 4 <% case event.event_type 5 5 when TaskEvent.TYPES[:CREATED] -%> 6 <%= _('Created by %s', event.creator ? event.creator. login_and_name : _('Unknown')) %>6 <%= _('Created by %s', event.creator ? event.creator.name : _('Unknown')) %> 7 7 <% when TaskEvent.TYPES[:CLOSED] -%> 8 <%= _('Closed by %s', event.creator ? event.creator. login_and_name : _('Unknown')) %>8 <%= _('Closed by %s', event.creator ? event.creator.name : _('Unknown')) %> 9 9 <% when TaskEvent.TYPES[:ASSIGNED] -%> 10 <%= _('Assiged to %s by %s', event.task_owner ? event.task_owner. login_and_name : _('Unknown'), event.creator ? event.creator.login_and_name : _('Unknown')) %>10 <%= _('Assiged to %s by %s', event.task_owner ? event.task_owner.name : _('Unknown'), event.creator ? event.creator.name : _('Unknown')) %> 11 11 <% when TaskEvent.TYPES[:ACCEPTED] -%> 12 <%= _('Accepted by %s', event.creator ? event.creator. login_and_name : _('Unknown')) %>12 <%= _('Accepted by %s', event.creator ? event.creator.name : _('Unknown')) %> 13 13 <% when TaskEvent.TYPES[:REOPENED] -%> 14 <%= _('Reopened by %s', event.creator ? event.creator. login_and_name : _('Unknown')) %>14 <%= _('Reopened by %s', event.creator ? event.creator.name : _('Unknown')) %> 15 15 <% when TaskEvent.TYPES[:COMMENTED] -%> 16 <%= _('Comment added by %s', event.creator ? event.creator. login_and_name : _('Unknown')) %>16 <%= _('Comment added by %s', event.creator ? event.creator.name : _('Unknown')) %> 17 17 <% end -%> 18 18 </th> trunk/app/views/task/_form.rhtml
r729 r750 55 55 <tr> 56 56 <th><%= _('Created by') %></th> 57 <td><%= h(@task.creator. login_and_name) %></td>57 <td><%= h(@task.creator.name) %></td> 58 58 </tr> 59 59 <tr> trunk/app/views/task/print_view.rhtml
r747 r750 16 16 <tr> 17 17 <th class="first"><%= _('Created by') %></th> 18 <td><%= h(@task.creator. login_and_name) %></td>18 <td><%= h(@task.creator.name) %></td> 19 19 <th class="second"><%= _('Created at') %></th> 20 20 <td><%= h(format_date(@task.created_at)) %></td> … … 22 22 <tr> 23 23 <th class="first"><%= _('Responsible user') %></th> 24 <td><%= h(@task.responsible_user. login_and_name) if @task.responsible_user %><%= ' (' + _('accepted') + ')' if @task.state == Task.ACCEPTED %></td>24 <td><%= h(@task.responsible_user.name) if @task.responsible_user %><%= ' (' + _('accepted') + ')' if @task.state == Task.ACCEPTED %></td> 25 25 <th class="second"><%= _('Starting time') %></th> 26 26 <td><%= h(format_date(@task.starting_time)) if @task.starting_time %> … … 41 41 <tr> 42 42 <th class="first"><%= _('Assigned users') %></th> 43 <td colspan="3"><%= @assigned_workers.map { |w| w. login_and_name }.join(', ') %></td>43 <td colspan="3"><%= @assigned_workers.map { |w| w.name }.join(', ') %></td> 44 44 </tr> 45 45 <% end -%> trunk/app/views/task/view.rhtml
r743 r750 21 21 <% end -%> 22 22 <%= radio_button_tag('task_action', 'assign') %><%= _('Assign responsibility to') %>: 23 <%= select_tag("responsible_user_id", options_from_collection_for_select(@users, "id", " login_and_name")) %><br/>23 <%= select_tag("responsible_user_id", options_from_collection_for_select(@users, "id", "name")) %><br/> 24 24 <% when Task.ASSIGNED -%> 25 25 <%= radio_button_tag('task_action', 'leave', true) %><%= _('Leave as assigned') %><br/> … … 31 31 <% end -%> 32 32 <%= radio_button_tag('task_action', 'assign') %><%= _('Reassign responsibility to') %>: 33 <%= select_tag("responsible_user_id", options_from_collection_for_select(@users, "id", " login_and_name")) %><br/>33 <%= select_tag("responsible_user_id", options_from_collection_for_select(@users, "id", "name")) %><br/> 34 34 <% when Task.ACCEPTED -%> 35 35 <%= radio_button_tag('task_action', 'leave', true) %><%= _('Leave as accepted') %><br/> … … 40 40 <% end -%> 41 41 <%= radio_button_tag('task_action', 'assign') %><%= _('Reassign responsibility to') %>: 42 <%= select_tag("responsible_user_id", options_from_collection_for_select(@users, "id", " login_and_name")) %><br/>42 <%= select_tag("responsible_user_id", options_from_collection_for_select(@users, "id", "name")) %><br/> 43 43 <% when Task.CLOSED -%> 44 44 <%= radio_button_tag('task_action', 'leave', true) %><%= _('Leave as closed') %><br/> trunk/app/views/timeline/_display_event.rhtml
r498 r750 12 12 case event.event_type 13 13 when TaskEvent.TYPES[:CREATED] 14 _('Created by %s', event.creator ? event.creator. login_and_name : _('Unknown'))14 _('Created by %s', event.creator ? event.creator.name : _('Unknown')) 15 15 when TaskEvent.TYPES[:CLOSED] 16 _('Closed by %s', event.creator ? event.creator. login_and_name : _('Unknown'))16 _('Closed by %s', event.creator ? event.creator.name : _('Unknown')) 17 17 when TaskEvent.TYPES[:ASSIGNED] 18 _("Assigned to %s by %s", event.task_owner ? event.task_owner. login_and_name : _('Unknown'), event.creator ? event.creator.login_and_name : _('Unknown'))18 _("Assigned to %s by %s", event.task_owner ? event.task_owner.name : _('Unknown'), event.creator ? event.creator.name : _('Unknown')) 19 19 when TaskEvent.TYPES[:ACCEPTED] 20 _('Accepted by %s', event.creator ? event.creator. login_and_name : _('Unknown'))20 _('Accepted by %s', event.creator ? event.creator.name : _('Unknown')) 21 21 when TaskEvent.TYPES[:REOPENED] 22 _('Reopened by %s', event.creator ? event.creator. login_and_name : _('Unknown'))22 _('Reopened by %s', event.creator ? event.creator.name : _('Unknown')) 23 23 when TaskEvent.TYPES[:COMMENTED] 24 _('Comment added by %s', event.creator ? event.creator. login_and_name : _('Unknown'))24 _('Comment added by %s', event.creator ? event.creator.name : _('Unknown')) 25 25 end 26 26 -%> … … 35 35 case event.event_type 36 36 when FormEvent.TYPES[:CREATED] 37 _('Filled out by %s', event.creator ? event.creator. login_and_name : _('Unknown'))37 _('Filled out by %s', event.creator ? event.creator.name : _('Unknown')) 38 38 when FormEvent.TYPES[:MODIFIED] 39 _('Modified by %s', event.creator ? event.creator. login_and_name : _('Unknown'))39 _('Modified by %s', event.creator ? event.creator.name : _('Unknown')) 40 40 end 41 41 -%> … … 50 50 case event.event_type 51 51 when AttachmentEvent.TYPES[:CREATED] 52 _('Uploaded by %s', event.creator ? event.creator. login_and_name : _('Unknown'))52 _('Uploaded by %s', event.creator ? event.creator.name : _('Unknown')) 53 53 end 54 54 -%> trunk/doc/manual/latex/tex/configuration_section.tex
r739 r750 245 245 The 'Enable the user permission system for assets' setting enables you to choose whether you want to use the user permission system or not. By default the user permission system is disabled. If the level of access control provided by the keys and keyrings is sufficient for you, we recommend you to leave the user permission system disabled. If you need user specific user rights for assets and their data, you can enable the user permission system. In this case see the sub-section~\ref{subsec:user_groups} for more information. 246 246 247 The 'Name format for users' setting enables you to choose the display format for the names of users. The default format is 'Last name, First name', but you can select the name format from several possibilities. 248 247 249 \subsection{User groups} 248 250 \label{subsec:user_groups} trunk/po/fi_FI/norfello_cmms.po
r749 r750 2 2 msgstr "" 3 3 "Project-Id-Version: NorfelloCMMS SVN trunk\n" 4 "POT-Creation-Date: 2008-0 2-21 13:57+0200\n"5 "PO-Revision-Date: 2008-0 2-21 13:59+0200\n"4 "POT-Creation-Date: 2008-03-11 18:36+0200\n" 5 "PO-Revision-Date: 2008-03-11 19:03+0200\n" 6 6 "Last-Translator: Markku Oksanen <markku.oksanen@norfello.com>\n" 7 7 "Language-Team: Norfello Ltd. <contact@norfello.com>\n" … … 293 293 msgstr[1] "%d avainta" 294 294 295 #: app/models/attachment_methods.rb: 30295 #: app/models/attachment_methods.rb:44 296 296 msgid "Text file" 297 297 msgstr "Tekstitiedosto" 298 298 299 #: app/models/attachment_methods.rb: 32299 #: app/models/attachment_methods.rb:46 300 300 msgid "Image file" 301 301 msgstr "Kuvatiedosto" 302 302 303 #: app/models/attachment_methods.rb: 34303 #: app/models/attachment_methods.rb:48 304 304 msgid "PDF file" 305 305 msgstr "PDF-tiedosto" 306 306 307 #: app/models/attachment_methods.rb: 36307 #: app/models/attachment_methods.rb:50 308 308 msgid "gzip (GNU zip) file" 309 309 msgstr "gzip (GNU zip) -tiedosto" 310 310 311 #: app/models/attachment_methods.rb: 38311 #: app/models/attachment_methods.rb:52 312 312 #: app/helpers/customer_interface_helper.rb:143 313 313 #: app/helpers/customer_interface_helper.rb:145 … … 695 695 #: app/helpers/application_helper.rb:470 696 696 #: app/controllers/attachment_controller.rb:22 697 #: app/controllers/attachment_controller.rb:6 6697 #: app/controllers/attachment_controller.rb:65 698 698 #: app/controllers/type_attachment_controller.rb:19 699 699 msgid "Attachment" … … 916 916 917 917 #: app/helpers/application_helper.rb:844 918 #: app/views/shared/_list_items.rhtml:31 3918 #: app/views/shared/_list_items.rhtml:315 919 919 #: app/views/shared/export_items_csv.rhtml:39 920 920 #: app/views/form/remove.rhtml:5 … … 924 924 925 925 #: app/helpers/application_helper.rb:844 926 #: app/views/shared/_list_items.rhtml:31 1926 #: app/views/shared/_list_items.rhtml:313 927 927 #: app/views/shared/export_items_csv.rhtml:37 928 928 #: app/views/customer_interface/_item_list.rhtml:64 … … 970 970 #: app/controllers/data_permission_controller.rb:56 971 971 #: app/controllers/task_controller.rb:481 972 #: app/controllers/attachment_controller.rb:6 8972 #: app/controllers/attachment_controller.rb:67 973 973 #: app/controllers/asset_tree_controller.rb:125 974 #: app/controllers/type_attachment_controller.rb: 91974 #: app/controllers/type_attachment_controller.rb:86 975 975 msgid "read" 976 976 msgstr "lue" … … 1123 1123 #: app/controllers/form_controller.rb:438 1124 1124 #: app/controllers/task_controller.rb:308 1125 #: app/controllers/attachment_controller.rb:12 81126 #: app/controllers/type_attachment_controller.rb:1 201125 #: app/controllers/attachment_controller.rb:127 1126 #: app/controllers/type_attachment_controller.rb:115 1127 1127 msgid "remove" 1128 1128 msgstr "poista" … … 1290 1290 msgstr "Muokkaa oikeuksienhallinnan asetuksia" 1291 1291 1292 #: app/controllers/setting_controller.rb:28 1293 msgid "Last name, First name" 1294 msgstr "Sukunimi, Etunimi" 1295 1296 #: app/controllers/setting_controller.rb:29 1297 msgid "First name Last name" 1298 msgstr "Etunimi Sukunimi" 1299 1300 #: app/controllers/setting_controller.rb:30 1301 msgid "Last name, First name (Username)" 1302 msgstr "Sukunimi, Etunimi (KÀyttÀjÀtunnus)" 1303