View Issue Details

IDProjectCategoryView StatusLast Update
0009703mantisbtprintingpublic2008-10-29 10:35
Reportermvc Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
PlatformLAMPOSDebian GNU/Linux 4.0OS Version4.0 (etch)
Product Version1.1.2 
Summary0009703: Print to Word or Excel document includes references to CSS files on server
Description

Because our Mantis installation is protected by htauth on a secure server, MS Word cannot load the included CSS files.

Mantis should produce a stand-alone CSS file.

Steps To Reproduce

Install Mantis on a protected server
Click View Issues
Click Print Reports
Click Word icon
Save file
Attempt to open file in Word

Additional Information

I've attached a patch for print_all_bug_page_word.php which solves this problem, and also ensures that issues are each printed on a separate page in Word, making the output cleaner. A similar fix is need for print_all_bug_page_excel.php.

TagsNo tags attached.
Attached Files
print_all_bug_page_word.php.patch (2,359 bytes)   
--- www/print_all_bug_page_word.php.orig	2008-10-16 09:22:10.000000000 -0400
+++ www/print_all_bug_page_word.php	2008-10-16 09:22:15.000000000 -0400
@@ -80,7 +80,28 @@
 xmlns:w="urn:schemas-microsoft-com:office:word"
 xmlns="http://www.w3.org/TR/REC-html40">
 
-<?php html_page_top1() ?>
+<?php html_head_begin(); ?>
+<?php # embed css for offline use -- mvc ?>
+<style type="text/css">
+<!--
+span.print                      { font-size: 8pt; }
+table.hide                      { width: 100%; border: solid 0px #ffffff; }
+table.width100          { width: 100%; border: solid 1px #000000; }
+td.form-title           { background-color: #ffffff; color: #000000; font-weight: bold; text-align: left; }
+td.nopad                        { padding: 0px; }
+td.print                        { font-size: 8pt; text-align: left; padding: 2px; }
+td.print-category       { font-size: 8pt; color: #000000; font-weight: bold; text-align: right; padding: 2px; }
+td.print-bottom         { border-bottom: 1px solid #000000; }
+td.print-spacer         { background-color: #ffffff; color: #000000; font-size: 1pt; line-height: 0.1; padding: 0px;}
+tr.print                        { vertical-align: top; }
+tr.print-category       { color: #000000; font-weight: bold; }
+.italic                                 { font-style: italic; }
+.italic-small                   { font-style: italic; font-size: 8pt; }
+-->
+</style>
+<?php html_content_type(); ?>
+<?php include( config_get( 'meta_include_file' ) ); ?>
+<?php html_title( $p_page_title ); ?>
 <?php html_head_end() ?>
 <?php html_body_begin() ?>
 
@@ -123,7 +144,8 @@
             $v2_additional_information 	= string_display_links( $v2_additional_information );
             ### note that dates are converted to unix format in filter_get_bug_rows
 ?>
-<br />
+<?php # added this line to force new page for each issue -- mvc ?>
+<br clear="all" style="page-break-before: always" />
 <table class="width100" cellspacing="1">
 <tr>
 	<td class="form-title" colspan="3">
@@ -403,6 +425,8 @@
 		?>
 	</td>
 </tr>
+</table>
+
 <?php
 	# get the bugnote data
  	if ( !access_has_bug_level( config_get( 'private_bugnote_threshold' ), $v_id ) ) {
@@ -518,11 +542,12 @@
 
 </table>
 <?php # Bugnotes END ?>
-</table>
 
 
 <?php
-echo '<br /><br />';
 		} # end in_array
 }  # end main loop
+
+html_body_end();
+html_end();
 ?>

Activities

mvc

mvc

2008-10-16 09:33

reporter   ~0019575

Err, sorry, I meant "a stand-alone HTML file", obviously.

gotdalife

gotdalife

2008-10-25 23:26

reporter   ~0019687

Is print_all_bug_page_excel.php from a previous version?
It looks like it's been replaced with excel_xml_export.php and this problem no longer exists for excel.

mvc

mvc

2008-10-29 10:35

reporter   ~0019726

As I indicated in the report, this bug report is regarding version 1.1.2 (the version shipped by Debian). So if there are no plans to release a bugfix version of that branch, feel free to close this issue.