diff --git a/src/classes/class_template.php b/src/classes/class_template.php index 40d1c1b..ada5413 100644 --- a/src/classes/class_template.php +++ b/src/classes/class_template.php @@ -191,7 +191,13 @@ class Template { { // FIXED BY ANDRE | Do not convert OBJECTS into strings! if ( !is_object($k) && !is_object($v) ) - $template = str_replace('{'.$k.'}', "$v", $template); + { + // Replace normal variables + $template = str_replace('{'.$k.'}', "$v", $template); + + // Replace variables with options, use Callback function! + $template = preg_replace( '/{'.$k.':(.*?):(.*?)}/ie', 'InsertTemplateVariable("$v", "\\1", "\\2")', $template ); + } } } } @@ -294,7 +300,30 @@ class Template { // return processed template return $template; } - - } + +function InsertTemplateVariable($szValue, $szOperation, $szOption) +{ + // Set Default + $szResult = $szValue; + + switch ( $szOperation ) + { + case "trunscate": + if ( is_numeric($szOption) && strlen($szValue) > $szOption) + $szResult = substr($szValue, 0, $szOption) . " ..."; + break; + case "forcelinebreak": + if ( is_numeric($szOption) && strlen($szValue) > $szOption) + $szResult = wordwrap($szValue, $szOption, "
", true); + break; + default: + // Nothing + break; + } + + // return result + return $szResult; +} + ?> \ No newline at end of file diff --git a/src/classes/reports/report.class.php b/src/classes/reports/report.class.php index d142b98..0435975 100644 --- a/src/classes/reports/report.class.php +++ b/src/classes/reports/report.class.php @@ -201,11 +201,14 @@ abstract class Report { // Set new Outputtype $this->_outputFormat = $newOutputType; + // Get include path + $szIncludePath = $this->GetReportIncludePath(); + // Set Filebasename $this->_baseFileName = $this->_reportFileBasicName . ".template." . $this->_outputFormat; // Set to HTML Template if is missing! - if ( !is_file($this->_baseFileName) ) + if ( !is_file( $szIncludePath . $this->_baseFileName) ) $this->_baseFileName = $this->_reportFileBasicName . ".template." . REPORT_OUTPUT_HTML; } @@ -496,7 +499,6 @@ abstract class Report { { // Include Custom language file if available IncludeLanguageFile( $szReportIncludePath . $this->_reportFileBasicName . ".lang.en.php" ); - } @@ -518,9 +520,11 @@ abstract class Report { // Convert into PDF! include_once($gl_root_path . 'classes/html2fpdf/html2fpdf.php'); - $pdf=new HTML2FPDF('landscape'); +// $pdf=new HTML2FPDF('landscape'); + $pdf=new HTML2FPDF(); + $pdf->UseCss(true); $pdf->AddPage(); - $pdf->SetFontSize(14); +// $pdf->SetFontSize(12); $pdf->WriteHTML( $szOutputBuffer ); // Header('Content-Type: application/pdf'); $pdf->Output('', 'I'); // Output to STANDARD Input! diff --git a/src/classes/reports/report.eventlog.monilog/report.eventlog.monilog.css b/src/classes/reports/report.eventlog.monilog/report.eventlog.monilog.css index ca2c40e..688a9dd 100644 --- a/src/classes/reports/report.eventlog.monilog/report.eventlog.monilog.css +++ b/src/classes/reports/report.eventlog.monilog/report.eventlog.monilog.css @@ -176,7 +176,7 @@ font /* Cells for listening */ .line0 { - font-size: 10px; + font-size: 7pt; color: #000000; background-color: #DDDDDD; } @@ -187,7 +187,7 @@ font .line1 { - font-size: 10px; + font-size: 7pt; color: #000000; background-color: #EEEEEE; } @@ -198,7 +198,7 @@ font .line2 { - font-size: 10px; + font-size: 7pt; color: #000000; background-color: #F5F5F5; } diff --git a/src/classes/reports/report.eventlog.monilog/report.eventlog.monilog.template.pdf b/src/classes/reports/report.eventlog.monilog/report.eventlog.monilog.template.pdf new file mode 100644 index 0000000..7cb07c9 --- /dev/null +++ b/src/classes/reports/report.eventlog.monilog/report.eventlog.monilog.template.pdf @@ -0,0 +1,120 @@ + + + + {report_title} + + + + +

{report_title}

+

{report_comment}

+ + +
+ + + + + + + + + + +
{LN_REPORT_FILTERS}
{FilterType}{FilterDisplay}
+ + +

+ +

{ln_report_summary}

+ + + + + + + + + + + +
{ln_report_event_summary}
{DisplayName}{ItemCount}
+ +

+ + + + + + + + +
{ln_report_computer_summary}
+ + {FROMHOST}({ItemCount}), + +
+ +

+ +

{ln_report_consolidation}

+ + +

{FROMHOST}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{ln_report_number}{ln_report_firstevent}{ln_report_lastevent}{ln_report_process}{ln_report_severity}{ln_report_eventid}{ln_report_count}
{ZAEHLER}{FirstEvent_Date_Formatted}{LastEvent_Date_Formatted}{sourceproc}{syslogseverity_text}{id}{ItemCount}{ItemCount}
{ln_report_description}{msg:forcelinebreak:40}
+ + +

+ + + + + + + + + + + +
Made by Adiscon GmbH (2009)  Report Version {report_version} Partners: Rsyslog |  WinSyslog
+ + {LN_REPORT_FOOTER_ENDERED}: {report_rendertime} +  | {LN_FOOTER_DBQUERIES}: {TOTALQUERIES} + +
+ + + \ No newline at end of file