From 0948194b46a03a47c3666b4076d31d624412cb1b Mon Sep 17 00:00:00 2001 From: Andre Lorbach Date: Fri, 28 Aug 2009 16:40:12 +0200 Subject: [PATCH] Further enhanced admin panel --- src/admin/reports.php | 40 +++++++++++++++++++++++++ src/include/functions_common.php | 15 ++++++++++ src/lang/de/admin.php | 4 +++ src/lang/de/main.php | 2 ++ src/lang/en/admin.php | 6 ++++ src/lang/en/main.php | 2 ++ src/lang/it_IT/admin.php | 4 +++ src/lang/pt_BR/admin.php | 4 +++ src/lang/pt_BR/main.php | 2 ++ src/templates/admin/admin_reports.html | 41 ++++++++++++++++++++++++++ 10 files changed, 120 insertions(+) diff --git a/src/admin/reports.php b/src/admin/reports.php index 170bc29..350f9d8 100644 --- a/src/admin/reports.php +++ b/src/admin/reports.php @@ -248,6 +248,46 @@ if ( isset($_GET['op']) ) $content['ERROR_MSG'] = $content['LN_REPORTS_ERROR_INVALIDID']; } } + else if ($_GET['op'] == "addsavedreport") + { + // Set Mode to edit +// $content['ISSHOWDETAILS'] = "true"; + $content['ISADDSAVEDREPORT'] = "true"; + $content['REPORT_FORMACTION'] = "addsavedreport"; + $content['REPORT_SENDBUTTON'] = $content['LN_REPORTS_ADDSAVEDREPORT']; + + if ( isset($_GET['id']) ) + { + //PreInit these values + $content['ReportID'] = DB_RemoveBadChars($_GET['id']); + if ( isset($content['REPORTS'][ $content['ReportID'] ]) ) + { + // Get Reference to parser! + $myReport = $content['REPORTS'][ $content['ReportID'] ]; + + // Set Report properties + $content['DisplayName'] = $myReport['DisplayName']; + $content['Description'] = $myReport['Description']; + + // Set defaults for report + $content['customTitle'] = $myReport['DisplayName']; + $content['customComment'] = ""; + $content['filterString'] = ""; + $content['customFilters'] = ""; + + $content['outputFormat'] = REPORT_OUTPUT_HTML; + CreateOutputformatList( $content['outputFormat'] ); + + $content['outputTarget'] = ""; + $content['scheduleSettings'] = ""; + } + } + else + { + $content['ISERROR'] = true; + $content['ERROR_MSG'] = $content['LN_REPORTS_ERROR_INVALIDID']; + } + } } // Default mode! diff --git a/src/include/functions_common.php b/src/include/functions_common.php index ea36af3..db0c9cf 100644 --- a/src/include/functions_common.php +++ b/src/include/functions_common.php @@ -397,6 +397,21 @@ function CreateDBTypesList( $selectedDBType ) if ( $selectedDBType == $content['DBTYPES'][DB_SQLITE]['type'] ) { $content['DBTYPES'][DB_SQLITE]['selected'] = "selected"; } else { $content['DB_ODBC'][DB_SQLITE]['selected'] = ""; } } +function CreateOutputformatList( $selectedOutputformat ) +{ + global $content; + + // REPORT_OUTPUT_HTML + $content['OUTPUTFORMATS'][REPORT_OUTPUT_HTML]['formatid'] = REPORT_OUTPUT_HTML; + $content['OUTPUTFORMATS'][REPORT_OUTPUT_HTML]['formatdisplayname'] = $content['LN_GEN_REPORT_OUTPUT_HTML']; + if ( $selectedOutputformat == $content['OUTPUTFORMATS'][REPORT_OUTPUT_HTML]['formatid'] ) { $content['OUTPUTFORMATS'][REPORT_OUTPUT_HTML]['formatselected'] = "selected"; } else { $content['OUTPUTFORMATS'][REPORT_OUTPUT_HTML]['formatselected'] = ""; } + + // REPORT_OUTPUT_PDF + $content['OUTPUTFORMATS'][REPORT_OUTPUT_PDF]['formatid'] = REPORT_OUTPUT_PDF; + $content['OUTPUTFORMATS'][REPORT_OUTPUT_PDF]['formatdisplayname'] = $content['LN_GEN_REPORT_OUTPUT_PDF']; + if ( $selectedOutputformat == $content['OUTPUTFORMATS'][REPORT_OUTPUT_PDF]['formatid'] ) { $content['OUTPUTFORMATS'][REPORT_OUTPUT_PDF]['formatselected'] = "selected"; } else { $content['OUTPUTFORMATS'][REPORT_OUTPUT_PDF]['formatselected'] = ""; } +} + function CreatePagesizesList() { global $content; diff --git a/src/lang/de/admin.php b/src/lang/de/admin.php index de95008..f42b57d 100644 --- a/src/lang/de/admin.php +++ b/src/lang/de/admin.php @@ -393,6 +393,10 @@ $content['LN_REPORTS_ERROR_HASBEENADDED'] = "All required settings for the repor $content['LN_REPORTS_ERROR_NOFIELDS'] = "The report '%1' does not have any custom settings which can be added."; $content['LN_REPORTS_ERROR_REPORTDOESNTNEEDTOBEREMOVED'] = "The report '%1' does not need to be removed or initialized."; $content['LN_REPORTS_ADDSAVEDREPORT'] = "Add Savedreport"; +$content['LN_REPORTS_CUSTOMTITLE'] = "Report Title"; +$content['LN_REPORTS_CUSTOMCOMMENT'] = "Comment / Description"; +$content['LN_REPORTS_FILTERSTRING'] = "Filterstring"; +$content['LN_REPORTS_OUTPUTFORMAT'] = "Outputformat"; $content['LN_REPORTS_'] = ""; ?> \ No newline at end of file diff --git a/src/lang/de/main.php b/src/lang/de/main.php index d9dcc3f..f9d9702 100644 --- a/src/lang/de/main.php +++ b/src/lang/de/main.php @@ -100,6 +100,8 @@ $content['LN_ERROR_NORECORDS'] = "Es wurden keine syslog-Einträge gefunden. $content['LN_ERROR_REDIRECTABORTED'] = 'Automatic redirect to the page was aborted, as an internal error occured. Please see the error details above and contact our support forums if you need assistance.'; $content['LN_DEBUGLEVEL'] = "Debug Level"; $content['LN_DEBUGMESSAGE'] = "Debug Message"; + $content['LN_GEN_REPORT_OUTPUT_HTML'] = "HTML Format"; + $content['LN_GEN_REPORT_OUTPUT_PDF'] = "PDF Format"; // Topmenu Entries $content['LN_MENU_SEARCH'] = "Suchen"; diff --git a/src/lang/en/admin.php b/src/lang/en/admin.php index ca2f60b..7df1766 100644 --- a/src/lang/en/admin.php +++ b/src/lang/en/admin.php @@ -406,6 +406,12 @@ $content['LN_REPORTS_ERROR_HASBEENADDED'] = "All required settings for the repor $content['LN_REPORTS_ERROR_NOFIELDS'] = "The report '%1' does not have any custom settings which can be added."; $content['LN_REPORTS_ERROR_REPORTDOESNTNEEDTOBEREMOVED'] = "The report '%1' does not need to be removed or initialized."; $content['LN_REPORTS_ADDSAVEDREPORT'] = "Add Savedreport"; +$content['LN_REPORTS_CUSTOMTITLE'] = "Report Title"; +$content['LN_REPORTS_CUSTOMCOMMENT'] = "Comment / Description"; +$content['LN_REPORTS_FILTERSTRING'] = "Filterstring"; +$content['LN_REPORTS_OUTPUTFORMAT'] = "Outputformat"; +$content['LN_REPORTS_'] = ""; + $content['LN_REPORTS_'] = ""; diff --git a/src/lang/en/main.php b/src/lang/en/main.php index 2ee573f..f287f33 100644 --- a/src/lang/en/main.php +++ b/src/lang/en/main.php @@ -102,6 +102,8 @@ $content['LN_ERROR_DB_DBFIELDNOTFOUND'] = "Database Field mapping for at least o $content['LN_ERROR_REDIRECTABORTED'] = 'Automatic redirect to the page was aborted, as an internal error occured. Please see the error details above and contact our support forums if you need assistance.'; $content['LN_DEBUGLEVEL'] = "Debug Level"; $content['LN_DEBUGMESSAGE'] = "Debug Message"; + $content['LN_GEN_REPORT_OUTPUT_HTML'] = "HTML Format"; + $content['LN_GEN_REPORT_OUTPUT_PDF'] = "PDF Format"; // Topmenu Entries diff --git a/src/lang/it_IT/admin.php b/src/lang/it_IT/admin.php index 4b1ad17..cef9fd9 100644 --- a/src/lang/it_IT/admin.php +++ b/src/lang/it_IT/admin.php @@ -406,6 +406,10 @@ $content['LN_REPORTS_ERROR_HASBEENADDED'] = "All required settings for the repor $content['LN_REPORTS_ERROR_NOFIELDS'] = "The report '%1' does not have any custom settings which can be added."; $content['LN_REPORTS_ERROR_REPORTDOESNTNEEDTOBEREMOVED'] = "The report '%1' does not need to be removed or initialized."; $content['LN_REPORTS_ADDSAVEDREPORT'] = "Add Savedreport"; +$content['LN_REPORTS_CUSTOMTITLE'] = "Report Title"; +$content['LN_REPORTS_CUSTOMCOMMENT'] = "Comment / Description"; +$content['LN_REPORTS_FILTERSTRING'] = "Filterstring"; +$content['LN_REPORTS_OUTPUTFORMAT'] = "Outputformat"; $content['LN_REPORTS_'] = ""; ?> \ No newline at end of file diff --git a/src/lang/pt_BR/admin.php b/src/lang/pt_BR/admin.php index de95008..f42b57d 100644 --- a/src/lang/pt_BR/admin.php +++ b/src/lang/pt_BR/admin.php @@ -393,6 +393,10 @@ $content['LN_REPORTS_ERROR_HASBEENADDED'] = "All required settings for the repor $content['LN_REPORTS_ERROR_NOFIELDS'] = "The report '%1' does not have any custom settings which can be added."; $content['LN_REPORTS_ERROR_REPORTDOESNTNEEDTOBEREMOVED'] = "The report '%1' does not need to be removed or initialized."; $content['LN_REPORTS_ADDSAVEDREPORT'] = "Add Savedreport"; +$content['LN_REPORTS_CUSTOMTITLE'] = "Report Title"; +$content['LN_REPORTS_CUSTOMCOMMENT'] = "Comment / Description"; +$content['LN_REPORTS_FILTERSTRING'] = "Filterstring"; +$content['LN_REPORTS_OUTPUTFORMAT'] = "Outputformat"; $content['LN_REPORTS_'] = ""; ?> \ No newline at end of file diff --git a/src/lang/pt_BR/main.php b/src/lang/pt_BR/main.php index 780b97a..282860f 100644 --- a/src/lang/pt_BR/main.php +++ b/src/lang/pt_BR/main.php @@ -102,6 +102,8 @@ $content['LN_ERROR_NORECORDS'] = "Sem mensagens encontradas."; $content['LN_WARNING_DBUPGRADE'] = "Database Upgrade required"; $content['LN_WARNING_DBUPGRADE_TEXT'] = "The current installed database version is '%1'.
An update to version '%2' is available."; $content['LN_ERROR_REDIRECTABORTED'] = 'Automatic redirect to the page was aborted, as an internal error occured. Please see the error details above and contact our support forums if you need assistance.'; + $content['LN_GEN_REPORT_OUTPUT_HTML'] = "HTML Format"; + $content['LN_GEN_REPORT_OUTPUT_PDF'] = "PDF Format"; // Topmenu Entries $content['LN_MENU_SEARCH'] = "Search"; diff --git a/src/templates/admin/admin_reports.html b/src/templates/admin/admin_reports.html index 279abbf..1992176 100644 --- a/src/templates/admin/admin_reports.html +++ b/src/templates/admin/admin_reports.html @@ -110,6 +110,47 @@ {LN_GEN_ERRORRETURNPREV} + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
{LN_REPORTS_ADDSAVEDREPORT}: '{DisplayName}'
{LN_REPORTS_CUSTOMTITLE}
{LN_REPORTS_CUSTOMCOMMENT}
{LN_REPORTS_FILTERSTRING}
{LN_REPORTS_OUTPUTFORMAT} + +
+ + +
+
+ +