Changeset 401
- Timestamp:
- 01/12/07 14:20:19 (2 years ago)
- Files:
-
- branches/1.2-alpha/app/models/open_document_file.rb (modified) (1 diff)
- branches/1.2-alpha/app/models/report_field_bool_value.rb (modified) (1 diff)
- branches/1.2-alpha/app/models/report_html_template.rb (modified) (1 diff)
- branches/1.2-alpha/app/views/layouts/mainlevel.rhtml (modified) (3 diffs)
- branches/1.2-alpha/doc/manual (copied) (copied from trunk/doc/manual)
- branches/1.2-alpha/doc/manual/latex (copied) (copied from trunk/doc/manual/latex)
- branches/1.2-alpha/doc/manual/latex/compilation_instructions (copied) (copied from trunk/doc/manual/latex/compilation_instructions)
- branches/1.2-alpha/doc/manual/latex/figure (copied) (copied from trunk/doc/manual/latex/figure)
- branches/1.2-alpha/doc/manual/latex/figure/application_navigation_menu.png (copied) (copied from trunk/doc/manual/latex/figure/application_navigation_menu.png)
- branches/1.2-alpha/doc/manual/latex/figure/asset_menu_functions.png (copied) (copied from trunk/doc/manual/latex/figure/asset_menu_functions.png)
- branches/1.2-alpha/doc/manual/latex/figure/asset_tree.png (copied) (copied from trunk/doc/manual/latex/figure/asset_tree.png)
- branches/1.2-alpha/doc/manual/latex/figure/asset_type_list.png (copied) (copied from trunk/doc/manual/latex/figure/asset_type_list.png)
- branches/1.2-alpha/doc/manual/latex/manual.tex (copied) (copied from trunk/doc/manual/latex/manual.tex)
- branches/1.2-alpha/doc/manual/latex/tex (copied) (copied from trunk/doc/manual/latex/tex)
- branches/1.2-alpha/doc/manual/latex/tex/installing_and_configuring.tex (copied) (copied from trunk/doc/manual/latex/tex/installing_and_configuring.tex)
- branches/1.2-alpha/doc/manual/latex/tex/network_maintenance.tex (copied) (copied from trunk/doc/manual/latex/tex/network_maintenance.tex)
- branches/1.2-alpha/doc/manual/latex/tex/preface.tex (copied) (copied from trunk/doc/manual/latex/tex/preface.tex)
- branches/1.2-alpha/doc/manual/latex/tex/reference_manual.tex (copied) (copied from trunk/doc/manual/latex/tex/reference_manual.tex)
- branches/1.2-alpha/doc/manual/latex/tex/title.tex (copied) (copied from trunk/doc/manual/latex/tex/title.tex)
- branches/1.2-alpha/doc/manual/pdf (copied) (copied from trunk/doc/manual/pdf)
- branches/1.2-alpha/doc/manual/pdf/NorfelloCMMS_OS_documentation.pdf (copied) (copied from trunk/doc/manual/pdf/NorfelloCMMS_OS_documentation.pdf)
- branches/1.2-alpha/lib/localization.rb (modified) (1 diff)
- branches/1.2-alpha/po/fi_FI/norfello_cmms.po (deleted)
- branches/1.2-alpha/public/images/header_logo_small.gif (copied) (copied from trunk/public/images/header_logo_small.gif)
- branches/1.2-alpha/public/stylesheets/asset.css (copied) (copied from trunk/public/stylesheets/asset.css)
- branches/1.2-alpha/public/stylesheets/assettree.css (copied) (copied from trunk/public/stylesheets/assettree.css)
- branches/1.2-alpha/public/stylesheets/base.css (copied) (copied from trunk/public/stylesheets/base.css)
- branches/1.2-alpha/public/stylesheets/layout.css (copied) (copied from trunk/public/stylesheets/layout.css)
- branches/1.2-alpha/public/stylesheets/mainlevel.css (deleted)
- branches/1.2-alpha/public/stylesheets/odt2html.css (copied) (copied from trunk/public/stylesheets/odt2html.css)
- branches/1.2-alpha/public/stylesheets/onlinehelp.css (copied) (copied from trunk/public/stylesheets/onlinehelp.css)
- branches/1.2-alpha/public/stylesheets/reports.css (copied) (copied from trunk/public/stylesheets/reports.css)
- branches/1.2-alpha/public/stylesheets/reset.css (copied) (copied from trunk/public/stylesheets/reset.css)
- branches/1.2-alpha/public/stylesheets/timeline.css (copied) (copied from trunk/public/stylesheets/timeline.css)
- branches/1.2-alpha/public/stylesheets/typography.css (copied) (copied from trunk/public/stylesheets/typography.css)
- branches/1.2-alpha/public/stylesheets/workorders.css (copied) (copied from trunk/public/stylesheets/workorders.css)
- branches/1.2-alpha/vendor/plugins/odt_to_xhtml/lib/analyze_content.rb (modified) (1 diff)
- branches/1.2-alpha/vendor/plugins/odt_to_xhtml/lib/analyze_styles.rb (modified) (1 diff)
- branches/1.2-alpha/vendor/plugins/odt_to_xhtml/lib/odt_to_xhtml.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.2-alpha/app/models/open_document_file.rb
r264 r401 85 85 getters.each { |e| 86 86 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 88 92 } 89 93 end branches/1.2-alpha/app/models/report_field_bool_value.rb
r264 r401 18 18 19 19 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 21 33 end 22 34 end branches/1.2-alpha/app/models/report_html_template.rb
r271 r401 35 35 } 36 36 } 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 38 66 return filled_version 39 67 end branches/1.2-alpha/app/views/layouts/mainlevel.rhtml
r371 r401 24 24 <%= @content_for_report_style %> 25 25 26 <%= stylesheet_link_tag ' mainlevel' %>26 <%= stylesheet_link_tag 'base' %> 27 27 <%= stylesheet_link_tag 'calendar-win2k-1' %> 28 28 … … 72 72 </head> 73 73 <body> 74 <div id="header"> 75 <h1>NorfelloCMMS</h1> 76 </div> 77 74 <h1 id="logo">NorfelloCMMS</h1> 75 <div id="header_background"> </div> 78 76 <!-- USER INFORMATION --> 79 77 <div id="user_info"> … … 266 264 <!-- MAIN COLUMN END --> 267 265 268 <div class="clear"> </div> 266 <div class="clear"> </div> 269 267 270 268 <div id="footer"> branches/1.2-alpha/lib/localization.rb
r339 r401 15 15 return _('(Not specified)') unless date_or_datetime 16 16 17 date_format ||= _('% A %B %Y-%m-%d')17 date_format ||= _('%Y-%m-%d') 18 18 return date_or_datetime.strftime(date_format) if date_or_datetime.is_a?(Date) 19 19 branches/1.2-alpha/vendor/plugins/odt_to_xhtml/lib/analyze_content.rb
r2 r401 133 133 end 134 134 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 135 146 # Text spans cannot produce a newline after their 136 147 # opening tag, so the extra <tt>""</tt> parameter is branches/1.2-alpha/vendor/plugins/odt_to_xhtml/lib/analyze_styles.rb
r2 r401 134 134 process_normal_style_attr( selector, "width", value ) 135 135 end 136 137 def process_min_row_height(selector, property, value) 138 process_normal_style_attr(selector, "height", value) 139 end 136 140 137 141 # <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 98 98 fo:text-indent 99 99 style:column-width* process_column_width 100 style:min-row-height* process_min_row_height 100 101 style:text-underline-style* process_underline_style 101 102 style:text-position* process_style_text_position