Changeset 44
- Timestamp:
- 08/07/06 11:18:56 (2 years ago)
- Files:
-
- trunk/app/controllers/asset_controller.rb (modified) (14 diffs)
- trunk/app/models/asset.rb (modified) (17 diffs)
- trunk/app/models/asset_join_model.rb (modified) (1 diff)
- trunk/app/models/assets_user_group.rb (modified) (1 diff)
- trunk/app/models/data_permission_profile.rb (modified) (1 diff)
- trunk/app/models/protected_asset_data.rb (modified) (2 diffs)
- trunk/app/models/protected_join_model.rb (modified) (3 diffs)
- trunk/app/views/asset/edit_user_permissions.rhtml (modified) (1 diff)
- trunk/app/views/asset/user_permissions.rhtml (modified) (1 diff)
- trunk/db/migrate/001_initial.rb (modified) (2 diffs)
- trunk/db/migrate/002_initial_data.rb (modified) (1 diff)
- trunk/db/temp_models.rb (added)
- trunk/po/fi_FI/norfello_cmms.po (modified) (24 diffs)
- trunk/test/functional/asset_controller_test.rb (modified) (32 diffs)
- trunk/test/functional/search_controller_test.rb (modified) (2 diffs)
- trunk/test/test_helper.rb (modified) (6 diffs)
- trunk/test/unit/asset_test.rb (modified) (19 diffs)
- trunk/test/unit/assets_user_group_test.rb (modified) (7 diffs)
- trunk/test/unit/data_permission_profile_test.rb (modified) (2 diffs)
- trunk/test/unit/protected_asset_data_test.rb (modified) (4 diffs)
- trunk/test/unit/protected_join_model_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/app/controllers/asset_controller.rb
r38 r44 35 35 36 36 def add_sub_asset 37 unless @selected_asset.authorized_to_ edit?37 unless @selected_asset.authorized_to_create_subasset? 38 38 redirect_with_message(msg_unauthorized_operation(_('create subassets'), @selected_asset.code_and_name), :action => 'view') 39 39 return … … 91 91 @selected_asset.attributes = params[:selected_asset] 92 92 93 if not@selected_asset.save93 unless @selected_asset.save 94 94 flash[:error] = msg_saving_failed 95 95 render :action => 'view' … … 114 114 end 115 115 116 # FIXME: Should these be moved to DataPermissionController?116 # TODO: It might be best to create AssetPermissionController for these actions? 117 117 118 118 # Managing permissions. … … 126 126 # link to parent's permissions page are shown 127 127 def user_permissions 128 @authorized_to_edit = @selected_asset.authorized_to_edit_permissions? 129 128 130 if @selected_asset.use_parents_permissions 129 131 @title = _("Asset %s uses same permissions as its parent asset %s", @selected_asset.code_and_name, @selected_asset.parent.code_and_name) … … 139 141 @available_groups = UserGroup.find(:all, :readonly => true) - @items 140 142 141 @authorized_to_edit = @selected_asset.authorized_to_edit?142 143 # Render edit permissions action link if user is authorized 143 if @authorized_to_edit and session[:user].authorized?('asset/edit_ permissions')144 if @authorized_to_edit and session[:user].authorized?('asset/edit_user_permissions') 144 145 @actions = [ [_('Edit permissions'), {:action => 'edit_user_permissions', :asset_id => @selected_asset.id, :image => '16x16/edit'}] ] 145 146 else … … 159 160 # Check that user is authorized to edit the asset and that it isn't using parent's permissions. 160 161 asset = Asset.find(params[:asset_id], :readonly => true) 161 return unless authorized_to_edit_asset (asset) and not(asset.use_parents_permissions)162 return unless authorized_to_edit_assets_permissions(asset) and not(asset.use_parents_permissions) 162 163 163 164 user_group = UserGroup.find(params[:id], :readonly => true) … … 181 182 # Check that user is authorized to edit the asset and that it isn't using parent's permissions. 182 183 asset = Asset.find(params[:asset_id], :readonly => true) 183 return unless authorized_to_edit_asset (asset) and not(asset.use_parents_permissions)184 return unless authorized_to_edit_assets_permissions(asset) and not(asset.use_parents_permissions) 184 185 185 186 redirect_to(:action => 'user_permissions') … … 196 197 # Sets asset @selected_asset's use_parents_permissions attribute. 197 198 def set_use_parents_permissions 199 invalid_request and return unless request.post? and params[:selected_asset] and ['0', '1'].include?(params[:selected_asset][:use_parents_permissions]) 200 201 if @selected_asset.update_attribute(:use_parents_permissions, params[:selected_asset][:use_parents_permissions]) 202 flash[:notice] = msg_changes_saved 203 else 204 flash[:error] = msg_saving_failed 205 end 198 206 redirect_to :back 199 200 if request.post? and params[:selected_asset] and201 ['0', '1'].include?(params[:selected_asset][:use_parents_permissions]) and202 @selected_asset.update_attribute(:use_parents_permissions, params[:selected_asset][:use_parents_permissions])203 204 flash[:notice] = msg_changes_saved205 else206 flash[:error] = msg_saving_failed207 end208 207 end 209 208 … … 212 211 if request.post? and params[:id] and params[:depth] 213 212 asset = Asset.find(params[:id], :readonly => true) 214 return unless authorized_to_edit_asset (asset) and not(asset.use_parents_permissions)213 return unless authorized_to_edit_assets_permissions(asset) and not(asset.use_parents_permissions) 215 214 copies = asset.copy_permissions_to_subassets(params[:depth].to_i) 216 215 if copies > 0 … … 228 227 # Find objects and check that authorized to edit asset 229 228 @asset = Asset.find(params[:asset_id], :readonly => true) 230 return unless authorized_to_edit_asset (@asset) and not(@asset.use_parents_permissions)229 return unless authorized_to_edit_assets_permissions(@asset) and not(@asset.use_parents_permissions) 231 230 232 231 @user_group = UserGroup.find params[:id] … … 256 255 assets_user_group = AssetsUserGroup.find(params[:id]) 257 256 asset = assets_user_group.asset 258 return unless authorized_to_edit_asset (asset) and not(asset.use_parents_permissions)257 return unless authorized_to_edit_assets_permissions(asset) and not(asset.use_parents_permissions) 259 258 260 259 # Update user group's permissions to the asset. … … 279 278 assets_user_group = AssetsUserGroup.find(params[:id]) 280 279 asset = assets_user_group.asset 281 return unless authorized_to_edit_asset (asset) and not(asset.use_parents_permissions)280 return unless authorized_to_edit_assets_permissions(asset) and not(asset.use_parents_permissions) 282 281 283 282 assets_user_group.update_permission_profiles(params[:profile], params[:report], params[:work_order], params[:attachment]) … … 297 296 assets_user_group = AssetsUserGroup.find(params[:id]) 298 297 asset = assets_user_group.asset 299 return unless authorized_to_edit_asset (asset) and not(asset.use_parents_permissions)298 return unless authorized_to_edit_assets_permissions(asset) and not(asset.use_parents_permissions) 300 299 301 300 redirect_to(:action => 'edit_user_permissions', … … 318 317 private 319 318 320 # Returns true if user is authorized to edit asset +asset+ and321 # otherwise redirects with error message and returns false 322 def authorized_to_edit_asset (asset)323 unless asset.authorized_to_edit ?319 # Returns true if user is authorized to edit asset +asset+'s permissions and 320 # otherwise redirects with error message and returns false. 321 def authorized_to_edit_assets_permissions(asset) 322 unless asset.authorized_to_edit_permissions? 324 323 error("Unauthorized to edit asset #{asset.full_code}'s permissions") 325 324 redirect_with_error_message(msg_unauthorized_operation(_('edit permissions'), asset.code_and_name), trunk/app/models/asset.rb
r24 r44 174 174 end 175 175 176 # Returns true if the user is authorized to create sub-assets to this asset 177 def authorized_to_create_subasset? 178 authorized_to(:create_subasset) 179 end 180 181 # Returns true if the user is authorized to edit asset permissions for this asset 182 def authorized_to_edit_permissions? 183 authorized_to(:edit_permissions) 184 end 185 186 # Returns true if the user is authorized to remove this asset 187 def authorized_to_remove? 188 authorized_to(:remove) 189 end 190 176 191 # Returns true if the user is authorized to create new instances of +datatype+ to this asset 177 192 def authorized_to_create?(datatype) … … 202 217 # The same association is created also for all sub-assets using this asset's permissions. 203 218 # Returns true if the creation is successfull and returns false if it fails. 204 def add_user_group(user_group, edit = false)219 def add_user_group(user_group, permissions = {}) 205 220 raise("#{user_group.class} in not a UserGroup") unless user_group.is_a?(UserGroup) 206 raise("Unauthorized to add user group to asset #{self.full_code}") unless not(use_parents_permissions) and authorized_to_edit? 221 raise("Unauthorized to add user group to asset #{self.full_code}") unless not(self.use_parents_permissions) and authorized_to_edit_permissions? 222 223 user_group_to_add = AssetsUserGroup.new(permissions) 224 user_group_to_add.asset = self 225 user_group_to_add.user_group = user_group 207 226 208 227 AssetsUserGroup.transaction do 209 228 210 if self.assets_user_groups.build(:user_group_id => user_group.id, :edit => edit).save229 if user_group_to_add.save 211 230 _info("User group \"#{user_group.name}\" added to asset #{self.full_code} and to all sub-assets using it's permissions.") 212 231 return true … … 223 242 def remove_user_groups(user_group_ids) 224 243 raise('Unable to remove user groups without ids') if user_group_ids.empty? 225 raise("Unauthorized to remove user groups from asset #{self.full_code}") unless not( use_parents_permissions) and authorized_to_edit?244 raise("Unauthorized to remove user groups from asset #{self.full_code}") unless not(self.use_parents_permissions) and authorized_to_edit_permissions? 226 245 227 246 associations_to_destroy = self.assets_user_groups.find(:all, :conditions => ['user_group_id IN (?)', user_group_ids]) … … 335 354 336 355 self.children.each { |subasset| 337 next unless subasset.use_parents_permissions and subasset.authorized_to_edit ?356 next unless subasset.use_parents_permissions and subasset.authorized_to_edit_permissions? 338 357 339 358 case operation … … 353 372 :create_report => assets_user_group.create_report, 354 373 :create_work_order => assets_user_group.create_work_order, 355 :attach_file => assets_user_group.attach_file) 374 :attach_file => assets_user_group.attach_file, 375 :create_subasset => assets_user_group.create_subasset, 376 :edit_permissions => assets_user_group.edit_permissions, 377 :remove => assets_user_group.remove) 356 378 _info("AssetsUserGroup(id=#{subassets_group.id}) updated") 357 379 else … … 361 383 subassets_group = AssetsUserGroup.find_by_asset_id_and_user_group_id(subasset.id, user_group_id) 362 384 363 if not(subassets_group.nil?)and subassets_group.destroy385 if subassets_group != nil and subassets_group.destroy 364 386 _info("User group (id=#{user_group_id}) removed from asset #{subasset.full_code}") 365 387 else … … 373 395 end 374 396 375 # Updates user group 's data permission profiles in sub-asset's using this asset's permissions397 # Updates user groups data permission profiles in sub-assets using this asset's permissions 376 398 # by performing +operation+ to sub-asset's user group's data permission profile. 377 399 # Called by after_[create|update|destroy] callbacks in DataPermissionProfile model. … … 416 438 profile = permission_profile.class.find_by_assets_user_group_id_and_user_group_id(subassets_group.id, permission_profile.user_group_id) 417 439 418 if not(profile.nil?)and profile.destroy440 if profile != nil and profile.destroy 419 441 _info("#{profile.class}(id=#{profile.id}) removed") 420 442 else … … 431 453 432 454 # Version of find which only returns assets the user is authorized to perform +operation+. 455 # +operation+:: Symbol defining which permission is checked. One of :edit, :create_subasset, 456 # :remove, :edit_permissions, :create_report, :create_work_order, :attach_file. 433 457 def Asset.find_authorized_to(operation, args) 434 458 return records_not_found(args) unless user = User.current_user … … 440 464 when :read 441 465 sanitize_sql(['user_group_id IN (?)', group_ids]) 442 when :edit 443 sanitize_sql([ 'user_group_id IN (?) AND edit = ?', group_ids, true])466 when :edit, :create_subasset, :edit_permissions, :remove, :create_report, :create_work_order, :attach_file 467 sanitize_sql(["user_group_id IN (?) AND #{operation} = ?", group_ids, true]) 444 468 else 445 469 raise("Unknown operation: #{operation}") … … 448 472 return records_not_found(args) if asset_ids.empty? 449 473 450 final_args = add_conditions_to_find_arguments(args, "#{self.table_name}.id IN (?)", [asset_ids])451 452 return self.find(* final_args)474 args = add_conditions_to_find_arguments(args, "#{self.table_name}.id IN (?)", [asset_ids]) 475 476 return self.find(*args) 453 477 end 454 478 455 479 # Returns true if the user is authorized to perform operation +operation+ to this asset. 456 # +operation+:: Symbol defining which permission is checked.457 # One of :edit, :create_report, :create_work_order, :attach_file.480 # +operation+:: Symbol defining which permission is checked. One of :edit, :create_report, 481 # :create_work_order, :attach_file, :create_subasset, :edit_permissions, :remove. 458 482 def authorized_to(operation) 459 483 if user = User.current_user … … 474 498 end 475 499 476 # Prevents creation of parentless assets if root asset exists. Verifies that user is authorized to create new asset, which requires editingpermission to asset's parent.500 # Prevents creation of parentless assets if root asset exists. Verifies that user is authorized to create new asset, which requires create_subasset permission to asset's parent. 477 501 def check_authorized_to_edit_parent 478 502 if Asset.count == 0 … … 484 508 raise(ActiveRecord::ActiveRecordError, "Asset #{self.full_code} doesn't have parent!") if parent_asset.nil? 485 509 486 if parent_asset.authorized_to_ edit?510 if parent_asset.authorized_to_create_subasset? 487 511 _info("Authorized to create sub-asset to asset #{parent_asset.full_code}") 488 512 return true … … 500 524 end 501 525 502 if self.authorized_to_edit? 503 _info("Authorized to save #{self.class}(id=#{self.id})") 504 return true 526 if only_use_parents_permissions_changed? 527 if use_parents_permissions_unchanged? 528 # Nothing was changed 529 self.errors.add_to_base(_('No changes have been made')) 530 return false 531 end 532 # Only use_parents_permissions changed 533 if authorized_to_edit_permissions? 534 _info("Authorized to save #{self.class}(id=#{self.id})") 535 return true 536 end 505 537 else 506 _error("Unauthorized to save #{self.class}(id=#{self.id})") 507 self.errors.add_to_base(_('Unauthorized to save %s', _(self.class.to_s))) 508 return false 509 end 538 if use_parents_permissions_unchanged? and authorized_to_edit? 539 _info("Authorized to save #{self.class}(id=#{self.id})") 540 return true 541 end 542 end 543 544 _error("Unauthorized to save #{self.class}(id=#{self.id})") 545 self.errors.add_to_base(_('Unauthorized to save %s', _(self.class.to_s))) 546 return false 510 547 end 511 548 … … 536 573 # permissions are identical with those in +assets_groups+. 537 574 def copy_permissions(assets_groups) 538 return false unless self.new_record? or self.authorized_to_edit ?575 return false unless self.new_record? or self.authorized_to_edit_permissions? 539 576 540 577 if self.new_record? 541 578 self.assets_user_groups = AssetsUserGroup.new_ones_from_instances(assets_groups) 542 579 543 Range.new(0, assets_groups.size-1).each{ |j|580 0.upto(assets_groups.size - 1) { |j| 544 581 self.assets_user_groups[j].copy_data_permission_profiles_from(assets_groups[j]) 545 582 } … … 552 589 :create_report => aug.create_report, 553 590 :create_work_order => aug.create_work_order, 554 :attach_file => aug.attach_file 591 :attach_file => aug.attach_file, 592 :create_subasset => aug.create_subasset, 593 :edit_permissions => aug.edit_permissions, 594 :remove => aug.remove 555 595 } 556 596 if new_aug.nil? … … 573 613 end 574 614 615 # Returns true if all attributes, except use_parents_permissions, are unchanged. 616 def only_use_parents_permissions_changed? 617 original_attributes = Asset.find(self.id).attributes 618 original_attributes.delete('use_parents_permissions') 619 attributes = self.attributes 620 attributes.delete('use_parents_permissions') 621 622 attributes == original_attributes 623 end 624 625 # Returns true if use_parents_permissions is unchanged. 626 def use_parents_permissions_unchanged? 627 self.use_parents_permissions == @original_use_parents_permissions 628 end 629 575 630 end trunk/app/models/asset_join_model.rb
r24 r44 23 23 def new_from_instance 24 24 new_obj = self.clone 25 new_obj.send(self.class::PROTECTOR_MODEL .to_s + '_id=', nil)25 new_obj.send(self.class::PROTECTOR_MODEL[0].to_s + '_id=', nil) 26 26 new_obj 27 27 end trunk/app/models/assets_user_group.rb
r24 r44 25 25 before_update :check_authorized_to_edit 26 26 # Associations 27 belongs_to_protector :asset 27 belongs_to_protector :asset, :edit_permission => :authorized_to_edit_permissions? 28 28 has_many :data_permission_profiles, :dependent => :delete_all 29 29 has_many :report_permission_profiles, :order => 'other', :dependent => :delete_all trunk/app/models/data_permission_profile.rb
r24 r44 39 39 add = true 40 40 profiles.each { |profile| 41 next unless profile.class == profile_to_add.class 42 41 43 if profile.user_group_id == profile_to_add.user_group_id 42 44 add = false trunk/app/models/protected_asset_data.rb
r24 r44 161 161 end 162 162 163 final_args = add_conditions_to_find_arguments(args, extra_conditions, arguments)164 165 return self.find(* final_args)163 args = add_conditions_to_find_arguments(args, extra_conditions, arguments) 164 165 return self.find(*args) 166 166 end 167 167 … … 175 175 return records_not_found(args) if asset_ids.empty? 176 176 177 final_args = add_conditions_to_find_arguments(args, 'asset_id IN (?) AND ready = ?', [asset_ids, ready])178 179 return self.find(* final_args)177 args = add_conditions_to_find_arguments(args, 'asset_id IN (?) AND ready = ?', [asset_ids, ready]) 178 179 return self.find(*args) 180 180 end 181 181 trunk/app/models/protected_join_model.rb
r24 r44 17 17 belongs_to :user_group 18 18 19 # Like ARs belongs_to association. In addition sets protector model for the model. 20 # Default value for option :edit_permission is :authorized_to_edit? 21 # 22 def ProtectedJoinModel.belongs_to_protector(association_id, options = {}) 23 edit_permission = options.delete(:edit_permission) || :authorized_to_edit? 19 24 20 # Like belongs_to association. In addition sets protector model for the model.21 def ProtectedJoinModel.belongs_to_protector(association_id, options = {})22 25 belongs_to(association_id, options) 23 26 24 self.const_set(:PROTECTOR_MODEL, association_id)27 self.const_set(:PROTECTOR_MODEL, [association_id, edit_permission]) 25 28 end 26 29 … … 44 47 # Returns an instance of the protector model for this object. 45 48 def protector 46 return self.send(self.class::PROTECTOR_MODEL )49 return self.send(self.class::PROTECTOR_MODEL[0]) 47 50 end 48 51 … … 50 53 def authorized_to_edit? 51 54 begin 52 return self.protector. authorized_to_edit?55 return self.protector.send(self.class::PROTECTOR_MODEL[1]) 53 56 rescue NoMethodError 54 raise(NoMethodError, "#{self.class}(id=#{self.id}) doesn't belong to a protecting #{self.class::PROTECTOR_MODEL }.")57 raise(NoMethodError, "#{self.class}(id=#{self.id}) doesn't belong to a protecting #{self.class::PROTECTOR_MODEL[0]}.") 55 58 end 56 59 end trunk/app/views/asset/edit_user_permissions.rhtml
r12 r44 22 22 <th><%= _('Attach files') %></th> 23 23 <td><%= check_box(:assets_user_group, :attach_file) %></td> 24 </tr> 25 <tr> 26 <th><%= _('Create sub-assets') %></th> 27 <td><%= check_box(:assets_user_group, :create_subasset) %></td> 28 </tr> 29 <tr> 30 <th><%= _('Edit asset permissions') %></th> 31 <td><%= check_box(:assets_user_group, :edit_permissions) %></td> 32 </tr> 33 <tr> 34 <th><%= _('Remove asset') %></th> 35 <td><%= check_box(:assets_user_group, :remove) %></td> 24 36 </tr> 25 37 <tr> trunk/app/views/asset/user_permissions.rhtml
r27 r44 29 29 30 30 <% else -%> 31 <%= link_to(_("Parent asset's permissions"), : action => 'select', :id => @selected_asset.parent_id) %><br/>31 <%= link_to(_("Parent asset's permissions"), :controller => 'asset_tree', :action => 'select', :id => @selected_asset.parent_id) %><br/> 32 32 <% end -%> 33 33 34 34 <% if @selected_asset.parent -%> 35 35 <br/> 36 <% disabled = ( not @selected_asset.authorized_to_edit?) -%>36 <% disabled = (@authorized_to_edit != true) -%> 37 37 <%= form_tag(:action => 'set_use_parents_permissions') %> 38 38 <table class="form"> trunk/db/migrate/001_initial.rb
r35 r44 2 2 def self.up 3 3 use_limit_for_binary_columns = ['MySQL'].include?(ActiveRecord::Base.connection.adapter_name) 4 4 5 #transaction do 5 6 # USERS … … 275 276 t.column "user_group_id", :integer 276 277 t.column "edit", :boolean, :default => false 277 t.column "add_subasset", :boolean, :default => false278 t.column "remove", :boolean, :default => false279 t.column "edit_permissions", :boolean, :default => false280 278 t.column "create_report", :boolean, :default => false 281 279 t.column "create_work_order", :boolean, :default => false 282 280 t.column "attach_file", :boolean, :default => false 281 t.column "create_subasset", :boolean, :default => false 282 t.column "edit_permissions", :boolean, :default => false 283 t.column "remove", :boolean, :default => false 283 284 end 284 285 add_index "assets_user_groups", ["asset_id"] trunk/db/migrate/002_initial_data.rb
r16 r44 26 26 execute "INSERT INTO assets (code, name) VALUES ('CMMS', 'NorfelloCMMS');" 27 27 # User permissions to assets 28 [["(1, 1, ?, ?, ?, ? )", true, true, true, true],29 ["(1, 2, ?, ?, ?, ? )", false, false, false, false]30 ].each { |values| 31 execute "INSERT INTO assets_user_groups (asset_id, user_group_id, edit, create_report, create_work_order, attach_file ) VALUES #{ActiveRecord::Base.sanitize_sql(values)};"32 } 33 # Default permissions to data created to root asset28 [["(1, 1, ?, ?, ?, ?, ?, ?, ?)", true, true, true, true, true, true, true], 29 ["(1, 2, ?, ?, ?, ?, ?, ?, ?)", false, false, false, false, false, false, false] 30 ].each { |values| 31 execute "INSERT INTO assets_user_groups (asset_id, user_group_id, edit, create_report, create_work_order, attach_file, create_subasset, edit_permissions, remove) VALUES #{ActiveRecord::Base.sanitize_sql(values)};" 32 } 33 # default permissions to data created to root asset 34 34 [["(1, 1, ?, 'ReportPermissionProfile', ?, ?, ?)", false, true, true, true], 35 35 ["(1, 1, ?, 'WorkOrderPermissionProfile', ?, ?, ?)", false, true, true, true], trunk/po/fi_FI/norfello_cmms.po
r43 r44 2 2 msgstr "" 3 3 "Project-Id-Version: NorfelloCMMS SVN trunk\n" 4 "POT-Creation-Date: 2006-08-07 1 0:50+0300\n"5 "PO-Revision-Date: 2006-08-0 4 14:38+0200\n"6 "Last-Translator: Jarmo Hekkanen <jarmo.hekkanen@norfello.com>\n"4 "POT-Creation-Date: 2006-08-07 11:11+0300\n" 5 "PO-Revision-Date: 2006-08-07 11:13+0200\n" 6 "Last-Translator: Markku Oksanen <markku.oksanen@norfello.com>\n" 7 7 "Language-Team: Norfello Ltd. <contact@norfello.com>\n" 8 8 "MIME-Version: 1.0\n" … … 14 14 "X-Poedit-Bookmarks: 311,243,-1,-1,-1,-1,-1,-1,-1,-1\n" 15 15 16 #: app/controllers/asset_controller.rb:15 17 msgid "Asset information" 18 msgstr "Kohteen tiedot " 19 20 #: app/controllers/asset_controller.rb:22 21 msgid "Displaying the asset" 22 msgstr "Kohteen nÀyttÀminen" 23 16 #: app/helpers/application_helper.rb:42 17 msgid "January" 18 msgstr "tammikuu" 19 20 #: app/helpers/application_helper.rb:43 21 msgid "February" 22 msgstr "helmikuu" 23 24 #: app/helpers/application_helper.rb:44 25 msgid "March" 26 msgstr "maaliskuu" 27 28 #: app/helpers/application_helper.rb:45 29 msgid "April" 30 msgstr "huhtikuu" 31 32 #: app/helpers/application_helper.rb:46 33 msgid "May" 34 msgstr "toukokuu" 35 36 #: app/helpers/application_helper.rb:47 37 msgid "June" 38 msgstr "kesÀkuu" 39 40 #: app/helpers/application_helper.rb:48 41 msgid "July" 42 msgstr "heinÀkuu" 43 44 #: app/helpers/application_helper.rb:49 45 msgid "August" 46 msgstr "elokuu" 47 48 #: app/helpers/application_helper.rb:50 49 msgid "September" 50 msgstr "syyskuu" 51 52 #: app/helpers/application_helper.rb:51 53 msgid "October" 54 msgstr "lokakuu" 55 56 #: app/helpers/application_helper.rb:52 57 msgid "November" 58 msgstr "marraskuu" 59 60 #: app/helpers/application_helper.rb:53 61 msgid "December" 62 msgstr "joulukuu" 63 64 #: app/helpers/application_helper.rb:56 65 msgid "All" 66 msgstr "Kaikki" 67 68 #: app/helpers/application_helper.rb:96 69 msgid "Popup calendar" 70 msgstr "Popup-kalenteri" 71 72 #: app/helpers/application_helper.rb:276 73 #: app/controllers/report_controller.rb:361 74 msgid "Report" 75 msgstr "Raportti" 76 77 #: app/helpers/application_helper.rb:289 78 #: app/controllers/work_order_controller.rb:23 79 msgid "Work order" 80 msgstr "TyömÀÀrÀin" 81 82 #: app/helpers/application_helper.rb:302 83 #: app/controllers/attachment_controller.rb:13 84 #: app/controllers/attachment_controller.rb:44 85 msgid "Attachment" 86 msgstr "Liitetiedosto" 87 88 #: app/models/report_type.rb:- 89 msgid "report type" 90 msgstr "raporttityyppi" 91 92 #: app/models/report_type.rb:- 93 msgid "ReportType|Report category" 94 msgstr "Raporttikategoria" 95 96 #: app/models/report_type.rb:- 97 msgid "ReportType|Name" 98 msgstr "Nimi" 99 100 #: app/models/report_type.rb:- 101 msgid "ReportType|Editable" 102 msgstr "Muokattavissa" 103 104 #: app/models/report_type.rb:- 105 msgid "ReportType|Ready" 106 msgstr "Valmis" 107 108 #: app/models/protected_asset_data.rb:375 109 #: app/models/asset.rb:545 110 msgid "Unauthorized to save %s" 111 msgstr "Ei oikeutta %s tallentamiseen" 112 113 #: app/models/permission.rb:- 114 msgid "permission" 115 msgstr "kÀyttöoikeus" 116 117 #: app/models/permission.rb:- 118 msgid "Permission|Name" 119 msgstr "Nimi" 120 121 #: app/models/permission.rb:- 122 msgid "Permission|Info" 123 msgstr "Tiedot" 124 125 #: app/models/open_document_file.rb:- 126 msgid "open document file" 127 msgstr "Avaa asiakirja" 128 129 #: app/models/open_document_file.rb:- 130 msgid "OpenDocumentFile|Type" 131 msgstr "Tyyppi" 132 133 #: app/models/open_document_file.rb:- 134 msgid "OpenDocumentFile|Content type" 135 msgstr "SisÀllön tyyppi" 136 137 #: app/models/open_document_file.rb:- 138 msgid "OpenDocumentFile|Data" 139 msgstr "Data" 140 141 #: app/models/open_document_file.rb:- 142 msgid "OpenDocumentFile|Report type" 143 msgstr "Raporttityyppi" 144 145 #: app/models/open_document_file.rb:18 146 msgid "cannot be empty" 147 msgstr "ei voi olla tyhjÀ" 148 149 #: app/models/open_document_file.rb:31 150 msgid "You can only upload OpenDocument files" 151 msgstr "Voit ladata vain OpenDocument-tiedostoja" 152 153 #: app/models/timeline_event.rb:- 154 msgid "timeline event" 155 msgstr "aikajanan tapahtuma" 156 157 #: app/models/timeline_event.rb:- 158 msgid "TimelineEvent|Type" 159 msgstr "Tyyppi" 160 161 #: app/models/timeline_event.rb:- 162 msgid "TimelineEvent|Event type" 163 msgstr "Tapahtuman tyyppi" 164 165 #: app/models/timeline_event.rb:- 166 msgid "TimelineEvent|Comment text" 167 msgstr "Kommenttiteksti" 168 169 #: app/models/timeline_event.rb:- 170 msgid "TimelineEvent|Created by" 171 msgstr "Luoja" 172 173 #: app/models/timeline_event.rb:- 174 msgid "TimelineEvent|Created at" 175 msgstr "Luotu" 176 177 #: app/models/timeline_event.rb:- 178 msgid "TimelineEvent|Work order" 179 msgstr "TyömÀÀrÀin" 180 181 #: app/models/timeline_event.rb:- 182 msgid "TimelineEvent|Responsible user" 183 msgstr "Vastuussa oleva kÀyttÀjÀ" 184 185 #: app/models/timeline_event.rb:- 186 msgid "TimelineEvent|Report" 187 msgstr "Raportti" 188 189 #: app/models/timeline_event.rb:- 190 msgid "TimelineEvent|Attachment" 191 msgstr "Liitetiedosto" 192 193 #: app/models/work_order_template.rb:27 194 msgid "User field %s is missing" 195 msgstr "KÀyttÀjÀkenttÀ %s puuttuu" 196 197 #: app/models/work_order_template.rb:29 198 msgid "User fields %s are missing" 199 msgstr "KÀyttÀjÀkentÀt %s puuttuvat" 200 201 #: app/models/lockable.rb:- 202 msgid "lockable" 203 msgstr "lockable" 204 205 #: app/models/work_order.rb:31 206 msgid "is not a positive number" 207 msgstr "ei ole kokonaisluku" 208 209 #: app/models/work_order.rb:75 210 msgid "cannot be earlier than the starting time" 211 msgstr "ei saa olla aikaisempi kuin aloitusaika" 212 213 #: app/models/report_field.rb:- 214 msgid "report field" 215 msgstr "raporttikenttÀ" 216 217 #: app/models/report_field.rb:- 218 msgid "ReportField|Report type" 219 msgstr "Raporttityyppi" 220 221 #: app/models/report_field.rb:- 222 msgid "ReportField|Report field group" 223 msgstr "RaporttikenttÀryhmÀ" 224 225 #: app/models/report_field.rb:- 226 msgid "ReportField|Place" 227 msgstr "Sijoitus" 228 229 #: app/models/report_field.rb:- 230 msgid "ReportField|Name" 231 msgstr "Nimi" 232 233 #: app/models/report_field.rb:- 234 msgid "ReportField|User field name" 235 msgstr "KentÀn nimi" 236 237 #: app/models/report_field.rb:- 238 msgid "ReportField|Type code" 239 msgstr "Tyyppikoodi" 240 241 #: app/models/report_field.rb:- 242 msgid "ReportField|List column" 243 msgstr "ReportField|List column" 244 245 #: app/models/report_field.rb:- 246 msgid "ReportField|Validate presence" 247 msgstr "ReportField|Validate presence" 248 249 #: app/models/user.rb:- 250 msgid "user" 251 msgstr "kÀyttÀjÀ" 252 253 #: app/models/user.rb:- 254 msgid "User|Login" 255 msgstr "KÀyttÀjÀtunnus" 256 257 #: app/models/user.rb:- 258 msgid "User|Password" 259 msgstr "Salasana" 260 261 #: app/models/user.rb:- 262 msgid "User|First name" 263 msgstr "Etunimi" 264 265 #: app/models/user.rb:- 266 msgid "User|Last name" 267 msgstr "Sukunimi" 268 269 #: app/models/user.rb:- 270 msgid "User|Description" 271 msgstr "Kuvaus" 272 273 #: app/models/user.rb:- 274 msgid "User|Email" 275 msgstr "SÀhköposti" 276 277 #: app/models/user.rb:- 278 msgid "User|Phone" 279 msgstr "Puhelin" 280 281 #: app/models/user.rb:- 282 msgid "User|Lang" 283 msgstr "Kieli" 284 285 #: app/models/user.rb:- 286 msgid "User|Created at" 287 msgstr "Luotu" 288 289 #: app/models/user.rb:- 290 msgid "User|Updated at" 291 msgstr "PÀivitetty" 292 293 #: app/models/user.rb:- 294 msgid "User|Accessed at" 295 msgstr "User|Accessed at" 296 297 #: app/models/work_order_type.rb:- 298 msgid "work order type" 299 msgstr "työmÀÀrÀintyyppi" 300 301 #: app/models/work_order_type.rb:- 302 msgid "WorkOrderType|Name" 303 msgstr "Nimi" 304 305 #: app/models/work_order_type.rb:- 306 msgid "WorkOrderType|Description" 307 msgstr "Kuvaus" 308 309 #: app/models/asset.rb:529 310 msgid "No changes have been made" 311 msgstr "" 312 313 #: app/models/message.rb:- 314 msgid "message" 315 msgstr "viesti" 316 317 #: app/models/message.rb:- 318 msgid "Message|Receiver user" 319 msgstr "Vastaanottaja" 320 321 #: app/models/message.rb:- 322 msgid "Message|Sender user" 323 msgstr "LÀhettÀjÀ" 324 325 #: app/models/message.rb:- 326 msgid "Message|Unread" 327 msgstr "Lukematon" 328 329 #: app/models/message.rb:- 330 msgid "Message|Subject" 331 msgstr "Aihe" 332 333 #: app/models/message.rb:- 334 msgid "Message|Body" 335 msgstr "SisÀltö" 336 337 #: app/models/message.rb:- 338 msgid "Message|Created at" 339 msgstr "Luotu" 340 341 #: app/models/attachment.rb:53 342 msgid "Text file" 343 msgstr "Tekstitiedosto" 344 345 #: app/models/attachment.rb:55 346 msgid "Image file" 347 msgstr "Kuvatiedosto" 348 349 #: app/models/attachment.rb:57 350 msgid "PDF file" 351 msgstr "PDF-tiedosto" 352 353 #: app/models/attachment.rb:59 354 msgid "gzip (GNU zip) file" 355 msgstr "gzip (GNU zip) -tiedosto" 356 357 #: app/models/attachment.rb:61 358 msgid "Unknown" 359 msgstr "Tuntematon" 360 361 #: app/models/report_field_group.rb:- 362 msgid "report field group" 363 msgstr "RaporttikenttÀryhmÀ" 364 365 #: app/models/report_field_group.rb:- 366 msgid "ReportFieldGroup|Report type" 367 msgstr "Raporttityyppi" 368 369 #: app/models/report_field_group.rb:- 370 msgid "ReportFieldGroup|Name" 371 msgstr "Nimi" 372 373 #: app/models/report_field_group.rb:- 374 msgid "ReportFieldGroup|Place" 375 msgstr "Sijoitus" 376 377 #: app/models/user_group.rb:- 378 msgid "user group" 379 msgstr "kÀyttÀjÀryhmÀ" 380 381 #: app/models/user_group.rb:- 382 msgid "UserGroup|Name" 383 msgstr "Nimi" 384 385 #: app/models/user_group.rb:- 386 msgid "UserGroup|Information" 387 msgstr "Tiedot" 388 389 #: app/models/role.rb:- 390 msgid "role" 391 msgstr "rooli" 392 393 #: app/models/role.rb:- 394 msgid "Role|Name" 395 msgstr "Nimi" 396 397 #: app/models/role.rb:- 398 msgid "Role|Info" 399 msgstr "Tiedot" 400 401 #: app/models/report_category.rb:- 402 msgid "report category" 403 msgstr "Raporttikategoria" 404 405 #: app/models/report_category.rb:- 406 msgid "ReportCategory|Parent" 407 msgstr "Vanhempi" 408 409 #: app/models/report_category.rb:- 410 msgid "ReportCategory|Name" 411 msgstr "Nimi" 412 413 #: app/models/report_field_value.rb:- 414 msgid "report field value" 415 msgstr "report field value" 416 417 #: app/models/report_field_value.rb:- 418 msgid "ReportFieldValue|Type" 419 msgstr "ReportFieldValue|Type" 420 421 #: app/models/report_field_value.rb:- 422 msgid "ReportFieldValue|Report" 423 msgstr "ReportFieldValue|Report" 424 425 #: app/models/report_field_value.rb:- 426 msgid "ReportFieldValue|Report field" 427 msgstr "ReportFieldValue|Report field" 428 429 #: app/models/report_field_value.rb:- 430 msgid "ReportFieldValue|String value" 431 msgstr "ReportFieldValue|String value" 432 433 #: app/models/report_field_value.rb:- 434 msgid "ReportFieldValue|Int value" 435 msgstr "ReportFieldValue|Int value" 436 437 #: app/models/report_field_value.rb:- 438 msgid "ReportFieldValue|Bool value" 439 msgstr "ReportFieldValue|Bool value" 440 441 #: app/models/report_field_value.rb:- 442 msgid "ReportFieldValue|Float value" 443 msgstr "ReportFieldValue|Float value" 444 445 #: app/models/report_field_value.rb:- 446 msgid "ReportFieldValue|Date value" 447 msgstr "ReportFieldValue|Date value" 448 449 #: app/models/report_field_value.rb:- 450 msgid "ReportFieldValue|Time value" 451 msgstr "ReportFieldValue|Time value" 452 453 #: app/models/report_field_value.rb:- 454 msgid "ReportFieldValue|Datetime value" 455 msgstr "ReportFieldValue|Datetime value" 456 457 #: app/models/report_field_value.rb:- 458 msgid "ReportFieldValue|Position x" 459 msgstr "ReportFieldValue|Position x" 460 461 #: app/models/report_field_value.rb:- 462 msgid "ReportFieldValue|Position y" 463 msgstr "ReportFieldValue|Position y" 464 465 #: app/models/protected_join_model.rb:- 466 msgid "protected join model" 467 msgstr "Suojattu liitosmalli" 468 469 #: app/controllers/work_order_controller.rb:22 470 #: app/controllers/report_controller.rb:360 471 #: app/controllers/attachment_controller.rb:12 472 #: app/views/attachment/view.rhtml:3 473 #: app/views/report/view.rhtml:11 474 #: app/views/work_order/_form.rhtml:5 475 #: app/views/online_help/index.rhtml:2 476 #: config/menu.rb:50 477 msgid "Asset" 478 msgstr "Kohde" 479 480 #: app/controllers/work_order_controller.rb:24 481 #: app/controllers/work_order_type_controller.rb:11 482 #: app/controllers/work_order_type_controller.rb:18 483 #: app/controllers/user_controller.rb:61 484 #: app/views/asset/online_help__edit.rhtml:16 485 #: app/views/work_order/_form.rhtml:54 486 #: app/views/user/edit.rhtml:21 487 msgid "Description" 488 msgstr "Kuvaus" 489 490 #: app/controllers/work_order_controller.rb:25 491 #: app/controllers/report_controller.rb:362 492 #: app/controllers/attachment_controller.rb:15 493 #: app/views/attachment/view.rhtml:25 494 #: app/views/report_type/preview.rhtml:22 495 msgid "Creator" 496 msgstr "Luoja" 497 498 #: app/controllers/work_order_controller.rb:26 499 #: app/views/work_order/_form.rhtml:28 500 #: app/views/work_order/create.rhtml:30 501 msgid "Starting time" 502 msgstr "Aloitusaika" 503 504 #: app/controllers/work_order_controller.rb:27 505 #: app/views/work_order/_form.rhtml:37 506 #: app/views/work_order/create.rhtml:34 507 msgid "Deadline" 508 msgstr "Takaraja" 509 510 #: app/controllers/work_order_controller.rb:31 511 msgid "Anybody" 512 msgstr "Kuka tahansa" 513 514 #: app/controllers/work_order_controller.rb:42 515 msgid "Work orders for branch %s" 516 msgstr "TyömÀÀrÀimet haaralle %s" 517 518 #: app/controllers/work_order_controller.rb:45 519 msgid "Work orders for asset %s" 520 msgstr "TyömÀÀrÀimet kohteelle %s" 521 522 #: app/controllers/work_order_controller.rb:73 24 523 #: app/controllers/asset_controller.rb:31 25 #: app/controllers/asset_tree_controller.rb:5026 524 #: app/controllers/data_permission_controller.rb:31 27 525 #: app/controllers/data_permission_controller.rb:34 28 526 #: app/controllers/data_permission_controller.rb:37 29 527 #: app/controllers/attachment_controller.rb:46