From 371b834f770cde453b527376d69e8730344518b1 Mon Sep 17 00:00:00 2001 From: Andre Lorbach Date: Thu, 6 Oct 2011 16:13:20 +0200 Subject: [PATCH] Added report page, simular to the statistics page which is accessable from the main loganalyzer area. --- src/images/icons/table_sql_run.png | Bin 0 -> 684 bytes src/lang/en/main.php | 5 +- src/reports.php | 143 +++++++++++++++++++ src/templates/include_menu.html | 2 +- src/templates/reports.html | 221 +++++++++++++++++++++++++++++ 5 files changed, 369 insertions(+), 2 deletions(-) create mode 100644 src/images/icons/table_sql_run.png create mode 100644 src/reports.php create mode 100644 src/templates/reports.html diff --git a/src/images/icons/table_sql_run.png b/src/images/icons/table_sql_run.png new file mode 100644 index 0000000000000000000000000000000000000000..d4bdb8e10cffc3431121f2ab6cfaf64490f2cdb8 GIT binary patch literal 684 zcmV;d0#p5oP)WdKBJAT%INa(W;#FfcP9FfckYG&(ReAS*C2FfiRo4vqi-00(qQO+^RR z1s4r7IN2=wIRF3v32;bRa{vGe@Bjb`@Bu=sG?)MY00d`2O+f$vv5yP6Iec?VwCmMH=?_Z(fOm|7<@j!>y=eEVM}*e5e$~J z1%*Kx56PLPrUg0z6`JXB51$X1HV742pSvzp}?|069f_2V789w*>C91jbQxt z3#_dPq*9jp8*-3o7AnwP1@Z<`-qOP_I6h9&7Wjv2=0AE5RA zY)Kv*@0vk;b%&}~(oNNbu5)i2uEYKla`Fjbg%Dxqcc>%;2%aJ}(AAJ6q<#aIe!toC SQwt6N0000 \ No newline at end of file diff --git a/src/reports.php b/src/reports.php new file mode 100644 index 0000000..9077cc9 --- /dev/null +++ b/src/reports.php @@ -0,0 +1,143 @@ + Helps administrating report modules + * + * All directives are explained within this file + * + * Copyright (C) 2008-2010 Adiscon GmbH. + * + * This file is part of LogAnalyzer. + * + * LogAnalyzer is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * LogAnalyzer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with LogAnalyzer. If not, see . + * + * A copy of the GPL can be found in the file "COPYING" in this + * distribution + ********************************************************************* +*/ + +// *** Default includes and procedures *** // +define('IN_PHPLOGCON', true); +$gl_root_path = './'; + +// Now include necessary include files! +include($gl_root_path . 'include/functions_common.php'); +include($gl_root_path . 'include/functions_frontendhelpers.php'); +include($gl_root_path . 'include/functions_filters.php'); +include($gl_root_path . 'include/functions_reports.php'); + +InitPhpLogCon(); +InitSourceConfigs(); +InitFrontEndDefaults(); // Only in WebFrontEnd +InitFilterHelpers(); // Helpers for frontend filtering! +// --- + +// --- BEGIN Custom Code + +// Firts of all init List of Reports! +InitReportModules(); + +if ( isset($content['REPORTS']) ) +{ + // This will enable to Stats View + $content['reportsenabled'] = true; + + $i = 0; // Help counter! + foreach ($content['REPORTS'] as &$myReport ) + { + // Set if help link is enabled + if ( strlen($myReport['ReportHelpArticle']) > 0 ) + $myReport['ReportHelpEnabled'] = true; + else + $myReport['ReportHelpEnabled'] = false; + + // check for custom fields + if ( $myReport['NeedsInit'] ) // && count($myReport['CustomFieldsList']) > 0 ) + { + // Needs custom fields! + $myReport['EnableNeedsInit'] = true; + + if ( $myReport['Initialized'] ) + { + $myReport['InitEnabled'] = false; + $myReport['DeleteEnabled'] = true; + } + else + { + $myReport['InitEnabled'] = true; + $myReport['DeleteEnabled'] = false; + } + } + + // --- Set CSS Class + if ( $i % 2 == 0 ) + { + $myReport['cssclass'] = "line1"; + $myReport['rowbegin'] = ''; + $myReport['rowend'] = ''; + } + else + { + $myReport['cssclass'] = "line2"; + $myReport['rowbegin'] = ''; + $myReport['rowend'] = ''; + } + $i++; + // --- + + // --- Check for saved reports! + if ( isset($myReport['SAVEDREPORTS']) && count($myReport['SAVEDREPORTS']) > 0 ) + { + $myReport['HASSAVEDREPORTS'] = "true"; + $myReport['SavedReportRowSpan'] = ( count($myReport['SAVEDREPORTS']) + 1); + + $j = 0; // Help counter! + foreach ($myReport['SAVEDREPORTS'] as &$mySavedReport ) + { + // --- Set CSS Class + if ( $j % 2 == 0 ) + $mySavedReport['srcssclass'] = "line1"; + else + $mySavedReport['srcssclass'] = "line2"; + $j++; + // --- + } + } + // --- + } +} +else +{ + $content['LISTREPORTS'] = "false"; + $content['ISERROR'] = true; + $content['ERROR_MSG'] = $content['LN_REPORTS_ERROR_NOREPORTS']; +} +// --- END Custom Code + +// --- BEGIN CREATE TITLE +$content['TITLE'] = InitPageTitle(); +// Append custom title part! +$content['TITLE'] .= " :: " . $content['LN_MENU_REPORTS']; +// --- END CREATE TITLE + +// --- Parsen and Output +InitTemplateParser(); +$page -> parser($content, "reports.html"); +$page -> output(); +// --- +?> \ No newline at end of file diff --git a/src/templates/include_menu.html b/src/templates/include_menu.html index 1526de1..26e8f65 100644 --- a/src/templates/include_menu.html +++ b/src/templates/include_menu.html @@ -20,7 +20,7 @@ - {LN_MENU_SEARCHINKB} + {LN_MENU_SEARCHINKB} {LN_MENU_LOGIN} diff --git a/src/templates/reports.html b/src/templates/reports.html new file mode 100644 index 0000000..122fb09 --- /dev/null +++ b/src/templates/reports.html @@ -0,0 +1,221 @@ + + + +

+
+
+
{LN_GEN_ERRORDETAILS}
+

{ERROR_MSG}

+

+ + + {LN_GEN_MOREINFORMATION} + +

+
+

+
+

+ + + + + + + + + + + + + +
{LN_MENU_REPORTS}

{LN_REPORTS_INFORMATION}

+ + + + + + + + + + + +
{LN_REPORTS_ADMIN}{LN_REPORTMENU_ONLINELIST}{REPORTS_DETAILSFOR} 
+ +
+ +

+ + + +{rowbegin} +
+ + + + + + + + + + + + + + + + +
{LN_REPORTS_NAME}{DisplayName}
{LN_REPORTS_HELP} + +    {LN_REPORTS_HELP} + +    {LN_REPORTS_INFO} +
{LN_REPORTS_DESCRIPTION}{Description}
{LN_REPORTS_SAVEDREPORTS} + + + + + + + + + +
+ + {customTitle} + +   +
+ + +
+

+{rowend} + + + + + + + + + + + + + + + + + + + + + + +
{LN_REPORTS_INSTALLED}{LN_REPORTS_ID}{LN_REPORTS_NAME}{LN_REPORTS_DESCRIPTION}{LN_REPORTS_LINKS}
{reportid} + + {reportname} + + + {reportname} + + {reportdescription} + +    + + +    + + +    + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{LN_REPORTS_DETAILS}
{LN_REPORTS_CAT}{Category}
{LN_REPORTS_ID}{ReportID}
{LN_REPORTS_NAME}{DisplayName}
{LN_REPORTS_DESCRIPTION}{Description}
{LN_REPORTS_REQUIREDFIELDS} + +
{FieldCaption} ({FieldDefine}) + +

+
{LN_REPORTS_HELP}{LN_REPORTS_HELP_CLICK}
+ + {LN_REPORTS_INIT} + + + {LN_REPORTS_REMOVE} + +
{LN_REPORTS_SAVEDREPORTS} +
+ + {customTitle} + +   +   +   +
+ +

+ {LN_GEN_ERRORRETURNPREV} + + +

+ + + + + + \ No newline at end of file