From 3d0bdcf95add4900f629a38b33292b77216c42b9 Mon Sep 17 00:00:00 2001 From: Paolo Date: Tue, 17 May 2022 16:05:02 +0200 Subject: [PATCH 001/137] Changed composer.json and updated composer.lock --- composer.json | 112 ++++++++++++++++++++++++--- composer.lock | 204 ++++++++++++++++++++------------------------------ 2 files changed, 182 insertions(+), 134 deletions(-) diff --git a/composer.json b/composer.json index 6a23a8526..540025875 100644 --- a/composer.json +++ b/composer.json @@ -23,8 +23,7 @@ ], "support": { "email": "info@fhcomplete.org", - "forum": "https://plus.google.com/communities/113278802529782592610", - "wiki": "http://wiki.fhcomplete.org/" + "wiki": "https://wiki.fhcomplete.info/doku.php" }, "repositories": [ { @@ -60,7 +59,6 @@ } } }, - { "type": "package", "package": { @@ -73,6 +71,28 @@ } } }, + { + "type": "package", + "package": { + "name": "fortawesome/font-awesome4", + "version": "4.7.0", + "dist": { + "url": "https://github.com/FortAwesome/Font-Awesome/archive/refs/tags/v4.7.0.zip", + "type": "zip" + } + } + }, + { + "type": "package", + "package": { + "name": "fortawesome/font-awesome6", + "version": "6.1.1", + "dist": { + "url": "https://github.com/FortAwesome/Font-Awesome/archive/refs/tags/6.1.1.zip", + "type": "zip" + } + } + }, { "type": "package", "package": { @@ -187,10 +207,21 @@ { "type": "package", "package": { - "name": "olifolkerd/tabulator", - "version": "4.2.7", + "name": "olifolkerd/tabulator4", + "version": "4.9.3", "dist": { - "url": "https://github.com/olifolkerd/tabulator/archive/4.2.7.zip", + "url": "https://github.com/olifolkerd/tabulator/archive/refs/tags/4.9.3.zip", + "type": "zip" + } + } + }, + { + "type": "package", + "package": { + "name": "olifolkerd/tabulator5", + "version": "5.2.1", + "dist": { + "url": "https://github.com/olifolkerd/tabulator/archive/refs/tags/5.2.1.zip", "type": "zip" } } @@ -228,6 +259,28 @@ } } }, + { + "type": "package", + "package": { + "name": "tinymce/tinymce4", + "version": "4.9.11", + "dist": { + "url": "https://github.com/tinymce/tinymce-dist/archive/refs/tags/4.9.11.zip", + "type": "zip" + } + } + }, + { + "type": "package", + "package": { + "name": "tinymce/tinymce5", + "version": "5.10.3", + "dist": { + "url": "https://github.com/tinymce/tinymce-dist/archive/refs/tags/5.10.3.zip", + "type": "zip" + } + } + }, { "type": "package", "package": { @@ -239,6 +292,39 @@ "reference": "9750b81fa55ed07b3b429297d18ffbeac07a2cde" } } + }, + { + "type": "package", + "package": { + "name": "twbs/bootstrap3", + "version": "3.4.1", + "dist": { + "url": "https://github.com/twbs/bootstrap/archive/refs/tags/v3.4.1.zip", + "type": "zip" + } + } + }, + { + "type": "package", + "package": { + "name": "twbs/bootstrap5", + "version": "5.0.2", + "dist": { + "url": "https://github.com/twbs/bootstrap/releases/download/v5.0.2/bootstrap-5.0.2-dist.zip", + "type": "zip" + } + } + }, + { + "type": "package", + "package": { + "name": "vuejs/vuejs3", + "version": "3.2.33", + "dist": { + "url": "https://unpkg.com/vue@3.2.33/dist/vue.global.prod.js", + "type": "file" + } + } } ], "require": { @@ -253,13 +339,14 @@ "codeigniter/framework": "3.*", "components/jquery": "3.*", "components/jqueryui": "1.*", - "components/font-awesome": "4.*", "components/angular.js": "1.3.*", "dapphp/securimage": "3.6.7", "easyrdf/easyrdf": "0.9.*", + "fortawesome/font-awesome4": "4.7.*", + "fortawesome/font-awesome6": "6.1.*", "fzaninotto/faker": "1.*", "kingsquare/json-schema-form": "*", @@ -273,9 +360,13 @@ "phpseclib/phpseclib": "2.0.*", - "tinymce/tinymce": "4.9.*", + "tinymce/tinymce4": "4.9.*", + "tinymce/tinymce5": "5.10.*", - "twbs/bootstrap": "3.4.*", + "twbs/bootstrap3": "3.4.*", + "twbs/bootstrap5": "5.0.*", + + "vuejs/vuejs3": "3.2.33", "zetacomponents/workflow": "1.*", "zetacomponents/document": "1.*", @@ -304,7 +395,8 @@ "nicolaskruchten/pivottable": "2.23.0", - "olifolkerd/tabulator": "4.2.7", + "olifolkerd/tabulator4": "4.9.*", + "olifolkerd/tabulator5": "5.2.*", "rmariuzzo/jquery-checkboxes": "1.0.7", diff --git a/composer.lock b/composer.lock index 7d9d977d0..5f2557632 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "6bab4617977e08b2939bf959929632d4", - "content-hash": "3e499134721f682f298dda20263ab686", + "hash": "d12bb05ce04aaee58782e9ad4803c387", + "content-hash": "798c94bdd795a81a8bdbb43f2a09fc33", "packages": [ { "name": "BlackrockDigital/startbootstrap-sb-admin-2", @@ -564,41 +564,6 @@ "homepage": "http://angularjs.org", "time": "2015-06-07 20:10:38" }, - { - "name": "components/font-awesome", - "version": "4.7.0", - "source": { - "type": "git", - "url": "https://github.com/components/font-awesome.git", - "reference": "885308b939369d147bec93174722786bc2c4eedd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/components/font-awesome/zipball/885308b939369d147bec93174722786bc2c4eedd", - "reference": "885308b939369d147bec93174722786bc2c4eedd", - "shasum": "" - }, - "type": "component", - "extra": { - "component": { - "styles": [ - "css/font-awesome.css" - ], - "files": [ - "css/font-awesome.min.css", - "css/font-awesome.css.map", - "fonts/*" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT", - "OFL-1.1" - ], - "description": "The iconic font designed for use with Twitter Bootstrap.", - "time": "2016-10-25 10:56:23" - }, { "name": "components/jquery", "version": "3.6.0", @@ -848,6 +813,28 @@ }, "type": "library" }, + { + "name": "fortawesome/font-awesome4", + "version": "4.7.0", + "dist": { + "type": "zip", + "url": "https://github.com/FortAwesome/Font-Awesome/archive/refs/tags/v4.7.0.zip", + "reference": null, + "shasum": null + }, + "type": "library" + }, + { + "name": "fortawesome/font-awesome6", + "version": "6.1.1", + "dist": { + "type": "zip", + "url": "https://github.com/FortAwesome/Font-Awesome/archive/refs/tags/6.1.1.zip", + "reference": null, + "shasum": null + }, + "type": "library" + }, { "name": "fzaninotto/faker", "version": "v1.9.2", @@ -1410,11 +1397,22 @@ "type": "library" }, { - "name": "olifolkerd/tabulator", - "version": "4.2.7", + "name": "olifolkerd/tabulator4", + "version": "4.9.3", "dist": { "type": "zip", - "url": "https://github.com/olifolkerd/tabulator/archive/4.2.7.zip", + "url": "https://github.com/olifolkerd/tabulator/archive/refs/tags/4.9.3.zip", + "reference": null, + "shasum": null + }, + "type": "library" + }, + { + "name": "olifolkerd/tabulator5", + "version": "5.2.1", + "dist": { + "type": "zip", + "url": "https://github.com/olifolkerd/tabulator/archive/refs/tags/5.2.1.zip", "reference": null, "shasum": null }, @@ -1607,50 +1605,26 @@ "type": "library" }, { - "name": "tinymce/tinymce", + "name": "tinymce/tinymce4", "version": "4.9.11", - "source": { - "type": "git", - "url": "https://github.com/tinymce/tinymce-dist.git", - "reference": "3a68b67d1120ab89c6760afeb787291703c9a7d5" - }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tinymce/tinymce-dist/zipball/3a68b67d1120ab89c6760afeb787291703c9a7d5", - "reference": "3a68b67d1120ab89c6760afeb787291703c9a7d5", - "shasum": "" + "url": "https://github.com/tinymce/tinymce-dist/archive/refs/tags/4.9.11.zip", + "reference": null, + "shasum": null }, - "type": "component", - "extra": { - "component": { - "scripts": [ - "tinymce.js", - "plugins/*/plugin.js", - "themes/*/theme.js" - ], - "files": [ - "tinymce.min.js", - "plugins/*/plugin.min.js", - "themes/*/theme.min.js", - "skins/**" - ] - } + "type": "library" + }, + { + "name": "tinymce/tinymce5", + "version": "5.10.3", + "dist": { + "type": "zip", + "url": "https://github.com/tinymce/tinymce-dist/archive/refs/tags/5.10.3.zip", + "reference": null, + "shasum": null }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-2.1-only" - ], - "description": "Web based JavaScript HTML WYSIWYG editor control.", - "homepage": "http://www.tinymce.com", - "keywords": [ - "editor", - "html", - "javascript", - "richtext", - "tinymce", - "wysiwyg" - ], - "time": "2020-07-13 05:29:19" + "type": "library" }, { "name": "tomazdragar/SimpleCropper", @@ -1663,55 +1637,26 @@ "type": "library" }, { - "name": "twbs/bootstrap", - "version": "v3.4.1", - "source": { - "type": "git", - "url": "https://github.com/twbs/bootstrap.git", - "reference": "68b0d231a13201eb14acd3dc84e51543d16e5f7e" - }, + "name": "twbs/bootstrap3", + "version": "3.4.1", "dist": { "type": "zip", - "url": "https://api.github.com/repos/twbs/bootstrap/zipball/68b0d231a13201eb14acd3dc84e51543d16e5f7e", - "reference": "68b0d231a13201eb14acd3dc84e51543d16e5f7e", - "shasum": "" + "url": "https://github.com/twbs/bootstrap/archive/refs/tags/v3.4.1.zip", + "reference": null, + "shasum": null }, - "replace": { - "twitter/bootstrap": "self.version" + "type": "library" + }, + { + "name": "twbs/bootstrap5", + "version": "5.0.2", + "dist": { + "type": "zip", + "url": "https://github.com/twbs/bootstrap/releases/download/v5.0.2/bootstrap-5.0.2-dist.zip", + "reference": null, + "shasum": null }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4.x-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jacob Thornton", - "email": "jacobthornton@gmail.com" - }, - { - "name": "Mark Otto", - "email": "markdotto@gmail.com" - } - ], - "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", - "homepage": "https://getbootstrap.com/", - "keywords": [ - "JS", - "css", - "framework", - "front-end", - "less", - "mobile-first", - "responsive", - "web" - ], - "time": "2019-02-13 15:55:38" + "type": "library" }, { "name": "twig/twig", @@ -1777,6 +1722,17 @@ ], "time": "2020-02-11 05:59:23" }, + { + "name": "vuejs/vuejs3", + "version": "3.2.33", + "dist": { + "type": "file", + "url": "https://unpkg.com/vue@3.2.33/dist/vue.global.prod.js", + "reference": null, + "shasum": null + }, + "type": "library" + }, { "name": "zetacomponents/base", "version": "1.9.3", From a603081544964f5bfd9e4c925a3defdb62b4565a Mon Sep 17 00:00:00 2001 From: Paolo Date: Mon, 23 May 2022 18:45:29 +0200 Subject: [PATCH 002/137] - Changed composer.json and updated composer.lock - Added new PostgreSQL types in application/core/DB_Model.php - Updated the includes in application/views/* - Added new view template application/views/templates/FHC-Common.php - Moved JS includes in application/views/templates/FHC-Footer.php - Updated JS and CSS includes in application/views/templates/FHC-Footer.php and application/views/templates/FHC-Header.php - Updated public/js/bootstrapper.js - Changed global variable names in application/views/templates/FHC-Common.php to include the version of the included source --- application/core/DB_Model.php | 54 ++- application/libraries/NavigationLib.php | 4 +- application/views/codex/oehbeitrag.php | 12 +- application/views/home.php | 58 ++- .../anrechnung/approveAnrechnungDetail.php | 8 +- .../approveAnrechnungUebersicht.php | 10 +- .../lehre/anrechnung/createAnrechnung.php | 10 +- .../lehre/anrechnung/requestAnrechnung.php | 8 +- .../anrechnung/reviewAnrechnungDetail.php | 8 +- .../anrechnung/reviewAnrechnungUebersicht.php | 10 +- .../views/lehre/lehrauftrag/Dashboard.php | 10 +- .../lehre/lehrauftrag/LehrendeUebersicht.php | 8 +- .../lehre/lehrauftrag/acceptLehrauftrag.php | 14 +- .../lehre/lehrauftrag/approveLehrauftrag.php | 16 +- .../lehre/lehrauftrag/orderLehrauftrag.php | 16 +- .../lvplanung/adminZeitverfuegbarkeit.php | 14 +- .../views/lehre/pruefungsprotokoll.php | 10 +- .../lehre/pruefungsprotokollUebersicht.php | 12 +- .../reihungstest/reihungstest.php | 12 +- .../views/organisation/studienjahrEdit.php | 2 +- application/views/person/bpk/bpkDetails.php | 14 +- application/views/person/bpk/bpkwartung.php | 12 +- .../views/person/gradelist/gradelist.php | 8 +- application/views/system/fas_udf.php | 10 +- .../views/system/infocenter/infocenter.php | 50 +- .../infocenter/infocenterAbgewiesen.php | 14 +- .../system/infocenter/infocenterDetails.php | 426 +++++++++--------- .../infocenter/infocenterFreigegeben.php | 14 +- .../infocenterReihungstestAbsolviert.php | 14 +- .../infocenter/infocenterZgvDetails.php | 14 +- .../infocenter/infocenterZgvUeberpruefung.php | 14 +- .../system/infocenter/studiengangZgvInfo.php | 8 +- application/views/system/issues/issues.php | 14 +- .../views/system/jq/jobsQueueViewer.php | 12 +- .../views/system/login/usernamePassword.php | 10 +- application/views/system/logs/logsViewer.php | 44 +- .../views/system/messages/ajaxRead.php | 16 +- .../views/system/messages/ajaxWrite.php | 12 +- .../views/system/messages/ajaxWriteReply.php | 12 +- .../system/messages/htmlMessageSentError.php | 8 +- .../messages/htmlMessageSentSuccess.php | 8 +- .../views/system/messages/htmlRead.php | 8 +- .../views/system/messages/htmlWriteReply.php | 10 +- .../system/messages/htmlWriteTemplate.php | 12 +- .../views/system/phrases/phraseinhaltEdit.php | 2 +- .../views/system/vorlage/templatetextEdit.php | 2 +- application/views/templates/FHC-Common.php | 44 ++ application/views/templates/FHC-Footer.php | 155 +++++++ application/views/templates/FHC-Header.php | 205 ++------- composer.json | 6 +- composer.lock | 8 +- public/css/NavigationComponent.css | 23 + public/js/bootstrapper.js | 4 +- 53 files changed, 824 insertions(+), 685 deletions(-) create mode 100644 application/views/templates/FHC-Common.php create mode 100644 public/css/NavigationComponent.css diff --git a/application/core/DB_Model.php b/application/core/DB_Model.php index 4e555be6c..bdd5316e7 100644 --- a/application/core/DB_Model.php +++ b/application/core/DB_Model.php @@ -22,11 +22,16 @@ class DB_Model extends CI_Model const PGSQL_BOOLEAN_FALSE = 'f'; const PGSQL_BOOLEAN_TYPE = 'bool'; const PGSQL_BOOLEAN_ARRAY_TYPE = '_bool'; + const PGSQL_INT2_TYPE = 'int2'; + const PGSQL_INT4_TYPE = 'int4'; + const PGSQL_INT8_TYPE = 'int8'; + const PGSQL_FLOAT4_TYPE = 'float4'; + const PGSQL_FLOAT8_TYPE = 'float8'; protected $dbTable; // Name of the DB-Table for CI-Insert, -Update, ... - protected $pk; // Name of the PrimaryKey for DB-Update, Load, ... + protected $pk; // Name of the PrimaryKey for DB-Update, Load, ... protected $hasSequence; // False if this table has a composite primary key that is not using a sequence - // True if this table has a primary key that uses a sequence + // True if this table has a primary key that uses a sequence private $executedQueryMetaData; private $executedQueryListFields; @@ -271,11 +276,6 @@ class DB_Model extends CI_Model /** * Load data and convert a record into a list of data from the main table, * and linked to every element, the data from the side tables - * - * TODO: - * - Adding support for composed primary key - * - Adding support for cascading side tables (useful?) - * * NOTE: sub queries are not supported in the from clause * * @return array @@ -598,6 +598,28 @@ class DB_Model extends CI_Model return $val; } + /** + * Convert PG-Int* to PHP-Integer + */ + public function pgIntPhp($val) + { + // If it is null, let it be null + if ($val == null) return $val; + + return intval($val); + } + + /** + * Convert PG-Float* to PHP-Float + */ + public function pgFloatPhp($val) + { + // If it is null, let it be null + if ($val == null) return $val; + + return floatval($val); + } + /** * Converts from PostgreSQL array to php array * It also takes care about array of booleans @@ -892,6 +914,11 @@ class DB_Model extends CI_Model // If array type, boolean type OR a UDF if (strpos($eqmd->type, DB_Model::PGSQL_ARRAY_TYPE) !== false || $eqmd->type == DB_Model::PGSQL_BOOLEAN_TYPE + || $eqmd->type == DB_Model::PGSQL_INT2_TYPE + || $eqmd->type == DB_Model::PGSQL_INT4_TYPE + || $eqmd->type == DB_Model::PGSQL_INT8_TYPE + || $eqmd->type == DB_Model::PGSQL_FLOAT4_TYPE + || $eqmd->type == DB_Model::PGSQL_FLOAT8_TYPE || $this->udflib->isUDFColumn($eqmd->name, $eqmd->type)) { // If UDFs are inside this result set @@ -941,6 +968,19 @@ class DB_Model extends CI_Model { $resultElement->{$toBeConverted->name} = $this->pgBoolPhp($resultElement->{$toBeConverted->name}); } + // Integer type + elseif ($toBeConverted->type == DB_Model::PGSQL_INT2_TYPE + || $toBeConverted->type == DB_Model::PGSQL_INT4_TYPE + || $toBeConverted->type == DB_Model::PGSQL_INT8_TYPE) + { + $resultElement->{$toBeConverted->name} = $this->pgIntPhp($resultElement->{$toBeConverted->name}); + } + // Float type + elseif ($toBeConverted->type == DB_Model::PGSQL_FLOAT4_TYPE + || $toBeConverted->type == DB_Model::PGSQL_FLOAT8_TYPE) + { + $resultElement->{$toBeConverted->name} = $this->pgFloatPhp($resultElement->{$toBeConverted->name}); + } } } } diff --git a/application/libraries/NavigationLib.php b/application/libraries/NavigationLib.php index e2492cef4..f8730afad 100644 --- a/application/libraries/NavigationLib.php +++ b/application/libraries/NavigationLib.php @@ -37,7 +37,7 @@ class NavigationLib // Loads library ExtensionsLib $this->_ci->load->library('ExtensionsLib'); - $this->_navigationPage = $this->_getNavigationtPage($params); // sets the id for the related navigation widget + $this->_navigationPage = $this->_getNavigationPage($params); // sets the id for the related navigation widget } //------------------------------------------------------------------------------------------------------------------ @@ -300,7 +300,7 @@ class NavigationLib * Return an unique string that identify this navigation widget * NOTE: The default value is the URI where the NavigationWidget is called */ - private function _getNavigationtPage($params) + private function _getNavigationPage($params) { if ($params != null && is_array($params) diff --git a/application/views/codex/oehbeitrag.php b/application/views/codex/oehbeitrag.php index 8a697129e..feebeddef 100644 --- a/application/views/codex/oehbeitrag.php +++ b/application/views/codex/oehbeitrag.php @@ -3,12 +3,12 @@ $this->load->view( 'templates/FHC-Header', array( 'title' => 'ÖH-Beitragsverwaltung', - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, - 'tablesorter' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, + 'tablesorter2' => true, 'dialoglib' => true, 'ajaxlib' => true, 'navigationwidget' => true, diff --git a/application/views/home.php b/application/views/home.php index 79669dd88..eb7ef0406 100644 --- a/application/views/home.php +++ b/application/views/home.php @@ -1,42 +1,36 @@ load->view('templates/FHC-Header', - array( + $includesArray = array( 'title' => 'FH-Complete', - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, 'ajaxlib' => true, + 'bootstrapper' => true, // to be used only if you know what you are doing! 'addons' => true, 'navigationwidget' => true - ) -); + ); + + $this->load->view('templates/FHC-Header', $includesArray); ?> - -
- - widgetlib->widget('NavigationWidget'); ?> - -
-
-
-
- +
+ + widgetlib->widget('NavigationWidget'); ?> + +
+
+
+
+ +
+ +
+
- -
-
-
- - -load->view('templates/FHC-Footer'); ?> + +load->view('templates/FHC-Footer', $includesArray); ?> + diff --git a/application/views/lehre/anrechnung/approveAnrechnungDetail.php b/application/views/lehre/anrechnung/approveAnrechnungDetail.php index cd38fd9ac..f522c323f 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungDetail.php +++ b/application/views/lehre/anrechnung/approveAnrechnungDetail.php @@ -3,10 +3,10 @@ $this->load->view( 'templates/FHC-Header', array( 'title' => $this->p->t('anrechnung', 'anrechnungenGenehmigen'), - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, 'ajaxlib' => true, 'dialoglib' => true, 'phrases' => array( diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php index 308f702a3..09c299565 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php @@ -3,11 +3,11 @@ $this->load->view( 'templates/FHC-Header', array( 'title' => $this->p->t('anrechnung', 'anrechnungenGenehmigen'), - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'tabulator' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'tabulator4' => true, 'ajaxlib' => true, 'dialoglib' => true, 'tablewidget' => true, diff --git a/application/views/lehre/anrechnung/createAnrechnung.php b/application/views/lehre/anrechnung/createAnrechnung.php index 58b0757b9..56f4827cd 100644 --- a/application/views/lehre/anrechnung/createAnrechnung.php +++ b/application/views/lehre/anrechnung/createAnrechnung.php @@ -3,13 +3,13 @@ $this->load->view( 'templates/FHC-Header', array( 'title' => $this->p->t('anrechnung', 'neueAnrechnung'), - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, 'ajaxlib' => true, 'dialoglib' => true, - 'tabulator' => true, + 'tabulator4' => true, 'tablewidget' => true, 'phrases' => array( 'global' => array( diff --git a/application/views/lehre/anrechnung/requestAnrechnung.php b/application/views/lehre/anrechnung/requestAnrechnung.php index 978dd5606..59e6c6502 100644 --- a/application/views/lehre/anrechnung/requestAnrechnung.php +++ b/application/views/lehre/anrechnung/requestAnrechnung.php @@ -5,10 +5,10 @@ $this->load->view( 'templates/FHC-Header', array( 'title' => $this->p->t('anrechnung', 'antragStellen'), - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, 'ajaxlib' => true, 'dialoglib' => true, 'phrases' => array( diff --git a/application/views/lehre/anrechnung/reviewAnrechnungDetail.php b/application/views/lehre/anrechnung/reviewAnrechnungDetail.php index 18c70e5af..147ef9a95 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungDetail.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungDetail.php @@ -3,10 +3,10 @@ $this->load->view( 'templates/FHC-Header', array( 'title' => $this->p->t('anrechnung', 'anrechnungenPruefen'), - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, 'ajaxlib' => true, 'dialoglib' => true, 'phrases' => array( diff --git a/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php b/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php index 54d0b49d1..3337c4a83 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php @@ -3,11 +3,11 @@ $this->load->view( 'templates/FHC-Header', array( 'title' => $this->p->t('anrechnung', 'anrechnungenPruefen'), - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'tabulator' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'tabulator4' => true, 'ajaxlib' => true, 'dialoglib' => true, 'tablewidget' => true, diff --git a/application/views/lehre/lehrauftrag/Dashboard.php b/application/views/lehre/lehrauftrag/Dashboard.php index a14cefa7a..d89636f04 100644 --- a/application/views/lehre/lehrauftrag/Dashboard.php +++ b/application/views/lehre/lehrauftrag/Dashboard.php @@ -3,11 +3,11 @@ $this->load->view( 'templates/FHC-Header', array( 'title' => 'Lehrauftrag bestellen', - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, 'ajaxlib' => true, 'dialoglib' => true, 'navigationwidget' => true, diff --git a/application/views/lehre/lehrauftrag/LehrendeUebersicht.php b/application/views/lehre/lehrauftrag/LehrendeUebersicht.php index 1ad295392..d64381547 100644 --- a/application/views/lehre/lehrauftrag/LehrendeUebersicht.php +++ b/application/views/lehre/lehrauftrag/LehrendeUebersicht.php @@ -3,10 +3,10 @@ $this->load->view( 'templates/FHC-Header', array( 'title' => 'Lehrauftrag bestellen', - 'jquery' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, + 'jquery3' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, 'ajaxlib' => true, 'navigationwidget' => true, ) diff --git a/application/views/lehre/lehrauftrag/acceptLehrauftrag.php b/application/views/lehre/lehrauftrag/acceptLehrauftrag.php index 521883452..691e576f3 100644 --- a/application/views/lehre/lehrauftrag/acceptLehrauftrag.php +++ b/application/views/lehre/lehrauftrag/acceptLehrauftrag.php @@ -3,14 +3,14 @@ $this->load->view( 'templates/FHC-Header', array( 'title' => 'Lehrauftrag annehmen', - 'jquery' => true, - 'jqueryui' => true, - 'jquerycheckboxes' => true, - 'bootstrap' => true, - 'fontawesome' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'jquerycheckboxes1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, 'sbadmintemplate' => false, - 'tabulator' => true, - 'momentjs' => true, + 'tabulator4' => true, + 'momentjs2' => true, 'ajaxlib' => true, 'dialoglib' => true, 'tablewidget' => true, diff --git a/application/views/lehre/lehrauftrag/approveLehrauftrag.php b/application/views/lehre/lehrauftrag/approveLehrauftrag.php index 7e0c062bf..fe7022ad6 100644 --- a/application/views/lehre/lehrauftrag/approveLehrauftrag.php +++ b/application/views/lehre/lehrauftrag/approveLehrauftrag.php @@ -3,14 +3,14 @@ $this->load->view( 'templates/FHC-Header', array( 'title' => 'Lehrauftrag erteilen', - 'jquery' => true, - 'jqueryui' => true, - 'jquerycheckboxes' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, - 'tabulator' => true, - 'momentjs' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'jquerycheckboxes1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, + 'tabulator4' => true, + 'momentjs2' => true, 'ajaxlib' => true, 'dialoglib' => true, 'tablewidget' => true, diff --git a/application/views/lehre/lehrauftrag/orderLehrauftrag.php b/application/views/lehre/lehrauftrag/orderLehrauftrag.php index 023df1ac7..3a5e955e2 100644 --- a/application/views/lehre/lehrauftrag/orderLehrauftrag.php +++ b/application/views/lehre/lehrauftrag/orderLehrauftrag.php @@ -3,14 +3,14 @@ $this->load->view( 'templates/FHC-Header', array( 'title' => 'Lehrauftrag bestellen', - 'jquery' => true, - 'jqueryui' => true, - 'jquerycheckboxes' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, - 'tabulator' => true, - 'momentjs' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'jquerycheckboxes1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, + 'tabulator4' => true, + 'momentjs2' => true, 'ajaxlib' => true, 'dialoglib' => true, 'tablewidget' => true, diff --git a/application/views/lehre/lvplanung/adminZeitverfuegbarkeit.php b/application/views/lehre/lvplanung/adminZeitverfuegbarkeit.php index 893a9c760..321cc7d60 100644 --- a/application/views/lehre/lvplanung/adminZeitverfuegbarkeit.php +++ b/application/views/lehre/lvplanung/adminZeitverfuegbarkeit.php @@ -3,16 +3,16 @@ $this->load->view( 'templates/FHC-Header', array( 'title' => 'Zeitverfuegbarkeit verwalten', - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'momentjs' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'momentjs2' => true, 'ajaxlib' => true, - 'tabulator' => true, + 'tabulator4' => true, 'tablewidget' => true, 'navigationwidget' => true, - 'sbadmintemplate' => true, + 'sbadmintemplate3' => true, 'phrases' => array( 'global' => array( 'bis', diff --git a/application/views/lehre/pruefungsprotokoll.php b/application/views/lehre/pruefungsprotokoll.php index 6e0404e1e..c6f75bd1c 100644 --- a/application/views/lehre/pruefungsprotokoll.php +++ b/application/views/lehre/pruefungsprotokoll.php @@ -3,13 +3,13 @@ $this->load->view( 'templates/FHC-Header', array( 'title' => 'Pruefungsprotokoll', - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, 'dialoglib' => true, 'ajaxlib' => true, - 'sbadmintemplate' => true, + 'sbadmintemplate3' => true, 'phrases' => array( 'abschlusspruefung' => array( 'freigegebenAm', diff --git a/application/views/lehre/pruefungsprotokollUebersicht.php b/application/views/lehre/pruefungsprotokollUebersicht.php index c7de8fcd0..6c347b3d0 100644 --- a/application/views/lehre/pruefungsprotokollUebersicht.php +++ b/application/views/lehre/pruefungsprotokollUebersicht.php @@ -3,12 +3,12 @@ 'templates/FHC-Header', array( 'title' => 'Prüfungsprotokoll', - 'jquery' => true, - 'jqueryui' => true, - 'jquerycheckboxes' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'tablesorter' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'jquerycheckboxes1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'tablesorter2' => true, 'ajaxlib' => true, 'dialoglib' => true, 'tablewidget' => true, diff --git a/application/views/organisation/reihungstest/reihungstest.php b/application/views/organisation/reihungstest/reihungstest.php index 2ffbfc38f..357c11c10 100644 --- a/application/views/organisation/reihungstest/reihungstest.php +++ b/application/views/organisation/reihungstest/reihungstest.php @@ -3,12 +3,12 @@ 'templates/FHC-Header', array( 'title' => 'Reihungstest', - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, - 'tablesorter' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, + 'tablesorter2' => true, 'ajaxlib' => true, 'filterwidget' => true, 'navigationwidget' => true, diff --git a/application/views/organisation/studienjahrEdit.php b/application/views/organisation/studienjahrEdit.php index df0397cdf..36f036d7f 100644 --- a/application/views/organisation/studienjahrEdit.php +++ b/application/views/organisation/studienjahrEdit.php @@ -1,6 +1,6 @@ load->view('templates/header', array('title' => 'StudienjahrEdit', 'jquery' => true)); +$this->load->view('templates/header', array('title' => 'StudienjahrEdit', 'jquery3' => true)); ?>
diff --git a/application/views/person/bpk/bpkDetails.php b/application/views/person/bpk/bpkDetails.php index e771cb7f5..3fdca9f95 100644 --- a/application/views/person/bpk/bpkDetails.php +++ b/application/views/person/bpk/bpkDetails.php @@ -3,14 +3,14 @@ 'templates/FHC-Header', array( 'title' => 'bPK Details', - 'jquery' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'jqueryui' => true, + 'jquery3' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'jqueryui1' => true, 'ajaxlib' => true, - 'tablesorter' => true, - 'tinymce' => true, - 'sbadmintemplate' => true, + 'tablesorter2' => true, + 'tinymce4' => true, + 'sbadmintemplate3' => true, 'addons' => true, 'navigationwidget' => true, 'customCSSs' => array( diff --git a/application/views/person/bpk/bpkwartung.php b/application/views/person/bpk/bpkwartung.php index 53450a9d8..f6283ee3b 100644 --- a/application/views/person/bpk/bpkwartung.php +++ b/application/views/person/bpk/bpkwartung.php @@ -3,12 +3,12 @@ 'templates/FHC-Header', array( 'title' => 'bPK Wartung', - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, - 'tablesorter' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, + 'tablesorter2' => true, 'ajaxlib' => true, 'filterwidget' => true, 'navigationwidget' => true, diff --git a/application/views/person/gradelist/gradelist.php b/application/views/person/gradelist/gradelist.php index 9ae485c02..daf66708b 100644 --- a/application/views/person/gradelist/gradelist.php +++ b/application/views/person/gradelist/gradelist.php @@ -3,10 +3,10 @@ 'templates/FHC-Header', array( 'title' => 'Gradelist', - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, 'ajaxlib' => true, 'customCSSs' => array( 'public/css/tools/gradelist.css', diff --git a/application/views/system/fas_udf.php b/application/views/system/fas_udf.php index e6fa396cf..bd314b4a8 100644 --- a/application/views/system/fas_udf.php +++ b/application/views/system/fas_udf.php @@ -3,15 +3,15 @@ 'templates/FHC-Header', array( 'title' => 'InfocenterDetails', - 'jquery' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'jqueryui' => true, + 'jquery3' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'jqueryui1' => true, 'dialoglib' => true, 'ajaxlib' => true, 'udfs' => true, 'widgets' => true, - 'sbadmintemplate' => true, + 'sbadmintemplate3' => true, 'customCSSs' => array( 'public/css/sbadmin2/admintemplate.css' ), diff --git a/application/views/system/infocenter/infocenter.php b/application/views/system/infocenter/infocenter.php index 38e644846..47c154d81 100644 --- a/application/views/system/infocenter/infocenter.php +++ b/application/views/system/infocenter/infocenter.php @@ -1,31 +1,29 @@ load->view( - 'templates/FHC-Header', - array( - 'title' => 'Info Center', - 'jquery' => true, - 'jqueryui' => true, - 'jquerycheckboxes' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, - 'tablesorter' => true, - 'ajaxlib' => true, - 'filterwidget' => true, - 'navigationwidget' => true, - 'dialoglib' => true, - 'phrases' => array( - 'person' => array('vorname', 'nachname'), - 'global' => array('mailAnXversandt'), - 'ui' => array('bitteEintragWaehlen') - ), - 'customCSSs' => array('public/css/sbadmin2/tablesort_bootstrap.css', 'public/css/infocenter/infocenterPersonDataset.css'), - 'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/infocenterPersonDataset.js') - ) + $includesArray = array( + 'title' => 'Info Center', + 'jquery3' => true, + 'jqueryui1' => true, + 'jquerycheckboxes1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, + 'tablesorter2' => true, + 'ajaxlib' => true, + 'bootstrapper' => true, + 'filterwidget' => true, + 'navigationwidget' => true, + 'dialoglib' => true, + 'phrases' => array( + 'person' => array('vorname', 'nachname'), + 'global' => array('mailAnXversandt'), + 'ui' => array('bitteEintragWaehlen') + ), + 'customCSSs' => array('public/css/sbadmin2/tablesort_bootstrap.css', 'public/css/infocenter/infocenterPersonDataset.css') ); + + $this->load->view('templates/FHC-Header', $includesArray); ?> -
widgetlib->widget('NavigationWidget'); ?> @@ -46,6 +44,6 @@
- -load->view('templates/FHC-Footer'); ?> +load->view('templates/FHC-Footer', $includesArray); ?> + diff --git a/application/views/system/infocenter/infocenterAbgewiesen.php b/application/views/system/infocenter/infocenterAbgewiesen.php index 8e946e573..55987a3bd 100644 --- a/application/views/system/infocenter/infocenterAbgewiesen.php +++ b/application/views/system/infocenter/infocenterAbgewiesen.php @@ -3,13 +3,13 @@ 'templates/FHC-Header', array( 'title' => 'Info Center', - 'jquery' => true, - 'jqueryui' => true, - 'jquerycheckboxes' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, - 'tablesorter' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'jquerycheckboxes1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, + 'tablesorter2' => true, 'ajaxlib' => true, 'filterwidget' => true, 'navigationwidget' => true, diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php index 76a371c11..158feeb2c 100644 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -1,232 +1,230 @@ load->view( - 'templates/FHC-Header', - array( - 'title' => 'InfocenterDetails', - 'jquery' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'jqueryui' => true, - 'dialoglib' => true, - 'ajaxlib' => true, - 'tablesorter' => true, - 'tinymce' => true, - 'sbadmintemplate' => true, - 'addons' => true, - 'navigationwidget' => true, - 'udfs' => true, - 'widgets' => true, - 'customCSSs' => array( - 'public/css/sbadmin2/admintemplate.css', - 'public/css/sbadmin2/tablesort_bootstrap.css', - 'public/css/infocenter/infocenterDetails.css' + $includesArray = array( + 'title' => 'InfocenterDetails', + 'jquery3' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'jqueryui1' => true, + 'dialoglib' => true, + 'ajaxlib' => true, + 'tablesorter2' => true, + 'tinymce4' => true, + 'sbadmintemplate3' => true, + 'addons' => true, + 'navigationwidget' => true, + 'udfs' => true, + 'widgets' => true, + 'customCSSs' => array( + 'public/css/sbadmin2/admintemplate.css', + 'public/css/sbadmin2/tablesort_bootstrap.css', + 'public/css/infocenter/infocenterDetails.css' + ), + 'customJSs' => array( + 'public/js/bootstrapper.js', + 'public/js/tablesort/tablesort.js', + 'public/js/infocenter/messageList.js', + 'public/js/infocenter/infocenterDetails.js', + 'public/js/infocenter/zgvUeberpruefung.js', + 'public/js/infocenter/docUeberpruefung.js' + ), + 'phrases' => array( + 'infocenter' => array( + 'notizHinzufuegen', + 'notizAendern', + 'bewerberParken', + 'bewerberAusparken', + 'nichtsZumAusparken', + 'fehlerBeimAusparken', + 'fehlerBeimParken', + 'bewerberGeparktBis', + 'bewerberOnHold', + 'bewerberOnHoldEntfernen', + 'bewerberOnHoldBis', + 'nichtsZumEntfernen', + 'fehlerBeimEntfernen', + 'rueckstelldatumUeberschritten', + 'parkenZurueckstellenInfo', + 'zgvInPruefung', + 'zgvErfuellt', + 'zgvNichtErfuellt', + 'zgvErfuelltPruefung', + 'datumUngueltig', + 'nachreichDatumNichtVergangenheit' ), - 'customJSs' => array( - 'public/js/bootstrapper.js', - 'public/js/tablesort/tablesort.js', - 'public/js/infocenter/messageList.js', - 'public/js/infocenter/infocenterDetails.js', - 'public/js/infocenter/zgvUeberpruefung.js', - 'public/js/infocenter/docUeberpruefung.js' + 'ui' => array( + 'gespeichert', + 'fehlerBeimSpeichern' ), - 'phrases' => array( - 'infocenter' => array( - 'notizHinzufuegen', - 'notizAendern', - 'bewerberParken', - 'bewerberAusparken', - 'nichtsZumAusparken', - 'fehlerBeimAusparken', - 'fehlerBeimParken', - 'bewerberGeparktBis', - 'bewerberOnHold', - 'bewerberOnHoldEntfernen', - 'bewerberOnHoldBis', - 'nichtsZumEntfernen', - 'fehlerBeimEntfernen', - 'rueckstelldatumUeberschritten', - 'parkenZurueckstellenInfo', - 'zgvInPruefung', - 'zgvErfuellt', - 'zgvNichtErfuellt', - 'zgvErfuelltPruefung', - 'datumUngueltig', - 'nachreichDatumNichtVergangenheit' - ), - 'ui' => array( - 'gespeichert', - 'fehlerBeimSpeichern' - ), - 'global' => array( - 'bis', - 'zeilen' - ) + 'global' => array( + 'bis', + 'zeilen' ) ) ); + + $this->load->view('templates/FHC-Header', $includesArray); ?> - -
- - widgetlib->widget('NavigationWidget'); ?> - -
-
- -
-
- -
-
-
- p->t('global', 'wirdBearbeitetVon').': '; - echo $lockedby; - if ($origin_page == 'index'): - $unlockpath = 'unlockPerson/'.$stammdaten->person_id; - $unlockpath .= '?fhc_controller_id='.$fhc_controller_id; - $unlockpath .= '&filter_id='.$prev_filter_id; - ?> -    - -  p->t('ui', 'freigeben')) ?> - +
+ + widgetlib->widget('NavigationWidget'); ?> + +
+
+ +
+
+ +
+
+
+ p->t('global', 'wirdBearbeitetVon').': '; + echo $lockedby; + if ($origin_page == 'index'): + $unlockpath = 'unlockPerson/'.$stammdaten->person_id; + $unlockpath .= '?fhc_controller_id='.$fhc_controller_id; + $unlockpath .= '&filter_id='.$prev_filter_id; + ?> +    + +  p->t('ui', 'freigeben')) ?> + + + +   - -   - +
-
- -
-

- p->t('global', 'bewerberVorhanden') . ':'; ?> -

-
- person_id . '
'; - } - ?> + +
+

+ p->t('global', 'bewerberVorhanden') . ':'; ?> +

+
+ person_id . '
'; + } + ?> +
+
- -
- -
-
-
-
-
-
-

p->t('global', 'stammdaten')) ?>

-
-
- load->view('system/infocenter/stammdaten.php'); ?> - load->view('system/infocenter/anmerkungenZurBewerbung.php'); ?> -
-
-
-
-
-
-
-
-
- -
-

- p->t('infocenter', 'dokumentenpruefung')) ?> -

-
-
- load->view('system/infocenter/dokpruefung.php'); ?> -
- load->view('system/infocenter/dokNachzureichend.php'); ?> + +
+
+
+
+
+
+

p->t('global', 'stammdaten')) ?>

-
-
-
-
-
-
-
-
-
-
- -

- p->t('infocenter', 'zgv').' - '.ucfirst($this->p->t('lehre', 'pruefung'))?> -

-
-
- load->view('system/infocenter/zgvpruefungen.php'); ?> -
-
-
-
-
-
-
-
-
-
- -

- p->t('global', 'nachrichten')) ?> -

-
-
-
- load->view('system/infocenter/messageList.php', $messages); - ?> +
+ load->view('system/infocenter/stammdaten.php'); ?> + load->view('system/infocenter/anmerkungenZurBewerbung.php'); ?> +
+
+
+
+
+
+
+
+
+ +
+

+ p->t('infocenter', 'dokumentenpruefung')) ?> +

+
+
+ load->view('system/infocenter/dokpruefung.php'); ?> +
+ load->view('system/infocenter/dokNachzureichend.php'); ?> +
+
+
+
+
+
+
+
+
+
+
+ +

+ p->t('infocenter', 'zgv').' - '.ucfirst($this->p->t('lehre', 'pruefung'))?> +

+
+
+ load->view('system/infocenter/zgvpruefungen.php'); ?> +
+
+
+
+
+
+
+
+
+
+ +

+ p->t('global', 'nachrichten')) ?> +

+
+
+
+ load->view('system/infocenter/messageList.php', $messages); + ?> +
-
- -
-
-
-
-
- -

- p->t('global', 'notizen')).' & '.ucfirst($this->p->t('global', 'aktivitaeten')) ?> -

-
-
-
-
-
- load->view('system/infocenter/addNotiz.php'); ?> +
+
+
+
+
+
+ +

+ p->t('global', 'notizen')).' & '.ucfirst($this->p->t('global', 'aktivitaeten')) ?> +

+
+
+
+
+
+ load->view('system/infocenter/addNotiz.php'); ?> +
+
+ load->view('system/infocenter/notizen.php'); ?> +
-
- load->view('system/infocenter/notizen.php'); ?> -
-
-
-
-
- load->view('system/infocenter/logs.php'); ?> -
-
-
-
-
-
-
- -
-
-
- - +
+
+
+ load->view('system/infocenter/logs.php'); ?> +
+
+
+
+
+
+
+ +
+
+ + + +load->view('templates/FHC-Footer', $includesArray); ?> -load->view('templates/FHC-Footer'); ?> diff --git a/application/views/system/infocenter/infocenterFreigegeben.php b/application/views/system/infocenter/infocenterFreigegeben.php index 4855e5cd6..d3e44ea95 100644 --- a/application/views/system/infocenter/infocenterFreigegeben.php +++ b/application/views/system/infocenter/infocenterFreigegeben.php @@ -3,13 +3,13 @@ 'templates/FHC-Header', array( 'title' => 'Info Center', - 'jquery' => true, - 'jqueryui' => true, - 'jquerycheckboxes' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, - 'tablesorter' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'jquerycheckboxes1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, + 'tablesorter2' => true, 'ajaxlib' => true, 'filterwidget' => true, 'navigationwidget' => true, diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviert.php b/application/views/system/infocenter/infocenterReihungstestAbsolviert.php index f2d838fac..71a7a1d5e 100644 --- a/application/views/system/infocenter/infocenterReihungstestAbsolviert.php +++ b/application/views/system/infocenter/infocenterReihungstestAbsolviert.php @@ -3,13 +3,13 @@ 'templates/FHC-Header', array( 'title' => 'Info Center', - 'jquery' => true, - 'jqueryui' => true, - 'jquerycheckboxes' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, - 'tablesorter' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'jquerycheckboxes1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, + 'tablesorter2' => true, 'ajaxlib' => true, 'filterwidget' => true, 'navigationwidget' => true, diff --git a/application/views/system/infocenter/infocenterZgvDetails.php b/application/views/system/infocenter/infocenterZgvDetails.php index 62fefbec8..8faa5aa63 100644 --- a/application/views/system/infocenter/infocenterZgvDetails.php +++ b/application/views/system/infocenter/infocenterZgvDetails.php @@ -3,15 +3,15 @@ 'templates/FHC-Header', array( 'title' => 'InfocenterZgvDetails', - 'jquery' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'jqueryui' => true, + 'jquery3' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'jqueryui1' => true, 'dialoglib' => true, 'ajaxlib' => true, - 'tablesorter' => true, - 'tinymce' => true, - 'sbadmintemplate' => true, + 'tablesorter2' => true, + 'tinymce4' => true, + 'sbadmintemplate3' => true, 'addons' => true, 'navigationwidget' => true, 'udfs' => true, diff --git a/application/views/system/infocenter/infocenterZgvUeberpruefung.php b/application/views/system/infocenter/infocenterZgvUeberpruefung.php index e0b8f9eae..7b285edb2 100644 --- a/application/views/system/infocenter/infocenterZgvUeberpruefung.php +++ b/application/views/system/infocenter/infocenterZgvUeberpruefung.php @@ -3,13 +3,13 @@ $this->load->view( 'templates/FHC-Header', array( 'title' => 'Info Center', - 'jquery' => true, - 'jqueryui' => true, - 'jquerycheckboxes' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, - 'tablesorter' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'jquerycheckboxes1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, + 'tablesorter2' => true, 'ajaxlib' => true, 'filterwidget' => true, 'navigationwidget' => true, diff --git a/application/views/system/infocenter/studiengangZgvInfo.php b/application/views/system/infocenter/studiengangZgvInfo.php index 1b699d634..e508bd505 100644 --- a/application/views/system/infocenter/studiengangZgvInfo.php +++ b/application/views/system/infocenter/studiengangZgvInfo.php @@ -3,10 +3,10 @@ $this->load->view( 'templates/FHC-Header', array( 'title' => 'ZGV Info', - 'jquery' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, + 'jquery3' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, 'customCSSs' => 'public/css/sbadmin2/admintemplate_contentonly.css' ) ); diff --git a/application/views/system/issues/issues.php b/application/views/system/issues/issues.php index 9812528d5..5e8efd547 100644 --- a/application/views/system/issues/issues.php +++ b/application/views/system/issues/issues.php @@ -3,13 +3,13 @@ $this->load->view( 'templates/FHC-Header', array( 'title' => 'Fehler Monitoring', - 'jquery' => true, - 'jqueryui' => true, - 'jquerycheckboxes' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, - 'tablesorter' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'jquerycheckboxes1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, + 'tablesorter2' => true, 'ajaxlib' => true, 'filterwidget' => true, 'navigationwidget' => true, diff --git a/application/views/system/jq/jobsQueueViewer.php b/application/views/system/jq/jobsQueueViewer.php index 6d92d610b..bf4e16645 100644 --- a/application/views/system/jq/jobsQueueViewer.php +++ b/application/views/system/jq/jobsQueueViewer.php @@ -3,12 +3,12 @@ 'templates/FHC-Header', array( 'title' => 'Jobs Queue Viewer', - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, - 'tablesorter' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, + 'tablesorter2' => true, 'ajaxlib' => true, 'filterwidget' => true, 'navigationwidget' => true, diff --git a/application/views/system/login/usernamePassword.php b/application/views/system/login/usernamePassword.php index 944212b49..ba6062b46 100644 --- a/application/views/system/login/usernamePassword.php +++ b/application/views/system/login/usernamePassword.php @@ -3,11 +3,11 @@ 'templates/FHC-Header', array( 'title' => 'Login', - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, 'ajaxlib' => true, 'dialoglib' => true, 'customCSSs' => 'public/css/Login.css', diff --git a/application/views/system/logs/logsViewer.php b/application/views/system/logs/logsViewer.php index 86423006b..2718480e9 100644 --- a/application/views/system/logs/logsViewer.php +++ b/application/views/system/logs/logsViewer.php @@ -1,28 +1,26 @@ load->view( - 'templates/FHC-Header', - array( - 'title' => 'Logs Viewer', - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, - 'tablesorter' => true, - 'ajaxlib' => true, - 'filterwidget' => true, - 'navigationwidget' => true, - 'phrases' => array( - 'global' => array('mailAnXversandt'), - 'ui' => array('bitteEintragWaehlen') - ), - 'customCSSs' => 'public/css/sbadmin2/tablesort_bootstrap.css', - 'customJSs' => array('public/js/bootstrapper.js') - ) + $includesArray = array( + 'title' => 'Logs Viewer', + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, + 'tablesorter2' => true, + 'ajaxlib' => true, + 'bootstrapper' => true, // to be used only if you know what you are doing! + 'filterwidget' => true, + 'navigationwidget' => true, + 'phrases' => array( + 'global' => array('mailAnXversandt'), + 'ui' => array('bitteEintragWaehlen') + ), + 'customCSSs' => 'public/css/sbadmin2/tablesort_bootstrap.css' ); + + $this->load->view('templates/FHC-Header', $includesArray); ?> -
widgetlib->widget('NavigationWidget'); ?> @@ -42,6 +40,6 @@
- -load->view('templates/FHC-Footer'); ?> +load->view('templates/FHC-Footer', $includesArray); ?> + diff --git a/application/views/system/messages/ajaxRead.php b/application/views/system/messages/ajaxRead.php index f7d60a68d..2cb88708e 100644 --- a/application/views/system/messages/ajaxRead.php +++ b/application/views/system/messages/ajaxRead.php @@ -3,16 +3,16 @@ 'templates/FHC-Header', array( 'title' => 'Read personal messages', - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, - 'momentjs' => true, - 'tabulator' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, + 'momentjs2' => true, + 'tabulator4' => true, 'ajaxlib' => true, 'dialoglib' => true, - 'tinymce' => true, + 'tinymce4' => true, 'phrases' => array('global', 'ui'), 'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messaging/message.css'), 'customJSs' => array('public/js/bootstrapper.js', 'public/js/messaging/read.js') diff --git a/application/views/system/messages/ajaxWrite.php b/application/views/system/messages/ajaxWrite.php index de3d79806..3b1582f22 100644 --- a/application/views/system/messages/ajaxWrite.php +++ b/application/views/system/messages/ajaxWrite.php @@ -3,14 +3,14 @@ 'templates/FHC-Header', array( 'title' => 'Write a new message', - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, 'ajaxlib' => true, 'dialoglib' => true, - 'tinymce' => true, + 'tinymce4' => true, 'phrases' => array('global', 'ui'), 'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messaging/message.css'), 'customJSs' => array('public/js/bootstrapper.js', 'public/js/messaging/write.js') diff --git a/application/views/system/messages/ajaxWriteReply.php b/application/views/system/messages/ajaxWriteReply.php index 3721565e9..0a496c93e 100644 --- a/application/views/system/messages/ajaxWriteReply.php +++ b/application/views/system/messages/ajaxWriteReply.php @@ -3,14 +3,14 @@ 'templates/FHC-Header', array( 'title' => 'Reply to a message', - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, 'ajaxlib' => true, 'dialoglib' => true, - 'tinymce' => true, + 'tinymce4' => true, 'phrases' => array('global', 'ui'), 'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messaging/message.css'), 'customJSs' => array('public/js/bootstrapper.js', 'public/js/messaging/writeReply.js') diff --git a/application/views/system/messages/htmlMessageSentError.php b/application/views/system/messages/htmlMessageSentError.php index 90191fcf0..f8a0f8491 100644 --- a/application/views/system/messages/htmlMessageSentError.php +++ b/application/views/system/messages/htmlMessageSentError.php @@ -3,10 +3,10 @@ 'templates/FHC-Header', array( 'title' => 'Message sent failure - Fehler beim Senden der Nachricht', - 'jquery' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, + 'jquery3' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, 'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messaging/message.css') ) ); diff --git a/application/views/system/messages/htmlMessageSentSuccess.php b/application/views/system/messages/htmlMessageSentSuccess.php index 48409a5f4..91eeab519 100644 --- a/application/views/system/messages/htmlMessageSentSuccess.php +++ b/application/views/system/messages/htmlMessageSentSuccess.php @@ -3,10 +3,10 @@ 'templates/FHC-Header', array( 'title' => 'Message sent successfully - Nachricht erfolgreich versandt!', - 'jquery' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, + 'jquery3' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, 'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messaging/message.css') ) ); diff --git a/application/views/system/messages/htmlRead.php b/application/views/system/messages/htmlRead.php index 5413af9f4..35e162b70 100644 --- a/application/views/system/messages/htmlRead.php +++ b/application/views/system/messages/htmlRead.php @@ -3,10 +3,10 @@ 'templates/FHC-Header', array( 'title' => 'Read message - Lies die Nachricht', - 'jquery' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, + 'jquery3' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, 'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messaging/message.css') ) ); diff --git a/application/views/system/messages/htmlWriteReply.php b/application/views/system/messages/htmlWriteReply.php index fa3390bfa..9106d802b 100644 --- a/application/views/system/messages/htmlWriteReply.php +++ b/application/views/system/messages/htmlWriteReply.php @@ -3,11 +3,11 @@ 'templates/FHC-Header', array( 'title' => 'Reply to a message', - 'jquery' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'tinymce' => true, - 'sbadmintemplate' => true, + 'jquery3' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'tinymce4' => true, + 'sbadmintemplate3' => true, 'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messaging/message.css'), 'customJSs' => array('public/js/bootstrapper.js', 'public/js/messaging/messageWriteReply.js') ) diff --git a/application/views/system/messages/htmlWriteTemplate.php b/application/views/system/messages/htmlWriteTemplate.php index 95ab12630..4c0c0baba 100644 --- a/application/views/system/messages/htmlWriteTemplate.php +++ b/application/views/system/messages/htmlWriteTemplate.php @@ -3,13 +3,13 @@ 'templates/FHC-Header', array( 'title' => 'Write a new message or reply using templates', - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, 'ajaxlib' => true, - 'fontawesome' => true, - 'tinymce' => true, - 'sbadmintemplate' => true, + 'fontawesome4' => true, + 'tinymce4' => true, + 'sbadmintemplate3' => true, 'dialoglib' => true, 'widgets' => true, 'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messaging/message.css'), diff --git a/application/views/system/phrases/phraseinhaltEdit.php b/application/views/system/phrases/phraseinhaltEdit.php index 594e8d9dd..388f1dd06 100644 --- a/application/views/system/phrases/phraseinhaltEdit.php +++ b/application/views/system/phrases/phraseinhaltEdit.php @@ -1,5 +1,5 @@ load->view('templates/header', array('title' => 'TemplateEdit', 'jquery' => true, 'textile' => true)); + $this->load->view('templates/header', array('title' => 'TemplateEdit', 'jquery3' => true, 'textile' => true)); ?>
diff --git a/application/views/system/vorlage/templatetextEdit.php b/application/views/system/vorlage/templatetextEdit.php index 40ebd1599..42efc1519 100644 --- a/application/views/system/vorlage/templatetextEdit.php +++ b/application/views/system/vorlage/templatetextEdit.php @@ -1,5 +1,5 @@ load->view('templates/header', array('title' => 'VorlageEdit', 'tinymce' => true, 'jsonforms' => true)); + $this->load->view('templates/header', array('title' => 'VorlageEdit', 'tinymce4' => true, 'jsonforms' => true)); ?>
diff --git a/application/views/templates/FHC-Common.php b/application/views/templates/FHC-Common.php new file mode 100644 index 000000000..cfbec86db --- /dev/null +++ b/application/views/templates/FHC-Common.php @@ -0,0 +1,44 @@ + +config->item('index_page'); + $calledPath = $this->router->directory.$this->router->class; + $calledMethod = $this->router->method; + + // By default set the parameters to null + $customJSs = isset($customJSs) ? $customJSs : null; + + // -------------------------------------------------------------------------------------------------------- + // Javascripts + + // Generates the global object to pass useful parameters to other javascripts + // NOTE: must be called before any other JS include + generateJSDataStorageObject($indexPage, $calledPath, $calledMethod); + + // Generates the global object to pass phrases to javascripts + // NOTE: must be called before including the PhrasesLib.js + if ($phrases != null) generateJSPhrasesStorageObject($phrases); + + // -------------------------------------------------------------------------------------------------------- + // From vendor folder + + // jQuery V3 + if ($jquery3 === true) generateJSsInclude('vendor/components/jquery/jquery.min.js'); + + // jQuery UI + if ($jqueryui1 === true) + { + generateJSsInclude('vendor/components/jqueryui/jquery-ui.min.js'); + generateJSsInclude('vendor/components/jqueryui/ui/i18n/datepicker-de.js'); // datepicker german language file + } + + // jQuery checkboxes + // NOTE: keep it after jQuery includes + if ($jquerycheckboxes1 === true) generateJSsInclude('vendor/rmariuzzo/jquery-checkboxes/dist/jquery.checkboxes-1.0.7.min.js'); + + // jQuery treetable + // NOTE: keep it after jQuery includes + if ($jquerytreetable3 === true) generateJSsInclude('vendor/ludo/jquery-treetable/jquery.treetable.js'); + + // Bootstrap 3 JS + if ($bootstrap3 === true) generateJSsInclude('vendor/twbs/bootstrap3/dist/js/bootstrap.min.js'); + + // Bootstrap 5 JS + if ($bootstrap5 === true) generateJSsInclude('vendor/twbs/bootstrap5/js/bootstrap.min.js'); + + // Securimage JS + if ($captcha3 === true) generateJSsInclude('vendor/dapphp/securimage/securimage.js'); + + // Moment JS + if ($momentjs2 === true) + { + generateJSsInclude('vendor/moment/momentjs/min/moment.min.js'); + generateJSsInclude('vendor/moment/momentjs/locale/de-at.js'); + generateJSsInclude('vendor/moment/momentjs/locale/en-ie.js'); + } + + // PivotUI JS + if ($pivotui2 === true) generateJSsInclude('vendor/nicolaskruchten/pivottable/dist/pivot.min.js'); + + // SB Admin 2 template JS + if ($sbadmintemplate3 === true) + { + generateJSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/vendor/metisMenu/metisMenu.min.js'); + generateJSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/dist/js/sb-admin-2.min.js'); + generateBackwardCompatibleJSMsIe('vendor/afarkas/html5shiv/dist/html5shiv.min.js'); + generateBackwardCompatibleJSMsIe('vendor/scottjehl/Respond/dest/respond.min.js'); + } + + // Table sorter JS + if ($tablesorter2 === true) + { + generateJSsInclude('vendor/mottie/tablesorter/dist/js/jquery.tablesorter.min.js'); + generateJSsInclude('vendor/mottie/tablesorter/dist/js/jquery.tablesorter.widgets.min.js'); + generateJSsInclude('vendor/mottie/tablesorter/dist/js/extras/jquery.tablesorter.pager.min.js'); + } + + // Tabulator 4 JS + if ($tabulator4 === true) + { + generateJSsInclude('vendor/olifolkerd/tabulator4/dist/js/tabulator.min.js'); + generateJSsInclude('vendor/olifolkerd/tabulator4/dist/js/jquery_wrapper.min.js'); + } + + // Tabulator 5 JS + if ($tabulator5 === true) generateJSsInclude('vendor/olifolkerd/tabulator5/dist/js/tabulator.min.js'); + + // Tinymce 4 JS + if ($tinymce4 === true) generateJSsInclude('vendor/tinymce/tinymce4/tinymce.min.js'); + + // Tinymce 5 JS + if ($tinymce5 === true) generateJSsInclude('vendor/tinymce/tinymce5/tinymce.min.js'); + + // Vue 3 JS + if ($vue3 === true) generateJSsInclude('vendor/vuejs/vuejs3/vue.global.prod.js'); + + // -------------------------------------------------------------------------------------------------------- + // From public folder + + // DialogLib JS + // NOTE: must be called before including others JS libraries that use it + if ($dialoglib === true) generateJSsInclude('public/js/DialogLib.js'); + + // AjaxLib JS + // NOTE: must be called before including others JS libraries that use it + if ($ajaxlib === true) generateJSsInclude('public/js/AjaxLib.js'); + + // Bootstrapper include + // NOTE: to be used only if you know what you are doing! + if ($bootstrapper === true) generateJSsInclude('public/js/bootstrapper.js'); + + // VUE Navigation Component JS + if ($navigationcomponent === true) generateJSsInclude('public/js/components/Navigation.js'); + + // NavigationWidget JS + if ($navigationwidget === true) generateJSsInclude('public/js/NavigationWidget.js'); + + // VUE Filter Component JS + if ($filtercomponent === true) generateJSsInclude('public/js/components/Filter.js'); + + // FilterWidget JS + if ($filterwidget === true) generateJSsInclude('public/js/FilterWidget.js'); + + // PhrasesLib JS + if ($phrases != null) generateJSsInclude('public/js/PhrasesLib.js'); + + // VUE Table Component JS + if ($tablecomponent === true) generateJSsInclude('public/js/components/Table.js'); + + // TableWidget JS + if ($tablewidget === true) generateJSsInclude('public/js/TableWidget.js'); + + // User Defined Fields + if ($udfs === true) generateJSsInclude('public/js/UDFWidget.js'); + + // Load addon hooks JS + // NOTE: keep it as the last but one + if ($addons === true) generateAddonsJSsInclude($calledPath.'/'.$calledMethod); + + // Eventually required JS + // NOTE: keep it as the latest + generateJSsInclude($customJSs); +?> + + + diff --git a/application/views/templates/FHC-Header.php b/application/views/templates/FHC-Header.php index 8620f8d1c..eed8b6590 100644 --- a/application/views/templates/FHC-Header.php +++ b/application/views/templates/FHC-Header.php @@ -1,45 +1,17 @@ config->item('index_page'); - $calledPath = $this->router->directory.$this->router->class; - $calledMethod = $this->router->method; + // Defines the includes variables + require('FHC-Common.php'); + // All the following variables are used only in this view // By default set the parameters to null $title = isset($title) ? $title : null; $refresh = isset($refresh) ? $refresh : null; $customCSSs = isset($customCSSs) ? $customCSSs : null; - $customJSs = isset($customJSs) ? $customJSs : null; - $phrases = isset($phrases) ? $phrases : null; - - // By default set the parameters to false - $addons = isset($addons) ? $addons : false; - $ajaxlib = isset($ajaxlib) ? $ajaxlib : false; - $bootstrap = isset($bootstrap) ? $bootstrap : false; - $captcha = isset($captcha) ? $captcha : false; - $dialoglib = isset($dialoglib) ? $dialoglib : false; - $filterwidget = isset($filterwidget) ? $filterwidget : false; - $fontawesome = isset($fontawesome) ? $fontawesome : false; - $jquery = isset($jquery) ? $jquery : false; - $jqueryui = isset($jqueryui) ? $jqueryui : false; - $jquerycheckboxes = isset($jquerycheckboxes) ? $jquerycheckboxes : false; - $jquerytreetable = isset($jquerytreetable) ? $jquerytreetable : false; - $momentjs = isset($momentjs) ? $momentjs : false; - $navigationwidget = isset($navigationwidget) ? $navigationwidget : false; - $pivotui = isset($pivotui) ? $pivotui : false; - $sbadmintemplate = isset($sbadmintemplate) ? $sbadmintemplate : false; - $tablesorter = isset($tablesorter) ? $tablesorter : false; - $tablewidget = isset($tablewidget) ? $tablewidget : false; - $tabulator = isset($tabulator) ? $tabulator : false; - $tinymce = isset($tinymce) ? $tinymce : false; - $udfs = isset($udfs) ? $udfs : false; - $widgets = isset($widgets) ? $widgets : false; ?> - + @@ -58,47 +30,64 @@ // -------------------------------------------------------------------------------------------------------- // From vendor folder - // jQuery UI CSS - if ($jqueryui === true) generateCSSsInclude('vendor/components/jqueryui/themes/base/jquery-ui.min.css'); + // Bootstrap 3 CSS + if ($bootstrap3 === true) generateCSSsInclude('vendor/twbs/bootstrap3/dist/css/bootstrap.min.css'); - // Bootstrap CSS - if ($bootstrap === true) generateCSSsInclude('vendor/twbs/bootstrap/dist/css/bootstrap.min.css'); + // Bootstrap 5 CSS + if ($bootstrap5 === true) generateCSSsInclude('vendor/twbs/bootstrap5/css/bootstrap.min.css'); + + // jQuery UI CSS + if ($jqueryui1 === true) generateCSSsInclude('vendor/components/jqueryui/themes/base/jquery-ui.min.css'); // jQuery treetable - if ($jquerytreetable === true) generateCSSsInclude('vendor/ludo/jquery-treetable/css/jquery.treetable.css'); + if ($jquerytreetable3 === true) generateCSSsInclude('vendor/ludo/jquery-treetable/css/jquery.treetable.css'); - // Font Awesome CSS - if ($fontawesome === true) generateCSSsInclude('vendor/components/font-awesome/css/font-awesome.min.css'); + // Font Awesome 4 CSS free icons + if ($fontawesome4 === true) generateCSSsInclude('vendor/fortawesome/font-awesome4/css/font-awesome.min.css'); + + // Font Awesome 6 CSS free icons + if ($fontawesome6 === true) + { + generateCSSsInclude('vendor/fortawesome/font-awesome6/css/fontawesome.min.css'); + generateCSSsInclude('vendor/fortawesome/font-awesome6/css/solid.min.css'); + generateCSSsInclude('vendor/fortawesome/font-awesome6/css/brands.min.css'); + } // PivotUI CSS - if ($pivotui === true) generateCSSsInclude('vendor/nicolaskruchten/pivottable/dist/pivot.min.css'); + if ($pivotui2 === true) generateCSSsInclude('vendor/nicolaskruchten/pivottable/dist/pivot.min.css'); // SB Admin 2 template CSS - if ($sbadmintemplate === true) + if ($sbadmintemplate3 === true) { generateCSSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/vendor/metisMenu/metisMenu.min.css'); generateCSSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/dist/css/sb-admin-2.min.css'); } // Securimage CSS - if ($captcha === true) generateCSSsInclude('vendor/dapphp/securimage/securimage.css'); + if ($captcha3 === true) generateCSSsInclude('vendor/dapphp/securimage/securimage.css'); // Table sorter CSS - if ($tablesorter === true) + if ($tablesorter2 === true) { generateCSSsInclude('vendor/mottie/tablesorter/dist/css/theme.default.min.css'); generateCSSsInclude('vendor/mottie/tablesorter/dist/css/jquery.tablesorter.pager.min.css'); } - // Tabulator CSS - if ($tabulator === true) + // Tabulator 4 CSS + if ($tabulator4 === true) { - generateCSSsInclude('vendor/olifolkerd/tabulator/dist/css/bootstrap/tabulator_bootstrap.min.css'); + generateCSSsInclude('vendor/olifolkerd/tabulator4/dist/css/bootstrap/tabulator_bootstrap.min.css'); generateCSSsInclude('public/css/Tabulator.css'); } - // Tinymce CSS - if ($tinymce === true) generateCSSsInclude('public/css/TinyMCE.css'); + // Tabulator 5 CSS + if ($tabulator5 === true) generateCSSsInclude('vendor/olifolkerd/tabulator5/dist/css/tabulator_bootstrap5.min.css'); + + // Tinymce 4 CSS + if ($tinymce4 === true) generateCSSsInclude('public/css/TinyMCE4.css'); + + // Tinymce 5 CSS + if ($tinymce5 === true) generateCSSsInclude('public/css/TinyMCE5.css'); // -------------------------------------------------------------------------------------------------------- // From public folder @@ -109,9 +98,15 @@ // DialogLib CSS if ($dialoglib === true) generateCSSsInclude('public/css/DialogLib.css'); + // VUE FilterWidget CSS + if ($filtercomponent === true) generateCSSsInclude('public/css/FilterComponent.css'); + // FilterWidget CSS if ($filterwidget === true) generateCSSsInclude('public/css/FilterWidget.css'); + // VUE NavigationWidget CSS + if ($navigationcomponent === true) generateCSSsInclude('public/css/NavigationComponent.css'); + // NavigationWidget CSS if ($navigationwidget === true) generateCSSsInclude('public/css/NavigationWidget.css'); @@ -120,117 +115,9 @@ // Eventually required CSS generateCSSsInclude($customCSSs); // Eventually required CSS - - - // -------------------------------------------------------------------------------------------------------- - // Javascripts - - // Generates the global object to pass useful parameters to other javascripts - // NOTE: must be called before any other JS include - generateJSDataStorageObject($indexPage, $calledPath, $calledMethod); - - // Generates the global object to pass phrases to javascripts - // NOTE: must be called before including the PhrasesLib.js - if ($phrases != null) generateJSPhrasesStorageObject($phrases); - - // -------------------------------------------------------------------------------------------------------- - // From vendor folder - - // jQuery V3 - if ($jquery === true) generateJSsInclude('vendor/components/jquery/jquery.min.js'); - - // jQuery UI - if ($jqueryui === true) - { - generateJSsInclude('vendor/components/jqueryui/jquery-ui.min.js'); - generateJSsInclude('vendor/components/jqueryui/ui/i18n/datepicker-de.js'); // datepicker german language file - } - - // jQuery checkboxes - // NOTE: keep it after jQuery includes - if ($jquerycheckboxes === true) generateJSsInclude('vendor/rmariuzzo/jquery-checkboxes/dist/jquery.checkboxes-1.0.7.min.js'); - // jQuery treetable - // NOTE: keep it after jQuery includes - if ($jquerytreetable === true) generateJSsInclude('vendor/ludo/jquery-treetable/jquery.treetable.js'); - - // Bootstrap JS - if ($bootstrap === true) generateJSsInclude('vendor/twbs/bootstrap/dist/js/bootstrap.min.js'); - - // SB Admin 2 template JS - if ($sbadmintemplate === true) - { - generateJSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/vendor/metisMenu/metisMenu.min.js'); - generateJSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/dist/js/sb-admin-2.min.js'); - generateBackwardCompatibleJSMsIe('vendor/afarkas/html5shiv/dist/html5shiv.min.js'); - generateBackwardCompatibleJSMsIe('vendor/scottjehl/Respond/dest/respond.min.js'); - } - - // Securimage JS - if ($captcha === true) generateJSsInclude('vendor/dapphp/securimage/securimage.js'); - - // Moment JS - if ($momentjs === true) - { - generateJSsInclude('vendor/moment/momentjs/min/moment.min.js'); - generateJSsInclude('vendor/moment/momentjs/locale/de-at.js'); - generateJSsInclude('vendor/moment/momentjs/locale/en-ie.js'); - } - - // PivotUI JS - if ($pivotui === true) generateJSsInclude('vendor/nicolaskruchten/pivottable/dist/pivot.min.js'); - - // Table sorter JS - if ($tablesorter === true) - { - generateJSsInclude('vendor/mottie/tablesorter/dist/js/jquery.tablesorter.min.js'); - generateJSsInclude('vendor/mottie/tablesorter/dist/js/jquery.tablesorter.widgets.min.js'); - generateJSsInclude('vendor/mottie/tablesorter/dist/js/extras/jquery.tablesorter.pager.min.js'); - } - - // Tabulator JS - if ($tabulator === true) - { - generateJSsInclude('vendor/olifolkerd/tabulator/dist/js/tabulator.min.js'); - generateJSsInclude('vendor/olifolkerd/tabulator/dist/js/jquery_wrapper.min.js'); - } - - // Tinymce JS - if ($tinymce === true) generateJSsInclude('vendor/tinymce/tinymce/tinymce.min.js'); - - // -------------------------------------------------------------------------------------------------------- - // From public folder - - // DialogLib JS - // NOTE: must be called before including others JS libraries that use it - if ($dialoglib === true) generateJSsInclude('public/js/DialogLib.js'); - - // AjaxLib JS - // NOTE: must be called before including others JS libraries that use it - if ($ajaxlib === true) generateJSsInclude('public/js/AjaxLib.js'); - - // FilterWidget JS - if ($filterwidget === true) generateJSsInclude('public/js/FilterWidget.js'); - - // NavigationWidget JS - if ($navigationwidget === true) generateJSsInclude('public/js/NavigationWidget.js'); - - // PhrasesLib JS - if ($phrases != null) generateJSsInclude('public/js/PhrasesLib.js'); - - // TableWidget JS - if ($tablewidget === true) generateJSsInclude('public/js/TableWidget.js'); - - // User Defined Fields - if ($udfs === true) generateJSsInclude('public/js/UDFWidget.js'); - - // Load addon hooks JS - // NOTE: keep it as the last but one - if ($addons === true) generateAddonsJSsInclude($calledPath.'/'.$calledMethod); - - // Eventually required JS - // NOTE: keep it as the latest - generateJSsInclude($customJSs); ?> - + + + diff --git a/composer.json b/composer.json index 540025875..f29a6b071 100644 --- a/composer.json +++ b/composer.json @@ -308,9 +308,9 @@ "type": "package", "package": { "name": "twbs/bootstrap5", - "version": "5.0.2", + "version": "5.1.3", "dist": { - "url": "https://github.com/twbs/bootstrap/releases/download/v5.0.2/bootstrap-5.0.2-dist.zip", + "url": "https://github.com/twbs/bootstrap/archive/refs/tags/v5.1.3.zip", "type": "zip" } } @@ -364,7 +364,7 @@ "tinymce/tinymce5": "5.10.*", "twbs/bootstrap3": "3.4.*", - "twbs/bootstrap5": "5.0.*", + "twbs/bootstrap5": "5.1.*", "vuejs/vuejs3": "3.2.33", diff --git a/composer.lock b/composer.lock index 5f2557632..e7e207c7d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "d12bb05ce04aaee58782e9ad4803c387", - "content-hash": "798c94bdd795a81a8bdbb43f2a09fc33", + "hash": "f35123d066def191c9f17dbbc4e78807", + "content-hash": "ddcd02108923c9169e0d3bcb3de85d70", "packages": [ { "name": "BlackrockDigital/startbootstrap-sb-admin-2", @@ -1649,10 +1649,10 @@ }, { "name": "twbs/bootstrap5", - "version": "5.0.2", + "version": "5.1.3", "dist": { "type": "zip", - "url": "https://github.com/twbs/bootstrap/releases/download/v5.0.2/bootstrap-5.0.2-dist.zip", + "url": "https://github.com/twbs/bootstrap/archive/refs/tags/v5.1.3.zip", "reference": null, "shasum": null }, diff --git a/public/css/NavigationComponent.css b/public/css/NavigationComponent.css new file mode 100644 index 000000000..64d908b02 --- /dev/null +++ b/public/css/NavigationComponent.css @@ -0,0 +1,23 @@ +.header-menu-link-entry { + font-size: 18px; + color: #5e5e5e !important; +} + +.navbar-header { + background-color: #f8f8f8; + border-color: #e7e7e7; +} + +.sidebar { + z-index: 1; + position: absolute; + width: 250px; +} + +#content { + position: inherit; + margin: 0 0 0 250px; + padding: 30px 30px; + border-left: 1px solid #e7e7e7; +} + diff --git a/public/js/bootstrapper.js b/public/js/bootstrapper.js index 6bc1372e2..91c1f2987 100644 --- a/public/js/bootstrapper.js +++ b/public/js/bootstrapper.js @@ -12,5 +12,7 @@ var Bootstrapper = { $("input[type=text], select, textarea").addClass("form-control"); $("button, input[type=button]").addClass("btn btn-default"); $("table").addClass("table-condensed"); + $("#tableDataset").addClass('table-bordered'); } -}; \ No newline at end of file +}; + From 061780a0d21c4a919db567a9453c231df048b0ec Mon Sep 17 00:00:00 2001 From: Paolo Date: Tue, 24 May 2022 09:45:31 +0200 Subject: [PATCH 003/137] - Added new VUE based JS public/js/components/Filter.js, public/js/components/Navigation.js and public/js/apps/LogsViewer.js - Fixed bootstrap includes in FHC-Footer and FHC-Header - Moved Job Logs Viewer to VUE --- application/views/system/logs/logsViewer.php | 40 +++--- application/views/templates/FHC-Footer.php | 2 +- application/views/templates/FHC-Header.php | 2 +- public/js/apps/LogsViewer.js | 19 +++ public/js/components/Filter.js | 132 +++++++++++++++++++ public/js/components/Navigation.js | 106 +++++++++++++++ 6 files changed, 278 insertions(+), 23 deletions(-) create mode 100644 public/js/apps/LogsViewer.js create mode 100644 public/js/components/Filter.js create mode 100644 public/js/components/Navigation.js diff --git a/application/views/system/logs/logsViewer.php b/application/views/system/logs/logsViewer.php index 2718480e9..521e867b3 100644 --- a/application/views/system/logs/logsViewer.php +++ b/application/views/system/logs/logsViewer.php @@ -2,42 +2,40 @@ $includesArray = array( 'title' => 'Logs Viewer', 'jquery3' => true, - 'jqueryui1' => true, - 'bootstrap3' => true, - 'fontawesome4' => true, - 'sbadmintemplate3' => true, + 'bootstrap5' => true, + 'fontawesome6' => true, 'tablesorter2' => true, + 'vue3' => true, 'ajaxlib' => true, - 'bootstrapper' => true, // to be used only if you know what you are doing! - 'filterwidget' => true, - 'navigationwidget' => true, + 'filtercomponent' => true, + 'navigationcomponent' => true, 'phrases' => array( 'global' => array('mailAnXversandt'), 'ui' => array('bitteEintragWaehlen') ), - 'customCSSs' => 'public/css/sbadmin2/tablesort_bootstrap.css' + 'customJSs' => array('public/js/apps/LogsViewer.js') ); $this->load->view('templates/FHC-Header', $includesArray); ?> -
+
- widgetlib->widget('NavigationWidget'); ?> + + -
-
-
-
- -
-
-
- load->view('system/logs/logsViewerData.php'); ?> +
+
+
+
+
+ + +
diff --git a/application/views/templates/FHC-Footer.php b/application/views/templates/FHC-Footer.php index dff868eab..b9ac0134e 100644 --- a/application/views/templates/FHC-Footer.php +++ b/application/views/templates/FHC-Footer.php @@ -52,7 +52,7 @@ if ($bootstrap3 === true) generateJSsInclude('vendor/twbs/bootstrap3/dist/js/bootstrap.min.js'); // Bootstrap 5 JS - if ($bootstrap5 === true) generateJSsInclude('vendor/twbs/bootstrap5/js/bootstrap.min.js'); + if ($bootstrap5 === true) generateJSsInclude('vendor/twbs/bootstrap5/dist/js/bootstrap.min.js'); // Securimage JS if ($captcha3 === true) generateJSsInclude('vendor/dapphp/securimage/securimage.js'); diff --git a/application/views/templates/FHC-Header.php b/application/views/templates/FHC-Header.php index eed8b6590..181796bfc 100644 --- a/application/views/templates/FHC-Header.php +++ b/application/views/templates/FHC-Header.php @@ -34,7 +34,7 @@ if ($bootstrap3 === true) generateCSSsInclude('vendor/twbs/bootstrap3/dist/css/bootstrap.min.css'); // Bootstrap 5 CSS - if ($bootstrap5 === true) generateCSSsInclude('vendor/twbs/bootstrap5/css/bootstrap.min.css'); + if ($bootstrap5 === true) generateCSSsInclude('vendor/twbs/bootstrap5/dist/css/bootstrap.min.css'); // jQuery UI CSS if ($jqueryui1 === true) generateCSSsInclude('vendor/components/jqueryui/themes/base/jquery-ui.min.css'); diff --git a/public/js/apps/LogsViewer.js b/public/js/apps/LogsViewer.js new file mode 100644 index 000000000..44e918432 --- /dev/null +++ b/public/js/apps/LogsViewer.js @@ -0,0 +1,19 @@ +const logsViewerApp = Vue.createApp({ + data() { + return { + appSideMenuEntries: {} + }; + }, + components: { + Navigation, + Filter + }, + methods: { + newSideMenuEntryHandler(payload) { + this.appSideMenuEntries = payload; + } + } +}); + +logsViewerApp.mount('#main'); + diff --git a/public/js/components/Filter.js b/public/js/components/Filter.js new file mode 100644 index 000000000..421ca2e6f --- /dev/null +++ b/public/js/components/Filter.js @@ -0,0 +1,132 @@ +const Filter = { + emits: ['nwNewEntry'], + data() { + return { + fieldsToDisplay: null, + dataset: null, + selectedFields: null + }; + }, + created() { + this.fetchFilterData(); + }, + updated() { + var filterWidgetTablesorter = $("#filterTableDataset"); + + // Checks if the table contains data (rows) + if (filterWidgetTablesorter.find("tbody:empty").length == 0 + && filterWidgetTablesorter.find("tr:empty").length == 0 + && filterWidgetTablesorter.hasClass("table-condensed")) + { + filterWidgetTablesorter.tablesorter({ + dateFormat: "ddmmyyyy", + widgets: ["zebra", "filter"], + widgetOptions: { + filter_saveFilters : true + } + }); + + $.tablesorter.updateAll(filterWidgetTablesorter[0].config, true, null); + } + }, + props: { + filterType: { + type: String, + required: true + } + }, + methods: { + clkNewEntry() { + console.log('emit'); + this.$emit( + 'nwNewEntry', + { + "link": "#", + "description": 'New side menu ' + Math.floor(Math.random() * 10), + "icon": "dashboard", + "sort": 1 + } + ); + }, + fetchFilterData() { + FHC_AjaxClient.ajaxCallGet( + "widgets/Filters/getFilter", + { + filterUniqueId: this.getFilterUniqueIdPrefix(), + filterType: this.filterType, // props!! + filterId: 170 + }, + { + successCallback: this.renderTableSorter + } + ); + }, + getFilterUniqueIdPrefix() { + return FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method; + }, + renderTableSorter(data) { + + if (FHC_AjaxClient.hasData(data)) + { + this._setFieldsToDisplay(FHC_AjaxClient.getData(data)); + this.dataset = FHC_AjaxClient.getData(data).dataset; + this.selectedFields = FHC_AjaxClient.getData(data).selectedFields; + } + else + { + console.error(FHC_AjaxClient.getError(data)); + } + }, + _setFieldsToDisplay(data) { + + let arrayFieldsToDisplay = []; + + if (data.hasOwnProperty("selectedFields") && $.isArray(data.selectedFields)) + { + if (data.hasOwnProperty("columnsAliases") && $.isArray(data.columnsAliases)) + { + for (let sfc = 0; sfc < data.selectedFields.length; sfc++) + { + for (let fc = 0; fc < data.fields.length; fc++) + { + if (data.selectedFields[sfc] == data.fields[fc]) + { + arrayFieldsToDisplay[sfc] = data.columnsAliases[fc]; + } + } + } + } + else + { + arrayFieldsToDisplay = data.selectedFields; + } + } + + this.fieldsToDisplay = arrayFieldsToDisplay; + } + }, + template: ` + + + + + + + + + + +
+ ` +}; + diff --git a/public/js/components/Navigation.js b/public/js/components/Navigation.js new file mode 100644 index 000000000..852b0bd17 --- /dev/null +++ b/public/js/components/Navigation.js @@ -0,0 +1,106 @@ +const Navigation = { + data() { + return { + headerMenu: {}, + sideMenu: {} + }; + }, + created() { + this.fetchDataHeader(); + this.fetchDataMenu(); + }, + props: { + addHeaderMenuEntries: Object, + addSideMenuEntries: Object + }, + methods: { + getNavigationPage() { + return FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method; + }, + fetchDataHeader() { + // Retrives the header menu array + FHC_AjaxClient.ajaxCallGet( + 'system/Navigation/header', + { + navigation_page: this.getNavigationPage() + }, + { + successCallback: this.setHeaders + } + ); + }, + setHeaders(data) { + if (FHC_AjaxClient.hasData(data)) this.headerMenu = FHC_AjaxClient.getData(data); + }, + fetchDataMenu() { + // Retrives the side menu array + FHC_AjaxClient.ajaxCallGet( + 'system/Navigation/menu', + { + navigation_page: this.getNavigationPage() + }, + { + successCallback: this.setSideMenu + } + ); + }, + setSideMenu(data) { + if (FHC_AjaxClient.hasData(data)) this.sideMenu = FHC_AjaxClient.getData(data); + }, + getDataBsToggle(header) { + return !header.children ? null : 'dropdown'; + } + }, + computed: { + headerMenuEntries() { + if (this.headerMenu != null && this.addHeaderMenuEntries != null && Object.keys(this.addHeaderMenuEntries).length > 0) + { + this.headerMenu[this.addHeaderMenuEntries.description] = this.addHeaderMenuEntries; + } + return this.headerMenu; + }, + sideMenuEntries() { + if (this.sideMenu != null && this.addSideMenuEntries != null && Object.keys(this.addSideMenuEntries).length > 0) + { + this.sideMenu[this.addSideMenuEntries.description] = this.addSideMenuEntries; + } + return this.sideMenu; + } + }, + template: ` + + + + + + ` +}; + From 29002124cca2915644f43e613f05b9c3ee4707f4 Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 2 Jun 2022 10:32:26 +0200 Subject: [PATCH 004/137] - Added new controller components/Filter.php - Added new library FilterCmptLib - Fixed includes paths in FHC-Footer and FHC-Header - Moved the LogsViewer tool to VUE+BS5 --- application/components/filters/LogsViewer.php | 61 + application/config/navigation.php | 36 +- application/controllers/components/Filter.php | 294 ++++ application/libraries/FilterCmptLib.php | 1441 +++++++++++++++++ application/views/person/bpk/bpkData.php | 1 + application/views/system/logs/logsViewer.php | 9 +- application/views/templates/FHC-Footer.php | 1 - application/views/templates/FHC-Header.php | 6 +- 8 files changed, 1823 insertions(+), 26 deletions(-) create mode 100644 application/components/filters/LogsViewer.php create mode 100644 application/controllers/components/Filter.php create mode 100644 application/libraries/FilterCmptLib.php diff --git a/application/components/filters/LogsViewer.php b/application/components/filters/LogsViewer.php new file mode 100644 index 000000000..79e97f366 --- /dev/null +++ b/application/components/filters/LogsViewer.php @@ -0,0 +1,61 @@ + ' + SELECT wsl.webservicelog_id AS "LogId", + wsl.request_id AS "RequestId", + wsl.execute_time AS "ExecutionTime", + wsl.execute_user AS "ExecutedBy", + wsl.beschreibung AS "Description", + wsl.request_data AS "Data", + wsl.webservicetyp_kurzbz AS "WebserviceType" + FROM system.tbl_webservicelog wsl + ORDER BY wsl.execute_time DESC + ', + 'requiredPermissions' => 'admin', + 'datasetRepresentation' => 'tablesorter', + 'columnsAliases' => array( + 'Log id', + 'Request id', + 'Execution time', + 'Executed by', + 'Producer', + 'Data', + 'Webservice type' + ), + 'formatRow' => function($datasetRaw) { + + $datasetRaw->ExecutionTime = date_format(date_create($datasetRaw->ExecutionTime), 'd.m.Y H:i:s:u'); + + return $datasetRaw; + }, + 'markRow' => function($datasetRaw) { + + $mark = ''; + + if (strpos($datasetRaw->RequestId, 'error') != false) + { + $mark = 'text-red'; + } + + if (strpos($datasetRaw->RequestId, 'info') != false) + { + $mark = 'text-green'; + } + + if (strpos($datasetRaw->RequestId, 'warning') != false) + { + $mark = 'text-orange'; + } + + if (strpos($datasetRaw->RequestId, 'debug') != false) + { + $mark = 'text-info'; + } + + return $mark; + } + ); + + $filterCmptArray['app'] = 'core'; + $filterCmptArray['datasetName'] = 'logs'; + diff --git a/application/config/navigation.php b/application/config/navigation.php index d415e9332..c2329470c 100644 --- a/application/config/navigation.php +++ b/application/config/navigation.php @@ -15,7 +15,7 @@ $config['navigation_header'] = array( 'description' => 'Organisation', 'sort' => 20, 'requiredPermissions' => 'basis/vilesci:r', - 'children'=> array( + 'children' => array( 'vilesci' => array( 'link' => base_url('vilesci'), 'icon' => '', @@ -40,7 +40,7 @@ $config['navigation_header'] = array( 'description' => 'Lehre', 'sort' => 30, 'requiredPermissions' => 'basis/vilesci:r', - 'children'=> array( + 'children' => array( 'cis' => array( 'link' => CIS_ROOT, 'icon' => '', @@ -71,16 +71,16 @@ $config['navigation_header'] = array( 'lehre/lehrauftrag_erteilen:r' ) ), - 'zverfueg' => array( - 'link' => site_url('lehre/lvplanung/AdminZeitverfuegbarkeit'), - 'description' => 'Zeitverfügbarkeit', - 'expand' => true, - 'sort' => 45, - 'requiredPermissions' => array( - 'lehre/zeitverfuegbarkeit:rw', - 'lehre/zeitverfuegbarkeit:rw' - ) - ), + 'zverfueg' => array( + 'link' => site_url('lehre/lvplanung/AdminZeitverfuegbarkeit'), + 'description' => 'Zeitverfügbarkeit', + 'expand' => true, + 'sort' => 45, + 'requiredPermissions' => array( + 'lehre/zeitverfuegbarkeit:rw', + 'lehre/zeitverfuegbarkeit:rw' + ) + ), 'zgvueberpruefung' => array( 'link' => site_url('system/infocenter/ZGVUeberpruefung'), 'description' => 'ZGV Überprüfung', @@ -98,7 +98,7 @@ $config['navigation_header'] = array( 'description' => 'Personen', 'sort' => 40, 'requiredPermissions' => 'basis/vilesci:r', - 'children'=> array( + 'children' => array( 'messages' => array( 'link' => site_url('system/messages/MessageClient/read'), 'icon' => '', @@ -129,7 +129,7 @@ $config['navigation_header'] = array( 'expand' => false, 'sort' => 50, 'requiredPermissions' => 'admin:r', - 'children'=> array( + 'children' => array( 'extensions' => array( 'link' => site_url('system/extensions/Manager'), 'description' => 'Extensions Manager', @@ -194,7 +194,8 @@ $config['navigation_menu']['lehre/lehrauftrag/Lehrauftrag/*'] = array( 'icon' => 'dashboard', 'sort' => 1, 'requiredPermissions' => array('lehre/lehrauftrag_bestellen:r','lehre/lehrauftrag_erteilen:r') - ),'lehrauftragBestellen' => array( + ), + 'lehrauftragBestellen' => array( 'link' => site_url('lehre/lehrauftrag/Lehrauftrag'), 'description' => 'Lehrauftrag bestellen', 'icon' => '', @@ -216,6 +217,7 @@ $config['navigation_menu']['lehre/lehrauftrag/Lehrauftrag/*'] = array( 'requiredPermissions' => array('lehre/lehrauftrag_erteilen:r') ) ); + $config['navigation_menu']['lehre/lehrauftrag/LehrauftragErteilen/*'] = array( 'lehrauftragDashboard' => array( 'link' => site_url('lehre/lehrauftrag/Lehrauftrag/Dashboard'), @@ -223,7 +225,8 @@ $config['navigation_menu']['lehre/lehrauftrag/LehrauftragErteilen/*'] = array( 'icon' => 'dashboard', 'sort' => 1, 'requiredPermissions' => array('lehre/lehrauftrag_bestellen:r','lehre/lehrauftrag_erteilen:r') - ),'lehrauftragBestellen' => array( + ), + 'lehrauftragBestellen' => array( 'link' => site_url('lehre/lehrauftrag/Lehrauftrag'), 'description' => 'Lehrauftrag bestellen', 'icon' => '', @@ -245,3 +248,4 @@ $config['navigation_menu']['lehre/lehrauftrag/LehrauftragErteilen/*'] = array( 'requiredPermissions' => array('lehre/lehrauftrag_erteilen:r') ) ); + diff --git a/application/controllers/components/Filter.php b/application/controllers/components/Filter.php new file mode 100644 index 000000000..94a3967ed --- /dev/null +++ b/application/controllers/components/Filter.php @@ -0,0 +1,294 @@ +load->library('AuthLib'); + + // Loads the FilterCmptLib with HTTP GET/POST parameters + $this->_loadFilterCmptLib(); + + // Checks if the caller is allow to read this data + $this->_isAllowed(); + } + + //------------------------------------------------------------------------------------------------------------------ + // Public methods + + /** + * Retrieves data about the current filter from the session and will be written on the output in JSON format + */ + public function getFilter() + { + $this->outputJsonSuccess($this->filtercmptlib->getSession()); + } + + /** + * Retrieves the number of records present in the current dataset and will be written on the output in JSON format + */ + public function rowNumber() + { + $rowNumber = 0; + $dataset = $this->filtercmptlib->getSessionElement(FilterCmptLib::SESSION_DATASET); + + if (isset($dataset) && is_array($dataset)) + { + $rowNumber = count($dataset); + } + + $this->outputJsonSuccess($rowNumber); + } + + /** + * Change the sort of the selected fields of the current filter and + * its data will be written on the output in JSON format + */ + public function sortSelectedFields() + { + $selectedFields = $this->input->post('selectedFields'); + + if ($this->filtercmptlib->sortSelectedFields($selectedFields) == true) + { + $this->getFilter(); + } + else + { + $this->outputJsonError('Wrong parameter'); + } + } + + /** + * Remove a selected field from the current filter and + * its data will be written on the output in JSON format + */ + public function removeSelectedField() + { + $selectedField = $this->input->post('selectedField'); + + if ($this->filtercmptlib->removeSelectedField($selectedField) == true) + { + $this->getFilter(); + } + else + { + $this->outputJsonError('Wrong parameter'); + } + } + + /** + * Add a field to the current filter and its data will be written on the output in JSON format + */ + public function addSelectedField() + { + $selectedField = $this->input->post('selectedField'); + + if ($this->filtercmptlib->addSelectedField($selectedField) == true) + { + $this->getFilter(); + } + else + { + $this->outputJsonError('Wrong parameter'); + } + } + + /** + * Remove an applied filter (SQL where condition) from the current filter + */ + public function removeAppliedFilter() + { + $appliedFilter = $this->input->post('appliedFilter'); + + if ($this->filtercmptlib->removeAppliedFilter($appliedFilter) == true) + { + $this->outputJsonSuccess('Removed'); + } + else + { + $this->outputJsonError('Wrong parameter'); + } + } + + /** + * Apply all the applied filters (SQL where conditions) to the current filter + */ + public function applyFilters() + { + $appliedFilters = $this->input->post('appliedFilters'); + $appliedFiltersOperations = $this->input->post('appliedFiltersOperations'); + $appliedFiltersConditions = $this->input->post('appliedFiltersConditions'); + $appliedFiltersOptions = $this->input->post('appliedFiltersOptions'); + + if ($this->filtercmptlib->applyFilters( + $appliedFilters, + $appliedFiltersOperations, + $appliedFiltersConditions, + $appliedFiltersOptions + ) == true) + { + $this->outputJsonSuccess('Applied'); + } + else + { + $this->outputJsonError('Wrong parameter'); + } + } + + /** + * Add a filter (SQL where clause) to be applied to the current filter + */ + public function addFilter() + { + $filter = $this->input->post('filter'); + + if ($this->filtercmptlib->addFilter($filter) == true) + { + $this->getFilter(); + } + else + { + $this->outputJsonError('Wrong parameter'); + } + } + + /** + * Save the current filter as a custom filter for this user with the given description + */ + public function saveCustomFilter() + { + $customFilterDescription = $this->input->post('customFilterDescription'); + + if ($this->filtercmptlib->saveCustomFilter($customFilterDescription) == true) + { + $this->outputJsonSuccess('Saved'); + } + else + { + $this->outputJsonError('An error occurred while saving a custom filter'); + } + } + + /** + * Remove a custom filter by its filter_id + */ + public function removeCustomFilter() + { + $filter_id = $this->input->post('filter_id'); + + if ($this->filtercmptlib->removeCustomFilter($filter_id) == true) + { + $this->outputJsonSuccess('Removed'); + } + else + { + $this->outputJsonError('Wrong parameter'); + } + } + + /** + * Reloads the dataset + */ + public function reloadDataset() + { + $this->filtercmptlib->reloadDataset(); + + $this->outputJsonSuccess('Success'); + } + + /** + * Define the navigation menu for the current filter widget + */ + public function generateFilterMenu() + { + // Generates the filters menu + $this->outputJsonSuccess($this->filtercmptlib->generateFilterMenu($this->input->get(FilterCmptLib::NAVIGATION_PAGE))); + } + + //------------------------------------------------------------------------------------------------------------------ + // Private methods + + /** + * Checks if the user is allowed to use this filter + */ + private function _isAllowed() + { + if (!$this->filtercmptlib->isAllowed()) + { + $this->terminateWithJsonError('You are not allowed to access to this content'); + } + } + + /** + * Loads the FilterCmptLib with the FILTER_UNIQUE_ID parameter + * If the parameter FILTER_UNIQUE_ID is not given then the execution of the controller is terminated and + * an error message is printed + */ + private function _loadFilterCmptLib() + { + // If the parameter FILTER_UNIQUE_ID is present in the HTTP GET or POST + if (isset($_GET[self::FILTER_UNIQUE_ID]) || isset($_POST[self::FILTER_UNIQUE_ID])) + { + $filterUniqueId = null; + + // If it is present in the HTTP GET + if (isset($_GET[self::FILTER_UNIQUE_ID])) + { + $filterUniqueId = $this->input->get(self::FILTER_UNIQUE_ID); // is retrieved from the HTTP GET + } + elseif (isset($_POST[self::FILTER_UNIQUE_ID])) // Else if it is present in the HTTP POST + { + $filterUniqueId = $this->input->post(self::FILTER_UNIQUE_ID); // is retrieved from the HTTP POST + } + + // Loads the FilterCmptLib that contains all the used logic + $this->load->library('FilterCmptLib'); + + $this->filtercmptlib->setFilterUniqueId($filterUniqueId); + } + else // Otherwise an error will be written in the output + { + $this->terminateWithJsonError('Parameter "'.self::FILTER_UNIQUE_ID.'" not provided!'); + } + + // If provided + if (isset($_GET[self::FILTER_TYPE]) || isset($_POST[self::FILTER_TYPE])) + { + $filterType = null; + + // If it is present in the HTTP GET + if (isset($_GET[self::FILTER_TYPE])) + { + $filterType = $this->input->get(self::FILTER_TYPE); // is retrieved from the HTTP GET + } + elseif (isset($_POST[self::FILTER_TYPE])) // Else if it is present in the HTTP POST + { + $filterType = $this->input->post(self::FILTER_TYPE); // is retrieved from the HTTP POST + } + + $this->filtercmptlib->setFilterType($filterType); + } + + $this->filtercmptlib->setFilterId($this->input->get('filterId')); + } +} + diff --git a/application/libraries/FilterCmptLib.php b/application/libraries/FilterCmptLib.php new file mode 100644 index 000000000..53020d358 --- /dev/null +++ b/application/libraries/FilterCmptLib.php @@ -0,0 +1,1441 @@ +_ci =& get_instance(); // get code igniter instance + } + + //------------------------------------------------------------------------------------------------------------------ + // Public methods + + /** + * Checks if at least one of the permissions given as parameter (requiredPermissions) belongs + * to the authenticated user, if confirmed then is allowed to use this FilterCmpt. + * If the parameter requiredPermissions is NOT given or is not present in the session, + * then NO one is allow to use this FilterCmpt + * Wrapper method to permissionlib->hasAtLeastOne + */ + public function isAllowed() + { + $this->_ci->load->library('PermissionLib'); // Load permission library + + // Gets the required permissions from the session if they are not provided as parameter + $rq = $this->getSessionElement(self::REQUIRED_PERMISSIONS); + + // + if ($rq == null) + { + // + $this->_initFilterCmpt(); + // + $this->_startFilterCmpt(); + // Gets the required permissions from the session if they are not provided as parameter + $rq = $this->getSessionElement(self::REQUIRED_PERMISSIONS); + } + + return $this->_ci->permissionlib->hasAtLeastOne($rq, self::PERMISSION_FILTER_METHOD, self::PERMISSION_TYPE); + } + + /** + * Wrapper method to the session helper funtions to retrieve the whole session for this filter + */ + public function getSession() + { + return getSessionElement(self::SESSION_NAME, $this->_filterUniqueId); + } + + /** + * Wrapper method to the session helper funtions to retrieve one element from the session of this filter + */ + public function getSessionElement($name) + { + $session = getSessionElement(self::SESSION_NAME, $this->_filterUniqueId); + + if (isset($session[$name])) + { + return $session[$name]; + } + + return null; + } + + /** + * Wrapper method to the session helper funtions to set the whole session for this filter + */ + public function setSession($data) + { + setSessionElement(self::SESSION_NAME, $this->_filterUniqueId, $data); + } + + /** + * Wrapper method to the session helper funtions to set one element in the session for this filter + */ + public function setSessionElement($name, $value) + { + $session = getSessionElement(self::SESSION_NAME, $this->_filterUniqueId); + + $session[$name] = $value; + + setSessionElement(self::SESSION_NAME, $this->_filterUniqueId, $session); // stores the single value + } + + /** + * + */ + public function dropExpiredFilterCmpts() + { + // Loads the session for all the filter components + $filterCmptsSession = getSession(self::SESSION_NAME); + + // If something is present in session + if ($filterCmptsSession != null) + { + // Loops in the session for all the filter components + foreach ($filterCmptsSession as $filterCmpt => $filterCmptData) + { + // If this filter component is not the current used filter component and the it is expired... + if ($this->_filterUniqueId != $filterCmpt && $filterCmptData[self::SESSION_TIMEOUT] <= time()) + { + cleanSessionElement(self::SESSION_NAME, $filterCmpt); // ...remove it + } + } + } + } + + /** + * Loads the definition data from DB for a filter component + */ + public function loadDefinition($filterId, $app, $datasetName, $filterKurzbz) + { + // Loads the needed models + $this->_ci->load->model('system/Filters_model', 'FiltersModel'); + $this->_ci->FiltersModel->resetQuery(); // reset any previous built query + + $this->_ci->FiltersModel->addSelect('system.tbl_filters.*'); // select only from table filters + $this->_ci->FiltersModel->addOrder('sort', 'ASC'); // sort on column sort + $this->_ci->FiltersModel->addLimit(1); // if more than one filter is set as default only one will be retrieved + + $definition = null; + $whereParameters = null; // where clause parameters + + // If we have a good filterId then use it! + if ($filterId != null && is_numeric($filterId) && $filterId > 0) + { + $whereParameters = array( + self::FILTER_ID => $filterId + ); + } + else + { + // If we can univocally retrieve a filter + if ($app != null && $datasetName != null && $filterKurzbz != null) + { + $whereParameters = array( + 'app' => $app, + 'dataset_name' => $datasetName, + 'filter_kurzbz' => $filterKurzbz + ); + } + // Else if we have only app and datasetName + elseif ($app != null && $datasetName != null && $filterKurzbz == null) + { + // Try to load the custom filter (person_id = logged user person_id) with the given "app" and "dataset_name" + // that is set as default filter (default_filter = true) + $whereParameters = array( + 'app' => $app, + 'dataset_name' => $datasetName, + 'person_id' => getAuthPersonId(), + 'default_filter' => true + ); + + $definition = $this->_ci->FiltersModel->loadWhere($whereParameters); + if (!hasData($definition)) // If a custom filter is NOT found + { + // Try to load the global filter (person_id = null) with the given "app" and "dataset_name" that is set as + // default filter (default_filter = true) + $whereParameters = array( + 'app' => $app, + 'dataset_name' => $datasetName, + 'person_id' => null, + 'default_filter' => true + ); + + $definition = $this->_ci->FiltersModel->loadWhere($whereParameters); + } + } + } + + // If no definition where loaded and where parameters were set + if ($definition == null && $whereParameters != null) + { + $definition = $this->_ci->FiltersModel->loadWhere($whereParameters); + + // Last chance!!! + if (!hasData($definition)) // If no data have been found until now the tries the most desperate query + { + $this->_ci->FiltersModel->addOrder('filter_id', 'ASC'); // sort on column filter_id to get the oldest + $whereParameters = array( + 'app' => $app, + 'dataset_name' => $datasetName + ); + + $definition = $this->_ci->FiltersModel->loadWhere($whereParameters); + } + } + + return $definition; + } + + /** + * Checks if the json definition of this filter is valid + */ + public function parseFilterJson($definition) + { + $jsonEncodedFilter = null; + + // If the definition contains data and they are valid + if (hasData($definition) && isset(getData($definition)[0]->filter) && trim(getData($definition)[0]->filter) != '') + { + // Get the json definition of the filter + $tmpJsonEncodedFilter = json_decode(getData($definition)[0]->filter); + + // Checks required filter's properies + if (isset($tmpJsonEncodedFilter->name) + && isset($tmpJsonEncodedFilter->columns) + && is_array($tmpJsonEncodedFilter->columns) + && isset($tmpJsonEncodedFilter->filters) + && is_array($tmpJsonEncodedFilter->filters)) + { + $jsonEncodedFilter = $tmpJsonEncodedFilter; + } + } + + return $jsonEncodedFilter; + } + + /** + * Generate the query to retrieve the dataset for a filter + */ + public function generateDatasetQuery($query, $filters) + { + $datasetQuery = 'SELECT * FROM ('.$query.') '.self::DATASET_TABLE_ALIAS; + + // If the given query is valid and the parameter filters is an array + if (!isEmptyString($query) && $filters != null && is_array($filters)) + { + $where = ''; // starts building the SQL where clause + + // Loops through the given applied filters + for ($filtersCounter = 0; $filtersCounter < count($filters); $filtersCounter++) + { + $filterDefinition = $filters[$filtersCounter]; // definition of one filter + + if ($filtersCounter > 0) + $where .= ' AND '; // if it's NOT the last one + + if (!isEmptyString($filterDefinition->name)) // if the name of the applied filter is valid + { + // ...build the condition + $where .= '"'.$filterDefinition->name.'"'.$this->_getDatasetQueryCondition($filterDefinition); + } + } + + if ($where != '') // if the SQL where clause was built + { + $datasetQuery .= ' WHERE '.$where; + } + } + + return $datasetQuery; + } + + /** + * Retrieves the dataset from the DB + */ + public function getDataset($datasetQuery) + { + $dataset = null; + + if ($datasetQuery != null) + { + $this->_ci->load->model('system/Filters_model', 'FiltersModel'); + + // Execute the given SQL statement suppressing error messages + $dataset = @$this->_ci->FiltersModel->execReadOnlyQuery($datasetQuery); + } + + return $dataset; + } + + /** + * Get the filter name, the default is the "name" property of the JSON definition + * If the property namePhrase is present into the JSON definition, then try to load that from the phrases system + * NOTE: filterJson should be already checked using the method parseFilterJson + */ + public function getFilterName($filterJson) + { + $filterName = $filterJson->name; // always present, used as default + $trimedname = (isset($filterJson->namePhrase)?trim($filterJson->namePhrase):''); + // Filter name from phrases system + if (isset($filterJson->namePhrase) && !isEmptyString($filterJson->namePhrase)) + { + // Loads the library to use the phrases system + $this->_ci->load->library('PhrasesLib', array(self::FILTER_PHRASES_CATEGORY)); + + $tmpFilterNamePhrase = $this->_ci->phraseslib->t(self::FILTER_PHRASES_CATEGORY, $filterJson->namePhrase); + if (!isEmptyString($tmpFilterNamePhrase)) // if is not null or an empty string + { + $filterName = $tmpFilterNamePhrase; + } + } + + return $filterName; + } + + /** + * Change the sort of the selected fields of the current filter + */ + public function sortSelectedFields($selectedFields) + { + $sortSelectedFields = false; + + // Checks the parameter selectedFields + if (isset($selectedFields) && is_array($selectedFields) && count($selectedFields) > 0) + { + // Retrieves all the used fields by the current filter + $fields = $this->getSessionElement(self::SESSION_FIELDS); + + // Checks that the given selected fields are present in all the used fields by the current filter + if (!array_diff($selectedFields, $fields)) + { + $this->setSessionElement(self::SESSION_SELECTED_FIELDS, $selectedFields); // write changes into the session + + $sortSelectedFields = true; + } + } + + return $sortSelectedFields; + } + + /** + * Remove a selected field from the current filter + */ + public function removeSelectedField($selectedField) + { + $removeSelectedField = false; + + // Checks the parameter selectedField + if (!isEmptyString($selectedField)) + { + // Retrieves all the used fields by the current filter + $fields = $this->getSessionElement(self::SESSION_FIELDS); + // Retrieves the selected fields by the current filter + $selectedFields = $this->getSessionElement(self::SESSION_SELECTED_FIELDS); + + // Checks that the given selected field is present in the list of all the used fields by the current filter + if (in_array($selectedField, $fields)) + { + // If the selected field is present in the list of the selected fields by the current filter + if (($pos = array_search($selectedField, $selectedFields)) !== false) + { + // Then remove it and shift the rest of elements by one if needed + array_splice($selectedFields, $pos, 1); + } + + $this->setSessionElement(self::SESSION_SELECTED_FIELDS, $selectedFields); // write changes into the session + + $removeSelectedField = true; + } + } + + return $removeSelectedField; + } + + /** + * Add a field to the current filter + */ + public function addSelectedField($selectedField) + { + $removeSelectedField = false; + + // Checks the parameter selectedField + if (!isEmptyString($selectedField)) + { + // Retrieves all the used fields by the current filter + $fields = $this->getSessionElement(self::SESSION_FIELDS); + // Retrieves the selected fields by the current filter + $selectedFields = $this->getSessionElement(self::SESSION_SELECTED_FIELDS); + + // Checks that the given selected field is present in the list of all the used fields by the current filter + if (in_array($selectedField, $fields)) + { + array_push($selectedFields, $selectedField); // place the new filed at the end of the selected fields list + + $this->setSessionElement(self::SESSION_SELECTED_FIELDS, $selectedFields); // write changes into the session + + $removeSelectedField = true; + } + } + + return $removeSelectedField; + } + + /** + * Remove an applied filter (SQL where condition) from the current filter + */ + public function removeAppliedFilter($appliedFilter) + { + $removeAppliedFilter = false; + + // Checks the parameter appliedFilter + if (!isEmptyString($appliedFilter)) + { + // Retrieves all the used fields by the current filter + $fields = $this->getSessionElement(self::SESSION_FIELDS); + // Retrieves the applied filters by the current filter + $filters = $this->getSessionElement(self::SESSION_FILTERS); + + // Checks that the given applied filter is present in the list of all the used fields by the current filter + if (in_array($appliedFilter, $fields)) + { + // Search in what position the given applied filter is + $pos = $this->_searchFilterByName($filters, $appliedFilter); + if ($pos !== false) // If found + { + array_splice($filters, $pos, 1); // Then remove it and shift the rest of elements by one if needed + } + + // Write changes into the session + $this->setSessionElement(self::SESSION_FILTERS, $filters); + $this->setSessionElement(self::SESSION_DATASET_RELOAD, true); // the dataset must be reloaded + + $removeAppliedFilter = true; + } + } + + return $removeAppliedFilter; + } + + /** + * Apply all the applied filters (SQL where conditions) to the current filter + */ + public function applyFilters($appliedFilters, $appliedFiltersOperations, $appliedFiltersConditions, $appliedFiltersOptions) + { + $applyFilters = false; + + // Checks the required parameters: appliedFilters and appliedFiltersOperations + if (isset($appliedFilters) && is_array($appliedFilters) + && isset($appliedFiltersOperations) && is_array($appliedFiltersOperations)) + { + $fields = $this->getSessionElement(self::SESSION_FIELDS); // Retrieves all the used fields by the current filter + + // Checks that the given applied filters are present in all the used fields by the current filter + if (!array_diff($appliedFilters, $fields)) + { + $filters = array(); // starts building the new applied filters list + for ($i = 0; $i < count($appliedFilters); $i++) // loops through the given applied filters + { + $filterDefinition = new stdClass(); // new applied filter definition + + // Sets the filter definition required properties + $filterDefinition->name = $appliedFilters[$i]; + $filterDefinition->operation = $appliedFiltersOperations[$i]; + + // Sets the filter definition optional properties + $filterDefinition->condition = null; + if (isset($appliedFiltersConditions) && isset($appliedFiltersConditions[$i])) + { + $filterDefinition->condition = $appliedFiltersConditions[$i]; + } + + $filterDefinition->option = null; + if (isset($appliedFiltersOptions) && isset($appliedFiltersOptions[$i])) + { + $filterDefinition->option = $appliedFiltersOptions[$i]; + } + + $filters[$i] = $filterDefinition; // adds the new definition to the list + } + + // Write changes into the session + $this->setSessionElement(self::SESSION_FILTERS, $filters); + $this->setSessionElement(self::SESSION_DATASET_RELOAD, true); // the dataset must be reloaded + + $applyFilters = true; + } + } + + return $applyFilters; + } + + /** + * Reloads dataset by setting session variable to true + */ + public function reloadDataset() + { + $this->setSessionElement(self::SESSION_DATASET_RELOAD, true); + } + + /** + * Add a filter (SQL where clause) to be applied to the current filter + */ + public function addFilter($filter) + { + $addFilter = false; + + // Checks the parameter filter + if (!isEmptyString($filter)) + { + // Retrieves all the used fields by the current filter + $fields = $this->getSessionElement(self::SESSION_FIELDS); + // Retrieves the applied filters by the current filter + $filters = $this->getSessionElement(self::SESSION_FILTERS); + + // Checks that the given applied filter is present in the list of all the used fields by the current filter + if (in_array($filter, $fields)) + { + // Search in what position the given applied filter is + $pos = $this->_searchFilterByName($filters, $filter); + if ($pos === false) // If NOT found then add it + { + // New filter definition + $filterDefinition = new stdClass(); + // Sets filter definition required properties + $filterDefinition->name = $filter; + // Sets filter definition optional properties + $filterDefinition->operation = null; + $filterDefinition->condition = null; + $filterDefinition->option = null; + // Place the new applied filter at the end of the applied filters list + array_push($filters, $filterDefinition); + } + + $this->setSessionElement(self::SESSION_FILTERS, $filters); // write changes into the session + + $addFilter = true; + } + } + + return $addFilter; + } + + /** + * Save the current filter as a custom filter for this user with the given description + */ + public function saveCustomFilter($customFilterDescription) + { + $saveCustomFilter = false; // by default returns a failure + + // Checks parameter customFilterDescription if not valid stop the execution + if (isEmptyString($customFilterDescription)) return $saveCustomFilter; + + $this->_ci->load->model('system/Filters_model', 'FiltersModel'); // to load the filter definitions + $this->_ci->FiltersModel->resetQuery(); // reset any previous built query + + // person_id of the authenticated user + $authPersonId = getAuthPersonId(); + // Postgres array for the description + $descPGArray = str_replace('%desc%', $customFilterDescription, '{"%desc%", "%desc%", "%desc%", "%desc%"}'); + + // Loads the definition to check if is already present in the DB + $definition = $this->_ci->FiltersModel->loadWhere(array( + 'app' => $this->getSessionElement(self::APP), + 'dataset_name' => $this->getSessionElement(self::DATASET_NAME), + 'description' => $descPGArray, + 'person_id' => $authPersonId + )); + + // New definition to be json encoded + $jsonDeifinition = new stdClass(); + $jsonDeifinition->name = $customFilterDescription; // name of the filter + + // Generates the "column" property + $jsonDeifinition->columns = array(); + $selectedFields = $this->getSessionElement(self::SESSION_SELECTED_FIELDS); // retrieved the selected fields + for ($i = 0; $i < count($selectedFields); $i++) + { + // Each element is an object with a property called "name" + $jsonDeifinition->columns[$i] = new stdClass(); + $jsonDeifinition->columns[$i]->name = $selectedFields[$i]; + } + + // List of applied filters + $jsonDeifinition->filters = $this->getSessionElement(self::SESSION_FILTERS); + + // If it is already present + if (hasData($definition)) + { + // update it + $this->_ci->FiltersModel->update( + array( + 'app' => $this->getSessionElement(self::APP), + 'dataset_name' => $this->getSessionElement(self::DATASET_NAME), + 'description' => $descPGArray, + 'person_id' => $authPersonId + ), + array( + 'filter' => json_encode($jsonDeifinition) + ) + ); + + $saveCustomFilter = true; + } + else // otherwise insert a new one + { + $this->_ci->FiltersModel->insert( + array( + 'app' => $this->getSessionElement(self::APP), + 'dataset_name' => $this->getSessionElement(self::DATASET_NAME), + 'filter_kurzbz' => uniqid($authPersonId, true), + 'description' => $descPGArray, + 'person_id' => $authPersonId, + 'sort' => null, + 'default_filter' => false, + 'filter' => json_encode($jsonDeifinition), + 'oe_kurzbz' => null + ) + ); + + $saveCustomFilter = true; + } + + return $saveCustomFilter; + } + + /** + * Remove a custom filter by its filter_id + */ + public function removeCustomFilter($filterId) + { + $removeCustomFilter = false; + + // Checks the parameter filterId + if (isset($filterId) && is_numeric($filterId) && $filterId > 0) + { + $this->_ci->load->model('system/Filters_model', 'FiltersModel'); // to remove the filter definitions from DB + + // Delete it from database + $this->_ci->FiltersModel->delete(array(self::FILTER_ID => $filterId)); + + // Delete it from session + $this->_dropFromSessionFilterCmptById($filterId); + + $removeCustomFilter = true; + } + + return $removeCustomFilter; + } + + /** + * Return an unique string that identify this filter component + * NOTE: The default value is the URI where the FilterCmpt is called + * If the fhc_controller_id is present then is also used + */ + public function setFilterUniqueIdByParams($params) + { + if ($params != null + && is_array($params) + && isset($params[self::FILTER_UNIQUE_ID]) + && !isEmptyString($params[self::FILTER_UNIQUE_ID])) + { + $filterUniqueId = $params[self::FILTER_UNIQUE_ID]; + } + else + { + // Gets the current page URI + $filterUniqueId = $this->_ci->router->directory.$this->_ci->router->class.'/'.$this->_ci->router->method; + } + + $this->setFilterUniqueId($filterUniqueId); + } + + /** + * + */ + public function setFilterUniqueId($filterUniqueId) + { + // If the FHC_CONTROLLER_ID parameter is present in the HTTP GET + if (isset($_GET[self::FHC_CONTROLLER_ID])) + { + $filterUniqueId .= '/'.$this->_ci->input->get(self::FHC_CONTROLLER_ID); // then use it + } + elseif (isset($_POST[self::FHC_CONTROLLER_ID])) // else if the FHC_CONTROLLER_ID parameter is present in the HTTP POST + { + $filterUniqueId .= '/'.$this->_ci->input->post(self::FHC_CONTROLLER_ID); // then use it + } + + $this->_filterUniqueId = $filterUniqueId; + } + + /** + * + */ + public function setFilterType($filterType) + { + $this->_filterType = $filterType; + } + + /** + * + */ + public function setFilterId($filterId) + { + $this->_filterId = $filterId; + } + + /** + * Generates the filters menu structure array and stores it into the session + */ + public function generateFilterMenu($navigationPage) + { + $filterMenu = new stdClass(); + $filterMenu->filters = array(); + $filterMenu->personalFilters = array(); + + $session = $this->getSession(); // The filter currently stored in session (the one that is currently used) + if ($session != null) + { + // Loads the Filters model + $this->_ci->load->model('system/Filters_model', 'FiltersModel'); + + // Loads all the filters related to this page (same dataset_name and same app name) + $filters = $this->_ci->FiltersModel->getFiltersByAppDatasetNamePersonId( + $session[self::APP], + $session[self::DATASET_NAME], + getAuthPersonId() + ); + + // If filters were loaded + if (hasData($filters)) + { + $childrenArray = array(); // contains all the children elements in a menu entry + $childrenPersonalArray = array(); // contains all the children elements in menu enty for personal filters + + // Loops through loaded filters + foreach (getData($filters) as $filter) + { + $menuEntry = new stdClass(); + $menuEntry->desc = $filter->description[0]; + $menuEntry->link = sprintf( + '%s?%s=%s', + site_url($navigationPage), + self::FILTER_ID, + $filter->{self::FILTER_ID} + ); + + // If it is NOT a personal filter + if ($filter->person_id == null) + { + $filterMenu->filters[] = $menuEntry; + } + else // otherwise + { + $menuEntry->subscriptDescription = 'Remove'; + $menuEntry->subscriptLinkClass = 'remove-custom-filter'; + $menuEntry->subscriptLinkValue = $filter->{self::FILTER_ID}; + + $filterMenu->personalFilters[] = $menuEntry; // adds to personal filters menu array + } + } + } + } + + return $filterMenu; + } + + //------------------------------------------------------------------------------------------------------------------ + // Private methods + + /** + * Contains all the logic used to load all the data needed to the FilterCmpt + */ + private function _startFilterCmpt() + { + // Looks for expired filter components in session and drops them + $this->dropExpiredFilterCmpts(); + + // Read the all session for this filter component + $session = $this->getSession(); + + // If session is NOT empty -> a filter was already loaded + if ($session != null) + { + // Retrieve the filterId stored in the session + $sessionFilterId = $this->getSessionElement(FilterCmptLib::FILTER_ID); + + // If the filter loaded in session is NOT the same that is being requested then empty the session + if ($this->_filterId != $sessionFilterId) + { + $this->setSession(null); + $session = null; + } + else // else if the filter loaded in session is the same that is being requested + { + // Get SESSION_DATASET_RELOAD from the session + $sessionReloadDataset = $this->getSessionElement(FilterCmptLib::SESSION_DATASET_RELOAD); + + // if Filter changed or reload is forced by parameter then reload the Dataset + if ($this->_reloadDataset === true || $sessionReloadDataset === true) + { + // Set as false to stop changing the dataset + $this->setSessionElement(FilterCmptLib::SESSION_DATASET_RELOAD, false); + + // Generate dataset query using filters from the session + $datasetQuery = $this->generateDatasetQuery( + $this->_query, + $this->getSessionElement(FilterCmptLib::SESSION_FILTERS) + ); + + // Then retrieve dataset from DB + $dataset = $this->getDataset($datasetQuery); + + // Save changes into session if data are valid + if (!isError($dataset)) + { + $this->_formatDataset($dataset); // marks rows using markRow and format rowns using formatRow + + // Set the new dataset and its attributes in the session + $this->setSessionElement(FilterCmptLib::SESSION_METADATA, $this->_ci->FiltersModel->getExecutedQueryMetaData()); + $this->setSessionElement(FilterCmptLib::SESSION_ROW_NUMBER, count($dataset->retval)); + $this->setSessionElement(FilterCmptLib::SESSION_DATASET, $dataset->retval); + } + } + } + } + + // If the session is empty -> first time that this filter is loaded + if ($session == null) + { + // Load filter definition data from DB + $definition = $this->loadDefinition( + $this->_filterId, + $this->_app, + $this->_datasetName, + $this->_filterKurzbz + ); + + // Checks and parse json present into the definition + $parsedFilterJson = $this->parseFilterJson($definition); + if ($parsedFilterJson != null) // if the json is valid + { + // Generate dataset query + $datasetQuery = $this->generateDatasetQuery($this->_query, $parsedFilterJson->filters); + + // Then retrieve dataset from DB + $dataset = $this->getDataset($datasetQuery); + + // Try to load the name of the filter using the PhrasesLib + $filterName = $this->getFilterName($parsedFilterJson); + + // Save changes into session if data are valid + if (!isError($dataset)) + { + $this->_formatDataset($dataset); // marks rows using markRow and format rowns using formatRow + + // Stores an array that contains all the data useful for + $this->setSession( + array( + FilterCmptLib::FILTER_ID => $this->_filterId, // the current filter id + FilterCmptLib::APP => $this->_app, // the current app parameter + FilterCmptLib::DATASET_NAME => $this->_datasetName, // the carrent dataset name + FilterCmptLib::SESSION_FILTER_NAME => $filterName, // the current filter name + FilterCmptLib::SESSION_FIELDS => $this->_ci->FiltersModel->getExecutedQueryListFields(), // all the fields of the dataset + FilterCmptLib::SESSION_SELECTED_FIELDS => $this->_getColumnsNames($parsedFilterJson->columns), // all the selected fields + FilterCmptLib::SESSION_COLUMNS_ALIASES => $this->_columnsAliases, // all the fields aliases + FilterCmptLib::SESSION_ADDITIONAL_COLUMNS => $this->_additionalColumns, // additional columns + FilterCmptLib::SESSION_CHECKBOXES => $this->_checkboxes, // the name of the field used to build the checkboxes column + FilterCmptLib::SESSION_FILTERS => $parsedFilterJson->filters, // all the filters used to filter the dataset + FilterCmptLib::SESSION_METADATA => $this->_ci->FiltersModel->getExecutedQueryMetaData(), // the metadata of the dataset + FilterCmptLib::SESSION_ROW_NUMBER => count($dataset->retval), // the number of loaded rows by this filter + FilterCmptLib::SESSION_DATASET => $dataset->retval, // the entire dataset + FilterCmptLib::SESSION_DATASET_RELOAD => false, // if the dataset must be reloaded, not needed the first time + FilterCmptLib::SESSION_DATASET_REPRESENTATION => $this->_datasetRepresentation, // the choosen dataset representation + FilterCmptLib::SESSION_DATASET_REP_OPTIONS => $this->_datasetRepresentationOptions, // the choosen dataset representation options + FilterCmptLib::SESSION_DATASET_REP_FIELDS_DEFS => $this->_datasetRepFieldsDefs // the choosen dataset representation record fields definition + ) + ); + } + } + } + + // NOTE: latest operations to be performed in the session to be shure that they are always present + // To be always stored in the session, otherwise is not possible to load data from Filters controller + $this->setSessionElement(FilterCmptLib::REQUIRED_PERMISSIONS, $this->_requiredPermissions); + // Renew or set the session expiring time + $this->setSessionElement(FilterCmptLib::SESSION_TIMEOUT, strtotime('+'.$this->_sessionTimeout.' minutes', time())); + } + + /** + * Checks the required parameters used to call this FilterCmpt + */ + private function _checkParameters($filterCmptArray) + { + // If no options are given to this component... + if (!is_array($filterCmptArray) || (is_array($filterCmptArray) && count($filterCmptArray) == 0)) + { + show_error('Second parameter of the component call must be a NOT empty associative array'); + } + else // ...otherwise + { + // Parameters (app AND dataset name) OR filter id are mandatory + if ((!isset($filterCmptArray[FilterCmptLib::APP]) && !isset($filterCmptArray[FilterCmptLib::DATASET_NAME])) + && !isset($filterCmptArray[FilterCmptLib::FILTER_ID])) + { + show_error( + 'The parameters ("'.FilterCmptLib::APP.'" AND "'.FilterCmptLib::DATASET_NAME.') OR "'. + FilterCmptLib::FILTER_ID.'" must be specified' + ); + } + + // The query parameter is mandatory + if (!isset($filterCmptArray[FilterCmptLib::QUERY])) + { + show_error('The parameter "'.FilterCmptLib::QUERY.'" must be specified'); + } + + // The dataset representation parameter is mandatory + if (!isset($filterCmptArray[FilterCmptLib::DATASET_REPRESENTATION])) + { + show_error('The parameter "'.FilterCmptLib::DATASET_REPRESENTATION.'" must be specified'); + } + + // Checks if the dataset representation parameter is valid + if (isset($filterCmptArray[FilterCmptLib::DATASET_REPRESENTATION]) + && $filterCmptArray[FilterCmptLib::DATASET_REPRESENTATION] != FilterCmptLib::DATASET_REP_TABLESORTER + && $filterCmptArray[FilterCmptLib::DATASET_REPRESENTATION] != FilterCmptLib::DATASET_REP_PIVOTUI + && $filterCmptArray[FilterCmptLib::DATASET_REPRESENTATION] != FilterCmptLib::DATASET_REP_TABULATOR) + { + show_error( + 'The parameter "'.FilterCmptLib::DATASET_REPRESENTATION. + '" must be IN ("' + .FilterCmptLib::DATASET_REP_TABLESORTER.'", "' + .FilterCmptLib::DATASET_REP_PIVOTUI.'", "' + .FilterCmptLib::DATASET_REP_TABULATOR.'")' + ); + } + + // If given the session timeout parameter must be a number + if (isset($filterCmptArray[FilterCmptLib::SESSION_TIMEOUT]) && !is_numeric($filterCmptArray[FilterCmptLib::SESSION_TIMEOUT])) + { + show_error('The parameter "'.FilterCmptLib::SESSION_TIMEOUT.'" must be a number'); + } + } + } + + /** + * Checks parameters and initialize all the properties of this FilterCmpt + */ + private function _initFilterCmpt() + { + // Gets the filter configuration from the file system + require_once(APPPATH.'components/filters/'.$this->_filterType.'.php'); + + // Gets the filter configuration from the extensions + // require_once(APPPATH.'components/extensions/'.$this->_filterType.'.php'); + + $this->_checkParameters($filterCmptArray); + + // If here then everything is ok + + // Initialize class properties + $this->_requiredPermissions = null; + $this->_app = null; + $this->_datasetName = null; + $this->_filterKurzbz = null; + //$this->_filterId = null; + $this->_reloadDataset = true; // by default the dataset is NOT cached in session + $this->_query = null; + $this->_additionalColumns = null; + $this->_columnsAliases = null; + $this->_formatRow = null; + $this->_markRow = null; + $this->_checkboxes = null; + $this->_hideOptions = null; + $this->_hideSelectFields = null; + $this->_hideSelectFilters = null; + $this->_hideSave = null; + $this->_hideMenu = null; + $this->_customMenu = null; + $this->_datasetRepresentation = null; + $this->_datasetRepresentationOptions = null; + $this->_datasetRepFieldsDefs = null; + $this->_sessionTimeout = FilterCmptLib::SESSION_DEFAULT_TIMEOUT; + + // Retrieved the required permissions parameter if present + if (isset($filterCmptArray[FilterCmptLib::REQUIRED_PERMISSIONS])) + { + $this->_requiredPermissions = $filterCmptArray[FilterCmptLib::REQUIRED_PERMISSIONS]; + } + + // Parameters needed to retrieve univocally a filter from DB + if (isset($filterCmptArray[FilterCmptLib::APP])) + { + $this->_app = $filterCmptArray[FilterCmptLib::APP]; + } + + if (isset($filterCmptArray[FilterCmptLib::DATASET_NAME])) + { + $this->_datasetName = $filterCmptArray[FilterCmptLib::DATASET_NAME]; + } + + if (isset($filterCmptArray[FilterCmptLib::FILTER_KURZBZ])) + { + $this->_filterKurzbz = $filterCmptArray[FilterCmptLib::FILTER_KURZBZ]; + } + + if (isset($filterCmptArray[FilterCmptLib::FILTER_ID])) + { + $this->_filterId = $filterCmptArray[FilterCmptLib::FILTER_ID]; + } + + // How to retrieve data for the filter: SQL statement or a result from DB + if (isset($filterCmptArray[FilterCmptLib::QUERY])) + { + $this->_query = $filterCmptArray[FilterCmptLib::QUERY]; + } + + if (isset($filterCmptArray[FilterCmptLib::DATASET_RELOAD])) + { + $this->_reloadDataset = $filterCmptArray[FilterCmptLib::DATASET_RELOAD]; + } + + // Parameter is used to add extra columns to the dataset + if (isset($filterCmptArray[FilterCmptLib::ADDITIONAL_COLUMNS]) + && is_array($filterCmptArray[FilterCmptLib::ADDITIONAL_COLUMNS]) + && count($filterCmptArray[FilterCmptLib::ADDITIONAL_COLUMNS]) > 0) + { + $this->_additionalColumns = $filterCmptArray[FilterCmptLib::ADDITIONAL_COLUMNS]; + } + + // Parameter is used to add use aliases for the columns fo the dataset + if (isset($filterCmptArray[FilterCmptLib::COLUMNS_ALIASES]) + && is_array($filterCmptArray[FilterCmptLib::COLUMNS_ALIASES]) + && count($filterCmptArray[FilterCmptLib::COLUMNS_ALIASES]) > 0) + { + $this->_columnsAliases = $filterCmptArray[FilterCmptLib::COLUMNS_ALIASES]; + } + + // Parameter that contains a function to format the rows of the dataset + if (isset($filterCmptArray[FilterCmptLib::FORMAT_ROW]) && is_callable($filterCmptArray[FilterCmptLib::FORMAT_ROW])) + { + $this->_formatRow = $filterCmptArray[FilterCmptLib::FORMAT_ROW]; + } + + // Parameter that contains a function to mark in the GUI the rows of the dataset + if (isset($filterCmptArray[FilterCmptLib::MARK_ROW]) && is_callable($filterCmptArray[FilterCmptLib::MARK_ROW])) + { + $this->_markRow = $filterCmptArray[FilterCmptLib::MARK_ROW]; + } + + // Parameter used to specify the column of the dataset that will be used + // as id of the checkboxes column in the GUI + if (isset($filterCmptArray[FilterCmptLib::CHECKBOXES])) + { + $this->_checkboxes = $filterCmptArray[FilterCmptLib::CHECKBOXES]; + } + + // To specify if the filter options are shown ot not + if (isset($filterCmptArray[FilterCmptLib::HIDE_OPTIONS]) && is_bool($filterCmptArray[FilterCmptLib::HIDE_OPTIONS])) + { + $this->_hideOptions = $filterCmptArray[FilterCmptLib::HIDE_OPTIONS]; + } + + // To specify if the form to select fields is shown or not + if (isset($filterCmptArray[FilterCmptLib::HIDE_SELECT_FIELDS]) && is_bool($filterCmptArray[FilterCmptLib::HIDE_SELECT_FIELDS])) + { + $this->_hideSelectFields = $filterCmptArray[FilterCmptLib::HIDE_SELECT_FIELDS]; + } + + // To specify if the form to select filters is shown or not + if (isset($filterCmptArray[FilterCmptLib::HIDE_SELECT_FILTERS]) && is_bool($filterCmptArray[FilterCmptLib::HIDE_SELECT_FILTERS])) + { + $this->_hideSelectFilters = $filterCmptArray[FilterCmptLib::HIDE_SELECT_FILTERS]; + } + + // To specify if the form to save a custom FilterCmpt is shown or not + if (isset($filterCmptArray[FilterCmptLib::HIDE_SAVE]) && is_bool($filterCmptArray[FilterCmptLib::HIDE_SAVE])) + { + $this->_hideSave = $filterCmptArray[FilterCmptLib::HIDE_SAVE]; + } + + // If the menu should be shown or not + if (isset($filterCmptArray[FilterCmptLib::HIDE_MENU]) && is_bool($filterCmptArray[FilterCmptLib::HIDE_MENU])) + { + $this->_hideMenu = $filterCmptArray[FilterCmptLib::HIDE_MENU]; + } + + // If a custom menu is set + if (isset($filterCmptArray[FilterCmptLib::CUSTOM_MENU]) && is_bool($filterCmptArray[FilterCmptLib::CUSTOM_MENU])) + { + $this->_customMenu = $filterCmptArray[FilterCmptLib::CUSTOM_MENU]; + } + + // To specify how to represent the dataset (ex: tablesorter, pivotUI, ...) + if (isset($filterCmptArray[FilterCmptLib::DATASET_REPRESENTATION]) + && ($filterCmptArray[FilterCmptLib::DATASET_REPRESENTATION] == FilterCmptLib::DATASET_REP_TABLESORTER + || $filterCmptArray[FilterCmptLib::DATASET_REPRESENTATION] == FilterCmptLib::DATASET_REP_PIVOTUI + || $filterCmptArray[FilterCmptLib::DATASET_REPRESENTATION] == FilterCmptLib::DATASET_REP_TABULATOR)) + { + $this->_datasetRepresentation = $filterCmptArray[FilterCmptLib::DATASET_REPRESENTATION]; + } + + // To specify options for the dataset representation (ex: tablesorter, pivotUI, ...) + if (isset($filterCmptArray[FilterCmptLib::DATASET_REP_OPTIONS]) && !isEmptyString($filterCmptArray[FilterCmptLib::DATASET_REP_OPTIONS])) + { + $this->_datasetRepresentationOptions = $filterCmptArray[FilterCmptLib::DATASET_REP_OPTIONS]; + } + + // To specify how to represent each record field + if (isset($filterCmptArray[FilterCmptLib::DATASET_REP_FIELDS_DEFS]) && !isEmptyString($filterCmptArray[FilterCmptLib::DATASET_REP_FIELDS_DEFS])) + { + $this->_datasetRepFieldsDefs = $filterCmptArray[FilterCmptLib::DATASET_REP_FIELDS_DEFS]; + } + + // To specify the expiring session time + if (isset($filterCmptArray[FilterCmptLib::SESSION_TIMEOUT]) && is_numeric($filterCmptArray[FilterCmptLib::SESSION_TIMEOUT])) + { + $this->_sessionTimeout = $filterCmptArray[FilterCmptLib::SESSION_TIMEOUT]; + } + } + + /** + * Generates a condition for a SQL where clause using the given applied filter definition. + * By default an empty string is returned. + */ + private function _getDatasetQueryCondition($filterDefinition) + { + $condition = ''; // starts building the condition + + $this->_ci->load->model('system/Filters_model', 'FiltersModel'); + + // "operation" is a required property for the applied filter definition + if (!isEmptyString($filterDefinition->operation)) + { + // Checks what operation is required + switch ($filterDefinition->operation) + { + // comparison (==) + case self::OP_EQUAL: + if (is_numeric($filterDefinition->condition)) $condition = '= '.$filterDefinition->condition; + break; + // not equal (!=) + case self::OP_NOT_EQUAL: + if (is_numeric($filterDefinition->condition)) $condition = '!= '.$filterDefinition->condition; + break; + // greater than (>) + case self::OP_GREATER_THAN: + // It it's a date type + if (is_numeric($filterDefinition->condition) + && isset($filterDefinition->option) + && ($filterDefinition->option == self::OPT_HOURS + || $filterDefinition->option == self::OPT_DAYS + || $filterDefinition->option == self::OPT_MONTHS + || $filterDefinition->option == self::OPT_MINUTES)) + { + $condition = '< (NOW() - \''.$filterDefinition->condition.' '.$filterDefinition->option.'\'::interval)'; + } + else // otherwise is a number + { + $condition = '> '.$filterDefinition->condition; + } + break; + // less than (<) + case self::OP_LESS_THAN: + // It it's a date type + if (is_numeric($filterDefinition->condition) + && isset($filterDefinition->option) + && ($filterDefinition->option == self::OPT_HOURS + || $filterDefinition->option == self::OPT_DAYS + || $filterDefinition->option == self::OPT_MONTHS + || $filterDefinition->option == self::OPT_MINUTES)) + { + $condition = '> (NOW() - \''.$filterDefinition->condition.' '.$filterDefinition->option.'\'::interval)'; + } + else // otherwise is a number + { + $condition = '< '.$filterDefinition->condition; + } + break; + // contains (ILIKE) + case self::OP_CONTAINS: + $condition = 'ILIKE \'%'.$this->_ci->FiltersModel->escapeLike($filterDefinition->condition).'%\''; + break; + // not contains (NOT ILIKE) + case self::OP_NOT_CONTAINS: + $condition = 'NOT ILIKE \'%'.$this->_ci->FiltersModel->escapeLike($filterDefinition->condition).'%\''; + break; + // is true (=== true) + case self::OP_IS_TRUE: + $condition = 'IS TRUE'; + break; + // is false (=== false) + case self::OP_IS_FALSE: + $condition = 'IS FALSE'; + break; + // is set + case self::OP_SET: + $condition = 'IS NOT NULL'; + break; + // is NOT set + case self::OP_NOT_SET: + $condition = 'IS NULL'; + break; + // by default must not be null (!= null) + default: + $condition = 'IS NOT NULL'; + break; + } + } + + // if the condition is valid + if (!isEmptyString($condition)) $condition = ' '.$condition; // add a white space before + + return $condition; + } + + /** + * Search for a filter inside a list of filters by the given filter name + * Returns false if NOT found, otherwise the position inside the list + */ + private function _searchFilterByName($filters, $filterName) + { + $pos = false; + + for($i = 0; $i < count($filters); $i++) + { + if ($filters[$i]->name == $filterName) + { + $pos = $i; + break; + } + } + + return $pos; + } + + /** + * Remove from the session the given filter component + */ + private function _dropFromSessionFilterCmptById($filterId) + { + // Loads the session for all the filter components + $filterCmptsSession = getSession(self::SESSION_NAME); + + // If something is present in session + if ($filterCmptsSession != null) + { + // Loops in the session for all the filter components + foreach ($filterCmptsSession as $filterCmpt => $filterCmptData) + { + // If this filter component is not the one that we are looking for + if ($filterCmptData[self::FILTER_ID] == $filterId) + { + cleanSessionElement(self::SESSION_NAME, $filterCmpt); // ...remove it + break; // stop to search + } + } + } + } + + /** + * Calls the method _markRow and _formatRow to marks rows using markRow and format rowns using formatRow + * NOTE: this method operates directly on the retrieved dataset: parameter passed by reference + */ + private function _formatDataset(&$rawDataset) + { + if (hasData($rawDataset) && is_array($rawDataset->retval)) + { + // For each row of the data set + for ($rowCounter = 0; $rowCounter < count($rawDataset->retval); $rowCounter++) + { + // Calls the methods to mark and to format a row + // NOTE: keep this order! the markRow function given as parameter is supposing to work + // on a raw dataset, NOT on a formatted one + $rawDataset->retval[$rowCounter]->MARK_ROW_CLASS = $this->_markRow($rawDataset->retval[$rowCounter]); + $this->_formatRow($rawDataset->retval[$rowCounter]); + } + } + } + + /** + * Formats the columns of all the rows of the entire dataset + * - converts booleans into strings "true" and "false" + * - format dates using the format string defined in DEFAULT_DATE_FORMAT + * Calls the parameter formatRow if it was given and if it is a valid funtion + * NOTE: this method operates directly on the retrieved dataset: parameter passed by reference + */ + private function _formatRow(&$rawDatasetRow) + { + // For each column of the row + foreach ($rawDatasetRow as $columnName => $columnValue) + { + // Basic conversions + if (is_bool($columnValue)) + { + $rawDatasetRow->{$columnName} = ($columnValue === true ? 'true' : 'false'); + } + elseif (DateTime::createFromFormat('Y-m-d H:i:s', $columnValue) !== false) + { + $rawDatasetRow->{$columnName} = date(self::DEFAULT_DATE_FORMAT, strtotime($columnValue)); + } + } + + // If a valid function call the given formatRow + if ($this->_formatRow != null && is_callable($this->_formatRow)) + { + $formatRowFunction = $this->_formatRow; + $rawDatasetRow = $formatRowFunction($rawDatasetRow); + } + } + + /** + * Returns a string that contains a class name used to mark rows in the dataset table + * Calls the parameter markRow if it was given and if it is a valid funtion + */ + private function _markRow($rawDatasetRow) + { + // If a valid function call the given markRow + if ($this->_markRow != null && is_callable($this->_markRow)) + { + $markRowFunction = $this->_markRow; + $class = $markRowFunction($rawDatasetRow); + } + + return !isset($class) ? '' : $class; + } + + /** + * Utility method that retrieves the name of the columns present in a filter JSON definition + */ + private function _getColumnsNames($columns) + { + $columnsNames = array(); + + foreach ($columns as $key => $obj) + { + if (isset($obj->name)) + { + $columnsNames[] = $obj->name; + } + } + + return $columnsNames; + } +} + diff --git a/application/views/person/bpk/bpkData.php b/application/views/person/bpk/bpkData.php index 1c70b44a6..0dfef4c4b 100644 --- a/application/views/person/bpk/bpkData.php +++ b/application/views/person/bpk/bpkData.php @@ -77,3 +77,4 @@ echo $this->widgetlib->widget('FilterWidget', $filterWidgetArray); ?> + diff --git a/application/views/system/logs/logsViewer.php b/application/views/system/logs/logsViewer.php index 521e867b3..9f3e0a75b 100644 --- a/application/views/system/logs/logsViewer.php +++ b/application/views/system/logs/logsViewer.php @@ -7,6 +7,7 @@ 'tablesorter2' => true, 'vue3' => true, 'ajaxlib' => true, + 'jqueryui1' => true, 'filtercomponent' => true, 'navigationcomponent' => true, 'phrases' => array( @@ -21,8 +22,8 @@
- - + +
@@ -33,8 +34,8 @@
- - + +
diff --git a/application/views/templates/FHC-Footer.php b/application/views/templates/FHC-Footer.php index b9ac0134e..6d979abc1 100644 --- a/application/views/templates/FHC-Footer.php +++ b/application/views/templates/FHC-Footer.php @@ -82,7 +82,6 @@ { generateJSsInclude('vendor/mottie/tablesorter/dist/js/jquery.tablesorter.min.js'); generateJSsInclude('vendor/mottie/tablesorter/dist/js/jquery.tablesorter.widgets.min.js'); - generateJSsInclude('vendor/mottie/tablesorter/dist/js/extras/jquery.tablesorter.pager.min.js'); } // Tabulator 4 JS diff --git a/application/views/templates/FHC-Header.php b/application/views/templates/FHC-Header.php index 181796bfc..2c6e0dcaa 100644 --- a/application/views/templates/FHC-Header.php +++ b/application/views/templates/FHC-Header.php @@ -67,11 +67,7 @@ if ($captcha3 === true) generateCSSsInclude('vendor/dapphp/securimage/securimage.css'); // Table sorter CSS - if ($tablesorter2 === true) - { - generateCSSsInclude('vendor/mottie/tablesorter/dist/css/theme.default.min.css'); - generateCSSsInclude('vendor/mottie/tablesorter/dist/css/jquery.tablesorter.pager.min.css'); - } + if ($tablesorter2 === true) generateCSSsInclude('vendor/mottie/tablesorter/dist/css/theme.default.min.css'); // Tabulator 4 CSS if ($tabulator4 === true) From f3fe3aa0995b602a3a05beffebcd34eb54392487 Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 2 Jun 2022 10:34:45 +0200 Subject: [PATCH 005/137] New changes for the Navigation and Filter components --- public/js/apps/LogsViewer.js | 4 +- public/js/components/Filter.js | 72 +++++++++++++++++++++--------- public/js/components/Navigation.js | 11 ++++- 3 files changed, 62 insertions(+), 25 deletions(-) diff --git a/public/js/apps/LogsViewer.js b/public/js/apps/LogsViewer.js index 44e918432..21b63b1db 100644 --- a/public/js/apps/LogsViewer.js +++ b/public/js/apps/LogsViewer.js @@ -5,8 +5,8 @@ const logsViewerApp = Vue.createApp({ }; }, components: { - Navigation, - Filter + CoreNavigationCmpt, + CoreFilterCmpt }, methods: { newSideMenuEntryHandler(payload) { diff --git a/public/js/components/Filter.js b/public/js/components/Filter.js index 421ca2e6f..352eae553 100644 --- a/public/js/components/Filter.js +++ b/public/js/components/Filter.js @@ -1,4 +1,4 @@ -const Filter = { +const CoreFilterCmpt = { emits: ['nwNewEntry'], data() { return { @@ -9,16 +9,16 @@ const Filter = { }, created() { this.fetchFilterData(); + this.fetchFilterMenuData(); }, updated() { - var filterWidgetTablesorter = $("#filterTableDataset"); + let filterCmptTablesorter = $("#filterTableDataset"); // Checks if the table contains data (rows) - if (filterWidgetTablesorter.find("tbody:empty").length == 0 - && filterWidgetTablesorter.find("tr:empty").length == 0 - && filterWidgetTablesorter.hasClass("table-condensed")) + if (filterCmptTablesorter.find("tbody:empty").length == 0 + && filterCmptTablesorter.find("tr:empty").length == 0) { - filterWidgetTablesorter.tablesorter({ + filterCmptTablesorter.tablesorter({ dateFormat: "ddmmyyyy", widgets: ["zebra", "filter"], widgetOptions: { @@ -26,7 +26,7 @@ const Filter = { } }); - $.tablesorter.updateAll(filterWidgetTablesorter[0].config, true, null); + $.tablesorter.updateAll(filterCmptTablesorter[0].config, true, null); } }, props: { @@ -36,21 +36,9 @@ const Filter = { } }, methods: { - clkNewEntry() { - console.log('emit'); - this.$emit( - 'nwNewEntry', - { - "link": "#", - "description": 'New side menu ' + Math.floor(Math.random() * 10), - "icon": "dashboard", - "sort": 1 - } - ); - }, fetchFilterData() { FHC_AjaxClient.ajaxCallGet( - "widgets/Filters/getFilter", + "components/Filter/getFilter", { filterUniqueId: this.getFilterUniqueIdPrefix(), filterType: this.filterType, // props!! @@ -61,9 +49,52 @@ const Filter = { } ); }, + fetchFilterMenuData() { + FHC_AjaxClient.ajaxCallGet( + "components/Filter/generateFilterMenu", + { + filterUniqueId: this.getFilterUniqueIdPrefix(), + navigation_page: this.getNavigationPage() + }, + { + successCallback: this.setSideMenu + } + ); + }, + setSideMenu(data) { + // Set the menu + if (FHC_AjaxClient.hasData(data)) + { + let filters = FHC_AjaxClient.getData(data).filters; + let personalFilters = FHC_AjaxClient.getData(data).personalFilters; + let filtersArray = []; + + for (let filtersCount = 0; filtersCount < filters.length; filtersCount++) + { + filtersArray[filtersArray.length] = { + link: filters[filtersCount].link, + description: filters[filtersCount].desc, + sort: filtersCount + }; + } + + this.$emit( + 'nwNewEntry', + [{ + link: "#", + description: "Filters", + icon: "filter", + children: filtersArray + }] + ); + } + }, getFilterUniqueIdPrefix() { return FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method; }, + getNavigationPage: function() { + return FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method; + }, renderTableSorter(data) { if (FHC_AjaxClient.hasData(data)) @@ -106,7 +137,6 @@ const Filter = { } }, template: ` - diff --git a/public/js/components/Navigation.js b/public/js/components/Navigation.js index 852b0bd17..9c554217b 100644 --- a/public/js/components/Navigation.js +++ b/public/js/components/Navigation.js @@ -1,4 +1,4 @@ -const Navigation = { +const CoreNavigationCmpt = { data() { return { headerMenu: {}, @@ -60,9 +60,10 @@ const Navigation = { return this.headerMenu; }, sideMenuEntries() { + if (this.sideMenu != null && this.addSideMenuEntries != null && Object.keys(this.addSideMenuEntries).length > 0) { - this.sideMenu[this.addSideMenuEntries.description] = this.addSideMenuEntries; + this.sideMenu = this.addSideMenuEntries; } return this.sideMenu; } @@ -97,6 +98,12 @@ const Navigation = { {{ menu.description }} + From 618a62425b2e3dcf9080e1cb38c2f1ee4347e874 Mon Sep 17 00:00:00 2001 From: Paolo Date: Tue, 7 Jun 2022 14:56:33 +0200 Subject: [PATCH 006/137] Adapted composer.json and includes to be compatible to composer version 2 --- application/views/templates/FHC-Footer.php | 6 +- application/views/templates/FHC-Header.php | 4 +- application/views/templates/header.php | 5 +- composer.json | 33 +- composer.lock | 434 ++------------------- 5 files changed, 46 insertions(+), 436 deletions(-) diff --git a/application/views/templates/FHC-Footer.php b/application/views/templates/FHC-Footer.php index 6d979abc1..e2948d77b 100644 --- a/application/views/templates/FHC-Footer.php +++ b/application/views/templates/FHC-Footer.php @@ -71,10 +71,10 @@ // SB Admin 2 template JS if ($sbadmintemplate3 === true) { - generateJSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/vendor/metisMenu/metisMenu.min.js'); - generateJSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/dist/js/sb-admin-2.min.js'); + generateJSsInclude('vendor/blackrockdigital/startbootstrap-sb-admin-2/vendor/metisMenu/metisMenu.min.js'); + generateJSsInclude('vendor/blackrockdigital/startbootstrap-sb-admin-2/dist/js/sb-admin-2.min.js'); generateBackwardCompatibleJSMsIe('vendor/afarkas/html5shiv/dist/html5shiv.min.js'); - generateBackwardCompatibleJSMsIe('vendor/scottjehl/Respond/dest/respond.min.js'); + generateBackwardCompatibleJSMsIe('vendor/scottjehl/respond/dest/respond.min.js'); } // Table sorter JS diff --git a/application/views/templates/FHC-Header.php b/application/views/templates/FHC-Header.php index 2c6e0dcaa..228856091 100644 --- a/application/views/templates/FHC-Header.php +++ b/application/views/templates/FHC-Header.php @@ -59,8 +59,8 @@ // SB Admin 2 template CSS if ($sbadmintemplate3 === true) { - generateCSSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/vendor/metisMenu/metisMenu.min.css'); - generateCSSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/dist/css/sb-admin-2.min.css'); + generateCSSsInclude('vendor/blackrockdigital/startbootstrap-sb-admin-2/vendor/metisMenu/metisMenu.min.css'); + generateCSSsInclude('vendor/blackrockdigital/startbootstrap-sb-admin-2/dist/css/sb-admin-2.min.css'); } // Securimage CSS diff --git a/application/views/templates/header.php b/application/views/templates/header.php index fa2cc127a..c854892b0 100644 --- a/application/views/templates/header.php +++ b/application/views/templates/header.php @@ -41,12 +41,12 @@ if($jqueryV1 && $jqueryV2) show_error("Two JQuery versions used: composer and in - + - + @@ -117,3 +117,4 @@ if($jqueryV1 && $jqueryV2) show_error("Two JQuery versions used: composer and in + diff --git a/composer.json b/composer.json index f29a6b071..9513a85b4 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ { "type": "package", "package": { - "name": "alvaro-prieto/colResizable", + "name": "alvaro-prieto/colresizable", "version": "1.6", "dist": { "url": "https://github.com/alvaro-prieto/colResizable/archive/1.6.zip", @@ -40,7 +40,7 @@ { "type": "package", "package": { - "name": "BlackrockDigital/startbootstrap-sb-admin-2", + "name": "blackrockdigital/startbootstrap-sb-admin-2", "version": "3.3.7.1", "dist": { "url": "https://github.com/BlackrockDigital/startbootstrap-sb-admin-2/archive/v3.3.7+1.zip", @@ -118,7 +118,7 @@ { "type": "package", "package": { - "name": "jquery/jqueryV1", + "name": "jquery/jquery1", "version": "1.12.4", "dist": { "type": "file", @@ -129,7 +129,7 @@ { "type": "package", "package": { - "name": "jquery/jqueryV2", + "name": "jquery/jquery2", "version": "2.2.4", "dist": { "type": "file", @@ -240,7 +240,7 @@ { "type": "package", "package": { - "name": "scottjehl/Respond", + "name": "scottjehl/respond", "version": "1.4.2", "dist": { "url": "https://github.com/scottjehl/Respond/archive/1.4.2.zip", @@ -251,7 +251,7 @@ { "type": "package", "package": { - "name": "tapmodo/Jcrop", + "name": "tapmodo/jcrop", "version": "2.0.4", "dist": { "url": "https://github.com/tapmodo/Jcrop/archive/v2.0.4.zip", @@ -284,7 +284,7 @@ { "type": "package", "package": { - "name": "tomazdragar/SimpleCropper", + "name": "tomazdragar/simplecropper", "version": "1.0", "source": { "url": "https://github.com/tomazdragar/SimpleCropper.git", @@ -368,22 +368,17 @@ "vuejs/vuejs3": "3.2.33", - "zetacomponents/workflow": "1.*", - "zetacomponents/document": "1.*", - "zetacomponents/workflow-database-tiein": "1.*", - "zetacomponents/workflow-event-log-tiein": "1.*", + "alvaro-prieto/colresizable": "1.6", - "alvaro-prieto/colResizable": "1.6", - - "BlackrockDigital/startbootstrap-sb-admin-2": "3.3.*", + "blackrockdigital/startbootstrap-sb-admin-2": "3.3.*", "borgar/textile-js": "2.0.4", "fgelinas/timepicker": "0.3.3", "joeldbirch/superfish": "1.7.*", - "jquery/jqueryV1": "1.*", - "jquery/jqueryV2": "2.*", + "jquery/jquery1": "1.*", + "jquery/jquery2": "2.*", "jquery/sizzle": "1.0.*", "jquery-archive/jquery-metadata": "1.0.*", "json-forms": "1.4.0", @@ -400,10 +395,10 @@ "rmariuzzo/jquery-checkboxes": "1.0.7", - "scottjehl/Respond": "1.4.2", + "scottjehl/respond": "1.4.2", - "tapmodo/Jcrop": "2.0.4", - "tomazdragar/SimpleCropper": "1.0" + "tapmodo/jcrop": "2.0.4", + "tomazdragar/simplecropper": "1.0" }, "config": { "bin-dir": "vendor/bin" diff --git a/composer.lock b/composer.lock index e7e207c7d..a307addc6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,9 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "f35123d066def191c9f17dbbc4e78807", - "content-hash": "ddcd02108923c9169e0d3bcb3de85d70", + "hash": "b676b82ae026f2aab04de7e7054038a3", + "content-hash": "6f7d38a748ab2c18b1121ee5dd24aa05", "packages": [ - { - "name": "BlackrockDigital/startbootstrap-sb-admin-2", - "version": "3.3.7.1", - "dist": { - "type": "zip", - "url": "https://github.com/BlackrockDigital/startbootstrap-sb-admin-2/archive/v3.3.7+1.zip", - "reference": null, - "shasum": null - }, - "type": "library" - }, { "name": "afarkas/html5shiv", "version": "3.7.3", @@ -50,7 +39,7 @@ "time": "2015-07-20 20:04:00" }, { - "name": "alvaro-prieto/colResizable", + "name": "alvaro-prieto/colresizable", "version": "1.6", "dist": { "type": "zip", @@ -60,6 +49,17 @@ }, "type": "library" }, + { + "name": "blackrockdigital/startbootstrap-sb-admin-2", + "version": "3.3.7.1", + "dist": { + "type": "zip", + "url": "https://github.com/BlackrockDigital/startbootstrap-sb-admin-2/archive/v3.3.7+1.zip", + "reference": null, + "shasum": null + }, + "type": "library" + }, { "name": "borgar/textile-js", "version": "2.0.4", @@ -908,7 +908,7 @@ "type": "library" }, { - "name": "jquery/jqueryV1", + "name": "jquery/jquery1", "version": "1.12.4", "dist": { "type": "file", @@ -919,7 +919,7 @@ "type": "library" }, { - "name": "jquery/jqueryV2", + "name": "jquery/jquery2", "version": "2.2.4", "dist": { "type": "file", @@ -1521,7 +1521,7 @@ "type": "library" }, { - "name": "scottjehl/Respond", + "name": "scottjehl/respond", "version": "1.4.2", "dist": { "type": "zip", @@ -1594,7 +1594,7 @@ "time": "2020-10-23 09:01:57" }, { - "name": "tapmodo/Jcrop", + "name": "tapmodo/jcrop", "version": "2.0.4", "dist": { "type": "zip", @@ -1627,7 +1627,7 @@ "type": "library" }, { - "name": "tomazdragar/SimpleCropper", + "name": "tomazdragar/simplecropper", "version": "1.0", "source": { "type": "git", @@ -1732,392 +1732,6 @@ "shasum": null }, "type": "library" - }, - { - "name": "zetacomponents/base", - "version": "1.9.3", - "source": { - "type": "git", - "url": "https://github.com/zetacomponents/Base.git", - "reference": "2f432f4117a5aa2164d4fb1784f84db91dbdd3b8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zetacomponents/Base/zipball/2f432f4117a5aa2164d4fb1784f84db91dbdd3b8", - "reference": "2f432f4117a5aa2164d4fb1784f84db91dbdd3b8", - "shasum": "" - }, - "require-dev": { - "phpunit/phpunit": "~8.0", - "zetacomponents/unit-test": "*" - }, - "type": "library", - "autoload": { - "classmap": [ - "src" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Sergey Alexeev" - }, - { - "name": "Sebastian Bergmann" - }, - { - "name": "Jan Borsodi" - }, - { - "name": "Raymond Bosman" - }, - { - "name": "Frederik Holljen" - }, - { - "name": "Kore Nordmann" - }, - { - "name": "Derick Rethans" - }, - { - "name": "Vadym Savchuk" - }, - { - "name": "Tobias Schlitt" - }, - { - "name": "Alexandru Stanoi" - } - ], - "description": "The Base package provides the basic infrastructure that all packages rely on. Therefore every component relies on this package.", - "homepage": "https://github.com/zetacomponents", - "time": "2021-07-25 15:46:08" - }, - { - "name": "zetacomponents/database", - "version": "1.5.2", - "source": { - "type": "git", - "url": "https://github.com/zetacomponents/Database.git", - "reference": "85a2fd2af4e49f64d5c7616b6fb82c1b88de53b4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zetacomponents/Database/zipball/85a2fd2af4e49f64d5c7616b6fb82c1b88de53b4", - "reference": "85a2fd2af4e49f64d5c7616b6fb82c1b88de53b4", - "shasum": "" - }, - "require": { - "zetacomponents/base": "~1.8" - }, - "require-dev": { - "phpunit/phpunit": "~8.0", - "zetacomponents/database-schema": "~1.5", - "zetacomponents/unit-test": "*" - }, - "type": "library", - "autoload": { - "classmap": [ - "src" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Sergey Alexeev" - }, - { - "name": "Sebastian Bergmann" - }, - { - "name": "Jan Borsodi" - }, - { - "name": "Raymond Bosman" - }, - { - "name": "Frederik Holljen" - }, - { - "name": "Kore Nordmann" - }, - { - "name": "Derick Rethans" - }, - { - "name": "Vadym Savchuk" - }, - { - "name": "Tobias Schlitt" - }, - { - "name": "Alexandru Stanoi" - }, - { - "name": "Joel Arvidsson" - }, - { - "name": "Friedel Hill" - }, - { - "name": "Christian Michel" - } - ], - "description": "A lightweight database layer on top of PHP's PDO that allows you to utilize a database without having to take care of differences in SQL dialects.", - "homepage": "https://github.com/zetacomponents", - "time": "2022-02-11 17:18:33" - }, - { - "name": "zetacomponents/document", - "version": "1.3.3", - "source": { - "type": "git", - "url": "https://github.com/zetacomponents/Document.git", - "reference": "196884f00871ea7dcbca9ab8bc85716f626e9cc3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zetacomponents/Document/zipball/196884f00871ea7dcbca9ab8bc85716f626e9cc3", - "reference": "196884f00871ea7dcbca9ab8bc85716f626e9cc3", - "shasum": "" - }, - "require": { - "zetacomponents/base": "~1.8" - }, - "require-dev": { - "phpunit/phpunit": "~8.0", - "zetacomponents/unit-test": "*" - }, - "type": "library", - "autoload": { - "classmap": [ - "src" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Sebastian Bergmann" - }, - { - "name": "Kore Nordmann" - }, - { - "name": "Derick Rethans" - }, - { - "name": "Tobias Schlitt" - }, - { - "name": "Alexandru Stanoi" - } - ], - "description": "The Document components provides a general conversion framework for different semantic document markup languages like XHTML, Docbook, RST and similar.", - "homepage": "https://github.com/zetacomponents", - "time": "2022-02-11 17:26:31" - }, - { - "name": "zetacomponents/workflow", - "version": "1.5", - "source": { - "type": "git", - "url": "https://github.com/zetacomponents/Workflow.git", - "reference": "44744003c131acc35ee3275a568fbfcb215c3bc8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zetacomponents/Workflow/zipball/44744003c131acc35ee3275a568fbfcb215c3bc8", - "reference": "44744003c131acc35ee3275a568fbfcb215c3bc8", - "shasum": "" - }, - "require": { - "zetacomponents/base": "~1.8" - }, - "require-dev": { - "zetacomponents/unit-test": "*" - }, - "type": "library", - "autoload": { - "classmap": [ - "src" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Sergey Alexeev" - }, - { - "name": "Sebastian Bergmann" - }, - { - "name": "Jan Borsodi" - }, - { - "name": "Raymond Bosman" - }, - { - "name": "Frederik Holljen" - }, - { - "name": "Kore Nordmann" - }, - { - "name": "Derick Rethans" - }, - { - "name": "Vadym Savchuk" - }, - { - "name": "Tobias Schlitt" - }, - { - "name": "Alexandru Stanoi" - } - ], - "description": "The purpose of the Workflow component is to provide the core functionality of an activity-based workflow system including the definition and execution of workflow specifications.", - "homepage": "https://github.com/zetacomponents", - "time": "2014-09-27 19:26:10" - }, - { - "name": "zetacomponents/workflow-database-tiein", - "version": "1.5", - "source": { - "type": "git", - "url": "https://github.com/zetacomponents/WorkflowDatabaseTiein.git", - "reference": "953af80e8e642b41839275f11ff0301a2a267fde" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zetacomponents/WorkflowDatabaseTiein/zipball/953af80e8e642b41839275f11ff0301a2a267fde", - "reference": "953af80e8e642b41839275f11ff0301a2a267fde", - "shasum": "" - }, - "require": { - "zetacomponents/database": "~1.4", - "zetacomponents/workflow": "~1.4" - }, - "require-dev": { - "zetacomponents/unit-test": "*" - }, - "type": "library", - "autoload": { - "classmap": [ - "src" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Sergey Alexeev" - }, - { - "name": "Sebastian Bergmann" - }, - { - "name": "Jan Borsodi" - }, - { - "name": "Raymond Bosman" - }, - { - "name": "Frederik Holljen" - }, - { - "name": "Kore Nordmann" - }, - { - "name": "Derick Rethans" - }, - { - "name": "Vadym Savchuk" - }, - { - "name": "Tobias Schlitt" - }, - { - "name": "Alexandru Stanoi" - } - ], - "description": "Contains the database backend for the Workflow component.", - "homepage": "https://github.com/zetacomponents", - "time": "2014-09-27 19:26:10" - }, - { - "name": "zetacomponents/workflow-event-log-tiein", - "version": "1.1", - "source": { - "type": "git", - "url": "https://github.com/zetacomponents/WorkflowEventLogTiein.git", - "reference": "3e157156d1d5aaac6fadaee86c9b884c18a2b86f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zetacomponents/WorkflowEventLogTiein/zipball/3e157156d1d5aaac6fadaee86c9b884c18a2b86f", - "reference": "3e157156d1d5aaac6fadaee86c9b884c18a2b86f", - "shasum": "" - }, - "type": "library", - "autoload": { - "classmap": [ - "src" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "apache2" - ], - "authors": [ - { - "name": "Sergey Alexeev" - }, - { - "name": "Sebastian Bergmann" - }, - { - "name": "Jan Borsodi" - }, - { - "name": "Raymond Bosman" - }, - { - "name": "Frederik Holljen" - }, - { - "name": "Kore Nordmann" - }, - { - "name": "Derick Rethans" - }, - { - "name": "Vadym Savchuk" - }, - { - "name": "Tobias Schlitt" - }, - { - "name": "Alexandru Stanoi" - } - ], - "description": "Contains the EventLog listener for the Workflow component.", - "homepage": "https://github.com/zetacomponents", - "time": "2007-12-17 09:04:44" } ], "packages-dev": [ @@ -2223,16 +1837,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.13.2", + "version": "v4.14.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077" + "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/34bea19b6e03d8153165d8f30bba4c3be86184c1", + "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1", "shasum": "" }, "require": { @@ -2271,7 +1885,7 @@ "parser", "php" ], - "time": "2021-11-30 19:35:32" + "time": "2022-05-31 20:59:12" }, { "name": "pdepend/pdepend", From 9e48ba09d853c80a45d71eed598cdec162f2e559 Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 24 Jun 2022 14:55:04 +0200 Subject: [PATCH 007/137] - Moved GUI options from application/components/filters/LogsViewer.php to application/views/system/logs/logsViewer.php - Changed controller components/Filter to work with the new FilterComponent - Removed unused code from library libraries/FilterCmptLib - Changed library libraries/FilterCmptLib to work with the new changes in the controller components/Filter - Added new CSSs for the new FilterComponent and NavigationComponent --- application/components/filters/LogsViewer.php | 50 +- application/controllers/components/Filter.php | 150 ++-- application/libraries/FilterCmptLib.php | 745 ++++++------------ public/css/FilterComponent.css | 47 ++ public/css/NavigationComponent.css | 79 +- 5 files changed, 424 insertions(+), 647 deletions(-) create mode 100644 public/css/FilterComponent.css diff --git a/application/components/filters/LogsViewer.php b/application/components/filters/LogsViewer.php index 79e97f366..3a5390273 100644 --- a/application/components/filters/LogsViewer.php +++ b/application/components/filters/LogsViewer.php @@ -1,5 +1,8 @@ 'core', + 'datasetName' => 'logs', + //'filterKurzbz' => 'jobs48hours', // REMOVE ME 'query' => ' SELECT wsl.webservicelog_id AS "LogId", wsl.request_id AS "RequestId", @@ -11,51 +14,6 @@ FROM system.tbl_webservicelog wsl ORDER BY wsl.execute_time DESC ', - 'requiredPermissions' => 'admin', - 'datasetRepresentation' => 'tablesorter', - 'columnsAliases' => array( - 'Log id', - 'Request id', - 'Execution time', - 'Executed by', - 'Producer', - 'Data', - 'Webservice type' - ), - 'formatRow' => function($datasetRaw) { - - $datasetRaw->ExecutionTime = date_format(date_create($datasetRaw->ExecutionTime), 'd.m.Y H:i:s:u'); - - return $datasetRaw; - }, - 'markRow' => function($datasetRaw) { - - $mark = ''; - - if (strpos($datasetRaw->RequestId, 'error') != false) - { - $mark = 'text-red'; - } - - if (strpos($datasetRaw->RequestId, 'info') != false) - { - $mark = 'text-green'; - } - - if (strpos($datasetRaw->RequestId, 'warning') != false) - { - $mark = 'text-orange'; - } - - if (strpos($datasetRaw->RequestId, 'debug') != false) - { - $mark = 'text-info'; - } - - return $mark; - } + 'requiredPermissions' => 'admin' ); - $filterCmptArray['app'] = 'core'; - $filterCmptArray['datasetName'] = 'logs'; - diff --git a/application/controllers/components/Filter.php b/application/controllers/components/Filter.php index 94a3967ed..6d5df98b7 100644 --- a/application/controllers/components/Filter.php +++ b/application/controllers/components/Filter.php @@ -26,10 +26,7 @@ class Filter extends FHC_Controller $this->load->library('AuthLib'); // Loads the FilterCmptLib with HTTP GET/POST parameters - $this->_loadFilterCmptLib(); - - // Checks if the caller is allow to read this data - $this->_isAllowed(); + $this->_startFilterCmptLib(); } //------------------------------------------------------------------------------------------------------------------ @@ -43,22 +40,6 @@ class Filter extends FHC_Controller $this->outputJsonSuccess($this->filtercmptlib->getSession()); } - /** - * Retrieves the number of records present in the current dataset and will be written on the output in JSON format - */ - public function rowNumber() - { - $rowNumber = 0; - $dataset = $this->filtercmptlib->getSessionElement(FilterCmptLib::SESSION_DATASET); - - if (isset($dataset) && is_array($dataset)) - { - $rowNumber = count($dataset); - } - - $this->outputJsonSuccess($rowNumber); - } - /** * Change the sort of the selected fields of the current filter and * its data will be written on the output in JSON format @@ -87,11 +68,11 @@ class Filter extends FHC_Controller if ($this->filtercmptlib->removeSelectedField($selectedField) == true) { - $this->getFilter(); + $this->outputJsonSuccess('Field removed'); } else { - $this->outputJsonError('Wrong parameter'); + $this->outputJsonError('Error occurred'); } } @@ -104,70 +85,62 @@ class Filter extends FHC_Controller if ($this->filtercmptlib->addSelectedField($selectedField) == true) { - $this->getFilter(); + $this->outputJsonSuccess('Field added'); } else { - $this->outputJsonError('Wrong parameter'); + $this->outputJsonError('Error occurred'); } } /** * Remove an applied filter (SQL where condition) from the current filter */ - public function removeAppliedFilter() + public function removeFilterField() { - $appliedFilter = $this->input->post('appliedFilter'); + $appliedFilter = $this->input->post('filterField'); - if ($this->filtercmptlib->removeAppliedFilter($appliedFilter) == true) + if ($this->filtercmptlib->removeFilterField($appliedFilter) == true) { - $this->outputJsonSuccess('Removed'); + $this->outputJsonSuccess('Field removed'); } else { - $this->outputJsonError('Wrong parameter'); - } - } - - /** - * Apply all the applied filters (SQL where conditions) to the current filter - */ - public function applyFilters() - { - $appliedFilters = $this->input->post('appliedFilters'); - $appliedFiltersOperations = $this->input->post('appliedFiltersOperations'); - $appliedFiltersConditions = $this->input->post('appliedFiltersConditions'); - $appliedFiltersOptions = $this->input->post('appliedFiltersOptions'); - - if ($this->filtercmptlib->applyFilters( - $appliedFilters, - $appliedFiltersOperations, - $appliedFiltersConditions, - $appliedFiltersOptions - ) == true) - { - $this->outputJsonSuccess('Applied'); - } - else - { - $this->outputJsonError('Wrong parameter'); + $this->outputJsonError('Error occurred'); } } /** * Add a filter (SQL where clause) to be applied to the current filter */ - public function addFilter() + public function addFilterField() { - $filter = $this->input->post('filter'); + $filterField = $this->input->post('filterField'); - if ($this->filtercmptlib->addFilter($filter) == true) + if ($this->filtercmptlib->addFilterField($filterField) == true) { - $this->getFilter(); + $this->outputJsonSuccess('Field added'); } else { - $this->outputJsonError('Wrong parameter'); + $this->outputJsonError('Error occurred'); + } + } + + /** + * Apply the filter changes + */ + public function applyFilterFields() + { + $filterFields = $this->input->post('filterFields'); + + if ($this->filtercmptlib->applyFilterFields($filterFields) == true) + { + $this->outputJsonSuccess('Applied'); + } + else + { + $this->outputJsonError('Error occurred'); } } @@ -176,9 +149,9 @@ class Filter extends FHC_Controller */ public function saveCustomFilter() { - $customFilterDescription = $this->input->post('customFilterDescription'); + $customFilterName = $this->input->post('customFilterName'); - if ($this->filtercmptlib->saveCustomFilter($customFilterDescription) == true) + if ($this->filtercmptlib->saveCustomFilter($customFilterName) == true) { $this->outputJsonSuccess('Saved'); } @@ -215,41 +188,22 @@ class Filter extends FHC_Controller $this->outputJsonSuccess('Success'); } - /** - * Define the navigation menu for the current filter widget - */ - public function generateFilterMenu() - { - // Generates the filters menu - $this->outputJsonSuccess($this->filtercmptlib->generateFilterMenu($this->input->get(FilterCmptLib::NAVIGATION_PAGE))); - } - //------------------------------------------------------------------------------------------------------------------ // Private methods - /** - * Checks if the user is allowed to use this filter - */ - private function _isAllowed() - { - if (!$this->filtercmptlib->isAllowed()) - { - $this->terminateWithJsonError('You are not allowed to access to this content'); - } - } - /** * Loads the FilterCmptLib with the FILTER_UNIQUE_ID parameter * If the parameter FILTER_UNIQUE_ID is not given then the execution of the controller is terminated and * an error message is printed */ - private function _loadFilterCmptLib() + private function _startFilterCmptLib() { + $filterUniqueId = null; + $filterType = null; + // If the parameter FILTER_UNIQUE_ID is present in the HTTP GET or POST if (isset($_GET[self::FILTER_UNIQUE_ID]) || isset($_POST[self::FILTER_UNIQUE_ID])) { - $filterUniqueId = null; - // If it is present in the HTTP GET if (isset($_GET[self::FILTER_UNIQUE_ID])) { @@ -259,22 +213,15 @@ class Filter extends FHC_Controller { $filterUniqueId = $this->input->post(self::FILTER_UNIQUE_ID); // is retrieved from the HTTP POST } - - // Loads the FilterCmptLib that contains all the used logic - $this->load->library('FilterCmptLib'); - - $this->filtercmptlib->setFilterUniqueId($filterUniqueId); } else // Otherwise an error will be written in the output { $this->terminateWithJsonError('Parameter "'.self::FILTER_UNIQUE_ID.'" not provided!'); } - // If provided + // If the parameter FILTER_TYPE is present in the HTTP GET or POST if (isset($_GET[self::FILTER_TYPE]) || isset($_POST[self::FILTER_TYPE])) { - $filterType = null; - // If it is present in the HTTP GET if (isset($_GET[self::FILTER_TYPE])) { @@ -284,11 +231,24 @@ class Filter extends FHC_Controller { $filterType = $this->input->post(self::FILTER_TYPE); // is retrieved from the HTTP POST } - - $this->filtercmptlib->setFilterType($filterType); + } + else // Otherwise an error will be written in the output + { + $this->terminateWithJsonError('Parameter "'.self::FILTER_TYPE.'" not provided!'); } - $this->filtercmptlib->setFilterId($this->input->get('filterId')); + // Loads the FilterCmptLib that contains all the used logic + $this->load->library( + 'FilterCmptLib', + array( + 'filterUniqueId' => $filterUniqueId, + 'filterType' => $filterType, + 'filterId' => $this->input->get('filter_id') + ) + ); + + // + $this->filtercmptlib->start(); } } diff --git a/application/libraries/FilterCmptLib.php b/application/libraries/FilterCmptLib.php index 53020d358..5e413aee8 100644 --- a/application/libraries/FilterCmptLib.php +++ b/application/libraries/FilterCmptLib.php @@ -14,9 +14,6 @@ class FilterCmptLib const SESSION_FILTER_NAME = 'filterName'; const SESSION_FIELDS = 'fields'; const SESSION_SELECTED_FIELDS = 'selectedFields'; - const SESSION_COLUMNS_ALIASES = 'columnsAliases'; - const SESSION_ADDITIONAL_COLUMNS = 'additionalColumns'; - const SESSION_CHECKBOXES = 'checkboxes'; const SESSION_FILTERS = 'filters'; const SESSION_METADATA = 'datasetMetadata'; const SESSION_ROW_NUMBER = 'rowNumber'; @@ -25,9 +22,8 @@ class FilterCmptLib // Session dataset elements const SESSION_DATASET = 'dataset'; const SESSION_DATASET_RELOAD = 'reloadDataset'; - const SESSION_DATASET_REPRESENTATION = 'datasetRepresentation'; - const SESSION_DATASET_REP_OPTIONS = 'datasetRepresentationOptions'; - const SESSION_DATASET_REP_FIELDS_DEFS = 'datasetRepresentationFieldsDefinitions'; + + const SESSION_SIDE_MENU = 'sideMenu'; // Default session timeout const SESSION_DEFAULT_TIMEOUT = 30; @@ -52,34 +48,6 @@ class FilterCmptLib // ...stament to retrieve the dataset const QUERY = 'query'; - // ...to specify more columns or aliases for them - const ADDITIONAL_COLUMNS = 'additionalColumns'; - const CHECKBOXES = 'checkboxes'; - const COLUMNS_ALIASES = 'columnsAliases'; - - // ...to format/mark records of a dataset - const FORMAT_ROW = 'formatRow'; - const MARK_ROW = 'markRow'; - - // ...to hide the options for a filter - const HIDE_OPTIONS = 'hideOptions'; - const HIDE_SELECT_FIELDS = 'hideSelectFields'; - const HIDE_SELECT_FILTERS = 'hideSelectFilters'; - const HIDE_SAVE = 'hideSave'; - - const CUSTOM_MENU = 'customMenu'; // ...to specify if the menu for this filter is custom (true) or not (false) - const HIDE_MENU = 'hideMenu'; // ...to specify if the menu should be shown or not - - // ...to specify how to represent the dataset (ex: tablesorter, pivotUI, ...) - const DATASET_REPRESENTATION = 'datasetRepresentation'; - const DATASET_REP_OPTIONS = 'datasetRepOptions'; - const DATASET_REP_FIELDS_DEFS = 'datasetRepFieldsDefs'; - - // Different dataset representations - const DATASET_REP_TABLESORTER = 'tablesorter'; - const DATASET_REP_PIVOTUI = 'pivotUI'; - const DATASET_REP_TABULATOR = 'tabulator'; - // Filter operations values const OP_EQUAL = 'equal'; const OP_NOT_EQUAL = 'nequal'; @@ -105,20 +73,39 @@ class FilterCmptLib const PERMISSION_FILTER_METHOD = 'FilterCmpt'; // Name for fake method to be checked by the PermissionLib const PERMISSION_TYPE = 'r'; - // Navigation page parameter name - const NAVIGATION_PAGE = 'navigation_page'; - private $_ci; // Code igniter instance - private $_filterUniqueId; // unique id for this filter component + + private $_filterUniqueId; // Unique id for this filter component private $_filterType; // private $_filterId; // + private $_app; + private $_datasetName; + private $_filterKurzbz; + private $_query; + private $_requiredPermissions; + private $_reloadDataset; + private $_sessionTimeout; + /** * Gets the CI instance and loads message helper */ - public function __construct($params = null) + public function __construct($params) { $this->_ci =& get_instance(); // get code igniter instance + + // Set parameters + $this->_setParameters($params); + } + + /** + * + */ + private function _setParameters($params) + { + if (isset($params['filterUniqueId'])) $this->_filterUniqueId = $params['filterUniqueId']; + if (isset($params['filterType'])) $this->_filterType = $params['filterType']; + if (isset($params['filterId'])) $this->_filterId = $params['filterId']; } //------------------------------------------------------------------------------------------------------------------ @@ -131,25 +118,17 @@ class FilterCmptLib * then NO one is allow to use this FilterCmpt * Wrapper method to permissionlib->hasAtLeastOne */ - public function isAllowed() + private function _isAllowed() { $this->_ci->load->library('PermissionLib'); // Load permission library - // Gets the required permissions from the session if they are not provided as parameter - $rq = $this->getSessionElement(self::REQUIRED_PERMISSIONS); - - // - if ($rq == null) + if (!$this->_ci->permissionlib->hasAtLeastOne($this->_requiredPermissions, self::PERMISSION_FILTER_METHOD, self::PERMISSION_TYPE)) { - // - $this->_initFilterCmpt(); - // - $this->_startFilterCmpt(); - // Gets the required permissions from the session if they are not provided as parameter - $rq = $this->getSessionElement(self::REQUIRED_PERMISSIONS); + $this->setSession(error('The required permission is not help by the logged user')); + return false; } - return $this->_ci->permissionlib->hasAtLeastOne($rq, self::PERMISSION_FILTER_METHOD, self::PERMISSION_TYPE); + return true; } /** @@ -433,6 +412,35 @@ class FilterCmptLib return $sortSelectedFields; } + /** + * Add a field to the current filter + */ + public function addSelectedField($selectedField) + { + $removeSelectedField = false; + + // Checks the parameter selectedField + if (!isEmptyString($selectedField)) + { + // Retrieves all the used fields by the current filter + $fields = $this->getSessionElement(self::SESSION_FIELDS); + // Retrieves the selected fields by the current filter + $selectedFields = $this->getSessionElement(self::SESSION_SELECTED_FIELDS); + + // Checks that the given selected field is present in the list of all the used fields by the current filter + if (in_array($selectedField, $fields)) + { + array_push($selectedFields, $selectedField); // place the new filed at the end of the selected fields list + + $this->setSessionElement(self::SESSION_SELECTED_FIELDS, $selectedFields); // write changes into the session + + $removeSelectedField = true; + } + } + + return $removeSelectedField; + } + /** * Remove a selected field from the current filter */ @@ -468,43 +476,14 @@ class FilterCmptLib } /** - * Add a field to the current filter + * Add a filter (SQL where clause) to be applied to the current filter */ - public function addSelectedField($selectedField) + public function addFilterField($filterField) { - $removeSelectedField = false; + $addFilterField = false; - // Checks the parameter selectedField - if (!isEmptyString($selectedField)) - { - // Retrieves all the used fields by the current filter - $fields = $this->getSessionElement(self::SESSION_FIELDS); - // Retrieves the selected fields by the current filter - $selectedFields = $this->getSessionElement(self::SESSION_SELECTED_FIELDS); - - // Checks that the given selected field is present in the list of all the used fields by the current filter - if (in_array($selectedField, $fields)) - { - array_push($selectedFields, $selectedField); // place the new filed at the end of the selected fields list - - $this->setSessionElement(self::SESSION_SELECTED_FIELDS, $selectedFields); // write changes into the session - - $removeSelectedField = true; - } - } - - return $removeSelectedField; - } - - /** - * Remove an applied filter (SQL where condition) from the current filter - */ - public function removeAppliedFilter($appliedFilter) - { - $removeAppliedFilter = false; - - // Checks the parameter appliedFilter - if (!isEmptyString($appliedFilter)) + // Checks the parameter filter + if (!isEmptyString($filterField)) { // Retrieves all the used fields by the current filter $fields = $this->getSessionElement(self::SESSION_FIELDS); @@ -512,10 +491,53 @@ class FilterCmptLib $filters = $this->getSessionElement(self::SESSION_FILTERS); // Checks that the given applied filter is present in the list of all the used fields by the current filter - if (in_array($appliedFilter, $fields)) + if (in_array($filterField, $fields)) { // Search in what position the given applied filter is - $pos = $this->_searchFilterByName($filters, $appliedFilter); + $pos = $this->_searchFilterByName($filters, $filterField); + if ($pos === false) // If NOT found then add it + { + // New filter definition + $filterDefinition = new stdClass(); + // Sets filter definition required properties + $filterDefinition->name = $filterField; + // Sets filter definition optional properties + $filterDefinition->operation = null; + $filterDefinition->condition = null; + $filterDefinition->option = null; + // Place the new applied filter at the end of the applied filters list + array_push($filters, $filterDefinition); + } + + $this->setSessionElement(self::SESSION_FILTERS, $filters); // write changes into the session + + $addFilterField = true; + } + } + + return $addFilterField; + } + + /** + * Remove an applied filter (SQL where condition) from the current filter + */ + public function removeFilterField($filterField) + { + $removeFilterField = false; + + // Checks the parameter filterField + if (!isEmptyString($filterField)) + { + // Retrieves all the used fields by the current filter + $fields = $this->getSessionElement(self::SESSION_FIELDS); + // Retrieves the applied filters by the current filter + $filters = $this->getSessionElement(self::SESSION_FILTERS); + + // Checks that the given applied filter is present in the list of all the used fields by the current filter + if (in_array($filterField, $fields)) + { + // Search in what position the given applied filter is + $pos = $this->_searchFilterByName($filters, $filterField); if ($pos !== false) // If found { array_splice($filters, $pos, 1); // Then remove it and shift the rest of elements by one if needed @@ -525,54 +547,68 @@ class FilterCmptLib $this->setSessionElement(self::SESSION_FILTERS, $filters); $this->setSessionElement(self::SESSION_DATASET_RELOAD, true); // the dataset must be reloaded - $removeAppliedFilter = true; + $removeFilterField = true; } } - return $removeAppliedFilter; + return $removeFilterField; } /** * Apply all the applied filters (SQL where conditions) to the current filter */ - public function applyFilters($appliedFilters, $appliedFiltersOperations, $appliedFiltersConditions, $appliedFiltersOptions) + public function applyFilterFields($filterFields) { $applyFilters = false; - // Checks the required parameters: appliedFilters and appliedFiltersOperations - if (isset($appliedFilters) && is_array($appliedFilters) - && isset($appliedFiltersOperations) && is_array($appliedFiltersOperations)) + // Check if the parameter is an array and it is not empty + if (!isEmptyArray($filterFields)) { - $fields = $this->getSessionElement(self::SESSION_FIELDS); // Retrieves all the used fields by the current filter + $filters = array(); - // Checks that the given applied filters are present in all the used fields by the current filter - if (!array_diff($appliedFilters, $fields)) + // Check if the parameter is fine + $fine = true; + foreach ($filterFields as $filterField) { - $filters = array(); // starts building the new applied filters list - for ($i = 0; $i < count($appliedFilters); $i++) // loops through the given applied filters + // If not an empty array + if (!isEmptyArray($filterField)) { - $filterDefinition = new stdClass(); // new applied filter definition - - // Sets the filter definition required properties - $filterDefinition->name = $appliedFilters[$i]; - $filterDefinition->operation = $appliedFiltersOperations[$i]; - - // Sets the filter definition optional properties - $filterDefinition->condition = null; - if (isset($appliedFiltersConditions) && isset($appliedFiltersConditions[$i])) + // + if (isset($filterField['name']) && isset($filterField["operation"]) && isset($filterField["condition"]) + && !isEmptyString($filterField["name"]) && !isEmptyString($filterField["operation"]) + && !isEmptyString($filterField["condition"])) { - $filterDefinition->condition = $appliedFiltersConditions[$i]; + // Fine + $filter = new stdClass(); + $filter->name = $filterField['name']; + $filter->operation = $filterField['operation']; + $filter->condition = $filterField['condition']; + if (isset($filterField['option']) && !isEmptyString($filterField['option'])) + { + $filter->option = $filterField['option']; + } + else + { + $filter->option = null; + } + $filters[] = $filter; } - - $filterDefinition->option = null; - if (isset($appliedFiltersOptions) && isset($appliedFiltersOptions[$i])) + else // otherwise is not fine and stop checking { - $filterDefinition->option = $appliedFiltersOptions[$i]; + $fine = false; + break; } - - $filters[$i] = $filterDefinition; // adds the new definition to the list } + else // + { + $fine = false; + break; + } + } + // + if ($fine) + { // Write changes into the session $this->setSessionElement(self::SESSION_FILTERS, $filters); $this->setSessionElement(self::SESSION_DATASET_RELOAD, true); // the dataset must be reloaded @@ -592,49 +628,6 @@ class FilterCmptLib $this->setSessionElement(self::SESSION_DATASET_RELOAD, true); } - /** - * Add a filter (SQL where clause) to be applied to the current filter - */ - public function addFilter($filter) - { - $addFilter = false; - - // Checks the parameter filter - if (!isEmptyString($filter)) - { - // Retrieves all the used fields by the current filter - $fields = $this->getSessionElement(self::SESSION_FIELDS); - // Retrieves the applied filters by the current filter - $filters = $this->getSessionElement(self::SESSION_FILTERS); - - // Checks that the given applied filter is present in the list of all the used fields by the current filter - if (in_array($filter, $fields)) - { - // Search in what position the given applied filter is - $pos = $this->_searchFilterByName($filters, $filter); - if ($pos === false) // If NOT found then add it - { - // New filter definition - $filterDefinition = new stdClass(); - // Sets filter definition required properties - $filterDefinition->name = $filter; - // Sets filter definition optional properties - $filterDefinition->operation = null; - $filterDefinition->condition = null; - $filterDefinition->option = null; - // Place the new applied filter at the end of the applied filters list - array_push($filters, $filterDefinition); - } - - $this->setSessionElement(self::SESSION_FILTERS, $filters); // write changes into the session - - $addFilter = true; - } - } - - return $addFilter; - } - /** * Save the current filter as a custom filter for this user with the given description */ @@ -742,116 +735,50 @@ class FilterCmptLib return $removeCustomFilter; } - /** - * Return an unique string that identify this filter component - * NOTE: The default value is the URI where the FilterCmpt is called - * If the fhc_controller_id is present then is also used - */ - public function setFilterUniqueIdByParams($params) - { - if ($params != null - && is_array($params) - && isset($params[self::FILTER_UNIQUE_ID]) - && !isEmptyString($params[self::FILTER_UNIQUE_ID])) - { - $filterUniqueId = $params[self::FILTER_UNIQUE_ID]; - } - else - { - // Gets the current page URI - $filterUniqueId = $this->_ci->router->directory.$this->_ci->router->class.'/'.$this->_ci->router->method; - } - - $this->setFilterUniqueId($filterUniqueId); - } - - /** - * - */ - public function setFilterUniqueId($filterUniqueId) - { - // If the FHC_CONTROLLER_ID parameter is present in the HTTP GET - if (isset($_GET[self::FHC_CONTROLLER_ID])) - { - $filterUniqueId .= '/'.$this->_ci->input->get(self::FHC_CONTROLLER_ID); // then use it - } - elseif (isset($_POST[self::FHC_CONTROLLER_ID])) // else if the FHC_CONTROLLER_ID parameter is present in the HTTP POST - { - $filterUniqueId .= '/'.$this->_ci->input->post(self::FHC_CONTROLLER_ID); // then use it - } - - $this->_filterUniqueId = $filterUniqueId; - } - - /** - * - */ - public function setFilterType($filterType) - { - $this->_filterType = $filterType; - } - - /** - * - */ - public function setFilterId($filterId) - { - $this->_filterId = $filterId; - } - /** * Generates the filters menu structure array and stores it into the session */ - public function generateFilterMenu($navigationPage) + private function _generateFilterMenu($app, $datasetName) { $filterMenu = new stdClass(); $filterMenu->filters = array(); $filterMenu->personalFilters = array(); - $session = $this->getSession(); // The filter currently stored in session (the one that is currently used) - if ($session != null) + // Loads the Filters model + $this->_ci->load->model('system/Filters_model', 'FiltersModel'); + + // Loads all the filters related to this page (same dataset_name and same app name) + $filters = $this->_ci->FiltersModel->getFiltersByAppDatasetNamePersonId( + $app, + $datasetName, + getAuthPersonId() + ); + + // If filters were loaded + if (hasData($filters)) { - // Loads the Filters model - $this->_ci->load->model('system/Filters_model', 'FiltersModel'); + $childrenArray = array(); // contains all the children elements in a menu entry + $childrenPersonalArray = array(); // contains all the children elements in menu enty for personal filters - // Loads all the filters related to this page (same dataset_name and same app name) - $filters = $this->_ci->FiltersModel->getFiltersByAppDatasetNamePersonId( - $session[self::APP], - $session[self::DATASET_NAME], - getAuthPersonId() - ); - - // If filters were loaded - if (hasData($filters)) + // Loops through loaded filters + foreach (getData($filters) as $filter) { - $childrenArray = array(); // contains all the children elements in a menu entry - $childrenPersonalArray = array(); // contains all the children elements in menu enty for personal filters + $menuEntry = new stdClass(); + $menuEntry->desc = $filter->description[0]; + $menuEntry->filter_id = $filter->filter_id; - // Loops through loaded filters - foreach (getData($filters) as $filter) + // If it is NOT a personal filter + if ($filter->person_id == null) { - $menuEntry = new stdClass(); - $menuEntry->desc = $filter->description[0]; - $menuEntry->link = sprintf( - '%s?%s=%s', - site_url($navigationPage), - self::FILTER_ID, - $filter->{self::FILTER_ID} - ); + $filterMenu->filters[] = $menuEntry; + } + else // otherwise + { + $menuEntry->subscriptDescription = 'Remove'; + $menuEntry->subscriptLinkClass = 'remove-custom-filter'; + $menuEntry->subscriptLinkValue = $filter->{self::FILTER_ID}; - // If it is NOT a personal filter - if ($filter->person_id == null) - { - $filterMenu->filters[] = $menuEntry; - } - else // otherwise - { - $menuEntry->subscriptDescription = 'Remove'; - $menuEntry->subscriptLinkClass = 'remove-custom-filter'; - $menuEntry->subscriptLinkValue = $filter->{self::FILTER_ID}; - - $filterMenu->personalFilters[] = $menuEntry; // adds to personal filters menu array - } + $filterMenu->personalFilters[] = $menuEntry; // adds to personal filters menu array } } } @@ -862,11 +789,51 @@ class FilterCmptLib //------------------------------------------------------------------------------------------------------------------ // Private methods + /** + * Checks the required parameters used to call this FilterCmpt + */ + private function _checkJSParameters() + { + // + if (isEmptyString($this->_filterUniqueId)) + { + $this->setSession(error('Parameter "filterUniqueId" not provided')); + return false; + } + + // + if (isEmptyString($this->_filterType)) + { + $this->setSession(error('Parameter "filterType" not provided')); + return false; + } + + return true; + } + /** * Contains all the logic used to load all the data needed to the FilterCmpt */ - private function _startFilterCmpt() + public function start() { + // + if (!$this->_checkJSParameters()) return; + + // Gets the filter configuration from the file system + require_once(APPPATH.'components/filters/'.$this->_filterType.'.php'); + + // Gets the filter configuration from the extensions + // require_once(APPPATH.'components/extensions/'.$this->_filterType.'.php'); + + // + if (!$this->_checkPHPParameters($filterCmptArray)) return; + + // + $this->_initFilterCmpt($filterCmptArray); + + // + if (!$this->_isAllowed()) return; + // Looks for expired filter components in session and drops them $this->dropExpiredFilterCmpts(); @@ -908,8 +875,6 @@ class FilterCmptLib // Save changes into session if data are valid if (!isError($dataset)) { - $this->_formatDataset($dataset); // marks rows using markRow and format rowns using formatRow - // Set the new dataset and its attributes in the session $this->setSessionElement(FilterCmptLib::SESSION_METADATA, $this->_ci->FiltersModel->getExecutedQueryMetaData()); $this->setSessionElement(FilterCmptLib::SESSION_ROW_NUMBER, count($dataset->retval)); @@ -946,8 +911,6 @@ class FilterCmptLib // Save changes into session if data are valid if (!isError($dataset)) { - $this->_formatDataset($dataset); // marks rows using markRow and format rowns using formatRow - // Stores an array that contains all the data useful for $this->setSession( array( @@ -957,17 +920,12 @@ class FilterCmptLib FilterCmptLib::SESSION_FILTER_NAME => $filterName, // the current filter name FilterCmptLib::SESSION_FIELDS => $this->_ci->FiltersModel->getExecutedQueryListFields(), // all the fields of the dataset FilterCmptLib::SESSION_SELECTED_FIELDS => $this->_getColumnsNames($parsedFilterJson->columns), // all the selected fields - FilterCmptLib::SESSION_COLUMNS_ALIASES => $this->_columnsAliases, // all the fields aliases - FilterCmptLib::SESSION_ADDITIONAL_COLUMNS => $this->_additionalColumns, // additional columns - FilterCmptLib::SESSION_CHECKBOXES => $this->_checkboxes, // the name of the field used to build the checkboxes column FilterCmptLib::SESSION_FILTERS => $parsedFilterJson->filters, // all the filters used to filter the dataset FilterCmptLib::SESSION_METADATA => $this->_ci->FiltersModel->getExecutedQueryMetaData(), // the metadata of the dataset FilterCmptLib::SESSION_ROW_NUMBER => count($dataset->retval), // the number of loaded rows by this filter FilterCmptLib::SESSION_DATASET => $dataset->retval, // the entire dataset FilterCmptLib::SESSION_DATASET_RELOAD => false, // if the dataset must be reloaded, not needed the first time - FilterCmptLib::SESSION_DATASET_REPRESENTATION => $this->_datasetRepresentation, // the choosen dataset representation - FilterCmptLib::SESSION_DATASET_REP_OPTIONS => $this->_datasetRepresentationOptions, // the choosen dataset representation options - FilterCmptLib::SESSION_DATASET_REP_FIELDS_DEFS => $this->_datasetRepFieldsDefs // the choosen dataset representation record fields definition + FilterCmptLib::SESSION_SIDE_MENU => $this->_generateFilterMenu($this->_app, $this->_datasetName) ) ); } @@ -984,97 +942,67 @@ class FilterCmptLib /** * Checks the required parameters used to call this FilterCmpt */ - private function _checkParameters($filterCmptArray) + private function _checkPHPParameters($filterCmptArray) { // If no options are given to this component... if (!is_array($filterCmptArray) || (is_array($filterCmptArray) && count($filterCmptArray) == 0)) { - show_error('Second parameter of the component call must be a NOT empty associative array'); + $this->setSession(error('No parameters provided')); + return false; } else // ...otherwise { - // Parameters (app AND dataset name) OR filter id are mandatory - if ((!isset($filterCmptArray[FilterCmptLib::APP]) && !isset($filterCmptArray[FilterCmptLib::DATASET_NAME])) - && !isset($filterCmptArray[FilterCmptLib::FILTER_ID])) + // Parameters app AND dataset name + if (!isset($filterCmptArray[FilterCmptLib::APP]) && !isset($filterCmptArray[FilterCmptLib::DATASET_NAME])) { - show_error( - 'The parameters ("'.FilterCmptLib::APP.'" AND "'.FilterCmptLib::DATASET_NAME.') OR "'. - FilterCmptLib::FILTER_ID.'" must be specified' + $this->setSession( + error( + 'The parameters "'.FilterCmptLib::APP.'" AND "'.FilterCmptLib::DATASET_NAME.' must be specified' + ) ); + return false; } // The query parameter is mandatory if (!isset($filterCmptArray[FilterCmptLib::QUERY])) { - show_error('The parameter "'.FilterCmptLib::QUERY.'" must be specified'); + $this->setSession(error('The parameter "'.FilterCmptLib::QUERY.'" must be specified')); + return false; } - // The dataset representation parameter is mandatory - if (!isset($filterCmptArray[FilterCmptLib::DATASET_REPRESENTATION])) + // + if (!isset($filterCmptArray[FilterCmptLib::DATASET_NAME])) { - show_error('The parameter "'.FilterCmptLib::DATASET_REPRESENTATION.'" must be specified'); + $this->setSession(error('The parameter "'.FilterCmptLib::DATESET_NAME.'" must be specified')); + return false; } - // Checks if the dataset representation parameter is valid - if (isset($filterCmptArray[FilterCmptLib::DATASET_REPRESENTATION]) - && $filterCmptArray[FilterCmptLib::DATASET_REPRESENTATION] != FilterCmptLib::DATASET_REP_TABLESORTER - && $filterCmptArray[FilterCmptLib::DATASET_REPRESENTATION] != FilterCmptLib::DATASET_REP_PIVOTUI - && $filterCmptArray[FilterCmptLib::DATASET_REPRESENTATION] != FilterCmptLib::DATASET_REP_TABULATOR) + // + if (!isset($filterCmptArray[FilterCmptLib::REQUIRED_PERMISSIONS])) { - show_error( - 'The parameter "'.FilterCmptLib::DATASET_REPRESENTATION. - '" must be IN ("' - .FilterCmptLib::DATASET_REP_TABLESORTER.'", "' - .FilterCmptLib::DATASET_REP_PIVOTUI.'", "' - .FilterCmptLib::DATASET_REP_TABULATOR.'")' - ); - } - - // If given the session timeout parameter must be a number - if (isset($filterCmptArray[FilterCmptLib::SESSION_TIMEOUT]) && !is_numeric($filterCmptArray[FilterCmptLib::SESSION_TIMEOUT])) - { - show_error('The parameter "'.FilterCmptLib::SESSION_TIMEOUT.'" must be a number'); + $this->setSession(error('The parameter "'.FilterCmptLib::REQUIRED_PERMISSIONS.'" must be specified')); + return false; } } + + return true; } /** * Checks parameters and initialize all the properties of this FilterCmpt */ - private function _initFilterCmpt() + private function _initFilterCmpt($filterCmptArray) { - // Gets the filter configuration from the file system - require_once(APPPATH.'components/filters/'.$this->_filterType.'.php'); - - // Gets the filter configuration from the extensions - // require_once(APPPATH.'components/extensions/'.$this->_filterType.'.php'); - - $this->_checkParameters($filterCmptArray); - // If here then everything is ok // Initialize class properties - $this->_requiredPermissions = null; $this->_app = null; $this->_datasetName = null; $this->_filterKurzbz = null; - //$this->_filterId = null; - $this->_reloadDataset = true; // by default the dataset is NOT cached in session $this->_query = null; - $this->_additionalColumns = null; - $this->_columnsAliases = null; - $this->_formatRow = null; - $this->_markRow = null; - $this->_checkboxes = null; - $this->_hideOptions = null; - $this->_hideSelectFields = null; - $this->_hideSelectFilters = null; - $this->_hideSave = null; - $this->_hideMenu = null; - $this->_customMenu = null; - $this->_datasetRepresentation = null; - $this->_datasetRepresentationOptions = null; - $this->_datasetRepFieldsDefs = null; + $this->_requiredPermissions = null; + + $this->_reloadDataset = true; // by default the dataset is NOT cached in session $this->_sessionTimeout = FilterCmptLib::SESSION_DEFAULT_TIMEOUT; // Retrieved the required permissions parameter if present @@ -1099,119 +1027,11 @@ class FilterCmptLib $this->_filterKurzbz = $filterCmptArray[FilterCmptLib::FILTER_KURZBZ]; } - if (isset($filterCmptArray[FilterCmptLib::FILTER_ID])) - { - $this->_filterId = $filterCmptArray[FilterCmptLib::FILTER_ID]; - } - // How to retrieve data for the filter: SQL statement or a result from DB if (isset($filterCmptArray[FilterCmptLib::QUERY])) { $this->_query = $filterCmptArray[FilterCmptLib::QUERY]; } - - if (isset($filterCmptArray[FilterCmptLib::DATASET_RELOAD])) - { - $this->_reloadDataset = $filterCmptArray[FilterCmptLib::DATASET_RELOAD]; - } - - // Parameter is used to add extra columns to the dataset - if (isset($filterCmptArray[FilterCmptLib::ADDITIONAL_COLUMNS]) - && is_array($filterCmptArray[FilterCmptLib::ADDITIONAL_COLUMNS]) - && count($filterCmptArray[FilterCmptLib::ADDITIONAL_COLUMNS]) > 0) - { - $this->_additionalColumns = $filterCmptArray[FilterCmptLib::ADDITIONAL_COLUMNS]; - } - - // Parameter is used to add use aliases for the columns fo the dataset - if (isset($filterCmptArray[FilterCmptLib::COLUMNS_ALIASES]) - && is_array($filterCmptArray[FilterCmptLib::COLUMNS_ALIASES]) - && count($filterCmptArray[FilterCmptLib::COLUMNS_ALIASES]) > 0) - { - $this->_columnsAliases = $filterCmptArray[FilterCmptLib::COLUMNS_ALIASES]; - } - - // Parameter that contains a function to format the rows of the dataset - if (isset($filterCmptArray[FilterCmptLib::FORMAT_ROW]) && is_callable($filterCmptArray[FilterCmptLib::FORMAT_ROW])) - { - $this->_formatRow = $filterCmptArray[FilterCmptLib::FORMAT_ROW]; - } - - // Parameter that contains a function to mark in the GUI the rows of the dataset - if (isset($filterCmptArray[FilterCmptLib::MARK_ROW]) && is_callable($filterCmptArray[FilterCmptLib::MARK_ROW])) - { - $this->_markRow = $filterCmptArray[FilterCmptLib::MARK_ROW]; - } - - // Parameter used to specify the column of the dataset that will be used - // as id of the checkboxes column in the GUI - if (isset($filterCmptArray[FilterCmptLib::CHECKBOXES])) - { - $this->_checkboxes = $filterCmptArray[FilterCmptLib::CHECKBOXES]; - } - - // To specify if the filter options are shown ot not - if (isset($filterCmptArray[FilterCmptLib::HIDE_OPTIONS]) && is_bool($filterCmptArray[FilterCmptLib::HIDE_OPTIONS])) - { - $this->_hideOptions = $filterCmptArray[FilterCmptLib::HIDE_OPTIONS]; - } - - // To specify if the form to select fields is shown or not - if (isset($filterCmptArray[FilterCmptLib::HIDE_SELECT_FIELDS]) && is_bool($filterCmptArray[FilterCmptLib::HIDE_SELECT_FIELDS])) - { - $this->_hideSelectFields = $filterCmptArray[FilterCmptLib::HIDE_SELECT_FIELDS]; - } - - // To specify if the form to select filters is shown or not - if (isset($filterCmptArray[FilterCmptLib::HIDE_SELECT_FILTERS]) && is_bool($filterCmptArray[FilterCmptLib::HIDE_SELECT_FILTERS])) - { - $this->_hideSelectFilters = $filterCmptArray[FilterCmptLib::HIDE_SELECT_FILTERS]; - } - - // To specify if the form to save a custom FilterCmpt is shown or not - if (isset($filterCmptArray[FilterCmptLib::HIDE_SAVE]) && is_bool($filterCmptArray[FilterCmptLib::HIDE_SAVE])) - { - $this->_hideSave = $filterCmptArray[FilterCmptLib::HIDE_SAVE]; - } - - // If the menu should be shown or not - if (isset($filterCmptArray[FilterCmptLib::HIDE_MENU]) && is_bool($filterCmptArray[FilterCmptLib::HIDE_MENU])) - { - $this->_hideMenu = $filterCmptArray[FilterCmptLib::HIDE_MENU]; - } - - // If a custom menu is set - if (isset($filterCmptArray[FilterCmptLib::CUSTOM_MENU]) && is_bool($filterCmptArray[FilterCmptLib::CUSTOM_MENU])) - { - $this->_customMenu = $filterCmptArray[FilterCmptLib::CUSTOM_MENU]; - } - - // To specify how to represent the dataset (ex: tablesorter, pivotUI, ...) - if (isset($filterCmptArray[FilterCmptLib::DATASET_REPRESENTATION]) - && ($filterCmptArray[FilterCmptLib::DATASET_REPRESENTATION] == FilterCmptLib::DATASET_REP_TABLESORTER - || $filterCmptArray[FilterCmptLib::DATASET_REPRESENTATION] == FilterCmptLib::DATASET_REP_PIVOTUI - || $filterCmptArray[FilterCmptLib::DATASET_REPRESENTATION] == FilterCmptLib::DATASET_REP_TABULATOR)) - { - $this->_datasetRepresentation = $filterCmptArray[FilterCmptLib::DATASET_REPRESENTATION]; - } - - // To specify options for the dataset representation (ex: tablesorter, pivotUI, ...) - if (isset($filterCmptArray[FilterCmptLib::DATASET_REP_OPTIONS]) && !isEmptyString($filterCmptArray[FilterCmptLib::DATASET_REP_OPTIONS])) - { - $this->_datasetRepresentationOptions = $filterCmptArray[FilterCmptLib::DATASET_REP_OPTIONS]; - } - - // To specify how to represent each record field - if (isset($filterCmptArray[FilterCmptLib::DATASET_REP_FIELDS_DEFS]) && !isEmptyString($filterCmptArray[FilterCmptLib::DATASET_REP_FIELDS_DEFS])) - { - $this->_datasetRepFieldsDefs = $filterCmptArray[FilterCmptLib::DATASET_REP_FIELDS_DEFS]; - } - - // To specify the expiring session time - if (isset($filterCmptArray[FilterCmptLib::SESSION_TIMEOUT]) && is_numeric($filterCmptArray[FilterCmptLib::SESSION_TIMEOUT])) - { - $this->_sessionTimeout = $filterCmptArray[FilterCmptLib::SESSION_TIMEOUT]; - } } /** @@ -1353,73 +1173,6 @@ class FilterCmptLib } } - /** - * Calls the method _markRow and _formatRow to marks rows using markRow and format rowns using formatRow - * NOTE: this method operates directly on the retrieved dataset: parameter passed by reference - */ - private function _formatDataset(&$rawDataset) - { - if (hasData($rawDataset) && is_array($rawDataset->retval)) - { - // For each row of the data set - for ($rowCounter = 0; $rowCounter < count($rawDataset->retval); $rowCounter++) - { - // Calls the methods to mark and to format a row - // NOTE: keep this order! the markRow function given as parameter is supposing to work - // on a raw dataset, NOT on a formatted one - $rawDataset->retval[$rowCounter]->MARK_ROW_CLASS = $this->_markRow($rawDataset->retval[$rowCounter]); - $this->_formatRow($rawDataset->retval[$rowCounter]); - } - } - } - - /** - * Formats the columns of all the rows of the entire dataset - * - converts booleans into strings "true" and "false" - * - format dates using the format string defined in DEFAULT_DATE_FORMAT - * Calls the parameter formatRow if it was given and if it is a valid funtion - * NOTE: this method operates directly on the retrieved dataset: parameter passed by reference - */ - private function _formatRow(&$rawDatasetRow) - { - // For each column of the row - foreach ($rawDatasetRow as $columnName => $columnValue) - { - // Basic conversions - if (is_bool($columnValue)) - { - $rawDatasetRow->{$columnName} = ($columnValue === true ? 'true' : 'false'); - } - elseif (DateTime::createFromFormat('Y-m-d H:i:s', $columnValue) !== false) - { - $rawDatasetRow->{$columnName} = date(self::DEFAULT_DATE_FORMAT, strtotime($columnValue)); - } - } - - // If a valid function call the given formatRow - if ($this->_formatRow != null && is_callable($this->_formatRow)) - { - $formatRowFunction = $this->_formatRow; - $rawDatasetRow = $formatRowFunction($rawDatasetRow); - } - } - - /** - * Returns a string that contains a class name used to mark rows in the dataset table - * Calls the parameter markRow if it was given and if it is a valid funtion - */ - private function _markRow($rawDatasetRow) - { - // If a valid function call the given markRow - if ($this->_markRow != null && is_callable($this->_markRow)) - { - $markRowFunction = $this->_markRow; - $class = $markRowFunction($rawDatasetRow); - } - - return !isset($class) ? '' : $class; - } - /** * Utility method that retrieves the name of the columns present in a filter JSON definition */ diff --git a/public/css/FilterComponent.css b/public/css/FilterComponent.css new file mode 100644 index 000000000..eaa3de83f --- /dev/null +++ b/public/css/FilterComponent.css @@ -0,0 +1,47 @@ +.filter-header-title { + font-weight: bold; + font-size: 16px; + text-decoration: none; + color: #333; + font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; + padding-top: 0.75rem !important; + cursor: pointer; +} + +.filter-filter-options { + margin-bottom: 30px; +} + +.filter-options-div { + margin-bottom: 12px; + padding-bottom: 12px; + border-bottom-style: solid; + border-bottom-color: rgba(0, 0, 0, 0.125); + border-bottom-width: 1px; +} + +.filter-dnd-area { + height: 50px; + padding: 3px; + margin-bottom: 10px; +} + +.filter-dnd-object { + height: 100%; + margin-left: 7px; + padding: 11px; + display: inline-block; + background-color: white; + border-style: solid; + border-color: black; + border-width: 1px; + border-radius: 7px; + font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; + cursor: move; +} + +.filter-filter-fields { + margin-top: 12px; + margin-bottom: 12px; +} + diff --git a/public/css/NavigationComponent.css b/public/css/NavigationComponent.css index 64d908b02..3e2273b67 100644 --- a/public/css/NavigationComponent.css +++ b/public/css/NavigationComponent.css @@ -1,23 +1,82 @@ -.header-menu-link-entry { - font-size: 18px; - color: #5e5e5e !important; -} - +/* + * Hederer + */ .navbar-header { background-color: #f8f8f8; + padding-top: 0px; + padding-bottom: 0px; + padding-left: 10px; + border-style: solid; border-color: #e7e7e7; + border-width: 0 0 1px; } -.sidebar { +.header-menu-link-entry { + font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; + font-size: 18px; + line-height: 1.42857143; + color: #5e5e5e !important; + padding-top: 15px !important; + padding-right: 7px !important; + padding-left: 7px !important; +} + +.header-menu-icon { + top: 0px; + margin-right: 3px; + font-size: 16px; +} + +/* + * Left side + */ +.navbar-left-side { z-index: 1; position: absolute; width: 250px; + border-right: 1px solid #e7e7e7; + background-color: #f8f8f8; } +.navbar-left-side ul { + width: 250px; +} + +.navbar-left-side ul li { + border-bottom: 1px solid #e7e7e7; +} + +.left-side-menu-second-level { + padding-top: 0px !important; + padding-bottom: 0px !important; +} + +.left-side-menu-second-level li { + border-bottom: none !important; +} + +.left-side-menu-link-entry { + font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; + font-size: 14px; + line-height: 1.42857143; + color: #23527c; + padding-top: 10px !important; + padding-bottom: 10px !important; + padding-left: 7px !important; + padding-right: 7px !important; + text-decoration: none; +} + +.left-side-menu-link-entry:hover { + background-color: #eee; +} + +/* + * To be moved outside + */ #content { - position: inherit; - margin: 0 0 0 250px; - padding: 30px 30px; - border-left: 1px solid #e7e7e7; + position: inherit; + margin: 0 0 0 250px; + padding: 30px 30px; } From 24b78454d3b1d7cf96782a7a211ad11b5af69c2a Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 24 Jun 2022 15:07:50 +0200 Subject: [PATCH 008/137] - Added new function generateJSModulesInclude to application/helpers/hlp_header_helper.php - Added entry "customJSModules" to the application/views/templates/FHC-Footer.php to be passed to the generateJSModulesInclude function to generate JS modules tags - The new VUE components are making use of the JS import and export functionalities --- application/helpers/hlp_header_helper.php | 26 ++ application/views/system/logs/logsViewer.php | 46 ++- application/views/templates/FHC-Footer.php | 11 +- public/js/apps/LogsViewer.js | 3 + public/js/components/Filter.js | 362 ++++++++++++++++--- public/js/components/Navigation.js | 16 +- 6 files changed, 400 insertions(+), 64 deletions(-) diff --git a/application/helpers/hlp_header_helper.php b/application/helpers/hlp_header_helper.php index 203834ebb..5d197e3be 100644 --- a/application/helpers/hlp_header_helper.php +++ b/application/helpers/hlp_header_helper.php @@ -149,6 +149,31 @@ function generateJSsInclude($JSs) } } +/** + * Generates tags for the javascript modules you want to include, the parameter could by a string or an array of strings + */ +function generateJSModulesInclude($JSModules) +{ + $jsInclude = ''; + + $ci =& get_instance(); + $cachetoken = '?'.$ci->config->item('fhcomplete_build_version'); + + if (isset($JSModules)) + { + $tmpJSs = is_array($JSModules) ? $JSModules : array($JSModules); + + for ($tmpJSsCounter = 0; $tmpJSsCounter < count($tmpJSs); $tmpJSsCounter++) + { + $toPrint = sprintf($jsInclude, base_url($tmpJSs[$tmpJSsCounter].$cachetoken)).PHP_EOL; + + if ($tmpJSsCounter > 0) $toPrint = "\t\t".$toPrint; + + echo $toPrint; + } + } +} + /** * Generates all the includes needed by the Addons */ @@ -180,3 +205,4 @@ function generateBackwardCompatibleJSMsIe($js) echo ' '."\n"; echo "\n"; } + diff --git a/application/views/system/logs/logsViewer.php b/application/views/system/logs/logsViewer.php index 9f3e0a75b..4accde521 100644 --- a/application/views/system/logs/logsViewer.php +++ b/application/views/system/logs/logsViewer.php @@ -14,7 +14,7 @@ 'global' => array('mailAnXversandt'), 'ui' => array('bitteEintragWaehlen') ), - 'customJSs' => array('public/js/apps/LogsViewer.js') + 'customJSModules' => array('public/js/apps/LogsViewer.js') ); $this->load->view('templates/FHC-Header', $includesArray); @@ -36,6 +36,50 @@
+
diff --git a/application/views/templates/FHC-Footer.php b/application/views/templates/FHC-Footer.php index e2948d77b..2cbaf5753 100644 --- a/application/views/templates/FHC-Footer.php +++ b/application/views/templates/FHC-Footer.php @@ -15,6 +15,7 @@ // By default set the parameters to null $customJSs = isset($customJSs) ? $customJSs : null; + $customJSModules = isset($customJSModules) ? $customJSModules : null; // -------------------------------------------------------------------------------------------------------- // Javascripts @@ -118,24 +119,15 @@ // NOTE: to be used only if you know what you are doing! if ($bootstrapper === true) generateJSsInclude('public/js/bootstrapper.js'); - // VUE Navigation Component JS - if ($navigationcomponent === true) generateJSsInclude('public/js/components/Navigation.js'); - // NavigationWidget JS if ($navigationwidget === true) generateJSsInclude('public/js/NavigationWidget.js'); - // VUE Filter Component JS - if ($filtercomponent === true) generateJSsInclude('public/js/components/Filter.js'); - // FilterWidget JS if ($filterwidget === true) generateJSsInclude('public/js/FilterWidget.js'); // PhrasesLib JS if ($phrases != null) generateJSsInclude('public/js/PhrasesLib.js'); - // VUE Table Component JS - if ($tablecomponent === true) generateJSsInclude('public/js/components/Table.js'); - // TableWidget JS if ($tablewidget === true) generateJSsInclude('public/js/TableWidget.js'); @@ -149,6 +141,7 @@ // Eventually required JS // NOTE: keep it as the latest generateJSsInclude($customJSs); + generateJSModulesInclude($customJSModules); ?> diff --git a/public/js/apps/LogsViewer.js b/public/js/apps/LogsViewer.js index 21b63b1db..97ab3eac8 100644 --- a/public/js/apps/LogsViewer.js +++ b/public/js/apps/LogsViewer.js @@ -1,3 +1,6 @@ +import {CoreFilterCmpt} from '../components/Filter.js'; +import {CoreNavigationCmpt} from '../components/Navigation.js'; + const logsViewerApp = Vue.createApp({ data() { return { diff --git a/public/js/components/Filter.js b/public/js/components/Filter.js index 352eae553..9fb3015ec 100644 --- a/public/js/components/Filter.js +++ b/public/js/components/Filter.js @@ -1,15 +1,18 @@ -const CoreFilterCmpt = { +export const CoreFilterCmpt = { emits: ['nwNewEntry'], data() { return { + fields: null, fieldsToDisplay: null, dataset: null, - selectedFields: null + selectedFields: null, + notSelectedFields: null, + filterFields: null, + notFilterFields: null }; }, created() { - this.fetchFilterData(); - this.fetchFilterMenuData(); + this._fetchFilterData(); }, updated() { let filterCmptTablesorter = $("#filterTableDataset"); @@ -36,72 +39,179 @@ const CoreFilterCmpt = { } }, methods: { - fetchFilterData() { + saveCustomFilter(el) { + FHC_AjaxClient.ajaxCallPost( + "components/Filter/saveCustomFilter", + { + filterUniqueId: this._getCurrentPage(), + filterType: this.filterType, + customFilterName: document.getElementById('customFilterName').value + }, + { + successCallback: function(data) {console.log(data)} + } + ); + }, + applyFilterFields(el) { + let filterFields = []; + let filterFieldDivs = document.getElementById('filterFields').getElementsByTagName('div'); + + for (let i = 0; i < filterFieldDivs.length; i++) + { + let filterField = {}; + + for (let j = 0; j < filterFieldDivs[i].children.length; j++) + { + if (filterFieldDivs[i].children[j].name != null) + { + // Name + if (filterFieldDivs[i].children[j].name == 'fieldName') + { + filterField.name = filterFieldDivs[i].children[j].value; + } + // Operation + if (filterFieldDivs[i].children[j].name == 'operation') + { + filterField.operation = filterFieldDivs[i].children[j].value; + } + // Condition + if (filterFieldDivs[i].children[j].name == 'condition') + { + filterField.condition = filterFieldDivs[i].children[j].value; + } + // Option + if (filterFieldDivs[i].children[j].name == 'option') + { + filterField.option = filterFieldDivs[i].children[j].value; + } + } + } + + filterFields.push(filterField); + } + + FHC_AjaxClient.ajaxCallPost( + "components/Filter/applyFilterFields", + { + filterUniqueId: this._getCurrentPage(), + filterType: this.filterType, + filterFields: filterFields + }, + { + successCallback: this._fetchFilterData + } + ); + }, + addFilterField(el) { + FHC_AjaxClient.ajaxCallPost( + "components/Filter/addFilterField", + { + filterUniqueId: this._getCurrentPage(), + filterType: this.filterType, + filterField: el.currentTarget.value + }, + { + successCallback: this._fetchFilterData + } + ); + }, + addSelectedField(el) { + FHC_AjaxClient.ajaxCallPost( + "components/Filter/addSelectedField", + { + filterUniqueId: this._getCurrentPage(), + filterType: this.filterType, + selectedField: el.currentTarget.value + }, + { + successCallback: this._fetchFilterData + } + ); + }, + removeSelectedField(el) { + FHC_AjaxClient.ajaxCallPost( + "components/Filter/removeSelectedField", + { + filterUniqueId: this._getCurrentPage(), + filterType: this.filterType, + selectedField: el.currentTarget.getAttribute('field-to-remove') + }, + { + successCallback: this._fetchFilterData + } + ); + }, + removeFilterField(el) { + FHC_AjaxClient.ajaxCallPost( + "components/Filter/removeFilterField", + { + filterUniqueId: this._getCurrentPage(), + filterType: this.filterType, + filterField: el.currentTarget.getAttribute('field-to-remove') + }, + { + successCallback: this._fetchFilterData + } + ); + }, + fetchFilterDataById(el) { FHC_AjaxClient.ajaxCallGet( "components/Filter/getFilter", { - filterUniqueId: this.getFilterUniqueIdPrefix(), - filterType: this.filterType, // props!! - filterId: 170 + filterUniqueId: this._getCurrentPage(), + filterType: this.filterType, + filter_id: el.currentTarget.getAttribute("href").substring(1) }, { - successCallback: this.renderTableSorter + successCallback: this._render } ); }, - fetchFilterMenuData() { + _fetchFilterData() { FHC_AjaxClient.ajaxCallGet( - "components/Filter/generateFilterMenu", + "components/Filter/getFilter", { - filterUniqueId: this.getFilterUniqueIdPrefix(), - navigation_page: this.getNavigationPage() + filterUniqueId: this._getCurrentPage(), + filterType: this.filterType // props!! }, { - successCallback: this.setSideMenu + successCallback: this._render } ); }, - setSideMenu(data) { - // Set the menu - if (FHC_AjaxClient.hasData(data)) - { - let filters = FHC_AjaxClient.getData(data).filters; - let personalFilters = FHC_AjaxClient.getData(data).personalFilters; - let filtersArray = []; - - for (let filtersCount = 0; filtersCount < filters.length; filtersCount++) - { - filtersArray[filtersArray.length] = { - link: filters[filtersCount].link, - description: filters[filtersCount].desc, - sort: filtersCount - }; - } - - this.$emit( - 'nwNewEntry', - [{ - link: "#", - description: "Filters", - icon: "filter", - children: filtersArray - }] - ); - } - }, - getFilterUniqueIdPrefix() { + _getCurrentPage: function() { return FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method; }, - getNavigationPage: function() { - return FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method; - }, - renderTableSorter(data) { + _render(data) { if (FHC_AjaxClient.hasData(data)) { - this._setFieldsToDisplay(FHC_AjaxClient.getData(data)); this.dataset = FHC_AjaxClient.getData(data).dataset; + this.fields = FHC_AjaxClient.getData(data).fields; this.selectedFields = FHC_AjaxClient.getData(data).selectedFields; + this.notSelectedFields = this.fields.filter(x => this.selectedFields.indexOf(x) === -1); + + this.filterFields = []; + let tmpFilterFields = []; + for (let i = 0; i < FHC_AjaxClient.getData(data).datasetMetadata.length; i++) + { + for (let j = 0; j < FHC_AjaxClient.getData(data).filters.length; j++) + { + if (FHC_AjaxClient.getData(data).datasetMetadata[i].name == FHC_AjaxClient.getData(data).filters[j].name) + { + let filter = FHC_AjaxClient.getData(data).filters[j]; + filter.type = FHC_AjaxClient.getData(data).datasetMetadata[i].type; + + this.filterFields.push(filter); + tmpFilterFields.push(filter.name); + break; + } + } + } + + this.notFilterFields = this.fields.filter(x => tmpFilterFields.indexOf(x) === -1); + this._setFieldsToDisplay(FHC_AjaxClient.getData(data)); + this._setSideMenu(FHC_AjaxClient.getData(data)); } else { @@ -134,9 +244,165 @@ const CoreFilterCmpt = { } this.fieldsToDisplay = arrayFieldsToDisplay; + }, + _setSideMenu(data) { + // Set the menu + let filters = data.sideMenu.filters; + let personalFilters = data.sideMenu.personalFilters; + let filtersArray = []; + + for (let filtersCount = 0; filtersCount < filters.length; filtersCount++) + { + let link = filters[filtersCount].link; + + if (link == null) link = '#'; + + filtersArray[filtersArray.length] = { + link: link + filters[filtersCount].filter_id, + description: filters[filtersCount].desc, + sort: filtersCount, + onClickCall: this.fetchFilterDataById + }; + } + + this.$emit( + 'nwNewEntry', + [{ + link: "#", + description: "Filters", + icon: "filter", + children: filtersArray + }] + ); } }, template: ` +
+
+ Filter options +
+
+ +
+
+ +
+ +
+ + +
+
+ +
+
+ +
+
+ +
+
+ + +
+ + +
+
+
+
diff --git a/public/js/components/Navigation.js b/public/js/components/Navigation.js index 9c554217b..538268de8 100644 --- a/public/js/components/Navigation.js +++ b/public/js/components/Navigation.js @@ -1,4 +1,4 @@ -const CoreNavigationCmpt = { +export const CoreNavigationCmpt = { data() { return { headerMenu: {}, @@ -76,7 +76,7 @@ const CoreNavigationCmpt = {