From 024035e890f7a480e54c308f4af8cb627039583b Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 15 Dec 2017 17:06:11 +0100 Subject: [PATCH] - Added directory application/controllers/system/infocenter/ - Moved controller TestFilterWidget to system/infocenter/ - Renamed controller TestFilterWidget to InfoCenter - Added directory application/views/system/infocenter/ - Added views system/infocenter/infocenter.php and system/infocenter/infocenterFilters.php - Added new header views/templates/FHC-Footer - Added new header views/templates/FHC-Header - FHC-Header still using old JQuery and missing others includes --- .../controllers/system/TestFilterWidget.php | 62 ----------- .../system/infocenter/InfoCenter.php | 95 ++++++++++++++++ .../views/system/infocenter/infocenter.php | 35 ++++++ .../system/infocenter/infocenterFilters.php | 30 +++++ application/views/templates/FHC-Footer.php | 3 + application/views/templates/FHC-Header.php | 103 ++++++++++++++++++ 6 files changed, 266 insertions(+), 62 deletions(-) delete mode 100644 application/controllers/system/TestFilterWidget.php create mode 100644 application/controllers/system/infocenter/InfoCenter.php create mode 100644 application/views/system/infocenter/infocenter.php create mode 100644 application/views/system/infocenter/infocenterFilters.php create mode 100644 application/views/templates/FHC-Footer.php create mode 100644 application/views/templates/FHC-Header.php diff --git a/application/controllers/system/TestFilterWidget.php b/application/controllers/system/TestFilterWidget.php deleted file mode 100644 index 9cdd54095..000000000 --- a/application/controllers/system/TestFilterWidget.php +++ /dev/null @@ -1,62 +0,0 @@ -load->library('WidgetLib'); - } - - /** - * - */ - public function sql() - { - echo $this->widgetlib->widget( - 'FilterWidget', - array( - 'app' => 'core', - 'datasetName' => 'kontakts', - 'filterKurzbz' => 'This filter filters', - 'query' => ' - SELECT p.person_id AS "PersonId", - p.nachname AS "Nachname", - p.vorname AS "Vorname", - k.kontakt AS "Email", - p.aktiv AS "Aktiv", - k.updateamum AS "UpdateDate" - FROM public.tbl_person p INNER JOIN public.tbl_kontakt k USING(person_id) - WHERE p.aktiv = TRUE - AND p.person_id = k.person_id - AND k.kontakttyp = \'email\' - AND p.person_id < 1000 - ', - 'hideHeader' => false, - 'hideSave' => false, - 'checkboxes' => array('PersonId'), - 'additionalColumns' => array('Delete', 'Edit'), - 'formatRaw' => function($fieldName, $fieldValue, $datasetRaw) { - - if ($fieldName == 'PersonId') - { - $datasetRaw->{$fieldName} = ''.$fieldValue.''; - } - elseif ($fieldName == 'Delete') - { - $datasetRaw->{$fieldName} = 'Delete'; - } - elseif ($fieldName == 'Edit') - { - $datasetRaw->{$fieldName} = 'Edit'; - } - - return $datasetRaw; - } - ) - ); - } -} diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php new file mode 100644 index 000000000..d75ab4d9e --- /dev/null +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -0,0 +1,95 @@ +load->library('WidgetLib'); + } + + /** + * + */ + public function index() + { + $listFiltersSent = array( + 'Sent 1' => 100, + 'Sent 2' => 200, + 'Sent 3' => 300 + ); + + $listFiltersNotSent = array( + 'Not Sent 1' => 400, + 'Not Sent 2' => 500, + 'Not Sent 3' => 600 + ); + + $this->load->view( + 'system/infocenter/infocenter.php', + array( + 'listFiltersSent' => $listFiltersSent, + 'listFiltersNotSent' => $listFiltersNotSent + ) + ); + } + + /** + * + */ + public function filter($filterId = null) + { + $filterWidgetArray = array( + 'query' => ' + SELECT p.person_id AS "PersonId", + p.nachname AS "Nachname", + p.vorname AS "Vorname", + k.kontakt AS "Email", + p.aktiv AS "Aktiv", + k.updateamum AS "UpdateDate" + FROM public.tbl_person p INNER JOIN public.tbl_kontakt k USING(person_id) + WHERE p.aktiv = TRUE + AND p.person_id = k.person_id + AND k.kontakttyp = \'email\' + AND p.person_id < 1000 + ', + 'hideHeader' => false, + 'hideSave' => false, + 'checkboxes' => array('PersonId'), + 'additionalColumns' => array('Delete', 'Edit'), + 'formatRaw' => function($fieldName, $fieldValue, $datasetRaw) { + + if ($fieldName == 'PersonId') + { + $datasetRaw->{$fieldName} = ''.$fieldValue.''; + } + elseif ($fieldName == 'Delete') + { + $datasetRaw->{$fieldName} = 'Delete'; + } + elseif ($fieldName == 'Edit') + { + $datasetRaw->{$fieldName} = 'Edit'; + } + + return $datasetRaw; + } + ); + + if ($filterId == null) + { + $filterWidgetArray['app'] = 'core'; + $filterWidgetArray['datasetName'] = 'kontakts'; + $filterWidgetArray['filterKurzbz'] = 'This filter filters'; + } + else + { + $filterWidgetArray['filterId'] = $filterId; + } + + echo $this->widgetlib->widget('FilterWidget', $filterWidgetArray); + } +} diff --git a/application/views/system/infocenter/infocenter.php b/application/views/system/infocenter/infocenter.php new file mode 100644 index 000000000..984005baa --- /dev/null +++ b/application/views/system/infocenter/infocenter.php @@ -0,0 +1,35 @@ +load->view('templates/FHC-Header', array('title' => 'Info Center', 'jquery3' => true)); ?> + + + + + + + + + load->view( + 'system/infocenter/infocenterFilters.php', + array( + 'listFiltersSent' => $listFiltersSent, + 'listFiltersNotSent' => $listFiltersNotSent + ) + ); + ?> + + + + + + + + +load->view('templates/FHC-Footer'); ?> diff --git a/application/views/system/infocenter/infocenterFilters.php b/application/views/system/infocenter/infocenterFilters.php new file mode 100644 index 000000000..e5d124aad --- /dev/null +++ b/application/views/system/infocenter/infocenterFilters.php @@ -0,0 +1,30 @@ + $filterId) + { + $toPrint = '
%s
'; + + echo sprintf($toPrint, base_url('index.ci.php/system/infocenter/InfoCenter/filter'), $filterId, $name).PHP_EOL; + } + } + +// HTML + // body + // span +?> +
+ +
+ Abgeschickt: +
+ + + +
+ Nicht abgeschickt: +
+ + + +
diff --git a/application/views/templates/FHC-Footer.php b/application/views/templates/FHC-Footer.php new file mode 100644 index 000000000..9be2faef3 --- /dev/null +++ b/application/views/templates/FHC-Footer.php @@ -0,0 +1,3 @@ + + + diff --git a/application/views/templates/FHC-Header.php b/application/views/templates/FHC-Header.php new file mode 100644 index 000000000..bde117a48 --- /dev/null +++ b/application/views/templates/FHC-Header.php @@ -0,0 +1,103 @@ +'; + + if (isset($CSSs)) + { + $tmpCSSs = is_array($CSSs) ? $CSSs : array($CSSs); + + for ($tmpCSSsCounter = 0; $tmpCSSsCounter < count($tmpCSSs); $tmpCSSsCounter++) + { + $toPrint = sprintf($cssLink, base_url($tmpCSSs[$tmpCSSsCounter])).PHP_EOL; + + if ($tmpCSSsCounter > 0) $toPrint = "\t\t".$toPrint; + + echo $toPrint; + } + } +} + +/** + * Generates tags for the javascripts you want to include, the parameter could by a string or an array of strings + */ +function _generateJSsInclude($JSs) +{ + $jsInclude = ''; + + if (isset($JSs)) + { + $tmpJSs = is_array($JSs) ? $JSs : array($JSs); + + for ($tmpJSsCounter = 0; $tmpJSsCounter < count($tmpJSs); $tmpJSsCounter++) + { + $toPrint = sprintf($jsInclude, base_url($tmpJSs[$tmpJSsCounter])).PHP_EOL; + + if ($tmpJSsCounter > 0) $toPrint = "\t\t".$toPrint; + + echo $toPrint; + } + } +} + +?> + + + + + <?php _printTitle($title); ?> + + + + + + + + + +