Changeset 401

Show
Ignore:
Timestamp:
01/12/07 14:20:19 (2 years ago)
Author:
jarmo
Message:
  • Merged changesets [381] - [400] to the 1.2-alpha branch
  • Removed finnish translations file
Files:

Legend:

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

    r264 r401  
    8585        getters.each { |e| 
    8686          e.attributes['text:name'] = prefix + e.attributes['text:name'] 
    87           e.text = user_field[:value]  # FIXME: Value should be formatted 
     87          if e.attributes['text:display'] == 'none' 
     88            e.text = '' 
     89          else 
     90            e.text = user_field[:value]  # FIXME: Value should be formatted 
     91          end 
    8892        } 
    8993      end 
  • branches/1.2-alpha/app/models/report_field_bool_value.rb

    r264 r401  
    1818 
    1919  def user_field_type 
    20     return 'boolean' 
     20    # OpenDocument has support for value-type="boolean" but 
     21    # OpenOffice doesn't seem to support it. Seems the OO way 
     22    # is to use floats and "1" for true and "0" for false. 
     23    #return 'boolean' 
     24    return 'float' 
     25  end 
     26 
     27  def user_field_value 
     28    # OpenDocument has support for value-type="boolean" but 
     29    # OpenOffice doesn't seem to support it. Seems the OO way 
     30    # is to use floats and "1" for true and "0" for false. 
     31    #return self.bool_value 
     32    return self.bool_value ? 1 : 0 
    2133  end 
    2234end 
  • branches/1.2-alpha/app/models/report_html_template.rb

    r271 r401  
    3535      } 
    3636    } 
    37     filled_version.body = body 
     37 
     38    # Update conditional texts that have simple conditions 
     39    body_doc = REXML::Document.new(body) 
     40    conditional_texts = REXML::XPath.match(body_doc, '//div[@type="conditional_text"]') 
     41    for conditional_text in conditional_texts 
     42      # Check the condition format 
     43      match = conditional_text.attributes['condition'].match(/^ooow:([_[:alnum:]]+)[[:space:]]*==[[:space:]]*([01])[[:space:]]*$/) 
     44      next unless match 
     45       
     46      user_field_name = match[1] 
     47      expected_value = match[2] 
     48       
     49      # Get the report field value 
     50      report_field = report.report_type.report_fields.find(:first, :conditions => ['user_field_name = ?', user_field_name]) 
     51      next unless report_field 
     52      report_field_value = report.get_field_value_for(report_field) 
     53      next unless report_field_value 
     54 
     55      # Evaluate the condition 
     56      if report_field_value.user_field_value.to_s == expected_value.to_s 
     57        conditional_text.text = conditional_text.attributes['true-value'] 
     58      else 
     59        conditional_text.text = conditional_text.attributes['false-value'] 
     60      end 
     61    end 
     62    body_text = StringIO.new('', 'w') 
     63    body_doc.write(body_text) 
     64 
     65    filled_version.body = body_text.string 
    3866    return filled_version 
    3967  end 
  • branches/1.2-alpha/app/views/layouts/mainlevel.rhtml

    r371 r401  
    2424    <%= @content_for_report_style %> 
    2525 
    26     <%= stylesheet_link_tag 'mainlevel' %> 
     26    <%= stylesheet_link_tag 'base' %> 
    2727    <%= stylesheet_link_tag 'calendar-win2k-1' %> 
    2828 
     
    7272  </head> 
    7373  <body> 
    74     <div id="header"> 
    75       <h1>NorfelloCMMS</h1> 
    76     </div> 
    77  
     74    <h1 id="logo">NorfelloCMMS</h1> 
     75    <div id="header_background">&nbsp;</div> 
    7876    <!-- USER INFORMATION --> 
    7977    <div id="user_info"> 
     
    266264    <!-- MAIN COLUMN END --> 
    267265 
    268     <div class="clear">&nbsp;</div> 
     266    <div class="clear">&nbsp;</div>  
    269267 
    270268    <div id="footer"> 
  • branches/1.2-alpha/lib/localization.rb

    r339 r401  
    1515    return _('(Not specified)') unless date_or_datetime 
    1616 
    17     date_format ||= _('%A %B %Y-%m-%d') 
     17    date_format ||= _('%Y-%m-%d') 
    1818    return date_or_datetime.strftime(date_format) if date_or_datetime.is_a?(Date) 
    1919 
  • branches/1.2-alpha/vendor/plugins/odt_to_xhtml/lib/analyze_content.rb

    r2 r401  
    133133        end 
    134134 
     135  # Added for the CMMS 
     136  # This is needed for the evaluation of conditional texts 
     137  # based on the report values. 
     138  def process_text_conditional_text(element, output_node) 
     139    div = emit_element(output_node, 'div', { 'true-value' => element.attributes['text:string-value-if-true'], 
     140                                             'false-value' => element.attributes['text:string-value-if-false'], 
     141                                             'condition' => element.attributes['text:condition'], 
     142                                             'type' => 'conditional_text' }) 
     143    process_children(element, div) 
     144  end 
     145 
    135146        #       Text spans cannot produce a newline after their 
    136147        #       opening tag, so the extra <tt>""</tt> parameter is 
  • branches/1.2-alpha/vendor/plugins/odt_to_xhtml/lib/analyze_styles.rb

    r2 r401  
    134134                process_normal_style_attr( selector, "width", value ) 
    135135        end 
     136 
     137  def process_min_row_height(selector, property, value) 
     138    process_normal_style_attr(selector, "height", value) 
     139  end 
    136140         
    137141        #       <tt>style:text-underline-style</tt> becomes <tt>text-decoration</tt> 
  • branches/1.2-alpha/vendor/plugins/odt_to_xhtml/lib/odt_to_xhtml.rb

    r2 r401  
    9898        fo:text-indent 
    9999        style:column-width* process_column_width 
     100        style:min-row-height* process_min_row_height 
    100101        style:text-underline-style* process_underline_style 
    101102        style:text-position* process_style_text_position 

© 2004-2007 Norfello Oy All Rights Reserved