Changeset 408

Show
Ignore:
Timestamp:
01/12/07 15:26:34 (2 years ago)
Author:
jarmo
Message:
  • Merged changes from [407] to the 1.2-alpha branch
  • Migration for alpha10
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.2-alpha/app/models/work_order.rb

    r371 r408  
    3232  exports_automatic_field 'cmms_work_order_working_time', :float, :working_time 
    3333  exports_automatic_field 'cmms_work_order_priority', :integer, :priority 
     34  exports_automatic_field 'cmms_work_order_comments', :string, :comments_as_string 
    3435 
    3536 
     
    306307  end 
    307308 
     309  def comments_as_string 
     310    comments = self.work_order_events.find(:all, :readonly => true).collect { |event| [event.created_at, event.creator, event.comment_text] } 
     311    result = [] 
     312    for creation_date, creator, text in comments 
     313      result.push(format_date(creation_date) + ' - ' + creator.login_and_name + ' - ' + text.gsub("\n", '   ')) 
     314    end 
     315    return result.join('  |  ') 
     316  end 
     317 
    308318protected 
    309319 

© 2004-2007 Norfello Oy All Rights Reserved