From 1b49ea2a20469bac37567eda86d0e1f16d8a0c37 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Tue, 11 Oct 2022 08:23:49 +0200 Subject: [PATCH 001/263] - rt job angepasst --- .../controllers/jobs/ReihungstestJob.php | 44 +++++++++---------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/application/controllers/jobs/ReihungstestJob.php b/application/controllers/jobs/ReihungstestJob.php index ab6c429a0..58f84f830 100644 --- a/application/controllers/jobs/ReihungstestJob.php +++ b/application/controllers/jobs/ReihungstestJob.php @@ -727,33 +727,27 @@ class ReihungstestJob extends JOB_Controller tbl_reihungstest.reihungstest_id, tbl_studienplan.studienplan_id, tbl_reihungstest.studiensemester_kurzbz, - tbl_studienordnung.studiengang_kz + tbl_studienordnung.studiengang_kz, + tbl_studienplan.orgform_kurzbz FROM public.tbl_reihungstest - JOIN public.tbl_rt_studienplan ON(tbl_rt_studienplan.reihungstest_id=tbl_reihungstest.reihungstest_id) - JOIN lehre.tbl_studienplan USING(studienplan_id) - JOIN lehre.tbl_studienordnung USING(studienordnung_id) + JOIN public.tbl_rt_studienplan ON(tbl_rt_studienplan.reihungstest_id=tbl_reihungstest.reihungstest_id) + JOIN lehre.tbl_studienplan USING(studienplan_id) + JOIN lehre.tbl_studienordnung USING(studienordnung_id) WHERE - NOT EXISTS( - SELECT 1 FROM lehre.tbl_studienplan_semester - WHERE studienplan_id=tbl_rt_studienplan.studienplan_id - AND tbl_studienplan_semester.studiensemester_kurzbz=tbl_reihungstest.studiensemester_kurzbz - ) + EXISTS ( + SELECT studienplan_id + FROM lehre.tbl_studienordnung sordnung + JOIN lehre.tbl_studienplan USING (studienordnung_id) + JOIN lehre.tbl_studienplan_semester USING (studienplan_id) + WHERE sordnung.studiengang_kz = tbl_studienordnung.studiengang_kz + AND tbl_studienplan_semester.studiensemester_kurzbz = tbl_reihungstest.studiensemester_kurzbz + AND tbl_studienplan.studienplan_id NOT IN + ( + SELECT studienplan_id FROM tbl_rt_studienplan WHERE reihungstest_id = tbl_reihungstest.reihungstest_id + ) AND tbl_reihungstest.datum >= now() - AND NOT EXISTS( - SELECT - 1 - FROM - public.tbl_rt_studienplan rtstp - JOIN lehre.tbl_studienplan stp USING(studienplan_id) - JOIN lehre.tbl_studienordnung sto USING(studienordnung_id) - JOIN lehre.tbl_studienplan_semester stpsem USING(studienplan_id) - WHERE - sto.studiengang_kz=tbl_studienordnung.studiengang_kz - AND rtstp.reihungstest_id=tbl_reihungstest.reihungstest_id - AND stpsem.studiensemester_kurzbz=tbl_reihungstest.studiensemester_kurzbz - ) - "; + )"; $db = new DB_Model(); $result_rt = $db->execReadOnlyQuery($qry); @@ -763,7 +757,9 @@ class ReihungstestJob extends JOB_Controller // find an active studyplan for the same degree program with is valid in this semester $result_stpl = $this->StudienplanModel->getStudienplaeneBySemester( $row_rt->studiengang_kz, - $row_rt->studiensemester_kurzbz + $row_rt->studiensemester_kurzbz, + null, + $row_rt->orgform_kurzbz ); if (hasData($result_stpl)) { From a2c2eddf0dc8633eb7399b33d24de9f34be9d6b1 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 12 Oct 2022 11:18:05 +0200 Subject: [PATCH 002/263] - sql angepasst --- application/controllers/jobs/ReihungstestJob.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/controllers/jobs/ReihungstestJob.php b/application/controllers/jobs/ReihungstestJob.php index 58f84f830..97a78fc41 100644 --- a/application/controllers/jobs/ReihungstestJob.php +++ b/application/controllers/jobs/ReihungstestJob.php @@ -746,8 +746,8 @@ class ReihungstestJob extends JOB_Controller ( SELECT studienplan_id FROM tbl_rt_studienplan WHERE reihungstest_id = tbl_reihungstest.reihungstest_id ) - AND tbl_reihungstest.datum >= now() - )"; + ) + AND tbl_reihungstest.datum >= now()"; $db = new DB_Model(); $result_rt = $db->execReadOnlyQuery($qry); From 9c0d70fe890d234aa2b44086fcfec4be0074a714 Mon Sep 17 00:00:00 2001 From: Paolo Date: Tue, 8 Nov 2022 12:01:05 +0100 Subject: [PATCH 003/263] Removed version 4 of tinymce --- composer.json | 12 -- composer.lock | 424 +++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 386 insertions(+), 50 deletions(-) diff --git a/composer.json b/composer.json index 825ed5625..46f4edc39 100644 --- a/composer.json +++ b/composer.json @@ -270,17 +270,6 @@ } } }, - { - "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": { @@ -413,7 +402,6 @@ "scottjehl/respond": "1.4.2", "tapmodo/jcrop": "2.0.4", - "tinymce/tinymce4": "4.9.*", "tinymce/tinymce5": "5.10.*", "tomazdragar/simplecropper": "1.0", "twbs/bootstrap3": "3.4.*", diff --git a/composer.lock b/composer.lock index 72f13c76f..ce909eccc 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d530cc4d7bd81812535eb64e87ba04f4", + "content-hash": "269157583af475d4c8cd307400c7b248", "packages": [ { "name": "afarkas/html5shiv", @@ -35,6 +35,10 @@ ], "description": "Defacto way to enable use of HTML5 sectioning elements in legacy Internet Explorer.", "homepage": "http://paulirish.com/2011/the-history-of-the-html5-shiv/", + "support": { + "issues": "https://github.com/aFarkas/html5shiv/issues", + "source": "https://github.com/aFarkas/html5shiv/tree/3.7.3" + }, "time": "2015-07-20T20:04:00+00:00" }, { @@ -130,6 +134,16 @@ "keywords": [ "qr code" ], + "support": { + "issues": "https://github.com/chillerlan/php-qrcode/issues", + "source": "https://github.com/chillerlan/php-qrcode/tree/v2.0.x" + }, + "funding": [ + { + "url": "https://ko-fi.com/codemasher", + "type": "ko_fi" + } + ], "time": "2020-04-12T07:38:35+00:00" }, { @@ -178,6 +192,10 @@ "helper", "trait" ], + "support": { + "issues": "https://github.com/chillerlan/php-traits/issues", + "source": "https://github.com/chillerlan/php-traits" + }, "abandoned": true, "time": "2018-06-22T00:30:47+00:00" }, @@ -218,6 +236,10 @@ ], "description": "REST Server for the CodeIgniter framework", "homepage": "https://github.com/chriskacerguis/codeigniter-restserver", + "support": { + "issues": "https://github.com/chriskacerguis/codeigniter-restserver/issues", + "source": "https://github.com/chriskacerguis/codeigniter-restserver" + }, "time": "2017-09-23T16:44:55+00:00" }, { @@ -236,6 +258,10 @@ }, "type": "library", "notification-url": "https://packagist.org/downloads/", + "support": { + "issues": "https://github.com/akiyatkin/tablesorter/issues", + "source": "https://github.com/akiyatkin/tablesorter/tree/master" + }, "time": "2016-09-02T11:31:54+00:00" }, { @@ -269,6 +295,13 @@ ], "description": "The CodeIgniter framework", "homepage": "https://codeigniter.com", + "support": { + "forum": "http://forum.codeigniter.com/", + "issues": "https://github.com/bcit-ci/CodeIgniter/issues", + "slack": "https://codeigniterchat.slack.com", + "source": "https://github.com/bcit-ci/CodeIgniter", + "wiki": "https://github.com/bcit-ci/CodeIgniter/wiki" + }, "time": "2022-03-03T13:21:49+00:00" }, { @@ -573,6 +606,10 @@ ], "description": "Shim repository for Angular.js", "homepage": "http://angularjs.org", + "support": { + "issues": "https://github.com/components/angular.js/issues", + "source": "https://github.com/components/angular.js/tree/master" + }, "time": "2015-06-07T20:10:38+00:00" }, { @@ -615,6 +652,13 @@ ], "description": "jQuery JavaScript Library", "homepage": "http://jquery.com", + "support": { + "forum": "http://forum.jquery.com", + "irc": "irc://irc.freenode.org/jquery", + "issues": "https://github.com/jquery/jquery/issues", + "source": "https://github.com/jquery/jquery", + "wiki": "http://docs.jquery.com/" + }, "time": "2021-03-20T19:13:42+00:00" }, { @@ -700,6 +744,10 @@ } ], "description": "jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library. Whether you're building highly interactive web applications or you just need to add a date picker to a form control, jQuery UI is the perfect choice.", + "support": { + "issues": "https://github.com/components/jqueryui/issues", + "source": "https://github.com/components/jqueryui/tree/master" + }, "time": "2016-09-16T05:47:55+00:00" }, { @@ -749,6 +797,10 @@ "captcha", "security" ], + "support": { + "issues": "https://github.com/dapphp/securimage/issues", + "source": "https://github.com/dapphp/securimage/tree/master" + }, "abandoned": true, "time": "2018-03-09T06:07:41+00:00" }, @@ -812,6 +864,12 @@ "rdfa", "sparql" ], + "support": { + "forum": "http://groups.google.com/group/easyrdf/", + "irc": "irc://chat.freenode.net/easyrdf", + "issues": "http://github.com/njh/easyrdf/issues", + "source": "https://github.com/easyrdf/easyrdf/tree/0.9.1" + }, "time": "2015-02-27T09:45:49+00:00" }, { @@ -890,6 +948,10 @@ "faker", "fixtures" ], + "support": { + "issues": "https://github.com/fzaninotto/Faker/issues", + "source": "https://github.com/fzaninotto/Faker/tree/v1.9.2" + }, "abandoned": true, "time": "2020-12-11T09:56:16+00:00" }, @@ -1012,6 +1074,10 @@ "json", "schema" ], + "support": { + "issues": "https://github.com/justinrainbow/json-schema/issues", + "source": "https://github.com/justinrainbow/json-schema/tree/master" + }, "time": "2014-08-25T02:48:14+00:00" }, { @@ -1046,6 +1112,10 @@ } ], "description": "A framework-agnostic PHP Implementation for generating simple forms based on json-schema", + "support": { + "issues": "https://github.com/kingsquare/json-schema-form/issues", + "source": "https://github.com/kingsquare/json-schema-form/tree/master" + }, "time": "2014-07-10T12:27:19+00:00" }, { @@ -1106,6 +1176,10 @@ "keywords": [ "markdown" ], + "support": { + "issues": "https://github.com/michelf/php-markdown/issues", + "source": "https://github.com/michelf/php-markdown/tree/lib" + }, "time": "2015-03-01T12:03:08+00:00" }, { @@ -1153,20 +1227,24 @@ "uri", "url" ], + "support": { + "issues": "https://github.com/lanthaler/IRI/issues", + "source": "https://github.com/lanthaler/IRI/tree/master" + }, "time": "2014-01-21T13:43:39+00:00" }, { "name": "ml/json-ld", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/lanthaler/JsonLD.git", - "reference": "c74a1aed5979ed1cfb1be35a55a305fd30e30b93" + "reference": "537e68e87a6bce23e57c575cd5dcac1f67ce25d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lanthaler/JsonLD/zipball/c74a1aed5979ed1cfb1be35a55a305fd30e30b93", - "reference": "c74a1aed5979ed1cfb1be35a55a305fd30e30b93", + "url": "https://api.github.com/repos/lanthaler/JsonLD/zipball/537e68e87a6bce23e57c575cd5dcac1f67ce25d8", + "reference": "537e68e87a6bce23e57c575cd5dcac1f67ce25d8", "shasum": "" }, "require": { @@ -1202,7 +1280,11 @@ "JSON-LD", "jsonld" ], - "time": "2020-06-16T17:45:06+00:00" + "support": { + "issues": "https://github.com/lanthaler/JsonLD/issues", + "source": "https://github.com/lanthaler/JsonLD/tree/1.2.1" + }, + "time": "2022-09-29T08:45:17+00:00" }, { "name": "moment/momentjs", @@ -1262,6 +1344,14 @@ "sorting", "table" ], + "support": { + "docs": "https://mottie.github.io/tablesorter/docs/index.html", + "email": "wowmotty@gmail.com", + "irc": "irc://irc.freenode.org/tablesorter", + "issues": "https://github.com/Mottie/tablesorter/issues", + "source": "https://github.com/Mottie/tablesorter", + "wiki": "https://github.com/Mottie/tablesorter/wiki" + }, "time": "2020-03-03T13:46:03+00:00" }, { @@ -1312,6 +1402,10 @@ "rest", "restful" ], + "support": { + "issues": "https://github.com/nategood/httpful/issues", + "source": "https://github.com/nategood/httpful/tree/v0.2.20" + }, "time": "2015-10-26T16:11:30+00:00" }, { @@ -1365,6 +1459,12 @@ "plaintext", "textile" ], + "support": { + "irc": "irc://irc.freenode.net/textile", + "issues": "https://github.com/textile/php-textile/issues", + "source": "https://github.com/textile/php-textile", + "wiki": "https://github.com/textile/php-textile/wiki" + }, "time": "2022-05-01T17:05:16+00:00" }, { @@ -1420,16 +1520,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "2.0.37", + "version": "2.0.39", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "c812fbb4d6b4d7f30235ab7298a12f09ba13b37c" + "reference": "f3a0e2b715c40cf1fd270d444901b63311725d63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/c812fbb4d6b4d7f30235ab7298a12f09ba13b37c", - "reference": "c812fbb4d6b4d7f30235ab7298a12f09ba13b37c", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/f3a0e2b715c40cf1fd270d444901b63311725d63", + "reference": "f3a0e2b715c40cf1fd270d444901b63311725d63", "shasum": "" }, "require": { @@ -1444,7 +1544,8 @@ "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.", "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.", "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", - "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations." + "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations.", + "ext-xml": "Install the XML extension to load XML formatted public keys." }, "type": "library", "autoload": { @@ -1507,7 +1608,25 @@ "x.509", "x509" ], - "time": "2022-04-04T04:57:45+00:00" + "support": { + "issues": "https://github.com/phpseclib/phpseclib/issues", + "source": "https://github.com/phpseclib/phpseclib/tree/2.0.39" + }, + "funding": [ + { + "url": "https://github.com/terrafrost", + "type": "github" + }, + { + "url": "https://www.patreon.com/phpseclib", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib", + "type": "tidelift" + } + ], + "time": "2022-10-24T10:49:03+00:00" }, { "name": "rmariuzzo/jquery-checkboxes", @@ -1587,6 +1706,23 @@ "polyfill", "portable" ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.19.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-10-23T09:01:57+00:00" }, { @@ -1598,15 +1734,6 @@ }, "type": "library" }, - { - "name": "tinymce/tinymce4", - "version": "4.9.11", - "dist": { - "type": "zip", - "url": "https://github.com/tinymce/tinymce-dist/archive/refs/tags/4.9.11.zip" - }, - "type": "library" - }, { "name": "tinymce/tinymce5", "version": "5.10.3", @@ -1706,6 +1833,10 @@ "keywords": [ "templating" ], + "support": { + "issues": "https://github.com/twigphp/Twig/issues", + "source": "https://github.com/twigphp/Twig/tree/1.x" + }, "time": "2020-02-11T05:59:23+00:00" }, { @@ -1779,6 +1910,24 @@ "regex", "regular expression" ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/1.0.1" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], "time": "2022-01-21T20:24:37+00:00" }, { @@ -1826,20 +1975,39 @@ "Xdebug", "performance" ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/2.0.5" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], "time": "2022-02-24T20:20:32+00:00" }, { "name": "nikic/php-parser", - "version": "v4.14.0", + "version": "v4.15.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1" + "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/34bea19b6e03d8153165d8f30bba4c3be86184c1", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", + "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", "shasum": "" }, "require": { @@ -1878,20 +2046,24 @@ "parser", "php" ], - "time": "2022-05-31T20:59:12+00:00" + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.1" + }, + "time": "2022-09-04T07:30:47+00:00" }, { "name": "pdepend/pdepend", - "version": "2.10.3", + "version": "2.12.1", "source": { "type": "git", "url": "https://github.com/pdepend/pdepend.git", - "reference": "da3166a06b4a89915920a42444f707122a1584c9" + "reference": "7a892d56ceafd804b4a2ecc85184640937ce9e84" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pdepend/pdepend/zipball/da3166a06b4a89915920a42444f707122a1584c9", - "reference": "da3166a06b4a89915920a42444f707122a1584c9", + "url": "https://api.github.com/repos/pdepend/pdepend/zipball/7a892d56ceafd804b4a2ecc85184640937ce9e84", + "reference": "7a892d56ceafd804b4a2ecc85184640937ce9e84", "shasum": "" }, "require": { @@ -1925,26 +2097,36 @@ "BSD-3-Clause" ], "description": "Official version of pdepend to be handled with Composer", - "time": "2022-02-23T07:53:09+00:00" + "support": { + "issues": "https://github.com/pdepend/pdepend/issues", + "source": "https://github.com/pdepend/pdepend/tree/2.12.1" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/pdepend/pdepend", + "type": "tidelift" + } + ], + "time": "2022-09-08T19:30:37+00:00" }, { "name": "phpmd/phpmd", - "version": "2.12.0", + "version": "2.13.0", "source": { "type": "git", "url": "https://github.com/phpmd/phpmd.git", - "reference": "c0b678ba71902f539c27c14332aa0ddcf14388ec" + "reference": "dad0228156856b3ad959992f9748514fa943f3e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpmd/phpmd/zipball/c0b678ba71902f539c27c14332aa0ddcf14388ec", - "reference": "c0b678ba71902f539c27c14332aa0ddcf14388ec", + "url": "https://api.github.com/repos/phpmd/phpmd/zipball/dad0228156856b3ad959992f9748514fa943f3e3", + "reference": "dad0228156856b3ad959992f9748514fa943f3e3", "shasum": "" }, "require": { "composer/xdebug-handler": "^1.0 || ^2.0 || ^3.0", "ext-xml": "*", - "pdepend/pdepend": "^2.10.3", + "pdepend/pdepend": "^2.12.1", "php": ">=5.3.9" }, "require-dev": { @@ -1997,7 +2179,18 @@ "phpmd", "pmd" ], - "time": "2022-03-24T13:33:01+00:00" + "support": { + "irc": "irc://irc.freenode.org/phpmd", + "issues": "https://github.com/phpmd/phpmd/issues", + "source": "https://github.com/phpmd/phpmd/tree/2.13.0" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/phpmd/phpmd", + "type": "tidelift" + } + ], + "time": "2022-09-10T08:44:15+00:00" }, { "name": "phpmetrics/phpmetrics", @@ -2061,6 +2254,10 @@ "quality", "testing" ], + "support": { + "issues": "https://github.com/PhpMetrics/PhpMetrics/issues", + "source": "https://github.com/phpmetrics/PhpMetrics/tree/v2.8.1" + }, "time": "2022-03-24T10:19:51+00:00" }, { @@ -2110,6 +2307,10 @@ "keywords": [ "timer" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/master" + }, "time": "2017-02-26T11:10:40+00:00" }, { @@ -2159,6 +2360,10 @@ "container-interop", "psr" ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/master" + }, "time": "2017-02-14T16:28:37+00:00" }, { @@ -2206,6 +2411,9 @@ "psr", "psr-3" ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, "time": "2021-05-03T11:20:27+00:00" }, { @@ -2245,6 +2453,10 @@ ], "description": "FinderFacade is a convenience wrapper for Symfony's Finder component.", "homepage": "https://github.com/sebastianbergmann/finder-facade", + "support": { + "issues": "https://github.com/sebastianbergmann/finder-facade/issues", + "source": "https://github.com/sebastianbergmann/finder-facade/tree/master" + }, "abandoned": true, "time": "2017-11-18T17:31:49+00:00" }, @@ -2296,6 +2508,10 @@ ], "description": "Copy/Paste Detector (CPD) for PHP code.", "homepage": "https://github.com/sebastianbergmann/phpcpd", + "support": { + "issues": "https://github.com/sebastianbergmann/phpcpd/issues", + "source": "https://github.com/sebastianbergmann/phpcpd/tree/master" + }, "time": "2017-11-16T08:49:28+00:00" }, { @@ -2339,6 +2555,10 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/master" + }, "time": "2016-10-03T07:35:21+00:00" }, { @@ -2390,6 +2610,11 @@ "phpcs", "standards" ], + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, "time": "2021-12-12T21:44:58+00:00" }, { @@ -2449,6 +2674,23 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/config/tree/v3.4.47" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-10-24T10:57:07+00:00" }, { @@ -2516,6 +2758,23 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/console/tree/v3.4.47" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-10-24T10:57:07+00:00" }, { @@ -2567,6 +2826,23 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/debug/tree/v3.4.47" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "abandoned": "symfony/error-handler", "time": "2020-10-24T10:57:07+00:00" }, @@ -2634,6 +2910,23 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/dependency-injection/tree/v3.4.47" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-10-24T10:57:07+00:00" }, { @@ -2679,6 +2972,23 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v3.4.47" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-10-24T10:57:07+00:00" }, { @@ -2723,6 +3033,23 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v3.4.47" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-11-16T17:02:08+00:00" }, { @@ -2786,6 +3113,23 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.19.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-10-23T09:01:57+00:00" }, { @@ -2829,6 +3173,10 @@ ], "description": "The classes contained within this repository extend the standard DOM to use exceptions at all occasions of errors instead of PHP warnings or notices. They also add various custom methods and shortcuts for convenience and to simplify the usage of DOM.", "homepage": "https://github.com/theseer/fDOMDocument", + "support": { + "issues": "https://github.com/theseer/fDOMDocument/issues", + "source": "https://github.com/theseer/fDOMDocument/tree/1.6.7" + }, "abandoned": true, "time": "2022-01-25T23:10:35+00:00" } @@ -2842,5 +3190,5 @@ "php": ">=5.6.40" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.2.0" } From ac1df7691a72d95e33b48e33426ffdb3da03870e Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 11 Nov 2022 13:54:25 +0100 Subject: [PATCH 004/263] - Added new view application/views/system/messages/FAShtmlWriteTemplate.php to be used with FAS/SeaMonkey and TinyMCE3 - Replaced TinyMCE V4 with V5 - Dropped TinyMCE V4 - Added new JS public/js/messaging/fasMessageWrite.js to be included by application/views/system/messages/FAShtmlWriteTemplate.php --- .../system/messages/FASMessages.php | 4 +- application/views/person/bpk/bpkDetails.php | 1 - .../system/infocenter/infocenterDetails.php | 2 +- .../infocenter/infocenterZgvDetails.php | 2 +- .../system/messages/FAShtmlWriteTemplate.php | 197 ++++++++++++++++++ .../views/system/messages/ajaxRead.php | 2 +- .../views/system/messages/ajaxWrite.php | 2 +- .../views/system/messages/ajaxWriteReply.php | 2 +- .../views/system/messages/htmlWriteReply.php | 2 +- .../system/messages/htmlWriteTemplate.php | 2 +- .../views/system/vorlage/templatetextEdit.php | 2 +- application/views/templates/FHC-Common.php | 2 +- application/views/templates/FHC-Footer.php | 4 +- application/views/templates/FHC-Header.php | 3 - application/views/templates/header.php | 2 +- application/views/widgets/tinymce.php | 5 +- public/css/{TinyMCE.css => TinyMCE5.css} | 0 public/js/messaging/fasMessageWrite.js | 140 +++++++++++++ public/js/messaging/messageWrite.js | 11 +- public/js/messaging/write.js | 2 +- 20 files changed, 363 insertions(+), 24 deletions(-) create mode 100644 application/views/system/messages/FAShtmlWriteTemplate.php rename public/css/{TinyMCE.css => TinyMCE5.css} (100%) create mode 100644 public/js/messaging/fasMessageWrite.js diff --git a/application/controllers/system/messages/FASMessages.php b/application/controllers/system/messages/FASMessages.php index 55d1da25f..e2169af9b 100644 --- a/application/controllers/system/messages/FASMessages.php +++ b/application/controllers/system/messages/FASMessages.php @@ -37,7 +37,7 @@ class FASMessages extends Auth_Controller // Loads the view to write a new message with a template $this->load->view( - 'system/messages/htmlWriteTemplate', + 'system/messages/FAShtmlWriteTemplate', $this->CLMessagesModel->prepareHtmlWriteTemplatePrestudents($prestudents) ); } @@ -53,7 +53,7 @@ class FASMessages extends Auth_Controller // Loads the view to write a new message with a template $this->load->view( - 'system/messages/htmlWriteTemplate', + 'system/messages/FAShtmlWriteTemplate', $this->CLMessagesModel->prepareHtmlWriteTemplatePrestudents($prestudents, $message_id, $recipient_id) ); } diff --git a/application/views/person/bpk/bpkDetails.php b/application/views/person/bpk/bpkDetails.php index 198065c24..6b7d4430d 100644 --- a/application/views/person/bpk/bpkDetails.php +++ b/application/views/person/bpk/bpkDetails.php @@ -9,7 +9,6 @@ 'jqueryui1' => true, 'ajaxlib' => true, 'tablesorter2' => true, - 'tinymce4' => true, 'sbadmintemplate3' => true, 'addons' => true, 'navigationwidget' => true, diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php index 158feeb2c..15eca90c2 100644 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -8,7 +8,7 @@ 'dialoglib' => true, 'ajaxlib' => true, 'tablesorter2' => true, - 'tinymce4' => true, + 'tinymce5' => true, 'sbadmintemplate3' => true, 'addons' => true, 'navigationwidget' => true, diff --git a/application/views/system/infocenter/infocenterZgvDetails.php b/application/views/system/infocenter/infocenterZgvDetails.php index cf3ffad8b..bf9f69e18 100644 --- a/application/views/system/infocenter/infocenterZgvDetails.php +++ b/application/views/system/infocenter/infocenterZgvDetails.php @@ -10,7 +10,7 @@ 'dialoglib' => true, 'ajaxlib' => true, 'tablesorter2' => true, - 'tinymce4' => true, + 'tinymce5' => true, 'sbadmintemplate3' => true, 'addons' => true, 'navigationwidget' => true, diff --git a/application/views/system/messages/FAShtmlWriteTemplate.php b/application/views/system/messages/FAShtmlWriteTemplate.php new file mode 100644 index 000000000..691629c10 --- /dev/null +++ b/application/views/system/messages/FAShtmlWriteTemplate.php @@ -0,0 +1,197 @@ +load->view( + 'templates/FHC-Header', + array( + 'title' => 'Write a new message or reply using templates', + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'ajaxlib' => true, + 'fontawesome4' => true, + 'tinymce3' => true, + 'sbadmintemplate3' => true, + 'dialoglib' => true, + 'widgets' => true, + 'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messaging/message.css'), + 'customJSs' => array('public/js/bootstrapper.js', 'public/js/messaging/fasMessageWrite.js') + ) + ); +?> + +
+
+
+
+
+ +
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+   +
+ +
+
+
+
+
+
+ + +
+
+
+ + + 19 ? 19 : count($variables); + echo $this->widgetlib->widget( + 'MultipleDropdown_widget', + array('elements' => success($variables)), + array( + 'name' => 'variables[]', + 'id' => 'variables', + 'size' => $size, + 'multiple' => true + ) + ); + ?> +
+
+
+ + + 5 ? 5 : count($user_fields); + echo $this->widgetlib->widget( + 'MultipleDropdown_widget', + array('elements' => success($user_fields)), + array( + 'name' => 'user_fields[]', + 'id' => 'user_fields', + 'size' => $size, + 'multiple' => true + ) + ); + ?> +
+
+
+
+
+
+ + widgetlib->widget( + 'Vorlage_widget', + array('oe_kurzbz' => $organisationUnits, 'isAdmin' => $senderIsAdmin), + array('name' => 'vorlage', 'id' => 'vorlageDnD') + ); + ?> + +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+
+ widgetlib->widget( + 'Dropdown_widget', + array( + 'elements' => success($recipientsArray), + 'emptyElement' => ucfirst($this->p->t('global', 'empfaenger')).'...' + ), + array( + 'name' => 'recipients[]', + 'id' => 'recipients' + ) + ); + ?> + + + p->t('ui', 'refresh')); ?> + + +
+
+
+
+
+ +
+ + + + + +
+
+
+
+ + +load->view("templates/FHC-Footer"); ?> + diff --git a/application/views/system/messages/ajaxRead.php b/application/views/system/messages/ajaxRead.php index 2cb88708e..4c1a77deb 100644 --- a/application/views/system/messages/ajaxRead.php +++ b/application/views/system/messages/ajaxRead.php @@ -12,7 +12,7 @@ 'tabulator4' => true, 'ajaxlib' => true, 'dialoglib' => true, - 'tinymce4' => true, + 'tinymce5' => 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 3b1582f22..b3a598506 100644 --- a/application/views/system/messages/ajaxWrite.php +++ b/application/views/system/messages/ajaxWrite.php @@ -10,7 +10,7 @@ 'sbadmintemplate3' => true, 'ajaxlib' => true, 'dialoglib' => true, - 'tinymce4' => true, + 'tinymce5' => 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 0a496c93e..08dc188fa 100644 --- a/application/views/system/messages/ajaxWriteReply.php +++ b/application/views/system/messages/ajaxWriteReply.php @@ -10,7 +10,7 @@ 'sbadmintemplate3' => true, 'ajaxlib' => true, 'dialoglib' => true, - 'tinymce4' => true, + 'tinymce5' => 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/htmlWriteReply.php b/application/views/system/messages/htmlWriteReply.php index 9106d802b..d2150c1fb 100644 --- a/application/views/system/messages/htmlWriteReply.php +++ b/application/views/system/messages/htmlWriteReply.php @@ -6,7 +6,7 @@ 'jquery3' => true, 'bootstrap3' => true, 'fontawesome4' => true, - 'tinymce4' => true, + 'tinymce5' => 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 761e05f96..42a31f374 100644 --- a/application/views/system/messages/htmlWriteTemplate.php +++ b/application/views/system/messages/htmlWriteTemplate.php @@ -8,7 +8,7 @@ 'bootstrap3' => true, 'ajaxlib' => true, 'fontawesome4' => true, - 'tinymce4' => true, + 'tinymce5' => true, 'sbadmintemplate3' => true, 'dialoglib' => true, 'widgets' => true, diff --git a/application/views/system/vorlage/templatetextEdit.php b/application/views/system/vorlage/templatetextEdit.php index 42efc1519..cc2487959 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', 'tinymce4' => true, 'jsonforms' => true)); + $this->load->view('templates/header', array('title' => 'VorlageEdit', 'tinymce5' => true, 'jsonforms' => true)); ?>
diff --git a/application/views/templates/FHC-Common.php b/application/views/templates/FHC-Common.php index dd1d8ae1c..27282bc11 100644 --- a/application/views/templates/FHC-Common.php +++ b/application/views/templates/FHC-Common.php @@ -23,7 +23,7 @@ $tablesorter2 = isset($tablesorter2) ? $tablesorter2 : false; $tabulator4 = isset($tabulator4) ? $tabulator4 : false; $tabulator5 = isset($tabulator5) ? $tabulator5 : false; - $tinymce4 = isset($tinymce4) ? $tinymce4 : false; + $tinymce3 = isset($tinymce3) ? $tinymce3 : false; $tinymce5 = isset($tinymce5) ? $tinymce5 : false; $vue3 = isset($vue3) ? $vue3 : false; $primevue3 = isset($primevue3) ? $primevue3 : false; diff --git a/application/views/templates/FHC-Footer.php b/application/views/templates/FHC-Footer.php index 0c3782fea..ee13c69d2 100644 --- a/application/views/templates/FHC-Footer.php +++ b/application/views/templates/FHC-Footer.php @@ -100,8 +100,8 @@ // 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 3 JS + if ($tinymce3 === true) generateJSsInclude('include/tiny_mce/tiny_mce.js'); // Tinymce 5 JS if ($tinymce5 === true) generateJSsInclude('vendor/tinymce/tinymce5/tinymce.min.js'); diff --git a/application/views/templates/FHC-Header.php b/application/views/templates/FHC-Header.php index aa63541c5..47eea34ec 100644 --- a/application/views/templates/FHC-Header.php +++ b/application/views/templates/FHC-Header.php @@ -79,9 +79,6 @@ // 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'); diff --git a/application/views/templates/header.php b/application/views/templates/header.php index 637eb3c7a..e75acca4f 100644 --- a/application/views/templates/header.php +++ b/application/views/templates/header.php @@ -95,7 +95,7 @@ if($jqueryV1 && $jqueryV2) show_error("Two JQuery versions used: composer and in - + diff --git a/application/views/widgets/tinymce.php b/application/views/widgets/tinymce.php index 3e2093e55..618cb4836 100644 --- a/application/views/widgets/tinymce.php +++ b/application/views/widgets/tinymce.php @@ -5,5 +5,6 @@ plugins: [], toolbar: "" }); - - < name="" style="">> + +< name="" style="">> + diff --git a/public/css/TinyMCE.css b/public/css/TinyMCE5.css similarity index 100% rename from public/css/TinyMCE.css rename to public/css/TinyMCE5.css diff --git a/public/js/messaging/fasMessageWrite.js b/public/js/messaging/fasMessageWrite.js new file mode 100644 index 000000000..d32f80fac --- /dev/null +++ b/public/js/messaging/fasMessageWrite.js @@ -0,0 +1,140 @@ +// ******************************************************** +// JS used by view system/messages/htmlWriteTemplate +// ******************************************************** + +function tinymcePreviewSetContent() +{ + if ($("#tinymcePreview")) + { + if ($("#recipients").children(":selected").val() > -1) + { + parseMessageText($("#recipients").children(":selected").val(), tinyMCE.get("bodyTextArea").getContent()); + } + else + { + tinyMCE.get("tinymcePreview").setContent(""); + } + } +} + +function parseMessageText(receiver_id, text) +{ + FHC_AjaxClient.ajaxCallPost( + "system/messages/Messages/parseMessageText", + { + receiver_id: receiver_id, + text: text, + type: $("#type").val() + }, + { + successCallback: function(data, textStatus, jqXHR) { + + if (FHC_AjaxClient.hasData(data)) + { + tinyMCE.get("tinymcePreview").setContent(FHC_AjaxClient.getData(data)); + } + else if (FHC_AjaxClient.isError(data)) + { + FHC_DialogLib.alertError(data.retval); + } + } + } + ); +} + +$(document).ready(function () +{ + + tinymce.init({ + theme : "advanced", + mode : "textareas" + }); + + if ($("#variables")) + { + $("#variables").dblclick(function () + { + if ($("#bodyTextArea")) + { + //if editor active add at cursor position, otherwise at end + if (tinymce.activeEditor.id === "bodyTextArea") + tinymce.activeEditor.execCommand('mceInsertContent', false, $(this).children(":selected").val()); + else + tinyMCE.get("bodyTextArea").setContent(tinyMCE.get("bodyTextArea").getContent() + $(this).children(":selected").val()); + } + }); + } + + if ($("#user_fields")) + { + $("#user_fields").dblclick(function () + { + if ($("#bodyTextArea")) + { + //if editor active add at cursor position, otherwise at end + if (tinymce.activeEditor.id === "bodyTextArea") + tinymce.activeEditor.execCommand('mceInsertContent', false, $(this).children(":selected").val()); + else + tinyMCE.get("bodyTextArea").setContent(tinyMCE.get("bodyTextArea").getContent() + $(this).children(":selected").val()); + } + }); + } + + if ($("#recipients")) + { + $("#recipients").change(tinymcePreviewSetContent); + } + + if ($("#refresh")) + { + $("#refresh").click(tinymcePreviewSetContent); + } + + if ($("#sendButton") && $("#sendForm")) + { + $("#sendButton").click(function () + { + if ($("#subject") && $("#subject").val() != '' && tinyMCE.get("bodyTextArea").getContent() != '') + { + $("#sendForm").submit(); + } + else + { + FHC_DialogLib.alertInfo("Subject and text are required fields!"); + } + }); + } + + if ($("#vorlageDnD")) + { + $("#vorlageDnD").change(function () + { + var vorlage_kurzbz = this.value; + + if (vorlage_kurzbz != '') + { + FHC_AjaxClient.ajaxCallGet( + "system/messages/Messages/getVorlage", + { + vorlage_kurzbz: vorlage_kurzbz + }, + { + successCallback: function(data, textStatus, jqXHR) { + + if (FHC_AjaxClient.hasData(data)) + { + var msg = FHC_AjaxClient.getData(data); + + tinyMCE.get("bodyTextArea").setContent(msg[0].text); + $("#subject").val(msg[0].subject); + } + } + } + ); + } + }); + } + + $("#subject").focus(); + +}); diff --git a/public/js/messaging/messageWrite.js b/public/js/messaging/messageWrite.js index 8b1d73bdf..382e79948 100644 --- a/public/js/messaging/messageWrite.js +++ b/public/js/messaging/messageWrite.js @@ -42,8 +42,8 @@ function parseMessageText(receiver_id, text) ); } -$(document).ready(function () -{ +$(document).ready(function () { + tinymce.init({ selector: "#bodyTextArea", plugins: "autoresize", @@ -60,7 +60,12 @@ $(document).ready(function () menubar: false, toolbar: false, statusbar: false, - readonly: 1 + readonly: 1, + autoresize_on_init: false, + autoresize_min_height: 400, + autoresize_max_height: 700, + autoresize_bottom_margin: 10, + auto_focus: "bodyTextArea" }); if ($("#variables")) diff --git a/public/js/messaging/write.js b/public/js/messaging/write.js index 1370fb2e0..bff451c2e 100644 --- a/public/js/messaging/write.js +++ b/public/js/messaging/write.js @@ -63,7 +63,7 @@ $(document).ready(function () { tinymce.init({ selector: "#body", plugins: "autoresize", - autoresize_min_height: 150, + autoresize_min_height: 300, autoresize_max_height: 600, autoresize_bottom_margin: 10 }); From 3818d5221c1ad38c3fef01c077680c66b9ebf4e7 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 13 Dec 2022 10:49:35 +0100 Subject: [PATCH 005/263] first guess vertragsbestandteil library --- .../VertragsbestandteilTest.php | 87 +++++++++ .../Vertragsbestandteil.php | 170 ++++++++++++++++++ .../VertragsbestandteilFactory.php | 74 ++++++++ .../VertragsbestandteilFunktion.php | 90 ++++++++++ .../VertragsbestandteilLib.php | 106 +++++++++++ .../VertragsbestandteilStunden.php | 76 ++++++++ .../VertragsbestandteilFunktion_model.php | 18 ++ .../VertragsbestandteilStunden_model.php | 18 ++ .../Vertragsbestandteil_model.php | 63 +++++++ 9 files changed, 702 insertions(+) create mode 100644 application/controllers/jobs/vertragsbestandteil_test/VertragsbestandteilTest.php create mode 100644 application/libraries/vertragsbestandteil/Vertragsbestandteil.php create mode 100644 application/libraries/vertragsbestandteil/VertragsbestandteilFactory.php create mode 100644 application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php create mode 100644 application/libraries/vertragsbestandteil/VertragsbestandteilLib.php create mode 100644 application/libraries/vertragsbestandteil/VertragsbestandteilStunden.php create mode 100644 application/models/vertragsbestandteil/VertragsbestandteilFunktion_model.php create mode 100644 application/models/vertragsbestandteil/VertragsbestandteilStunden_model.php create mode 100644 application/models/vertragsbestandteil/Vertragsbestandteil_model.php diff --git a/application/controllers/jobs/vertragsbestandteil_test/VertragsbestandteilTest.php b/application/controllers/jobs/vertragsbestandteil_test/VertragsbestandteilTest.php new file mode 100644 index 000000000..407a5ba24 --- /dev/null +++ b/application/controllers/jobs/vertragsbestandteil_test/VertragsbestandteilTest.php @@ -0,0 +1,87 @@ +load->library('vertragsbestandteil/VertragsbestandteilLib', + null, 'VertragsbestandteilLib'); + } + + public function testFetch() + { + $dienstverhaeltnis_id = 1; + $stichtag = null; + + foreach($this->VertragsbestandteilLib->fetchVertragsbestandteile( + $dienstverhaeltnis_id, $stichtag) as $vertragsbestandteil) + { + //print_r($vertragsbestandteil); + echo $vertragsbestandteil . "\n"; + } + } + + public function testUpdate() + { + $now = new DateTime(); + + $data = new stdClass(); + $data->vertragsbestandteil_id = 32; + $data->von = '2022-12-05'; + + $data->wochenstunden = 45.0; + $data->vertragsbestandteiltyp_kurzbz = VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_STUNDEN; + + $vb = VertragsbestandteilFactory::getVertragsbestandteil($data); + + try + { + $this->VertragsbestandteilLib->storeVertragsbestandteil($vb); + echo "Update successful.\n"; + } + catch( Exception $ex ) + { + echo "Update failed.\n"; + } + } + + + public function testInsert() + { + $now = new DateTime(); + + $data = new stdClass(); + $data->dienstverhaeltnis_id = 1; + $data->von = '2022-12-01'; + $data->insertamum = $now->format(DateTime::ATOM); + $data->insertvon = 'ma0080'; + $data->vertragsbestandteiltyp_kurzbz = VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_FUNKTION; + + $data->benutzerfunktion_id = 112667; + $data->anmerkung = 'test funkton'; + $data->kuendigungsrelevant = false; + + $vb = VertragsbestandteilFactory::getVertragsbestandteil($data); + + try + { + $this->VertragsbestandteilLib->storeVertragsbestandteil($vb); + echo "Insert successful.\n"; + } + catch( Exception $ex ) + { + echo "Insert failed.\n"; + } + } +} diff --git a/application/libraries/vertragsbestandteil/Vertragsbestandteil.php b/application/libraries/vertragsbestandteil/Vertragsbestandteil.php new file mode 100644 index 000000000..a583c9190 --- /dev/null +++ b/application/libraries/vertragsbestandteil/Vertragsbestandteil.php @@ -0,0 +1,170 @@ +vertragsbestandteil_id) && $this->setVertragsbestandteil_id($data->vertragsbestandteil_id); + isset($data->dienstverhaeltnis_id) && $this->setDienstverhaeltnis_id($data->dienstverhaeltnis_id); + isset($data->von) && $this->setVon($data->von); + isset($data->bis) && $this->setBis($data->bis); + isset($data->insertamum) && $this->setInsertamum($data->insertamum); + isset($data->insertvon) && $this->setInsertvon($data->insertvon); + isset($data->updateamum) && $this->setUpdateamum($data->updateamum); + isset($data->updatevon) && $this->setUpdatevon($data->updatevon); + } + + public function getVertragsbestandteil_id() + { + return $this->vertragsbestandteil_id; + } + + public function getDienstverhaeltnis_id() + { + return $this->dienstverhaeltnis_id; + } + + public function getVon() + { + return $this->von; + } + + public function getBis() + { + return $this->bis; + } + + public function getVertragsbestandteiltyp_kurzbz() + { + return $this->vertragsbestandteiltyp_kurzbz; + } + + public function getInsertamum() + { + return $this->insertamum; + } + + public function getInsertvon() + { + return $this->insertvon; + } + + public function getUpdateamum() + { + return $this->updateamum; + } + + public function getUpdatevon() + { + return $this->updatevon; + } + + public function setVertragsbestandteil_id($vertragsbestandteil_id) + { + $this->vertragsbestandteil_id = $vertragsbestandteil_id; + return $this; + } + + public function setDienstverhaeltnis_id($dienstverhaeltnis_id) + { + $this->dienstverhaeltnis_id = $dienstverhaeltnis_id; + return $this; + } + + public function setVon($von) + { + $this->von = $von; + return $this; + } + + public function setBis($bis) + { + $this->bis = $bis; + return $this; + } + + public function setVertragsbestandteiltyp_kurzbz($vertragsbestandteiltyp_kurzbz) + { + $this->vertragsbestandteiltyp_kurzbz = $vertragsbestandteiltyp_kurzbz; + return $this; + } + + public function setInsertamum($insertamum) + { + $this->insertamum = $insertamum; + return $this; + } + + public function setInsertvon($insertvon) + { + $this->insertvon = $insertvon; + return $this; + } + + public function setUpdateamum($updateamum) + { + $this->updateamum = $updateamum; + return $this; + } + + public function setUpdatevon($updatevon) + { + $this->updatevon = $updatevon; + return $this; + } + + public function baseToStdClass() { + $tmp = array( + 'vertragsbestandteil_id' => $this->getVertragsbestandteil_id(), + 'dienstverhaeltnis_id' => $this->getDienstverhaeltnis_id(), + 'von' => $this->getVon(), + 'bis' => $this->getBis(), + 'vertragsbestandteiltyp_kurzbz' => $this->getVertragsbestandteiltyp_kurzbz(), + 'insertamum' => $this->getInsertamum(), + 'insertvon' => $this->getInsertvon(), + 'updateamum' => $this->getUpdateamum(), + 'updatevon' => $this->getUpdatevon(), + ); + + $tmp = array_filter($tmp, function($v) { + return !is_null($v); + }); + + return (object) $tmp; + } + + public function __toString() + { + return <<getVertragsbestandteil_id()} + dienstverhaeltnis_id: {$this->getDienstverhaeltnis_id()} + von: {$this->getVon()} + bis: {$this->getBis()} + vertragsbestandteiltyp_kurzbz: {$this->getVertragsbestandteiltyp_kurzbz()} + insertamum: {$this->getInsertamum()} + insertvon: {$this->getInsertvon()} + updateamum: {$this->getUpdateamum()} + updatevon: {$this->getUpdatevon()} + +EOTXT; + + } + + public abstract function toStdClass(); +} diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilFactory.php b/application/libraries/vertragsbestandteil/VertragsbestandteilFactory.php new file mode 100644 index 000000000..6a6fed451 --- /dev/null +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilFactory.php @@ -0,0 +1,74 @@ +vertragsbestandteiltyp_kurzbz) + ? $data->vertragsbestandteiltyp_kurzbz : false; + if( false === $vertragsbestandteiltyp_kurzbz ) + { + throw new Exception('Missing Parameter vertragsbestandteiltyp_kurzbz'); + } + + $vertragsbestandteil = null; + switch ($vertragsbestandteiltyp_kurzbz) + { + + case self::VERTRAGSBESTANDTEIL_STUNDEN: + $vertragsbestandteil = new VertragsbestandteilStunden(); + $vertragsbestandteil->hydrateByStdClass($data); + break; + + case self::VERTRAGSBESTANDTEIL_FUNKTION: + $vertragsbestandteil = new VertragsbestandteilFunktion(); + $vertragsbestandteil->hydrateByStdClass($data); + break; + + default: + throw new Exception('Unknown vertragsbestandteiltyp_kurzbz ' + . $vertragsbestandteiltyp_kurzbz); + } + + return $vertragsbestandteil; + } + + public static function getVertragsbestandteilDBModel($vertragsbestandteil_kurzbz) + { + $CI = get_instance(); + + $vertragsbestandteildbmodel = null; + switch ($vertragsbestandteil_kurzbz) + { + case self::VERTRAGSBESTANDTEIL_STUNDEN: + $CI->load->model('vertragsbestandteil/VertragsbestandteilStunden_model', + 'VertragsbestandteilStunden_model'); + $vertragsbestandteildbmodel = $CI->VertragsbestandteilStunden_model; + break; + + case self::VERTRAGSBESTANDTEIL_FUNKTION: + $CI->load->model('vertragsbestandteil/VertragsbestandteilFunktion_model', + 'VertragsbestandteilFunktion_model'); + $vertragsbestandteildbmodel = $CI->VertragsbestandteilFunktion_model; + break; + + default: + throw new Exception('Unknown vertragsbestandteil_kurzbz ' + . $vertragsbestandteil_kurzbz); + } + + return $vertragsbestandteildbmodel; + } +} diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php b/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php new file mode 100644 index 000000000..d59e1b158 --- /dev/null +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php @@ -0,0 +1,90 @@ +setVertragsbestandteiltyp_kurzbz( + VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_FUNKTION); + } + + public function toStdClass() + { + $tmp = array( + 'vertragsbestandteil_id' => $this->getVertragsbestandteil_id(), + 'benutzerfunktion_id' => $this->getBenutzerfunktion_id(), + 'anmerkung' => $this->getAnmerkung(), + 'kuendigungsrelevant' => $this->getKuendigungsrelevant() + ); + + $tmp = array_filter($tmp, function($v) { + return !is_null($v); + }); + + return (object) $tmp; + } + + public function __toString() + { + $txt = <<getBenutzerfunktion_id()} + anmerkung: {$this->getAnmerkung()} + kuendigungsrelevant: {$this->getKuendigungsrelevant()} + +EOTXT; + return parent::__toString() . $txt; + } + + public function hydrateByStdClass($data) + { + parent::hydrateByStdClass($data); + isset($data->benutzerfunktion_id) && $this->setBenutzerfunktion_id($data->benutzerfunktion_id); + isset($data->anmerkung) && $this->setAnmerkung($data->anmerkung); + isset($data->kuendigungsrelevant) && $this->setKuendigungsrelevant($data->kuendigungsrelevant); + } + + public function getBenutzerfunktion_id() + { + return $this->benutzerfunktion_id; + } + + public function getAnmerkung() + { + return $this->anmerkung; + } + + public function getKuendigungsrelevant() + { + return $this->kuendigungsrelevant; + } + + public function setBenutzerfunktion_id($benutzerfunktion_id) + { + $this->benutzerfunktion_id = $benutzerfunktion_id; + return $this; + } + public function setAnmerkung($anmerkung) + { + $this->anmerkung = $anmerkung; + return $this; + } + + public function setKuendigungsrelevant($kuendigungsrelevant) + { + $this->kuendigungsrelevant = $kuendigungsrelevant; + return $this; + } +} diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php new file mode 100644 index 000000000..0be539a96 --- /dev/null +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php @@ -0,0 +1,106 @@ +CI = get_instance(); + $this->CI->load->model('vertragsbestandteil/Vertragsbestandteil_model', + 'VertragsbestandteilModel'); + $this->VertragsbestandteilModel = $this->CI->VertragsbestandteilModel; + } + + public function fetchVertragsbestandteile($dienstverhaeltnis_id, $stichtag=null) + { + return $this->VertragsbestandteilModel->getVertragsbestandteile($dienstverhaeltnis_id, $stichtag); + } + + public function storeVertragsbestandteil(Vertragsbestandteil $vertragsbestandteil) + { + $this->CI->db->trans_begin(); + try + { + if( intval($vertragsbestandteil->getVertragsbestandteil_id()) > 0 ) + { + $this->updateVertragsbestandteil($vertragsbestandteil); + } + else + { + $this->insertVertragsbestandteil($vertragsbestandteil); + } + if( $this->CI->db->trans_status() === false ) + { + log_message('debug', "Transaction failed"); + throw new Exception("Transaction failed"); + } + $this->CI->db->trans_commit(); + } + catch (Exception $ex) + { + log_message('debug', "Transaction rolled back. " . $ex->getMessage()); + $this->CI->db->trans_rollback(); + } + } + + protected function insertVertragsbestandteil(Vertragsbestandteil $vertragsbestandteil) + { + $ret = $this->VertragsbestandteilModel->insert($vertragsbestandteil->baseToStdClass()); + if( hasData($ret) ) + { + $vertragsbestandteil->setVertragsbestandteil_id(getData($ret)); + } + else + { + throw new Exception('error inserting vertragsbestandteil'); + } + + $specialisedModel = VertragsbestandteilFactory::getVertragsbestandteilDBModel( + $vertragsbestandteil->getVertragsbestandteiltyp_kurzbz()); + $retspecial = $specialisedModel->insert($vertragsbestandteil->toStdClass()); + + if(isError($retspecial) ) + { + throw new Exception('error updating vertragsbestandteil ' + . $vertragsbestandteil->getVertragsbestandteiltyp_kurzbz()); + } + } + + protected function updateVertragsbestandteil(Vertragsbestandteil $vertragsbestandteil) + { + $vertragsbestandteil->setUpdateamum(strftime('%Y-%m-%d %H:%M')) + ->setUpdatevon('ma0080'); + $ret = $this->VertragsbestandteilModel->update($vertragsbestandteil->getVertragsbestandteil_id(), + $vertragsbestandteil->baseToStdClass()); + + if(isError($ret) ) + { + throw new Exception('error updating vertragsbestandteil'); + } + + $specialisedModel = VertragsbestandteilFactory::getVertragsbestandteilDBModel( + $vertragsbestandteil->getVertragsbestandteiltyp_kurzbz()); + $retspecial = $specialisedModel->update($vertragsbestandteil->getVertragsbestandteil_id(), + $vertragsbestandteil->toStdClass()); + + if(isError($retspecial) ) + { + throw new Exception('error updating vertragsbestandteil ' + . $vertragsbestandteil->getVertragsbestandteiltyp_kurzbz()); + } + } +} diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilStunden.php b/application/libraries/vertragsbestandteil/VertragsbestandteilStunden.php new file mode 100644 index 000000000..5f03c8030 --- /dev/null +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilStunden.php @@ -0,0 +1,76 @@ +setVertragsbestandteiltyp_kurzbz( + VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_STUNDEN); + } + + public function hydrateByStdClass($data) + { + parent::hydrateByStdClass($data); + isset($data->wochenstunden) && $this->setWochenstunden($data->wochenstunden); + isset($data->karenz) && $this->setKarenz($data->karenz); + } + + public function getWochenstunden() + { + return $this->wochenstunden; + } + + public function getKarenz() + { + return $this->karenz; + } + + public function setWochenstunden($wochenstunden) + { + $this->wochenstunden = $wochenstunden; + return $this; + } + + public function setKarenz($karenz) + { + $this->karenz = $karenz; + return $this; + } + + public function toStdClass(): \stdClass + { + $tmp = array( + 'vertragsbestandteil_id' => $this->getVertragsbestandteil_id(), + 'wochenstunden' => $this->getWochenstunden(), + 'karenz' => $this->getKarenz() + ); + + $tmp = array_filter($tmp, function($v) { + return !is_null($v); + }); + + return (object) $tmp; + } + + public function __toString() + { + $txt = <<getWochenstunden()} + karenz: {$this->getKarenz()} + +EOTXT; + return parent::__toString() . $txt; + } +} diff --git a/application/models/vertragsbestandteil/VertragsbestandteilFunktion_model.php b/application/models/vertragsbestandteil/VertragsbestandteilFunktion_model.php new file mode 100644 index 000000000..23bffed7b --- /dev/null +++ b/application/models/vertragsbestandteil/VertragsbestandteilFunktion_model.php @@ -0,0 +1,18 @@ +dbTable = 'hr.tbl_vertragsbestandteil_funktion'; + $this->pk = 'vertragsbestandteil_id'; + } +} diff --git a/application/models/vertragsbestandteil/VertragsbestandteilStunden_model.php b/application/models/vertragsbestandteil/VertragsbestandteilStunden_model.php new file mode 100644 index 000000000..569c9a601 --- /dev/null +++ b/application/models/vertragsbestandteil/VertragsbestandteilStunden_model.php @@ -0,0 +1,18 @@ +dbTable = 'hr.tbl_vertragsbestandteil_stunden'; + $this->pk = 'vertragsbestandteil_id'; + } +} diff --git a/application/models/vertragsbestandteil/Vertragsbestandteil_model.php b/application/models/vertragsbestandteil/Vertragsbestandteil_model.php new file mode 100644 index 000000000..fcb41752f --- /dev/null +++ b/application/models/vertragsbestandteil/Vertragsbestandteil_model.php @@ -0,0 +1,63 @@ +dbTable = 'hr.tbl_vertragsbestandteil'; + $this->pk = 'vertragsbestandteil_id'; + } + + public function getVertragsbestandteile($dienstverhaeltnis_id=1, $stichtag=null) + { + $stichtagclause = ''; + if( !is_null($stichtag) ) + { + $date = strftime('%Y-%m-%d', strtotime($stichtag)); + $stichtagclause = 'AND ' . $this->escape($date) + . ' BETWEEN COALESCE(v.von, \'1970-01-01\'::date)' + . ' AND COALESCE(v.bis, \'2170-01-01\'::date)'; + } + + $sql = <<escape($dienstverhaeltnis_id)} + {$stichtagclause} + ; +EOSQL; + + echo $sql . "\n\n"; + $query = $this->db->query($sql); + + $vertragsbestandteile = array(); + foreach( $query->result() as $row ) { + try + { + $vertragsbestandteile[] = VertragsbestandteilFactory::getVertragsbestandteil($row); + } + catch (Exception $ex) + { + echo $ex->getMessage() . "\n"; + } + } + + return $vertragsbestandteile; + } +} From 030b459b0a07298f58330fb9e3af33b46ee2c7f3 Mon Sep 17 00:00:00 2001 From: Werner Masik Date: Fri, 30 Dec 2022 18:36:10 +0100 Subject: [PATCH 006/263] make Vertragbestandteil JsonSerializable (because json_encode would otherwise output null) --- .../libraries/vertragsbestandteil/Vertragsbestandteil.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/application/libraries/vertragsbestandteil/Vertragsbestandteil.php b/application/libraries/vertragsbestandteil/Vertragsbestandteil.php index a583c9190..9ada04329 100644 --- a/application/libraries/vertragsbestandteil/Vertragsbestandteil.php +++ b/application/libraries/vertragsbestandteil/Vertragsbestandteil.php @@ -6,7 +6,7 @@ namespace vertragsbestandteil; * * @author bambi */ -abstract class Vertragsbestandteil +abstract class Vertragsbestandteil implements \JsonSerializable { protected $vertragsbestandteil_id; protected $dienstverhaeltnis_id; @@ -148,6 +148,11 @@ abstract class Vertragsbestandteil return (object) $tmp; } + + public function jsonSerialize() + { + return get_object_vars($this); + } public function __toString() { From 4fa1193948c1a972327ecfb820af670d653218ad Mon Sep 17 00:00:00 2001 From: Paolo Date: Mon, 16 Jan 2023 12:10:49 +0100 Subject: [PATCH 007/263] - Added new CI config file application/config/db_crypt.php, it is loaded by core/DB_Model - Added new constant ENCRYPTION_PASSWORDS to application/core/DB_Model.php - Added new protected properties passwordName and encryptedColumns to core/DB_Model - Added new private methods _isCryptoEnabledAndValid, _getCipher, _encrypt and _decrypt to core/DB_Model - core/DB_Model properties insert and update now are making use of _encrypt() - core/DB_Model properties loadWhere and loadTree now are making use of _decrypt() --- application/config/db_crypt.php | 24 ++++++ application/core/DB_Model.php | 148 ++++++++++++++++++++++++++++++-- 2 files changed, 165 insertions(+), 7 deletions(-) create mode 100644 application/config/db_crypt.php diff --git a/application/config/db_crypt.php b/application/config/db_crypt.php new file mode 100644 index 000000000..e3329a158 --- /dev/null +++ b/application/config/db_crypt.php @@ -0,0 +1,24 @@ +. + */ + +if (!defined('BASEPATH')) exit('No direct script access allowed'); + +// NOTE: if database encryption is _not_ used then leave this array empty! +$config['encryption_passwords'] = array(); + diff --git a/application/core/DB_Model.php b/application/core/DB_Model.php index bdd5316e7..752561615 100644 --- a/application/core/DB_Model.php +++ b/application/core/DB_Model.php @@ -1,7 +1,26 @@ . + */ + if (!defined('BASEPATH')) exit('No direct script access allowed'); +use phpseclib\Crypt\Twofish; + /** * */ @@ -28,15 +47,20 @@ class DB_Model extends CI_Model const PGSQL_FLOAT4_TYPE = 'float4'; const PGSQL_FLOAT8_TYPE = 'float8'; + // Name of the config entry containing an array of password that can be used to encrypt/decrypt + const ENCRYPTION_PASSWORDS = 'encryption_passwords'; + protected $dbTable; // Name of the DB-Table for CI-Insert, -Update, ... 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 + protected $passwordName; // Eventually the name of the password that is used to encrypt/decrypt + protected $encryptedColumns; // Eventually an array of columns to be encrypted/decrypted private $executedQueryMetaData; private $executedQueryListFields; - private $debugMode; + private $debugMode; // Debug mode enable (true) or disabled (false) /** * Constructor @@ -46,20 +70,25 @@ class DB_Model extends CI_Model // Call parent constructor parent::__construct(); - // Set properties - $this->hasSequence = true; - - // Loads DB conns and confs + // Loads DB connections and configs $this->load->database($dbtype); + // Loads the DB config to encrypt/decrypt data + $this->config->load('db_crypt'); + + // Set properties + $this->hasSequence = true; + $this->passwordName = null; + $this->encryptedColumns = null; + $this->debugMode = isset($this->db->db_debug) && $this->db->db_debug === true; + + // Loads UDF model $this->load->model('system/UDF_model', 'UDFModel'); // Loads the UDF library $this->load->library('UDFLib'); // Loads the logs library $this->load->library('LogLib'); - - $this->debugMode = isset($this->db->db_debug) && $this->db->db_debug === true; } // ------------------------------------------------------------------------------------------ @@ -93,6 +122,9 @@ class DB_Model extends CI_Model // If this table has UDF and the validation of them is ok if (isError($validate = $this->_prepareUDFsWrite($data, $this->dbTable))) return $validate; + // + $this->_encrypt($data); + // DB-INSERT $insert = $this->db->insert($this->dbTable, $data); @@ -161,6 +193,9 @@ class DB_Model extends CI_Model $this->db->where($tmpId); + // + $this->_encrypt($data); + // DB-UPDATE $update = $this->db->update($this->dbTable, $data); @@ -265,6 +300,9 @@ class DB_Model extends CI_Model if ($result) { + // Decrypt data if needed + $this->_decrypt($result); + return success($this->_toPhp($result)); } else @@ -328,6 +366,9 @@ class DB_Model extends CI_Model // Execute the query $resultDB = $this->db->get_where($this->dbTable, $where); + // Decrypt data if needed + $this->_decrypt($resultDB); + $this->_logLastQuery(); // If everything went ok... @@ -851,6 +892,99 @@ class DB_Model extends CI_Model // ------------------------------------------------------------------------------------------ // Private methods + // + // + + + /** + * If the cryptography is enabled and correctly configured + */ + private function _isCryptoEnabledAndValid() + { + // Get the password list to decrypt/encrypt from the configuration + $encryptionPasswords = $this->config->item(self::ENCRYPTION_PASSWORDS); + + // If not configured or wrongly configured + if (isEmptyArray($encryptionPasswords)) return false; + + // If array of encrypted columns is defined or wrongly defined for this model + if (isEmptyArray($this->encryptedColumns)) return false; + + // If no decryption/encryption password name is defined for this model + if (isEmptyString($this->passwordName)) return false; + + // If the configured password name does not exists in the password list to decrypt/encrypt + if (!array_key_exists($this->passwordName, $encryptionPasswords)) return false; + + // + return true; + } + + /** + * Returns a cipher to decrypt/encrypt data + */ + private function _getCipher() + { + // Set the cipher type + $cipher = new Twofish(); + // Set the password to encrypt using the chosen one + $cipher->setPassword($this->config->item(self::ENCRYPTION_PASSWORDS)[$this->passwordName]); + + return $cipher; + } + + /** + * To encrypt data + * Data is an associative array that contains column names as keys and the colum value as array value + */ + private function _encrypt(&$data) + { + // If no encryption is configured or not correctly configured then exit this method + if (!$this->_isCryptoEnabledAndValid()) return; + + // Gets the cipher + $cipher = $this->_getCipher(); + + // For each column that is going to be inserted/updated + foreach ($data as $column => $value) + { + // If the current column is in the list of the columns to be encrypted + if (in_array($column, $this->encryptedColumns)) + { + // Encrypt it! + $data[$column] = base64_encode($cipher->encrypt($value)); + } + } + } + + /** + * To decrypt data + * dbResult is an array of objects, each object is a representation of a database record, + * each property of the object is the column name and the property value is the database value + */ + private function _decrypt(&$dbResult) + { + // If no encryption is configured or not correctly configured then exit this method + if (!$this->_isCryptoEnabledAndValid()) return; + + // Gets the cipher + $cipher = $this->_getCipher(); + + // For each record from database + foreach ($dbResult->result() as $record) + { + // For each column to be encrypted + foreach ($this->encryptedColumns as $column) + { + // If the current record contains such a column + if (property_exists($record, $column)) + { + // Decrypt it! + $record->{$column} = $cipher->decrypt(base64_decode($record->{$column})); + } + } + } + } /** * Invalid ID From fd5ce62b0e5b5fdc96623f251b25f5d607730317 Mon Sep 17 00:00:00 2001 From: Werner Masik Date: Sat, 21 Jan 2023 13:50:45 +0100 Subject: [PATCH 008/263] added timeline widget --- application/views/templates/FHC-Footer.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/views/templates/FHC-Footer.php b/application/views/templates/FHC-Footer.php index 0c3782fea..272dd5542 100644 --- a/application/views/templates/FHC-Footer.php +++ b/application/views/templates/FHC-Footer.php @@ -122,6 +122,7 @@ generateJSsInclude('vendor/npm-asset/primevue/column/column.min.js'); generateJSsInclude('vendor/npm-asset/primevue/calendar/calendar.min.js'); generateJSsInclude('vendor/npm-asset/primevue/skeleton/skeleton.min.js'); + generateJSsInclude('vendor/npm-asset/primevue/timeline/timeline.min.js'); } // -------------------------------------------------------------------------------------------------------- From f7d315d4ccfcc7aefa403c7ee99a9cf9912dba06 Mon Sep 17 00:00:00 2001 From: Werner Masik Date: Sat, 21 Jan 2023 13:51:59 +0100 Subject: [PATCH 009/263] model classes for contract parts (Vertragsbestandteile) --- .../VertragsbestandteilBefristung.php | 89 +++++++ .../VertragsbestandteilFactory.php | 22 +- .../VertragsbestandteilFreitext.php | 107 ++++++++ .../VertragsbestandteilGehalt.php | 245 ++++++++++++++++++ .../VertragsbestandteilKarenz.php | 108 ++++++++ .../VertragsbestandteilKuendigungsfrist.php | 87 +++++++ .../VertragsbestandteilLehre.php | 65 +++++ .../VertragsbestandteilUrlaubsanspruch.php | 65 +++++ .../VertragsbestandteilZeitaufzeichnung.php | 109 ++++++++ .../Dienstverhaeltnis_model.php | 76 ++++++ .../Gehaltsbestandteil_model.php | 44 ++++ .../VertragsbestandteilBefristung_model.php | 14 + .../VertragsbestandteilFreitext_model.php | 12 + .../VertragsbestandteilKV_model.php | 12 + .../VertragsbestandteilKarenz_model.php | 14 + ...rtragsbestandteilUrlaubsanspruch_model.php | 11 + ...tragsbestandteilZeitaufzeichnung_model.php | 12 + .../Vertragsbestandteil_model.php | 43 +-- 18 files changed, 1117 insertions(+), 18 deletions(-) create mode 100644 application/libraries/vertragsbestandteil/VertragsbestandteilBefristung.php create mode 100644 application/libraries/vertragsbestandteil/VertragsbestandteilFreitext.php create mode 100644 application/libraries/vertragsbestandteil/VertragsbestandteilGehalt.php create mode 100644 application/libraries/vertragsbestandteil/VertragsbestandteilKarenz.php create mode 100644 application/libraries/vertragsbestandteil/VertragsbestandteilKuendigungsfrist.php create mode 100644 application/libraries/vertragsbestandteil/VertragsbestandteilLehre.php create mode 100644 application/libraries/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch.php create mode 100644 application/libraries/vertragsbestandteil/VertragsbestandteilZeitaufzeichnung.php create mode 100644 application/models/vertragsbestandteil/Dienstverhaeltnis_model.php create mode 100644 application/models/vertragsbestandteil/Gehaltsbestandteil_model.php create mode 100644 application/models/vertragsbestandteil/VertragsbestandteilBefristung_model.php create mode 100644 application/models/vertragsbestandteil/VertragsbestandteilFreitext_model.php create mode 100644 application/models/vertragsbestandteil/VertragsbestandteilKV_model.php create mode 100644 application/models/vertragsbestandteil/VertragsbestandteilKarenz_model.php create mode 100644 application/models/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch_model.php create mode 100644 application/models/vertragsbestandteil/VertragsbestandteilZeitaufzeichnung_model.php diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilBefristung.php b/application/libraries/vertragsbestandteil/VertragsbestandteilBefristung.php new file mode 100644 index 000000000..a2585b5e9 --- /dev/null +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilBefristung.php @@ -0,0 +1,89 @@ +setVertragsbestandteiltyp_kurzbz( + VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_BEFRISTUNG); + } + + public function hydrateByStdClass($data) + { + parent::hydrateByStdClass($data); + isset($data->befristet) && $this->setBefristet($data->befristet); + isset($data->befristet_bis) && $this->setBefristetBis($data->befristet_bis); + } + + + /** + * Get the value of befristet + */ + public function getBefristet() + { + return $this->befristet; + } + + /** + * Set the value of befristet + */ + public function setBefristet($befristet): self + { + $this->befristet = $befristet; + + return $this; + } + + /** + * Get the value of befristet_bis + */ + public function getBefristetBis() + { + return $this->befristet_bis; + } + + /** + * Set the value of befristet_bis + */ + public function setBefristetBis($befristet_bis): self + { + $this->befristet_bis = $befristet_bis; + + return $this; + } + + public function toStdClass(): \stdClass + { + $tmp = array( + 'vertragsbestandteil_id' => $this->getVertragsbestandteil_id(), + 'befristet' => $this->getBefristet(), + 'befristet_bis' => $this->getBefristetBis() + ); + + $tmp = array_filter($tmp, function($v) { + return !is_null($v); + }); + + return (object) $tmp; + } + + public function __toString() + { + $txt = <<getBefristet()} + befristet_bis: {$this->getBefristetBis()} + +EOTXT; + return parent::__toString() . $txt; + } + + + +} diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilFactory.php b/application/libraries/vertragsbestandteil/VertragsbestandteilFactory.php index 6a6fed451..b6ee488e7 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilFactory.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilFactory.php @@ -13,6 +13,15 @@ class VertragsbestandteilFactory { const VERTRAGSBESTANDTEIL_STUNDEN = 'stunden'; const VERTRAGSBESTANDTEIL_FUNKTION = 'funktion'; + const VERTRAGSBESTANDTEIL_GEHALT = 'gehalt'; + const VERTRAGSBESTANDTEIL_FREITEXT = 'freitext'; + const VERTRAGSBESTANDTEIL_KARENZ = 'karenz'; + const VERTRAGSBESTANDTEIL_BEFRISTUNG = 'befristung'; + const VERTRAGSBESTANDTEIL_KUENDIGUNGSFRIST = 'kuendigungsfrist'; + const VERTRAGSBESTANDTEIL_KV = 'kv'; + const VERTRAGSBESTANDTEIL_URLAUBSANSPRUCH = 'urlaubsanspruch'; + const VERTRAGSBESTANDTEIL_ZEITAUFZEICHNUNG = 'zeitaufzeichnung'; + const VERTRAGSBESTANDTEIL_LEHRE = 'lehre'; public static function getVertragsbestandteil($data) { @@ -36,7 +45,12 @@ class VertragsbestandteilFactory $vertragsbestandteil = new VertragsbestandteilFunktion(); $vertragsbestandteil->hydrateByStdClass($data); break; - + + case self::VERTRAGSBESTANDTEIL_GEHALT: + $vertragsbestandteil = new VertragsbestandteilGehalt(); + $vertragsbestandteil->hydrateByStdClass($data); + break; + default: throw new Exception('Unknown vertragsbestandteiltyp_kurzbz ' . $vertragsbestandteiltyp_kurzbz); @@ -63,6 +77,12 @@ class VertragsbestandteilFactory 'VertragsbestandteilFunktion_model'); $vertragsbestandteildbmodel = $CI->VertragsbestandteilFunktion_model; break; + + case self::VERTRAGSBESTANDTEIL_GEHALT: + $CI->load->model('vertragsbestandteil/VertragsbestandteilGehalt_model', + 'VertragsbestandteilGehalt_model'); + $vertragsbestandteildbmodel = $CI->VertragsbestandteilGehalt_model; + break; default: throw new Exception('Unknown vertragsbestandteil_kurzbz ' diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilFreitext.php b/application/libraries/vertragsbestandteil/VertragsbestandteilFreitext.php new file mode 100644 index 000000000..b1beefa43 --- /dev/null +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilFreitext.php @@ -0,0 +1,107 @@ +setVertragsbestandteiltyp_kurzbz( + VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_FREITEXT); + } + + public function hydrateByStdClass($data) + { + parent::hydrateByStdClass($data); + isset($data->anmerkung) && $this->setAnmerkung($data->anmerkung); + isset($data->kuendigungrelevant) && $this->setKuendigungrelevant($data->kuendigungrelevant); + isset($data->freitexttyp_kurzbz) && $this->setFreitexttypKurzbz($data->freitexttyp_kurzbz); + } + + public function toStdClass(): \stdClass + { + $tmp = array( + 'vertragsbestandteil_id' => $this->getVertragsbestandteil_id(), + 'anmerkung' => $this->getAnmerkung(), + 'kuendigungrelevant' => $this->getKuendigungrelevant(), + 'freitexttyp_kurzbz' => $this->getFreitexttypKurzbz() + ); + + $tmp = array_filter($tmp, function($v) { + return !is_null($v); + }); + + return (object) $tmp; + } + + public function __toString() + { + $txt = <<getAnmerkung()} + kuendigungrelevant: {$this->getKuendigungrelevant()} + freitexttyp_kurzbz: {$this->getFreitexttypKurzbz()} + +EOTXT; + return parent::__toString() . $txt; + } + + /** + * Get the value of anmerkung + */ + public function getAnmerkung() + { + return $this->anmerkung; + } + + /** + * Set the value of anmerkung + */ + public function setAnmerkung($anmerkung): self + { + $this->anmerkung = $anmerkung; + + return $this; + } + + /** + * Get the value of kuendigungrelevant + */ + public function getKuendigungrelevant() + { + return $this->kuendigungrelevant; + } + + /** + * Set the value of kuendigungrelevant + */ + public function setKuendigungrelevant($kuendigungrelevant): self + { + $this->kuendigungrelevant = $kuendigungrelevant; + + return $this; + } + + /** + * Get the value of freitexttyp_kurzbz + */ + public function getFreitexttypKurzbz() + { + return $this->freitexttyp_kurzbz; + } + + /** + * Set the value of freitexttyp_kurzbz + */ + public function setFreitexttypKurzbz($freitexttyp_kurzbz): self + { + $this->freitexttyp_kurzbz = $freitexttyp_kurzbz; + + return $this; + } +} diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilGehalt.php b/application/libraries/vertragsbestandteil/VertragsbestandteilGehalt.php new file mode 100644 index 000000000..cdb06b26b --- /dev/null +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilGehalt.php @@ -0,0 +1,245 @@ +setVertragsbestandteiltyp_kurzbz( + VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_GEHALT); + } + + public function hydrateByStdClass($data) + { + parent::hydrateByStdClass($data); + isset($data->gehalt_von) && $this->setGehaltVon($data->gehalt_von); + isset($data->gehalt_bis) && $this->setGehaltBis($data->gehalt_bis); + isset($data->anmerkung) && $this->setAnmerkung($data->anmerkung); + isset($data->gehalt_dienstverhaeltnis_id) && $this->setGehaltDienstverhaeltnisID($data->gehalt_dienstverhaeltnis_id); + isset($data->gehaltstyp_kurzbz) && $this->setGehaltstypKurzbz($data->gehaltstyp_kurzbz); + isset($data->valorisierungssperre) && $this->setValorisierungssperre($data->valorisierungssperre); + } + + public function getGehaltVon() + { + return $this->gehalt_von; + } + + public function getGehaltBis() + { + return $this->gehalt_bis; + } + + public function setGehaltVon($von) + { + $this->gehalt_von = $von; + return $this; + } + + public function setGehaltBis($bis) + { + $this->gehalt_bis = $bis; + return $this; + } + + /** + * Get the value of gehaltsbestandteil_id + */ + public function getGehaltsbestandteilId() + { + return $this->gehaltsbestandteil_id; + } + + /** + * Set the value of gehaltsbestandteil_id + */ + public function setGehaltsbestandteilId($gehaltsbestandteil_id): self + { + $this->gehaltsbestandteil_id = $gehaltsbestandteil_id; + + return $this; + } + + /** + * Get the value of anmerkung + */ + public function getAnmerkung() + { + return $this->anmerkung; + } + + /** + * Set the value of anmerkung + */ + public function setAnmerkung($anmerkung): self + { + $this->anmerkung = $anmerkung; + + return $this; + } + + /** + * Get the value of grundbetrag + */ + public function getGrundbetrag() + { + return $this->grundbetrag; + } + + /** + * Set the value of grundbetrag + */ + public function setGrundbetrag($grundbetrag): self + { + $this->grundbetrag = $grundbetrag; + + return $this; + } + + /** + * Get the value of betrag_valorisiert + */ + public function getBetragValorisiert() + { + return $this->betrag_valorisiert; + } + + /** + * Set the value of betrag_valorisiert + */ + public function setBetragValorisiert($betrag_valorisiert): self + { + $this->betrag_valorisiert = $betrag_valorisiert; + + return $this; + } + + /** + * Get the value of valorisieren + */ + public function getValorisieren() + { + return $this->valorisieren; + } + + /** + * Set the value of valorisieren + */ + public function setValorisieren($valorisieren): self + { + $this->valorisieren = $valorisieren; + + return $this; + } + + /** + * Get the value of dienstverhaeltnis_id + */ + public function getGehaltDienstverhaeltnisID() + { + return $this->gehalt_dienstverhaeltnis_id; + } + + /** + * Set the value of dienstverhaeltnis_id + */ + public function setGehaltDienstverhaeltnisID($dienstverhaeltnis_id): self + { + $this->gehalt_dienstverhaeltnis_id = $dienstverhaeltnis_id; + + return $this; + } + + /** + * Get the value of gehaltstyp_kurzbz + */ + public function getGehaltstypKurzbz() + { + return $this->gehaltstyp_kurzbz; + } + + /** + * Set the value of gehaltstyp_kurzbz + */ + public function setGehaltstypKurzbz($gehaltstyp_kurzbz): self + { + $this->gehaltstyp_kurzbz = $gehaltstyp_kurzbz; + + return $this; + } + + /** + * Get the value of valorisierungssperre + */ + public function getValorisierungssperre() + { + return $this->valorisierungssperre; + } + + /** + * Set the value of valorisierungssperre + */ + public function setValorisierungssperre($valorisierungssperre): self + { + $this->valorisierungssperre = $valorisierungssperre; + + return $this; + } + + + + + public function toStdClass(): \stdClass + { + $tmp = array( + 'von' => $this->getVon(), + 'bis' => $this->getBis(), + 'gehalt_von' => $this->getGehaltVon(), + 'gehalt_bis' => $this->getGehaltBis(), + 'gehalt_dienstverhaeltnis_id' => $this->getGehaltDienstverhaeltnisID(), + 'grundbetrag' => $this->getGrundbetrag(), + 'betrag_valorisiert' => $this->getBetragValorisiert(), + 'valorisieren' => $this->getValorisieren(), + 'gehaltstyp_kurzbz' => $this->getGehaltstypKurzbz(), + 'valorisierungssperre' => $this->getValorisierungssperre(), + 'anmerkung' => $this->getAnmerkung() + ); + + $tmp = array_filter($tmp, function($v) { + return !is_null($v); + }); + + return (object) $tmp; + } + + public function __toString() + { + $txt = <<getVon()} + bis: {$this->getBis()} + grundbetrag: {$this->getGrundbetrag()} + valorisieren: {$this->getValorisieren()} + +EOTXT; + return parent::__toString() . $txt; + } + + +} diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilKarenz.php b/application/libraries/vertragsbestandteil/VertragsbestandteilKarenz.php new file mode 100644 index 000000000..3c9f7b38d --- /dev/null +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilKarenz.php @@ -0,0 +1,108 @@ +setVertragsbestandteiltyp_kurzbz( + VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_KARENZ); + } + + public function hydrateByStdClass($data) + { + parent::hydrateByStdClass($data); + isset($data->karenztyp_kurzbz) && $this->setKarenztypKurzbz($data->karenztyp_kurzbz); + isset($data->geburtstermin_geplant) && $this->setGeburtsterminGeplant($data->geburtstermin_geplant); + isset($data->geburtstermin) && $this->setGeburtstermin($data->geburtstermin); + } + + /** + * Get the value of karenztyp_kurzbz + */ + public function getKarenztypKurzbz() + { + return $this->karenztyp_kurzbz; + } + + /** + * Set the value of karenztyp_kurzbz + */ + public function setKarenztypKurzbz($karenztyp_kurzbz): self + { + $this->karenztyp_kurzbz = $karenztyp_kurzbz; + + return $this; + } + + /** + * Get the value of geburtstermin + */ + public function getGeburtstermin() + { + return $this->geburtstermin; + } + + /** + * Set the value of geburtstermin + */ + public function setGeburtstermin($geburtstermin): self + { + $this->geburtstermin = $geburtstermin; + + return $this; + } + + /** + * Get the value of geburtstermin_geplant + */ + public function getGeburtsterminGeplant() + { + return $this->geburtstermin_geplant; + } + + /** + * Set the value of geburtstermin_geplant + */ + public function setGeburtsterminGeplant($geburtstermin_geplant): self + { + $this->geburtstermin_geplant = $geburtstermin_geplant; + + return $this; + } + + public function toStdClass(): \stdClass + { + $tmp = array( + 'karenztyp_kurzbz' => $this->getKarenztypKurzbz(), + 'geburtstermin' => $this->getGeburtstermin(), + 'geburtstermin_geplant' => $this->getGeburtsterminGeplant() + ); + + $tmp = array_filter($tmp, function($v) { + return !is_null($v); + }); + + return (object) $tmp; + } + + public function __toString() + { + $txt = <<getKarenztypKurzbz()} + geburtstermin: {$this->getGeburtstermin()} + geburtstermin_geplant: {$this->getGeburtsterminGeplant()} + +EOTXT; + return parent::__toString() . $txt; + } + + +} diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilKuendigungsfrist.php b/application/libraries/vertragsbestandteil/VertragsbestandteilKuendigungsfrist.php new file mode 100644 index 000000000..18b220b37 --- /dev/null +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilKuendigungsfrist.php @@ -0,0 +1,87 @@ +setVertragsbestandteiltyp_kurzbz( + VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_KUENDIGUNGSFRIST); + } + + public function hydrateByStdClass($data) + { + parent::hydrateByStdClass($data); + isset($data->arbeitgeber_frist) && $this->setArbeitgeberFrist($data->arbeitgeber_frist); + isset($data->arbeitnehmer_frist) && $this->setArbeitnehmerFrist($data->arbeitnehmer_frist); + } + + /** + * Get the value of arbeitgeber_frist + */ + public function getArbeitgeberFrist() + { + return $this->arbeitgeber_frist; + } + + /** + * Set the value of arbeitgeber_frist + */ + public function setArbeitgeberFrist($arbeitgeber_frist): self + { + $this->arbeitgeber_frist = $arbeitgeber_frist; + + return $this; + } + + /** + * Get the value of arbeitnehmer_frist + */ + public function getArbeitnehmerFrist() + { + return $this->arbeitnehmer_frist; + } + + /** + * Set the value of arbeitnehmer_frist + */ + public function setArbeitnehmerFrist($arbeitnehmer_frist): self + { + $this->arbeitnehmer_frist = $arbeitnehmer_frist; + + return $this; + } + + public function toStdClass(): \stdClass + { + $tmp = array( + 'vertragsbestandteil_id' => $this->getVertragsbestandteil_id(), + 'arbeitgeber_frist' => $this->getArbeitgeberFrist(), + 'arbeitnehmer_frist' => $this->getArbeitnehmerFrist() + ); + + $tmp = array_filter($tmp, function($v) { + return !is_null($v); + }); + + return (object) $tmp; + } + + public function __toString() + { + $txt = <<getArbeitgeberFrist()} + arbeitnehmer_frist: {$this->getArbeitnehmerFrist()} + +EOTXT; + return parent::__toString() . $txt; + } + + +} diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilLehre.php b/application/libraries/vertragsbestandteil/VertragsbestandteilLehre.php new file mode 100644 index 000000000..2c665cbf5 --- /dev/null +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilLehre.php @@ -0,0 +1,65 @@ +setVertragsbestandteiltyp_kurzbz( + VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_LEHRE); + } + + public function hydrateByStdClass($data) + { + parent::hydrateByStdClass($data); + isset($data->inkludierte_lehre) && $this->setInkludierteLehre($data->inkludierte_lehre); + } + + /** + * Get the value of inkludierte_lehre + */ + public function getInkludierteLehre() + { + return $this->inkludierte_lehre; + } + + /** + * Set the value of inkludierte_lehre + */ + public function setInkludierteLehre($inkludierte_lehre): self + { + $this->inkludierte_lehre = $inkludierte_lehre; + + return $this; + } + + public function toStdClass(): \stdClass + { + $tmp = array( + 'vertragsbestandteil_id' => $this->getVertragsbestandteil_id(), + 'inkludierte_lehre' => $this->getInkludierteLehre(), + ); + + $tmp = array_filter($tmp, function($v) { + return !is_null($v); + }); + + return (object) $tmp; + } + + public function __toString() + { + $txt = <<getInkludierteLehre()} + +EOTXT; + return parent::__toString() . $txt; + } + + +} diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch.php b/application/libraries/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch.php new file mode 100644 index 000000000..285d7e8ad --- /dev/null +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch.php @@ -0,0 +1,65 @@ +setVertragsbestandteiltyp_kurzbz( + VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_URLAUBSANSPRUCH); + } + + public function hydrateByStdClass($data) + { + parent::hydrateByStdClass($data); + isset($data->tage) && $this->setTage($data->tage); + } + + /** + * Get the value of tage + */ + public function getTage() + { + return $this->tage; + } + + /** + * Set the value of tage + */ + public function setTage($tage): self + { + $this->tage = $tage; + + return $this; + } + + public function toStdClass(): \stdClass + { + $tmp = array( + 'vertragsbestandteil_id' => $this->getVertragsbestandteil_id(), + 'tage' => $this->getTage(), + ); + + $tmp = array_filter($tmp, function($v) { + return !is_null($v); + }); + + return (object) $tmp; + } + + public function __toString() + { + $txt = <<getTage()} + +EOTXT; + return parent::__toString() . $txt; + } + + +} diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilZeitaufzeichnung.php b/application/libraries/vertragsbestandteil/VertragsbestandteilZeitaufzeichnung.php new file mode 100644 index 000000000..fb715304c --- /dev/null +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilZeitaufzeichnung.php @@ -0,0 +1,109 @@ +setVertragsbestandteiltyp_kurzbz( + VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_ZEITAUFZEICHNUNG); + } + + public function hydrateByStdClass($data) + { + parent::hydrateByStdClass($data); + isset($data->zeitaufzeichnung) && $this->setZeitaufzeichnung($data->zeitaufzeichnung); + isset($data->azgrelevant) && $this->setAzgrelevant($data->azgrelevant); + isset($data->homeoffice) && $this->setHomeoffice($data->homeoffice); + } + + /** + * Get the value of zeitaufzeichnung + */ + public function getZeitaufzeichnung() + { + return $this->zeitaufzeichnung; + } + + /** + * Set the value of zeitaufzeichnung + */ + public function setZeitaufzeichnung($zeitaufzeichnung): self + { + $this->zeitaufzeichnung = $zeitaufzeichnung; + + return $this; + } + + /** + * Get the value of azgrelevant + */ + public function getAzgrelevant() + { + return $this->azgrelevant; + } + + /** + * Set the value of azgrelevant + */ + public function setAzgrelevant($azgrelevant): self + { + $this->azgrelevant = $azgrelevant; + + return $this; + } + + /** + * Get the value of homeoffice + */ + public function getHomeoffice() + { + return $this->homeoffice; + } + + /** + * Set the value of homeoffice + */ + public function setHomeoffice($homeoffice): self + { + $this->homeoffice = $homeoffice; + + return $this; + } + + public function toStdClass(): \stdClass + { + $tmp = array( + 'vertragsbestandteil_id' => $this->getVertragsbestandteil_id(), + 'zeitaufzeichnung' => $this->getZeitaufzeichnung(), + 'azgrelevant' => $this->getAzgrelevant(), + 'homeoffice' => $this->getHomeoffice() + ); + + $tmp = array_filter($tmp, function($v) { + return !is_null($v); + }); + + return (object) $tmp; + } + + public function __toString() + { + $txt = <<getZeitaufzeichnung()} + azgrelevant: {$this->getAzgrelevant()} + homeoffice: {$this->getHomeoffice()} + +EOTXT; + return parent::__toString() . $txt; + } + + +} diff --git a/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php b/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php new file mode 100644 index 000000000..3c43a6fb1 --- /dev/null +++ b/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php @@ -0,0 +1,76 @@ +dbTable = 'hr.tbl_dienstverhaeltnis'; + $this->pk = 'dienstverhaeltnis_id'; + } + + /** + * @return list of DV + */ + public function getDVByPersonUID($uid) + { + $result = null; + + $qry = " + SELECT + dv.dienstverhaeltnis_id, + tbl_benutzer.uid, + tbl_mitarbeiter.personalnummer, + tbl_mitarbeiter.kurzbz, + tbl_mitarbeiter.lektor, + tbl_mitarbeiter.fixangestellt, + tbl_person.person_id, + tbl_benutzer.alias, + dv.von, + dv.bis, + dv.vertragsart_kurzbz, + dv.updateamum, + dv.updatevon + FROM tbl_mitarbeiter + JOIN tbl_benutzer ON tbl_mitarbeiter.mitarbeiter_uid::text = tbl_benutzer.uid::text + JOIN tbl_person USING (person_id) + JOIN hr.tbl_dienstverhaeltnis dv ON(tbl_benutzer.uid::text = dv.mitarbeiter_uid::text) + WHERE tbl_benutzer.uid=? + ORDER BY dv.von desc + "; + + return $this->execQuery($qry, array($uid)); + + } + + + public function getCurrentDVByPersonUID($uid) + { + $qry = " + SELECT + dv.dienstverhaeltnis_id, + tbl_benutzer.uid, + tbl_mitarbeiter.personalnummer, + tbl_mitarbeiter.kurzbz, + tbl_mitarbeiter.lektor, + tbl_mitarbeiter.fixangestellt, + tbl_person.person_id, + tbl_benutzer.alias, + dv.von, + dv.bis, + dv.vertragsart_kurzbz, + dv.updateamum, + dv.updatevon + FROM tbl_mitarbeiter + JOIN tbl_benutzer ON tbl_mitarbeiter.mitarbeiter_uid::text = tbl_benutzer.uid::text + JOIN tbl_person USING (person_id) + JOIN hr.tbl_dienstverhaeltnis dv ON(tbl_benutzer.uid::text = dv.mitarbeiter_uid::text) + WHERE tbl_benutzer.uid=? and (dv.von<=CURRENT_DATE::text::date and (dv.bis is null OR dv.bis>=CURRENT_DATE::text::date)) + ORDER BY dv.von desc + "; + + return $this->execQuery($qry, array($uid)); + } + +} \ No newline at end of file diff --git a/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php b/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php new file mode 100644 index 000000000..7b94cc56c --- /dev/null +++ b/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php @@ -0,0 +1,44 @@ +dbTable = 'hr.tbl_gehaltsbestandteil'; + $this->pk = 'gehaltsbestandteil_id'; + $encryptionkey_filename = APPPATH.'config/extensions/FHC-Core-Personalverwaltung/keys.config.inc.php'; + require($encryptionkey_filename); + } + + public function getCurrentGBTByDV($dienstverhaeltnis_id) + { + $result = null; + + $qry = " + SELECT + gehaltsbestandteil_id, + von, + bis, + anmerkung, + dienstverhaeltnis_id, + gehaltstyp_kurzbz, + valorisierungssperre, + valorisieren, + pgp_sym_decrypt(grundbetrag,?) grundbetrag, + pgp_sym_decrypt(betrag_valorisiert,?) betrag_valorisiert, + gt.bezeichnung as gehaltstyp_bezeichnung + FROM hr.tbl_gehaltsbestandteil gbt JOIN hr.tbl_gehaltstyp gt using(gehaltstyp_kurzbz) + WHERE gbt.dienstverhaeltnis_id=? AND + (gbt.von<=CURRENT_DATE::text::date and (gbt.bis is null OR gbt.bis>=CURRENT_DATE::text::date)) + ORDER BY gt.sort + "; + + return $this->execQuery($qry, array(ENCRYPTIONKEY, ENCRYPTIONKEY, $dienstverhaeltnis_id)); + + } + +} \ No newline at end of file diff --git a/application/models/vertragsbestandteil/VertragsbestandteilBefristung_model.php b/application/models/vertragsbestandteil/VertragsbestandteilBefristung_model.php new file mode 100644 index 000000000..9166b1c06 --- /dev/null +++ b/application/models/vertragsbestandteil/VertragsbestandteilBefristung_model.php @@ -0,0 +1,14 @@ +dbTable = 'hr.tbl_vertragsbestandteil_befristung'; + $this->pk = 'vertragsbestandteil_id'; + } +} diff --git a/application/models/vertragsbestandteil/VertragsbestandteilFreitext_model.php b/application/models/vertragsbestandteil/VertragsbestandteilFreitext_model.php new file mode 100644 index 000000000..d47ce53df --- /dev/null +++ b/application/models/vertragsbestandteil/VertragsbestandteilFreitext_model.php @@ -0,0 +1,12 @@ +dbTable = 'hr.tbl_vertragsbestandteil_freitext'; + $this->pk = 'vertragsbestandteil_id'; + } +} diff --git a/application/models/vertragsbestandteil/VertragsbestandteilKV_model.php b/application/models/vertragsbestandteil/VertragsbestandteilKV_model.php new file mode 100644 index 000000000..197d44530 --- /dev/null +++ b/application/models/vertragsbestandteil/VertragsbestandteilKV_model.php @@ -0,0 +1,12 @@ +dbTable = 'hr.tbl_vertragsbestandteil_kv'; + $this->pk = 'vertragsbestandteil_id'; + } +} diff --git a/application/models/vertragsbestandteil/VertragsbestandteilKarenz_model.php b/application/models/vertragsbestandteil/VertragsbestandteilKarenz_model.php new file mode 100644 index 000000000..525291439 --- /dev/null +++ b/application/models/vertragsbestandteil/VertragsbestandteilKarenz_model.php @@ -0,0 +1,14 @@ +dbTable = 'hr.tbl_vertragsbestandteil_karenz'; + $this->pk = 'vertragsbestandteil_id'; + } +} diff --git a/application/models/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch_model.php b/application/models/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch_model.php new file mode 100644 index 000000000..561ed2932 --- /dev/null +++ b/application/models/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch_model.php @@ -0,0 +1,11 @@ +dbTable = 'hr.tbl_vertragsbestandteil_urlaubsanspruch'; + $this->pk = 'vertragsbestandteil_id'; + } +} diff --git a/application/models/vertragsbestandteil/VertragsbestandteilZeitaufzeichnung_model.php b/application/models/vertragsbestandteil/VertragsbestandteilZeitaufzeichnung_model.php new file mode 100644 index 000000000..89ae0ba0a --- /dev/null +++ b/application/models/vertragsbestandteil/VertragsbestandteilZeitaufzeichnung_model.php @@ -0,0 +1,12 @@ +dbTable = 'hr.tbl_vertragsbestandteil_zeitaufzeichnung'; + $this->pk = 'vertragsbestandteil_id'; + } +} diff --git a/application/models/vertragsbestandteil/Vertragsbestandteil_model.php b/application/models/vertragsbestandteil/Vertragsbestandteil_model.php index fcb41752f..b87b3ea10 100644 --- a/application/models/vertragsbestandteil/Vertragsbestandteil_model.php +++ b/application/models/vertragsbestandteil/Vertragsbestandteil_model.php @@ -6,7 +6,7 @@ use vertragsbestandteil\VertragsbestandteilFactory; * @author bambi */ class Vertragsbestandteil_model extends DB_Model -{ +{ /** * Constructor */ @@ -16,39 +16,48 @@ class Vertragsbestandteil_model extends DB_Model $this->dbTable = 'hr.tbl_vertragsbestandteil'; $this->pk = 'vertragsbestandteil_id'; } - + public function getVertragsbestandteile($dienstverhaeltnis_id=1, $stichtag=null) { $stichtagclause = ''; - if( !is_null($stichtag) ) + if( !is_null($stichtag) ) { $date = strftime('%Y-%m-%d', strtotime($stichtag)); - $stichtagclause = 'AND ' . $this->escape($date) + $stichtagclause = 'AND ' . $this->escape($date) . ' BETWEEN COALESCE(v.von, \'1970-01-01\'::date)' . ' AND COALESCE(v.bis, \'2170-01-01\'::date)'; } - + $sql = <<escape($dienstverhaeltnis_id)} {$stichtagclause} ; EOSQL; - - echo $sql . "\n\n"; + + // echo $sql . "\n\n"; $query = $this->db->query($sql); - + $vertragsbestandteile = array(); foreach( $query->result() as $row ) { - try + try { $vertragsbestandteile[] = VertragsbestandteilFactory::getVertragsbestandteil($row); } @@ -57,7 +66,7 @@ EOSQL; echo $ex->getMessage() . "\n"; } } - + return $vertragsbestandteile; } } From c8313550123c43cd3aca28444c813cc126940e99 Mon Sep 17 00:00:00 2001 From: Paolo Date: Wed, 8 Feb 2023 13:33:40 +0100 Subject: [PATCH 010/263] - FilterWidget: now it is possible to provide the encryptedColumns parameter to specify which columns of a database table are encrypted, how to cast them and which password to use to decrypt them - Added new constants PGSQL_BYTEA_TYPE, CRYPT_CONF_PASSWORDS, CRYPT_CAST, CRYPT_PASSWORD_NAME, CRYPT_SELECT_TEMPLATE, CRYPT_WHERE_TEMPLATE and CRYPT_WRITE_TEMPLATE to application/core/DB_Model.php - Added new optional parameter encryptedColumns to application/core/DB_Model insert, update, load, loadWhere, execQuery, execReadOnlyQuery and _toPhp - Added new private methods _addEncrypt, _addDecryptQuery and _addDecryptLoad to application/core/DB_Model.php - core/DB_Model: now it is possible to provide the encryptedColumns parameter to specify which columns of a database table are encrypted, how to cast them and which password to use to decrypt them - Adapted application/models/system/PersonLog_model.php --- application/core/DB_Model.php | 322 ++++++++++++------ application/libraries/FilterWidgetLib.php | 23 +- application/models/person/Person_model.php | 19 ++ application/models/system/PersonLog_model.php | 19 +- application/widgets/FilterWidget.php | 33 +- 5 files changed, 314 insertions(+), 102 deletions(-) diff --git a/application/core/DB_Model.php b/application/core/DB_Model.php index 752561615..69e088ef8 100644 --- a/application/core/DB_Model.php +++ b/application/core/DB_Model.php @@ -3,7 +3,7 @@ /** * Copyright (C) 2023 fhcomplete.org * - * This program is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. @@ -19,8 +19,6 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -use phpseclib\Crypt\Twofish; - /** * */ @@ -46,16 +44,20 @@ class DB_Model extends CI_Model const PGSQL_INT8_TYPE = 'int8'; const PGSQL_FLOAT4_TYPE = 'float4'; const PGSQL_FLOAT8_TYPE = 'float8'; + const PGSQL_BYTEA_TYPE = 'bytea'; // Name of the config entry containing an array of password that can be used to encrypt/decrypt - const ENCRYPTION_PASSWORDS = 'encryption_passwords'; + const CRYPT_CONF_PASSWORDS = 'encryption_passwords'; + const CRYPT_CAST = 'cast'; + const CRYPT_PASSWORD_NAME = 'passwordName'; + const CRYPT_SELECT_TEMPLATE = 'PGP_SYM_DECRYPT(%s, \'%s\')::%s AS %s'; + const CRYPT_WHERE_TEMPLATE = 'PGP_SYM_DECRYPT(%s, \'%s\')::%s'; + const CRYPT_WRITE_TEMPLATE = 'PGP_SYM_ENCRYPT(\'%s\', \'%s\')'; protected $dbTable; // Name of the DB-Table for CI-Insert, -Update, ... 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 - protected $passwordName; // Eventually the name of the password that is used to encrypt/decrypt - protected $encryptedColumns; // Eventually an array of columns to be encrypted/decrypted private $executedQueryMetaData; private $executedQueryListFields; @@ -78,8 +80,6 @@ class DB_Model extends CI_Model // Set properties $this->hasSequence = true; - $this->passwordName = null; - $this->encryptedColumns = null; $this->debugMode = isset($this->db->db_debug) && $this->db->db_debug === true; // Loads UDF model @@ -114,7 +114,7 @@ class DB_Model extends CI_Model * @param array $data DataArray for Insert * @return array */ - public function insert($data) + public function insert($data, $encryptedColumns = null) { // Check class properties if (is_null($this->dbTable)) return error('The given database table name is not valid', EXIT_MODEL); @@ -122,8 +122,8 @@ class DB_Model extends CI_Model // If this table has UDF and the validation of them is ok if (isError($validate = $this->_prepareUDFsWrite($data, $this->dbTable))) return $validate; - // - $this->_encrypt($data); + // Add the pgp_sym_eccrypt postgresql function to the set clause if needed + $this->_addEncrypt($encryptedColumns, $data); // DB-INSERT $insert = $this->db->insert($this->dbTable, $data); @@ -167,7 +167,7 @@ class DB_Model extends CI_Model * @param array $data DataArray for Insert * @return array */ - public function update($id, $data) + public function update($id, $data, $encryptedColumns = null) { // Check class properties if (is_null($this->pk)) return error('The given primary key is not valid', EXIT_MODEL); @@ -193,8 +193,8 @@ class DB_Model extends CI_Model $this->db->where($tmpId); - // - $this->_encrypt($data); + // Add the pgp_sym_eccrypt postgresql function to the set clause if needed + $this->_addEncrypt($encryptedColumns, $data); // DB-UPDATE $update = $this->db->update($this->dbTable, $data); @@ -259,7 +259,7 @@ class DB_Model extends CI_Model * @param string $id ID (Primary Key) for SELECT ... WHERE * @return array */ - public function load($id = null) + public function load($id = null, $encryptedColumns = null) { // Check class properties if (is_null($this->pk)) return error('The given primary key is not valid', EXIT_MODEL); @@ -280,7 +280,7 @@ class DB_Model extends CI_Model $tmpId = array($this->pk => $id); } - return $this->loadWhere($tmpId); + return $this->loadWhere($tmpId, $encryptedColumns); } /** @@ -288,11 +288,14 @@ class DB_Model extends CI_Model * * @return array */ - public function loadWhere($where = null) + public function loadWhere($where = null, $encryptedColumns = null) { // Check class properties if (is_null($this->dbTable)) return error('The given database table name is not valid', EXIT_MODEL); + // Add the pgp_sym_decrypt postgresql function to the select and where clause if needed + $this->_addDecryptLoad($encryptedColumns, $where); + // Execute query $result = $this->db->get_where($this->dbTable, $where); @@ -300,10 +303,7 @@ class DB_Model extends CI_Model if ($result) { - // Decrypt data if needed - $this->_decrypt($result); - - return success($this->_toPhp($result)); + return success($this->_toPhp($result, $encryptedColumns)); } else { @@ -366,9 +366,6 @@ class DB_Model extends CI_Model // Execute the query $resultDB = $this->db->get_where($this->dbTable, $where); - // Decrypt data if needed - $this->_decrypt($resultDB); - $this->_logLastQuery(); // If everything went ok... @@ -799,7 +796,7 @@ class DB_Model extends CI_Model /** * Like execQuery, but it allows only to perform queries to read data */ - public function execReadOnlyQuery($query, $parametersArray = null) + public function execReadOnlyQuery($query, $parametersArray = null, $encryptedColumns = null) { $result = error('You are allowed to run only query for reading data'); // $cleanedQuery = trim(preg_replace('/\t|\n|\r|;/', '', $query)); // @@ -816,7 +813,7 @@ class DB_Model extends CI_Model { $queryToExec = str_replace(';', '', $query); // - $result = $this->execQuery($queryToExec, $parametersArray); + $result = $this->execQuery($queryToExec, $parametersArray, $encryptedColumns); } return $result; @@ -831,13 +828,16 @@ class DB_Model extends CI_Model * boolean if the query is of the write type (INSERT, UPDATE, DELETE...) * array that represents DB data */ - protected function execQuery($query, $parametersArray = null) + protected function execQuery($query, $parametersArray = null, $encryptedColumns = null) { $result = null; // If the query is empty don't lose time if (!isEmptyString($query)) { + // Add the pgp_sym_decrypt postgresql function to the given query + $this->_addDecryptQuery($encryptedColumns, $query); + // If there are parameters to bind to the query if (is_array($parametersArray) && count($parametersArray) > 0) { @@ -853,7 +853,7 @@ class DB_Model extends CI_Model // If no errors occurred if ($resultDB) { - $result = success($this->_toPhp($resultDB)); + $result = success($this->_toPhp($resultDB, $encryptedColumns)); } else { @@ -895,92 +895,202 @@ class DB_Model extends CI_Model // // - /** - * If the cryptography is enabled and correctly configured + * To add the pgp_sym_encrypt function to the set clause where needed */ - private function _isCryptoEnabledAndValid() + private function _addEncrypt($encryptedColumns, &$data) { - // Get the password list to decrypt/encrypt from the configuration - $encryptionPasswords = $this->config->item(self::ENCRYPTION_PASSWORDS); - - // If not configured or wrongly configured - if (isEmptyArray($encryptionPasswords)) return false; - - // If array of encrypted columns is defined or wrongly defined for this model - if (isEmptyArray($this->encryptedColumns)) return false; - - // If no decryption/encryption password name is defined for this model - if (isEmptyString($this->passwordName)) return false; - - // If the configured password name does not exists in the password list to decrypt/encrypt - if (!array_key_exists($this->passwordName, $encryptionPasswords)) return false; - - // - return true; - } - - /** - * Returns a cipher to decrypt/encrypt data - */ - private function _getCipher() - { - // Set the cipher type - $cipher = new Twofish(); - // Set the password to encrypt using the chosen one - $cipher->setPassword($this->config->item(self::ENCRYPTION_PASSWORDS)[$this->passwordName]); - - return $cipher; - } - - /** - * To encrypt data - * Data is an associative array that contains column names as keys and the colum value as array value - */ - private function _encrypt(&$data) - { - // If no encryption is configured or not correctly configured then exit this method - if (!$this->_isCryptoEnabledAndValid()) return; - - // Gets the cipher - $cipher = $this->_getCipher(); + $tmpData = array(); // Temporary array used to copy not encrypted columns // For each column that is going to be inserted/updated foreach ($data as $column => $value) { // If the current column is in the list of the columns to be encrypted - if (in_array($column, $this->encryptedColumns)) + // and contains the password name element + if (array_key_exists($column, $encryptedColumns) + && array_key_exists(self::CRYPT_PASSWORD_NAME, $encryptedColumns[$column])) { - // Encrypt it! - $data[$column] = base64_encode($cipher->encrypt($value)); + // Password to encrypt data + $encryptionPassword = $this->config->item(self::CRYPT_CONF_PASSWORDS)[ + $encryptedColumns[$column][self::CRYPT_PASSWORD_NAME] + ]; + + // Add the encrypted column to the set clause without escaping + $this->db->set( + $column, + sprintf( + self::CRYPT_WRITE_TEMPLATE, + $value, + $encryptionPassword + ), + false + ); + } + else // otherwise copy this element as it is + { + $tmpData[$column] = $value; + } + } + + $data = $tmpData; // this array does not contain encrypted columns + } + + /** + * To add the pgp_sym_decrypt function to the given query + */ + private function _addDecryptQuery($encryptedColumns, &$query) + { + // If it is request to get encrypted columns + if (!isEmptyArray($encryptedColumns)) + { + // For each requested encrypted column + foreach ($encryptedColumns as $encryptedColumn => $definition) + { + // If the requested encrypted column is well defined + if (!isEmptyArray($definition) + && array_key_exists(self::CRYPT_CAST, $definition) + && array_key_exists(self::CRYPT_PASSWORD_NAME, $definition)) + { + // And if exists the wanted password to decrypt in the configs + if (array_key_exists( + $definition[self::CRYPT_PASSWORD_NAME], + $this->config->item(self::CRYPT_CONF_PASSWORDS)) + ) + { + // Password to decrypt data + $decryptionPassword = $this->config->item(self::CRYPT_CONF_PASSWORDS)[ + $definition[self::CRYPT_PASSWORD_NAME] + ]; + + // Find and replace all the occurrences of the provided encrypted columns + // with the postgresql decryption function + $query = str_replace( + $encryptedColumn, + sprintf( + self::CRYPT_WHERE_TEMPLATE, + $encryptedColumn, + $decryptionPassword, + $definition[self::CRYPT_CAST] + ), + $query + ); + } + } } } } /** - * To decrypt data - * dbResult is an array of objects, each object is a representation of a database record, - * each property of the object is the column name and the property value is the database value + * To add the pgp_sym_decrypt function to the select and where clause where needed */ - private function _decrypt(&$dbResult) + private function _addDecryptLoad($encryptedColumns, &$where) { - // If no encryption is configured or not correctly configured then exit this method - if (!$this->_isCryptoEnabledAndValid()) return; - - // Gets the cipher - $cipher = $this->_getCipher(); - - // For each record from database - foreach ($dbResult->result() as $record) + // If it is request to get encrypted columns + if (!isEmptyArray($encryptedColumns)) { - // For each column to be encrypted - foreach ($this->encryptedColumns as $column) + // For each requested encrypted column + foreach ($encryptedColumns as $encryptedColumn => $definition) { - // If the current record contains such a column - if (property_exists($record, $column)) + // If the requested encrypted column is well defined + if (!isEmptyArray($definition) + && array_key_exists(self::CRYPT_CAST, $definition) + && array_key_exists(self::CRYPT_PASSWORD_NAME, $definition)) { - // Decrypt it! - $record->{$column} = $cipher->decrypt(base64_decode($record->{$column})); + // And if exists the wanted password to decrypt in the configs + if (array_key_exists( + $definition[self::CRYPT_PASSWORD_NAME], + $this->config->item(self::CRYPT_CONF_PASSWORDS)) + ) + { + // Password to decrypt data + $decryptionPassword = $this->config->item(self::CRYPT_CONF_PASSWORDS)[ + $definition[self::CRYPT_PASSWORD_NAME] + ]; + + // ----------------------------------------- + // SELECT + + // Add to the select clause the column to be decrypted + // NOTE: this is going to override any previously added column with the same name + $this->addSelect( + sprintf( + self::CRYPT_SELECT_TEMPLATE, + $encryptedColumn, + $decryptionPassword, + $definition[self::CRYPT_CAST], + $encryptedColumn + ) + ); + + // ----------------------------------------- + // WHERE + + // If the where parameter is a valid array + if (!isEmptyArray($where)) + { + $tmpWhere = array(); + + // For each condition of the where clause + foreach ($where as $column => $condition) + { + $operator = null; // operator not found in the column name + + // Custom operators + if (strpos($column, '>') != false + || strpos($column, '<') != false + || strpos($column, '>=') != false + || strpos($column, '<=') != false + || strpos($column, '!=') != false + || strpos($column, '=') != false + ) + { + $operator = ' '.substr(trim($column), -1).' '; + } + else // default operator + { + $operator = ' = '; + } + + // If the column from the where clause is the same from the encrypted columns definition + if (trim($column) == $encryptedColumn + || ($operator != null && substr(trim($column), 0, strlen(trim($column)) - 2) == $encryptedColumn) + ) + { + // Then rename the column using the postgresql decryption function + $tmpWhere[ + sprintf( + self::CRYPT_WHERE_TEMPLATE, + $encryptedColumn, + $decryptionPassword, + $definition[self::CRYPT_CAST] + ).$operator + ] = $condition; + } + else // otherwise copy the column as it is + { + $tmpWhere[$column] = $condition; + } + } + + $where = $tmpWhere; // replace with the new where + } + // Otherwise if the where parameter is a valid string + elseif (!isEmptyString($where)) + { + // Find and replace all the occurrences of the provided encrypted columns + // with the postgresql decryption function + $where = str_replace( + $encryptedColumn, + sprintf( + self::CRYPT_WHERE_TEMPLATE, + $encryptedColumn, + $decryptionPassword, + $definition[self::CRYPT_CAST] + ), + $where + ); + } + } } } } @@ -1029,7 +1139,7 @@ class DB_Model extends CI_Model * - A FALSE value on failure * - Otherwise an object filled with data on success */ - private function _toPhp($result) + private function _toPhp($result, $encryptedColumns = null) { $udfs = false; // if UDFs are inside the given result set $toPhp = $result; // if there is nothing to convert then return the result from DB @@ -1045,7 +1155,9 @@ class DB_Model extends CI_Model // Looking for booleans, arrays and UDFs foreach ($this->executedQueryMetaData as $eqmd) { - // If array type, boolean type OR a UDF + // If array type, boolean type, numeric type + // Or bytea type + // Or UDF type if (strpos($eqmd->type, DB_Model::PGSQL_ARRAY_TYPE) !== false || $eqmd->type == DB_Model::PGSQL_BOOLEAN_TYPE || $eqmd->type == DB_Model::PGSQL_INT2_TYPE @@ -1053,6 +1165,7 @@ class DB_Model extends CI_Model || $eqmd->type == DB_Model::PGSQL_INT8_TYPE || $eqmd->type == DB_Model::PGSQL_FLOAT4_TYPE || $eqmd->type == DB_Model::PGSQL_FLOAT8_TYPE + || $eqmd->type == DB_Model::PGSQL_BYTEA_TYPE || $this->udflib->isUDFColumn($eqmd->name, $eqmd->type)) { // If UDFs are inside this result set @@ -1115,6 +1228,21 @@ class DB_Model extends CI_Model { $resultElement->{$toBeConverted->name} = $this->pgFloatPhp($resultElement->{$toBeConverted->name}); } + // Byte A type + elseif ($toBeConverted->type == DB_Model::PGSQL_BYTEA_TYPE) + { + // If encrypted columns are defined + // and if the byte a column is defined as encrypted column + if (!isEmptyArray($encryptedColumns) + && array_key_exists($toBeConverted->name, $encryptedColumns)) + { + // keep the column + } + else // otherwise remove the column from the result + { + unset($resultElement->{$toBeConverted->name}); + } + } } } } diff --git a/application/libraries/FilterWidgetLib.php b/application/libraries/FilterWidgetLib.php index 19cdec848..72a749d60 100644 --- a/application/libraries/FilterWidgetLib.php +++ b/application/libraries/FilterWidgetLib.php @@ -1,5 +1,22 @@ . + */ + if (! defined('BASEPATH')) exit('No direct script access allowed'); /** @@ -16,6 +33,7 @@ class FilterWidgetLib const SESSION_SELECTED_FIELDS = 'selectedFields'; const SESSION_COLUMNS_ALIASES = 'columnsAliases'; const SESSION_ADDITIONAL_COLUMNS = 'additionalColumns'; + const SESSION_ENCRYPTED_COLUMNS = 'encryptedColumns'; const SESSION_CHECKBOXES = 'checkboxes'; const SESSION_FILTERS = 'filters'; const SESSION_METADATA = 'datasetMetadata'; @@ -56,6 +74,7 @@ class FilterWidgetLib const ADDITIONAL_COLUMNS = 'additionalColumns'; const CHECKBOXES = 'checkboxes'; const COLUMNS_ALIASES = 'columnsAliases'; + const ENCRYPTED_COLUMNS = 'encryptedColumns'; // ...to format/mark records of a dataset const FORMAT_ROW = 'formatRow'; @@ -367,7 +386,7 @@ class FilterWidgetLib /** * Retrieves the dataset from the DB */ - public function getDataset($datasetQuery) + public function getDataset($datasetQuery, $encryptedColumns) { $dataset = null; @@ -376,7 +395,7 @@ class FilterWidgetLib $this->_ci->load->model('system/Filters_model', 'FiltersModel'); // Execute the given SQL statement suppressing error messages - $dataset = @$this->_ci->FiltersModel->execReadOnlyQuery($datasetQuery); + $dataset = @$this->_ci->FiltersModel->execReadOnlyQuery($datasetQuery, null, $encryptedColumns); } return $dataset; diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php index 8875fd4c5..cf99099fe 100644 --- a/application/models/person/Person_model.php +++ b/application/models/person/Person_model.php @@ -1,5 +1,22 @@ . + */ + class Person_model extends DB_Model { /** @@ -8,6 +25,7 @@ class Person_model extends DB_Model public function __construct() { parent::__construct(); + $this->dbTable = 'public.tbl_person'; $this->pk = 'person_id'; @@ -336,3 +354,4 @@ class Person_model extends DB_Model return $this->execQuery($qry, array($person_id, $person_id, $person_id)); } } + diff --git a/application/models/system/PersonLog_model.php b/application/models/system/PersonLog_model.php index 7a66958b8..88b50487a 100644 --- a/application/models/system/PersonLog_model.php +++ b/application/models/system/PersonLog_model.php @@ -1,5 +1,22 @@ . + */ + class PersonLog_model extends DB_Model { /** @@ -17,7 +34,7 @@ class PersonLog_model extends DB_Model * @param array $data Data of Log Entry to save. * @return success object if true */ - public function insert($data) + public function insert($data, $encryptedColumns = null) { $result = $this->db->insert($this->dbTable, $data); if ($result) diff --git a/application/widgets/FilterWidget.php b/application/widgets/FilterWidget.php index 1cef91c15..4c40e434a 100644 --- a/application/widgets/FilterWidget.php +++ b/application/widgets/FilterWidget.php @@ -1,5 +1,22 @@ . + */ + /** * To filter data using a SQL statement */ @@ -59,6 +76,8 @@ class FilterWidget extends Widget private $_sessionTimeout; // session expiring time + private $_encryptedColumns; // contains info about encrypted columns + private static $_FilterWidgetInstance; // static property that contains the instance of itself /** @@ -195,6 +214,7 @@ class FilterWidget extends Widget $this->_formatRow = null; $this->_markRow = null; $this->_checkboxes = null; + $this->_encryptedColumns = null; $this->_hideOptions = null; $this->_hideSelectFields = null; $this->_hideSelectFilters = null; @@ -252,6 +272,14 @@ class FilterWidget extends Widget $this->_additionalColumns = $args[FilterWidgetLib::ADDITIONAL_COLUMNS]; } + // Parameter is used to define the ecrypted columns + if (isset($args[FilterWidgetLib::ENCRYPTED_COLUMNS]) + && is_array($args[FilterWidgetLib::ENCRYPTED_COLUMNS]) + && count($args[FilterWidgetLib::ENCRYPTED_COLUMNS]) > 0) + { + $this->_encryptedColumns = $args[FilterWidgetLib::ENCRYPTED_COLUMNS]; + } + // Parameter is used to add use aliases for the columns fo the dataset if (isset($args[FilterWidgetLib::COLUMNS_ALIASES]) && is_array($args[FilterWidgetLib::COLUMNS_ALIASES]) @@ -441,7 +469,7 @@ class FilterWidget extends Widget ); // Then retrieve dataset from DB - $dataset = $this->filterwidgetlib->getDataset($datasetQuery); + $dataset = $this->filterwidgetlib->getDataset($datasetQuery, $this->_encryptedColumns); // Save changes into session if data are valid if (!isError($dataset)) @@ -476,7 +504,7 @@ class FilterWidget extends Widget $datasetQuery = $this->filterwidgetlib->generateDatasetQuery($this->_query, $parsedFilterJson->filters); // Then retrieve dataset from DB - $dataset = $this->filterwidgetlib->getDataset($datasetQuery); + $dataset = $this->filterwidgetlib->getDataset($datasetQuery, $this->_encryptedColumns); // Try to load the name of the filter using the PhrasesLib $filterName = $this->filterwidgetlib->getFilterName($parsedFilterJson); @@ -497,6 +525,7 @@ class FilterWidget extends Widget FilterWidgetLib::SESSION_SELECTED_FIELDS => $this->_getColumnsNames($parsedFilterJson->columns), // all the selected fields FilterWidgetLib::SESSION_COLUMNS_ALIASES => $this->_columnsAliases, // all the fields aliases FilterWidgetLib::SESSION_ADDITIONAL_COLUMNS => $this->_additionalColumns, // additional columns + FilterWidgetLib::SESSION_ENCRYPTED_COLUMNS => $this->_encryptedColumns, // encrypted columns FilterWidgetLib::SESSION_CHECKBOXES => $this->_checkboxes, // the name of the field used to build the checkboxes column FilterWidgetLib::SESSION_FILTERS => $parsedFilterJson->filters, // all the filters used to filter the dataset FilterWidgetLib::SESSION_METADATA => $this->FiltersModel->getExecutedQueryMetaData(), // the metadata of the dataset From facee3076d858db2e3c14eb6c5856156e31693f1 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Wed, 15 Feb 2023 15:55:37 +0100 Subject: [PATCH 011/263] first guess vue vertragsbestandteil und gehaltsbestandteil components --- application/controllers/system/TestVBform.php | 32 ++++++ application/views/system/logs/testVBform.php | 16 +++ public/js/apps/vbform/vbform.js | 22 +++++ .../components/vbform/gehaltsbestandteil.js | 57 +++++++++++ .../vbform/gehaltsbestandteilhelper.js | 53 ++++++++++ public/js/components/vbform/gueltigkeit.js | 25 +++++ .../vbform/vertragsbestandteil_freitext.js | 72 ++++++++++++++ .../vbform/vertragsbestandteil_funktion.js | 55 +++++++++++ .../vbform/vertragsbestandteil_stunden.js | 48 +++++++++ .../vertragsbestandteil_zeitaufzeichnung.js | 65 ++++++++++++ .../vbform/vertragsbestandteilhelper.js | 98 +++++++++++++++++++ 11 files changed, 543 insertions(+) create mode 100644 application/controllers/system/TestVBform.php create mode 100644 application/views/system/logs/testVBform.php create mode 100644 public/js/apps/vbform/vbform.js create mode 100644 public/js/components/vbform/gehaltsbestandteil.js create mode 100644 public/js/components/vbform/gehaltsbestandteilhelper.js create mode 100644 public/js/components/vbform/gueltigkeit.js create mode 100644 public/js/components/vbform/vertragsbestandteil_freitext.js create mode 100644 public/js/components/vbform/vertragsbestandteil_funktion.js create mode 100644 public/js/components/vbform/vertragsbestandteil_stunden.js create mode 100644 public/js/components/vbform/vertragsbestandteil_zeitaufzeichnung.js create mode 100644 public/js/components/vbform/vertragsbestandteilhelper.js diff --git a/application/controllers/system/TestVBform.php b/application/controllers/system/TestVBform.php new file mode 100644 index 000000000..9923bf05b --- /dev/null +++ b/application/controllers/system/TestVBform.php @@ -0,0 +1,32 @@ + 'system/developer:r' + ) + ); + } + + // ----------------------------------------------------------------------------------------------------------------- + // Public methods + + /** + * Everything has a beginning + */ + public function index() + { + $this->load->view('system/logs/testVBform.php'); + } +} diff --git a/application/views/system/logs/testVBform.php b/application/views/system/logs/testVBform.php new file mode 100644 index 000000000..566abb1cb --- /dev/null +++ b/application/views/system/logs/testVBform.php @@ -0,0 +1,16 @@ + 'Test VBform', + 'bootstrap5' => true, + 'fontawesome6' => true, + 'vue3' => true, + 'customJSModules' => array('public/js/apps/vbform/vbform.js') + ); + + $this->load->view('templates/FHC-Header', $includesArray); +?> + +
+ +load->view('templates/FHC-Footer', $includesArray); ?> + diff --git a/public/js/apps/vbform/vbform.js b/public/js/apps/vbform/vbform.js new file mode 100644 index 000000000..2ca309ba8 --- /dev/null +++ b/public/js/apps/vbform/vbform.js @@ -0,0 +1,22 @@ +import vertragsbestandteilhelper from '../../components/vbform/vertragsbestandteilhelper.js'; + +Vue.createApp({ + template: ` +
+

{{ title }}

+ +
+ `, + data: function() { + return { + "title": "Vertragsbestandteil Form", + }; + }, + components: { + 'vertragsbestandteilhelper': vertragsbestandteilhelper + }, + created: function() { + }, + methods: { + } +}).mount('#main'); diff --git a/public/js/components/vbform/gehaltsbestandteil.js b/public/js/components/vbform/gehaltsbestandteil.js new file mode 100644 index 000000000..ac4d726c5 --- /dev/null +++ b/public/js/components/vbform/gehaltsbestandteil.js @@ -0,0 +1,57 @@ +import gueltigkeit from './gueltigkeit.js'; + +export default { + props: [ + 'id' + ], + data: function() { + return { + gehaltstyp : '', + betrag: '', + gueltig_ab: '', + gueltig_bis: '', + valorisierung: '' + } + }, + template: ` +
+
+ +
+
+ +
+ +
+ + +
+
+ +
+
+ `, + components: { + 'gueltigkeit': gueltigkeit + }, + methods: { + removeGB: function() { + this.$emit('removeGB', {id: this.id}); + }, + getPayload: function() { + return { + gehaltstyp: this.gehaltstyp, + betrag: this.betrag, + gueltigkeit: this.$refs.gueltigkeit.getPayload(), + valorisierung: this.valorisierung + }; + } + } +} diff --git a/public/js/components/vbform/gehaltsbestandteilhelper.js b/public/js/components/vbform/gehaltsbestandteilhelper.js new file mode 100644 index 000000000..865a98ec5 --- /dev/null +++ b/public/js/components/vbform/gehaltsbestandteilhelper.js @@ -0,0 +1,53 @@ +import gehaltsbestandteil from './gehaltsbestandteil'; + +export default { + template: ` + +
+
+ +
+
+ `, + data: function() { + return { + payload: [], + gbs: [], + }; + }, + components: { + 'gehaltsbestandteil': gehaltsbestandteil, + }, + methods: { + addGB: function(e) { + e.preventDefault(); + e.stopPropagation(); + + var gbid = 'testgb' + (this.gbs.length + 1); + this.gbs.push({ + id: gbid + }); + }, + removeGB: function(payload) { + var gbs = this.gbs.filter(function(gb) { + return gb.id !== payload.id; + }); + this.gbs = gbs; + }, + getPayload: function() { + var gbs = this.gbs; + var that = this; + + this.payload = []; + gbs.forEach(function(gb) { + that.payload.push(that.$refs[gb.id][0].getPayload()); + }); + + return this.payload; + } + } +} diff --git a/public/js/components/vbform/gueltigkeit.js b/public/js/components/vbform/gueltigkeit.js new file mode 100644 index 000000000..ea40f920f --- /dev/null +++ b/public/js/components/vbform/gueltigkeit.js @@ -0,0 +1,25 @@ +export default { + data: function() { + return { + gueltig_ab: '', + gueltig_bis: '' + } + }, + template: ` +
+ +
+
+ +
+ `, + components: {}, + methods: { + getPayload: function() { + return { + gueltig_ab: this.gueltig_ab, + gueltig_bis: this.gueltig_bis, + }; + } + } +} diff --git a/public/js/components/vbform/vertragsbestandteil_freitext.js b/public/js/components/vbform/vertragsbestandteil_freitext.js new file mode 100644 index 000000000..03dc41be6 --- /dev/null +++ b/public/js/components/vbform/vertragsbestandteil_freitext.js @@ -0,0 +1,72 @@ +import gehaltsbestandteilhelper from './gehaltsbestandteilhelper.js'; +import gueltigkeit from './gueltigkeit.js'; + +export default { + props: [ + 'id' + ], + emits: { + removeVB: null + }, + data: function() { + return { + freitexttyp: '', + titel: '', + freitext: '', + kuendigungsrelevant: '' + } + }, + template: ` +
+
+
+ +
+
+
+
+ +
+ +
+
+
+ +
+
+
+
+ +
+
+
+ +
+
+ `, + components: { + 'gehaltsbestandteilhelper': gehaltsbestandteilhelper, + 'gueltigkeit': gueltigkeit + }, + methods: { + removeVB: function() { + this.$emit('removeVB', {id: this.id}); + }, + getPayload: function() { + return { + freitexttyp: this.freitexttyp, + titel: this.titel, + freitext: this.freitext, + kuendigungsrelevant: this.kuendigungsrelevant, + gueltigkeit: this.$refs.gueltigkeit.getPayload(), + gehaltsbestandteile: this.$refs.gbh.getPayload() + }; + } + } +} diff --git a/public/js/components/vbform/vertragsbestandteil_funktion.js b/public/js/components/vbform/vertragsbestandteil_funktion.js new file mode 100644 index 000000000..8c14a6ddf --- /dev/null +++ b/public/js/components/vbform/vertragsbestandteil_funktion.js @@ -0,0 +1,55 @@ +import gehaltsbestandteilhelper from './gehaltsbestandteilhelper.js' +import gueltigkeit from './gueltigkeit.js'; + +export default { + props: [ + 'id' + ], + emits: { + removeVB: null + }, + data: function () { + return { + funktion: '', + orget: '', + gueltig_ab: '', + gueltig_bis: '' + } + }, + template: ` +
+
+
+ +
+
+
+
+ +
+
+ +
+ +
+ +
+ `, + components: { + 'gehaltsbestandteilhelper': gehaltsbestandteilhelper, + 'gueltigkeit': gueltigkeit + }, + methods: { + removeVB: function() { + this.$emit('removeVB', {id: this.id}); + }, + getPayload: function() { + return { + funktion: this.funktion, + orget: this.orget, + gueltigkeit: this.$refs.gueltigkeit.getPayload(), + gehaltsbestandteile: this.$refs.gbh.getPayload() + }; + } + } +} diff --git a/public/js/components/vbform/vertragsbestandteil_stunden.js b/public/js/components/vbform/vertragsbestandteil_stunden.js new file mode 100644 index 000000000..4cdfafe0d --- /dev/null +++ b/public/js/components/vbform/vertragsbestandteil_stunden.js @@ -0,0 +1,48 @@ +import gehaltsbestandteilhelper from './gehaltsbestandteilhelper.js'; +import gueltigkeit from './gueltigkeit.js'; + +export default { + props: [ + 'id' + ], + emits: { + removeVB: null + }, + data: function () { + return { + stunden: '' + } + }, + "template": ` +
+
+
+ +
+
+
+
+ +
+ +
+ +
+ `, + components: { + 'gehaltsbestandteilhelper': gehaltsbestandteilhelper, + 'gueltigkeit': gueltigkeit + }, + methods: { + removeVB: function() { + this.$emit('removeVB', {id: this.id}); + }, + getPayload: function() { + return { + stunden: this.stunden, + gueltigkeit: this.$refs.gueltigkeit.getPayload(), + gehaltsbestandteile: this.$refs.gbh.getPayload() + }; + } + } +} diff --git a/public/js/components/vbform/vertragsbestandteil_zeitaufzeichnung.js b/public/js/components/vbform/vertragsbestandteil_zeitaufzeichnung.js new file mode 100644 index 000000000..f16555d2d --- /dev/null +++ b/public/js/components/vbform/vertragsbestandteil_zeitaufzeichnung.js @@ -0,0 +1,65 @@ +import gueltigkeit from './gueltigkeit.js'; + +export default { + props: [ + 'id' + ], + emits: { + removeVB: null + }, + data: function () { + return { + zeitaufzeichnung: '', + azgrelevant: '', + homeoffice: '', + gueltig_ab: '', + gueltig_bis: '' + } + }, + template: ` +
+
+
+ +
+
+
+
+ + +
+
+ + +
+
+ + +
+ +
+
+ `, + components: { + 'gueltigkeit': gueltigkeit + }, + methods: { + removeVB: function() { + this.$emit('removeVB', {id: this.id}); + }, + getPayload: function() { + return { + zeitaufzeichnung: this.zeitaufzeichnung, + azgrelevant: this.azgrelevant, + homeoffice: this.homeoffice, + gueltigkeit: this.$refs.gueltigkeit.getPayload(), + }; + } + } +} diff --git a/public/js/components/vbform/vertragsbestandteilhelper.js b/public/js/components/vbform/vertragsbestandteilhelper.js new file mode 100644 index 000000000..0a3707664 --- /dev/null +++ b/public/js/components/vbform/vertragsbestandteilhelper.js @@ -0,0 +1,98 @@ +import vertragsbestandteilstunden from './vertragsbestandteil_stunden.js'; +import vertragsbestandteilzeitaufzeichnung from './vertragsbestandteil_zeitaufzeichnung.js'; +import vertragsbestandteilfunktion from './vertragsbestandteil_funktion.js'; +import vertragsbestandteilfreitext from './vertragsbestandteil_freitext.js'; + +export default { + template: ` +
+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+{{resjson}}
+      
+
+
+ `, + data: function() { + return { + vertragsbestandteiltyp: 'vertragsbestandteil', + payload: { + vbs: [] + }, + vbs: [ + { + type: 'vertragsbestandteilstunden', + id: 'test1' + }, + { + type: 'vertragsbestandteilzeitaufzeichnung', + id: 'test2' + } + ], + }; + }, + components: { + 'vertragsbestandteilstunden': vertragsbestandteilstunden, + 'vertragsbestandteilzeitaufzeichnung': vertragsbestandteilzeitaufzeichnung, + 'vertragsbestandteilfunktion': vertragsbestandteilfunktion, + 'vertragsbestandteilfreitext': vertragsbestandteilfreitext, + }, + methods: { + addVB: function(e) { + e.preventDefault(); + e.stopPropagation(); + + var vbid = 'test' + (this.vbs.length + 1); + this.vbs.push({ + type: this.vertragsbestandteiltyp, + id: vbid + }); + }, + removeVB: function(payload) { + var vbs = this.vbs.filter(function(vb) { + return vb.id !== payload.id; + }); + this.vbs = vbs; + }, + getJSON: function(e) { + e.preventDefault(); + e.stopPropagation(); + + var vbs = this.vbs; + var that = this; + + this.payload = { + vbs: [] + }; + vbs.forEach(function(vb) { + that.payload.vbs.push(that.$refs[vb.id][0].getPayload()); + }); + } + }, + computed: { + resjson: function() { + return JSON.stringify(this.payload, null, 2); + } + } +} From f80ecd9aa2120ac077fc8325587183377d7b86b6 Mon Sep 17 00:00:00 2001 From: Werner Masik Date: Fri, 17 Feb 2023 10:41:35 +0100 Subject: [PATCH 012/263] fix missing extension --- public/js/components/vbform/gehaltsbestandteilhelper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/components/vbform/gehaltsbestandteilhelper.js b/public/js/components/vbform/gehaltsbestandteilhelper.js index 865a98ec5..fc0bf74f4 100644 --- a/public/js/components/vbform/gehaltsbestandteilhelper.js +++ b/public/js/components/vbform/gehaltsbestandteilhelper.js @@ -1,4 +1,4 @@ -import gehaltsbestandteil from './gehaltsbestandteil'; +import gehaltsbestandteil from './gehaltsbestandteil.js'; export default { template: ` From 9b8a1ba096375c783bf1c45f67eff87f9c559b72 Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 17 Feb 2023 14:01:09 +0100 Subject: [PATCH 013/263] - Added new constants SESSION_ENCRYPTED_COLUMNS and ENCRYPTED_COLUMNS to libraries/FilterCmptLib - Added new private property _encryptedColumns to libraries/FilterCmptLib - libraries/FilterCmptLib: execReadOnlyQuery is now called providing the parameter _encryptedColumns to read database encrypted columns --- application/libraries/FilterCmptLib.php | 13 ++++++++++++- application/libraries/TableWidgetLib.php | 17 +++++++++++++++++ application/widgets/TableWidget.php | 17 +++++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/application/libraries/FilterCmptLib.php b/application/libraries/FilterCmptLib.php index 9d6dfa681..3e885b6e7 100644 --- a/application/libraries/FilterCmptLib.php +++ b/application/libraries/FilterCmptLib.php @@ -1,4 +1,5 @@ _filterKurzbz = null; $this->_query = null; $this->_requiredPermissions = null; + $this->_encryptedColumns = null; $this->_reloadDataset = true; // by default the dataset is NOT cached in session $this->_sessionTimeout = FilterCmptLib::SESSION_DEFAULT_TIMEOUT; @@ -727,6 +732,12 @@ class FilterCmptLib $this->_requiredPermissions = $filterCmptArray[FilterCmptLib::REQUIRED_PERMISSIONS]; } + // Retrieved the encrypted columns parameter if present + if (isset($filterCmptArray[FilterCmptLib::ENCRYPTED_COLUMNS])) + { + $this->_encryptedColumns = $filterCmptArray[FilterCmptLib::ENCRYPTED_COLUMNS]; + } + // Parameters needed to retrieve univocally a filter from DB if (isset($filterCmptArray[FilterCmptLib::APP])) { @@ -1129,7 +1140,7 @@ class FilterCmptLib $this->_ci->load->model('system/Filters_model', 'FiltersModel'); // Execute the given SQL statement suppressing error messages - $dataset = @$this->_ci->FiltersModel->execReadOnlyQuery($datasetQuery); + $dataset = @$this->_ci->FiltersModel->execReadOnlyQuery($datasetQuery, null, $this->_encryptedColumns); } return $dataset; diff --git a/application/libraries/TableWidgetLib.php b/application/libraries/TableWidgetLib.php index dc746b6d5..e8538e84e 100644 --- a/application/libraries/TableWidgetLib.php +++ b/application/libraries/TableWidgetLib.php @@ -1,5 +1,22 @@ . + */ + if (! defined('BASEPATH')) exit('No direct script access allowed'); /** diff --git a/application/widgets/TableWidget.php b/application/widgets/TableWidget.php index 5a000601f..44dc18bd4 100644 --- a/application/widgets/TableWidget.php +++ b/application/widgets/TableWidget.php @@ -1,5 +1,22 @@ . + */ + /** * To display a table that shows data retriev by a SQL statement */ From 0413528798f9dc02c3233ee9b4c68d15c8d4e158 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Fri, 17 Feb 2023 16:05:35 +0100 Subject: [PATCH 014/263] cleanup form, add preset functionality for structure and data, use same JSON for preset and formoutput - prepare for save and restore before persisting to db --- public/js/apps/vbform/presets.js | 222 ++++++++++++++++++ public/js/apps/vbform/vbform.js | 10 +- public/js/components/vbform/debug_viewer.js | 12 + .../components/vbform/gehaltsbestandteil.js | 92 +++++--- .../vbform/gehaltsbestandteilhelper.js | 36 +-- .../js/components/vbform/presets_chooser.js | 58 +++++ .../vbform/vertragsbestandteil_freitext.js | 113 +++++---- .../vbform/vertragsbestandteil_funktion.js | 73 +++--- .../vbform/vertragsbestandteil_stunden.js | 69 ++++-- .../vertragsbestandteil_zeitaufzeichnung.js | 74 ++++-- .../vbform/vertragsbestandteilhelper.js | 78 +++--- public/js/helpers/vbform/uuid.js | 14 ++ public/js/mixins/vbform/configurable.js | 14 ++ public/js/mixins/vbform/presetable.js | 21 ++ 14 files changed, 669 insertions(+), 217 deletions(-) create mode 100644 public/js/apps/vbform/presets.js create mode 100644 public/js/components/vbform/debug_viewer.js create mode 100644 public/js/components/vbform/presets_chooser.js create mode 100644 public/js/helpers/vbform/uuid.js create mode 100644 public/js/mixins/vbform/configurable.js create mode 100644 public/js/mixins/vbform/presetable.js diff --git a/public/js/apps/vbform/presets.js b/public/js/apps/vbform/presets.js new file mode 100644 index 000000000..2a1b87987 --- /dev/null +++ b/public/js/apps/vbform/presets.js @@ -0,0 +1,222 @@ +import uuid from '../../helpers/vbform/uuid.js'; + +export default [ + { + type: 'preset', + guioptions: { + id: 'leer', + label: 'Leer', + description: 'keine vordefinierten Vertrags- und Gehaltsbestandteile. Alles kann/muss manuell angelegt werden.' + }, + vbs: [] + }, + { + type: 'preset', + guioptions: { + id: 'neustd', + label: 'Neuanlage Standard DV', + description: 'Standard Dienstvertrag Vorlage' + }, + vbs: [ + { + type: 'vertragsbestandteilstunden', + guioptions: { + id: uuid.get_uuid(), + removable: false + }, + gbs: [ + { + type: 'gehaltsbestandteil', + guioptions: { + id: uuid.get_uuid(), + removable: false + }, + data: { + gehaltstyp: 'basis', + valorisierung: true + } + } + ] + }, + { + type: 'vertragsbestandteilzeitaufzeichnung', + guioptions: { + id: uuid.get_uuid(), + removable: false + }, + data: { + zeitaufzeichnung: true, + azgrelevant: true, + homeoffice: true + } + }, + { + type: 'vertragsbestandteilfunktion', + guioptions: { + id: uuid.get_uuid(), + removable: false + } + } + ] + }, + { + type: 'preset', + guioptions: { + id: 'allin', + label: 'AllIn', + description: 'AllIn Vertrag' + }, + vbs: [ + { + type: 'vertragsbestandteilstunden', + guioptions: { + id: uuid.get_uuid(), + removable: false + }, + gbs: [ + { + type: 'gehaltsbestandteil', + guioptions: { + id: uuid.get_uuid(), + removable: false + }, + data: { + gehaltstyp: 'grund', + valorisierung: true + } + } + ] + }, + { + type: 'vertragsbestandteilzeitaufzeichnung', + guioptions: { + id: uuid.get_uuid(), + removable: false + }, + data: { + zeitaufzeichnung: true, + azgrelevant: false, + homeoffice: true + } + }, + { + type: 'vertragsbestandteilfreitext', + guioptions: { + id: uuid.get_uuid(), + removable: false, + }, + data: { + freitexttyp: 'allin', + titel: 'AllIn Vereinbarung', + freitext: 'Es wird AllIn vereinbart.' + }, + gbs: [ + { + type: 'gehaltsbestandteil', + guioptions: { + id: uuid.get_uuid(), + removable: false + }, + data: { + gehaltstyp: 'zulage', + valorisierung: false + } + } + ] + } + ] + }, + { + "type": "preset", + "guioptions": { + "id": "savedallin", + "label": "Test Zwischenspeichern", + "description": "generiertes JSON aus ausgeflltem Formular als POC für das Zwischenspeichern" + }, + "vbs": [ + { + "type": "vertragsbestandteilstunden", + "guioptions": { + "id": "44c4d3bc-ee1f-4edf-8b2a-82736e09d287", + "removable": false + }, + "data": { + "stunden": "38,5", + "gueltigkeit": { + "gueltig_ab": "01.03.2023", + "gueltig_bis": "" + } + }, + "gbs": [ + { + "type": "gehaltsbestandteil", + "guioptions": { + "id": "cc38c689-5c79-4a82-899a-000fd77ed582", + "removable": false + }, + "data": { + "gehaltstyp": "grund", + "betrag": "3500", + "gueltigkeit": { + "gueltig_ab": "01.03.2023", + "gueltig_bis": "" + }, + "valorisierung": true + } + } + ] + }, + { + "type": "vertragsbestandteilzeitaufzeichnung", + "guioptions": { + "id": "b55a558e-458c-4ea5-bebf-dd9cbe247ca6", + "removable": false + }, + "data": { + "zeitaufzeichnung": true, + "azgrelevant": false, + "homeoffice": true, + "gueltigkeit": { + "gueltig_ab": "01.03.2023", + "gueltig_bis": "" + } + } + }, + { + "type": "vertragsbestandteilfreitext", + "guioptions": { + "id": "6f5756d9-2128-48b8-8954-408f96816b22", + "removable": false + }, + "data": { + "freitexttyp": "allin", + "titel": "AllIn Vereinbarung", + "freitext": "Es wird AllIn vereinbart.", + "kuendigungsrelevant": "", + "gueltigkeit": { + "gueltig_ab": "01.03.2023", + "gueltig_bis": "" + } + }, + "gbs": [ + { + "type": "gehaltsbestandteil", + "guioptions": { + "id": "d0c8946f-1c64-4981-9c15-e09ac5c9ba0a", + "removable": false + }, + "data": { + "gehaltstyp": "zulage", + "betrag": "500", + "gueltigkeit": { + "gueltig_ab": "01.03.2023", + "gueltig_bis": "" + }, + "valorisierung": false + } + } + ] + } + ] + } +] diff --git a/public/js/apps/vbform/vbform.js b/public/js/apps/vbform/vbform.js index 2ca309ba8..992a0db85 100644 --- a/public/js/apps/vbform/vbform.js +++ b/public/js/apps/vbform/vbform.js @@ -1,22 +1,26 @@ -import vertragsbestandteilhelper from '../../components/vbform/vertragsbestandteilhelper.js'; +import presets_chooser from '../../components/vbform/presets_chooser.js'; +import presets from './presets.js'; Vue.createApp({ template: `

{{ title }}

- +
`, data: function() { return { "title": "Vertragsbestandteil Form", + presets: presets }; }, components: { - 'vertragsbestandteilhelper': vertragsbestandteilhelper + 'presets_chooser': presets_chooser }, created: function() { }, methods: { + }, + computed: { } }).mount('#main'); diff --git a/public/js/components/vbform/debug_viewer.js b/public/js/components/vbform/debug_viewer.js new file mode 100644 index 000000000..baf2fa37a --- /dev/null +++ b/public/js/components/vbform/debug_viewer.js @@ -0,0 +1,12 @@ +export default { + template: ` +
+
+{{text}}
+    
+
+ `, + props: [ + "text" + ] +} diff --git a/public/js/components/vbform/gehaltsbestandteil.js b/public/js/components/vbform/gehaltsbestandteil.js index ac4d726c5..125ec6e40 100644 --- a/public/js/components/vbform/gehaltsbestandteil.js +++ b/public/js/components/vbform/gehaltsbestandteil.js @@ -1,9 +1,35 @@ import gueltigkeit from './gueltigkeit.js'; +import configurable from '../../mixins/vbform/configurable.js'; export default { - props: [ - 'id' - ], + template: ` +
+
+ +
+
+
+ + +
+
+
+ + +
+ +
+ +
+
+ `, data: function() { return { gehaltstyp : '', @@ -13,44 +39,44 @@ export default { valorisierung: '' } }, - template: ` -
-
- -
-
- -
- -
- - -
-
- -
-
- `, components: { 'gueltigkeit': gueltigkeit }, + mixins: [ + configurable + ], + created: function() { + this.setDataFromConfig(); + }, methods: { + setDataFromConfig: function() { + if( typeof this.config.data === 'undefined' ) { + return; + } + + if( typeof this.config.data.gehaltstyp !== 'undefined' ) { + this.gehaltstyp = this.config.data.gehaltstyp; + } + if( typeof this.config.data.betrag !== 'undefined' ) { + this.betrag = this.config.data.betrag; + } + if( typeof this.config.data.valorisierung !== 'undefined' ) { + this.valorisierung = this.config.data.valorisierung; + } + }, removeGB: function() { - this.$emit('removeGB', {id: this.id}); + this.$emit('removeGB', {id: this.config.guioptions.id}); }, getPayload: function() { return { - gehaltstyp: this.gehaltstyp, - betrag: this.betrag, - gueltigkeit: this.$refs.gueltigkeit.getPayload(), - valorisierung: this.valorisierung + type: this.config.type, + guioptions: this.config.guioptions, + data: { + gehaltstyp: this.gehaltstyp, + betrag: this.betrag, + gueltigkeit: this.$refs.gueltigkeit.getPayload(), + valorisierung: this.valorisierung + } }; } } diff --git a/public/js/components/vbform/gehaltsbestandteilhelper.js b/public/js/components/vbform/gehaltsbestandteilhelper.js index fc0bf74f4..f1bfdb5d2 100644 --- a/public/js/components/vbform/gehaltsbestandteilhelper.js +++ b/public/js/components/vbform/gehaltsbestandteilhelper.js @@ -1,50 +1,58 @@ -import gehaltsbestandteil from './gehaltsbestandteil.js'; +import gehaltsbestandteil from './gehaltsbestandteil'; +import presetable from '../../mixins/vbform/presetable.js'; +import uuid from '../../helpers/vbform/uuid.js'; export default { template: `
- +
`, data: function() { return { - payload: [], - gbs: [], + payload: [] }; }, components: { 'gehaltsbestandteil': gehaltsbestandteil, }, + mixins: [ + presetable + ], methods: { addGB: function(e) { e.preventDefault(); e.stopPropagation(); - var gbid = 'testgb' + (this.gbs.length + 1); - this.gbs.push({ - id: gbid + this.children.unshift({ + type: 'gehaltsbestandteil', + guioptions: { + id: uuid.get_uuid(), + removeable: true + } }); }, removeGB: function(payload) { - var gbs = this.gbs.filter(function(gb) { - return gb.id !== payload.id; + var children = this.children.filter(function(gb) { + return gb.guioptions.id !== payload.id; }); - this.gbs = gbs; + this.children = children; }, getPayload: function() { - var gbs = this.gbs; + var children = this.children; var that = this; this.payload = []; - gbs.forEach(function(gb) { - that.payload.push(that.$refs[gb.id][0].getPayload()); + children.forEach(function(gb) { + that.payload.push(that.$refs[gb.guioptions.id][0].getPayload()); }); return this.payload; diff --git a/public/js/components/vbform/presets_chooser.js b/public/js/components/vbform/presets_chooser.js new file mode 100644 index 000000000..ef13ca014 --- /dev/null +++ b/public/js/components/vbform/presets_chooser.js @@ -0,0 +1,58 @@ +import vertragsbestandteilhelper from './vertragsbestandteilhelper.js'; +import debug_viewer from './debug_viewer.js'; + +export default { + template: ` +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ `, + props:[ + 'presets' + ], + data: function() { + return { + selectedpresetidx: 0, + selectedpreset: [], + vbhjson: '' + } + }, + components: { + 'vertragsbestandteilhelper': vertragsbestandteilhelper, + 'debug_viewer': debug_viewer + }, + methods: { + selectpreset: function(idx) { + if( typeof this.presets[idx] !== 'undefined' ) { + this.seletedpresetidx = idx; + this.selectedpreset = this.presets[idx].vbs; + } + }, + isactive: function(idx) { + return (idx === this.selectedpresetidx) ? 'active' : ''; + }, + process_json: function(payload) { + this.vbhjson = payload; + } + }, + computed: { + } +} diff --git a/public/js/components/vbform/vertragsbestandteil_freitext.js b/public/js/components/vbform/vertragsbestandteil_freitext.js index 03dc41be6..031c4030b 100644 --- a/public/js/components/vbform/vertragsbestandteil_freitext.js +++ b/public/js/components/vbform/vertragsbestandteil_freitext.js @@ -1,9 +1,46 @@ import gehaltsbestandteilhelper from './gehaltsbestandteilhelper.js'; import gueltigkeit from './gueltigkeit.js'; +import configurable from '../../mixins/vbform/configurable.js'; export default { - props: [ - 'id' + template: ` +
+
+
+ +
+ +
+ +
+
+
+
+ +
+
 
+
+
+
+ +
+
 
+
+ +
+ `, + components: { + 'gehaltsbestandteilhelper': gehaltsbestandteilhelper, + 'gueltigkeit': gueltigkeit + }, + mixins: [ + configurable ], emits: { removeVB: null @@ -16,56 +53,40 @@ export default { kuendigungsrelevant: '' } }, - template: ` -
-
-
- -
-
-
-
- -
- -
-
-
- -
-
-
-
- -
-
-
- -
-
- `, - components: { - 'gehaltsbestandteilhelper': gehaltsbestandteilhelper, - 'gueltigkeit': gueltigkeit + created: function() { + this.setDataFromConfig(); }, methods: { + setDataFromConfig: function() { + if( typeof this.config.data === 'undefined' ) { + return; + } + + if( typeof this.config.data.freitexttyp !== 'undefined' ) { + this.freitexttyp = this.config.data.freitexttyp; + } + if( typeof this.config.data.titel !== 'undefined' ) { + this.titel = this.config.data.titel; + } + if( typeof this.config.data.freitexttyp !== 'undefined' ) { + this.freitext = this.config.data.freitext + } + }, removeVB: function() { - this.$emit('removeVB', {id: this.id}); + this.$emit('removeVB', {id: this.config.guioptions.id}); }, getPayload: function() { return { - freitexttyp: this.freitexttyp, - titel: this.titel, - freitext: this.freitext, - kuendigungsrelevant: this.kuendigungsrelevant, - gueltigkeit: this.$refs.gueltigkeit.getPayload(), - gehaltsbestandteile: this.$refs.gbh.getPayload() + type: 'vertragsbestandteilfreitext', + guioptions: this.config.guioptions, + data: { + freitexttyp: this.freitexttyp, + titel: this.titel, + freitext: this.freitext, + kuendigungsrelevant: this.kuendigungsrelevant, + gueltigkeit: this.$refs.gueltigkeit.getPayload() + }, + gbs: this.$refs.gbh.getPayload() }; } } diff --git a/public/js/components/vbform/vertragsbestandteil_funktion.js b/public/js/components/vbform/vertragsbestandteil_funktion.js index 8c14a6ddf..6f3194eea 100644 --- a/public/js/components/vbform/vertragsbestandteil_funktion.js +++ b/public/js/components/vbform/vertragsbestandteil_funktion.js @@ -1,9 +1,31 @@ import gehaltsbestandteilhelper from './gehaltsbestandteilhelper.js' import gueltigkeit from './gueltigkeit.js'; +import configurable from '../../mixins/vbform/configurable.js'; export default { - props: [ - 'id' + template: ` +
+
+
+ +
+
+ +
+ +
+ +
+
+ +
+ `, + components: { + 'gehaltsbestandteilhelper': gehaltsbestandteilhelper, + 'gueltigkeit': gueltigkeit + }, + mixins: [ + configurable ], emits: { removeVB: null @@ -16,39 +38,32 @@ export default { gueltig_bis: '' } }, - template: ` -
-
-
- -
-
-
-
- -
-
- -
- -
- -
- `, - components: { - 'gehaltsbestandteilhelper': gehaltsbestandteilhelper, - 'gueltigkeit': gueltigkeit + created: function() { + this.setDataFromConfig(); }, methods: { + setDataFromConfig: function() { + if( typeof this.config.data === 'undefined' ) { + return; + } + + if( typeof this.config.data.funktion !== 'undefined' ) { + this.funktion = this.config.data.funktion; + } + }, removeVB: function() { - this.$emit('removeVB', {id: this.id}); + this.$emit('removeVB', {id: this.config.guioptions.id}); }, getPayload: function() { return { - funktion: this.funktion, - orget: this.orget, - gueltigkeit: this.$refs.gueltigkeit.getPayload(), - gehaltsbestandteile: this.$refs.gbh.getPayload() + type: this.config.type, + guioptions: this.config.guioptions, + data: { + funktion: this.funktion, + orget: this.orget, + gueltigkeit: this.$refs.gueltigkeit.getPayload() + }, + gbs: this.$refs.gbh.getPayload() }; } } diff --git a/public/js/components/vbform/vertragsbestandteil_stunden.js b/public/js/components/vbform/vertragsbestandteil_stunden.js index 4cdfafe0d..410a586b5 100644 --- a/public/js/components/vbform/vertragsbestandteil_stunden.js +++ b/public/js/components/vbform/vertragsbestandteil_stunden.js @@ -1,9 +1,32 @@ import gehaltsbestandteilhelper from './gehaltsbestandteilhelper.js'; import gueltigkeit from './gueltigkeit.js'; +import configurable from '../../mixins/vbform/configurable.js'; export default { - props: [ - 'id' + template: ` +
+
+
+
+ + Std/Woche +
+
+
 
+ +
+ +
+
+ +
+ `, + components: { + 'gehaltsbestandteilhelper': gehaltsbestandteilhelper, + 'gueltigkeit': gueltigkeit + }, + mixins: [ + configurable ], emits: { removeVB: null @@ -13,35 +36,31 @@ export default { stunden: '' } }, - "template": ` -
-
-
- -
-
-
-
- -
- -
- -
- `, - components: { - 'gehaltsbestandteilhelper': gehaltsbestandteilhelper, - 'gueltigkeit': gueltigkeit + created: function() { + this.setDataFromConfig(); }, methods: { + setDataFromConfig: function() { + if( typeof this.config.data === 'undefined' ) { + return; + } + + if( typeof this.config.data.stunden !== 'undefined' ) { + this.stunden = this.config.data.stunden; + } + }, removeVB: function() { - this.$emit('removeVB', {id: this.id}); + this.$emit('removeVB', {id: this.config.guioptions.id}); }, getPayload: function() { return { - stunden: this.stunden, - gueltigkeit: this.$refs.gueltigkeit.getPayload(), - gehaltsbestandteile: this.$refs.gbh.getPayload() + type: this.config.type, + guioptions: this.config.guioptions, + data: { + stunden: this.stunden, + gueltigkeit: this.$refs.gueltigkeit.getPayload() + }, + gbs: this.$refs.gbh.getPayload() }; } } diff --git a/public/js/components/vbform/vertragsbestandteil_zeitaufzeichnung.js b/public/js/components/vbform/vertragsbestandteil_zeitaufzeichnung.js index f16555d2d..9a26ca3f8 100644 --- a/public/js/components/vbform/vertragsbestandteil_zeitaufzeichnung.js +++ b/public/js/components/vbform/vertragsbestandteil_zeitaufzeichnung.js @@ -1,28 +1,9 @@ import gueltigkeit from './gueltigkeit.js'; +import configurable from '../../mixins/vbform/configurable.js'; export default { - props: [ - 'id' - ], - emits: { - removeVB: null - }, - data: function () { - return { - zeitaufzeichnung: '', - azgrelevant: '', - homeoffice: '', - gueltig_ab: '', - gueltig_bis: '' - } - }, template: ` -
-
-
- -
-
+
@@ -42,23 +23,64 @@ export default { Home-Office
+
 
+
+ +
`, components: { 'gueltigkeit': gueltigkeit }, + mixins: [ + configurable + ], + emits: { + removeVB: null + }, + data: function () { + return { + zeitaufzeichnung: '', + azgrelevant: '', + homeoffice: '', + gueltig_ab: '', + gueltig_bis: '' + } + }, + created: function() { + this.setDataFromConfig(); + }, methods: { + setDataFromConfig: function() { + if( typeof this.config.data === 'undefined' ) { + return; + } + + if( typeof this.config.data.zeitaufzeichnung !== 'undefined' ) { + this.zeitaufzeichnung = this.config.data.zeitaufzeichnung; + } + if( typeof this.config.data.azgrelevant !== 'undefined' ) { + this.azgrelevant = this.config.data.azgrelevant; + } + if( typeof this.config.data.homeoffice !== 'undefined' ) { + this.homeoffice = this.config.data.homeoffice + } + }, removeVB: function() { - this.$emit('removeVB', {id: this.id}); + this.$emit('removeVB', {id: this.config.guioptions.id}); }, getPayload: function() { return { - zeitaufzeichnung: this.zeitaufzeichnung, - azgrelevant: this.azgrelevant, - homeoffice: this.homeoffice, - gueltigkeit: this.$refs.gueltigkeit.getPayload(), + type: this.config.type, + guioptions: this.config.guioptions, + data: { + zeitaufzeichnung: this.zeitaufzeichnung, + azgrelevant: this.azgrelevant, + homeoffice: this.homeoffice, + gueltigkeit: this.$refs.gueltigkeit.getPayload() + } }; } } diff --git a/public/js/components/vbform/vertragsbestandteilhelper.js b/public/js/components/vbform/vertragsbestandteilhelper.js index 0a3707664..42c0e7e22 100644 --- a/public/js/components/vbform/vertragsbestandteilhelper.js +++ b/public/js/components/vbform/vertragsbestandteilhelper.js @@ -2,15 +2,16 @@ import vertragsbestandteilstunden from './vertragsbestandteil_stunden.js'; import vertragsbestandteilzeitaufzeichnung from './vertragsbestandteil_zeitaufzeichnung.js'; import vertragsbestandteilfunktion from './vertragsbestandteil_funktion.js'; import vertragsbestandteilfreitext from './vertragsbestandteil_freitext.js'; +import presetable from '../../mixins/vbform/presetable.js'; +import uuid from '../../helpers/vbform/uuid.js'; export default { template: ` -
-
-
-
+
+
- +
- +
- - -
-
-
-{{resjson}}
-      
-
-
+ +
`, data: function() { return { - vertragsbestandteiltyp: 'vertragsbestandteil', + vertragsbestandteiltyp: '', payload: { + type: 'formdata', vbs: [] - }, - vbs: [ - { - type: 'vertragsbestandteilstunden', - id: 'test1' - }, - { - type: 'vertragsbestandteilzeitaufzeichnung', - id: 'test2' - } - ], + } }; }, components: { @@ -58,41 +44,51 @@ export default { 'vertragsbestandteilfunktion': vertragsbestandteilfunktion, 'vertragsbestandteilfreitext': vertragsbestandteilfreitext, }, + mixins: [ + presetable + ], + emits: { + vbhjsonready: null + }, methods: { addVB: function(e) { e.preventDefault(); e.stopPropagation(); - var vbid = 'test' + (this.vbs.length + 1); - this.vbs.push({ + if( this.vertragsbestandteiltyp === '') { + return; + } + + this.children.unshift({ type: this.vertragsbestandteiltyp, - id: vbid + guioptions: { + id: uuid.get_uuid(), + removeable: true + } }); }, removeVB: function(payload) { - var vbs = this.vbs.filter(function(vb) { - return vb.id !== payload.id; + var children = this.children.filter(function(vb) { + return vb.guioptions.id !== payload.id; }); - this.vbs = vbs; + this.children = children; }, getJSON: function(e) { e.preventDefault(); e.stopPropagation(); - var vbs = this.vbs; + var children = this.children; var that = this; this.payload = { + type: 'formdata', vbs: [] }; - vbs.forEach(function(vb) { - that.payload.vbs.push(that.$refs[vb.id][0].getPayload()); + children.forEach(function(vb) { + that.payload.vbs.push(that.$refs[vb.guioptions.id][0].getPayload()); }); - } - }, - computed: { - resjson: function() { - return JSON.stringify(this.payload, null, 2); + + this.$emit('vbhjsonready', JSON.stringify(this.payload, null, 2)); } } } diff --git a/public/js/helpers/vbform/uuid.js b/public/js/helpers/vbform/uuid.js new file mode 100644 index 000000000..d8df0c103 --- /dev/null +++ b/public/js/helpers/vbform/uuid.js @@ -0,0 +1,14 @@ +export default { + get_uuid: function() { + var uuidValue = "", k, randomValue; + for (k = 0; k < 32; k++) { + randomValue = Math.random() * 16 | 0; + + if (k == 8 || k == 12 || k == 16 || k == 20) { + uuidValue += "-" + } + uuidValue += (k == 12 ? 4 : (k == 16 ? (randomValue & 3 | 8) : randomValue)).toString(16); + } + return uuidValue; + } +} diff --git a/public/js/mixins/vbform/configurable.js b/public/js/mixins/vbform/configurable.js new file mode 100644 index 000000000..d8885defb --- /dev/null +++ b/public/js/mixins/vbform/configurable.js @@ -0,0 +1,14 @@ +export default { + props: [ + 'config' + ], + computed: { + isremoveable: function() { + return (typeof this.config.guioptions.removeable === 'undefined') + ? false : this.config.guioptions.removeable; + }, + getgehaltsbestandteile: function() { + return (typeof this.config.gbs !== 'undefined') ? this.config.gbs : []; + } + } +} diff --git a/public/js/mixins/vbform/presetable.js b/public/js/mixins/vbform/presetable.js new file mode 100644 index 000000000..01612f09b --- /dev/null +++ b/public/js/mixins/vbform/presetable.js @@ -0,0 +1,21 @@ +export default { + props: [ + 'preset' + ], + data: function() { + return { + children: [] + } + }, + created: function() { + this.children = JSON.parse(JSON.stringify(this.preset)); + }, + watch: { + preset: function() { + this.children = []; + this.$nextTick(function() { + this.children = JSON.parse(JSON.stringify(this.preset)); + }); + } + } +} From 2729b60b394a0b20f11a19b013edd81d497cc44f Mon Sep 17 00:00:00 2001 From: Paolo Date: Mon, 20 Feb 2023 11:31:19 +0100 Subject: [PATCH 015/263] - Added new constants SESSION_ENCRYPTED_COLUMNS and ENCRYPTED_COLUMNS to libraries/TableWidgetLib - Changed libraries/TableWidgetLib->getDataset to accept the new parameter encryptedColumns - Added new private method _encryptedColumns to widgets/TableWidget - widgets/TableWidget now calls tablewidgetlib->getDataset now giving the encryptedColumns parameter - widgets/TableWidget stores in the session the encryptedColumns parameter --- application/libraries/TableWidgetLib.php | 6 ++++-- application/widgets/TableWidget.php | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/application/libraries/TableWidgetLib.php b/application/libraries/TableWidgetLib.php index e8538e84e..9637122a7 100644 --- a/application/libraries/TableWidgetLib.php +++ b/application/libraries/TableWidgetLib.php @@ -33,6 +33,7 @@ class TableWidgetLib const SESSION_FIELDS = 'fields'; const SESSION_COLUMNS_ALIASES = 'columnsAliases'; const SESSION_ADDITIONAL_COLUMNS = 'additionalColumns'; + const SESSION_ENCRYPTED_COLUMNS = 'encryptedColumns'; const SESSION_CHECKBOXES = 'checkboxes'; const SESSION_METADATA = 'datasetMetadata'; const SESSION_ROW_NUMBER = 'rowNumber'; @@ -66,6 +67,7 @@ class TableWidgetLib const ADDITIONAL_COLUMNS = 'additionalColumns'; const CHECKBOXES = 'checkboxes'; const COLUMNS_ALIASES = 'columnsAliases'; + const ENCRYPTED_COLUMNS = 'encryptedColumns'; // ...to format/mark records of a dataset const FORMAT_ROW = 'formatRow'; @@ -194,7 +196,7 @@ class TableWidgetLib /** * Retrieves the dataset from the DB */ - public function getDataset($datasetQuery) + public function getDataset($datasetQuery, $encryptedColumns) { $dataset = null; @@ -203,7 +205,7 @@ class TableWidgetLib $this->_ci->load->model('system/Filters_model', 'FiltersModel'); // Execute the given SQL statement suppressing error messages - $dataset = @$this->_ci->FiltersModel->execReadOnlyQuery($datasetQuery); + $dataset = @$this->_ci->FiltersModel->execReadOnlyQuery($datasetQuery, null, $encryptedColumns); } return $dataset; diff --git a/application/widgets/TableWidget.php b/application/widgets/TableWidget.php index 44dc18bd4..a1a15d508 100644 --- a/application/widgets/TableWidget.php +++ b/application/widgets/TableWidget.php @@ -57,6 +57,8 @@ class TableWidget extends Widget private $_sessionTimeout; // session expiring time + private $_encryptedColumns; // contains info about encrypted columns + private static $_TableWidgetInstance; // static property that contains the instance of itself /** @@ -144,6 +146,7 @@ class TableWidget extends Widget $this->_datasetRepresentationOptions = null; $this->_datasetRepFieldsDefs = null; $this->_sessionTimeout = TableWidgetLib::SESSION_DEFAULT_TIMEOUT; + $this->_encryptedColumns = null; // Retrieved the required permissions parameter if present if (isset($args[TableWidgetLib::REQUIRED_PERMISSIONS])) @@ -223,6 +226,14 @@ class TableWidget extends Widget { $this->_sessionTimeout = $args[TableWidgetLib::SESSION_TIMEOUT]; } + + // Parameter is used to define the ecrypted columns + if (isset($args[TableWidgetLib::ENCRYPTED_COLUMNS]) + && is_array($args[TableWidgetLib::ENCRYPTED_COLUMNS]) + && count($args[TableWidgetLib::ENCRYPTED_COLUMNS]) > 0) + { + $this->_encryptedColumns = $args[TableWidgetLib::ENCRYPTED_COLUMNS]; + } } /** @@ -305,7 +316,7 @@ class TableWidget extends Widget $datasetQuery = $this->tablewidgetlib->generateDatasetQuery($this->_query); // Then retrieve dataset from DB - $dataset = $this->tablewidgetlib->getDataset($datasetQuery); + $dataset = $this->tablewidgetlib->getDataset($datasetQuery, $this->_encryptedColumns); // Save changes into session if data are valid if (!isError($dataset)) @@ -327,7 +338,7 @@ class TableWidget extends Widget $datasetQuery = $this->tablewidgetlib->generateDatasetQuery($this->_query); // Then retrieve dataset from DB - $dataset = $this->tablewidgetlib->getDataset($datasetQuery); + $dataset = $this->tablewidgetlib->getDataset($datasetQuery, $this->_encryptedColumns); // Save changes into session if data are valid if (!isError($dataset)) @@ -341,6 +352,7 @@ class TableWidget extends Widget TableWidgetLib::SESSION_FIELDS => $this->tablewidgetlib->getExecutedQueryListFields(), // all the fields of the dataset TableWidgetLib::SESSION_COLUMNS_ALIASES => $this->_columnsAliases, // all the fields aliases TableWidgetLib::SESSION_ADDITIONAL_COLUMNS => $this->_additionalColumns, // additional columns + TableWidgetLib::SESSION_ENCRYPTED_COLUMNS => $this->_encryptedColumns, // encrypted columns TableWidgetLib::SESSION_CHECKBOXES => $this->_checkboxes, // the name of the field used to build the checkboxes column TableWidgetLib::SESSION_METADATA => $this->tablewidgetlib->getExecutedQueryMetaData(), // the metadata of the dataset TableWidgetLib::SESSION_ROW_NUMBER => count($dataset->retval), // the number of loaded rows by this table From 785b824d6fcbbb4c7794c466731a3682da9b6b4c Mon Sep 17 00:00:00 2001 From: Werner Masik Date: Mon, 20 Feb 2023 16:25:19 +0100 Subject: [PATCH 016/263] add missing extension .js --- public/js/components/vbform/gehaltsbestandteilhelper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/components/vbform/gehaltsbestandteilhelper.js b/public/js/components/vbform/gehaltsbestandteilhelper.js index f1bfdb5d2..9f1b60708 100644 --- a/public/js/components/vbform/gehaltsbestandteilhelper.js +++ b/public/js/components/vbform/gehaltsbestandteilhelper.js @@ -1,4 +1,4 @@ -import gehaltsbestandteil from './gehaltsbestandteil'; +import gehaltsbestandteil from './gehaltsbestandteil.js'; import presetable from '../../mixins/vbform/presetable.js'; import uuid from '../../helpers/vbform/uuid.js'; From 2b9af86955e537d747721cb2901def3411d67179 Mon Sep 17 00:00:00 2001 From: Paolo Date: Tue, 21 Feb 2023 16:11:49 +0100 Subject: [PATCH 017/263] - Added examples to application/config/db_crypt.php - core/DB_Model->_addDecryptLoad fixed when checking the condition if the used operator is made of two characters --- application/config/db_crypt.php | 7 ++++++- application/core/DB_Model.php | 16 +++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/application/config/db_crypt.php b/application/config/db_crypt.php index e3329a158..72f8c30d8 100644 --- a/application/config/db_crypt.php +++ b/application/config/db_crypt.php @@ -20,5 +20,10 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); // NOTE: if database encryption is _not_ used then leave this array empty! -$config['encryption_passwords'] = array(); +$config['encryption_passwords'] = array( + // 'password name 1' => 'password 1' + // 'password name 2' => 'password 2' + // 'password name ...' => 'password ...' + // 'password name N' => 'password N' +); diff --git a/application/core/DB_Model.php b/application/core/DB_Model.php index 69e088ef8..062bc06c2 100644 --- a/application/core/DB_Model.php +++ b/application/core/DB_Model.php @@ -923,7 +923,7 @@ class DB_Model extends CI_Model $value, $encryptionPassword ), - false + false // no escaping ); } else // otherwise copy this element as it is @@ -1035,12 +1035,18 @@ class DB_Model extends CI_Model { $operator = null; // operator not found in the column name - // Custom operators - if (strpos($column, '>') != false - || strpos($column, '<') != false - || strpos($column, '>=') != false + // Custom operators with 2 chars + if (strpos($column, '>=') != false || strpos($column, '<=') != false || strpos($column, '!=') != false + || strpos($column, '<>') != false + ) + { + $operator = ' '.substr(trim($column), -2).' '; + } + // Custom operators with 1 chars + elseif (strpos($column, '>') != false + || strpos($column, '<') != false || strpos($column, '=') != false ) { From 2672ebc61c262e8085f661e330bf9ca2d4110030 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Wed, 22 Feb 2023 09:36:45 +0100 Subject: [PATCH 018/263] sharedstate for gueltigkeit, mode to set gueltigkeits reflect or ignore or set shared gueltigkeit, add vertragsbestandteil kuendigungsfrist --- public/js/apps/vbform/presets.js | 79 ++++++++++-- public/js/components/vbform/dvaenderung.js | 23 ++++ public/js/components/vbform/dvneuanlage.js | 66 +++++++++++ .../components/vbform/gehaltsbestandteil.js | 2 +- public/js/components/vbform/gueltigkeit.js | 112 ++++++++++++++++-- .../js/components/vbform/presets_chooser.js | 8 +- public/js/components/vbform/vbsharedstate.js | 6 + .../vbform/vertragsbestandteil_freitext.js | 2 +- .../vbform/vertragsbestandteil_funktion.js | 6 +- .../vertragsbestandteil_kuendigungsfrist.js | 76 ++++++++++++ .../vbform/vertragsbestandteil_stunden.js | 4 +- .../vertragsbestandteil_zeitaufzeichnung.js | 6 +- .../vbform/vertragsbestandteilhelper.js | 22 ++++ public/js/mixins/vbform/configurable.js | 8 +- 14 files changed, 383 insertions(+), 37 deletions(-) create mode 100644 public/js/components/vbform/dvaenderung.js create mode 100644 public/js/components/vbform/dvneuanlage.js create mode 100644 public/js/components/vbform/vbsharedstate.js create mode 100644 public/js/components/vbform/vertragsbestandteil_kuendigungsfrist.js diff --git a/public/js/apps/vbform/presets.js b/public/js/apps/vbform/presets.js index 2a1b87987..d134cf5b1 100644 --- a/public/js/apps/vbform/presets.js +++ b/public/js/apps/vbform/presets.js @@ -8,6 +8,9 @@ export default [ label: 'Leer', description: 'keine vordefinierten Vertrags- und Gehaltsbestandteile. Alles kann/muss manuell angelegt werden.' }, + data: { + dienstverhaeltnisid: null + }, vbs: [] }, { @@ -17,6 +20,11 @@ export default [ label: 'Neuanlage Standard DV', description: 'Standard Dienstvertrag Vorlage' }, + data: { + dienstverhaeltnisid: null, + unternehmen: 'fhtw', + vertragsart_kurzbz: 'echterDV' + }, vbs: [ { type: 'vertragsbestandteilstunden', @@ -50,6 +58,17 @@ export default [ homeoffice: true } }, + { + type: 'vertragsbestandteilkuendigungsfrist', + guioptions: { + id: uuid.get_uuid(), + removable: false + }, + data: { + arbeitgeber_frist: 6, + arbeitnehmer_frist: 4 + } + }, { type: 'vertragsbestandteilfunktion', guioptions: { @@ -66,6 +85,9 @@ export default [ label: 'AllIn', description: 'AllIn Vertrag' }, + data: { + dienstverhaeltnisid: null + }, vbs: [ { type: 'vertragsbestandteilstunden', @@ -133,6 +155,18 @@ export default [ "label": "Test Zwischenspeichern", "description": "generiertes JSON aus ausgeflltem Formular als POC für das Zwischenspeichern" }, + "data": { + "dienstverhaeltnisid": 135, + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "set" + }, + "data": { + "gueltig_ab": "01.06.2023", + "gueltig_bis": "31.12.2023" + } + } + }, "vbs": [ { "type": "vertragsbestandteilstunden", @@ -143,8 +177,13 @@ export default [ "data": { "stunden": "38,5", "gueltigkeit": { - "gueltig_ab": "01.03.2023", - "gueltig_bis": "" + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "01.03.2023", + "gueltig_bis": "" + } } }, "gbs": [ @@ -158,8 +197,13 @@ export default [ "gehaltstyp": "grund", "betrag": "3500", "gueltigkeit": { - "gueltig_ab": "01.03.2023", - "gueltig_bis": "" + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "01.03.2023", + "gueltig_bis": "" + } }, "valorisierung": true } @@ -177,8 +221,13 @@ export default [ "azgrelevant": false, "homeoffice": true, "gueltigkeit": { - "gueltig_ab": "01.03.2023", - "gueltig_bis": "" + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "01.03.2023", + "gueltig_bis": "" + } } } }, @@ -194,8 +243,13 @@ export default [ "freitext": "Es wird AllIn vereinbart.", "kuendigungsrelevant": "", "gueltigkeit": { - "gueltig_ab": "01.03.2023", - "gueltig_bis": "" + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "01.03.2023", + "gueltig_bis": "" + } } }, "gbs": [ @@ -209,8 +263,13 @@ export default [ "gehaltstyp": "zulage", "betrag": "500", "gueltigkeit": { - "gueltig_ab": "01.03.2023", - "gueltig_bis": "" + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "01.03.2023", + "gueltig_bis": "" + } }, "valorisierung": false } diff --git a/public/js/components/vbform/dvaenderung.js b/public/js/components/vbform/dvaenderung.js new file mode 100644 index 000000000..cfc782077 --- /dev/null +++ b/public/js/components/vbform/dvaenderung.js @@ -0,0 +1,23 @@ +import gueltigkeit from './gueltigkeit.js'; +import configurable from '../../mixins/vbform/configurable.js'; + +export default { + template: ` +
Aenderung
+ +
 
+ `, + components: { + 'gueltigkeit': gueltigkeit + }, + mixins: [ + configurable + ], + methods: { + getPayload: function() { + return { + gueltigkeit: this.$refs.gueltigkeit.getPayload() + } + } + } +} diff --git a/public/js/components/vbform/dvneuanlage.js b/public/js/components/vbform/dvneuanlage.js new file mode 100644 index 000000000..0b3ca2e91 --- /dev/null +++ b/public/js/components/vbform/dvneuanlage.js @@ -0,0 +1,66 @@ +import gueltigkeit from './gueltigkeit.js'; +import configurable from '../../mixins/vbform/configurable.js'; + +export default { + template: ` +
+ +
+
+ +
+
 
+ +
 
+ `, + data: function() { + return { + 'unternehmen': '', + 'vertragsart_kurzbz': '' + } + }, + components: { + 'gueltigkeit': gueltigkeit + }, + mixins: [ + configurable + ], + watch: { + config: function() { + this.setDataFromConfig(); + } + }, + methods: { + setDataFromConfig: function() { + if( this.config?.unternehmen !== undefined ) { + this.unternehmen = this.config.unternehmen; + } else { + this.unternehmen = ''; + } + + if( this.config?.vertragsart_kurzbz !== undefined ) { + this.vertragsart_kurzbz = this.config.vertragsart_kurzbz; + } else { + this.vertragsart_kurzbz = ''; + } + }, + getPayload: function() { + return { + unternehmen: this.unternehmen, + vertragsart_kurzbz: this.vertragsart_kurzbz, + gueltigkeit: this.$refs.gueltigkeit.getPayload() + } + } + } +} diff --git a/public/js/components/vbform/gehaltsbestandteil.js b/public/js/components/vbform/gehaltsbestandteil.js index 125ec6e40..0fe22b1f8 100644 --- a/public/js/components/vbform/gehaltsbestandteil.js +++ b/public/js/components/vbform/gehaltsbestandteil.js @@ -24,7 +24,7 @@ export default { Valorisierung
- +
diff --git a/public/js/components/vbform/gueltigkeit.js b/public/js/components/vbform/gueltigkeit.js index ea40f920f..a4e6c6a51 100644 --- a/public/js/components/vbform/gueltigkeit.js +++ b/public/js/components/vbform/gueltigkeit.js @@ -1,25 +1,117 @@ +import configurable from '../../mixins/vbform/configurable.js'; +import sharedstate from './vbsharedstate.js'; + export default { + template: ` +
+
+ + + + + + + + + + + + +
+
+ `, + props: { + 'initialsharedstatemode': { + type: String, + default: 'reflect', + validator: function(value) { + return ['reflect', 'set', 'ignore'].includes(value); + } + } + }, data: function() { return { + sharedstate: sharedstate, + sharedstatemode: '', gueltig_ab: '', gueltig_bis: '' } }, - template: ` -
- -
-
- -
- `, components: {}, + mixins: [ + configurable + ], + created: function() { + this.sharedstatemode = this.initialsharedstatemode; + this.setDataFromSharedSate(); + this.setGUIOptionsFromConfig(); + this.setDataFromConfig(); + }, + watch: { + 'sharedstate.gueltigkeit.gueltig_ab': function() { + if( this.sharedstatemode === 'reflect' ) { + this.gueltig_ab = this.sharedstate.gueltigkeit.gueltig_ab; + } + }, + 'sharedstate.gueltigkeit.gueltig_bis': function() { + if( this.sharedstatemode === 'reflect' ) { + this.gueltig_bis = this.sharedstate.gueltigkeit.gueltig_bis; + } + }, + }, methods: { + setDataFromConfig: function() { + if( typeof this.config === 'undefined' ) { + return; + } + + if( typeof this.config.data === 'undefined' ) { + return; + } + + if( typeof this.config.data.gueltig_ab !== 'undefined' ) { + this.gueltig_ab = this.config.data.gueltig_ab; + } + if( typeof this.config.gueltig_bis !== 'undefined' ) { + this.gueltig_bis = this.config.data.gueltig_bis; + } + }, + setDataFromSharedSate: function() { + if( this.sharedstatemode === 'reflect' ) { + this.gueltig_ab = this.sharedstate.gueltigkeit.gueltig_ab; + this.gueltig_bis = this.sharedstate.gueltigkeit.gueltig_bis; + } + }, + setGUIOptionsFromConfig: function() { + if( typeof this.config?.guioptions?.sharedstatemode !== 'undefined' ) { + this.sharedstatemode = this.config.guioptions.sharedstatemode; + } + }, getPayload: function() { return { - gueltig_ab: this.gueltig_ab, - gueltig_bis: this.gueltig_bis, + guioptions: { + sharedstatemode: this.sharedstatemode, + }, + data: { + gueltig_ab: this.gueltig_ab, + gueltig_bis: this.gueltig_bis + } }; + }, + gueltigkeitchanged: function() { + if( this.sharedstatemode === 'set' ) { + this.sharedstate.gueltigkeit.gueltig_ab = this.gueltig_ab; + this.sharedstate.gueltigkeit.gueltig_bis = this.gueltig_bis; + } + }, + changesharedstatemode: function(mode) { + this.sharedstatemode = mode; + this.setDataFromSharedSate(); + } + }, + computed: { + isdisabled: function() { + return (this.sharedstatemode === 'reflect'); } } } diff --git a/public/js/components/vbform/presets_chooser.js b/public/js/components/vbform/presets_chooser.js index ef13ca014..d185dca1f 100644 --- a/public/js/components/vbform/presets_chooser.js +++ b/public/js/components/vbform/presets_chooser.js @@ -17,7 +17,7 @@ export default {
- +
@@ -31,7 +31,8 @@ export default { data: function() { return { selectedpresetidx: 0, - selectedpreset: [], + selectedpresetvbs: [], + selectedpresetdata: {}, vbhjson: '' } }, @@ -43,7 +44,8 @@ export default { selectpreset: function(idx) { if( typeof this.presets[idx] !== 'undefined' ) { this.seletedpresetidx = idx; - this.selectedpreset = this.presets[idx].vbs; + this.selectedpresetvbs = this.presets[idx].vbs; + this.selectedpresetdata = this.presets[idx].data; } }, isactive: function(idx) { diff --git a/public/js/components/vbform/vbsharedstate.js b/public/js/components/vbform/vbsharedstate.js new file mode 100644 index 000000000..d55cab423 --- /dev/null +++ b/public/js/components/vbform/vbsharedstate.js @@ -0,0 +1,6 @@ +export default Vue.reactive({ + gueltigkeit: { + gueltig_ab: '', + gueltig_bis: '' + } +}); diff --git a/public/js/components/vbform/vertragsbestandteil_freitext.js b/public/js/components/vbform/vertragsbestandteil_freitext.js index 031c4030b..b775b9989 100644 --- a/public/js/components/vbform/vertragsbestandteil_freitext.js +++ b/public/js/components/vbform/vertragsbestandteil_freitext.js @@ -15,7 +15,7 @@ export default {
- +
diff --git a/public/js/components/vbform/vertragsbestandteil_funktion.js b/public/js/components/vbform/vertragsbestandteil_funktion.js index 6f3194eea..7385b178d 100644 --- a/public/js/components/vbform/vertragsbestandteil_funktion.js +++ b/public/js/components/vbform/vertragsbestandteil_funktion.js @@ -12,7 +12,7 @@ export default {
- +
@@ -33,9 +33,7 @@ export default { data: function () { return { funktion: '', - orget: '', - gueltig_ab: '', - gueltig_bis: '' + orget: '' } }, created: function() { diff --git a/public/js/components/vbform/vertragsbestandteil_kuendigungsfrist.js b/public/js/components/vbform/vertragsbestandteil_kuendigungsfrist.js new file mode 100644 index 000000000..8a898a393 --- /dev/null +++ b/public/js/components/vbform/vertragsbestandteil_kuendigungsfrist.js @@ -0,0 +1,76 @@ +import gehaltsbestandteilhelper from './gehaltsbestandteilhelper.js'; +import gueltigkeit from './gueltigkeit.js'; +import configurable from '../../mixins/vbform/configurable.js'; + +export default { + template: ` +
+
+
+
+ + Wochen +
+
+
+
+ + Wochen +
+
+
 
+ +
+ +
+
+
+ `, + components: { + 'gueltigkeit': gueltigkeit + }, + mixins: [ + configurable + ], + emits: { + removeVB: null + }, + data: function () { + return { + arbeitgeber_frist: '', + arbeitnehmer_frist: '' + } + }, + created: function() { + this.setDataFromConfig(); + }, + methods: { + setDataFromConfig: function() { + if( typeof this.config?.data === 'undefined' ) { + return; + } + + if( typeof this.config.data.arbeitgeber_frist !== 'undefined' ) { + this.arbeitgeber_frist = this.config.data.arbeitgeber_frist; + } + + if( typeof this.config.data.arbeitnehmer_frist !== 'undefined' ) { + this.arbeitnehmer_frist = this.config.data.arbeitnehmer_frist; + } + }, + removeVB: function() { + this.$emit('removeVB', {id: this.config.guioptions.id}); + }, + getPayload: function() { + return { + type: this.config.type, + guioptions: this.config.guioptions, + data: { + arbeitgeber_frist: this.arbeitgeber_frist, + arbeitnehmer_frist: this.arbeitnehmer_frist, + gueltigkeit: this.$refs.gueltigkeit.getPayload(), + } + }; + } + } +} diff --git a/public/js/components/vbform/vertragsbestandteil_stunden.js b/public/js/components/vbform/vertragsbestandteil_stunden.js index 410a586b5..5c81852ef 100644 --- a/public/js/components/vbform/vertragsbestandteil_stunden.js +++ b/public/js/components/vbform/vertragsbestandteil_stunden.js @@ -13,7 +13,7 @@ export default {
 
- +
@@ -58,7 +58,7 @@ export default { guioptions: this.config.guioptions, data: { stunden: this.stunden, - gueltigkeit: this.$refs.gueltigkeit.getPayload() + gueltigkeit: this.$refs.gueltigkeit.getPayload(), }, gbs: this.$refs.gbh.getPayload() }; diff --git a/public/js/components/vbform/vertragsbestandteil_zeitaufzeichnung.js b/public/js/components/vbform/vertragsbestandteil_zeitaufzeichnung.js index 9a26ca3f8..98ed58b64 100644 --- a/public/js/components/vbform/vertragsbestandteil_zeitaufzeichnung.js +++ b/public/js/components/vbform/vertragsbestandteil_zeitaufzeichnung.js @@ -24,7 +24,7 @@ export default {
 
- +
@@ -44,9 +44,7 @@ export default { return { zeitaufzeichnung: '', azgrelevant: '', - homeoffice: '', - gueltig_ab: '', - gueltig_bis: '' + homeoffice: '' } }, created: function() { diff --git a/public/js/components/vbform/vertragsbestandteilhelper.js b/public/js/components/vbform/vertragsbestandteilhelper.js index 42c0e7e22..b4c583ddc 100644 --- a/public/js/components/vbform/vertragsbestandteilhelper.js +++ b/public/js/components/vbform/vertragsbestandteilhelper.js @@ -2,12 +2,20 @@ import vertragsbestandteilstunden from './vertragsbestandteil_stunden.js'; import vertragsbestandteilzeitaufzeichnung from './vertragsbestandteil_zeitaufzeichnung.js'; import vertragsbestandteilfunktion from './vertragsbestandteil_funktion.js'; import vertragsbestandteilfreitext from './vertragsbestandteil_freitext.js'; +import vertragsbestandteilkuendigungsfrist from './vertragsbestandteil_kuendigungsfrist.js'; import presetable from '../../mixins/vbform/presetable.js'; import uuid from '../../helpers/vbform/uuid.js'; +import dvneuanlage from './dvneuanlage.js'; +import dvaenderung from './dvaenderung.js'; +import sharedstate from './vbsharedstate.js'; export default { template: `
+
+ + +
@@ -29,8 +38,12 @@ export default { v-bind:config="config" :key="config.guioptions.id" @removeVB="removeVB">
`, + props: [ + 'data' + ], data: function() { return { + sharedstate: sharedstate, vertragsbestandteiltyp: '', payload: { type: 'formdata', @@ -43,6 +56,9 @@ export default { 'vertragsbestandteilzeitaufzeichnung': vertragsbestandteilzeitaufzeichnung, 'vertragsbestandteilfunktion': vertragsbestandteilfunktion, 'vertragsbestandteilfreitext': vertragsbestandteilfreitext, + 'vertragsbestandteilkuendigungsfrist': vertragsbestandteilkuendigungsfrist, + 'dvneuanlage': dvneuanlage, + 'dvaenderung': dvaenderung }, mixins: [ presetable @@ -82,6 +98,7 @@ export default { this.payload = { type: 'formdata', + data: this.$refs.formheader.getPayload(), vbs: [] }; children.forEach(function(vb) { @@ -89,6 +106,11 @@ export default { }); this.$emit('vbhjsonready', JSON.stringify(this.payload, null, 2)); + }, + }, + computed: { + isaenderung: function() { + return ((typeof this.data.dienstverhaeltnisid !== 'undefined') && parseInt(this.data.dienstverhaeltnisid) > 0); } } } diff --git a/public/js/mixins/vbform/configurable.js b/public/js/mixins/vbform/configurable.js index d8885defb..5918c6521 100644 --- a/public/js/mixins/vbform/configurable.js +++ b/public/js/mixins/vbform/configurable.js @@ -4,11 +4,15 @@ export default { ], computed: { isremoveable: function() { - return (typeof this.config.guioptions.removeable === 'undefined') + return (this.config?.guioptions?.removeable === undefined) ? false : this.config.guioptions.removeable; }, getgehaltsbestandteile: function() { - return (typeof this.config.gbs !== 'undefined') ? this.config.gbs : []; + return (this.config?.gbs !== undefined) ? this.config.gbs : []; + }, + getgueltigkeit: function() { + return (this.config?.data?.gueltigkeit !== undefined) + ? this.config.data.gueltigkeit : {}; } } } From 7ae41ac965fcb13e6c47c83cbfc9024f039c49ef Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Wed, 22 Feb 2023 10:27:39 +0100 Subject: [PATCH 019/263] pass config to gueltigkeit in formheader --- public/js/apps/vbform/presets.js | 4 ++-- public/js/components/vbform/dvaenderung.js | 6 ++++-- public/js/components/vbform/dvneuanlage.js | 3 ++- public/js/mixins/vbform/configurable.js | 9 +++++++-- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/public/js/apps/vbform/presets.js b/public/js/apps/vbform/presets.js index d134cf5b1..1aab6b9c7 100644 --- a/public/js/apps/vbform/presets.js +++ b/public/js/apps/vbform/presets.js @@ -162,8 +162,8 @@ export default [ "sharedstatemode": "set" }, "data": { - "gueltig_ab": "01.06.2023", - "gueltig_bis": "31.12.2023" + "gueltig_ab": "01.03.2023", + "gueltig_bis": "" } } }, diff --git a/public/js/components/vbform/dvaenderung.js b/public/js/components/vbform/dvaenderung.js index cfc782077..180149887 100644 --- a/public/js/components/vbform/dvaenderung.js +++ b/public/js/components/vbform/dvaenderung.js @@ -4,7 +4,7 @@ import configurable from '../../mixins/vbform/configurable.js'; export default { template: `
Aenderung
- +
 
`, components: { @@ -16,8 +16,10 @@ export default { methods: { getPayload: function() { return { + dienstverhaeltnisid: this.config.dienstverhaeltnisid, gueltigkeit: this.$refs.gueltigkeit.getPayload() } - } + }, + } } diff --git a/public/js/components/vbform/dvneuanlage.js b/public/js/components/vbform/dvneuanlage.js index 0b3ca2e91..a309acec0 100644 --- a/public/js/components/vbform/dvneuanlage.js +++ b/public/js/components/vbform/dvneuanlage.js @@ -21,7 +21,7 @@ export default {
 
- +
 
`, data: function() { @@ -57,6 +57,7 @@ export default { }, getPayload: function() { return { + dienstverhaeltnisid: null, unternehmen: this.unternehmen, vertragsart_kurzbz: this.vertragsart_kurzbz, gueltigkeit: this.$refs.gueltigkeit.getPayload() diff --git a/public/js/mixins/vbform/configurable.js b/public/js/mixins/vbform/configurable.js index 5918c6521..228d105c8 100644 --- a/public/js/mixins/vbform/configurable.js +++ b/public/js/mixins/vbform/configurable.js @@ -11,8 +11,13 @@ export default { return (this.config?.gbs !== undefined) ? this.config.gbs : []; }, getgueltigkeit: function() { - return (this.config?.data?.gueltigkeit !== undefined) - ? this.config.data.gueltigkeit : {}; + if( this.config?.gueltigkeit !== undefined ) { + return this.config.gueltigkeit; + } else if ( this.config?.data?.gueltigkeit !== undefined ) { + return this.config.data.gueltigkeit; + } else { + return {}; + } } } } From 220617f14fef284e4535819222187a57468b30f7 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 28 Feb 2023 10:50:40 +0100 Subject: [PATCH 020/263] enhance guioptions to be able to disable selected fields and hide gehaltsbestandteile add link --- public/js/apps/vbform/presets.js | 41 ++++++++++++++++++- .../components/vbform/gehaltsbestandteil.js | 5 ++- .../vbform/gehaltsbestandteilhelper.js | 17 ++++---- .../vbform/vertragsbestandteil_freitext.js | 1 + .../vbform/vertragsbestandteil_funktion.js | 11 +++-- .../vbform/vertragsbestandteilhelper.js | 12 +++--- public/js/mixins/vbform/configurable.js | 26 ++++++++++++ 7 files changed, 93 insertions(+), 20 deletions(-) diff --git a/public/js/apps/vbform/presets.js b/public/js/apps/vbform/presets.js index 1aab6b9c7..323c6c3c3 100644 --- a/public/js/apps/vbform/presets.js +++ b/public/js/apps/vbform/presets.js @@ -73,7 +73,46 @@ export default [ type: 'vertragsbestandteilfunktion', guioptions: { id: uuid.get_uuid(), - removable: false + removable: false, + canhavegehaltsbestandteile: false, + nobottomborder: true, + nobottommargin: true, + disabled: [ + 'funktion' + ] + }, + data: { + funktion: 'Standardkostenstelle' + } + }, + { + type: 'vertragsbestandteilfunktion', + guioptions: { + id: uuid.get_uuid(), + removable: false, + canhavegehaltsbestandteile: false, + nobottomborder: true, + nobottommargin: true, + disabled: [ + 'funktion' + ] + }, + data: { + funktion: 'Diszpl-Zuordnung' + } + }, + { + type: 'vertragsbestandteilfunktion', + guioptions: { + id: uuid.get_uuid(), + removable: false, + canhavegehaltsbestandteile: false, + disabled: [ + 'funktion' + ] + }, + data: { + funktion: 'Fachliche-Zuordnung' } } ] diff --git a/public/js/components/vbform/gehaltsbestandteil.js b/public/js/components/vbform/gehaltsbestandteil.js index 0fe22b1f8..b81f12beb 100644 --- a/public/js/components/vbform/gehaltsbestandteil.js +++ b/public/js/components/vbform/gehaltsbestandteil.js @@ -4,7 +4,10 @@ import configurable from '../../mixins/vbform/configurable.js'; export default { template: `
-
+
+   +
+
diff --git a/public/js/components/vbform/vertragsbestandteil_funktion.js b/public/js/components/vbform/vertragsbestandteil_funktion.js index 7385b178d..3b0020907 100644 --- a/public/js/components/vbform/vertragsbestandteil_funktion.js +++ b/public/js/components/vbform/vertragsbestandteil_funktion.js @@ -4,10 +4,10 @@ import configurable from '../../mixins/vbform/configurable.js'; export default { template: ` -
+
- +
@@ -17,7 +17,7 @@ export default {
- +
`, components: { @@ -52,6 +52,9 @@ export default { removeVB: function() { this.$emit('removeVB', {id: this.config.guioptions.id}); }, + getGehaltsbestandteilePayload: function() { + return (!this.$refs?.gbh === undefined) ? this.$refs.gbh.getPayload() : []; + }, getPayload: function() { return { type: this.config.type, @@ -61,7 +64,7 @@ export default { orget: this.orget, gueltigkeit: this.$refs.gueltigkeit.getPayload() }, - gbs: this.$refs.gbh.getPayload() + gbs: this.getGehaltsbestandteilePayload() }; } } diff --git a/public/js/components/vbform/vertragsbestandteilhelper.js b/public/js/components/vbform/vertragsbestandteilhelper.js index b4c583ddc..f334db02d 100644 --- a/public/js/components/vbform/vertragsbestandteilhelper.js +++ b/public/js/components/vbform/vertragsbestandteilhelper.js @@ -12,10 +12,12 @@ import sharedstate from './vbsharedstate.js'; export default { template: `
-
+
+
+ + +
+
 
`, props:[ @@ -30,31 +20,16 @@ export default { ], data: function() { return { - selectedpresetidx: 0, - selectedpresetvbs: [], - selectedpresetdata: {}, - vbhjson: '' + selectedpresetidx: 1 } }, - components: { - 'vertragsbestandteilhelper': vertragsbestandteilhelper, - 'debug_viewer': debug_viewer - }, + emits: [ + "presetselected" + ], methods: { - selectpreset: function(idx) { - if( typeof this.presets[idx] !== 'undefined' ) { - this.seletedpresetidx = idx; - this.selectedpresetvbs = this.presets[idx].vbs; - this.selectedpresetdata = this.presets[idx].data; - } - }, - isactive: function(idx) { - return (idx === this.selectedpresetidx) ? 'active' : ''; - }, - process_json: function(payload) { - this.vbhjson = payload; + selectpreset: function() { + var preset = this.presets[this.selectedpresetidx]; + this.$emit("presetselected", preset); } - }, - computed: { } } diff --git a/public/js/components/vbform/sections.js b/public/js/components/vbform/sections.js new file mode 100644 index 000000000..60832818e --- /dev/null +++ b/public/js/components/vbform/sections.js @@ -0,0 +1,10 @@ +export default { + props: [ + 'preset' + ], + template: ` +
+
{{label}}
+
+ ` +} diff --git a/public/js/components/vbform/tab.js b/public/js/components/vbform/tab.js new file mode 100644 index 000000000..b3e953cef --- /dev/null +++ b/public/js/components/vbform/tab.js @@ -0,0 +1,51 @@ +import presetable from '../../mixins/vbform/presetable.js'; +import vertragsbestandteillist from '../../components/vbform/vertragsbestandteillist.js'; +import dv from './dv.js'; + +export default { + template: ` +
+ +
+ `, + props: [ + 'activetab' + ], + data: function() { + return { + payload: { + type: 'tab', + guioptions: { + title: '', + id: '' + }, + children: [] + } + }; + }, + components: { + "dv": dv, + "vertragsbestandteillist": vertragsbestandteillist + }, + mixins: [ + presetable + ], + methods: { + getPayload: function() { + var children = []; + for( var i in this.$refs.parts ) { + children.push(this.$refs.parts[i].getPayload()); + } + var payload = { + type: 'tab', + guioptions: JSON.parse(JSON.stringify(this.preset.guioptions)), + children: children + }; + return payload; + } + } +} diff --git a/public/js/components/vbform/tabs.js b/public/js/components/vbform/tabs.js new file mode 100644 index 000000000..f55e10ace --- /dev/null +++ b/public/js/components/vbform/tabs.js @@ -0,0 +1,58 @@ +import presetable from '../../mixins/vbform/presetable.js'; +import tab from './tab.js'; + +export default { + template: ` +
+ + +
+ +
+
+ `, + components: { + "tab": tab + }, + mixins: [ + presetable + ], + created: function() { + if( this.children.length > 0 ) { + this.activetab = this.children[0].guioptions.id; + } + }, + data: function() { + return { + activetab: '' + } + }, + methods: { + getPayload: function() { + var children = []; + for( var i in this.$refs.parts ) { + children.push(this.$refs.parts[i].getPayload()); + } + var payload = { + "type": "tabs", + "guioptions": JSON.parse(JSON.stringify(this.preset.guioptions)), + "children": children + } + return payload; + } + } +} diff --git a/public/js/components/vbform/vbformhelper.js b/public/js/components/vbform/vbformhelper.js new file mode 100644 index 000000000..386dbfcee --- /dev/null +++ b/public/js/components/vbform/vbformhelper.js @@ -0,0 +1,52 @@ +import presetable from '../../mixins/vbform/presetable.js'; +import tabs from './tabs.js'; +import vertragsbestandteillist from './vertragsbestandteillist.js'; +import dv from './dv.js'; +import store from './vbsharedstate.js'; + +export default { + template: ` +
+
+
+
 
+
+ +
+
+
+ +
+ `, + components: { + "tabs": tabs, + "dv": dv, + "vertragsbestandteillist": vertragsbestandteillist + }, + mixins: [ + presetable + ], + data: function() { + return { + store: store + }; + }, + emits: [ + "vbhjsonready" + ], + methods: { + getJSON: function() { + var children = []; + for ( var i in this.$refs.parts) { + children.push(this.$refs.parts[i].getPayload()); + } + var payload = { + "type": "formdata", + "children": children, + "data": this.store.getDVPayload(), + "vbs": this.store.getVBsPayload() + }; + this.$emit('vbhjsonready', JSON.stringify(payload, null, 2)); + } + } +} diff --git a/public/js/components/vbform/vbsharedstate.js b/public/js/components/vbform/vbsharedstate.js index d55cab423..d9912dfef 100644 --- a/public/js/components/vbform/vbsharedstate.js +++ b/public/js/components/vbform/vbsharedstate.js @@ -2,5 +2,32 @@ export default Vue.reactive({ gueltigkeit: { gueltig_ab: '', gueltig_bis: '' + }, + dv: { + + }, + vbs: { + + }, + getDV: function() { + return this.dv; + }, + setDV: function(dv) { + this.dv = JSON.parse(JSON.stringify(dv)); + }, + getDVPayload: function() { + return JSON.parse(JSON.stringify(this.dv)); + }, + addVB: function(uuid, vb) { + this.vbs[uuid] = vb; + }, + removeVB: function(uuid) { + delete this.vbs[uuid]; + }, + getVB: function(uuid) { + return this.vbs[uuid]; + }, + getVBsPayload: function() { + return JSON.parse(JSON.stringify(this.vbs)); } }); diff --git a/public/js/components/vbform/vertragsbestandteil_stunden.js b/public/js/components/vbform/vertragsbestandteil_stunden.js index 5c81852ef..7286ea809 100644 --- a/public/js/components/vbform/vertragsbestandteil_stunden.js +++ b/public/js/components/vbform/vertragsbestandteil_stunden.js @@ -1,10 +1,14 @@ import gehaltsbestandteilhelper from './gehaltsbestandteilhelper.js'; import gueltigkeit from './gueltigkeit.js'; import configurable from '../../mixins/vbform/configurable.js'; +import errors from './errors.js'; +import infos from './infos.js'; export default { template: `
+ +
@@ -23,7 +27,9 @@ export default { `, components: { 'gehaltsbestandteilhelper': gehaltsbestandteilhelper, - 'gueltigkeit': gueltigkeit + 'gueltigkeit': gueltigkeit, + 'infos': infos, + 'errors': errors }, mixins: [ configurable diff --git a/public/js/components/vbform/vertragsbestandteillist.js b/public/js/components/vbform/vertragsbestandteillist.js new file mode 100644 index 000000000..3d2cd952f --- /dev/null +++ b/public/js/components/vbform/vertragsbestandteillist.js @@ -0,0 +1,112 @@ +import vertragsbestandteilstunden from './vertragsbestandteil_stunden.js'; +import vertragsbestandteilzeitaufzeichnung from './vertragsbestandteil_zeitaufzeichnung.js'; +import vertragsbestandteilfunktion from './vertragsbestandteil_funktion.js'; +import vertragsbestandteilfreitext from './vertragsbestandteil_freitext.js'; +import vertragsbestandteilkuendigungsfrist from './vertragsbestandteil_kuendigungsfrist.js'; +import presetable from '../../mixins/vbform/presetable.js'; +import uuid from '../../helpers/vbform/uuid.js'; +import store from './vbsharedstate.js'; + +export default { + template: ` +
+
+
+ +   + {{ title }} +
+
+ +
+ `, + props: [ + 'data' + ], + data: function() { + return { + title: '', + vertragsbestandteiltyp: '', + store: store, + payload: { + type: 'vertragsbestandteillist', + guioptions: { + title: '', + vertragsbestandteiltyp: '', + }, + children: [] + } + }; + }, + components: { + 'vertragsbestandteilstunden': vertragsbestandteilstunden, + 'vertragsbestandteilzeitaufzeichnung': vertragsbestandteilzeitaufzeichnung, + 'vertragsbestandteilfunktion': vertragsbestandteilfunktion, + 'vertragsbestandteilfreitext': vertragsbestandteilfreitext, + 'vertragsbestandteilkuendigungsfrist': vertragsbestandteilkuendigungsfrist + }, + mixins: [ + presetable + ], + created: function() { + this.title = this.preset.guioptions.title; + this.vertragsbestandteiltyp = this.preset.guioptions.vertragsbestandteiltyp + }, + methods: { + addVB: function(e) { + e.preventDefault(); + e.stopPropagation(); + + if( this.vertragsbestandteiltyp === '') { + return; + } + + var vbid = uuid.get_uuid(); + this.store.addVB(vbid, { + type: this.vertragsbestandteiltyp, + guioptions: { + id: vbid, + removeable: true + } + }); + this.children.push(vbid); + }, + removeVB: function(payload) { + this.store.removeVB(payload.id); + var children = this.children.filter(function(vbid) { + return vbid !== payload.id; + }); + this.children = children; + }, + getPayload: function() { + this.payload = { + type: 'vertragsbestandteillist', + guioptions: { + title: this.title, + vertragsbestandteiltyp: this.vertragsbestandteiltyp + }, + children: JSON.parse(JSON.stringify(this.children)) + }; + this.updateVBsInStore(); + return this.payload; + }, + updateVBsInStore: function() { + for( var id in this.$refs.parts) { + var payload = this.$refs.parts[id].getPayload(); + this.store.addVB(this.$refs.parts[id].config.guioptions.id, payload); + } + }, + getChildren: function() { + var vbs = []; + var that = this; + + for( var i in this.children ) { + var uuid = this.children[i]; + vbs.push(that.store.getVB(uuid)); + } + + return vbs; + } + } +} diff --git a/public/js/helpers/vbform/uuid.js b/public/js/helpers/vbform/uuid.js index d8df0c103..8ebc6a882 100644 --- a/public/js/helpers/vbform/uuid.js +++ b/public/js/helpers/vbform/uuid.js @@ -1,4 +1,5 @@ export default { + _uuidsbyname: {}, get_uuid: function() { var uuidValue = "", k, randomValue; for (k = 0; k < 32; k++) { @@ -10,5 +11,11 @@ export default { uuidValue += (k == 12 ? 4 : (k == 16 ? (randomValue & 3 | 8) : randomValue)).toString(16); } return uuidValue; + }, + get_uuidbyname: function(name) { + if( this._uuidsbyname[name] === undefined ) { + this._uuidsbyname[name] = this.get_uuid(); + } + return this._uuidsbyname[name]; } } diff --git a/public/js/mixins/vbform/configurable.js b/public/js/mixins/vbform/configurable.js index 1ba095289..3e69ae90e 100644 --- a/public/js/mixins/vbform/configurable.js +++ b/public/js/mixins/vbform/configurable.js @@ -20,7 +20,8 @@ export default { ? true : this.config.guioptions.canhavegehaltsbestandteile; }, getgehaltsbestandteile: function() { - return (this.config?.gbs !== undefined) ? this.config.gbs : []; + var gbs = (this.config?.gbs !== undefined) ? this.config.gbs : []; + return { children: gbs }; }, getgueltigkeit: function() { if( this.config?.gueltigkeit !== undefined ) { diff --git a/public/js/mixins/vbform/presetable.js b/public/js/mixins/vbform/presetable.js index 01612f09b..cfad85be3 100644 --- a/public/js/mixins/vbform/presetable.js +++ b/public/js/mixins/vbform/presetable.js @@ -8,13 +8,13 @@ export default { } }, created: function() { - this.children = JSON.parse(JSON.stringify(this.preset)); + this.children = JSON.parse(JSON.stringify(this.preset.children)); }, watch: { preset: function() { this.children = []; this.$nextTick(function() { - this.children = JSON.parse(JSON.stringify(this.preset)); + this.children = JSON.parse(JSON.stringify(this.preset.children)); }); } } From c62d89d25c18fe40241044f575feecf2bdaf3802 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Thu, 9 Mar 2023 16:46:15 +0100 Subject: [PATCH 022/263] add default settings for childs, add option to hide fields --- public/js/apps/vbform/presets.js | 19 +++++++++++++- .../vbform/vertragsbestandteil_freitext.js | 13 ++++++---- .../vbform/vertragsbestandteillist.js | 26 ++++++++++++------- public/js/mixins/vbform/configurable.js | 6 +++++ 4 files changed, 49 insertions(+), 15 deletions(-) diff --git a/public/js/apps/vbform/presets.js b/public/js/apps/vbform/presets.js index 00f2ab34f..70f23809f 100644 --- a/public/js/apps/vbform/presets.js +++ b/public/js/apps/vbform/presets.js @@ -102,7 +102,24 @@ export default [ type: 'vertragsbestandteillist', guioptions: { title: 'Befristung', - vertragsbestandteiltyp: 'vertragsbestandteilfreitext' + vertragsbestandteiltyp: 'vertragsbestandteilfreitext', + childdefaults: { + guioptions: { + canhavegehaltsbestandteile: false, + disabled: [ + 'freitexttyp' + ], + hidden: [ + 'titel', + 'freitext' + ] + }, + data: { + freitexttyp: "befristung", + titel: "Befristung", + freitext: "befristeter Dienstvertrag" + } + } }, children: [] } diff --git a/public/js/components/vbform/vertragsbestandteil_freitext.js b/public/js/components/vbform/vertragsbestandteil_freitext.js index cd61b836a..f4742a4ab 100644 --- a/public/js/components/vbform/vertragsbestandteil_freitext.js +++ b/public/js/components/vbform/vertragsbestandteil_freitext.js @@ -7,7 +7,7 @@ export default {
- @@ -21,19 +21,19 @@ export default {
-
+
 
-
+
 
- +
`, components: { @@ -76,6 +76,9 @@ export default { removeVB: function() { this.$emit('removeVB', {id: this.config.guioptions.id}); }, + getGehaltsbestandteilePayload: function() { + return (!this.$refs?.gbh === undefined) ? this.$refs.gbh.getPayload() : []; + }, getPayload: function() { return { type: 'vertragsbestandteilfreitext', @@ -87,7 +90,7 @@ export default { kuendigungsrelevant: this.kuendigungsrelevant, gueltigkeit: this.$refs.gueltigkeit.getPayload() }, - gbs: this.$refs.gbh.getPayload() + gbs: this.getGehaltsbestandteilePayload() }; } } diff --git a/public/js/components/vbform/vertragsbestandteillist.js b/public/js/components/vbform/vertragsbestandteillist.js index 3d2cd952f..b494e861d 100644 --- a/public/js/components/vbform/vertragsbestandteillist.js +++ b/public/js/components/vbform/vertragsbestandteillist.js @@ -14,7 +14,7 @@ export default {
  - {{ title }} + {{ title }}{{ childcount }}
0) ? ' (' + this.children.length + ')' : ''; + } } } diff --git a/public/js/mixins/vbform/configurable.js b/public/js/mixins/vbform/configurable.js index 3e69ae90e..648f61445 100644 --- a/public/js/mixins/vbform/configurable.js +++ b/public/js/mixins/vbform/configurable.js @@ -8,6 +8,12 @@ export default { return false; } return this.config.guioptions.disabled.includes(inputname); + }, + showinput: function(inputname) { + if( this.config?.guioptions?.hidden === undefined ) { + return true; + } + return !this.config.guioptions.hidden.includes(inputname); } }, computed: { From cca82d29614806d9bd365a281fcb0bcd55b815ce Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Fri, 10 Mar 2023 08:21:59 +0100 Subject: [PATCH 023/263] problem with switching presets and problem with vanishing gehaltsbestandteile solved --- public/js/apps/vbform/presets.js | 4 +--- public/js/apps/vbform/vbform.js | 14 +++++++++----- public/js/components/vbform/gehaltsbestandteil.js | 12 ++++-------- public/js/components/vbform/presets_chooser.js | 4 ++++ public/js/components/vbform/vbsharedstate.js | 8 ++++++++ .../vbform/vertragsbestandteil_freitext.js | 2 +- .../vbform/vertragsbestandteil_funktion.js | 2 +- 7 files changed, 28 insertions(+), 18 deletions(-) diff --git a/public/js/apps/vbform/presets.js b/public/js/apps/vbform/presets.js index 70f23809f..3971a4bf9 100644 --- a/public/js/apps/vbform/presets.js +++ b/public/js/apps/vbform/presets.js @@ -59,9 +59,7 @@ export default [ data: { dienstverhaeltnisid: null }, - vbs: { - - } + vbs: {} }, { type: 'preset', diff --git a/public/js/apps/vbform/vbform.js b/public/js/apps/vbform/vbform.js index 2431e10b9..c70e4d06f 100644 --- a/public/js/apps/vbform/vbform.js +++ b/public/js/apps/vbform/vbform.js @@ -62,15 +62,19 @@ Vue.createApp({ 'vbformhelper': vbformhelper }, created: function() { - var vbs = JSON.parse(JSON.stringify(this.preset.vbs)); - for( var key in vbs ) { - this.store.addVB(key, vbs[key]); - } - this.store.setDV(JSON.parse(JSON.stringify(this.preset.data))); + this.presettostore(); }, methods: { presetselected: function(preset) { this.preset = preset; + this.presettostore(); + }, + presettostore: function() { + var vbs = JSON.parse(JSON.stringify(this.preset.vbs)); + for( var key in vbs ) { + this.store.addVB(key, vbs[key]); + } + this.store.setDV(JSON.parse(JSON.stringify(this.preset.data))); }, processJSON: function(payload) { this.vbhjson = payload; diff --git a/public/js/components/vbform/gehaltsbestandteil.js b/public/js/components/vbform/gehaltsbestandteil.js index 6c53501b1..f6833b0ce 100644 --- a/public/js/components/vbform/gehaltsbestandteil.js +++ b/public/js/components/vbform/gehaltsbestandteil.js @@ -62,17 +62,13 @@ export default { }, methods: { setDataFromConfig: function() { - if( typeof this.config.data === 'undefined' ) { - return; - } - - if( typeof this.config.data.gehaltstyp !== 'undefined' ) { + if( typeof this.config?.data?.gehaltstyp !== 'undefined' ) { this.gehaltstyp = this.config.data.gehaltstyp; } - if( typeof this.config.data.betrag !== 'undefined' ) { + if( typeof this.config?.data?.betrag !== 'undefined' ) { this.betrag = this.config.data.betrag; } - if( typeof this.config.data.valorisierung !== 'undefined' ) { + if( typeof this.config?.data?.valorisierung !== 'undefined' ) { this.valorisierung = this.config.data.valorisierung; } }, @@ -82,7 +78,7 @@ export default { getPayload: function() { return { type: this.config.type, - guioptions: this.config.guioptions, + guioptions: JSON.parse(JSON.stringify(this.config.guioptions)), data: { gehaltstyp: this.gehaltstyp, betrag: this.betrag, diff --git a/public/js/components/vbform/presets_chooser.js b/public/js/components/vbform/presets_chooser.js index a77a4b7ac..1d80d7651 100644 --- a/public/js/components/vbform/presets_chooser.js +++ b/public/js/components/vbform/presets_chooser.js @@ -1,3 +1,5 @@ +import store from './vbsharedstate.js'; + export default { template: `
@@ -20,6 +22,7 @@ export default { ], data: function() { return { + store: store, selectedpresetidx: 1 } }, @@ -29,6 +32,7 @@ export default { methods: { selectpreset: function() { var preset = this.presets[this.selectedpresetidx]; + this.store.reset(); this.$emit("presetselected", preset); } } diff --git a/public/js/components/vbform/vbsharedstate.js b/public/js/components/vbform/vbsharedstate.js index d9912dfef..6ca21be26 100644 --- a/public/js/components/vbform/vbsharedstate.js +++ b/public/js/components/vbform/vbsharedstate.js @@ -29,5 +29,13 @@ export default Vue.reactive({ }, getVBsPayload: function() { return JSON.parse(JSON.stringify(this.vbs)); + }, + reset: function() { + this.gueltigkeit = { + gueltig_ab: '', + gueltig_bis: '' + }; + this.dv = {}; + this.vbs = {}; } }); diff --git a/public/js/components/vbform/vertragsbestandteil_freitext.js b/public/js/components/vbform/vertragsbestandteil_freitext.js index f4742a4ab..f13b11337 100644 --- a/public/js/components/vbform/vertragsbestandteil_freitext.js +++ b/public/js/components/vbform/vertragsbestandteil_freitext.js @@ -77,7 +77,7 @@ export default { this.$emit('removeVB', {id: this.config.guioptions.id}); }, getGehaltsbestandteilePayload: function() { - return (!this.$refs?.gbh === undefined) ? this.$refs.gbh.getPayload() : []; + return (this.$refs?.gbh !== undefined) ? this.$refs.gbh.getPayload() : []; }, getPayload: function() { return { diff --git a/public/js/components/vbform/vertragsbestandteil_funktion.js b/public/js/components/vbform/vertragsbestandteil_funktion.js index 3b0020907..75555d42c 100644 --- a/public/js/components/vbform/vertragsbestandteil_funktion.js +++ b/public/js/components/vbform/vertragsbestandteil_funktion.js @@ -53,7 +53,7 @@ export default { this.$emit('removeVB', {id: this.config.guioptions.id}); }, getGehaltsbestandteilePayload: function() { - return (!this.$refs?.gbh === undefined) ? this.$refs.gbh.getPayload() : []; + return (this.$refs?.gbh !== undefined) ? this.$refs.gbh.getPayload() : []; }, getPayload: function() { return { From c85d98f68175957867f5e67f910e620042c69691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Fri, 10 Mar 2023 17:44:15 +0100 Subject: [PATCH 024/263] Neues HR Schema und Vertragstabellen --- system/dbupdate_3.4.php | 23 +- system/dbupdate_3.4/28260_vertraege.php | 414 ++++++++++++++++++++++++ 2 files changed, 436 insertions(+), 1 deletion(-) create mode 100644 system/dbupdate_3.4/28260_vertraege.php diff --git a/system/dbupdate_3.4.php b/system/dbupdate_3.4.php index c33f184a1..c63e55025 100644 --- a/system/dbupdate_3.4.php +++ b/system/dbupdate_3.4.php @@ -31,6 +31,8 @@ require_once('dbupdate_3.4/example2.php'); require_once('dbupdate_3.4/26173_index_webservicelog.php'); require_once('dbupdate_3.4/24682_reihungstest_zugangscode_fuer_login.php'); require_once('dbupdate_3.4/17512_fehlercode_constraints.php'); +require_once('dbupdate_3.4/28260_vertraege.php'); + // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

Pruefe Tabellen und Attribute!

'; @@ -137,6 +139,25 @@ $tabellen=array( "fue.tbl_ressource" => array("ressource_id","student_uid","mitarbeiter_uid","betriebsmittel_id","firma_id","bezeichnung","beschreibung","insertamum","insertvon","updateamum","updatevon"), "fue.tbl_scrumteam" => array("scrumteam_kurzbz","bezeichnung","punkteprosprint","tasksprosprint","gruppe_kurzbz"), "fue.tbl_scrumsprint" => array("scrumsprint_id","scrumteam_kurzbz","sprint_kurzbz","sprintstart","sprintende","insertamum","insertvon","updateamum","updatevon"), + "hr.tbl_sachaufwand" => array("sachaufwand_id","mitarbeiter_uid","sachaufwandtyp_kurzbz","dienstverhaeltnis_id","beginn","ende","anmerkung","insertamum","insertvon","updateamum","updatevon"), + "hr.tbl_sachaufwandtyp" => array("sachaufwandtyp_kurzbz","bezeichnung","sort", "aktiv"), + "hr.tbl_dienstverhaeltnis" => array("dienstverhaeltnis_id","mitarbeiter_uid","vertragsart_kurzbz","oe_kurzbz","von","bis","insertamum","insertvon","updateamum","updatevon"), + "hr.tbl_vertragsart" => array("vertragsart_kurzbz","bezeichnung","anmerkung","dientverhaeltnis","vertragsart_kurzbz_parent","aktiv","sort"), + "hr.tbl_vertragsbestandteil" => array("vertragsbestandteil_id","dienstverhaeltnis_id","vertragsbestandteiltyp_kurzbz","von", "bis","insertamum", "insertvon","updateamum","updatevon"), + "hr.tbl_vertragsbestandteiltyp" => array("vertragsbestandteiltyp_kurzbz","bezeichnung","ueberlappend"), + "hr.tbl_vertragsbestandteil_funktion" => array("vertragsbestandteil_id","benutzerfunktion_id",), + "hr.tbl_vertragsbestandteil_stunden" => array("vertragsbestandteil_id","wochenstunden","teilzeittyp_kurzbz"), + "hr.tbl_vertragsbestandteil_freitext" => array("vertragsbestandteil_id","freitexttyp_kurzbz","titel","anmerkung",), + "hr.tbl_vertragsbestandteil_freitexttyp" => array("freitexttyp_kurzbz","bezeichnung","ueberlappend","kuendigungsrelevant"), + "hr.tbl_vertragsbestandteil_zeitaufzeichnung" => array("vertragsbestandteil_id","zeitaufzeichnung","azgrelevant","homeoffice"), + "hr.tbl_vertragsbestandteil_urlaubsanspruch" => array("vertragsbestandteil_id", "tage"), + "hr.tbl_vertragsbestandteil_kuendigungsfrist" => array("vertragsbestandteil_id", "arbeitgeber_frist", "arbeitnehmer_frist"), + "hr.tbl_vertragsbestandteil_karenz" => array("vertragsbestandteil_id", "karenztyp_kurzbz","geplanter_geburtstermin","tatsaechlicher_geburtstermin"), + "hr.tbl_karenztyp" => array("karenztyp_kurzbz","bezeichnung"), + "hr.tbl_teilzeittyp" => array("teilzeittyp_kurzbz","bezeichnung","aktiv"), + "hr.tbl_gehaltsbestandteil" => array("gehaltsbestandteil_id","dienstverhaeltnis_id","vertragsbestandteil_id","gehaltstyp_kurzbz","von","bis","anmerkung","grundbetrag","betrag_valorisiert","valorisierungssperre","insertamum", "insertvon","updateamum","updatevon","valorisierung","auszahlungen"), + "hr.tbl_gehaltsabrechnung" => array("gehaltsabrechnung_id", "datum","betrag","gehaltsbestandteil_id"), + "hr.tbl_gehaltstyp" => array("gehaltstyp_kurzbz","bezeichnung","valorisierung","sort","aktiv"), "lehre.tbl_abschlussbeurteilung" => array("abschlussbeurteilung_kurzbz","bezeichnung","bezeichnung_english","sort"), "lehre.tbl_abschlusspruefung" => array("abschlusspruefung_id","student_uid","vorsitz","pruefer1","pruefer2","pruefer3","abschlussbeurteilung_kurzbz","akadgrad_id","pruefungstyp_kurzbz","datum","uhrzeit","sponsion","anmerkung","updateamum","updatevon","insertamum","insertvon","ext_id","note","protokoll","endezeit","pruefungsantritt_kurzbz","freigabedatum"), "lehre.tbl_abschlusspruefung_antritt" => array("pruefungsantritt_kurzbz","bezeichnung","bezeichnung_english","sort"), @@ -216,7 +237,7 @@ $tabellen=array( "public.tbl_firmentyp" => array("firmentyp_kurzbz","beschreibung"), "public.tbl_firmatag" => array("firma_id","tag","insertamum","insertvon"), "public.tbl_fotostatus" => array("fotostatus_kurzbz","beschreibung"), - "public.tbl_funktion" => array("funktion_kurzbz","beschreibung","aktiv","fachbereich","semester"), + "public.tbl_funktion" => array("funktion_kurzbz","beschreibung","aktiv","fachbereich","semester", "hrrelevant","vertragsrelevant"), "public.tbl_geschlecht" => array("geschlecht","bezeichnung_mehrsprachig","sort"), "public.tbl_geschaeftsjahr" => array("geschaeftsjahr_kurzbz","start","ende","bezeichnung"), "public.tbl_gruppe" => array("gruppe_kurzbz","studiengang_kz","semester","bezeichnung","beschreibung","sichtbar","lehre","aktiv","sort","mailgrp","generiert","updateamum","updatevon","insertamum","insertvon","ext_id","orgform_kurzbz","gid","content_visible","gesperrt","zutrittssystem","aufnahmegruppe","direktinskription"), diff --git a/system/dbupdate_3.4/28260_vertraege.php b/system/dbupdate_3.4/28260_vertraege.php new file mode 100644 index 000000000..1601694af --- /dev/null +++ b/system/dbupdate_3.4/28260_vertraege.php @@ -0,0 +1,414 @@ +db_query("SELECT * FROM information_schema.tables WHERE table_name='tbl_dienstverhaeltnis' AND table_schema='hr'")) +{ + if ($db->db_num_rows($result) == 0) + { + $qry = " + CREATE SCHEMA hr; + COMMENT ON SCHEMA hr IS E'Personalverwaltung'; + + ALTER SCHEMA hr OWNER TO fhcomplete; + + CREATE TABLE hr.tbl_dienstverhaeltnis + ( + dienstverhaeltnis_id serial NOT NULL, + mitarbeiter_uid character varying(32), + vertragsart_kurzbz varchar(32), + oe_kurzbz character varying(32), + von date, + bis date, + insertamum timestamp, + insertvon varchar(32), + updateamum timestamp, + updatevon varchar(32), + CONSTRAINT tbl_dienstverhaeltnis_pk PRIMARY KEY (dienstverhaeltnis_id) + ); + + CREATE TABLE hr.tbl_vertragsbestandteil + ( + vertragsbestandteil_id serial NOT NULL, + dienstverhaeltnis_id integer, + vertragsbestandteiltyp_kurzbz varchar(32), + von date, + bis date, + insertamum timestamp, + insertvon varchar(32), + updateamum timestamp, + updatevon varchar(32), + CONSTRAINT tbl_vertragsbestandteil_pk PRIMARY KEY (vertragsbestandteil_id) + ); + + CREATE TABLE hr.tbl_gehaltsbestandteil + ( + gehaltsbestandteil_id serial NOT NULL, + dienstverhaeltnis_id integer NOT NULL, + vertragsbestandteil_id integer, + gehaltstyp_kurzbz character varying(32) NOT NULL, + von date, + bis date, + anmerkung text, + grundbetrag bytea, + betrag_valorisiert bytea, + valorisierungssperre date, + insertamum timestamp, + insertvon varchar(32), + updateamum timestamp, + updatevon varchar(32), + valorisierung boolean NOT NULL, + auszahlungen smallint NOT NULL DEFAULT 14, + CONSTRAINT tbl_gehaltsbestandteil_pk PRIMARY KEY (gehaltsbestandteil_id) + ); + + COMMENT ON COLUMN hr.tbl_gehaltsbestandteil.grundbetrag IS E'verschluesselt - Ursprüngliches Gehalt laut Vertrag'; + COMMENT ON COLUMN hr.tbl_gehaltsbestandteil.betrag_valorisiert IS E'verschluesselt - Valorisierter aktueller Betrag'; + COMMENT ON COLUMN hr.tbl_gehaltsbestandteil.auszahlungen IS E'Wie oft im Jahr wird das Gehalt bezahlt. zb 14x oder nur 12x'; + COMMENT ON COLUMN hr.tbl_gehaltsbestandteil.valorisierung IS E'Wird dieser Bestandteil mitvalorisiert'; + COMMENT ON COLUMN hr.tbl_gehaltsbestandteil.valorisierungssperre IS E'Bis zu welchem Datum ist dieser Bestandteil von der Valorisierung ausgenommen'; + + ALTER TABLE hr.tbl_gehaltsbestandteil ADD CONSTRAINT tbl_dienstverhaeltnis_fk FOREIGN KEY (dienstverhaeltnis_id) + REFERENCES hr.tbl_dienstverhaeltnis (dienstverhaeltnis_id) MATCH FULL + ON DELETE RESTRICT ON UPDATE CASCADE; + + ALTER TABLE hr.tbl_vertragsbestandteil ADD CONSTRAINT tbl_dienstverhaeltnis_fk FOREIGN KEY (dienstverhaeltnis_id) + REFERENCES hr.tbl_dienstverhaeltnis (dienstverhaeltnis_id) MATCH FULL + ON DELETE RESTRICT ON UPDATE CASCADE; + + CREATE TABLE hr.tbl_gehaltsabrechnung + ( + gehaltsabrechnung_id serial NOT NULL, + datum date, + betrag bytea, + gehaltsbestandteil_id integer, + CONSTRAINT tbl_gehaltsabrechnung_pk PRIMARY KEY (gehaltsabrechnung_id) + ); + + COMMENT ON COLUMN hr.tbl_gehaltsabrechnung.betrag IS E'verschluesselt'; + + ALTER TABLE hr.tbl_gehaltsabrechnung ADD CONSTRAINT tbl_gehaltsbestandteil_fk FOREIGN KEY (gehaltsbestandteil_id) + REFERENCES hr.tbl_gehaltsbestandteil (gehaltsbestandteil_id) MATCH FULL + ON DELETE RESTRICT ON UPDATE CASCADE; + + ALTER TABLE hr.tbl_dienstverhaeltnis ADD CONSTRAINT tbl_mitarbeiter_fk FOREIGN KEY (mitarbeiter_uid) + REFERENCES public.tbl_mitarbeiter (mitarbeiter_uid) MATCH FULL + ON DELETE RESTRICT ON UPDATE CASCADE; + + CREATE TABLE hr.tbl_gehaltstyp + ( + gehaltstyp_kurzbz character varying(32) NOT NULL, + bezeichnung varchar(256), + valorisierung boolean NOT NULL DEFAULT true, + sort smallint, + aktiv boolean NOT NULL DEFAULT true, + CONSTRAINT gehaltstypen_pk PRIMARY KEY (gehaltstyp_kurzbz) + ); + + COMMENT ON TABLE hr.tbl_gehaltstyp IS E'Key-Table of Salary Types'; + + ALTER TABLE hr.tbl_gehaltsbestandteil ADD CONSTRAINT tbl_gehaltstyp_fk FOREIGN KEY (gehaltstyp_kurzbz) + REFERENCES hr.tbl_gehaltstyp (gehaltstyp_kurzbz) MATCH FULL + ON DELETE RESTRICT ON UPDATE CASCADE; + + CREATE TABLE hr.tbl_vertragsart + ( + vertragsart_kurzbz varchar(32) NOT NULL, + bezeichnung varchar(256), + anmerkung text, + dienstverhaeltnis boolean, + vertragsart_kurzbz_parent character varying(32), + aktiv boolean NOT NULL DEFAULT true, + sort smallint, + CONSTRAINT tbl_vertragsar_pk PRIMARY KEY (vertragsart_kurzbz) + ); + + COMMENT ON TABLE hr.tbl_vertragsart IS E'Key-Table of Contract Types'; + COMMENT ON COLUMN hr.tbl_vertragsart.dienstverhaeltnis IS E'Kann dieser Typ direkt beim Dienstverhaeltnis zugeordnet werden'; + + ALTER TABLE hr.tbl_dienstverhaeltnis ADD CONSTRAINT tbl_vertragsart_fk FOREIGN KEY (vertragsart_kurzbz) + REFERENCES hr.tbl_vertragsart (vertragsart_kurzbz) MATCH FULL + ON DELETE RESTRICT ON UPDATE CASCADE; + + CREATE TABLE hr.tbl_sachaufwand + ( + sachaufwand_id serial NOT NULL, + mitarbeiter_uid character varying(32), + sachaufwandtyp_kurzbz character varying(32), + dienstverhaeltnis_id integer, + beginn date, + ende date, + anmerkung text, + insertamum timestamp, + insertvon character varying(32), + updateamum timestamp, + updatevon character varying(32), + CONSTRAINT tbl_sachaufwand_pk PRIMARY KEY (sachaufwand_id) + ); + + ALTER TABLE hr.tbl_sachaufwand ADD CONSTRAINT tbl_mitarbeiter_fk FOREIGN KEY (mitarbeiter_uid) + REFERENCES public.tbl_mitarbeiter (mitarbeiter_uid) MATCH FULL + ON DELETE RESTRICT ON UPDATE CASCADE; + + CREATE TABLE hr.tbl_sachaufwandtyp + ( + sachaufwandtyp_kurzbz character varying(32) NOT NULL, + bezeichnung character varying(256), + sort smallint, + aktiv boolean NOT NULL DEFAULT true, + CONSTRAINT tbl_sachaufwandtyp_pk PRIMARY KEY (sachaufwandtyp_kurzbz) + ); + + ALTER TABLE hr.tbl_sachaufwand ADD CONSTRAINT tbl_sachaufwandtyp_fk FOREIGN KEY (sachaufwandtyp_kurzbz) + REFERENCES hr.tbl_sachaufwandtyp (sachaufwandtyp_kurzbz) MATCH FULL + ON DELETE RESTRICT ON UPDATE CASCADE; + + ALTER TABLE hr.tbl_sachaufwand ADD CONSTRAINT tbl_dienstverhaeltnis_fk FOREIGN KEY (dienstverhaeltnis_id) + REFERENCES hr.tbl_dienstverhaeltnis (dienstverhaeltnis_id) MATCH FULL + ON DELETE RESTRICT ON UPDATE CASCADE; + + ALTER TABLE public.tbl_funktion ADD COLUMN hrrelevant boolean NOT NULL DEFAULT false; + ALTER TABLE public.tbl_funktion ADD COLUMN vertragsrelevant boolean NOT NULL DEFAULT false; + + ALTER TABLE hr.tbl_gehaltsbestandteil ADD CONSTRAINT tbl_vertragsbestandteil_fk FOREIGN KEY (vertragsbestandteil_id) + REFERENCES hr.tbl_vertragsbestandteil (vertragsbestandteil_id) MATCH FULL + ON DELETE RESTRICT ON UPDATE CASCADE; + + CREATE TABLE hr.tbl_vertragsbestandteiltyp + ( + vertragsbestandteiltyp_kurzbz varchar(32) NOT NULL, + bezeichnung varchar(256), + ueberlappend boolean NOT NULL, + CONSTRAINT tbl_vertragsbestandteiltyp_pk PRIMARY KEY (vertragsbestandteiltyp_kurzbz) + ); + + COMMENT ON TABLE hr.tbl_vertragsbestandteiltyp IS E'Type of Contract-Part'; + COMMENT ON COLUMN hr.tbl_vertragsbestandteiltyp.ueberlappend IS E'Dürfen sich Einträge von diesem Typ zeitlich überlappen'; + + ALTER TABLE hr.tbl_vertragsbestandteil ADD CONSTRAINT tbl_vertragsbestandteiltyp_fk FOREIGN KEY (vertragsbestandteiltyp_kurzbz) + REFERENCES hr.tbl_vertragsbestandteiltyp (vertragsbestandteiltyp_kurzbz) MATCH FULL + ON DELETE RESTRICT ON UPDATE CASCADE; + + CREATE TABLE hr.tbl_vertragsbestandteil_funktion + ( + vertragsbestandteil_id integer NOT NULL, + benutzerfunktion_id integer, + CONSTRAINT tbl_vertragsbestandteil_funktion_pk PRIMARY KEY (vertragsbestandteil_id) + ); + + ALTER TABLE hr.tbl_vertragsbestandteil_funktion ADD CONSTRAINT tbl_benutzerfunktion_fk FOREIGN KEY (benutzerfunktion_id) + REFERENCES public.tbl_benutzerfunktion (benutzerfunktion_id) MATCH FULL + ON DELETE RESTRICT ON UPDATE CASCADE; + + CREATE TABLE hr.tbl_vertragsbestandteil_stunden + ( + vertragsbestandteil_id integer NOT NULL, + wochenstunden smallint, + teilzeittyp_kurzbz character varying(32), + CONSTRAINT tbl_vertragsbestandteil_stunden_pk PRIMARY KEY (vertragsbestandteil_id) + ); + + COMMENT ON COLUMN hr.tbl_vertragsbestandteil_stunden.teilzeittyp_kurzbz IS E'Altersteilzeit, Elternteilzeit'; + + CREATE TABLE hr.tbl_teilzeittyp + ( + teilzeittyp_kurzbz character varying(32) NOT NULL, + bezeichnung varchar(256) NOT NULL, + aktiv boolean NOT NULL DEFAULT true, + CONSTRAINT tbl_teilzeittyp_pk PRIMARY KEY (teilzeittyp_kurzbz) + ); + + ALTER TABLE hr.tbl_vertragsbestandteil_stunden ADD CONSTRAINT tbl_teilzeittyp_fk FOREIGN KEY (teilzeittyp_kurzbz) + REFERENCES hr.tbl_teilzeittyp (teilzeittyp_kurzbz) MATCH FULL + ON DELETE RESTRICT ON UPDATE CASCADE; + + CREATE TABLE hr.tbl_vertragsbestandteil_freitext + ( + vertragsbestandteil_id integer NOT NULL, + freitexttyp_kurzbz varchar(32), + titel varchar(256), + anmerkung text, + CONSTRAINT tbl_vertragsbestandteil_freitext_pk PRIMARY KEY (vertragsbestandteil_id) + ); + + CREATE TABLE hr.tbl_vertragsbestandteil_freitexttyp + ( + freitexttyp_kurzbz varchar(32) NOT NULL, + bezeichnung varchar(128), + ueberlappend boolean NOT NULL DEFAULT true, + kuendigungsrelevant boolean NOT NULL DEFAULT false, + CONSTRAINT tbl_freitexttyp_pk PRIMARY KEY (freitexttyp_kurzbz) + ); + COMMENT ON TABLE hr.tbl_vertragsbestandteil_freitexttyp IS E'Key-Table FreeTextType (Sideletter, Ersatzarbeitskraft, AllIn, Befristung, Überstundenpauschale)'; + COMMENT ON COLUMN hr.tbl_vertragsbestandteil_freitexttyp.ueberlappend IS E'Dürfen sich Einträge von diesem Typ zeitlich überlappen'; + COMMENT ON COLUMN hr.tbl_vertragsbestandteil_freitexttyp.kuendigungsrelevant IS E'Ist dieser Freitext bei einer Kündigung zu berücksichtigen'; + + ALTER TABLE hr.tbl_vertragsbestandteil_freitext ADD CONSTRAINT tbl_vertragsbestandteil_freitexttyp_fk FOREIGN KEY (freitexttyp_kurzbz) + REFERENCES hr.tbl_vertragsbestandteil_freitexttyp (freitexttyp_kurzbz) MATCH FULL + ON DELETE RESTRICT ON UPDATE CASCADE; + + ALTER TABLE hr.tbl_vertragsbestandteil_freitext ADD CONSTRAINT tbl_vertragsbestandteil_fk FOREIGN KEY (vertragsbestandteil_id) + REFERENCES hr.tbl_vertragsbestandteil (vertragsbestandteil_id) MATCH FULL + ON DELETE RESTRICT ON UPDATE CASCADE; + + ALTER TABLE hr.tbl_vertragsbestandteil_stunden ADD CONSTRAINT tbl_vertragsbestandteil_fk FOREIGN KEY (vertragsbestandteil_id) + REFERENCES hr.tbl_vertragsbestandteil (vertragsbestandteil_id) MATCH FULL + ON DELETE RESTRICT ON UPDATE CASCADE; + + ALTER TABLE hr.tbl_vertragsbestandteil_funktion ADD CONSTRAINT tbl_vertragsbestandteil_fk FOREIGN KEY (vertragsbestandteil_id) + REFERENCES hr.tbl_vertragsbestandteil (vertragsbestandteil_id) MATCH FULL + ON DELETE RESTRICT ON UPDATE CASCADE; + + CREATE TABLE hr.tbl_vertragsbestandteil_zeitaufzeichnung + ( + vertragsbestandteil_id integer NOT NULL, + zeitaufzeichnung bool, + azgrelevant bool, + homeoffice bool, + CONSTRAINT tbl_vertragsbestandteil_zeitaufzeichnung_pk PRIMARY KEY (vertragsbestandteil_id) + ); + + CREATE TABLE hr.tbl_vertragsbestandteil_urlaubsanspruch + ( + vertragsbestandteil_id integer NOT NULL, + tage smallint, + CONSTRAINT tbl_vertragsbestandteil_urlaubsanspruch_pk PRIMARY KEY (vertragsbestandteil_id) + ); + + CREATE TABLE hr.tbl_vertragsbestandteil_kuendigungsfrist + ( + vertragsbestandteil_id integer NOT NULL, + arbeitgeber_frist smallint, + arbeitnehmer_frist smallint, + CONSTRAINT tbl_vertragsbestandteil_kuendigungsfrist_pk PRIMARY KEY (vertragsbestandteil_id) + ); + + ALTER TABLE hr.tbl_vertragsbestandteil_zeitaufzeichnung ADD CONSTRAINT tbl_vertragsbestandteil_fk FOREIGN KEY (vertragsbestandteil_id) + REFERENCES hr.tbl_vertragsbestandteil (vertragsbestandteil_id) MATCH FULL + ON DELETE RESTRICT ON UPDATE CASCADE; + + ALTER TABLE hr.tbl_vertragsbestandteil_urlaubsanspruch ADD CONSTRAINT tbl_vertragsbestandteil_fk FOREIGN KEY (vertragsbestandteil_id) + REFERENCES hr.tbl_vertragsbestandteil (vertragsbestandteil_id) MATCH FULL + ON DELETE RESTRICT ON UPDATE CASCADE; + + ALTER TABLE hr.tbl_vertragsbestandteil_kuendigungsfrist ADD CONSTRAINT tbl_vertragsbestandteil_fk FOREIGN KEY (vertragsbestandteil_id) + REFERENCES hr.tbl_vertragsbestandteil (vertragsbestandteil_id) MATCH FULL + ON DELETE RESTRICT ON UPDATE CASCADE; + + CREATE TABLE hr.tbl_vertragsbestandteil_karenz + ( + vertragsbestandteil_id integer NOT NULL, + karenztyp_kurzbz varchar(32), + geplanter_geburtstermin date, + tatsaechlicher_geburtstermin date, + CONSTRAINT tbl_vertragsbestandteil_karenz_pk PRIMARY KEY (vertragsbestandteil_id) + ); + + ALTER TABLE hr.tbl_vertragsbestandteil_karenz ADD CONSTRAINT tbl_vertragsbestandteil_fk FOREIGN KEY (vertragsbestandteil_id) + REFERENCES hr.tbl_vertragsbestandteil (vertragsbestandteil_id) MATCH FULL + ON DELETE RESTRICT ON UPDATE CASCADE; + + CREATE TABLE hr.tbl_karenztyp + ( + karenztyp_kurzbz varchar(32) NOT NULL, + bezeichnung character varying(256) NOT NULL, + CONSTRAINT tbl_karenztyp_pk PRIMARY KEY (karenztyp_kurzbz) + ); + COMMENT ON TABLE hr.tbl_karenztyp IS E'Key-Table Elternkarenz, Bildungskarenz, Papamonat'; + + ALTER TABLE hr.tbl_vertragsbestandteil_karenz ADD CONSTRAINT tbl_karenztyp_fk FOREIGN KEY (karenztyp_kurzbz) + REFERENCES hr.tbl_karenztyp (karenztyp_kurzbz) MATCH FULL + ON DELETE RESTRICT ON UPDATE CASCADE; + + ALTER TABLE hr.tbl_dienstverhaeltnis ADD CONSTRAINT tbl_organisationseinheit_fk FOREIGN KEY (oe_kurzbz) + REFERENCES public.tbl_organisationseinheit (oe_kurzbz) MATCH FULL + ON DELETE RESTRICT ON UPDATE CASCADE; + + ALTER TABLE hr.tbl_vertragsart ADD CONSTRAINT fk_vertragsart_vertragsartparent FOREIGN KEY (vertragsart_kurzbz_parent) + REFERENCES hr.tbl_vertragsart (vertragsart_kurzbz) MATCH SIMPLE + ON DELETE NO ACTION ON UPDATE NO ACTION; + + GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_sachaufwand TO vilesci; + GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_sachaufwandtyp TO vilesci; + + GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_dienstverhaeltnis TO vilesci; + GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_vertragsart TO vilesci; + GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_vertragsbestandteil TO vilesci; + GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_vertragsbestandteiltyp TO vilesci; + GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_vertragsbestandteil_funktion TO vilesci; + GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_vertragsbestandteil_stunden TO vilesci; + GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_vertragsbestandteil_freitext TO vilesci; + GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_vertragsbestandteil_freitexttyp TO vilesci; + GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_vertragsbestandteil_zeitaufzeichnung TO vilesci; + GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_vertragsbestandteil_urlaubsanspruch TO vilesci; + GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_vertragsbestandteil_kuendigungsfrist TO vilesci; + GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_vertragsbestandteil_karenz TO vilesci; + GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_karenztyp TO vilesci; + GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_teilzeittyp TO vilesci; + + GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_gehaltsbestandteil TO vilesci; + GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_gehaltsabrechnung TO vilesci; + GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_gehaltstyp TO vilesci; + + GRANT USAGE ON SCHEMA hr TO vilesci; + + INSERT INTO hr.tbl_karenztyp(karenztyp_kurzbz, bezeichnung) VALUES('elternkarenz','Elternkarenz'); + INSERT INTO hr.tbl_karenztyp(karenztyp_kurzbz, bezeichnung) VALUES('bildungskarenz','Bildungskarenz'); + INSERT INTO hr.tbl_karenztyp(karenztyp_kurzbz, bezeichnung) VALUES('papamonat','Papamonat'); + + INSERT INTO hr.tbl_teilzeittyp(teilzeittyp_kurzbz, bezeichnung) VALUES('altersteilzeit','Altersteilzeit'); + INSERT INTO hr.tbl_teilzeittyp(teilzeittyp_kurzbz, bezeichnung) VALUES('elternteilzeit','Elternteilzeit'); + + INSERT INTO hr.tbl_vertragsart(vertragsart_kurzbz, bezeichnung, anmerkung, dientverhaeltnis, vertragsart_kurzbz_parent, aktiv, sort) VALUES('echterdv','Echter DV','Echter Dienstvertrag', true, null, true, 100); + INSERT INTO hr.tbl_vertragsart(vertragsart_kurzbz, bezeichnung, anmerkung, dientverhaeltnis, vertragsart_kurzbz_parent, aktiv, sort) VALUES('studentischehilfskr','Studentische Hilfskraft','Studentische Hilfskraft', true, 'echterdv', true, 101); + + INSERT INTO hr.tbl_vertragsart(vertragsart_kurzbz, bezeichnung, anmerkung, dientverhaeltnis, vertragsart_kurzbz_parent, aktiv, sort) VALUES('freierdv','Freier DV','Freier Dienstvertrag', false, null, true, 200); + INSERT INTO hr.tbl_vertragsart(vertragsart_kurzbz, bezeichnung, anmerkung, dientverhaeltnis, vertragsart_kurzbz_parent, aktiv, sort) VALUES('externerlehrender','externer Lehrender','Externer Lehrender Freier DV', true, 'freierdv', true, 201); + INSERT INTO hr.tbl_vertragsart(vertragsart_kurzbz, bezeichnung, anmerkung, dientverhaeltnis, vertragsart_kurzbz_parent, aktiv, sort) VALUES('gastlektor','Gastlektor','Gastlektor', true, 'freierdv', true, 202); + INSERT INTO hr.tbl_vertragsart(vertragsart_kurzbz, bezeichnung, anmerkung, dientverhaeltnis, vertragsart_kurzbz_parent, aktiv, sort) VALUES('echterfreier','Echter Freier DV','Echter Freier DV', true, 'freierdv', true, 203); + + INSERT INTO hr.tbl_vertragsart(vertragsart_kurzbz, bezeichnung, anmerkung, dientverhaeltnis, vertragsart_kurzbz_parent, aktiv, sort) VALUES('werkvertrag','Werkvertrag','Werkvertrag', true, null, true, 300); + INSERT INTO hr.tbl_vertragsart(vertragsart_kurzbz, bezeichnung, anmerkung, dientverhaeltnis, vertragsart_kurzbz_parent, aktiv, sort) VALUES('ueberlassungsvertrag','Überlassungsvertrag','Überlassungsvertrag', true, 'werkvertrag', true, 300); + + INSERT INTO hr.tbl_gehaltstyp(gehaltstyp_kurzbz, bezeichnung, valorisierung, sort, aktiv) VALUES('basisgehalt','Basisgehalt', true, 1, true); + INSERT INTO hr.tbl_gehaltstyp(gehaltstyp_kurzbz, bezeichnung, valorisierung, sort, aktiv) VALUES('grundgehalt','Grundgehalt', true, 2, true); + INSERT INTO hr.tbl_gehaltstyp(gehaltstyp_kurzbz, bezeichnung, valorisierung, sort, aktiv) VALUES('zulage','Zulage', true, 3, true); + INSERT INTO hr.tbl_gehaltstyp(gehaltstyp_kurzbz, bezeichnung, valorisierung, sort, aktiv) VALUES('praemie','Prämie', false, 4, true); + + INSERT INTO hr.tbl_vertragsbestandteil_freitexttyp(freitexttyp_kurzbz, bezeichnung, ueberlappend, kuendigungsrelevant) VALUES('allin','All-In', false, false); + INSERT INTO hr.tbl_vertragsbestandteil_freitexttyp(freitexttyp_kurzbz, bezeichnung, ueberlappend, kuendigungsrelevant) VALUES('ersatzarbeitskraft','Ersatzarbeitskraft', false, true); + INSERT INTO hr.tbl_vertragsbestandteil_freitexttyp(freitexttyp_kurzbz, bezeichnung, ueberlappend, kuendigungsrelevant) VALUES('zusatzvereinbarung','Zusatzvereinbarung', true, false); + INSERT INTO hr.tbl_vertragsbestandteil_freitexttyp(freitexttyp_kurzbz, bezeichnung, ueberlappend, kuendigungsrelevant) VALUES('befristung','Befristung', false, true); + INSERT INTO hr.tbl_vertragsbestandteil_freitexttyp(freitexttyp_kurzbz, bezeichnung, ueberlappend, kuendigungsrelevant) VALUES('sonstiges','Sonstiges', true, false); + + INSERT INTO hr.tbl_vertragsbestandteiltyp(vertragsbestandteiltyp_kurzbz, bezeichnung, ueberlappend) VALUES('stunden', 'Stunden', false); + INSERT INTO hr.tbl_vertragsbestandteiltyp(vertragsbestandteiltyp_kurzbz, bezeichnung, ueberlappend) VALUES('funktion', 'Funktion', true); + INSERT INTO hr.tbl_vertragsbestandteiltyp(vertragsbestandteiltyp_kurzbz, bezeichnung, ueberlappend) VALUES('freitext', 'Freitext', true); + INSERT INTO hr.tbl_vertragsbestandteiltyp(vertragsbestandteiltyp_kurzbz, bezeichnung, ueberlappend) VALUES('zeitaufzeichnung', 'Zeitaufzeichnung', false); + INSERT INTO hr.tbl_vertragsbestandteiltyp(vertragsbestandteiltyp_kurzbz, bezeichnung, ueberlappend) VALUES('urlaubsanspruch', 'Urlaubsanspruch', false); + INSERT INTO hr.tbl_vertragsbestandteiltyp(vertragsbestandteiltyp_kurzbz, bezeichnung, ueberlappend) VALUES('kuendigungsfrist', 'Kündigungsfrist', false); + INSERT INTO hr.tbl_vertragsbestandteiltyp(vertragsbestandteiltyp_kurzbz, bezeichnung, ueberlappend) VALUES('karenz', 'Karenz', false); + + INSERT INTO hr.tbl_sachaufwandtyp(sachaufwandtyp_kurzbz, bezeichnung, sort, aktiv) VALUES('jobticket', 'Jobticket', 1, true); + INSERT INTO hr.tbl_sachaufwandtyp(sachaufwandtyp_kurzbz, bezeichnung, sort, aktiv) VALUES('klimaticket', 'Klimaticket', 1, true); + INSERT INTO hr.tbl_sachaufwandtyp(sachaufwandtyp_kurzbz, bezeichnung, sort, aktiv) VALUES('pendlerpauschale', 'Pendlerpauschale', 1, true); + + CREATE INDEX idx_tbl_dienstverhaeltnis_mitarbeiter_uid ON hr.tbl_dienstverhaeltnis USING btree (mitarbeiter_uid); + CREATE INDEX idx_tbl_vertragsbestandteil_dienstverhaeltnis_id ON hr.tbl_vertragsbestandteil USING btree (dienstverhaeltnis_id); + CREATE INDEX idx_tbl_gehaltsabrechnung_gehaltsbestandteil_id ON hr.tbl_gehaltsabrechnung USING btree (gehaltsbestandteil_id); + CREATE INDEX idx_tbl_gehaltsbestandteil_dienstverhaeltnis_id ON hr.tbl_gehaltsbestandteil USING btree (dienstverhaeltnis_id); + + COMMENT ON TABLE hr.tbl_dienstverhaeltnis IS E'Dienstverhaeltnisse von Mitarbeitern'; + COMMENT ON TABLE hr.tbl_gehaltsabrechnung IS E'Historie monatlich abgerechneter Gehaelter'; + COMMENT ON TABLE hr.tbl_gehaltsbestandteil IS E'Gehaltskomponenten zu Vertraegen'; + COMMENT ON TABLE hr.tbl_sachaufwand IS E'Zusatzvergütungen für Mitarbeiter'; + COMMENT ON TABLE hr.tbl_sachaufwandtyp IS E'Key-Table for Sachaufwand'; + COMMENT ON TABLE hr.tbl_teilzeittyp IS E'Key-Table Altersteilzeit, Elternteilzeit'; + "; + + if (! $db->db_query($qry)) + echo 'Vertraege: ' . $db->db_last_error() . '
'; + else + echo 'HR Schema und Vertagstabellen wurden neu erstellt'; + } +} From a413064d80e911c47776c47e72d34af11dbc627f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Tue, 14 Mar 2023 11:46:07 +0100 Subject: [PATCH 025/263] =?UTF-8?q?Erstversion=20f=C3=BCr=20Vertragsmigrat?= =?UTF-8?q?ion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/system/MigrateContract.php | 413 ++++++++++++++++++ 1 file changed, 413 insertions(+) create mode 100644 application/controllers/system/MigrateContract.php diff --git a/application/controllers/system/MigrateContract.php b/application/controllers/system/MigrateContract.php new file mode 100644 index 000000000..cefc080d6 --- /dev/null +++ b/application/controllers/system/MigrateContract.php @@ -0,0 +1,413 @@ +load->model('codex/bisverwendung_model', 'BisVerwendungModel'); + $this->load->model('person/benutzerfunktion_model', 'BenutzerfunktionModel'); + + $this->matching_ba1_vertragsart = array( + '101'=>'DV zum Bund', + '102'=>'DV anderen Gebietskörperschaft', + '103'=>'EchterDV', + '104'=>'Lehr- oder Ausbildungsverhältnis', + '105'=>'ext. LehrendeR (freier DV)', + '106'=>'Andere Bildungseinrichtung', + '107'=>'Werkvertrag (Sonstiges)', + '108'=>'Stud. Hilfskraft (Echter DV)', + '109'=>'Überlassungsvertrag', + '110'=>'Echter Freier DV', + '111'=>'EchterDV', //All-In + ); + } + + // ----------------------------------------------------------------------------------------------------------------- + // Public methods + + /** + * Everything has a beginning + */ + public function index($user = null) + { + $contracts = $this->_transformUser($user); + + /* + Format: + $contracts['dv'][]['vbs'][] + */ + //$this->outputJson($contracts); + var_dump($contracts); + } + + /** + * Ermittelt die neue Vertragsstruktur fuer einen User + */ + private function _transformUser($user) + { + $contracts = array(); + $this->BisVerwendungModel->addOrder('beginn'); + $result_verwendung = $this->BisVerwendungModel->loadWhere(array("mitarbeiter_uid" => $user)); + + if (isError($result_verwendung)) + die("Failed to load Verwendung"); + + if (hasData($result_verwendung)) + { + $verwendung = getData($result_verwendung); + + foreach ($verwendung as $row_verwendung) + { + $dv = $this->_getOrCreateDV($contracts, $row_verwendung); + + // Ende des DV aktualisieren + if ($contracts['dv'][$dv]['bis'] < $row_verwendung->ende || $row_verwendung->ende == '') + $contracts['dv'][$dv]['bis'] = $row_verwendung->ende; + + // Stundenbestandteil pruefen + $this->_addVertragsbestandteilStunden($contracts, $dv, $row_verwendung); + + // Befristung + $this->_addVertragsbestandteilFreitextBefristung($contracts, $dv, $row_verwendung); + + // All-In + $this->_addVertragsbestandteilFreitextAllIn($contracts, $dv, $row_verwendung); + + // Zeitaufzeichnung + $this->_addVertragsbestandteilZeitaufzeichnung($contracts, $dv, $row_verwendung); + + // Karenz + $this->_addVertragsbestandteilKarenz($contracts, $dv, $row_verwendung); + + // Inkludierte Lehre + // Kuendigungsfrist + // Urlaubsanspruch + } + + // Funktion + $this->_addVertragsbestandteilFunktion($contracts, $user); + + } + + return $contracts; + } + + /** + * Fuegt Karenzierungseintraege zu bestehenden Dienstverhaeltnissen hinzu + */ + private function _addVertragsbestandteilKarenz(&$contracts, $dv, $row_verwendung) + { + if ($row_verwendung->beschausmasscode == 5) + { + $dtstart = new DateTime($row_verwendung->beginn); + $dtende = new DateTime($row_verwendung->ende); + $interval = $dtende->diff($dtstart); + $dauer = $interval->format('%a'); + + // TODO: klären ob das so machbar ist + if ($dauer < 65) + $karenztyp = 'papamonat'; + elseif ($dauer < 120) + $karenztyp = 'bildungskarenz'; + else + $karenztyp = 'elternkarenz'; + + // VBS anlegen und Funktion zuweisen + $newVBSIndex = $this->_getNewVBSIndex($contracts, $dv); + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['vertragsbestandteiltyp_kurzbz'] = 'karenz'; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['von'] = $row_verwendung->beginn; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['bis'] = $row_verwendung->ende; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['karenztyp_kurzbz'] = $karenztyp; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['geplanter_geburtstermin'] = null; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['tatsaechlicher_geburtstermin'] = null; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['hint'] = 'Dauer:'.$dauer; + } + } + + /** + * Holt die Funktionen die Vertragsrelevant sind und verknüpft diese + */ + private function _addVertragsbestandteilFunktion(&$contracts, $user) + { + // Alle Funktionen holen die Vertragsrelevant sind + $this->BenutzerfunktionModel->addOrder('datum_von'); + $this->BenutzerfunktionModel->addJoin('public.tbl_funktion','funktion_kurzbz'); + $resultFunktionen = $this->BenutzerfunktionModel->loadWhere(array('uid' => $user, 'vertragsrelevant' => true)); + + if (isSuccess($resultFunktionen) && hasData($resultFunktionen)) + { + $funktionen = getData($resultFunktionen); + + foreach ($funktionen as $row_funktion) + { + $funktion_added = 0; + $dv = ''; + + // Passendes DV suchen + foreach ($contracts['dv'] as $key_dv => $row_contract) + { + // Eine Funktion kann zu mehreren DV zugeordnet sein + // es werden daher alle durchsucht ob es reinfaellt und ggf mehrfach zugeordnet + if ((isset($row_funktion->datum_von) && $row_funktion->datum_von >= $row_contract['von']) + && ($row_contract['bis'] == '' || $row_contract['bis'] >= $row_funktion->datum_von) + && ( + ( + isset($row_funktion->datum_bis) && isset($row_contract['bis']) + && $row_funktion->datum_bis <= $row_contract['bis'] + ) + || $row_funktion->datum_bis == '' + || (isset($row_funktion->datum_bis) && !isset($row_contract['bis'])) + ) + ) + { + + $dv = $key_dv; + + // Startdatum und Endedatum ermitteln wenn die Funktion ueber das DV hinausgeht + // Wenn die Dauer laenger ist, wird beim Beginn/Ende des DV abgegrenzt + $dtstart_fkt = new DateTime($row_funktion->datum_von); + $dtstart_dv = new DateTime($row_contract['von']); + if ($dtstart_fkt < $dtstart_dv) + $startdatum = $row_contract['von']; + else + $startdatum = $row_funktion->datum_von; + + $dtende_fkt = new DateTime($row_funktion->datum_bis); + $dtende_dv = new DateTime($row_contract['bis']); + if ($dtende_fkt < $dtende_dv) + $endedatum = $row_funktion->datum_bis; + else + $endedatum = $row_contract['von']; + + // VBS anlegen und Funktion zuweisen + $newVBSIndex = $this->_getNewVBSIndex($contracts, $dv); + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['vertragsbestandteiltyp_kurzbz'] = 'funktion'; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['von'] = $startdatum; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['bis'] = $endedatum; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['benutzerfunktion_id'] = $row_funktion->benutzerfunktion_id; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['hint'] = $row_funktion->funktion_kurzbz.' '.$row_funktion->datum_von.' - '.$row_funktion->datum_bis; + $funktion_added++; + } + } + if ($funktion_added == 0) + { + echo "\nFunktion nicht zugeordnet: ".$row_funktion->funktion_kurzbz.' '.$row_funktion->datum_von.' - '.$row_funktion->datum_bis; + } + } + } + } + + /** + * Prueft ob schon ein Vertragsbestandteil fuer Zeitaufzeichnung vorhanden ist das in den Zeitraum passt + * bzw direkt anschließt. Wenn es direkt anschließend ist und die Art gleich sind wird die Laufzeit verlaengert + * Ansonsten wird ein neuer VBS angelegt + */ + private function _addVertragsbestandteilZeitaufzeichnung(&$contracts, $dv, $row_verwendung) + { + if (isset($contracts['dv'][$dv]['vbs'])) + { + foreach ($contracts['dv'][$dv]['vbs'] as $index_vbs=>$row_vbs) + { + if ($row_vbs['vertragsbestandteiltyp_kurzbz'] == 'zeitaufzeichnung') + { + if ($this->_isVBSAngrenzend($row_verwendung, $row_vbs) + && $row_vbs['zeitaufzeichnung'] == $row_verwendung->zeitaufzeichnungspflichtig + && $row_vbs['azgrelevant'] == $row_verwendung->azgrelevant + && $row_vbs['homeoffice'] == $row_verwendung->homeoffice + ) + { + // Zeitaufzeichnungsarten bleiben gleich - Ende des VBS verlaengern + $contracts['dv'][$dv]['vbs'][$index_vbs]['bis'] = $row_verwendung->ende; + return true; + } + } + } + } + + // kein passender VBS gefunden - neuen anlegen + $newVBSIndex = $this->_getNewVBSIndex($contracts, $dv); + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['vertragsbestandteiltyp_kurzbz'] = 'zeitaufzeichnung'; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['von'] = $row_verwendung->beginn; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['bis'] = $row_verwendung->ende; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['zeitaufzeichnung'] = $row_verwendung->zeitaufzeichnungspflichtig; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['azgrelevant'] = $row_verwendung->azgrelevant; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['homeoffice'] = $row_verwendung->homeoffice; + + return true; + } + + /** + * Fueg einen Freitextbestandteil fuer All-In zum DV hinzu + */ + private function _addVertragsbestandteilFreitextAllIn(&$contracts, $dv, $row_verwendung) + { + if ($row_verwendung->ba1code == 111) // All-In + { + $newVBSIndex = $this->_getNewVBSIndex($contracts, $dv); + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['vertragsbestandteiltyp_kurzbz'] = 'freitext'; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['von'] = $row_verwendung->beginn; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['bis'] = $row_verwendung->ende; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['freitexttyp_kurzbz'] = 'allin'; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['titel'] = ''; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['anmerkung'] = ''; + } + return true; + } + + /** + * Fueg einen Freitextbestandteil fuer die Berfristung zum DV hinzu + */ + private function _addVertragsbestandteilFreitextBefristung(&$contracts, $dv, $row_verwendung) + { + if ($row_verwendung->ba2code == 1) // Befristung + { + $newVBSIndex = $this->_getNewVBSIndex($contracts, $dv); + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['vertragsbestandteiltyp_kurzbz'] = 'freitext'; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['von'] = $row_verwendung->beginn; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['bis'] = $row_verwendung->ende; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['freitexttyp_kurzbz'] = 'befristung'; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['titel'] = ''; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['anmerkung'] = ''; + } + return true; + } + + /** + * Prueft ob schon ein Vertragsbestandteil mit diesem Stundenausmass vorhanden ist das in den Zeitraum passt + * bzw direkt anschließt. Wenn es direkt anschließend ist und die Stunden gleich sind wird die Laufzeit verlaengert + * Ansonsten wird ein neuer VBS angelegt + */ + private function _addVertragsbestandteilStunden(&$contracts, $dv, $row_verwendung) + { + // Nur anlegen wenn im aktuellen Eintrag auch Stunden eingetragen sind + if ($row_verwendung->vertragsstunden != '') + { + if (isset($contracts['dv'][$dv]['vbs'])) + { + foreach ($contracts['dv'][$dv]['vbs'] as $index_vbs=>$row_vbs) + { + if ($row_vbs['vertragsbestandteiltyp_kurzbz'] == 'stunden') + { + if ($this->_isVBSAngrenzend($row_verwendung, $row_vbs) && $row_vbs['wochenstunden'] == $row_verwendung->vertragsstunden) + { + // stunden bleiben gleich - Ende des VBS verlaengern + $contracts['dv'][$dv]['vbs'][$index_vbs]['bis'] = $row_verwendung->ende; + return true; + } + } + } + } + + // kein passender VBS gefunden - neuen anlegen + $newVBSIndex = $this->_getNewVBSIndex($contracts, $dv); + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['vertragsbestandteiltyp_kurzbz'] = 'stunden'; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['von'] = $row_verwendung->beginn; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['bis'] = $row_verwendung->ende; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['wochenstunden'] = $row_verwendung->vertragsstunden; + $contracts['dv'][$dv]['vbs'][$newVBSIndex]['teilzeittyp_kurzbz'] = null; + } + return true; + } + + /** + * Prueft ob die Verwendung direkt an den Vertragsbestandteil angrenzt + * @return boolean true wenn ja, sonst false + */ + private function _isVBSAngrenzend($verwendung, $vbs) + { + // Beginn Minus 1 Tag + $dtstart = new DateTime($verwendung->beginn); + $dtstartMinus1 = $dtstart->sub(new DateInterval('P1D'))->format('Y-m-d'); + + if ($vbs['bis'] == '' + || $vbs['bis'] == $dtstartMinus1) + { + return true; + } + + return false; + } + + /** + * Create a new DV or Returns the Index of an existing + */ + private function _getOrCreateDV(&$contracts, $row_verwendung) + { + if (isset($contracts['dv']) && is_array($contracts['dv'])) + { + foreach($contracts['dv'] as $indexdv => $row_dv) + { + // Vertragsart ist die selbe + if ($row_dv['vertragsart_kurzbz'] == $this->matching_ba1_vertragsart[$row_verwendung->ba1code]) + { + + $dtstart = new DateTime($row_verwendung->beginn); + + // Zeitraum passt zur Verwendung + if ($row_dv['von'] <= $row_verwendung->beginn // Beginn Datum Pruefen + && ( // Ende innerhalb des DV + (isset($row_dv['bis']) && $row_verwendung->ende != '' && ($row_dv['bis'] == '' || $row_dv['bis'] >= $row_verwendung->ende) + ) + || // direkt angrenzend an dieses DV + (isset($row_dv['bis']) + && ($row_dv['bis'] == '' + || $row_dv['bis'] == $dtstart->sub(new DateInterval('P1D'))->format('Y-m-d') + ) + ) + ) + ) + { + return $indexdv; + } + } + } + } + + $newDvIndex = $this->_getNewDVIndex($contracts); + $contracts['dv'][$newDvIndex]['mitarbeiter_uid'] = $row_verwendung->mitarbeiter_uid; + $contracts['dv'][$newDvIndex]['von'] = $row_verwendung->beginn; + $contracts['dv'][$newDvIndex]['bis'] = $row_verwendung->ende; + $contracts['dv'][$newDvIndex]['vertragsart_kurzbz'] = $this->matching_ba1_vertragsart[$row_verwendung->ba1code]; + + return $newDvIndex; + } + + /** + * Ermittelt den nächsten (freien) Index für den Vertragsbetandteil + */ + private function _getNewVBSIndex($contracts, $dv) + { + if (isset($contracts['dv'][$dv]['vbs'])) + return max(array_keys($contracts['dv'][$dv]['vbs'])) + 1; + else + return 0; + } + + /** + * Ermittelt den nächsten (freien) Index für das Dienstverhältnis + */ + private function _getNewDVIndex($contracts) + { + if (isset($contracts['dv']) && is_array($contracts['dv'])) + return max(array_keys($contracts['dv'])) + 1; + else + return 0; + } +} From b2a6db9ed3c59cbcc84b960d11b678337599c13b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Wed, 15 Mar 2023 17:26:04 +0100 Subject: [PATCH 026/263] Added NOTNULL Constrait to tbl_gehaltsabrechnung.gehaltsbestandteil_id --- system/dbupdate_3.4/28260_vertraege.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/dbupdate_3.4/28260_vertraege.php b/system/dbupdate_3.4/28260_vertraege.php index 1601694af..9d7b4932c 100644 --- a/system/dbupdate_3.4/28260_vertraege.php +++ b/system/dbupdate_3.4/28260_vertraege.php @@ -81,7 +81,7 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table gehaltsabrechnung_id serial NOT NULL, datum date, betrag bytea, - gehaltsbestandteil_id integer, + gehaltsbestandteil_id integer NOT NULL, CONSTRAINT tbl_gehaltsabrechnung_pk PRIMARY KEY (gehaltsabrechnung_id) ); From 8f37d246934b6f798f4cc80463c7b8b70a7f9d13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Fri, 17 Mar 2023 08:29:21 +0100 Subject: [PATCH 027/263] Fixed Typo in Column Dienstverhaeltnis --- system/dbupdate_3.4.php | 2 +- system/dbupdate_3.4/28260_vertraege.php | 68 ++++++++++++------------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/system/dbupdate_3.4.php b/system/dbupdate_3.4.php index c63e55025..75a34f4be 100644 --- a/system/dbupdate_3.4.php +++ b/system/dbupdate_3.4.php @@ -142,7 +142,7 @@ $tabellen=array( "hr.tbl_sachaufwand" => array("sachaufwand_id","mitarbeiter_uid","sachaufwandtyp_kurzbz","dienstverhaeltnis_id","beginn","ende","anmerkung","insertamum","insertvon","updateamum","updatevon"), "hr.tbl_sachaufwandtyp" => array("sachaufwandtyp_kurzbz","bezeichnung","sort", "aktiv"), "hr.tbl_dienstverhaeltnis" => array("dienstverhaeltnis_id","mitarbeiter_uid","vertragsart_kurzbz","oe_kurzbz","von","bis","insertamum","insertvon","updateamum","updatevon"), - "hr.tbl_vertragsart" => array("vertragsart_kurzbz","bezeichnung","anmerkung","dientverhaeltnis","vertragsart_kurzbz_parent","aktiv","sort"), + "hr.tbl_vertragsart" => array("vertragsart_kurzbz","bezeichnung","anmerkung","dienstverhaeltnis","vertragsart_kurzbz_parent","aktiv","sort"), "hr.tbl_vertragsbestandteil" => array("vertragsbestandteil_id","dienstverhaeltnis_id","vertragsbestandteiltyp_kurzbz","von", "bis","insertamum", "insertvon","updateamum","updatevon"), "hr.tbl_vertragsbestandteiltyp" => array("vertragsbestandteiltyp_kurzbz","bezeichnung","ueberlappend"), "hr.tbl_vertragsbestandteil_funktion" => array("vertragsbestandteil_id","benutzerfunktion_id",), diff --git a/system/dbupdate_3.4/28260_vertraege.php b/system/dbupdate_3.4/28260_vertraege.php index 9d7b4932c..4d6497a73 100644 --- a/system/dbupdate_3.4/28260_vertraege.php +++ b/system/dbupdate_3.4/28260_vertraege.php @@ -12,7 +12,7 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table ALTER SCHEMA hr OWNER TO fhcomplete; - CREATE TABLE hr.tbl_dienstverhaeltnis + CREATE TABLE hr.tbl_dienstverhaeltnis ( dienstverhaeltnis_id serial NOT NULL, mitarbeiter_uid character varying(32), @@ -27,7 +27,7 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table CONSTRAINT tbl_dienstverhaeltnis_pk PRIMARY KEY (dienstverhaeltnis_id) ); - CREATE TABLE hr.tbl_vertragsbestandteil + CREATE TABLE hr.tbl_vertragsbestandteil ( vertragsbestandteil_id serial NOT NULL, dienstverhaeltnis_id integer, @@ -41,7 +41,7 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table CONSTRAINT tbl_vertragsbestandteil_pk PRIMARY KEY (vertragsbestandteil_id) ); - CREATE TABLE hr.tbl_gehaltsbestandteil + CREATE TABLE hr.tbl_gehaltsbestandteil ( gehaltsbestandteil_id serial NOT NULL, dienstverhaeltnis_id integer NOT NULL, @@ -68,7 +68,7 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table COMMENT ON COLUMN hr.tbl_gehaltsbestandteil.valorisierung IS E'Wird dieser Bestandteil mitvalorisiert'; COMMENT ON COLUMN hr.tbl_gehaltsbestandteil.valorisierungssperre IS E'Bis zu welchem Datum ist dieser Bestandteil von der Valorisierung ausgenommen'; - ALTER TABLE hr.tbl_gehaltsbestandteil ADD CONSTRAINT tbl_dienstverhaeltnis_fk FOREIGN KEY (dienstverhaeltnis_id) + ALTER TABLE hr.tbl_gehaltsbestandteil ADD CONSTRAINT tbl_dienstverhaeltnis_fk FOREIGN KEY (dienstverhaeltnis_id) REFERENCES hr.tbl_dienstverhaeltnis (dienstverhaeltnis_id) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE; @@ -76,7 +76,7 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table REFERENCES hr.tbl_dienstverhaeltnis (dienstverhaeltnis_id) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE; - CREATE TABLE hr.tbl_gehaltsabrechnung + CREATE TABLE hr.tbl_gehaltsabrechnung ( gehaltsabrechnung_id serial NOT NULL, datum date, @@ -95,7 +95,7 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table REFERENCES public.tbl_mitarbeiter (mitarbeiter_uid) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE; - CREATE TABLE hr.tbl_gehaltstyp + CREATE TABLE hr.tbl_gehaltstyp ( gehaltstyp_kurzbz character varying(32) NOT NULL, bezeichnung varchar(256), @@ -111,7 +111,7 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table REFERENCES hr.tbl_gehaltstyp (gehaltstyp_kurzbz) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE; - CREATE TABLE hr.tbl_vertragsart + CREATE TABLE hr.tbl_vertragsart ( vertragsart_kurzbz varchar(32) NOT NULL, bezeichnung varchar(256), @@ -130,7 +130,7 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table REFERENCES hr.tbl_vertragsart (vertragsart_kurzbz) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE; - CREATE TABLE hr.tbl_sachaufwand + CREATE TABLE hr.tbl_sachaufwand ( sachaufwand_id serial NOT NULL, mitarbeiter_uid character varying(32), @@ -150,7 +150,7 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table REFERENCES public.tbl_mitarbeiter (mitarbeiter_uid) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE; - CREATE TABLE hr.tbl_sachaufwandtyp + CREATE TABLE hr.tbl_sachaufwandtyp ( sachaufwandtyp_kurzbz character varying(32) NOT NULL, bezeichnung character varying(256), @@ -174,7 +174,7 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table REFERENCES hr.tbl_vertragsbestandteil (vertragsbestandteil_id) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE; - CREATE TABLE hr.tbl_vertragsbestandteiltyp + CREATE TABLE hr.tbl_vertragsbestandteiltyp ( vertragsbestandteiltyp_kurzbz varchar(32) NOT NULL, bezeichnung varchar(256), @@ -189,7 +189,7 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table REFERENCES hr.tbl_vertragsbestandteiltyp (vertragsbestandteiltyp_kurzbz) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE; - CREATE TABLE hr.tbl_vertragsbestandteil_funktion + CREATE TABLE hr.tbl_vertragsbestandteil_funktion ( vertragsbestandteil_id integer NOT NULL, benutzerfunktion_id integer, @@ -200,29 +200,29 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table REFERENCES public.tbl_benutzerfunktion (benutzerfunktion_id) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE; - CREATE TABLE hr.tbl_vertragsbestandteil_stunden + CREATE TABLE hr.tbl_vertragsbestandteil_stunden ( vertragsbestandteil_id integer NOT NULL, wochenstunden smallint, teilzeittyp_kurzbz character varying(32), CONSTRAINT tbl_vertragsbestandteil_stunden_pk PRIMARY KEY (vertragsbestandteil_id) ); - + COMMENT ON COLUMN hr.tbl_vertragsbestandteil_stunden.teilzeittyp_kurzbz IS E'Altersteilzeit, Elternteilzeit'; - CREATE TABLE hr.tbl_teilzeittyp + CREATE TABLE hr.tbl_teilzeittyp ( teilzeittyp_kurzbz character varying(32) NOT NULL, bezeichnung varchar(256) NOT NULL, aktiv boolean NOT NULL DEFAULT true, CONSTRAINT tbl_teilzeittyp_pk PRIMARY KEY (teilzeittyp_kurzbz) ); - + ALTER TABLE hr.tbl_vertragsbestandteil_stunden ADD CONSTRAINT tbl_teilzeittyp_fk FOREIGN KEY (teilzeittyp_kurzbz) REFERENCES hr.tbl_teilzeittyp (teilzeittyp_kurzbz) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE; - CREATE TABLE hr.tbl_vertragsbestandteil_freitext + CREATE TABLE hr.tbl_vertragsbestandteil_freitext ( vertragsbestandteil_id integer NOT NULL, freitexttyp_kurzbz varchar(32), @@ -231,7 +231,7 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table CONSTRAINT tbl_vertragsbestandteil_freitext_pk PRIMARY KEY (vertragsbestandteil_id) ); - CREATE TABLE hr.tbl_vertragsbestandteil_freitexttyp + CREATE TABLE hr.tbl_vertragsbestandteil_freitexttyp ( freitexttyp_kurzbz varchar(32) NOT NULL, bezeichnung varchar(128), @@ -259,7 +259,7 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table REFERENCES hr.tbl_vertragsbestandteil (vertragsbestandteil_id) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE; - CREATE TABLE hr.tbl_vertragsbestandteil_zeitaufzeichnung + CREATE TABLE hr.tbl_vertragsbestandteil_zeitaufzeichnung ( vertragsbestandteil_id integer NOT NULL, zeitaufzeichnung bool, @@ -268,14 +268,14 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table CONSTRAINT tbl_vertragsbestandteil_zeitaufzeichnung_pk PRIMARY KEY (vertragsbestandteil_id) ); - CREATE TABLE hr.tbl_vertragsbestandteil_urlaubsanspruch + CREATE TABLE hr.tbl_vertragsbestandteil_urlaubsanspruch ( vertragsbestandteil_id integer NOT NULL, tage smallint, CONSTRAINT tbl_vertragsbestandteil_urlaubsanspruch_pk PRIMARY KEY (vertragsbestandteil_id) ); - CREATE TABLE hr.tbl_vertragsbestandteil_kuendigungsfrist + CREATE TABLE hr.tbl_vertragsbestandteil_kuendigungsfrist ( vertragsbestandteil_id integer NOT NULL, arbeitgeber_frist smallint, @@ -295,7 +295,7 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table REFERENCES hr.tbl_vertragsbestandteil (vertragsbestandteil_id) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE; - CREATE TABLE hr.tbl_vertragsbestandteil_karenz + CREATE TABLE hr.tbl_vertragsbestandteil_karenz ( vertragsbestandteil_id integer NOT NULL, karenztyp_kurzbz varchar(32), @@ -308,7 +308,7 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table REFERENCES hr.tbl_vertragsbestandteil (vertragsbestandteil_id) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE; - CREATE TABLE hr.tbl_karenztyp + CREATE TABLE hr.tbl_karenztyp ( karenztyp_kurzbz varchar(32) NOT NULL, bezeichnung character varying(256) NOT NULL, @@ -328,9 +328,9 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table REFERENCES hr.tbl_vertragsart (vertragsart_kurzbz) MATCH SIMPLE ON DELETE NO ACTION ON UPDATE NO ACTION; - GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_sachaufwand TO vilesci; + GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_sachaufwand TO vilesci; GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_sachaufwandtyp TO vilesci; - + GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_dienstverhaeltnis TO vilesci; GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_vertragsart TO vilesci; GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_vertragsbestandteil TO vilesci; @@ -345,7 +345,7 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_vertragsbestandteil_karenz TO vilesci; GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_karenztyp TO vilesci; GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_teilzeittyp TO vilesci; - + GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_gehaltsbestandteil TO vilesci; GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_gehaltsabrechnung TO vilesci; GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_gehaltstyp TO vilesci; @@ -359,16 +359,16 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table INSERT INTO hr.tbl_teilzeittyp(teilzeittyp_kurzbz, bezeichnung) VALUES('altersteilzeit','Altersteilzeit'); INSERT INTO hr.tbl_teilzeittyp(teilzeittyp_kurzbz, bezeichnung) VALUES('elternteilzeit','Elternteilzeit'); - INSERT INTO hr.tbl_vertragsart(vertragsart_kurzbz, bezeichnung, anmerkung, dientverhaeltnis, vertragsart_kurzbz_parent, aktiv, sort) VALUES('echterdv','Echter DV','Echter Dienstvertrag', true, null, true, 100); - INSERT INTO hr.tbl_vertragsart(vertragsart_kurzbz, bezeichnung, anmerkung, dientverhaeltnis, vertragsart_kurzbz_parent, aktiv, sort) VALUES('studentischehilfskr','Studentische Hilfskraft','Studentische Hilfskraft', true, 'echterdv', true, 101); + INSERT INTO hr.tbl_vertragsart(vertragsart_kurzbz, bezeichnung, anmerkung, dienstverhaeltnis, vertragsart_kurzbz_parent, aktiv, sort) VALUES('echterdv','Echter DV','Echter Dienstvertrag', true, null, true, 100); + INSERT INTO hr.tbl_vertragsart(vertragsart_kurzbz, bezeichnung, anmerkung, dienstverhaeltnis, vertragsart_kurzbz_parent, aktiv, sort) VALUES('studentischehilfskr','Studentische Hilfskraft','Studentische Hilfskraft', true, 'echterdv', true, 101); - INSERT INTO hr.tbl_vertragsart(vertragsart_kurzbz, bezeichnung, anmerkung, dientverhaeltnis, vertragsart_kurzbz_parent, aktiv, sort) VALUES('freierdv','Freier DV','Freier Dienstvertrag', false, null, true, 200); - INSERT INTO hr.tbl_vertragsart(vertragsart_kurzbz, bezeichnung, anmerkung, dientverhaeltnis, vertragsart_kurzbz_parent, aktiv, sort) VALUES('externerlehrender','externer Lehrender','Externer Lehrender Freier DV', true, 'freierdv', true, 201); - INSERT INTO hr.tbl_vertragsart(vertragsart_kurzbz, bezeichnung, anmerkung, dientverhaeltnis, vertragsart_kurzbz_parent, aktiv, sort) VALUES('gastlektor','Gastlektor','Gastlektor', true, 'freierdv', true, 202); - INSERT INTO hr.tbl_vertragsart(vertragsart_kurzbz, bezeichnung, anmerkung, dientverhaeltnis, vertragsart_kurzbz_parent, aktiv, sort) VALUES('echterfreier','Echter Freier DV','Echter Freier DV', true, 'freierdv', true, 203); - - INSERT INTO hr.tbl_vertragsart(vertragsart_kurzbz, bezeichnung, anmerkung, dientverhaeltnis, vertragsart_kurzbz_parent, aktiv, sort) VALUES('werkvertrag','Werkvertrag','Werkvertrag', true, null, true, 300); - INSERT INTO hr.tbl_vertragsart(vertragsart_kurzbz, bezeichnung, anmerkung, dientverhaeltnis, vertragsart_kurzbz_parent, aktiv, sort) VALUES('ueberlassungsvertrag','Überlassungsvertrag','Überlassungsvertrag', true, 'werkvertrag', true, 300); + INSERT INTO hr.tbl_vertragsart(vertragsart_kurzbz, bezeichnung, anmerkung, dienstverhaeltnis, vertragsart_kurzbz_parent, aktiv, sort) VALUES('freierdv','Freier DV','Freier Dienstvertrag', false, null, true, 200); + INSERT INTO hr.tbl_vertragsart(vertragsart_kurzbz, bezeichnung, anmerkung, dienstverhaeltnis, vertragsart_kurzbz_parent, aktiv, sort) VALUES('externerlehrender','externer Lehrender','Externer Lehrender Freier DV', true, 'freierdv', true, 201); + INSERT INTO hr.tbl_vertragsart(vertragsart_kurzbz, bezeichnung, anmerkung, dienstverhaeltnis, vertragsart_kurzbz_parent, aktiv, sort) VALUES('gastlektor','Gastlektor','Gastlektor', true, 'freierdv', true, 202); + INSERT INTO hr.tbl_vertragsart(vertragsart_kurzbz, bezeichnung, anmerkung, dienstverhaeltnis, vertragsart_kurzbz_parent, aktiv, sort) VALUES('echterfreier','Echter Freier DV','Echter Freier DV', true, 'freierdv', true, 203); + + INSERT INTO hr.tbl_vertragsart(vertragsart_kurzbz, bezeichnung, anmerkung, dienstverhaeltnis, vertragsart_kurzbz_parent, aktiv, sort) VALUES('werkvertrag','Werkvertrag','Werkvertrag', true, null, true, 300); + INSERT INTO hr.tbl_vertragsart(vertragsart_kurzbz, bezeichnung, anmerkung, dienstverhaeltnis, vertragsart_kurzbz_parent, aktiv, sort) VALUES('ueberlassungsvertrag','Überlassungsvertrag','Überlassungsvertrag', true, 'werkvertrag', true, 300); INSERT INTO hr.tbl_gehaltstyp(gehaltstyp_kurzbz, bezeichnung, valorisierung, sort, aktiv) VALUES('basisgehalt','Basisgehalt', true, 1, true); INSERT INTO hr.tbl_gehaltstyp(gehaltstyp_kurzbz, bezeichnung, valorisierung, sort, aktiv) VALUES('grundgehalt','Grundgehalt', true, 2, true); From 279ddddfc83328b106e6f9dfabc181bae43810e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Fri, 17 Mar 2023 09:53:41 +0100 Subject: [PATCH 028/263] =?UTF-8?q?Wochenstunden=20auf=20numeric=20korrigi?= =?UTF-8?q?ert,=20Diverse=20NOT=20NULL=20Constraints=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- system/dbupdate_3.4/28260_vertraege.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/system/dbupdate_3.4/28260_vertraege.php b/system/dbupdate_3.4/28260_vertraege.php index 4d6497a73..1bdaa5f4d 100644 --- a/system/dbupdate_3.4/28260_vertraege.php +++ b/system/dbupdate_3.4/28260_vertraege.php @@ -30,8 +30,8 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table CREATE TABLE hr.tbl_vertragsbestandteil ( vertragsbestandteil_id serial NOT NULL, - dienstverhaeltnis_id integer, - vertragsbestandteiltyp_kurzbz varchar(32), + dienstverhaeltnis_id integer NOT NULL, + vertragsbestandteiltyp_kurzbz varchar(32) NOT NULL, von date, bis date, insertamum timestamp, @@ -203,7 +203,7 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table CREATE TABLE hr.tbl_vertragsbestandteil_stunden ( vertragsbestandteil_id integer NOT NULL, - wochenstunden smallint, + wochenstunden numeric(4,2), teilzeittyp_kurzbz character varying(32), CONSTRAINT tbl_vertragsbestandteil_stunden_pk PRIMARY KEY (vertragsbestandteil_id) ); @@ -225,7 +225,7 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table CREATE TABLE hr.tbl_vertragsbestandteil_freitext ( vertragsbestandteil_id integer NOT NULL, - freitexttyp_kurzbz varchar(32), + freitexttyp_kurzbz varchar(32) NOT NULL, titel varchar(256), anmerkung text, CONSTRAINT tbl_vertragsbestandteil_freitext_pk PRIMARY KEY (vertragsbestandteil_id) @@ -262,9 +262,9 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table CREATE TABLE hr.tbl_vertragsbestandteil_zeitaufzeichnung ( vertragsbestandteil_id integer NOT NULL, - zeitaufzeichnung bool, - azgrelevant bool, - homeoffice bool, + zeitaufzeichnung boolean NOT NULL, + azgrelevant boolean NOT NULL, + homeoffice boolean NOT NULL, CONSTRAINT tbl_vertragsbestandteil_zeitaufzeichnung_pk PRIMARY KEY (vertragsbestandteil_id) ); From 25313a8f527cd7d8964cab01fbb8f5a75298a551 Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 23 Mar 2023 14:34:37 +0100 Subject: [PATCH 029/263] Code quality check fixes --- application/views/person/bpk/bpkDetails.php | 12 ++++++++++-- .../views/system/infocenter/infocenterZgvDetails.php | 6 +++++- application/views/templates/FHC-Footer.php | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/application/views/person/bpk/bpkDetails.php b/application/views/person/bpk/bpkDetails.php index 6b7d4430d..bd6191c6a 100644 --- a/application/views/person/bpk/bpkDetails.php +++ b/application/views/person/bpk/bpkDetails.php @@ -125,10 +125,18 @@
-
+ - +
diff --git a/application/views/system/infocenter/infocenterZgvDetails.php b/application/views/system/infocenter/infocenterZgvDetails.php index bf9f69e18..3a254b16a 100644 --- a/application/views/system/infocenter/infocenterZgvDetails.php +++ b/application/views/system/infocenter/infocenterZgvDetails.php @@ -130,7 +130,11 @@ p->t('infocenter', 'zgvNichtErfuellt') ?> - diff --git a/application/views/templates/FHC-Footer.php b/application/views/templates/FHC-Footer.php index ee13c69d2..a9a44b978 100644 --- a/application/views/templates/FHC-Footer.php +++ b/application/views/templates/FHC-Footer.php @@ -107,7 +107,7 @@ if ($tinymce5 === true) generateJSsInclude('vendor/tinymce/tinymce5/tinymce.min.js'); // Vue 3 JS - if ($vue3 === true) + if ($vue3 === true) { generateJSsInclude('vendor/vuejs/vuejs3/vue.global.prod.js'); generateJSsInclude('vendor/vuejs/vuerouter4/vue-router.global.js'); From c52cd05436f7910909ee84237418ce6e1260dab4 Mon Sep 17 00:00:00 2001 From: Werner Masik Date: Tue, 28 Mar 2023 20:12:40 +0200 Subject: [PATCH 030/263] Merge branch 'feature-25562/PV21_Vertraege_Encryption_Merge' --- application/config/db_crypt.php | 29 ++ application/core/DB_Model.php | 306 ++++++++++++++- application/libraries/FilterCmptLib.php | 13 +- application/libraries/FilterWidgetLib.php | 23 +- application/libraries/TableWidgetLib.php | 23 +- .../vertragsbestandteil/Dienstverhaeltnis.php | 144 +++++++ .../VertragsbestandteilFactory.php | 78 +++- .../VertragsbestandteilLib.php | 51 ++- .../gui/AbstractBestandteil.php | 86 +++++ .../gui/AbstractGUIVertragsbestandteil.php | 143 +++++++ .../vertragsbestandteil/gui/FormData.php | 105 ++++++ .../gui/GUIGehaltsbestandteil.php | 89 +++++ .../gui/GUIGueltigkeit.php | 76 ++++ .../vertragsbestandteil/gui/GUIHandler.php | 167 +++++++++ .../gui/GUIHandlerFactory.php | 30 ++ .../gui/GUIVertragsbestandteilFunktion.php | 122 ++++++ ...GUIVertragsbestandteilKuendigungsfrist.php | 118 ++++++ .../gui/GUIVertragsbestandteilStunden.php | 131 +++++++ ...GUIVertragsbestandteilZeitaufzeichnung.php | 103 +++++ ...IVertragsbestandteilZusatzvereinbarung.php | 139 +++++++ .../vertragsbestandteil/gui/JSONData.php | 53 +++ application/models/person/Person_model.php | 19 + application/models/system/PersonLog_model.php | 19 +- .../Gehaltsbestandteil_model.php | 19 +- .../vertragsbestandteil/IEncryption.php | 7 + ...tragsbestandteilKuendigungsfrist_model.php | 14 + .../Vertragsbestandteil_model.php | 46 ++- application/widgets/FilterWidget.php | 33 +- application/widgets/TableWidget.php | 33 +- composer.json | 5 +- system/UnitTests/FunctionsTest.php | 5 +- .../vertragsbestandteil/gui/FormDataTest.php | 40 ++ .../GUIVertragsbestandteilFunktionTest.php | 39 ++ ...ertragsbestandteilKuendigungsfristTest.php | 36 ++ .../gui/GUIVertragsbestandteilStundenTest.php | 77 ++++ ...ertragsbestandteilZeitaufzeichnungTest.php | 39 ++ .../GUIVertragsbestandteilZusatzvbTest.php | 41 ++ .../vertragsbestandteil/gui/funktion01.json | 241 ++++++++++++ .../gui/kuendigungsfrist01.json | 263 +++++++++++++ .../vertragsbestandteil/gui/stunden01.json | 241 ++++++++++++ .../gui/zeitaufzeichnung01.json | 264 +++++++++++++ .../vertragsbestandteil/gui/zusatz01.json | 354 ++++++++++++++++++ 42 files changed, 3812 insertions(+), 52 deletions(-) create mode 100644 application/config/db_crypt.php create mode 100644 application/libraries/vertragsbestandteil/Dienstverhaeltnis.php create mode 100644 application/libraries/vertragsbestandteil/gui/AbstractBestandteil.php create mode 100644 application/libraries/vertragsbestandteil/gui/AbstractGUIVertragsbestandteil.php create mode 100644 application/libraries/vertragsbestandteil/gui/FormData.php create mode 100644 application/libraries/vertragsbestandteil/gui/GUIGehaltsbestandteil.php create mode 100644 application/libraries/vertragsbestandteil/gui/GUIGueltigkeit.php create mode 100644 application/libraries/vertragsbestandteil/gui/GUIHandler.php create mode 100644 application/libraries/vertragsbestandteil/gui/GUIHandlerFactory.php create mode 100644 application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilFunktion.php create mode 100644 application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilKuendigungsfrist.php create mode 100644 application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilStunden.php create mode 100644 application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilZeitaufzeichnung.php create mode 100644 application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilZusatzvereinbarung.php create mode 100644 application/libraries/vertragsbestandteil/gui/JSONData.php create mode 100644 application/models/vertragsbestandteil/IEncryption.php create mode 100644 application/models/vertragsbestandteil/VertragsbestandteilKuendigungsfrist_model.php create mode 100644 system/UnitTests/vertragsbestandteil/gui/FormDataTest.php create mode 100644 system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilFunktionTest.php create mode 100644 system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilKuendigungsfristTest.php create mode 100644 system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilStundenTest.php create mode 100644 system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilZeitaufzeichnungTest.php create mode 100644 system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilZusatzvbTest.php create mode 100644 system/UnitTests/vertragsbestandteil/gui/funktion01.json create mode 100644 system/UnitTests/vertragsbestandteil/gui/kuendigungsfrist01.json create mode 100644 system/UnitTests/vertragsbestandteil/gui/stunden01.json create mode 100644 system/UnitTests/vertragsbestandteil/gui/zeitaufzeichnung01.json create mode 100644 system/UnitTests/vertragsbestandteil/gui/zusatz01.json diff --git a/application/config/db_crypt.php b/application/config/db_crypt.php new file mode 100644 index 000000000..72f8c30d8 --- /dev/null +++ b/application/config/db_crypt.php @@ -0,0 +1,29 @@ +. + */ + +if (!defined('BASEPATH')) exit('No direct script access allowed'); + +// NOTE: if database encryption is _not_ used then leave this array empty! +$config['encryption_passwords'] = array( + // 'password name 1' => 'password 1' + // 'password name 2' => 'password 2' + // 'password name ...' => 'password ...' + // 'password name N' => 'password N' +); + diff --git a/application/core/DB_Model.php b/application/core/DB_Model.php index bdd5316e7..062bc06c2 100644 --- a/application/core/DB_Model.php +++ b/application/core/DB_Model.php @@ -1,5 +1,22 @@ . + */ + if (!defined('BASEPATH')) exit('No direct script access allowed'); /** @@ -27,6 +44,15 @@ class DB_Model extends CI_Model const PGSQL_INT8_TYPE = 'int8'; const PGSQL_FLOAT4_TYPE = 'float4'; const PGSQL_FLOAT8_TYPE = 'float8'; + const PGSQL_BYTEA_TYPE = 'bytea'; + + // Name of the config entry containing an array of password that can be used to encrypt/decrypt + const CRYPT_CONF_PASSWORDS = 'encryption_passwords'; + const CRYPT_CAST = 'cast'; + const CRYPT_PASSWORD_NAME = 'passwordName'; + const CRYPT_SELECT_TEMPLATE = 'PGP_SYM_DECRYPT(%s, \'%s\')::%s AS %s'; + const CRYPT_WHERE_TEMPLATE = 'PGP_SYM_DECRYPT(%s, \'%s\')::%s'; + const CRYPT_WRITE_TEMPLATE = 'PGP_SYM_ENCRYPT(\'%s\', \'%s\')'; protected $dbTable; // Name of the DB-Table for CI-Insert, -Update, ... protected $pk; // Name of the PrimaryKey for DB-Update, Load, ... @@ -36,7 +62,7 @@ class DB_Model extends CI_Model private $executedQueryMetaData; private $executedQueryListFields; - private $debugMode; + private $debugMode; // Debug mode enable (true) or disabled (false) /** * Constructor @@ -46,20 +72,23 @@ class DB_Model extends CI_Model // Call parent constructor parent::__construct(); - // Set properties - $this->hasSequence = true; - - // Loads DB conns and confs + // Loads DB connections and configs $this->load->database($dbtype); + // Loads the DB config to encrypt/decrypt data + $this->config->load('db_crypt'); + + // Set properties + $this->hasSequence = true; + $this->debugMode = isset($this->db->db_debug) && $this->db->db_debug === true; + + // Loads UDF model $this->load->model('system/UDF_model', 'UDFModel'); // Loads the UDF library $this->load->library('UDFLib'); // Loads the logs library $this->load->library('LogLib'); - - $this->debugMode = isset($this->db->db_debug) && $this->db->db_debug === true; } // ------------------------------------------------------------------------------------------ @@ -85,7 +114,7 @@ class DB_Model extends CI_Model * @param array $data DataArray for Insert * @return array */ - public function insert($data) + public function insert($data, $encryptedColumns = null) { // Check class properties if (is_null($this->dbTable)) return error('The given database table name is not valid', EXIT_MODEL); @@ -93,6 +122,9 @@ class DB_Model extends CI_Model // If this table has UDF and the validation of them is ok if (isError($validate = $this->_prepareUDFsWrite($data, $this->dbTable))) return $validate; + // Add the pgp_sym_eccrypt postgresql function to the set clause if needed + $this->_addEncrypt($encryptedColumns, $data); + // DB-INSERT $insert = $this->db->insert($this->dbTable, $data); @@ -135,7 +167,7 @@ class DB_Model extends CI_Model * @param array $data DataArray for Insert * @return array */ - public function update($id, $data) + public function update($id, $data, $encryptedColumns = null) { // Check class properties if (is_null($this->pk)) return error('The given primary key is not valid', EXIT_MODEL); @@ -161,6 +193,9 @@ class DB_Model extends CI_Model $this->db->where($tmpId); + // Add the pgp_sym_eccrypt postgresql function to the set clause if needed + $this->_addEncrypt($encryptedColumns, $data); + // DB-UPDATE $update = $this->db->update($this->dbTable, $data); @@ -224,7 +259,7 @@ class DB_Model extends CI_Model * @param string $id ID (Primary Key) for SELECT ... WHERE * @return array */ - public function load($id = null) + public function load($id = null, $encryptedColumns = null) { // Check class properties if (is_null($this->pk)) return error('The given primary key is not valid', EXIT_MODEL); @@ -245,7 +280,7 @@ class DB_Model extends CI_Model $tmpId = array($this->pk => $id); } - return $this->loadWhere($tmpId); + return $this->loadWhere($tmpId, $encryptedColumns); } /** @@ -253,11 +288,14 @@ class DB_Model extends CI_Model * * @return array */ - public function loadWhere($where = null) + public function loadWhere($where = null, $encryptedColumns = null) { // Check class properties if (is_null($this->dbTable)) return error('The given database table name is not valid', EXIT_MODEL); + // Add the pgp_sym_decrypt postgresql function to the select and where clause if needed + $this->_addDecryptLoad($encryptedColumns, $where); + // Execute query $result = $this->db->get_where($this->dbTable, $where); @@ -265,7 +303,7 @@ class DB_Model extends CI_Model if ($result) { - return success($this->_toPhp($result)); + return success($this->_toPhp($result, $encryptedColumns)); } else { @@ -758,7 +796,7 @@ class DB_Model extends CI_Model /** * Like execQuery, but it allows only to perform queries to read data */ - public function execReadOnlyQuery($query, $parametersArray = null) + public function execReadOnlyQuery($query, $parametersArray = null, $encryptedColumns = null) { $result = error('You are allowed to run only query for reading data'); // $cleanedQuery = trim(preg_replace('/\t|\n|\r|;/', '', $query)); // @@ -775,7 +813,7 @@ class DB_Model extends CI_Model { $queryToExec = str_replace(';', '', $query); // - $result = $this->execQuery($queryToExec, $parametersArray); + $result = $this->execQuery($queryToExec, $parametersArray, $encryptedColumns); } return $result; @@ -790,13 +828,16 @@ class DB_Model extends CI_Model * boolean if the query is of the write type (INSERT, UPDATE, DELETE...) * array that represents DB data */ - protected function execQuery($query, $parametersArray = null) + protected function execQuery($query, $parametersArray = null, $encryptedColumns = null) { $result = null; // If the query is empty don't lose time if (!isEmptyString($query)) { + // Add the pgp_sym_decrypt postgresql function to the given query + $this->_addDecryptQuery($encryptedColumns, $query); + // If there are parameters to bind to the query if (is_array($parametersArray) && count($parametersArray) > 0) { @@ -812,7 +853,7 @@ class DB_Model extends CI_Model // If no errors occurred if ($resultDB) { - $result = success($this->_toPhp($resultDB)); + $result = success($this->_toPhp($resultDB, $encryptedColumns)); } else { @@ -851,6 +892,215 @@ class DB_Model extends CI_Model // ------------------------------------------------------------------------------------------ // Private methods + // + // + + /** + * To add the pgp_sym_encrypt function to the set clause where needed + */ + private function _addEncrypt($encryptedColumns, &$data) + { + $tmpData = array(); // Temporary array used to copy not encrypted columns + + // For each column that is going to be inserted/updated + foreach ($data as $column => $value) + { + // If the current column is in the list of the columns to be encrypted + // and contains the password name element + if (array_key_exists($column, $encryptedColumns) + && array_key_exists(self::CRYPT_PASSWORD_NAME, $encryptedColumns[$column])) + { + // Password to encrypt data + $encryptionPassword = $this->config->item(self::CRYPT_CONF_PASSWORDS)[ + $encryptedColumns[$column][self::CRYPT_PASSWORD_NAME] + ]; + + // Add the encrypted column to the set clause without escaping + $this->db->set( + $column, + sprintf( + self::CRYPT_WRITE_TEMPLATE, + $value, + $encryptionPassword + ), + false // no escaping + ); + } + else // otherwise copy this element as it is + { + $tmpData[$column] = $value; + } + } + + $data = $tmpData; // this array does not contain encrypted columns + } + + /** + * To add the pgp_sym_decrypt function to the given query + */ + private function _addDecryptQuery($encryptedColumns, &$query) + { + // If it is request to get encrypted columns + if (!isEmptyArray($encryptedColumns)) + { + // For each requested encrypted column + foreach ($encryptedColumns as $encryptedColumn => $definition) + { + // If the requested encrypted column is well defined + if (!isEmptyArray($definition) + && array_key_exists(self::CRYPT_CAST, $definition) + && array_key_exists(self::CRYPT_PASSWORD_NAME, $definition)) + { + // And if exists the wanted password to decrypt in the configs + if (array_key_exists( + $definition[self::CRYPT_PASSWORD_NAME], + $this->config->item(self::CRYPT_CONF_PASSWORDS)) + ) + { + // Password to decrypt data + $decryptionPassword = $this->config->item(self::CRYPT_CONF_PASSWORDS)[ + $definition[self::CRYPT_PASSWORD_NAME] + ]; + + // Find and replace all the occurrences of the provided encrypted columns + // with the postgresql decryption function + $query = str_replace( + $encryptedColumn, + sprintf( + self::CRYPT_WHERE_TEMPLATE, + $encryptedColumn, + $decryptionPassword, + $definition[self::CRYPT_CAST] + ), + $query + ); + } + } + } + } + } + + /** + * To add the pgp_sym_decrypt function to the select and where clause where needed + */ + private function _addDecryptLoad($encryptedColumns, &$where) + { + // If it is request to get encrypted columns + if (!isEmptyArray($encryptedColumns)) + { + // For each requested encrypted column + foreach ($encryptedColumns as $encryptedColumn => $definition) + { + // If the requested encrypted column is well defined + if (!isEmptyArray($definition) + && array_key_exists(self::CRYPT_CAST, $definition) + && array_key_exists(self::CRYPT_PASSWORD_NAME, $definition)) + { + // And if exists the wanted password to decrypt in the configs + if (array_key_exists( + $definition[self::CRYPT_PASSWORD_NAME], + $this->config->item(self::CRYPT_CONF_PASSWORDS)) + ) + { + // Password to decrypt data + $decryptionPassword = $this->config->item(self::CRYPT_CONF_PASSWORDS)[ + $definition[self::CRYPT_PASSWORD_NAME] + ]; + + // ----------------------------------------- + // SELECT + + // Add to the select clause the column to be decrypted + // NOTE: this is going to override any previously added column with the same name + $this->addSelect( + sprintf( + self::CRYPT_SELECT_TEMPLATE, + $encryptedColumn, + $decryptionPassword, + $definition[self::CRYPT_CAST], + $encryptedColumn + ) + ); + + // ----------------------------------------- + // WHERE + + // If the where parameter is a valid array + if (!isEmptyArray($where)) + { + $tmpWhere = array(); + + // For each condition of the where clause + foreach ($where as $column => $condition) + { + $operator = null; // operator not found in the column name + + // Custom operators with 2 chars + if (strpos($column, '>=') != false + || strpos($column, '<=') != false + || strpos($column, '!=') != false + || strpos($column, '<>') != false + ) + { + $operator = ' '.substr(trim($column), -2).' '; + } + // Custom operators with 1 chars + elseif (strpos($column, '>') != false + || strpos($column, '<') != false + || strpos($column, '=') != false + ) + { + $operator = ' '.substr(trim($column), -1).' '; + } + else // default operator + { + $operator = ' = '; + } + + // If the column from the where clause is the same from the encrypted columns definition + if (trim($column) == $encryptedColumn + || ($operator != null && substr(trim($column), 0, strlen(trim($column)) - 2) == $encryptedColumn) + ) + { + // Then rename the column using the postgresql decryption function + $tmpWhere[ + sprintf( + self::CRYPT_WHERE_TEMPLATE, + $encryptedColumn, + $decryptionPassword, + $definition[self::CRYPT_CAST] + ).$operator + ] = $condition; + } + else // otherwise copy the column as it is + { + $tmpWhere[$column] = $condition; + } + } + + $where = $tmpWhere; // replace with the new where + } + // Otherwise if the where parameter is a valid string + elseif (!isEmptyString($where)) + { + // Find and replace all the occurrences of the provided encrypted columns + // with the postgresql decryption function + $where = str_replace( + $encryptedColumn, + sprintf( + self::CRYPT_WHERE_TEMPLATE, + $encryptedColumn, + $decryptionPassword, + $definition[self::CRYPT_CAST] + ), + $where + ); + } + } + } + } + } + } /** * Invalid ID @@ -895,7 +1145,7 @@ class DB_Model extends CI_Model * - A FALSE value on failure * - Otherwise an object filled with data on success */ - private function _toPhp($result) + private function _toPhp($result, $encryptedColumns = null) { $udfs = false; // if UDFs are inside the given result set $toPhp = $result; // if there is nothing to convert then return the result from DB @@ -911,7 +1161,9 @@ class DB_Model extends CI_Model // Looking for booleans, arrays and UDFs foreach ($this->executedQueryMetaData as $eqmd) { - // If array type, boolean type OR a UDF + // If array type, boolean type, numeric type + // Or bytea type + // Or UDF type if (strpos($eqmd->type, DB_Model::PGSQL_ARRAY_TYPE) !== false || $eqmd->type == DB_Model::PGSQL_BOOLEAN_TYPE || $eqmd->type == DB_Model::PGSQL_INT2_TYPE @@ -919,6 +1171,7 @@ class DB_Model extends CI_Model || $eqmd->type == DB_Model::PGSQL_INT8_TYPE || $eqmd->type == DB_Model::PGSQL_FLOAT4_TYPE || $eqmd->type == DB_Model::PGSQL_FLOAT8_TYPE + || $eqmd->type == DB_Model::PGSQL_BYTEA_TYPE || $this->udflib->isUDFColumn($eqmd->name, $eqmd->type)) { // If UDFs are inside this result set @@ -981,6 +1234,21 @@ class DB_Model extends CI_Model { $resultElement->{$toBeConverted->name} = $this->pgFloatPhp($resultElement->{$toBeConverted->name}); } + // Byte A type + elseif ($toBeConverted->type == DB_Model::PGSQL_BYTEA_TYPE) + { + // If encrypted columns are defined + // and if the byte a column is defined as encrypted column + if (!isEmptyArray($encryptedColumns) + && array_key_exists($toBeConverted->name, $encryptedColumns)) + { + // keep the column + } + else // otherwise remove the column from the result + { + unset($resultElement->{$toBeConverted->name}); + } + } } } } diff --git a/application/libraries/FilterCmptLib.php b/application/libraries/FilterCmptLib.php index 9d6dfa681..3e885b6e7 100644 --- a/application/libraries/FilterCmptLib.php +++ b/application/libraries/FilterCmptLib.php @@ -1,4 +1,5 @@ _filterKurzbz = null; $this->_query = null; $this->_requiredPermissions = null; + $this->_encryptedColumns = null; $this->_reloadDataset = true; // by default the dataset is NOT cached in session $this->_sessionTimeout = FilterCmptLib::SESSION_DEFAULT_TIMEOUT; @@ -727,6 +732,12 @@ class FilterCmptLib $this->_requiredPermissions = $filterCmptArray[FilterCmptLib::REQUIRED_PERMISSIONS]; } + // Retrieved the encrypted columns parameter if present + if (isset($filterCmptArray[FilterCmptLib::ENCRYPTED_COLUMNS])) + { + $this->_encryptedColumns = $filterCmptArray[FilterCmptLib::ENCRYPTED_COLUMNS]; + } + // Parameters needed to retrieve univocally a filter from DB if (isset($filterCmptArray[FilterCmptLib::APP])) { @@ -1129,7 +1140,7 @@ class FilterCmptLib $this->_ci->load->model('system/Filters_model', 'FiltersModel'); // Execute the given SQL statement suppressing error messages - $dataset = @$this->_ci->FiltersModel->execReadOnlyQuery($datasetQuery); + $dataset = @$this->_ci->FiltersModel->execReadOnlyQuery($datasetQuery, null, $this->_encryptedColumns); } return $dataset; diff --git a/application/libraries/FilterWidgetLib.php b/application/libraries/FilterWidgetLib.php index 19cdec848..72a749d60 100644 --- a/application/libraries/FilterWidgetLib.php +++ b/application/libraries/FilterWidgetLib.php @@ -1,5 +1,22 @@ . + */ + if (! defined('BASEPATH')) exit('No direct script access allowed'); /** @@ -16,6 +33,7 @@ class FilterWidgetLib const SESSION_SELECTED_FIELDS = 'selectedFields'; const SESSION_COLUMNS_ALIASES = 'columnsAliases'; const SESSION_ADDITIONAL_COLUMNS = 'additionalColumns'; + const SESSION_ENCRYPTED_COLUMNS = 'encryptedColumns'; const SESSION_CHECKBOXES = 'checkboxes'; const SESSION_FILTERS = 'filters'; const SESSION_METADATA = 'datasetMetadata'; @@ -56,6 +74,7 @@ class FilterWidgetLib const ADDITIONAL_COLUMNS = 'additionalColumns'; const CHECKBOXES = 'checkboxes'; const COLUMNS_ALIASES = 'columnsAliases'; + const ENCRYPTED_COLUMNS = 'encryptedColumns'; // ...to format/mark records of a dataset const FORMAT_ROW = 'formatRow'; @@ -367,7 +386,7 @@ class FilterWidgetLib /** * Retrieves the dataset from the DB */ - public function getDataset($datasetQuery) + public function getDataset($datasetQuery, $encryptedColumns) { $dataset = null; @@ -376,7 +395,7 @@ class FilterWidgetLib $this->_ci->load->model('system/Filters_model', 'FiltersModel'); // Execute the given SQL statement suppressing error messages - $dataset = @$this->_ci->FiltersModel->execReadOnlyQuery($datasetQuery); + $dataset = @$this->_ci->FiltersModel->execReadOnlyQuery($datasetQuery, null, $encryptedColumns); } return $dataset; diff --git a/application/libraries/TableWidgetLib.php b/application/libraries/TableWidgetLib.php index dc746b6d5..9637122a7 100644 --- a/application/libraries/TableWidgetLib.php +++ b/application/libraries/TableWidgetLib.php @@ -1,5 +1,22 @@ . + */ + if (! defined('BASEPATH')) exit('No direct script access allowed'); /** @@ -16,6 +33,7 @@ class TableWidgetLib const SESSION_FIELDS = 'fields'; const SESSION_COLUMNS_ALIASES = 'columnsAliases'; const SESSION_ADDITIONAL_COLUMNS = 'additionalColumns'; + const SESSION_ENCRYPTED_COLUMNS = 'encryptedColumns'; const SESSION_CHECKBOXES = 'checkboxes'; const SESSION_METADATA = 'datasetMetadata'; const SESSION_ROW_NUMBER = 'rowNumber'; @@ -49,6 +67,7 @@ class TableWidgetLib const ADDITIONAL_COLUMNS = 'additionalColumns'; const CHECKBOXES = 'checkboxes'; const COLUMNS_ALIASES = 'columnsAliases'; + const ENCRYPTED_COLUMNS = 'encryptedColumns'; // ...to format/mark records of a dataset const FORMAT_ROW = 'formatRow'; @@ -177,7 +196,7 @@ class TableWidgetLib /** * Retrieves the dataset from the DB */ - public function getDataset($datasetQuery) + public function getDataset($datasetQuery, $encryptedColumns) { $dataset = null; @@ -186,7 +205,7 @@ class TableWidgetLib $this->_ci->load->model('system/Filters_model', 'FiltersModel'); // Execute the given SQL statement suppressing error messages - $dataset = @$this->_ci->FiltersModel->execReadOnlyQuery($datasetQuery); + $dataset = @$this->_ci->FiltersModel->execReadOnlyQuery($datasetQuery, null, $encryptedColumns); } return $dataset; diff --git a/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php b/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php new file mode 100644 index 000000000..c7820f65a --- /dev/null +++ b/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php @@ -0,0 +1,144 @@ + $this->getDienstverhaeltnisId(), + 'vertragsart_kurzbz' => $this->getVertragsartKurzbz(), + 'unternehmen' => $this->getUnternehmen(), + 'gueltig_ab' => $this->getGueltigAb(), + 'gueltig_bis' => $this->getGueltigBis(), + ); + + $tmp = array_filter($tmp, function($v) { + return !is_null($v); + }); + + return (object) $tmp; + } + + + public function __toString() + { + $txt = <<getDienstverhaeltnisId()} + vertragsart_kurzbz: {$this->getVertragsartKurzbz()} + gueltig_ab: {$this->getGueltigAb()} + gueltig_bis: {$this->getGueltigBis()} + +EOTXT; + return $txt; + } + + + /** + * Get the value of dienstverhaeltnis_id + */ + public function getDienstverhaeltnisId() + { + return $this->dienstverhaeltnis_id; + } + + /** + * Set the value of dienstverhaeltnis_id + */ + public function setDienstverhaeltnisId($dienstverhaeltnis_id): self + { + $this->dienstverhaeltnis_id = $dienstverhaeltnis_id; + + return $this; + } + + /** + * Get the value of unternehmen + */ + public function getUnternehmen() + { + return $this->unternehmen; + } + + /** + * Set the value of unternehmen + */ + public function setUnternehmen($unternehmen): self + { + $this->unternehmen = $unternehmen; + + return $this; + } + + /** + * Get the value of vertragsart_kurzbz + */ + public function getVertragsartKurzbz() + { + return $this->vertragsart_kurzbz; + } + + /** + * Set the value of vertragsart_kurzbz + */ + public function setVertragsartKurzbz($vertragsart_kurzbz): self + { + $this->vertragsart_kurzbz = $vertragsart_kurzbz; + + return $this; + } + + /** + * Get the value of gueltig_ab + */ + public function getGueltigAb() + { + return $this->gueltig_ab; + } + + /** + * Set the value of gueltig_ab + */ + public function setGueltigAb($gueltig_ab): self + { + $this->gueltig_ab = $gueltig_ab; + + return $this; + } + + /** + * Get the value of gueltig_bis + */ + public function getGueltigBis() + { + return $this->gueltig_bis; + } + + /** + * Set the value of gueltig_bis + */ + public function setGueltigBis($gueltig_bis): self + { + $this->gueltig_bis = $gueltig_bis; + + return $this; + } +} \ No newline at end of file diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilFactory.php b/application/libraries/vertragsbestandteil/VertragsbestandteilFactory.php index b6ee488e7..a00417272 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilFactory.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilFactory.php @@ -23,9 +23,9 @@ class VertragsbestandteilFactory const VERTRAGSBESTANDTEIL_ZEITAUFZEICHNUNG = 'zeitaufzeichnung'; const VERTRAGSBESTANDTEIL_LEHRE = 'lehre'; - public static function getVertragsbestandteil($data) + public static function getVertragsbestandteil($data) { - $vertragsbestandteiltyp_kurzbz = isset($data->vertragsbestandteiltyp_kurzbz) + $vertragsbestandteiltyp_kurzbz = isset($data->vertragsbestandteiltyp_kurzbz) ? $data->vertragsbestandteiltyp_kurzbz : false; if( false === $vertragsbestandteiltyp_kurzbz ) { @@ -51,6 +51,36 @@ class VertragsbestandteilFactory $vertragsbestandteil->hydrateByStdClass($data); break; + case self::VERTRAGSBESTANDTEIL_KUENDIGUNGSFRIST: + $vertragsbestandteil = new VertragsbestandteilKuendigungsfrist(); + $vertragsbestandteil->hydrateByStdClass($data); + break; + + case self::VERTRAGSBESTANDTEIL_FREITEXT: + $vertragsbestandteil = new VertragsbestandteilFreitext(); + $vertragsbestandteil->hydrateByStdClass($data); + break; + + case self::VERTRAGSBESTANDTEIL_ZEITAUFZEICHNUNG: + $vertragsbestandteil = new VertragsbestandteilZeitaufzeichnung(); + $vertragsbestandteil->hydrateByStdClass($data); + break; + + case self::VERTRAGSBESTANDTEIL_BEFRISTUNG: + $vertragsbestandteil = new VertragsbestandteilBefristung(); + $vertragsbestandteil->hydrateByStdClass($data); + break; + + case self::VERTRAGSBESTANDTEIL_KARENZ: + $vertragsbestandteil = new VertragsbestandteilKarenz(); + $vertragsbestandteil->hydrateByStdClass($data); + break; + + case self::VERTRAGSBESTANDTEIL_URLAUBSANSPRUCH: + $vertragsbestandteil = new VertragsbestandteilUrlaubsanspruch(); + $vertragsbestandteil->hydrateByStdClass($data); + break; + default: throw new Exception('Unknown vertragsbestandteiltyp_kurzbz ' . $vertragsbestandteiltyp_kurzbz); @@ -59,7 +89,7 @@ class VertragsbestandteilFactory return $vertragsbestandteil; } - public static function getVertragsbestandteilDBModel($vertragsbestandteil_kurzbz) + public static function getVertragsbestandteilDBModel($vertragsbestandteil_kurzbz): \DB_model { $CI = get_instance(); @@ -73,19 +103,49 @@ class VertragsbestandteilFactory break; case self::VERTRAGSBESTANDTEIL_FUNKTION: - $CI->load->model('vertragsbestandteil/VertragsbestandteilFunktion_model', + $CI->load->model('vertragsbestandteil/VertragsbestandteilFunktion_model', 'VertragsbestandteilFunktion_model'); $vertragsbestandteildbmodel = $CI->VertragsbestandteilFunktion_model; break; case self::VERTRAGSBESTANDTEIL_GEHALT: - $CI->load->model('vertragsbestandteil/VertragsbestandteilGehalt_model', - 'VertragsbestandteilGehalt_model'); - $vertragsbestandteildbmodel = $CI->VertragsbestandteilGehalt_model; + $CI->load->model('vertragsbestandteil/Gehaltsbestandteil_model', + 'Gehaltsbestandteil_model'); + $vertragsbestandteildbmodel = $CI->Gehaltsbestandteil_model; break; - + + case self::VERTRAGSBESTANDTEIL_FREITEXT: + $CI->load->model('vertragsbestandteil/VertragsbestandteilFreitext_model', + 'VertragsbestandteilFreitext_model'); + $vertragsbestandteildbmodel = $CI->VertragsbestandteilFreitext_model; + break; + + case self::VERTRAGSBESTANDTEIL_KUENDIGUNGSFRIST: + $CI->load->model('vertragsbestandteil/VertragsbestandteilKuendigungsfrist_model', + 'VertragsbestandteilKuendigungsfrist_model'); + $vertragsbestandteildbmodel = $CI->VertragsbestandteilKuendigungsfrist_model; + break; + + case self::VERTRAGSBESTANDTEIL_KARENZ: + $CI->load->model('vertragsbestandteil/VertragsbestandteilKarenz_model', + 'VertragsbestandteilKarenz_model'); + $vertragsbestandteildbmodel = $CI->VertragsbestandteilKarenz_model; + break; + + case self::VERTRAGSBESTANDTEIL_ZEITAUFZEICHNUNG: + $CI->load->model('vertragsbestandteil/VertragsbestandteilZeitaufzeichnung_model', + 'VertragsbestandteilZeitaufzeichnung_model'); + $vertragsbestandteildbmodel = $CI->VertragsbestandteilZeitaufzeichnung_model; + break; + + case self::VERTRAGSBESTANDTEIL_URLAUBSANSPRUCH: + $CI->load->model('vertragsbestandteil/VertragsbestandteilUrlaubsanspruch_model', + 'VertragsbestandteilUrlaubsanspruch_model'); + $vertragsbestandteildbmodel = $CI->VertragsbestandteilUrlaubsanspruch_model; + break; + default: - throw new Exception('Unknown vertragsbestandteil_kurzbz ' + throw new Exception('Unknown vertragsbestandteil_kurzbz ' . $vertragsbestandteil_kurzbz); } diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php index 0be539a96..8e5daa520 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php @@ -15,6 +15,7 @@ use vertragsbestandteil\VertragsbestandteilFactory; class VertragsbestandteilLib { protected $CI; + /** @var Vertragsbestandteil_model */ protected $VertragsbestandteilModel; public function __construct() @@ -25,10 +26,29 @@ class VertragsbestandteilLib $this->VertragsbestandteilModel = $this->CI->VertragsbestandteilModel; } + public function handleGUIData($guidata, $employeeUID, $userUID) + { + $guiHandler = new GUIHandler($employeeUID, $userUID); + $ret = false; + try { + $ret = $guiHandler->handle($guidata, $employeeUID, $userUID); + } catch (Exception $ex) + { + log_message('debug', "Error handling json data from GUI. " . $ex->getMessage()); + } + + return $ret; + } + public function fetchVertragsbestandteile($dienstverhaeltnis_id, $stichtag=null) { return $this->VertragsbestandteilModel->getVertragsbestandteile($dienstverhaeltnis_id, $stichtag); } + + public function fetchVertragsbestandteil($vertragsbestandteil_id) + { + return $this->VertragsbestandteilModel->getVertragsbestandteil($vertragsbestandteil_id); + } public function storeVertragsbestandteil(Vertragsbestandteil $vertragsbestandteil) { @@ -57,7 +77,8 @@ class VertragsbestandteilLib } } - protected function insertVertragsbestandteil(Vertragsbestandteil $vertragsbestandteil) + protected function insertVertragsbestandteil(Vertragsbestandteil $vertragsbestandteil, + Vertragsbestandteil $vertragsbestandteil_secondary = null /* i.e. Gehaltsbestandteil connected to Stunden*/) { $ret = $this->VertragsbestandteilModel->insert($vertragsbestandteil->baseToStdClass()); if( hasData($ret) ) @@ -78,6 +99,34 @@ class VertragsbestandteilLib throw new Exception('error updating vertragsbestandteil ' . $vertragsbestandteil->getVertragsbestandteiltyp_kurzbz()); } + + if ($vertragsbestandteil_secondary == null) return; + + if (!is_array($vertragsbestandteil_secondary)) + { + $vertragsbestandteil_secondary = [$vertragsbestandteil_secondary]; + } + + foreach ($vertragsbestandteil_secondary as $vb) + { + $specialisedModel = VertragsbestandteilFactory::getVertragsbestandteilDBModel( + $vb->getVertragsbestandteiltyp_kurzbz()); + + if ($specialisedModel instanceof IEncryption) + { + $retspecial = $specialisedModel->insert($vb->toStdClass(), $specialisedModel->getEncryptedColumns()); + } else + { + $retspecial = $specialisedModel->insert($vb->toStdClass()); + } + + if(isError($retspecial) ) + { + throw new Exception('error updating secondary vertragsbestandteil ' + . $vb->getVertragsbestandteiltyp_kurzbz()); + } + } + } protected function updateVertragsbestandteil(Vertragsbestandteil $vertragsbestandteil) diff --git a/application/libraries/vertragsbestandteil/gui/AbstractBestandteil.php b/application/libraries/vertragsbestandteil/gui/AbstractBestandteil.php new file mode 100644 index 000000000..861dcf11a --- /dev/null +++ b/application/libraries/vertragsbestandteil/gui/AbstractBestandteil.php @@ -0,0 +1,86 @@ +getTypeString())) + { + throw new \Exception('wrong type string: "'.$decoded['type'].'" should be "'.$this->getTypeString().'"'); + } + } + + /** + * Get the value of type + */ + public function getType() + { + return $this->type; + } + + /** + * Set the value of type + */ + public function setType($type): self + { + $this->type = $type; + + return $this; + } + + /** + * Get the value of guioptions + */ + public function getGuioptions() + { + return $this->guioptions; + } + + /** + * Set the value of guioptions + */ + public function setGuioptions($guioptions): self + { + $this->guioptions = $guioptions; + + return $this; + } + + /** + * Get the value of data + */ + public function getData() + { + return $this->data; + } + + /** + * Set the value of data + */ + public function setData($data): self + { + $this->data = $data; + + return $this; + } +} \ No newline at end of file diff --git a/application/libraries/vertragsbestandteil/gui/AbstractGUIVertragsbestandteil.php b/application/libraries/vertragsbestandteil/gui/AbstractGUIVertragsbestandteil.php new file mode 100644 index 000000000..63906e42e --- /dev/null +++ b/application/libraries/vertragsbestandteil/gui/AbstractGUIVertragsbestandteil.php @@ -0,0 +1,143 @@ +vbsLib = new VertragsbestandteilLib(); + } + + abstract public function generateVertragsbestandteil($id); + + /** + * Get the value of uuid + */ + public function getUuid() + { + return $this->uuid; + } + + /** + * Set the value of uuid + */ + public function setUuid($uuid): self + { + $this->uuid = $uuid; + + return $this; + } + + + + /** + * Get the value of hasGBS + */ + public function getHasGBS() + { + return $this->hasGBS; + } + + /** + * Set the value of hasGBS + */ + public function setHasGBS($hasGBS): self + { + $this->hasGBS = $hasGBS; + + return $this; + } + + + + /** + * Get the value of gbs + */ + public function getGbs() + { + return $this->gbs; + } + + /** + * Set the value of gbs + */ + public function setGbs($gbs): self + { + $this->gbs = $gbs; + + return $this; + } +} \ No newline at end of file diff --git a/application/libraries/vertragsbestandteil/gui/FormData.php b/application/libraries/vertragsbestandteil/gui/FormData.php new file mode 100644 index 000000000..9c24e3f99 --- /dev/null +++ b/application/libraries/vertragsbestandteil/gui/FormData.php @@ -0,0 +1,105 @@ +checkType($decoded); + // preserve gui data + $this->mapChildren($decoded); + // data contains DV + $this->mapData($decoded); + // vbs array + $this->mapVbs($decoded); + } + + public function generateJSON() + { + $json = json_encode([ + "children" => $this->children, + "data" => $this->generateDvJSON(), + "vbs" => $this->generateVbsJSON() + ]); + return $json; + } + + private function mapChildren(&$decoded) + { + $decodedData = null; + if (!$this->getJSONData($decodedData, $decoded, 'children')) + { + throw new \Exception('missing children'); + } + $this->getJSONData($this->data['children'], $decodedData, 'children'); + } + + private function mapData(&$decoded) + { + $decodedData = null; + if (!$this->getJSONData($decodedData, $decoded, 'data')) + { + throw new \Exception('missing data'); + } + + $this->getJSONDataInt($this->data['dienstverhaeltnisid'], $decodedData, 'dienstverhaeltnisid'); + $this->getJSONData($this->data['unternehmen'], $decodedData, 'unternehmen'); + $this->getJSONData($this->data['vertragsart_kurzbz'], $decodedData, 'vertragsart_kurzbz'); + $this->getJSONData($this->data['gueltigkeit'], $decodedData, 'gueltigkeit'); + } + + private function generateDvJSON() + { + return json_encode($this->data); + } + + + private function mapVbs(&$decoded) + { + if (!$this->getJSONData($this->vbs, $decoded, 'vbs')) + { + throw new \Exception('missing vbs'); + } + //$this->getJSONData($this->vbs, $decodedData, 'vbs'); + } + + private function generateVbsJSON() + { + return json_encode($this->vbs); + } + + /** + * Get the value of children + */ + public function getChildren() + { + return $this->children; + } + + + /** + * Get the value of vbs + */ + public function getVbs() + { + return $this->vbs; + } + + +} \ No newline at end of file diff --git a/application/libraries/vertragsbestandteil/gui/GUIGehaltsbestandteil.php b/application/libraries/vertragsbestandteil/gui/GUIGehaltsbestandteil.php new file mode 100644 index 000000000..713ee64a0 --- /dev/null +++ b/application/libraries/vertragsbestandteil/gui/GUIGehaltsbestandteil.php @@ -0,0 +1,89 @@ +type = GUIVertragsbestandteilStunden::TYPE_STRING; + $this-> guioptions = ["id" => null, "infos" => [], "errors" => [], "removeable" => true]; + $this->data = [ "gehaltstyp" => "", + "betrag" => "", + "gueltigkeit" => [ + "guioptions" => ["sharedstatemode" => "reflect"], + "data" => ["gueltig_ab" => "", "gueltig_bis" => ""] + ], + "valorisierung" => true + ]; + } + + public function getTypeString(): string + { + return GUIGehaltsbestandteil::TYPE_STRING; + } + + public function mapJSON(&$decoded) + { + //$decoded = json_decode($jsondata); + $this->checkType($decoded); + $this->mapGUIOptions($decoded); + $this->mapData($decoded); + } + + private function mapGUIOptions(&$decoded) + { + $decodedGUIOptions = null; + if (!$this->getJSONData($decodedGUIOptions, $decoded, 'guioptions')) + { + throw new \Exception('missing guioptions'); + } + $this->getJSONData($this->guioptions, $decodedGUIOptions, 'id'); + $this->getJSONData($this->guioptions, $decodedGUIOptions, 'infos'); + $this->getJSONData($this->guioptions, $decodedGUIOptions, 'errors'); + $this->getJSONData($this->guioptions, $decodedGUIOptions, 'removable'); + } + + private function mapData(&$decoded) + { + $decodedData = null; + if (!$this->getJSONData($decodedData, $decoded, 'data')) + { + throw new \Exception('missing data'); + } + $this->getJSONData($this->data['id'], $decodedData, 'id'); + $this->getJSONData($this->data['gehaltstyp'], $decodedData, 'gehaltstyp'); + $this->getJSONDataInt($this->data['betrag'], $decodedData, 'betrag'); + $gueltigkeit = new GUIGueltigkeit(); + $gueltigkeit->mapJSON($decodedData['gueltigkeit']); + $this->data['gueltigkeit'] = $gueltigkeit; + $this->getJSONData($this->data['valorisierung'], $decodedData, 'valorisierung'); + } + +} \ No newline at end of file diff --git a/application/libraries/vertragsbestandteil/gui/GUIGueltigkeit.php b/application/libraries/vertragsbestandteil/gui/GUIGueltigkeit.php new file mode 100644 index 000000000..c1acec672 --- /dev/null +++ b/application/libraries/vertragsbestandteil/gui/GUIGueltigkeit.php @@ -0,0 +1,76 @@ +mapGuioptions($decoded); + $this->mapData($decoded); + } + + private function mapGuioptions(&$decoded) + { + $decodedData = null; + if (!$this->getJSONData($decodedData, $decoded, 'guioptions')) + { + throw new \Exception('missing guioptions'); + } + $this->getJSONData($this->guioptions, $decodedData, 'guioptions'); + } + + private function mapData(&$decoded) + { + $decodedData = null; + if (!$this->getJSONData($decodedData, $decoded, 'data')) + { + throw new \Exception('missing data'); + } + $this->getJSONData($this->data['gueltig_ab'], $decodedData, 'gueltig_ab'); + $this->getJSONData($this->data['gueltig_bis'], $decodedData, 'gueltig_bis'); + + } + + /** + * Get the value of guioptions + */ + public function getGuioptions() + { + return $this->guioptions; + } + + /** + * Get the value of data + */ + public function getData() + { + return $this->data; + } + + public function jsonSerialize() { + return ["guioptions" => $this->guioptions, + "data" => $this->data]; + } +} \ No newline at end of file diff --git a/application/libraries/vertragsbestandteil/gui/GUIHandler.php b/application/libraries/vertragsbestandteil/gui/GUIHandler.php new file mode 100644 index 000000000..7a5695b44 --- /dev/null +++ b/application/libraries/vertragsbestandteil/gui/GUIHandler.php @@ -0,0 +1,167 @@ +employeeUID = $employeeUID; + $this->userUID = $userUID; + $this->CI = get_instance(); + $this->CI->load->model('vertragsbestandteil/Dienstverhaeltnis_model', + 'Dienstverhaeltnis_model'); + + + } + + /** + * main entry (called from VetragsbestandteilLib) + * @param string $guidata JSON submitted by editor + * @param string $employeeUID uid of the employee + * @param string $userUID uid of the user currently editing the employee data + * @return string JSON for GUI client + */ + public function handle($guidata) + { + $decoded = json_decode($guidata, true); + $formDataMapper = new FormData(); + $formDataMapper->mapJSON($decoded); + + // DV + $dvData = $formDataMapper->getData(); + $this->handleDV($dvData); + + // VBS + $vbsList = $formDataMapper->getVbs(); + + foreach ($vbsList as $vbsID => $vbs) { + $this->handleVBS($dvData['dienstverhaeltnis_id'] ,$vbs); + } + + return $formDataMapper->generateJSON(); + } + + /** + * dienstverhaeltnisid + * unternehmen + * vertragsart_kurzbz + * gueltigkeit + */ + private function handleDV(&$dv) + { + $dienstverhaeltnisid = $dv['dienstverhaeltnisid']; + + if (isset($dienstverhaeltnisid) && intval($dienstverhaeltnisid > 0)) + { + // DV exists + $ret = $this->updateDV($dv); + } else { + // DV is new + $ret = $this->insertDV($dv); + // write back new id + $dv['dienstverhaeltnisid'] = $ret['dienstverhaeltnis_id']; + } + + } + + private function handleVBS($vbs) + { + $vbsMapper = GUIHandlerFactory::getGUIHandler($vbs['type']); + $vbsMapper->mapJSON($vbs); + $vbsData = $vbsMapper->getData(); + + // merge GUI-Data with DB-Data + $vbsInstance = $vbsMapper->generateVertragsbestandteil($vbsData['id']); + + // TODO Validate? + + // store + $this->VertragsbestandteilLib->store($vbsInstance); + + // GBS + /* + foreach ($vbsMapper->getGbs() as $gbs) + { + $gbsData = $gbs->getData(); + $this->handleGBS($gbsData); + }*/ + } + + + // GBS without connection to VBS + private static function handleGBS($gbs) + { + // TODO + } + + + // ------------------------------------ + // DV does not have a dedicated handler + + private function insertDV($dvJSON) + { + $now = new DateTime(); + $dvJSON['insertvon'] = $this->userUID; + $dvJSON['insertamum'] = $now->format(DateTime::ATOM); + + $result = $this->CI->Dienstverhaeltnis_model->insert($dvJSON); + + if (isError($result)) + { + throw Exception($result->msg); + } + + $record = $this->CI->Dienstverhaeltnis_model->load($result->retval); + + return $record; + } + + private function updateDV($dvJSON) + { + $now = new DateTime(); + $dvJSON['updatevon'] = getAuthUID(); + $dvJSON['updateamum'] = $now->format(DateTime::ATOM); + + unset($dvJSON['insertamum']); + unset($dvJSON['insertvon']); + + + $result = $this->CI->Dienstverhaeltnis_model->update($dvJSON['kontakt_id'], $dvJSON); + + if (isError($result)) + { + return error($result->msg, EXIT_ERROR); + } + + $record = $this->CI->Dienstverhaeltnis_model->load($result->retval); + + return $record; + } + + private function deleteDV($dv_id) + { + $result = $this->CI->Dienstverhaeltnis_model->delete($dv_id); + + if (isError($result)) + { + return error($result->msg, EXIT_ERROR); + } + + return success($dv_id); + } + +} \ No newline at end of file diff --git a/application/libraries/vertragsbestandteil/gui/GUIHandlerFactory.php b/application/libraries/vertragsbestandteil/gui/GUIHandlerFactory.php new file mode 100644 index 000000000..ff1a7581d --- /dev/null +++ b/application/libraries/vertragsbestandteil/gui/GUIHandlerFactory.php @@ -0,0 +1,30 @@ +type = GUIVertragsbestandteilFunktion::TYPE_STRING; + $this->hasGBS = true; + $this-> guioptions = ["id" => null, "infos" => [], "errors" => [], "removeable" => false]; + $this->data = ["funktion" => "Leitung", + "orget" => "", + "gueltigkeit" => [ + "guioptions" => ["sharedstatemode" => "reflect"], + "data" => ["gueltig_ab" => "", "gueltig_bis" => ""] + ] + ]; + $this->gbs = []; + } + + public function getTypeString(): string + { + return GUIVertragsbestandteilFunktion::TYPE_STRING; + } + + /** + * parse JSON into object + * @param string $jsondata + */ + public function mapJSON(&$decoded) + { + $this->checkType($decoded); + $this->mapGUIOptions($decoded); + $this->mapData($decoded); + $this->mapGBS($decoded); + } + + /** + * ["id" => null, + * "infos" => [], + * "errors" => [], + * "removeable" => true + * ] + * @param mixed $decoded decoded JSON data (use associative array) + */ + private function mapGUIOptions(&$decoded) + { + $decodedGUIOptions = null; + if (!$this->getJSONData($decodedGUIOptions, $decoded, 'guioptions')) + { + throw new \Exception('missing guioptions'); + } + $this->getJSONData($this->guioptions, $decodedGUIOptions, 'id'); + $this->getJSONData($this->guioptions, $decodedGUIOptions, 'infos'); + $this->getJSONData($this->guioptions, $decodedGUIOptions, 'errors'); + $this->getJSONDataBool($this->guioptions, $decodedGUIOptions, 'removable'); + } + + /** + * { + * "funktion": "Leitung", + * "orget": "sdf", + * "gueltigkeit": { + * "guioptions": { + * "sharedstatemode": "reflect" + * }, + * "data": { + * "gueltig_ab": "", + * "gueltig_bis": "" + * } + * } + * } + */ + private function mapData(&$decoded) + { + $decodedData = null; + if (!$this->getJSONData($decodedData, $decoded, 'data')) + { + throw new \Exception('missing data'); + } + $this->getJSONData($this->data['funktion'], $decodedData, 'funktion'); + $this->getJSONData($this->data['orget'], $decodedData, 'orget'); + $gueltigkeit = new GUIGueltigkeit(); + $gueltigkeit->mapJSON($decodedData['gueltigkeit']); + $this->data['gueltigkeit'] = $gueltigkeit; + } + + private function mapGBS(&$decoded) + { + //echo "gbs: ";var_dump($decoded); + $decodedGbsList = []; + if (!$this->getJSONData($decodedGbsList, $decoded, 'gbs')) + { + throw new \Exception('missing gbs'); + } + $guiGBS = null; + foreach ($decodedGbsList as $decodedGbs) { + $guiGBS = new GUIGehaltsbestandteil(); + $guiGBS->mapJSON($decodedGbs); + $this->gbs[] = $guiGBS; + } + } + + + public function generateVertragsbestandteil($id) { + // TODO + } + + public function jsonSerialize() { + return [ + "type" => $this->type, + "guioptions" => $this->guioptions, + "data" => $this->data, + "gbs" => $this->gbs]; + } + +} \ No newline at end of file diff --git a/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilKuendigungsfrist.php b/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilKuendigungsfrist.php new file mode 100644 index 000000000..8d706ef26 --- /dev/null +++ b/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilKuendigungsfrist.php @@ -0,0 +1,118 @@ +type = GUIVertragsbestandteilKuendigungsfrist::TYPE_STRING; + $this->hasGBS = false; + $this-> guioptions = ["id" => null, "infos" => [], "errors" => [], "removeable" => true]; + $this->data = ["arbeitnehmer_frist" => "", + "arbeitgeber_frist" => "", + "gueltigkeit" => [ + "guioptions" => ["sharedstatemode" => "reflect"], + "data" => ["gueltig_ab" => "", "gueltig_bis" => ""] + ] + ]; + } + + public function getTypeString(): string + { + return GUIVertragsbestandteilKuendigungsfrist::TYPE_STRING; + } + + /** + * parse JSON into object + * @param string $jsondata + */ + public function mapJSON(&$decoded) + { + $this->checkType($decoded); + $this->mapGUIOptions($decoded); + $this->mapData($decoded); + } + + /** + * ["id" => null, + * "infos" => [], + * "errors" => [], + * "removeable" => true + * ] + * @param mixed $decoded decoded JSON data (use associative array) + */ + private function mapGUIOptions(&$decoded) + { + $decodedGUIOptions = null; + if (!$this->getJSONData($decodedGUIOptions, $decoded, 'guioptions')) + { + throw new \Exception('missing guioptions'); + } + $this->getJSONData($this->guioptions, $decodedGUIOptions, 'id'); + $this->getJSONData($this->guioptions, $decodedGUIOptions, 'infos'); + $this->getJSONData($this->guioptions, $decodedGUIOptions, 'errors'); + $this->getJSONDataBool($this->guioptions, $decodedGUIOptions, 'removable'); + } + + /** + */ + private function mapData(&$decoded) + { + $decodedData = null; + if (!$this->getJSONData($decodedData, $decoded, 'data')) + { + throw new \Exception('missing data'); + } + $this->getJSONDataInt($this->data['arbeitnehmer_frist'], $decodedData, 'arbeitnehmer_frist'); + $this->getJSONDataInt($this->data['arbeitgeber_frist'], $decodedData, 'arbeitgeber_frist'); + $this->getJSONData($this->data['gueltigkeit'], $decodedData, 'gueltigkeit'); + } + + private function mapGBS() + { + $decodedGbsList = []; + if (!$this->getJSONData($decodedGbsList, $decoded, 'gbs')) + { + throw new \Exception('missing gbs'); + } + $guiGBS = null; + foreach ($decodedGbsList as $decodedGbs) { + $guiGBS = new GUIGehaltsbestandteil(); + $guiGBS->mapJSON($decodedGbs); + } + } + + public function generateVertragsbestandteil($id) { + // TODO + } + + public function jsonSerialize() { + return [ + "type" => $this->type, + "guioptions" => $this->guioptions, + "data" => $this->data]; + } + +} \ No newline at end of file diff --git a/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilStunden.php b/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilStunden.php new file mode 100644 index 000000000..60accea05 --- /dev/null +++ b/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilStunden.php @@ -0,0 +1,131 @@ +type = GUIVertragsbestandteilStunden::TYPE_STRING; + $this->hasGBS = true; + $this-> guioptions = ["id" => null, "infos" => [], "errors" => [], "removeable" => true]; + $this->data = ["stunden" => "", + "gueltigkeit" => [ + "guioptions" => ["sharedstatemode" => "reflect"], + "data" => ["gueltig_ab" => "", "gueltig_bis" => ""] + ] + ]; + $this->gbs = []; + } + + public function getTypeString(): string + { + return GUIVertragsbestandteilStunden::TYPE_STRING; + } + + /** + * parse JSON into object + * @param string $jsondata + */ + public function mapJSON(&$decoded) + { + $this->checkType($decoded); + $this->mapGUIOptions($decoded); + $this->mapData($decoded); + $this->mapGBS($decoded); + } + + /** + * ["id" => null, + * "infos" => [], + * "errors" => [], + * "removeable" => true + * ] + * @param mixed $decoded decoded JSON data (use associative array) + */ + private function mapGUIOptions(&$decoded) + { + $decodedGUIOptions = null; + if (!$this->getJSONData($decodedGUIOptions, $decoded, 'guioptions')) + { + throw new \Exception('missing guioptions'); + } + $this->getJSONData($this->guioptions, $decodedGUIOptions, 'id'); + $this->getJSONData($this->guioptions, $decodedGUIOptions, 'infos'); + $this->getJSONData($this->guioptions, $decodedGUIOptions, 'errors'); + $this->getJSONDataBool($this->guioptions, $decodedGUIOptions, 'removable'); + } + + /** + * { + * "stunden": "38,5", + * "gueltigkeit": { + * "guioptions": { + * "sharedstatemode": "reflect" + * }, + * "data": { + * "gueltig_ab": "1.1.2011", + * "gueltig_bis": "" + * } + * } + */ + private function mapData(&$decoded) + { + $decodedData = null; + if (!$this->getJSONData($decodedData, $decoded, 'data')) + { + throw new \Exception('missing data'); + } + $this->getJSONDataFloat($this->data['stunden'], $decodedData, 'stunden'); + $gueltigkeit = new GUIGueltigkeit(); + $gueltigkeit->mapJSON($decodedData['gueltigkeit']); + $this->data['gueltigkeit'] = $gueltigkeit; + } + + private function mapGBS(&$decoded) + { + $decodedGbsList = []; + if (!$this->getJSONData($decodedGbsList, $decoded, 'gbs')) + { + throw new \Exception('missing gbs'); + } + $guiGBS = null; + foreach ($decodedGbsList as $decodedGbs) { + $guiGBS = new GUIGehaltsbestandteil(); + $guiGBS->mapJSON($decodedGbs); + $this->gbs[] = $guiGBS; + } + } + + public function generateVertragsbestandteil($id) + { + $vbs = null; + if (isset($vbsData['id']) && $vbsData['id'] > 0) + { + // load VBS + $vbs = $this->vbsLib->fetchVertragsbestandteil($vbsData['id']); + } else { + $vbs = new vertragsbestandteil\VertragsbestandteilStunden(); + } + // merge + $vbs->setWochenstunden($this->data['stunden']); + $vbs->setVon($this->data['gueltigkeit']->getData()['gueltig_ab']); + $vbs->setBis($this->data['gueltigkeit']->getData()['gueltig_bis']); + return $vbs; + } + + public function jsonSerialize() { + return [ + "type" => $this->type, + "guioptions" => $this->guioptions, + "data" => $this->data, + "gbs" => $this->gbs]; + } + +} \ No newline at end of file diff --git a/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilZeitaufzeichnung.php b/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilZeitaufzeichnung.php new file mode 100644 index 000000000..dacee544c --- /dev/null +++ b/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilZeitaufzeichnung.php @@ -0,0 +1,103 @@ +type = GUIVertragsbestandteilZeitaufzeichnung::TYPE_STRING; + $this->hasGBS = false; + $this-> guioptions = ["id" => null, "infos" => [], "errors" => [], "removeable" => true]; + $this->data = null; + } + + public function getTypeString(): string + { + return GUIVertragsbestandteilZeitaufzeichnung::TYPE_STRING; + } + + /** + * parse JSON into object + * @param string $jsondata + */ + public function mapJSON(&$decoded) + { + $this->checkType($decoded); + $this->mapGUIOptions($decoded); + $this->mapData($decoded); + } + + /** + * ["id" => null, + * "infos" => [], + * "errors" => [], + * "removeable" => true + * ] + * @param mixed $decoded decoded JSON data (use associative array) + */ + private function mapGUIOptions(&$decoded) + { + $decodedGUIOptions = null; + if (!$this->getJSONData($decodedGUIOptions, $decoded, 'guioptions')) + { + throw new \Exception('missing guioptions'); + } + $this->getJSONData($this->guioptions, $decodedGUIOptions, 'id'); + $this->getJSONData($this->guioptions, $decodedGUIOptions, 'infos'); + $this->getJSONData($this->guioptions, $decodedGUIOptions, 'errors'); + $this->getJSONDataBool($this->guioptions, $decodedGUIOptions, 'removable'); + } + + private function mapData(&$decoded) + { + $decodedData = null; + if (!$this->getJSONData($decodedData, $decoded, 'data')) + { + throw new \Exception('missing data'); + } + $this->getJSONDataBool($this->data['zeitaufzeichnung'], $decodedData, 'zeitaufzeichnung'); + $this->getJSONDataBool($this->data['azgrelevant'], $decodedData, 'azgrelevant'); + $this->getJSONDataBool($this->data['homeoffice'], $decodedData, 'homeoffice'); + $gueltigkeit = new GUIGueltigkeit(); + $gueltigkeit->mapJSON($decodedData['gueltigkeit']); + $this->data['gueltigkeit'] = $gueltigkeit; + } + + public function generateVertragsbestandteil($id) { + // TODO + } + + public function jsonSerialize() { + return [ + "type" => $this->type, + "guioptions" => $this->guioptions, + "data" => $this->data]; + } +} \ No newline at end of file diff --git a/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilZusatzvereinbarung.php b/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilZusatzvereinbarung.php new file mode 100644 index 000000000..606f57b0e --- /dev/null +++ b/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilZusatzvereinbarung.php @@ -0,0 +1,139 @@ +type = GUIVertragsbestandteilZusatzvereinbarung::TYPE_STRING; + $this->hasGBS = true; + $this-> guioptions = ["id" => null, "infos" => [], "errors" => [], "removeable" => true]; + $this->data = null; + $this->gbs = []; + } + + public function getTypeString(): string + { + return GUIVertragsbestandteilZusatzvereinbarung::TYPE_STRING; + } + + /** + * parse JSON into object + * @param string $jsondata + */ + public function mapJSON(&$decoded) + { + $this->checkType($decoded); + $this->mapGUIOptions($decoded); + $this->mapData($decoded); + $this->mapGBS($decoded); + } + + /** + * ["id" => null, + * "infos" => [], + * "errors" => [], + * "removeable" => true + * ] + * @param mixed $decoded decoded JSON data (use associative array) + */ + private function mapGUIOptions(&$decoded) + { + $decodedGUIOptions = null; + if (!$this->getJSONData($decodedGUIOptions, $decoded, 'guioptions')) + { + throw new \Exception('missing guioptions'); + } + $this->getJSONData($this->guioptions, $decodedGUIOptions, 'id'); + $this->getJSONData($this->guioptions, $decodedGUIOptions, 'infos'); + $this->getJSONData($this->guioptions, $decodedGUIOptions, 'errors'); + $this->getJSONDataBool($this->guioptions, $decodedGUIOptions, 'removable'); + } + + /** + * { + * "freitexttyp": "allin", + * "titel": "Lorem ipsum ", + * "freitext": "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. \nAt vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. ", + * "kuendigungsrelevant": "", + * "gueltigkeit": { + * "guioptions": { + * "sharedstatemode": "reflect" + * }, + * "data": { + * "gueltig_ab": "1.1.2010", + * "gueltig_bis": "" + * } + */ + private function mapData(&$decoded) + { + $decodedData = null; + if (!$this->getJSONData($decodedData, $decoded, 'data')) + { + throw new \Exception('missing data'); + } + $this->getJSONDataString($this->data['freitexttyp'], $decodedData, 'freitexttyp'); + $this->getJSONDataString($this->data['titel'], $decodedData, 'titel'); + $this->getJSONDataString($this->data['freitext'], $decodedData, 'freitext'); + $gueltigkeit = new GUIGueltigkeit(); + $gueltigkeit->mapJSON($decodedData['gueltigkeit']); + $this->data['gueltigkeit'] = $gueltigkeit; + } + + private function mapGBS(&$decoded) + { + $decodedGbsList = []; + if (!$this->getJSONData($decodedGbsList, $decoded, 'gbs')) + { + throw new \Exception('missing gbs'); + } + $guiGBS = null; + foreach ($decodedGbsList as $decodedGbs) { + $guiGBS = new GUIGehaltsbestandteil(); + $guiGBS->mapJSON($decodedGbs); + $this->gbs[] = $guiGBS; + } + } + + public function generateVertragsbestandteil($id) { + // TODO + } + + public function jsonSerialize() { + return [ + "type" => $this->type, + "guioptions" => $this->guioptions, + "data" => $this->data, + "gbs" => $this->gbs]; + } + +} \ No newline at end of file diff --git a/application/libraries/vertragsbestandteil/gui/JSONData.php b/application/libraries/vertragsbestandteil/gui/JSONData.php new file mode 100644 index 000000000..77ea19ce4 --- /dev/null +++ b/application/libraries/vertragsbestandteil/gui/JSONData.php @@ -0,0 +1,53 @@ +. + */ + class Person_model extends DB_Model { /** @@ -8,6 +25,7 @@ class Person_model extends DB_Model public function __construct() { parent::__construct(); + $this->dbTable = 'public.tbl_person'; $this->pk = 'person_id'; @@ -336,3 +354,4 @@ class Person_model extends DB_Model return $this->execQuery($qry, array($person_id, $person_id, $person_id)); } } + diff --git a/application/models/system/PersonLog_model.php b/application/models/system/PersonLog_model.php index 7a66958b8..88b50487a 100644 --- a/application/models/system/PersonLog_model.php +++ b/application/models/system/PersonLog_model.php @@ -1,5 +1,22 @@ . + */ + class PersonLog_model extends DB_Model { /** @@ -17,7 +34,7 @@ class PersonLog_model extends DB_Model * @param array $data Data of Log Entry to save. * @return success object if true */ - public function insert($data) + public function insert($data, $encryptedColumns = null) { $result = $this->db->insert($this->dbTable, $data); if ($result) diff --git a/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php b/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php index 7b94cc56c..fce950012 100644 --- a/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php +++ b/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php @@ -1,8 +1,8 @@ dbTable = 'hr.tbl_gehaltsbestandteil'; $this->pk = 'gehaltsbestandteil_id'; - $encryptionkey_filename = APPPATH.'config/extensions/FHC-Core-Personalverwaltung/keys.config.inc.php'; - require($encryptionkey_filename); } + public function getEncryptedColumns(): array + { + return ['grundbetrag' => 'ENCRYPTIONKEY', 'betrag_valorisiert' => 'ENCRYPTIONKEY']; + } + public function getCurrentGBTByDV($dienstverhaeltnis_id) { - $result = null; - $qry = " SELECT gehaltsbestandteil_id, @@ -28,8 +29,8 @@ class Gehaltsbestandteil_model extends DB_Model gehaltstyp_kurzbz, valorisierungssperre, valorisieren, - pgp_sym_decrypt(grundbetrag,?) grundbetrag, - pgp_sym_decrypt(betrag_valorisiert,?) betrag_valorisiert, + grundbetrag, + betrag_valorisiert, gt.bezeichnung as gehaltstyp_bezeichnung FROM hr.tbl_gehaltsbestandteil gbt JOIN hr.tbl_gehaltstyp gt using(gehaltstyp_kurzbz) WHERE gbt.dienstverhaeltnis_id=? AND @@ -37,7 +38,7 @@ class Gehaltsbestandteil_model extends DB_Model ORDER BY gt.sort "; - return $this->execQuery($qry, array(ENCRYPTIONKEY, ENCRYPTIONKEY, $dienstverhaeltnis_id)); + return $this->execQuery($qry, array($dienstverhaeltnis_id), $this->getEncryptedColumns()); } diff --git a/application/models/vertragsbestandteil/IEncryption.php b/application/models/vertragsbestandteil/IEncryption.php new file mode 100644 index 000000000..ebfb437ea --- /dev/null +++ b/application/models/vertragsbestandteil/IEncryption.php @@ -0,0 +1,7 @@ +dbTable = 'hr.tbl_vertragsbestandteil_kuendigungsfrist'; + $this->pk = 'vertragsbestandteil_id'; + } +} diff --git a/application/models/vertragsbestandteil/Vertragsbestandteil_model.php b/application/models/vertragsbestandteil/Vertragsbestandteil_model.php index b87b3ea10..3dd6bf6cb 100644 --- a/application/models/vertragsbestandteil/Vertragsbestandteil_model.php +++ b/application/models/vertragsbestandteil/Vertragsbestandteil_model.php @@ -53,7 +53,7 @@ class Vertragsbestandteil_model extends DB_Model EOSQL; // echo $sql . "\n\n"; - $query = $this->db->query($sql); + $query = $this->db->query($sql); // TODO add decryption $vertragsbestandteile = array(); foreach( $query->result() as $row ) { @@ -69,4 +69,48 @@ EOSQL; return $vertragsbestandteile; } + + + public function getVertragsbestandteil($id) + { + + $sql = <<escape($id)} + ; +EOSQL; + + // echo $sql . "\n\n"; + $query = $this->db->query($sql); + + $vertragsbestandteil = array(); + try + { + $vertragsbestandteile = VertragsbestandteilFactory::getVertragsbestandteil($row); // TODO add decryption + } + catch (Exception $ex) + { + echo $ex->getMessage() . "\n"; + } + + return $vertragsbestandteil; + + } } diff --git a/application/widgets/FilterWidget.php b/application/widgets/FilterWidget.php index 1cef91c15..4c40e434a 100644 --- a/application/widgets/FilterWidget.php +++ b/application/widgets/FilterWidget.php @@ -1,5 +1,22 @@ . + */ + /** * To filter data using a SQL statement */ @@ -59,6 +76,8 @@ class FilterWidget extends Widget private $_sessionTimeout; // session expiring time + private $_encryptedColumns; // contains info about encrypted columns + private static $_FilterWidgetInstance; // static property that contains the instance of itself /** @@ -195,6 +214,7 @@ class FilterWidget extends Widget $this->_formatRow = null; $this->_markRow = null; $this->_checkboxes = null; + $this->_encryptedColumns = null; $this->_hideOptions = null; $this->_hideSelectFields = null; $this->_hideSelectFilters = null; @@ -252,6 +272,14 @@ class FilterWidget extends Widget $this->_additionalColumns = $args[FilterWidgetLib::ADDITIONAL_COLUMNS]; } + // Parameter is used to define the ecrypted columns + if (isset($args[FilterWidgetLib::ENCRYPTED_COLUMNS]) + && is_array($args[FilterWidgetLib::ENCRYPTED_COLUMNS]) + && count($args[FilterWidgetLib::ENCRYPTED_COLUMNS]) > 0) + { + $this->_encryptedColumns = $args[FilterWidgetLib::ENCRYPTED_COLUMNS]; + } + // Parameter is used to add use aliases for the columns fo the dataset if (isset($args[FilterWidgetLib::COLUMNS_ALIASES]) && is_array($args[FilterWidgetLib::COLUMNS_ALIASES]) @@ -441,7 +469,7 @@ class FilterWidget extends Widget ); // Then retrieve dataset from DB - $dataset = $this->filterwidgetlib->getDataset($datasetQuery); + $dataset = $this->filterwidgetlib->getDataset($datasetQuery, $this->_encryptedColumns); // Save changes into session if data are valid if (!isError($dataset)) @@ -476,7 +504,7 @@ class FilterWidget extends Widget $datasetQuery = $this->filterwidgetlib->generateDatasetQuery($this->_query, $parsedFilterJson->filters); // Then retrieve dataset from DB - $dataset = $this->filterwidgetlib->getDataset($datasetQuery); + $dataset = $this->filterwidgetlib->getDataset($datasetQuery, $this->_encryptedColumns); // Try to load the name of the filter using the PhrasesLib $filterName = $this->filterwidgetlib->getFilterName($parsedFilterJson); @@ -497,6 +525,7 @@ class FilterWidget extends Widget FilterWidgetLib::SESSION_SELECTED_FIELDS => $this->_getColumnsNames($parsedFilterJson->columns), // all the selected fields FilterWidgetLib::SESSION_COLUMNS_ALIASES => $this->_columnsAliases, // all the fields aliases FilterWidgetLib::SESSION_ADDITIONAL_COLUMNS => $this->_additionalColumns, // additional columns + FilterWidgetLib::SESSION_ENCRYPTED_COLUMNS => $this->_encryptedColumns, // encrypted columns FilterWidgetLib::SESSION_CHECKBOXES => $this->_checkboxes, // the name of the field used to build the checkboxes column FilterWidgetLib::SESSION_FILTERS => $parsedFilterJson->filters, // all the filters used to filter the dataset FilterWidgetLib::SESSION_METADATA => $this->FiltersModel->getExecutedQueryMetaData(), // the metadata of the dataset diff --git a/application/widgets/TableWidget.php b/application/widgets/TableWidget.php index 5a000601f..a1a15d508 100644 --- a/application/widgets/TableWidget.php +++ b/application/widgets/TableWidget.php @@ -1,5 +1,22 @@ . + */ + /** * To display a table that shows data retriev by a SQL statement */ @@ -40,6 +57,8 @@ class TableWidget extends Widget private $_sessionTimeout; // session expiring time + private $_encryptedColumns; // contains info about encrypted columns + private static $_TableWidgetInstance; // static property that contains the instance of itself /** @@ -127,6 +146,7 @@ class TableWidget extends Widget $this->_datasetRepresentationOptions = null; $this->_datasetRepFieldsDefs = null; $this->_sessionTimeout = TableWidgetLib::SESSION_DEFAULT_TIMEOUT; + $this->_encryptedColumns = null; // Retrieved the required permissions parameter if present if (isset($args[TableWidgetLib::REQUIRED_PERMISSIONS])) @@ -206,6 +226,14 @@ class TableWidget extends Widget { $this->_sessionTimeout = $args[TableWidgetLib::SESSION_TIMEOUT]; } + + // Parameter is used to define the ecrypted columns + if (isset($args[TableWidgetLib::ENCRYPTED_COLUMNS]) + && is_array($args[TableWidgetLib::ENCRYPTED_COLUMNS]) + && count($args[TableWidgetLib::ENCRYPTED_COLUMNS]) > 0) + { + $this->_encryptedColumns = $args[TableWidgetLib::ENCRYPTED_COLUMNS]; + } } /** @@ -288,7 +316,7 @@ class TableWidget extends Widget $datasetQuery = $this->tablewidgetlib->generateDatasetQuery($this->_query); // Then retrieve dataset from DB - $dataset = $this->tablewidgetlib->getDataset($datasetQuery); + $dataset = $this->tablewidgetlib->getDataset($datasetQuery, $this->_encryptedColumns); // Save changes into session if data are valid if (!isError($dataset)) @@ -310,7 +338,7 @@ class TableWidget extends Widget $datasetQuery = $this->tablewidgetlib->generateDatasetQuery($this->_query); // Then retrieve dataset from DB - $dataset = $this->tablewidgetlib->getDataset($datasetQuery); + $dataset = $this->tablewidgetlib->getDataset($datasetQuery, $this->_encryptedColumns); // Save changes into session if data are valid if (!isError($dataset)) @@ -324,6 +352,7 @@ class TableWidget extends Widget TableWidgetLib::SESSION_FIELDS => $this->tablewidgetlib->getExecutedQueryListFields(), // all the fields of the dataset TableWidgetLib::SESSION_COLUMNS_ALIASES => $this->_columnsAliases, // all the fields aliases TableWidgetLib::SESSION_ADDITIONAL_COLUMNS => $this->_additionalColumns, // additional columns + TableWidgetLib::SESSION_ENCRYPTED_COLUMNS => $this->_encryptedColumns, // encrypted columns TableWidgetLib::SESSION_CHECKBOXES => $this->_checkboxes, // the name of the field used to build the checkboxes column TableWidgetLib::SESSION_METADATA => $this->tablewidgetlib->getExecutedQueryMetaData(), // the metadata of the dataset TableWidgetLib::SESSION_ROW_NUMBER => count($dataset->retval), // the number of loaded rows by this table diff --git a/composer.json b/composer.json index 825ed5625..16da033db 100644 --- a/composer.json +++ b/composer.json @@ -425,11 +425,12 @@ "config": { "bin-dir": "vendor/bin" }, + "require-dev": { "squizlabs/php_codesniffer": "3.6.*", "phpmd/phpmd": "2.*", "phpmetrics/phpmetrics": "2.*", - "sebastian/phpcpd": "3.*" + "sebastian/phpcpd": "3.*", + "phpunit/phpunit": "^6" } } - diff --git a/system/UnitTests/FunctionsTest.php b/system/UnitTests/FunctionsTest.php index 35be2cf69..9531a22a7 100644 --- a/system/UnitTests/FunctionsTest.php +++ b/system/UnitTests/FunctionsTest.php @@ -18,10 +18,13 @@ * Authors: Werner Masik , */ +use PHPUnit\Framework\TestCase; + + require_once('../../config/vilesci.config.inc.php'); require_once('../../include/functions.inc.php'); -class FunctionsTest extends PHPUnit_Framework_TestCase +class FunctionsTest extends TestCase { public function setUp() diff --git a/system/UnitTests/vertragsbestandteil/gui/FormDataTest.php b/system/UnitTests/vertragsbestandteil/gui/FormDataTest.php new file mode 100644 index 000000000..0426ba8bc --- /dev/null +++ b/system/UnitTests/vertragsbestandteil/gui/FormDataTest.php @@ -0,0 +1,40 @@ +mapJSON($decoded); + // Dienstverhaeltnis + $dataDV = $formDataMapper->getData(); + $this->assertNotEmpty($dataDV); + $this->assertNotEmpty($dataDV['unternehmen']); + $this->assertEquals('fhtw', $dataDV['unternehmen']); + $this->assertNull($dataDV['dienstverhaeltnisid']); + $this->assertNotEmpty($dataDV['vertragsart_kurzbz']); + $this->assertEquals('echterDV', $dataDV['vertragsart_kurzbz']); + $this->assertNotEmpty($dataDV['gueltigkeit']); + $this->assertNotEmpty($dataDV['gueltigkeit']['guioptions']); + $this->assertNotEmpty($dataDV['gueltigkeit']['data']); + $this->assertNotEmpty($dataDV['gueltigkeit']['data']['gueltig_ab']); + // Vertragsbestandteile + $vbs = $formDataMapper->getVbs(); + $this->assertNotEmpty($vbs); + } + + + +} \ No newline at end of file diff --git a/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilFunktionTest.php b/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilFunktionTest.php new file mode 100644 index 000000000..7369cd026 --- /dev/null +++ b/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilFunktionTest.php @@ -0,0 +1,39 @@ +mapJSON($decoded); + // VBS + $vbs = $formDataMapper->getVbs(); + $this->assertNotEmpty($vbs); + $this->assertNotEmpty($vbs['fc5f4ab8-4652-40e4-9ac3-e76bbf7310af']); + $vbsMapper = new GUIVertragsbestandteilFunktion(); + $vbsMapper->mapJSON($vbs['fc5f4ab8-4652-40e4-9ac3-e76bbf7310af']); + $vbsData=$vbsMapper->getData(); + $this->assertNotEmpty($vbsData['funktion']); + $this->assertEquals('Leitung', $vbsData['funktion']); + // GBS + $this->assertEmpty($vbsMapper->getGbs()); + + + } + + + +} \ No newline at end of file diff --git a/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilKuendigungsfristTest.php b/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilKuendigungsfristTest.php new file mode 100644 index 000000000..a36c749c9 --- /dev/null +++ b/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilKuendigungsfristTest.php @@ -0,0 +1,36 @@ +mapJSON($decoded); + // VBS + $vbs = $formDataMapper->getVbs(); + $this->assertNotEmpty($vbs); + $this->assertNotEmpty($vbs['6ae61b45-99a8-406b-b583-9f0353dd834f']); + $vbsMapper = new GUIVertragsbestandteilKuendigungsfrist(); + $vbsMapper->mapJSON($vbs['6ae61b45-99a8-406b-b583-9f0353dd834f']); + $vbsData=$vbsMapper->getData(); + $this->assertNotEmpty($vbsData['arbeitgeber_frist']); + $this->assertNotEmpty($vbsData['arbeitnehmer_frist']); + + } + + + +} \ No newline at end of file diff --git a/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilStundenTest.php b/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilStundenTest.php new file mode 100644 index 000000000..5716d3bed --- /dev/null +++ b/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilStundenTest.php @@ -0,0 +1,77 @@ +mapJSON($decoded); + // VBS + $vbs = $formDataMapper->getVbs(); + $this->assertNotEmpty($vbs); + $this->assertNotEmpty($vbs['73a60d69-cbd5-40f0-bcb1-ed0ccdd4a9fd']); + $vbsMapper = new GUIVertragsbestandteilStunden(); + $vbsMapper->mapJSON($vbs['73a60d69-cbd5-40f0-bcb1-ed0ccdd4a9fd']); + $vbsData=$vbsMapper->getData(); + var_dump($vbsData); + $this->assertNotEmpty($vbsData['stunden']); + $this->assertEquals(38.5, $vbsData['stunden']); + // GBS + $this->assertNotEmpty($vbsMapper->getGbs()); + + foreach ($vbsMapper->getGbs() as $gbs) + { + $this->assertNotEmpty($gbs->getData()); + $gbsData = $gbs->getData(); + $this->assertNotEmpty($gbsData['gehaltstyp']); + $this->assertNotEmpty($gbsData['betrag']); + $this->assertNotEmpty($gbsData['gueltigkeit']); + $this->assertNotEmpty($gbsData['valorisierung']); + } + } + + public function testMapJSON_02() + { + $jsondata = file_get_contents('./system/UnitTests/vertragsbestandteil/gui/funktion01.json'); + $decoded = json_decode($jsondata, true); + $formDataMapper = new FormData(); + $formDataMapper->mapJSON($decoded); + // VBS + $vbs = $formDataMapper->getVbs(); + $this->assertNotEmpty($vbs); + $this->assertNotEmpty($vbs['98704748-0ef0-4a70-94b7-5d8e719c2b3e']); + $vbsMapper = new GUIVertragsbestandteilStunden(); + $vbsMapper->mapJSON($vbs['98704748-0ef0-4a70-94b7-5d8e719c2b3e']); + $vbsData=$vbsMapper->getData(); + $this->assertNotEmpty($vbsData['stunden']); + $this->assertEquals(38.5, $vbsData['stunden']); + $this->assertNotEmpty($vbsData['gueltigkeit']->getData()); + // GBS + $this->assertNotEmpty($vbsMapper->getGbs()); + + foreach ($vbsMapper->getGbs() as $gbs) + { + $this->assertNotEmpty($gbs->getData()); + $gbsData = $gbs->getData(); + $this->assertNotEmpty($gbsData['gehaltstyp']); + $this->assertNotEmpty($gbsData['betrag']); + $this->assertNotEmpty($gbsData['gueltigkeit']); + $this->assertEmpty($gbsData['valorisierung']); + $this->assertNotEmpty($gbsData['gueltigkeit']->getData()); + } + } + +} \ No newline at end of file diff --git a/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilZeitaufzeichnungTest.php b/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilZeitaufzeichnungTest.php new file mode 100644 index 000000000..f76d65aee --- /dev/null +++ b/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilZeitaufzeichnungTest.php @@ -0,0 +1,39 @@ +mapJSON($decoded); + // VBS + $vbs = $formDataMapper->getVbs(); + $this->assertNotEmpty($vbs); + $this->assertNotEmpty($vbs['7625d25d-8fd9-476b-94a6-4fbb72c147d4']); + $vbsMapper = new GUIVertragsbestandteilZeitaufzeichnung(); + $vbsMapper->mapJSON($vbs['7625d25d-8fd9-476b-94a6-4fbb72c147d4']); + $vbsData=$vbsMapper->getData(); + $this->assertNotEmpty($vbsData['zeitaufzeichnung']); + $this->assertTrue($vbsData['zeitaufzeichnung']); + $this->assertEmpty($vbsData['azgrelevant']); + $this->assertNotEmpty($vbsData['homeoffice']); + $this->assertTrue($vbsData['homeoffice']); + + } + + + +} \ No newline at end of file diff --git a/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilZusatzvbTest.php b/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilZusatzvbTest.php new file mode 100644 index 000000000..705919f5a --- /dev/null +++ b/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilZusatzvbTest.php @@ -0,0 +1,41 @@ +mapJSON($decoded); + // VBS + $vbs = $formDataMapper->getVbs(); + $this->assertNotEmpty($vbs); + $this->assertNotEmpty($vbs['b168a3bb-d0e2-407f-8192-525a5ab59b22']); + $vbsMapper = new GUIVertragsbestandteilZusatzvereinbarung(); + $vbsMapper->mapJSON($vbs['b168a3bb-d0e2-407f-8192-525a5ab59b22']); + $vbsData=$vbsMapper->getData(); + $this->assertNotEmpty($vbsData['freitexttyp']); + $this->assertEquals('allin', $vbsData['freitexttyp']); + $this->assertNotEmpty($vbsData['titel']); + $this->assertEquals('Lorem ipsum', $vbsData['titel']); + // GBS + $this->assertEmpty($vbsMapper->getGbs()); + + + } + + + +} \ No newline at end of file diff --git a/system/UnitTests/vertragsbestandteil/gui/funktion01.json b/system/UnitTests/vertragsbestandteil/gui/funktion01.json new file mode 100644 index 000000000..15604745b --- /dev/null +++ b/system/UnitTests/vertragsbestandteil/gui/funktion01.json @@ -0,0 +1,241 @@ +{ + "type": "formdata", + "children": [ + { + "type": "tabs", + "guioptions": {}, + "children": [ + { + "type": "tab", + "guioptions": { + "title": "Allgemein", + "id": "allgemein" + }, + "children": [ + { + "type": "dv", + "guioptions": {}, + "children": [] + }, + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Kündigungsfrist", + "vertragsbestandteiltyp": "vertragsbestandteilkuendigungsfrist" + }, + "children": [] + }, + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Befristung", + "vertragsbestandteiltyp": "vertragsbestandteilfreitext", + "childdefaults": { + "guioptions": { + "canhavegehaltsbestandteile": false, + "disabled": [ + "freitexttyp" + ], + "hidden": [ + "titel", + "freitext" + ] + }, + "data": { + "freitexttyp": "befristung", + "titel": "Befristung", + "freitext": "befristeter Dienstvertrag" + } + } + }, + "children": [] + } + ] + }, + { + "type": "tab", + "guioptions": { + "title": "Arbeitszeit & Basisgehalt", + "id": "arbeitszeit" + }, + "children": [ + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Arbeitszeit", + "vertragsbestandteiltyp": "vertragsbestandteilstunden", + "errors": [ + "test1", + "test2" + ], + "infos": [] + }, + "children": [ + "98704748-0ef0-4a70-94b7-5d8e719c2b3e" + ] + }, + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Zeitaufzeichnung", + "vertragsbestandteiltyp": "vertragsbestandteilzeitaufzeichnung", + "errors": [], + "infos": [] + }, + "children": [] + } + ] + }, + { + "type": "tab", + "guioptions": { + "title": "Funktionen", + "id": "funktionen" + }, + "children": [ + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Funktion", + "vertragsbestandteiltyp": "vertragsbestandteilfunktion", + "errors": [], + "infos": [] + }, + "children": [ + "fc5f4ab8-4652-40e4-9ac3-e76bbf7310af" + ] + } + ] + }, + { + "type": "tab", + "guioptions": { + "title": "Zusatzvereinbarungen", + "id": "zusatzvereinbarungen" + }, + "children": [ + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Zusatzvereinbarungen", + "vertragsbestandteiltyp": "vertragsbestandteilfreitext" + }, + "children": [] + } + ] + }, + { + "type": "tab", + "guioptions": { + "title": "Sonstiges", + "id": "sonstiges" + }, + "children": [ + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Kündigungsfrist", + "vertragsbestandteiltyp": "vertragsbestandteilkuendigungsfrist", + "errors": [], + "infos": [] + }, + "children": [] + } + ] + } + ] + } + ], + "data": { + "dienstverhaeltnisid": null, + "unternehmen": "fhtw", + "vertragsart_kurzbz": "echterDV", + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "set" + }, + "data": { + "gueltig_ab": "1.1.2001", + "gueltig_bis": "" + } + } + }, + "vbs": { + "98704748-0ef0-4a70-94b7-5d8e719c2b3e": { + "type": "vertragsbestandteilstunden", + "guioptions": { + "id": "98704748-0ef0-4a70-94b7-5d8e719c2b3e", + "infos": [ + "test info 1", + "test info 2" + ], + "errors": [ + "test error 1", + "test error 2" + ] + }, + "data": { + "stunden": 38.5, + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "1.1.2001", + "gueltig_bis": "" + } + } + }, + "gbs": [ + { + "type": "gehaltsbestandteil", + "guioptions": { + "infos": [ + "test info 1", + "test info 2" + ], + "errors": [ + "test error 1", + "test error 2" + ] + }, + "data": { + "gehaltstyp": "grund", + "betrag": "3500", + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "1.1.2001", + "gueltig_bis": "" + } + }, + "valorisierung": "" + } + } + ] + }, + "fc5f4ab8-4652-40e4-9ac3-e76bbf7310af": { + "type": "vertragsbestandteilfunktion", + "guioptions": { + "id": "fc5f4ab8-4652-40e4-9ac3-e76bbf7310af" + }, + "data": { + "funktion": "Leitung", + "orget": "", + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "1.1.2001", + "gueltig_bis": "" + } + } + }, + "gbs": [] + } + } + } + \ No newline at end of file diff --git a/system/UnitTests/vertragsbestandteil/gui/kuendigungsfrist01.json b/system/UnitTests/vertragsbestandteil/gui/kuendigungsfrist01.json new file mode 100644 index 000000000..5c9d87ff6 --- /dev/null +++ b/system/UnitTests/vertragsbestandteil/gui/kuendigungsfrist01.json @@ -0,0 +1,263 @@ +{ + "type": "formdata", + "children": [ + { + "type": "tabs", + "guioptions": {}, + "children": [ + { + "type": "tab", + "guioptions": { + "title": "Allgemein", + "id": "allgemein" + }, + "children": [ + { + "type": "dv", + "guioptions": {}, + "children": [] + }, + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Kündigungsfrist", + "vertragsbestandteiltyp": "vertragsbestandteilkuendigungsfrist" + }, + "children": [ + "6ae61b45-99a8-406b-b583-9f0353dd834f" + ] + }, + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Befristung", + "vertragsbestandteiltyp": "vertragsbestandteilfreitext", + "childdefaults": { + "guioptions": { + "canhavegehaltsbestandteile": false, + "disabled": [ + "freitexttyp" + ], + "hidden": [ + "titel", + "freitext" + ] + }, + "data": { + "freitexttyp": "befristung", + "titel": "Befristung", + "freitext": "befristeter Dienstvertrag" + } + } + }, + "children": [] + } + ] + }, + { + "type": "tab", + "guioptions": { + "title": "Arbeitszeit & Basisgehalt", + "id": "arbeitszeit" + }, + "children": [ + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Arbeitszeit", + "vertragsbestandteiltyp": "vertragsbestandteilstunden", + "errors": [ + "test1", + "test2" + ], + "infos": [] + }, + "children": [ + "98704748-0ef0-4a70-94b7-5d8e719c2b3e" + ] + }, + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Zeitaufzeichnung", + "vertragsbestandteiltyp": "vertragsbestandteilzeitaufzeichnung", + "errors": [], + "infos": [] + }, + "children": [] + } + ] + }, + { + "type": "tab", + "guioptions": { + "title": "Funktionen", + "id": "funktionen" + }, + "children": [ + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Funktion", + "vertragsbestandteiltyp": "vertragsbestandteilfunktion", + "errors": [], + "infos": [] + }, + "children": [ + "fc5f4ab8-4652-40e4-9ac3-e76bbf7310af" + ] + } + ] + }, + { + "type": "tab", + "guioptions": { + "title": "Zusatzvereinbarungen", + "id": "zusatzvereinbarungen" + }, + "children": [ + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Zusatzvereinbarungen", + "vertragsbestandteiltyp": "vertragsbestandteilfreitext" + }, + "children": [] + } + ] + }, + { + "type": "tab", + "guioptions": { + "title": "Sonstiges", + "id": "sonstiges" + }, + "children": [ + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Kündigungsfrist", + "vertragsbestandteiltyp": "vertragsbestandteilkuendigungsfrist", + "errors": [], + "infos": [] + }, + "children": [] + } + ] + } + ] + } + ], + "data": { + "dienstverhaeltnisid": null, + "unternehmen": "fhtw", + "vertragsart_kurzbz": "echterDV", + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "set" + }, + "data": { + "gueltig_ab": "1.1.2001", + "gueltig_bis": "" + } + } + }, + "vbs": { + "98704748-0ef0-4a70-94b7-5d8e719c2b3e": { + "type": "vertragsbestandteilstunden", + "guioptions": { + "id": "98704748-0ef0-4a70-94b7-5d8e719c2b3e", + "infos": [ + "test info 1", + "test info 2" + ], + "errors": [ + "test error 1", + "test error 2" + ] + }, + "data": { + "stunden": "38,5", + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "1.1.2001", + "gueltig_bis": "" + } + } + }, + "gbs": [ + { + "type": "gehaltsbestandteil", + "guioptions": { + "infos": [ + "test info 1", + "test info 2" + ], + "errors": [ + "test error 1", + "test error 2" + ] + }, + "data": { + "gehaltstyp": "grund", + "betrag": "3500", + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "1.1.2001", + "gueltig_bis": "" + } + }, + "valorisierung": "" + } + } + ] + }, + "fc5f4ab8-4652-40e4-9ac3-e76bbf7310af": { + "type": "vertragsbestandteilfunktion", + "guioptions": { + "id": "fc5f4ab8-4652-40e4-9ac3-e76bbf7310af" + }, + "data": { + "funktion": "Leitung", + "orget": "", + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "1.1.2001", + "gueltig_bis": "" + } + } + }, + "gbs": [] + }, + "6ae61b45-99a8-406b-b583-9f0353dd834f": { + "type": "vertragsbestandteilkuendigungsfrist", + "guioptions": { + "id": "6ae61b45-99a8-406b-b583-9f0353dd834f", + "removeable": true + }, + "data": { + "arbeitgeber_frist": "8", + "arbeitnehmer_frist": "4", + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "1.1.2001", + "gueltig_bis": "" + } + } + } + } + } + } + \ No newline at end of file diff --git a/system/UnitTests/vertragsbestandteil/gui/stunden01.json b/system/UnitTests/vertragsbestandteil/gui/stunden01.json new file mode 100644 index 000000000..8c319f7b5 --- /dev/null +++ b/system/UnitTests/vertragsbestandteil/gui/stunden01.json @@ -0,0 +1,241 @@ +{ + "type": "formdata", + "children": [ + { + "type": "tabs", + "guioptions": {}, + "children": [ + { + "type": "tab", + "guioptions": { + "title": "Allgemein", + "id": "allgemein" + }, + "children": [ + { + "type": "dv", + "guioptions": {}, + "children": [] + }, + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Kündigungsfrist", + "vertragsbestandteiltyp": "vertragsbestandteilkuendigungsfrist" + }, + "children": [] + }, + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Befristung", + "vertragsbestandteiltyp": "vertragsbestandteilfreitext", + "childdefaults": { + "guioptions": { + "canhavegehaltsbestandteile": false, + "disabled": [ + "freitexttyp" + ], + "hidden": [ + "titel", + "freitext" + ] + }, + "data": { + "freitexttyp": "befristung", + "titel": "Befristung", + "freitext": "befristeter Dienstvertrag" + } + } + }, + "children": [] + } + ] + }, + { + "type": "tab", + "guioptions": { + "title": "Arbeitszeit & Basisgehalt", + "id": "arbeitszeit" + }, + "children": [ + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Arbeitszeit", + "vertragsbestandteiltyp": "vertragsbestandteilstunden", + "errors": [ + "test1", + "test2" + ], + "infos": [] + }, + "children": [ + "73a60d69-cbd5-40f0-bcb1-ed0ccdd4a9fd" + ] + }, + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Zeitaufzeichnung", + "vertragsbestandteiltyp": "vertragsbestandteilzeitaufzeichnung", + "errors": [], + "infos": [] + }, + "children": [] + } + ] + }, + { + "type": "tab", + "guioptions": { + "title": "Funktionen", + "id": "funktionen" + }, + "children": [ + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Funktion", + "vertragsbestandteiltyp": "vertragsbestandteilfunktion", + "errors": [], + "infos": [] + }, + "children": [ + "a0e35f18-e4d9-4dc3-8001-1b689360782a" + ] + } + ] + }, + { + "type": "tab", + "guioptions": { + "title": "Zusatzvereinbarungen", + "id": "zusatzvereinbarungen" + }, + "children": [ + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Zusatzvereinbarungen", + "vertragsbestandteiltyp": "vertragsbestandteilfreitext" + }, + "children": [] + } + ] + }, + { + "type": "tab", + "guioptions": { + "title": "Sonstiges", + "id": "sonstiges" + }, + "children": [ + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Kündigungsfrist", + "vertragsbestandteiltyp": "vertragsbestandteilkuendigungsfrist", + "errors": [], + "infos": [] + }, + "children": [] + } + ] + } + ] + } + ], + "data": { + "dienstverhaeltnisid": null, + "unternehmen": "fhtw", + "vertragsart_kurzbz": "echterDV", + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "set" + }, + "data": { + "gueltig_ab": "1.1.2011", + "gueltig_bis": "" + } + } + }, + "vbs": { + "73a60d69-cbd5-40f0-bcb1-ed0ccdd4a9fd": { + "type": "vertragsbestandteilstunden", + "guioptions": { + "id": "73a60d69-cbd5-40f0-bcb1-ed0ccdd4a9fd", + "infos": [ + "test info 1", + "test info 2" + ], + "errors": [ + "test error 1", + "test error 2" + ] + }, + "data": { + "stunden": 38.5, + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "1.1.2011", + "gueltig_bis": "" + } + } + }, + "gbs": [ + { + "type": "gehaltsbestandteil", + "guioptions": { + "infos": [ + "test info 1", + "test info 2" + ], + "errors": [ + "test error 1", + "test error 2" + ] + }, + "data": { + "gehaltstyp": "grund", + "betrag": "3334", + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "1.1.2011", + "gueltig_bis": "" + } + }, + "valorisierung": true + } + } + ] + }, + "a0e35f18-e4d9-4dc3-8001-1b689360782a": { + "type": "vertragsbestandteilfunktion", + "guioptions": { + "id": "a0e35f18-e4d9-4dc3-8001-1b689360782a" + }, + "data": { + "funktion": "Leitung", + "orget": "", + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "1.1.2011", + "gueltig_bis": "" + } + } + }, + "gbs": [] + } + } +} + \ No newline at end of file diff --git a/system/UnitTests/vertragsbestandteil/gui/zeitaufzeichnung01.json b/system/UnitTests/vertragsbestandteil/gui/zeitaufzeichnung01.json new file mode 100644 index 000000000..ce3d48a8d --- /dev/null +++ b/system/UnitTests/vertragsbestandteil/gui/zeitaufzeichnung01.json @@ -0,0 +1,264 @@ +{ + "type": "formdata", + "children": [ + { + "type": "tabs", + "guioptions": {}, + "children": [ + { + "type": "tab", + "guioptions": { + "title": "Allgemein", + "id": "allgemein" + }, + "children": [ + { + "type": "dv", + "guioptions": {}, + "children": [] + }, + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Kündigungsfrist", + "vertragsbestandteiltyp": "vertragsbestandteilkuendigungsfrist" + }, + "children": [] + }, + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Befristung", + "vertragsbestandteiltyp": "vertragsbestandteilfreitext", + "childdefaults": { + "guioptions": { + "canhavegehaltsbestandteile": false, + "disabled": [ + "freitexttyp" + ], + "hidden": [ + "titel", + "freitext" + ] + }, + "data": { + "freitexttyp": "befristung", + "titel": "Befristung", + "freitext": "befristeter Dienstvertrag" + } + } + }, + "children": [] + } + ] + }, + { + "type": "tab", + "guioptions": { + "title": "Arbeitszeit & Basisgehalt", + "id": "arbeitszeit" + }, + "children": [ + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Arbeitszeit", + "vertragsbestandteiltyp": "vertragsbestandteilstunden", + "errors": [ + "test1", + "test2" + ], + "infos": [] + }, + "children": [ + "439336ad-05ee-4b2a-9a0c-df7dc1c7245e" + ] + }, + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Zeitaufzeichnung", + "vertragsbestandteiltyp": "vertragsbestandteilzeitaufzeichnung", + "errors": [], + "infos": [] + }, + "children": [ + "7625d25d-8fd9-476b-94a6-4fbb72c147d4" + ] + } + ] + }, + { + "type": "tab", + "guioptions": { + "title": "Funktionen", + "id": "funktionen" + }, + "children": [ + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Funktion", + "vertragsbestandteiltyp": "vertragsbestandteilfunktion", + "errors": [], + "infos": [] + }, + "children": [ + "81c92565-82fe-40ec-ad35-454c3218fb3b" + ] + } + ] + }, + { + "type": "tab", + "guioptions": { + "title": "Zusatzvereinbarungen", + "id": "zusatzvereinbarungen" + }, + "children": [ + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Zusatzvereinbarungen", + "vertragsbestandteiltyp": "vertragsbestandteilfreitext" + }, + "children": [] + } + ] + }, + { + "type": "tab", + "guioptions": { + "title": "Sonstiges", + "id": "sonstiges" + }, + "children": [ + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Kündigungsfrist", + "vertragsbestandteiltyp": "vertragsbestandteilkuendigungsfrist", + "errors": [], + "infos": [] + }, + "children": [] + } + ] + } + ] + } + ], + "data": { + "dienstverhaeltnisid": null, + "unternehmen": "", + "vertragsart_kurzbz": "", + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "set" + }, + "data": { + "gueltig_ab": "", + "gueltig_bis": "" + } + } + }, + "vbs": { + "439336ad-05ee-4b2a-9a0c-df7dc1c7245e": { + "type": "vertragsbestandteilstunden", + "guioptions": { + "id": "439336ad-05ee-4b2a-9a0c-df7dc1c7245e", + "infos": [ + "test info 1", + "test info 2" + ], + "errors": [ + "test error 1", + "test error 2" + ] + }, + "data": { + "stunden": "38,5", + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "", + "gueltig_bis": "" + } + } + }, + "gbs": [ + { + "type": "gehaltsbestandteil", + "guioptions": { + "infos": [ + "test info 1", + "test info 2" + ], + "errors": [ + "test error 1", + "test error 2" + ] + }, + "data": { + "gehaltstyp": "", + "betrag": "", + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "", + "gueltig_bis": "" + } + }, + "valorisierung": true + } + } + ] + }, + "81c92565-82fe-40ec-ad35-454c3218fb3b": { + "type": "vertragsbestandteilfunktion", + "guioptions": { + "id": "81c92565-82fe-40ec-ad35-454c3218fb3b" + }, + "data": { + "funktion": "Leitung", + "orget": "", + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "", + "gueltig_bis": "" + } + } + }, + "gbs": [] + }, + "7625d25d-8fd9-476b-94a6-4fbb72c147d4": { + "type": "vertragsbestandteilzeitaufzeichnung", + "guioptions": { + "id": "7625d25d-8fd9-476b-94a6-4fbb72c147d4", + "removeable": true + }, + "data": { + "zeitaufzeichnung": true, + "azgrelevant": "", + "homeoffice": true, + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "", + "gueltig_bis": "" + } + } + } + } + } + } + \ No newline at end of file diff --git a/system/UnitTests/vertragsbestandteil/gui/zusatz01.json b/system/UnitTests/vertragsbestandteil/gui/zusatz01.json new file mode 100644 index 000000000..b5d63b0a2 --- /dev/null +++ b/system/UnitTests/vertragsbestandteil/gui/zusatz01.json @@ -0,0 +1,354 @@ +{ + "type": "formdata", + "children": [ + { + "type": "tabs", + "guioptions": {}, + "children": [ + { + "type": "tab", + "guioptions": { + "title": "Allgemein", + "id": "allgemein" + }, + "children": [ + { + "type": "dv", + "guioptions": {}, + "children": [] + }, + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Kündigungsfrist", + "vertragsbestandteiltyp": "vertragsbestandteilkuendigungsfrist" + }, + "children": [] + }, + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Befristung", + "vertragsbestandteiltyp": "vertragsbestandteilfreitext", + "childdefaults": { + "guioptions": { + "canhavegehaltsbestandteile": false, + "disabled": [ + "freitexttyp" + ], + "hidden": [ + "titel", + "freitext" + ] + }, + "data": { + "freitexttyp": "befristung", + "titel": "Befristung", + "freitext": "befristeter Dienstvertrag" + } + } + }, + "children": [] + } + ] + }, + { + "type": "tab", + "guioptions": { + "title": "Arbeitszeit & Basisgehalt", + "id": "arbeitszeit" + }, + "children": [ + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Arbeitszeit", + "vertragsbestandteiltyp": "vertragsbestandteilstunden", + "errors": [ + "test1", + "test2" + ], + "infos": [] + }, + "children": [ + "5671ff88-9580-4b20-8bbf-a744bc353485" + ] + }, + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Zeitaufzeichnung", + "vertragsbestandteiltyp": "vertragsbestandteilzeitaufzeichnung", + "errors": [], + "infos": [] + }, + "children": [ + "484f7166-7792-4cc7-b906-0db09c65bbf4" + ] + } + ] + }, + { + "type": "tab", + "guioptions": { + "title": "Funktionen", + "id": "funktionen" + }, + "children": [ + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Funktion", + "vertragsbestandteiltyp": "vertragsbestandteilfunktion", + "errors": [], + "infos": [] + }, + "children": [ + "2c38c937-3157-4404-ad33-dfad2ed15633", + "b983791e-ff2e-4eeb-891e-b786c90daf69" + ] + } + ] + }, + { + "type": "tab", + "guioptions": { + "title": "Zusatzvereinbarungen", + "id": "zusatzvereinbarungen" + }, + "children": [ + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Zusatzvereinbarungen", + "vertragsbestandteiltyp": "vertragsbestandteilfreitext" + }, + "children": [ + "b168a3bb-d0e2-407f-8192-525a5ab59b22" + ] + } + ] + }, + { + "type": "tab", + "guioptions": { + "title": "Sonstiges", + "id": "sonstiges" + }, + "children": [ + { + "type": "vertragsbestandteillist", + "guioptions": { + "title": "Kündigungsfrist", + "vertragsbestandteiltyp": "vertragsbestandteilkuendigungsfrist", + "errors": [], + "infos": [] + }, + "children": [ + "b7c613f2-f82b-45af-bc6a-9c5cefb41e91" + ] + } + ] + } + ] + } + ], + "data": { + "dienstverhaeltnisid": null, + "unternehmen": "", + "vertragsart_kurzbz": "", + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "set" + }, + "data": { + "gueltig_ab": "1.1.2010", + "gueltig_bis": "" + } + } + }, + "vbs": { + "5671ff88-9580-4b20-8bbf-a744bc353485": { + "type": "vertragsbestandteilstunden", + "guioptions": { + "id": "5671ff88-9580-4b20-8bbf-a744bc353485", + "infos": [ + "test info 1", + "test info 2" + ], + "errors": [ + "test error 1", + "test error 2" + ] + }, + "data": { + "stunden": "38,5", + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "1.1.2010", + "gueltig_bis": "" + } + } + }, + "gbs": [ + { + "type": "gehaltsbestandteil", + "guioptions": { + "infos": [ + "test info 1", + "test info 2" + ], + "errors": [ + "test error 1", + "test error 2" + ] + }, + "data": { + "gehaltstyp": "", + "betrag": "", + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "1.1.2010", + "gueltig_bis": "" + } + }, + "valorisierung": "" + } + } + ] + }, + "2c38c937-3157-4404-ad33-dfad2ed15633": { + "type": "vertragsbestandteilfunktion", + "guioptions": { + "id": "2c38c937-3157-4404-ad33-dfad2ed15633" + }, + "data": { + "funktion": "Leitung", + "orget": "sdf", + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "1.1.2010", + "gueltig_bis": "" + } + } + }, + "gbs": [ + { + "type": "gehaltsbestandteil", + "guioptions": { + "id": "a5df7915-6935-47d8-9751-f8f8d63d188b", + "removeable": true + }, + "data": { + "gehaltstyp": "zulage", + "betrag": "111", + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "1.1.2010", + "gueltig_bis": "" + } + }, + "valorisierung": true + } + } + ] + }, + "b983791e-ff2e-4eeb-891e-b786c90daf69": { + "type": "vertragsbestandteilfunktion", + "guioptions": { + "id": "b983791e-ff2e-4eeb-891e-b786c90daf69", + "removeable": true + }, + "data": { + "funktion": "", + "orget": "", + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "1.1.2010", + "gueltig_bis": "" + } + } + }, + "gbs": [] + }, + "b168a3bb-d0e2-407f-8192-525a5ab59b22": { + "type": "vertragsbestandteilfreitext", + "guioptions": { + "id": "b168a3bb-d0e2-407f-8192-525a5ab59b22", + "removeable": true + }, + "data": { + "freitexttyp": "allin", + "titel": "Lorem ipsum", + "freitext": "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. \nAt vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. ", + "kuendigungsrelevant": "", + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "1.1.2010", + "gueltig_bis": "" + } + } + }, + "gbs": [] + }, + "b7c613f2-f82b-45af-bc6a-9c5cefb41e91": { + "type": "vertragsbestandteilkuendigungsfrist", + "guioptions": { + "id": "b7c613f2-f82b-45af-bc6a-9c5cefb41e91", + "removeable": true + }, + "data": { + "arbeitgeber_frist": "", + "arbeitnehmer_frist": "", + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "1.1.2010", + "gueltig_bis": "" + } + } + } + }, + "484f7166-7792-4cc7-b906-0db09c65bbf4": { + "type": "vertragsbestandteilzeitaufzeichnung", + "guioptions": { + "id": "484f7166-7792-4cc7-b906-0db09c65bbf4", + "removeable": true + }, + "data": { + "zeitaufzeichnung": true, + "azgrelevant": false, + "homeoffice": true, + "gueltigkeit": { + "guioptions": { + "sharedstatemode": "reflect" + }, + "data": { + "gueltig_ab": "1.1.2010", + "gueltig_bis": "" + } + } + } + } + } + } \ No newline at end of file From c613c6dc432d0d2e83a98d4404e23fa9f5f50bb4 Mon Sep 17 00:00:00 2001 From: Werner Masik Date: Mon, 3 Apr 2023 13:37:12 +0200 Subject: [PATCH 031/263] small fix to prevent error when $encryptedColumns is null --- application/core/DB_Model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/core/DB_Model.php b/application/core/DB_Model.php index 062bc06c2..9b1147f28 100644 --- a/application/core/DB_Model.php +++ b/application/core/DB_Model.php @@ -123,7 +123,7 @@ class DB_Model extends CI_Model if (isError($validate = $this->_prepareUDFsWrite($data, $this->dbTable))) return $validate; // Add the pgp_sym_eccrypt postgresql function to the set clause if needed - $this->_addEncrypt($encryptedColumns, $data); + if (!empty($encryptedColumns)) $this->_addEncrypt($encryptedColumns, $data); // DB-INSERT $insert = $this->db->insert($this->dbTable, $data); @@ -194,7 +194,7 @@ class DB_Model extends CI_Model $this->db->where($tmpId); // Add the pgp_sym_eccrypt postgresql function to the set clause if needed - $this->_addEncrypt($encryptedColumns, $data); + if (!empty($encryptedColumns)) $this->_addEncrypt($encryptedColumns, $data); // DB-UPDATE $update = $this->db->update($this->dbTable, $data); From 783cb289cddabeb8f3d641be95904420614fff27 Mon Sep 17 00:00:00 2001 From: Werner Masik Date: Tue, 4 Apr 2023 18:51:06 +0200 Subject: [PATCH 032/263] added Unit-Tests; changed IDs of organisationseinheit in VertragsGUI --- application/controllers/Test.php | 16 ++++ .../VertragsbestandteilStunden.php | 3 + .../vertragsbestandteil/gui/FormData.php | 6 +- .../vertragsbestandteil/gui/GUIHandler.php | 86 +++++++++++++++---- .../gui/GUIHandlerFactory.php | 6 ++ .../gui/GUIVertragsbestandteilFunktion.php | 15 +++- .../gui/GUIVertragsbestandteilStunden.php | 20 +++-- .../vertragsbestandteil/gui/util.php | 8 ++ phpunit.xml | 13 +++ public/js/components/vbform/dvneuanlage.js | 4 +- .../vertragsbestandteil/gui/FormDataTest.php | 2 +- .../gui/GuiHandlerTest.php | 41 +++++++++ .../vertragsbestandteil/gui/funktion01.json | 4 +- .../gui/kuendigungsfrist01.json | 4 +- .../vertragsbestandteil/gui/readme.txt | 6 ++ .../vertragsbestandteil/gui/stunden01.json | 4 +- system/checksystem.php | 2 +- 17 files changed, 203 insertions(+), 37 deletions(-) create mode 100644 application/controllers/Test.php create mode 100644 application/libraries/vertragsbestandteil/gui/util.php create mode 100644 phpunit.xml create mode 100644 system/UnitTests/vertragsbestandteil/gui/GuiHandlerTest.php create mode 100644 system/UnitTests/vertragsbestandteil/gui/readme.txt diff --git a/application/controllers/Test.php b/application/controllers/Test.php new file mode 100644 index 000000000..2a7aa4e4e --- /dev/null +++ b/application/controllers/Test.php @@ -0,0 +1,16 @@ +getJSONDataInt($this->data['dienstverhaeltnisid'], $decodedData, 'dienstverhaeltnisid'); $this->getJSONData($this->data['unternehmen'], $decodedData, 'unternehmen'); $this->getJSONData($this->data['vertragsart_kurzbz'], $decodedData, 'vertragsart_kurzbz'); - $this->getJSONData($this->data['gueltigkeit'], $decodedData, 'gueltigkeit'); + $gueltigkeit = new GUIGueltigkeit(); + $gueltigkeit->mapJSON($decodedData['gueltigkeit']); + $this->data['gueltigkeit'] = $gueltigkeit; + //$this->getJSONData($this->data['gueltigkeit'], $decodedData, 'gueltigkeit'); } private function generateDvJSON() diff --git a/application/libraries/vertragsbestandteil/gui/GUIHandler.php b/application/libraries/vertragsbestandteil/gui/GUIHandler.php index 7a5695b44..5ccf9d421 100644 --- a/application/libraries/vertragsbestandteil/gui/GUIHandler.php +++ b/application/libraries/vertragsbestandteil/gui/GUIHandler.php @@ -1,9 +1,11 @@ userUID = $userUID; $this->CI = get_instance(); $this->CI->load->model('vertragsbestandteil/Dienstverhaeltnis_model', - 'Dienstverhaeltnis_model'); + 'Dienstverhaeltnis_model'); + $this->CI->load->library('vertragsbestandteil/VertragsbestandteilLib', + null, 'VertragsbestandteilLib'); } @@ -43,13 +47,19 @@ class GUIHandler // DV $dvData = $formDataMapper->getData(); - $this->handleDV($dvData); + $res = $this->handleDV($dvData); - // VBS - $vbsList = $formDataMapper->getVbs(); + if ($res === false) + { + // TODO write error message + } else { - foreach ($vbsList as $vbsID => $vbs) { - $this->handleVBS($dvData['dienstverhaeltnis_id'] ,$vbs); + // VBS + $vbsList = $formDataMapper->getVbs(); + + foreach ($vbsList as $vbsID => $vbs) { + $this->handleVBS($dvData['dienstverhaeltnisid'] ,$vbs); + } } return $formDataMapper->generateJSON(); @@ -68,29 +78,50 @@ class GUIHandler if (isset($dienstverhaeltnisid) && intval($dienstverhaeltnisid > 0)) { // DV exists - $ret = $this->updateDV($dv); + $res = $this->updateDV($dv); + if (isSuccess($res)) + { + return true; + } } else { // DV is new - $ret = $this->insertDV($dv); - // write back new id - $dv['dienstverhaeltnisid'] = $ret['dienstverhaeltnis_id']; + $res = $this->insertDV($dv); + if (isSuccess($res)) + { + // write back new id + $dv['dienstverhaeltnisid'] = $res->retval[0]->dienstverhaeltnis_id; + return true; + } + } + + return false; } - private function handleVBS($vbs) + private function handleVBS($dienstverhaeltnis_id, $vbs) { + /** @var GUIVertragsbestandteilFunktion */ $vbsMapper = GUIHandlerFactory::getGUIHandler($vbs['type']); $vbsMapper->mapJSON($vbs); $vbsData = $vbsMapper->getData(); // merge GUI-Data with DB-Data - $vbsInstance = $vbsMapper->generateVertragsbestandteil($vbsData['id']); + $vbsInstance = $vbsMapper->generateVertragsbestandteil(isset($vbsData['id'])?$vbsData['id']:null); + if ($vbsInstance->getDienstverhaeltnis_id() === null) + { + $vbsInstance->setDienstverhaeltnis_id($dienstverhaeltnis_id); + $vbsInstance->setInsertvon($this->userUID); + $vbsInstance->setInsertamum((new DateTime())->format("Y-m-d h:m:s")); + } else { + $vbsInstance->setUpdatevon($this->userUID); + $vbsInstance->setUpdateamum((new DateTime())->format("Y-m-d h:m:s")); + } // TODO Validate? // store - $this->VertragsbestandteilLib->store($vbsInstance); + $this->CI->VertragsbestandteilLib->storeVertragsbestandteil($vbsInstance); // GBS /* @@ -111,13 +142,21 @@ class GUIHandler // ------------------------------------ // DV does not have a dedicated handler - private function insertDV($dvJSON) { + $dvJSON['mitarbeiter_uid'] = $this->employeeUID; $now = new DateTime(); + $dvJSON['von'] = string2Date($dvJSON['gueltigkeit']->getData()['gueltig_ab']); + $dvJSON['bis'] = string2Date($dvJSON['gueltigkeit']->getData()['gueltig_bis']); + $dvJSON['oe_kurzbz'] = $dvJSON['unternehmen']; $dvJSON['insertvon'] = $this->userUID; $dvJSON['insertamum'] = $now->format(DateTime::ATOM); + unset($dvJSON['dienstverhaeltnisid']); + unset($dvJSON['children']); + unset($dvJSON['gueltigkeit']); + unset($dvJSON['unternehmen']); + $result = $this->CI->Dienstverhaeltnis_model->insert($dvJSON); if (isError($result)) @@ -132,15 +171,24 @@ class GUIHandler private function updateDV($dvJSON) { + $dvJSON['mitarbeiter_uid'] = $this->employeeUID; + $dvJSON['von'] = string2Date($dvJSON['gueltigkeit']->getData()['gueltig_ab']); + $dvJSON['bis'] = string2Date($dvJSON['gueltigkeit']->getData()['gueltig_bis']); + $dvJSON['oe_kurzbz'] = $dvJSON['unternehmen']; $now = new DateTime(); - $dvJSON['updatevon'] = getAuthUID(); + $dvJSON['updatevon'] = $this->userUID; $dvJSON['updateamum'] = $now->format(DateTime::ATOM); + $dvJSON['dienstverhaeltnis_id'] = $dvJSON['dienstverhaeltnisid']; unset($dvJSON['insertamum']); unset($dvJSON['insertvon']); + unset($dvJSON['dienstverhaeltnisid']); + unset($dvJSON['children']); + unset($dvJSON['gueltigkeit']); + unset($dvJSON['unternehmen']); - - $result = $this->CI->Dienstverhaeltnis_model->update($dvJSON['kontakt_id'], $dvJSON); + $result = $this->CI->Dienstverhaeltnis_model->update($dvJSON); + //$result = $this->CI->Dienstverhaeltnis_model->update($dvJSON['kontakt_id'], $dvJSON); if (isError($result)) { diff --git a/application/libraries/vertragsbestandteil/gui/GUIHandlerFactory.php b/application/libraries/vertragsbestandteil/gui/GUIHandlerFactory.php index ff1a7581d..e0140755b 100644 --- a/application/libraries/vertragsbestandteil/gui/GUIHandlerFactory.php +++ b/application/libraries/vertragsbestandteil/gui/GUIHandlerFactory.php @@ -1,5 +1,11 @@ 0) + { + // load VBS + $vbs = $this->vbsLib->fetchVertragsbestandteil($vbsData['id']); + } else { + $vbs = new vertragsbestandteil\VertragsbestandteilFunktion(); + } + // merge + $vbs->setBenutzerfunktion_id($this->data['benutzerfunktionid']); + $vbs->setVon(string2Date($this->data['gueltigkeit']->getData()['gueltig_ab'])); + $vbs->setBis(string2Date($this->data['gueltigkeit']->getData()['gueltig_bis'])); + return $vbs; } public function jsonSerialize() { diff --git a/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilStunden.php b/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilStunden.php index 60accea05..0e94ca16d 100644 --- a/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilStunden.php +++ b/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilStunden.php @@ -1,10 +1,18 @@ vbsLib->fetchVertragsbestandteil($vbsData['id']); } else { - $vbs = new vertragsbestandteil\VertragsbestandteilStunden(); - } - // merge + $vbs = new vertragsbestandteil\VertragsbestandteilStunden(); + } + // merge $vbs->setWochenstunden($this->data['stunden']); - $vbs->setVon($this->data['gueltigkeit']->getData()['gueltig_ab']); - $vbs->setBis($this->data['gueltigkeit']->getData()['gueltig_bis']); + $vbs->setVon(string2Date($this->data['gueltigkeit']->getData()['gueltig_ab'])); + $vbs->setBis(string2Date($this->data['gueltigkeit']->getData()['gueltig_bis'])); return $vbs; } diff --git a/application/libraries/vertragsbestandteil/gui/util.php b/application/libraries/vertragsbestandteil/gui/util.php new file mode 100644 index 000000000..6d70e790f --- /dev/null +++ b/application/libraries/vertragsbestandteil/gui/util.php @@ -0,0 +1,8 @@ +format('Y-m-d'); +} \ No newline at end of file diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 000000000..946312355 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,13 @@ + + + + + system/UnitTests/vertragsbestandteil/gui + + + + + + + + diff --git a/public/js/components/vbform/dvneuanlage.js b/public/js/components/vbform/dvneuanlage.js index a309acec0..c4dddf191 100644 --- a/public/js/components/vbform/dvneuanlage.js +++ b/public/js/components/vbform/dvneuanlage.js @@ -6,8 +6,8 @@ export default {
diff --git a/system/UnitTests/vertragsbestandteil/gui/FormDataTest.php b/system/UnitTests/vertragsbestandteil/gui/FormDataTest.php index 0426ba8bc..c25892670 100644 --- a/system/UnitTests/vertragsbestandteil/gui/FormDataTest.php +++ b/system/UnitTests/vertragsbestandteil/gui/FormDataTest.php @@ -22,7 +22,7 @@ class FormDataTest extends TestCase $dataDV = $formDataMapper->getData(); $this->assertNotEmpty($dataDV); $this->assertNotEmpty($dataDV['unternehmen']); - $this->assertEquals('fhtw', $dataDV['unternehmen']); + $this->assertEquals('gst', $dataDV['unternehmen']); $this->assertNull($dataDV['dienstverhaeltnisid']); $this->assertNotEmpty($dataDV['vertragsart_kurzbz']); $this->assertEquals('echterDV', $dataDV['vertragsart_kurzbz']); diff --git a/system/UnitTests/vertragsbestandteil/gui/GuiHandlerTest.php b/system/UnitTests/vertragsbestandteil/gui/GuiHandlerTest.php new file mode 100644 index 000000000..fa808ff1d --- /dev/null +++ b/system/UnitTests/vertragsbestandteil/gui/GuiHandlerTest.php @@ -0,0 +1,41 @@ +load->helper('hlp_common'); + self::$CI->load->helper('hlp_return_object'); + } + + + public function testHandleInsert(): void + { + $jsondata = file_get_contents('./system/UnitTests/vertragsbestandteil/gui/stunden01.json'); + $this->assertNotEmpty($jsondata); + $GH = new GUIHandler($this->employeeUID, $this->userUID); + $res = $GH->handle($jsondata); + } + + + + public function test_true() + { + $this->assertTrue(true); + } + + + +} \ No newline at end of file diff --git a/system/UnitTests/vertragsbestandteil/gui/funktion01.json b/system/UnitTests/vertragsbestandteil/gui/funktion01.json index 15604745b..5130a317e 100644 --- a/system/UnitTests/vertragsbestandteil/gui/funktion01.json +++ b/system/UnitTests/vertragsbestandteil/gui/funktion01.json @@ -148,8 +148,8 @@ ], "data": { "dienstverhaeltnisid": null, - "unternehmen": "fhtw", - "vertragsart_kurzbz": "echterDV", + "unternehmen": "gst", + "vertragsart_kurzbz": "echterdv", "gueltigkeit": { "guioptions": { "sharedstatemode": "set" diff --git a/system/UnitTests/vertragsbestandteil/gui/kuendigungsfrist01.json b/system/UnitTests/vertragsbestandteil/gui/kuendigungsfrist01.json index 5c9d87ff6..4e279a047 100644 --- a/system/UnitTests/vertragsbestandteil/gui/kuendigungsfrist01.json +++ b/system/UnitTests/vertragsbestandteil/gui/kuendigungsfrist01.json @@ -150,8 +150,8 @@ ], "data": { "dienstverhaeltnisid": null, - "unternehmen": "fhtw", - "vertragsart_kurzbz": "echterDV", + "unternehmen": "gst", + "vertragsart_kurzbz": "echterdv", "gueltigkeit": { "guioptions": { "sharedstatemode": "set" diff --git a/system/UnitTests/vertragsbestandteil/gui/readme.txt b/system/UnitTests/vertragsbestandteil/gui/readme.txt new file mode 100644 index 000000000..7aaeab96f --- /dev/null +++ b/system/UnitTests/vertragsbestandteil/gui/readme.txt @@ -0,0 +1,6 @@ + + +testen: + +./vendor/bin/phpunit system/UnitTests/vertragsbestandteil/gui/FormDataTest.php +./vendor/bin/phpunit system/UnitTests/vertragsbestandteil/gui/GuiHandlerTest.php \ No newline at end of file diff --git a/system/UnitTests/vertragsbestandteil/gui/stunden01.json b/system/UnitTests/vertragsbestandteil/gui/stunden01.json index 8c319f7b5..48295f742 100644 --- a/system/UnitTests/vertragsbestandteil/gui/stunden01.json +++ b/system/UnitTests/vertragsbestandteil/gui/stunden01.json @@ -148,8 +148,8 @@ ], "data": { "dienstverhaeltnisid": null, - "unternehmen": "fhtw", - "vertragsart_kurzbz": "echterDV", + "unternehmen": "gst", + "vertragsart_kurzbz": "echterdv", "gueltigkeit": { "guioptions": { "sharedstatemode": "set" diff --git a/system/checksystem.php b/system/checksystem.php index ce343cdca..bdc14c9d3 100644 --- a/system/checksystem.php +++ b/system/checksystem.php @@ -28,7 +28,7 @@ require_once('../version.php'); require_once('../include/benutzerberechtigung.class.php'); // Datenbank Verbindung -$db = new basis_db(); + $db = new basis_db(); echo ' CheckSystem From fca341ccf4029186ee400e5a03c3935b772452a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Thu, 6 Apr 2023 07:34:26 +0200 Subject: [PATCH 033/263] =?UTF-8?q?Migration=20von=20Vertr=C3=A4gen=20spei?= =?UTF-8?q?chert=20nun=20die=20Eint=C3=A4ge=20auch=20in=20der=20DB=20Tippf?= =?UTF-8?q?ehler=20in=20Models=20behoben=20Berechtigungen=20f=C3=BCr=20DV?= =?UTF-8?q?=20und=20VBS=20Sequence=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/system/MigrateContract.php | 170 +++++++++++++++++- .../VertragsbestandteilFreitext_model.php | 2 +- ...tragsbestandteilZeitaufzeichnung_model.php | 2 +- system/dbupdate_3.4/28260_vertraege.php | 3 + 4 files changed, 168 insertions(+), 9 deletions(-) diff --git a/application/controllers/system/MigrateContract.php b/application/controllers/system/MigrateContract.php index cefc080d6..8a1b6fff6 100644 --- a/application/controllers/system/MigrateContract.php +++ b/application/controllers/system/MigrateContract.php @@ -13,6 +13,7 @@ class MigrateContract extends CLI_Controller { private $matching_ba1_vertragsart; + private $OE_DEFAULT = 'gst'; /** * Constructor @@ -27,15 +28,15 @@ class MigrateContract extends CLI_Controller $this->matching_ba1_vertragsart = array( '101'=>'DV zum Bund', '102'=>'DV anderen Gebietskörperschaft', - '103'=>'EchterDV', + '103'=>'echterdv', '104'=>'Lehr- oder Ausbildungsverhältnis', - '105'=>'ext. LehrendeR (freier DV)', + '105'=>'freierdv', '106'=>'Andere Bildungseinrichtung', - '107'=>'Werkvertrag (Sonstiges)', - '108'=>'Stud. Hilfskraft (Echter DV)', - '109'=>'Überlassungsvertrag', - '110'=>'Echter Freier DV', - '111'=>'EchterDV', //All-In + '107'=>'werkvertrag', + '108'=>'studentischehilfskr', + '109'=>'ueberlassungsvertrag', + '110'=>'echterfreier', + '111'=>'echterdv', //All-In ); } @@ -55,6 +56,160 @@ class MigrateContract extends CLI_Controller */ //$this->outputJson($contracts); var_dump($contracts); + $this->_saveJSON($contracts); + } + + private function _saveJSON($contracts) + { + $this->load->model('vertragsbestandteil/Dienstverhaeltnis_model','DienstverhaeltnisModel'); + $this->load->model('vertragsbestandteil/Vertragsbestandteil_model','VertragsbestandteilModel'); + $this->load->model('vertragsbestandteil/VertragsbestandteilStunden_model','VertragsbestandteilStundenModel'); + $this->load->model('vertragsbestandteil/VertragsbestandteilZeitaufzeichnung_model','VertragsbestandteilZeitaufzeichnungModel'); + $this->load->model('vertragsbestandteil/VertragsbestandteilFreitext_model','VertragsbestandteilFreitextModel'); + $this->load->model('vertragsbestandteil/VertragsbestandteilFunktion_model','VertragsbestandteilFunktionModel'); + + $failed = false; + $this->db->trans_begin(); + + foreach($contracts['dv'] as $row_dv) + { + // Dienstvertrag erstellen + $resultDV = $this->DienstverhaeltnisModel->insert( + array( + 'mitarbeiter_uid' => $row_dv['mitarbeiter_uid'], + 'vertragsart_kurzbz' => $row_dv['vertragsart_kurzbz'], + 'oe_kurzbz' => $row_dv['oe_kurzbz'], + 'von' => $row_dv['von'], + 'bis' => $row_dv['bis'], + 'insertamum' => date('Y-m-d H:i:s'), + 'insertvon' => 'MigrateContract' + ) + ); + + if (isSuccess($resultDV) && hasData($resultDV)) + { + $dv_id = getData($resultDV); + + // Vertragsbetandteile erstellen + foreach($row_dv['vbs'] as $row_vbs) + { + $resultVBS = $this->VertragsbestandteilModel->insert( + array( + 'dienstverhaeltnis_id' => $dv_id, + 'vertragsbestandteiltyp_kurzbz' => $row_vbs['vertragsbestandteiltyp_kurzbz'], + 'von' => $row_vbs['von'], + 'bis' => $row_vbs['bis'], + 'insertamum' => date('Y-m-d H:i:s'), + 'insertvon' => 'MigrateContract' + ) + ); + + if (isSuccess($resultVBS) && hasData($resultVBS)) + { + $vbs_id = getData($resultVBS); + echo 'VBS:'.$vbs_id; + + switch($row_vbs['vertragsbestandteiltyp_kurzbz']) + { + case 'stunden': + $resultVBS = $this->_insertVBSStunden($vbs_id, $row_vbs); + break; + case 'zeitaufzeichnung': + $resultVBS = $this->_insertVBSZeitaufzeichnung($vbs_id, $row_vbs); + break; + case 'funktion': + $resultVBS = $this->_insertVBSFunktion($vbs_id, $row_vbs); + break; + case 'freitext': + $resultVBS = $this->_insertVBSFreitext($vbs_id, $row_vbs); + break; + case 'karenz': + $resultVBS = $this->_insertVBSKarenz($vbs_id, $row_vbs); + break; + } + + if (isError($resultVBS)) + { + echo "FAILED:".getError($resultVBS); + $failed = true; + } + } + else + { + $failed = true; + } + } + } + else + { + $failed = true; + } + } + + if(!$failed) + { + $this->db->trans_commit(); + } + else + { + echo "ROLLBACK"; + $this->db->trans_rollback(); + } + } + + private function _insertVBSKarenz($vbs_id, $row_vbs) + { + return $this->VertragsbestandteilKarenzModel->insert( + array( + 'vertragsbestandteil_id' => $vbs_id, + 'karenztyp_kurzbz' => $row_vbs['karenztyp_kurzbz'] + ) + ); + } + + private function _insertVBSFreitext($vbs_id, $row_vbs) + { + return $this->VertragsbestandteilFreitextModel->insert( + array( + 'vertragsbestandteil_id' => $vbs_id, + 'freitexttyp_kurzbz' => $row_vbs['freitexttyp_kurzbz'], + 'titel' => $row_vbs['titel'], + 'anmerkung' => $row_vbs['anmerkung'] + ) + ); + } + + private function _insertVBSFunktion($vbs_id, $row_vbs) + { + return $this->VertragsbestandteilFunktionModel->insert( + array( + 'vertragsbestandteil_id' => $vbs_id, + 'benutzerfunktion_id' => $row_vbs['benutzerfunktion_id'] + ) + ); + } + + private function _insertVBSZeitaufzeichnung($vbs_id, $row_vbs) + { + return $this->VertragsbestandteilZeitaufzeichnungModel->insert( + array( + 'vertragsbestandteil_id' => $vbs_id, + 'zeitaufzeichnung' => $row_vbs['zeitaufzeichnung'], + 'azgrelevant' => $row_vbs['azgrelevant'], + 'homeoffice' => $row_vbs['homeoffice'] + ) + ); + } + + private function _insertVBSStunden($vbs_id, $row_vbs) + { + return $this->VertragsbestandteilStundenModel->insert( + array( + 'vertragsbestandteil_id' => $vbs_id, + 'wochenstunden' => $row_vbs['wochenstunden'], + 'teilzeittyp_kurzbz' => $row_vbs['teilzeittyp_kurzbz'] + ) + ); } /** @@ -384,6 +539,7 @@ class MigrateContract extends CLI_Controller $contracts['dv'][$newDvIndex]['mitarbeiter_uid'] = $row_verwendung->mitarbeiter_uid; $contracts['dv'][$newDvIndex]['von'] = $row_verwendung->beginn; $contracts['dv'][$newDvIndex]['bis'] = $row_verwendung->ende; + $contracts['dv'][$newDvIndex]['oe_kurzbz'] = $this->OE_DEFAULT; $contracts['dv'][$newDvIndex]['vertragsart_kurzbz'] = $this->matching_ba1_vertragsart[$row_verwendung->ba1code]; return $newDvIndex; diff --git a/application/models/vertragsbestandteil/VertragsbestandteilFreitext_model.php b/application/models/vertragsbestandteil/VertragsbestandteilFreitext_model.php index d47ce53df..7da091f11 100644 --- a/application/models/vertragsbestandteil/VertragsbestandteilFreitext_model.php +++ b/application/models/vertragsbestandteil/VertragsbestandteilFreitext_model.php @@ -1,6 +1,6 @@ db_query("SELECT * FROM information_schema.tables WHERE table COMMENT ON TABLE hr.tbl_sachaufwand IS E'Zusatzvergütungen für Mitarbeiter'; COMMENT ON TABLE hr.tbl_sachaufwandtyp IS E'Key-Table for Sachaufwand'; COMMENT ON TABLE hr.tbl_teilzeittyp IS E'Key-Table Altersteilzeit, Elternteilzeit'; + + GRANT USAGE ON hr.tbl_dienstverhaeltnis_dienstverhaeltnis_id_seq TO vilesci; + GRANT USAGE ON hr.tbl_vertragsbestandteil_vertragsbestandteil_id_seq TO vilesci; "; if (! $db->db_query($qry)) From 025b58dee3b3057769d45c2fb8fdea1cdb1a64a7 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 11 Apr 2023 11:05:15 +0200 Subject: [PATCH 034/263] throw Exception when storeVertragsbestandteil is rolled back to handle rollback in possible outer transaction --- .../libraries/vertragsbestandteil/VertragsbestandteilLib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php index 8e5daa520..f527388c7 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php @@ -74,6 +74,7 @@ class VertragsbestandteilLib { log_message('debug', "Transaction rolled back. " . $ex->getMessage()); $this->CI->db->trans_rollback(); + throw new Exception('Storing Vertragsbestandteil failed.'); } } From ed2aa6620e079852e129e7bae161d53e836b8df1 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 11 Apr 2023 12:53:56 +0200 Subject: [PATCH 035/263] vuedatepicker added --- composer.json | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 16da033db..229b83a98 100644 --- a/composer.json +++ b/composer.json @@ -348,6 +348,28 @@ } } }, + { + "type": "package", + "package": { + "name": "vuejs/vuedatepicker_js", + "version": "4.2.3", + "dist": { + "url": "https://unpkg.com/@vuepic/vue-datepicker@4.2.3/dist/vue-datepicker.iife.js", + "type": "file" + } + } + }, + { + "type": "package", + "package": { + "name": "vuejs/vuedatepicker_css", + "version": "4.2.3", + "dist": { + "url": "https://unpkg.com/@vuepic/vue-datepicker@4.2.3/dist/main.css", + "type": "file" + } + } + }, { "type": "composer", "url": "https://asset-packagist.org" @@ -420,7 +442,9 @@ "twbs/bootstrap5": "5.1.*", "vuejs/vuejs3": "3.2.33", - "vuejs/vuerouter4": "4.1.3" + "vuejs/vuerouter4": "4.1.3", + "vuejs/vuedatepicker_js": "4.2.3", + "vuejs/vuedatepicker_css": "4.2.3" }, "config": { "bin-dir": "vendor/bin" From b50ca57907740b5611b5ab68e571799b89ca8299 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 11 Apr 2023 15:10:24 +0200 Subject: [PATCH 036/263] extend VertragsbestandteilFunktion to be able to create a Benutzerfunktion entry before being persited --- .../Vertragsbestandteil.php | 6 +- .../VertragsbestandteilFunktion.php | 71 +++++++++++-------- .../VertragsbestandteilLib.php | 2 + 3 files changed, 49 insertions(+), 30 deletions(-) diff --git a/application/libraries/vertragsbestandteil/Vertragsbestandteil.php b/application/libraries/vertragsbestandteil/Vertragsbestandteil.php index 9ada04329..1d1101e44 100644 --- a/application/libraries/vertragsbestandteil/Vertragsbestandteil.php +++ b/application/libraries/vertragsbestandteil/Vertragsbestandteil.php @@ -171,5 +171,9 @@ EOTXT; } - public abstract function toStdClass(); + public function beforePersist() { + // can be overridden in childs + } + + public abstract function toStdClass(); } diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php b/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php index d59e1b158..388e4873a 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php @@ -12,22 +12,44 @@ use vertragsbestandteil\VertragsbestandteilFactory; class VertragsbestandteilFunktion extends Vertragsbestandteil { protected $benutzerfunktion_id; - protected $anmerkung; - protected $kuendigungsrelevant; + protected $benutzerfunktiondata; + protected $CI; + public function __construct() { + $this->benutzerfunktiondata = null; + $this->setVertragsbestandteiltyp_kurzbz( VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_FUNKTION); + + $this->CI = get_instance(); + $this->CI->load->model('person/Benutzerfunktion_model', + 'BenutzerfunktionModel'); + } + + public function beforePersist() + { + if( $this->benutzerfunktiondata === null) + { + return; + } + + $ret = $this->BenutzerfunktionModel->insert($this->benutzerfunktiondata); + + if(isError($ret) ) + { + throw new Exception('failed to create Benutzerfunktion'); + } + + $this->setBenutzerfunktion_id(getData($ret)); } public function toStdClass() { $tmp = array( 'vertragsbestandteil_id' => $this->getVertragsbestandteil_id(), - 'benutzerfunktion_id' => $this->getBenutzerfunktion_id(), - 'anmerkung' => $this->getAnmerkung(), - 'kuendigungsrelevant' => $this->getKuendigungsrelevant() + 'benutzerfunktion_id' => $this->getBenutzerfunktion_id() ); $tmp = array_filter($tmp, function($v) { @@ -41,8 +63,6 @@ class VertragsbestandteilFunktion extends Vertragsbestandteil { $txt = <<getBenutzerfunktion_id()} - anmerkung: {$this->getAnmerkung()} - kuendigungsrelevant: {$this->getKuendigungsrelevant()} EOTXT; return parent::__toString() . $txt; @@ -52,39 +72,32 @@ EOTXT; { parent::hydrateByStdClass($data); isset($data->benutzerfunktion_id) && $this->setBenutzerfunktion_id($data->benutzerfunktion_id); - isset($data->anmerkung) && $this->setAnmerkung($data->anmerkung); - isset($data->kuendigungsrelevant) && $this->setKuendigungsrelevant($data->kuendigungsrelevant); + isset($data->funktion_kurzbz) && isset($data->oe_kurzbz) + && isset($mitarbeiter_uid) && $this->createBenutzerfunktionData($data); + } - + public function getBenutzerfunktion_id() { return $this->benutzerfunktion_id; } - - public function getAnmerkung() - { - return $this->anmerkung; - } - - public function getKuendigungsrelevant() - { - return $this->kuendigungsrelevant; - } public function setBenutzerfunktion_id($benutzerfunktion_id) { $this->benutzerfunktion_id = $benutzerfunktion_id; return $this; } - public function setAnmerkung($anmerkung) + + protected function createBenutzerfunktionData($data) { - $this->anmerkung = $anmerkung; - return $this; - } - - public function setKuendigungsrelevant($kuendigungsrelevant) - { - $this->kuendigungsrelevant = $kuendigungsrelevant; - return $this; + $this->benutzerfunktiondata = (object) array( + 'funktion_kurzbz' => $data->funktion_kurzbz, + 'oe_kurzbz' => $data->oe_kurzbz, + 'uid' => $data->mitarbeiter_uid, + 'datum_von' => $this->getVon(), + 'datum_bis' => $this->getBis(), + 'insertamum' => strftime('%Y-%m-%d %H:%M:%s'), + 'insertvon' => getAuthUID() + ); } } diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php index f527388c7..50198f82f 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php @@ -81,6 +81,7 @@ class VertragsbestandteilLib protected function insertVertragsbestandteil(Vertragsbestandteil $vertragsbestandteil, Vertragsbestandteil $vertragsbestandteil_secondary = null /* i.e. Gehaltsbestandteil connected to Stunden*/) { + $vertragsbestandteil->beforePersist(); $ret = $this->VertragsbestandteilModel->insert($vertragsbestandteil->baseToStdClass()); if( hasData($ret) ) { @@ -134,6 +135,7 @@ class VertragsbestandteilLib { $vertragsbestandteil->setUpdateamum(strftime('%Y-%m-%d %H:%M')) ->setUpdatevon('ma0080'); + $vertragsbestandteil->beforePersist(); $ret = $this->VertragsbestandteilModel->update($vertragsbestandteil->getVertragsbestandteil_id(), $vertragsbestandteil->baseToStdClass()); From 12c712c1b4b5bb556c1eb0992478b87f6a9bb4ba Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 11 Apr 2023 15:22:40 +0200 Subject: [PATCH 037/263] changed property names to match gui input --- .../vertragsbestandteil/VertragsbestandteilFunktion.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php b/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php index 388e4873a..1ac6d96b0 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php @@ -72,7 +72,7 @@ EOTXT; { parent::hydrateByStdClass($data); isset($data->benutzerfunktion_id) && $this->setBenutzerfunktion_id($data->benutzerfunktion_id); - isset($data->funktion_kurzbz) && isset($data->oe_kurzbz) + isset($data->funktion) && isset($data->orget) && isset($mitarbeiter_uid) && $this->createBenutzerfunktionData($data); } @@ -91,8 +91,8 @@ EOTXT; protected function createBenutzerfunktionData($data) { $this->benutzerfunktiondata = (object) array( - 'funktion_kurzbz' => $data->funktion_kurzbz, - 'oe_kurzbz' => $data->oe_kurzbz, + 'funktion_kurzbz' => $data->funktion, + 'oe_kurzbz' => $data->orget, 'uid' => $data->mitarbeiter_uid, 'datum_von' => $this->getVon(), 'datum_bis' => $this->getBis(), From 234820490ccabd8a3b9b4f2ed6598b173004b8b0 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 11 Apr 2023 15:44:34 +0200 Subject: [PATCH 038/263] variable names --- .../vertragsbestandteil/VertragsbestandteilFunktion.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php b/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php index 1ac6d96b0..5b24fa89e 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php @@ -71,9 +71,9 @@ EOTXT; public function hydrateByStdClass($data) { parent::hydrateByStdClass($data); - isset($data->benutzerfunktion_id) && $this->setBenutzerfunktion_id($data->benutzerfunktion_id); + isset($data->benutzerfunktionid) && $this->setBenutzerfunktion_id($data->benutzerfunktionid); isset($data->funktion) && isset($data->orget) - && isset($mitarbeiter_uid) && $this->createBenutzerfunktionData($data); + && isset($data->mitarbeiter_uid) && $this->createBenutzerfunktionData($data); } From 3ff024fc69c922763e76aa0138e8943ba13f673e Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 11 Apr 2023 15:51:23 +0200 Subject: [PATCH 039/263] fix date format --- .../vertragsbestandteil/VertragsbestandteilFunktion.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php b/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php index 5b24fa89e..a0ab364e0 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php @@ -35,7 +35,7 @@ class VertragsbestandteilFunktion extends Vertragsbestandteil return; } - $ret = $this->BenutzerfunktionModel->insert($this->benutzerfunktiondata); + $ret = $this->CI->BenutzerfunktionModel->insert($this->benutzerfunktiondata); if(isError($ret) ) { @@ -96,7 +96,7 @@ EOTXT; 'uid' => $data->mitarbeiter_uid, 'datum_von' => $this->getVon(), 'datum_bis' => $this->getBis(), - 'insertamum' => strftime('%Y-%m-%d %H:%M:%s'), + 'insertamum' => strftime('%Y-%m-%d %H:%M:%S'), 'insertvon' => getAuthUID() ); } From 92e23ea585ae6d3df08fe3cd2903910b2dbd24d4 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 11 Apr 2023 16:47:44 +0200 Subject: [PATCH 040/263] add requires for vbs zeitaufzeichnung and kuendigungsfrist --- .../libraries/vertragsbestandteil/VertragsbestandteilLib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php index 50198f82f..c0c3716e8 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php @@ -2,6 +2,8 @@ require_once __DIR__ . '/Vertragsbestandteil.php'; require_once __DIR__ . '/VertragsbestandteilStunden.php'; require_once __DIR__ . '/VertragsbestandteilFunktion.php'; +require_once __DIR__ . '/VertragsbestandteilZeitaufzeichnung.php'; +require_once __DIR__ . '/VertragsbestandteilKuendigungsfrist.php'; require_once __DIR__ . '/VertragsbestandteilFactory.php'; use vertragsbestandteil\Vertragsbestandteil; From c929fa87024640f1225356c3f91ed091ea97c2d2 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 11 Apr 2023 16:59:21 +0200 Subject: [PATCH 041/263] add freitext require, adapt freitext to current db --- .../VertragsbestandteilFreitext.php | 28 +++++++++---------- .../VertragsbestandteilLib.php | 1 + 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilFreitext.php b/application/libraries/vertragsbestandteil/VertragsbestandteilFreitext.php index b1beefa43..8109fb64c 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilFreitext.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilFreitext.php @@ -6,9 +6,9 @@ use vertragsbestandteil\VertragsbestandteilFactory; class VertragsbestandteilFreitext extends Vertragsbestandteil { - protected $anmerkung; - protected $kuendigungrelevant; protected $freitexttyp_kurzbz; + protected $titel; + protected $anmerkung; public function __construct() { @@ -19,18 +19,18 @@ class VertragsbestandteilFreitext extends Vertragsbestandteil public function hydrateByStdClass($data) { parent::hydrateByStdClass($data); - isset($data->anmerkung) && $this->setAnmerkung($data->anmerkung); - isset($data->kuendigungrelevant) && $this->setKuendigungrelevant($data->kuendigungrelevant); isset($data->freitexttyp_kurzbz) && $this->setFreitexttypKurzbz($data->freitexttyp_kurzbz); + isset($data->titel) && $this->setTitel($data->titel); + isset($data->freitext) && $this->setAnmerkung($data->freitext); } public function toStdClass(): \stdClass { $tmp = array( 'vertragsbestandteil_id' => $this->getVertragsbestandteil_id(), - 'anmerkung' => $this->getAnmerkung(), - 'kuendigungrelevant' => $this->getKuendigungrelevant(), - 'freitexttyp_kurzbz' => $this->getFreitexttypKurzbz() + 'freitexttyp_kurzbz' => $this->getFreitexttypKurzbz(), + 'titel' => $this->getTitel(), + 'anmerkung' => $this->getAnmerkung() ); $tmp = array_filter($tmp, function($v) { @@ -44,7 +44,7 @@ class VertragsbestandteilFreitext extends Vertragsbestandteil { $txt = <<getAnmerkung()} - kuendigungrelevant: {$this->getKuendigungrelevant()} + titel: {$this->getTitel()} freitexttyp_kurzbz: {$this->getFreitexttypKurzbz()} EOTXT; @@ -70,19 +70,19 @@ EOTXT; } /** - * Get the value of kuendigungrelevant + * Get the value of titel */ - public function getKuendigungrelevant() + public function getTitel() { - return $this->kuendigungrelevant; + return $this->titel; } /** - * Set the value of kuendigungrelevant + * Set the value of titel */ - public function setKuendigungrelevant($kuendigungrelevant): self + public function setTitel($titel): self { - $this->kuendigungrelevant = $kuendigungrelevant; + $this->titel = $titel; return $this; } diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php index c0c3716e8..38b152523 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php @@ -4,6 +4,7 @@ require_once __DIR__ . '/VertragsbestandteilStunden.php'; require_once __DIR__ . '/VertragsbestandteilFunktion.php'; require_once __DIR__ . '/VertragsbestandteilZeitaufzeichnung.php'; require_once __DIR__ . '/VertragsbestandteilKuendigungsfrist.php'; +require_once __DIR__ . '/VertragsbestandteilFreitext.php'; require_once __DIR__ . '/VertragsbestandteilFactory.php'; use vertragsbestandteil\Vertragsbestandteil; From e7f23643d442581425aa660b2df0c6f87c5cec5d Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 11 Apr 2023 17:05:20 +0200 Subject: [PATCH 042/263] fix data property name --- .../vertragsbestandteil/VertragsbestandteilFreitext.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilFreitext.php b/application/libraries/vertragsbestandteil/VertragsbestandteilFreitext.php index 8109fb64c..c878dc24b 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilFreitext.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilFreitext.php @@ -19,7 +19,7 @@ class VertragsbestandteilFreitext extends Vertragsbestandteil public function hydrateByStdClass($data) { parent::hydrateByStdClass($data); - isset($data->freitexttyp_kurzbz) && $this->setFreitexttypKurzbz($data->freitexttyp_kurzbz); + isset($data->freitexttyp) && $this->setFreitexttypKurzbz($data->freitexttyp); isset($data->titel) && $this->setTitel($data->titel); isset($data->freitext) && $this->setAnmerkung($data->freitext); } From fe6a8d56259687a24d69c2cf7964aa9d48d46587 Mon Sep 17 00:00:00 2001 From: Werner Masik Date: Mon, 10 Apr 2023 19:08:22 +0200 Subject: [PATCH 043/263] fixed wrong JSON-Mapping for GUIOptions --- .../vertragsbestandteil/gui/GUIGueltigkeit.php | 2 +- system/UnitTests/AppdatenTest.php | 10 ++++++---- system/UnitTests/FunctionsTest.php | 9 +++++---- .../UnitTests/vertragsbestandteil/gui/FormDataTest.php | 10 +++++----- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/application/libraries/vertragsbestandteil/gui/GUIGueltigkeit.php b/application/libraries/vertragsbestandteil/gui/GUIGueltigkeit.php index c1acec672..0caee1114 100644 --- a/application/libraries/vertragsbestandteil/gui/GUIGueltigkeit.php +++ b/application/libraries/vertragsbestandteil/gui/GUIGueltigkeit.php @@ -38,7 +38,7 @@ class GUIGueltigkeit implements JsonSerializable { { throw new \Exception('missing guioptions'); } - $this->getJSONData($this->guioptions, $decodedData, 'guioptions'); + $this->guioptions = $decodedData; } private function mapData(&$decoded) diff --git a/system/UnitTests/AppdatenTest.php b/system/UnitTests/AppdatenTest.php index 30848cc12..2de140018 100644 --- a/system/UnitTests/AppdatenTest.php +++ b/system/UnitTests/AppdatenTest.php @@ -22,11 +22,13 @@ * Authors: Werner Masik * */ -require_once('../../config/system.config.inc.php'); -require_once('../../include/appdaten.class.php'); -require_once('../../include/benutzer.class.php'); +require_once( __DIR__.'/../../config/system.config.inc.php'); +require_once( __DIR__.'/../../include/appdaten.class.php'); +require_once( __DIR__.'/../../include/benutzer.class.php'); -class AppdatenTest extends PHPUnit_Framework_TestCase +use PHPUnit\Framework\TestCase; + +class AppdatenTest extends TestCase { protected $benutzer; protected $uid = 'unittest'; diff --git a/system/UnitTests/FunctionsTest.php b/system/UnitTests/FunctionsTest.php index 9531a22a7..3bb199422 100644 --- a/system/UnitTests/FunctionsTest.php +++ b/system/UnitTests/FunctionsTest.php @@ -18,12 +18,13 @@ * Authors: Werner Masik , */ + + +require_once(__DIR__.'/../../config/vilesci.config.inc.php'); +require_once(__DIR__.'/../../include/functions.inc.php'); + use PHPUnit\Framework\TestCase; - -require_once('../../config/vilesci.config.inc.php'); -require_once('../../include/functions.inc.php'); - class FunctionsTest extends TestCase { diff --git a/system/UnitTests/vertragsbestandteil/gui/FormDataTest.php b/system/UnitTests/vertragsbestandteil/gui/FormDataTest.php index c25892670..7bfaee017 100644 --- a/system/UnitTests/vertragsbestandteil/gui/FormDataTest.php +++ b/system/UnitTests/vertragsbestandteil/gui/FormDataTest.php @@ -19,17 +19,17 @@ class FormDataTest extends TestCase $decoded = json_decode($jsondata, true); $formDataMapper->mapJSON($decoded); // Dienstverhaeltnis - $dataDV = $formDataMapper->getData(); + $dataDV = $formDataMapper->getData(); $this->assertNotEmpty($dataDV); $this->assertNotEmpty($dataDV['unternehmen']); $this->assertEquals('gst', $dataDV['unternehmen']); $this->assertNull($dataDV['dienstverhaeltnisid']); $this->assertNotEmpty($dataDV['vertragsart_kurzbz']); - $this->assertEquals('echterDV', $dataDV['vertragsart_kurzbz']); + $this->assertEquals('echterdv', $dataDV['vertragsart_kurzbz']); $this->assertNotEmpty($dataDV['gueltigkeit']); - $this->assertNotEmpty($dataDV['gueltigkeit']['guioptions']); - $this->assertNotEmpty($dataDV['gueltigkeit']['data']); - $this->assertNotEmpty($dataDV['gueltigkeit']['data']['gueltig_ab']); + $this->assertNotEmpty($dataDV['gueltigkeit']->getGuioptions()); + $this->assertNotEmpty($dataDV['gueltigkeit']->getData()); + $this->assertNotEmpty($dataDV['gueltigkeit']->getData()['gueltig_ab']); // Vertragsbestandteile $vbs = $formDataMapper->getVbs(); $this->assertNotEmpty($vbs); From 2b03fcc930ab2e7ecda366657afa287811cc47f2 Mon Sep 17 00:00:00 2001 From: Werner Masik Date: Wed, 12 Apr 2023 09:41:07 +0200 Subject: [PATCH 044/263] removed GUI handling and renamed Gehaltsbestandteil to make it independend from Vertragsbestandteil --- .../vertragsbestandteil/Dienstverhaeltnis.php | 2 +- ...dteilGehalt.php => Gehaltsbestandteil.php} | 90 ++++---- .../gui/AbstractBestandteil.php | 86 ------- .../gui/AbstractGUIVertragsbestandteil.php | 143 ------------ .../vertragsbestandteil/gui/FormData.php | 109 --------- .../gui/GUIGehaltsbestandteil.php | 89 -------- .../gui/GUIGueltigkeit.php | 76 ------- .../vertragsbestandteil/gui/GUIHandler.php | 215 ------------------ .../gui/GUIHandlerFactory.php | 36 --- .../gui/GUIVertragsbestandteilFunktion.php | 135 ----------- ...GUIVertragsbestandteilKuendigungsfrist.php | 118 ---------- .../gui/GUIVertragsbestandteilStunden.php | 139 ----------- ...GUIVertragsbestandteilZeitaufzeichnung.php | 103 --------- ...IVertragsbestandteilZusatzvereinbarung.php | 139 ----------- .../vertragsbestandteil/gui/JSONData.php | 53 ----- .../vertragsbestandteil/gui/util.php | 8 - 16 files changed, 44 insertions(+), 1497 deletions(-) rename application/libraries/vertragsbestandteil/{VertragsbestandteilGehalt.php => Gehaltsbestandteil.php} (74%) delete mode 100644 application/libraries/vertragsbestandteil/gui/AbstractBestandteil.php delete mode 100644 application/libraries/vertragsbestandteil/gui/AbstractGUIVertragsbestandteil.php delete mode 100644 application/libraries/vertragsbestandteil/gui/FormData.php delete mode 100644 application/libraries/vertragsbestandteil/gui/GUIGehaltsbestandteil.php delete mode 100644 application/libraries/vertragsbestandteil/gui/GUIGueltigkeit.php delete mode 100644 application/libraries/vertragsbestandteil/gui/GUIHandler.php delete mode 100644 application/libraries/vertragsbestandteil/gui/GUIHandlerFactory.php delete mode 100644 application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilFunktion.php delete mode 100644 application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilKuendigungsfrist.php delete mode 100644 application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilStunden.php delete mode 100644 application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilZeitaufzeichnung.php delete mode 100644 application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilZusatzvereinbarung.php delete mode 100644 application/libraries/vertragsbestandteil/gui/JSONData.php delete mode 100644 application/libraries/vertragsbestandteil/gui/util.php diff --git a/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php b/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php index c7820f65a..aa89fe781 100644 --- a/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php +++ b/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php @@ -15,7 +15,7 @@ class Dienstverhaeltnis { /** @var integer */ protected $dienstverhaeltnis_id; /** @var integer */ - protected $unternehmen; // TODO link zu orgeinheit + protected $unternehmen; /** @var string */ protected $vertragsart_kurzbz; protected $gueltig_ab; diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilGehalt.php b/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php similarity index 74% rename from application/libraries/vertragsbestandteil/VertragsbestandteilGehalt.php rename to application/libraries/vertragsbestandteil/Gehaltsbestandteil.php index cdb06b26b..e911c4228 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilGehalt.php +++ b/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php @@ -1,17 +1,16 @@ setVertragsbestandteiltyp_kurzbz( - VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_GEHALT); - } + { + } - public function hydrateByStdClass($data) - { - parent::hydrateByStdClass($data); - isset($data->gehalt_von) && $this->setGehaltVon($data->gehalt_von); - isset($data->gehalt_bis) && $this->setGehaltBis($data->gehalt_bis); - isset($data->anmerkung) && $this->setAnmerkung($data->anmerkung); - isset($data->gehalt_dienstverhaeltnis_id) && $this->setGehaltDienstverhaeltnisID($data->gehalt_dienstverhaeltnis_id); - isset($data->gehaltstyp_kurzbz) && $this->setGehaltstypKurzbz($data->gehaltstyp_kurzbz); - isset($data->valorisierungssperre) && $this->setValorisierungssperre($data->valorisierungssperre); - } - - public function getGehaltVon() - { - return $this->gehalt_von; - } - - public function getGehaltBis() - { - return $this->gehalt_bis; - } - - public function setGehaltVon($von) - { - $this->gehalt_von = $von; - return $this; - } - - public function setGehaltBis($bis) - { - $this->gehalt_bis = $bis; - return $this; - } /** * Get the value of gehaltsbestandteil_id @@ -203,16 +168,11 @@ class VertragsbestandteilGehalt extends Vertragsbestandteil return $this; } - - - public function toStdClass(): \stdClass { $tmp = array( - 'von' => $this->getVon(), - 'bis' => $this->getBis(), - 'gehalt_von' => $this->getGehaltVon(), - 'gehalt_bis' => $this->getGehaltBis(), + 'gueltig_ab' => $this->getGueltigAb(), + 'gueltig_bis' => $this->getGueltigBis(), 'gehalt_dienstverhaeltnis_id' => $this->getGehaltDienstverhaeltnisID(), 'grundbetrag' => $this->getGrundbetrag(), 'betrag_valorisiert' => $this->getBetragValorisiert(), @@ -242,4 +202,40 @@ EOTXT; } + + /** + * Get the value of gueltig_ab + */ + public function getGueltigAb() + { + return $this->gueltig_ab; + } + + /** + * Set the value of gueltig_ab + */ + public function setGueltigAb($gueltig_ab): self + { + $this->gueltig_ab = $gueltig_ab; + + return $this; + } + + /** + * Get the value of gueltig_bis + */ + public function getGueltigBis() + { + return $this->gueltig_bis; + } + + /** + * Set the value of gueltig_bis + */ + public function setGueltigBis($gueltig_bis): self + { + $this->gueltig_bis = $gueltig_bis; + + return $this; + } } diff --git a/application/libraries/vertragsbestandteil/gui/AbstractBestandteil.php b/application/libraries/vertragsbestandteil/gui/AbstractBestandteil.php deleted file mode 100644 index 861dcf11a..000000000 --- a/application/libraries/vertragsbestandteil/gui/AbstractBestandteil.php +++ /dev/null @@ -1,86 +0,0 @@ -getTypeString())) - { - throw new \Exception('wrong type string: "'.$decoded['type'].'" should be "'.$this->getTypeString().'"'); - } - } - - /** - * Get the value of type - */ - public function getType() - { - return $this->type; - } - - /** - * Set the value of type - */ - public function setType($type): self - { - $this->type = $type; - - return $this; - } - - /** - * Get the value of guioptions - */ - public function getGuioptions() - { - return $this->guioptions; - } - - /** - * Set the value of guioptions - */ - public function setGuioptions($guioptions): self - { - $this->guioptions = $guioptions; - - return $this; - } - - /** - * Get the value of data - */ - public function getData() - { - return $this->data; - } - - /** - * Set the value of data - */ - public function setData($data): self - { - $this->data = $data; - - return $this; - } -} \ No newline at end of file diff --git a/application/libraries/vertragsbestandteil/gui/AbstractGUIVertragsbestandteil.php b/application/libraries/vertragsbestandteil/gui/AbstractGUIVertragsbestandteil.php deleted file mode 100644 index 63906e42e..000000000 --- a/application/libraries/vertragsbestandteil/gui/AbstractGUIVertragsbestandteil.php +++ /dev/null @@ -1,143 +0,0 @@ -vbsLib = new VertragsbestandteilLib(); - } - - abstract public function generateVertragsbestandteil($id); - - /** - * Get the value of uuid - */ - public function getUuid() - { - return $this->uuid; - } - - /** - * Set the value of uuid - */ - public function setUuid($uuid): self - { - $this->uuid = $uuid; - - return $this; - } - - - - /** - * Get the value of hasGBS - */ - public function getHasGBS() - { - return $this->hasGBS; - } - - /** - * Set the value of hasGBS - */ - public function setHasGBS($hasGBS): self - { - $this->hasGBS = $hasGBS; - - return $this; - } - - - - /** - * Get the value of gbs - */ - public function getGbs() - { - return $this->gbs; - } - - /** - * Set the value of gbs - */ - public function setGbs($gbs): self - { - $this->gbs = $gbs; - - return $this; - } -} \ No newline at end of file diff --git a/application/libraries/vertragsbestandteil/gui/FormData.php b/application/libraries/vertragsbestandteil/gui/FormData.php deleted file mode 100644 index fe3f761f6..000000000 --- a/application/libraries/vertragsbestandteil/gui/FormData.php +++ /dev/null @@ -1,109 +0,0 @@ -checkType($decoded); - // preserve gui data - $this->mapChildren($decoded); - // data contains DV - $this->mapData($decoded); - // vbs array - $this->mapVbs($decoded); - } - - public function generateJSON() - { - $json = json_encode([ - "children" => $this->children, - "data" => $this->generateDvJSON(), - "vbs" => $this->generateVbsJSON() - ]); - return $json; - } - - private function mapChildren(&$decoded) - { - $decodedData = null; - if (!$this->getJSONData($decodedData, $decoded, 'children')) - { - throw new \Exception('missing children'); - } - $this->getJSONData($this->data['children'], $decodedData, 'children'); - } - - private function mapData(&$decoded) - { - $decodedData = null; - if (!$this->getJSONData($decodedData, $decoded, 'data')) - { - throw new \Exception('missing data'); - } - - $this->getJSONDataInt($this->data['dienstverhaeltnisid'], $decodedData, 'dienstverhaeltnisid'); - $this->getJSONData($this->data['unternehmen'], $decodedData, 'unternehmen'); - $this->getJSONData($this->data['vertragsart_kurzbz'], $decodedData, 'vertragsart_kurzbz'); - $gueltigkeit = new GUIGueltigkeit(); - $gueltigkeit->mapJSON($decodedData['gueltigkeit']); - $this->data['gueltigkeit'] = $gueltigkeit; - //$this->getJSONData($this->data['gueltigkeit'], $decodedData, 'gueltigkeit'); - } - - private function generateDvJSON() - { - return json_encode($this->data); - } - - - private function mapVbs(&$decoded) - { - if (!$this->getJSONData($this->vbs, $decoded, 'vbs')) - { - throw new \Exception('missing vbs'); - } - //$this->getJSONData($this->vbs, $decodedData, 'vbs'); - } - - private function generateVbsJSON() - { - return json_encode($this->vbs); - } - - /** - * Get the value of children - */ - public function getChildren() - { - return $this->children; - } - - - /** - * Get the value of vbs - */ - public function getVbs() - { - return $this->vbs; - } - - -} \ No newline at end of file diff --git a/application/libraries/vertragsbestandteil/gui/GUIGehaltsbestandteil.php b/application/libraries/vertragsbestandteil/gui/GUIGehaltsbestandteil.php deleted file mode 100644 index 713ee64a0..000000000 --- a/application/libraries/vertragsbestandteil/gui/GUIGehaltsbestandteil.php +++ /dev/null @@ -1,89 +0,0 @@ -type = GUIVertragsbestandteilStunden::TYPE_STRING; - $this-> guioptions = ["id" => null, "infos" => [], "errors" => [], "removeable" => true]; - $this->data = [ "gehaltstyp" => "", - "betrag" => "", - "gueltigkeit" => [ - "guioptions" => ["sharedstatemode" => "reflect"], - "data" => ["gueltig_ab" => "", "gueltig_bis" => ""] - ], - "valorisierung" => true - ]; - } - - public function getTypeString(): string - { - return GUIGehaltsbestandteil::TYPE_STRING; - } - - public function mapJSON(&$decoded) - { - //$decoded = json_decode($jsondata); - $this->checkType($decoded); - $this->mapGUIOptions($decoded); - $this->mapData($decoded); - } - - private function mapGUIOptions(&$decoded) - { - $decodedGUIOptions = null; - if (!$this->getJSONData($decodedGUIOptions, $decoded, 'guioptions')) - { - throw new \Exception('missing guioptions'); - } - $this->getJSONData($this->guioptions, $decodedGUIOptions, 'id'); - $this->getJSONData($this->guioptions, $decodedGUIOptions, 'infos'); - $this->getJSONData($this->guioptions, $decodedGUIOptions, 'errors'); - $this->getJSONData($this->guioptions, $decodedGUIOptions, 'removable'); - } - - private function mapData(&$decoded) - { - $decodedData = null; - if (!$this->getJSONData($decodedData, $decoded, 'data')) - { - throw new \Exception('missing data'); - } - $this->getJSONData($this->data['id'], $decodedData, 'id'); - $this->getJSONData($this->data['gehaltstyp'], $decodedData, 'gehaltstyp'); - $this->getJSONDataInt($this->data['betrag'], $decodedData, 'betrag'); - $gueltigkeit = new GUIGueltigkeit(); - $gueltigkeit->mapJSON($decodedData['gueltigkeit']); - $this->data['gueltigkeit'] = $gueltigkeit; - $this->getJSONData($this->data['valorisierung'], $decodedData, 'valorisierung'); - } - -} \ No newline at end of file diff --git a/application/libraries/vertragsbestandteil/gui/GUIGueltigkeit.php b/application/libraries/vertragsbestandteil/gui/GUIGueltigkeit.php deleted file mode 100644 index 0caee1114..000000000 --- a/application/libraries/vertragsbestandteil/gui/GUIGueltigkeit.php +++ /dev/null @@ -1,76 +0,0 @@ -mapGuioptions($decoded); - $this->mapData($decoded); - } - - private function mapGuioptions(&$decoded) - { - $decodedData = null; - if (!$this->getJSONData($decodedData, $decoded, 'guioptions')) - { - throw new \Exception('missing guioptions'); - } - $this->guioptions = $decodedData; - } - - private function mapData(&$decoded) - { - $decodedData = null; - if (!$this->getJSONData($decodedData, $decoded, 'data')) - { - throw new \Exception('missing data'); - } - $this->getJSONData($this->data['gueltig_ab'], $decodedData, 'gueltig_ab'); - $this->getJSONData($this->data['gueltig_bis'], $decodedData, 'gueltig_bis'); - - } - - /** - * Get the value of guioptions - */ - public function getGuioptions() - { - return $this->guioptions; - } - - /** - * Get the value of data - */ - public function getData() - { - return $this->data; - } - - public function jsonSerialize() { - return ["guioptions" => $this->guioptions, - "data" => $this->data]; - } -} \ No newline at end of file diff --git a/application/libraries/vertragsbestandteil/gui/GUIHandler.php b/application/libraries/vertragsbestandteil/gui/GUIHandler.php deleted file mode 100644 index 5ccf9d421..000000000 --- a/application/libraries/vertragsbestandteil/gui/GUIHandler.php +++ /dev/null @@ -1,215 +0,0 @@ -employeeUID = $employeeUID; - $this->userUID = $userUID; - $this->CI = get_instance(); - $this->CI->load->model('vertragsbestandteil/Dienstverhaeltnis_model', - 'Dienstverhaeltnis_model'); - $this->CI->load->library('vertragsbestandteil/VertragsbestandteilLib', - null, 'VertragsbestandteilLib'); - - - } - - /** - * main entry (called from VetragsbestandteilLib) - * @param string $guidata JSON submitted by editor - * @param string $employeeUID uid of the employee - * @param string $userUID uid of the user currently editing the employee data - * @return string JSON for GUI client - */ - public function handle($guidata) - { - $decoded = json_decode($guidata, true); - $formDataMapper = new FormData(); - $formDataMapper->mapJSON($decoded); - - // DV - $dvData = $formDataMapper->getData(); - $res = $this->handleDV($dvData); - - if ($res === false) - { - // TODO write error message - } else { - - // VBS - $vbsList = $formDataMapper->getVbs(); - - foreach ($vbsList as $vbsID => $vbs) { - $this->handleVBS($dvData['dienstverhaeltnisid'] ,$vbs); - } - } - - return $formDataMapper->generateJSON(); - } - - /** - * dienstverhaeltnisid - * unternehmen - * vertragsart_kurzbz - * gueltigkeit - */ - private function handleDV(&$dv) - { - $dienstverhaeltnisid = $dv['dienstverhaeltnisid']; - - if (isset($dienstverhaeltnisid) && intval($dienstverhaeltnisid > 0)) - { - // DV exists - $res = $this->updateDV($dv); - if (isSuccess($res)) - { - return true; - } - } else { - // DV is new - $res = $this->insertDV($dv); - if (isSuccess($res)) - { - // write back new id - $dv['dienstverhaeltnisid'] = $res->retval[0]->dienstverhaeltnis_id; - return true; - } - - } - - return false; - - } - - private function handleVBS($dienstverhaeltnis_id, $vbs) - { - /** @var GUIVertragsbestandteilFunktion */ - $vbsMapper = GUIHandlerFactory::getGUIHandler($vbs['type']); - $vbsMapper->mapJSON($vbs); - $vbsData = $vbsMapper->getData(); - - // merge GUI-Data with DB-Data - $vbsInstance = $vbsMapper->generateVertragsbestandteil(isset($vbsData['id'])?$vbsData['id']:null); - if ($vbsInstance->getDienstverhaeltnis_id() === null) - { - $vbsInstance->setDienstverhaeltnis_id($dienstverhaeltnis_id); - $vbsInstance->setInsertvon($this->userUID); - $vbsInstance->setInsertamum((new DateTime())->format("Y-m-d h:m:s")); - } else { - $vbsInstance->setUpdatevon($this->userUID); - $vbsInstance->setUpdateamum((new DateTime())->format("Y-m-d h:m:s")); - } - - // TODO Validate? - - // store - $this->CI->VertragsbestandteilLib->storeVertragsbestandteil($vbsInstance); - - // GBS - /* - foreach ($vbsMapper->getGbs() as $gbs) - { - $gbsData = $gbs->getData(); - $this->handleGBS($gbsData); - }*/ - } - - - // GBS without connection to VBS - private static function handleGBS($gbs) - { - // TODO - } - - - // ------------------------------------ - // DV does not have a dedicated handler - private function insertDV($dvJSON) - { - $dvJSON['mitarbeiter_uid'] = $this->employeeUID; - $now = new DateTime(); - $dvJSON['von'] = string2Date($dvJSON['gueltigkeit']->getData()['gueltig_ab']); - $dvJSON['bis'] = string2Date($dvJSON['gueltigkeit']->getData()['gueltig_bis']); - $dvJSON['oe_kurzbz'] = $dvJSON['unternehmen']; - $dvJSON['insertvon'] = $this->userUID; - $dvJSON['insertamum'] = $now->format(DateTime::ATOM); - - unset($dvJSON['dienstverhaeltnisid']); - unset($dvJSON['children']); - unset($dvJSON['gueltigkeit']); - unset($dvJSON['unternehmen']); - - $result = $this->CI->Dienstverhaeltnis_model->insert($dvJSON); - - if (isError($result)) - { - throw Exception($result->msg); - } - - $record = $this->CI->Dienstverhaeltnis_model->load($result->retval); - - return $record; - } - - private function updateDV($dvJSON) - { - $dvJSON['mitarbeiter_uid'] = $this->employeeUID; - $dvJSON['von'] = string2Date($dvJSON['gueltigkeit']->getData()['gueltig_ab']); - $dvJSON['bis'] = string2Date($dvJSON['gueltigkeit']->getData()['gueltig_bis']); - $dvJSON['oe_kurzbz'] = $dvJSON['unternehmen']; - $now = new DateTime(); - $dvJSON['updatevon'] = $this->userUID; - $dvJSON['updateamum'] = $now->format(DateTime::ATOM); - $dvJSON['dienstverhaeltnis_id'] = $dvJSON['dienstverhaeltnisid']; - - unset($dvJSON['insertamum']); - unset($dvJSON['insertvon']); - unset($dvJSON['dienstverhaeltnisid']); - unset($dvJSON['children']); - unset($dvJSON['gueltigkeit']); - unset($dvJSON['unternehmen']); - - $result = $this->CI->Dienstverhaeltnis_model->update($dvJSON); - //$result = $this->CI->Dienstverhaeltnis_model->update($dvJSON['kontakt_id'], $dvJSON); - - if (isError($result)) - { - return error($result->msg, EXIT_ERROR); - } - - $record = $this->CI->Dienstverhaeltnis_model->load($result->retval); - - return $record; - } - - private function deleteDV($dv_id) - { - $result = $this->CI->Dienstverhaeltnis_model->delete($dv_id); - - if (isError($result)) - { - return error($result->msg, EXIT_ERROR); - } - - return success($dv_id); - } - -} \ No newline at end of file diff --git a/application/libraries/vertragsbestandteil/gui/GUIHandlerFactory.php b/application/libraries/vertragsbestandteil/gui/GUIHandlerFactory.php deleted file mode 100644 index e0140755b..000000000 --- a/application/libraries/vertragsbestandteil/gui/GUIHandlerFactory.php +++ /dev/null @@ -1,36 +0,0 @@ -type = GUIVertragsbestandteilFunktion::TYPE_STRING; - $this->hasGBS = true; - $this-> guioptions = ["id" => null, "infos" => [], "errors" => [], "removeable" => false]; - $this->data = ["funktion" => "Leitung", - "orget" => "", - "gueltigkeit" => [ - "guioptions" => ["sharedstatemode" => "reflect"], - "data" => ["gueltig_ab" => "", "gueltig_bis" => ""] - ] - ]; - $this->gbs = []; - } - - public function getTypeString(): string - { - return GUIVertragsbestandteilFunktion::TYPE_STRING; - } - - /** - * parse JSON into object - * @param string $jsondata - */ - public function mapJSON(&$decoded) - { - $this->checkType($decoded); - $this->mapGUIOptions($decoded); - $this->mapData($decoded); - $this->mapGBS($decoded); - } - - /** - * ["id" => null, - * "infos" => [], - * "errors" => [], - * "removeable" => true - * ] - * @param mixed $decoded decoded JSON data (use associative array) - */ - private function mapGUIOptions(&$decoded) - { - $decodedGUIOptions = null; - if (!$this->getJSONData($decodedGUIOptions, $decoded, 'guioptions')) - { - throw new \Exception('missing guioptions'); - } - $this->getJSONData($this->guioptions, $decodedGUIOptions, 'id'); - $this->getJSONData($this->guioptions, $decodedGUIOptions, 'infos'); - $this->getJSONData($this->guioptions, $decodedGUIOptions, 'errors'); - $this->getJSONDataBool($this->guioptions, $decodedGUIOptions, 'removable'); - } - - /** - * { - * "funktion": "Leitung", - * "orget": "sdf", - * "gueltigkeit": { - * "guioptions": { - * "sharedstatemode": "reflect" - * }, - * "data": { - * "gueltig_ab": "", - * "gueltig_bis": "" - * } - * } - * } - */ - private function mapData(&$decoded) - { - $decodedData = null; - if (!$this->getJSONData($decodedData, $decoded, 'data')) - { - throw new \Exception('missing data'); - } - $this->getJSONData($this->data['funktion'], $decodedData, 'funktion'); - $this->getJSONData($this->data['orget'], $decodedData, 'orget'); - $gueltigkeit = new GUIGueltigkeit(); - $gueltigkeit->mapJSON($decodedData['gueltigkeit']); - $this->data['gueltigkeit'] = $gueltigkeit; - } - - private function mapGBS(&$decoded) - { - //echo "gbs: ";var_dump($decoded); - $decodedGbsList = []; - if (!$this->getJSONData($decodedGbsList, $decoded, 'gbs')) - { - throw new \Exception('missing gbs'); - } - $guiGBS = null; - foreach ($decodedGbsList as $decodedGbs) { - $guiGBS = new GUIGehaltsbestandteil(); - $guiGBS->mapJSON($decodedGbs); - $this->gbs[] = $guiGBS; - } - } - - - public function generateVertragsbestandteil($id) { - /** @var vertragsbestandteil\VertragsbestandteilFunktion */ - $vbs = null; - if (isset($vbsData['id']) && $vbsData['id'] > 0) - { - // load VBS - $vbs = $this->vbsLib->fetchVertragsbestandteil($vbsData['id']); - } else { - $vbs = new vertragsbestandteil\VertragsbestandteilFunktion(); - } - // merge - $vbs->setBenutzerfunktion_id($this->data['benutzerfunktionid']); - $vbs->setVon(string2Date($this->data['gueltigkeit']->getData()['gueltig_ab'])); - $vbs->setBis(string2Date($this->data['gueltigkeit']->getData()['gueltig_bis'])); - return $vbs; - } - - public function jsonSerialize() { - return [ - "type" => $this->type, - "guioptions" => $this->guioptions, - "data" => $this->data, - "gbs" => $this->gbs]; - } - -} \ No newline at end of file diff --git a/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilKuendigungsfrist.php b/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilKuendigungsfrist.php deleted file mode 100644 index 8d706ef26..000000000 --- a/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilKuendigungsfrist.php +++ /dev/null @@ -1,118 +0,0 @@ -type = GUIVertragsbestandteilKuendigungsfrist::TYPE_STRING; - $this->hasGBS = false; - $this-> guioptions = ["id" => null, "infos" => [], "errors" => [], "removeable" => true]; - $this->data = ["arbeitnehmer_frist" => "", - "arbeitgeber_frist" => "", - "gueltigkeit" => [ - "guioptions" => ["sharedstatemode" => "reflect"], - "data" => ["gueltig_ab" => "", "gueltig_bis" => ""] - ] - ]; - } - - public function getTypeString(): string - { - return GUIVertragsbestandteilKuendigungsfrist::TYPE_STRING; - } - - /** - * parse JSON into object - * @param string $jsondata - */ - public function mapJSON(&$decoded) - { - $this->checkType($decoded); - $this->mapGUIOptions($decoded); - $this->mapData($decoded); - } - - /** - * ["id" => null, - * "infos" => [], - * "errors" => [], - * "removeable" => true - * ] - * @param mixed $decoded decoded JSON data (use associative array) - */ - private function mapGUIOptions(&$decoded) - { - $decodedGUIOptions = null; - if (!$this->getJSONData($decodedGUIOptions, $decoded, 'guioptions')) - { - throw new \Exception('missing guioptions'); - } - $this->getJSONData($this->guioptions, $decodedGUIOptions, 'id'); - $this->getJSONData($this->guioptions, $decodedGUIOptions, 'infos'); - $this->getJSONData($this->guioptions, $decodedGUIOptions, 'errors'); - $this->getJSONDataBool($this->guioptions, $decodedGUIOptions, 'removable'); - } - - /** - */ - private function mapData(&$decoded) - { - $decodedData = null; - if (!$this->getJSONData($decodedData, $decoded, 'data')) - { - throw new \Exception('missing data'); - } - $this->getJSONDataInt($this->data['arbeitnehmer_frist'], $decodedData, 'arbeitnehmer_frist'); - $this->getJSONDataInt($this->data['arbeitgeber_frist'], $decodedData, 'arbeitgeber_frist'); - $this->getJSONData($this->data['gueltigkeit'], $decodedData, 'gueltigkeit'); - } - - private function mapGBS() - { - $decodedGbsList = []; - if (!$this->getJSONData($decodedGbsList, $decoded, 'gbs')) - { - throw new \Exception('missing gbs'); - } - $guiGBS = null; - foreach ($decodedGbsList as $decodedGbs) { - $guiGBS = new GUIGehaltsbestandteil(); - $guiGBS->mapJSON($decodedGbs); - } - } - - public function generateVertragsbestandteil($id) { - // TODO - } - - public function jsonSerialize() { - return [ - "type" => $this->type, - "guioptions" => $this->guioptions, - "data" => $this->data]; - } - -} \ No newline at end of file diff --git a/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilStunden.php b/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilStunden.php deleted file mode 100644 index 0e94ca16d..000000000 --- a/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilStunden.php +++ /dev/null @@ -1,139 +0,0 @@ -type = GUIVertragsbestandteilStunden::TYPE_STRING; - $this->hasGBS = true; - $this-> guioptions = ["id" => null, "infos" => [], "errors" => [], "removeable" => true]; - $this->data = ["stunden" => "", - "gueltigkeit" => [ - "guioptions" => ["sharedstatemode" => "reflect"], - "data" => ["gueltig_ab" => "", "gueltig_bis" => ""] - ] - ]; - $this->gbs = []; - } - - public function getTypeString(): string - { - return GUIVertragsbestandteilStunden::TYPE_STRING; - } - - /** - * parse JSON into object - * @param string $jsondata - */ - public function mapJSON(&$decoded) - { - $this->checkType($decoded); - $this->mapGUIOptions($decoded); - $this->mapData($decoded); - $this->mapGBS($decoded); - } - - /** - * ["id" => null, - * "infos" => [], - * "errors" => [], - * "removeable" => true - * ] - * @param mixed $decoded decoded JSON data (use associative array) - */ - private function mapGUIOptions(&$decoded) - { - $decodedGUIOptions = null; - if (!$this->getJSONData($decodedGUIOptions, $decoded, 'guioptions')) - { - throw new \Exception('missing guioptions'); - } - $this->getJSONData($this->guioptions, $decodedGUIOptions, 'id'); - $this->getJSONData($this->guioptions, $decodedGUIOptions, 'infos'); - $this->getJSONData($this->guioptions, $decodedGUIOptions, 'errors'); - $this->getJSONDataBool($this->guioptions, $decodedGUIOptions, 'removable'); - } - - /** - * { - * "stunden": "38,5", - * "gueltigkeit": { - * "guioptions": { - * "sharedstatemode": "reflect" - * }, - * "data": { - * "gueltig_ab": "1.1.2011", - * "gueltig_bis": "" - * } - * } - */ - private function mapData(&$decoded) - { - $decodedData = null; - if (!$this->getJSONData($decodedData, $decoded, 'data')) - { - throw new \Exception('missing data'); - } - $this->getJSONDataFloat($this->data['stunden'], $decodedData, 'stunden'); - $gueltigkeit = new GUIGueltigkeit(); - $gueltigkeit->mapJSON($decodedData['gueltigkeit']); - $this->data['gueltigkeit'] = $gueltigkeit; - } - - private function mapGBS(&$decoded) - { - $decodedGbsList = []; - if (!$this->getJSONData($decodedGbsList, $decoded, 'gbs')) - { - throw new \Exception('missing gbs'); - } - $guiGBS = null; - foreach ($decodedGbsList as $decodedGbs) { - $guiGBS = new GUIGehaltsbestandteil(); - $guiGBS->mapJSON($decodedGbs); - $this->gbs[] = $guiGBS; - } - } - - public function generateVertragsbestandteil($id) - { - $vbs = null; - if (isset($vbsData['id']) && $vbsData['id'] > 0) - { - // load VBS - $vbs = $this->vbsLib->fetchVertragsbestandteil($vbsData['id']); - } else { - $vbs = new vertragsbestandteil\VertragsbestandteilStunden(); - } - // merge - $vbs->setWochenstunden($this->data['stunden']); - $vbs->setVon(string2Date($this->data['gueltigkeit']->getData()['gueltig_ab'])); - $vbs->setBis(string2Date($this->data['gueltigkeit']->getData()['gueltig_bis'])); - return $vbs; - } - - public function jsonSerialize() { - return [ - "type" => $this->type, - "guioptions" => $this->guioptions, - "data" => $this->data, - "gbs" => $this->gbs]; - } - -} \ No newline at end of file diff --git a/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilZeitaufzeichnung.php b/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilZeitaufzeichnung.php deleted file mode 100644 index dacee544c..000000000 --- a/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilZeitaufzeichnung.php +++ /dev/null @@ -1,103 +0,0 @@ -type = GUIVertragsbestandteilZeitaufzeichnung::TYPE_STRING; - $this->hasGBS = false; - $this-> guioptions = ["id" => null, "infos" => [], "errors" => [], "removeable" => true]; - $this->data = null; - } - - public function getTypeString(): string - { - return GUIVertragsbestandteilZeitaufzeichnung::TYPE_STRING; - } - - /** - * parse JSON into object - * @param string $jsondata - */ - public function mapJSON(&$decoded) - { - $this->checkType($decoded); - $this->mapGUIOptions($decoded); - $this->mapData($decoded); - } - - /** - * ["id" => null, - * "infos" => [], - * "errors" => [], - * "removeable" => true - * ] - * @param mixed $decoded decoded JSON data (use associative array) - */ - private function mapGUIOptions(&$decoded) - { - $decodedGUIOptions = null; - if (!$this->getJSONData($decodedGUIOptions, $decoded, 'guioptions')) - { - throw new \Exception('missing guioptions'); - } - $this->getJSONData($this->guioptions, $decodedGUIOptions, 'id'); - $this->getJSONData($this->guioptions, $decodedGUIOptions, 'infos'); - $this->getJSONData($this->guioptions, $decodedGUIOptions, 'errors'); - $this->getJSONDataBool($this->guioptions, $decodedGUIOptions, 'removable'); - } - - private function mapData(&$decoded) - { - $decodedData = null; - if (!$this->getJSONData($decodedData, $decoded, 'data')) - { - throw new \Exception('missing data'); - } - $this->getJSONDataBool($this->data['zeitaufzeichnung'], $decodedData, 'zeitaufzeichnung'); - $this->getJSONDataBool($this->data['azgrelevant'], $decodedData, 'azgrelevant'); - $this->getJSONDataBool($this->data['homeoffice'], $decodedData, 'homeoffice'); - $gueltigkeit = new GUIGueltigkeit(); - $gueltigkeit->mapJSON($decodedData['gueltigkeit']); - $this->data['gueltigkeit'] = $gueltigkeit; - } - - public function generateVertragsbestandteil($id) { - // TODO - } - - public function jsonSerialize() { - return [ - "type" => $this->type, - "guioptions" => $this->guioptions, - "data" => $this->data]; - } -} \ No newline at end of file diff --git a/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilZusatzvereinbarung.php b/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilZusatzvereinbarung.php deleted file mode 100644 index 606f57b0e..000000000 --- a/application/libraries/vertragsbestandteil/gui/GUIVertragsbestandteilZusatzvereinbarung.php +++ /dev/null @@ -1,139 +0,0 @@ -type = GUIVertragsbestandteilZusatzvereinbarung::TYPE_STRING; - $this->hasGBS = true; - $this-> guioptions = ["id" => null, "infos" => [], "errors" => [], "removeable" => true]; - $this->data = null; - $this->gbs = []; - } - - public function getTypeString(): string - { - return GUIVertragsbestandteilZusatzvereinbarung::TYPE_STRING; - } - - /** - * parse JSON into object - * @param string $jsondata - */ - public function mapJSON(&$decoded) - { - $this->checkType($decoded); - $this->mapGUIOptions($decoded); - $this->mapData($decoded); - $this->mapGBS($decoded); - } - - /** - * ["id" => null, - * "infos" => [], - * "errors" => [], - * "removeable" => true - * ] - * @param mixed $decoded decoded JSON data (use associative array) - */ - private function mapGUIOptions(&$decoded) - { - $decodedGUIOptions = null; - if (!$this->getJSONData($decodedGUIOptions, $decoded, 'guioptions')) - { - throw new \Exception('missing guioptions'); - } - $this->getJSONData($this->guioptions, $decodedGUIOptions, 'id'); - $this->getJSONData($this->guioptions, $decodedGUIOptions, 'infos'); - $this->getJSONData($this->guioptions, $decodedGUIOptions, 'errors'); - $this->getJSONDataBool($this->guioptions, $decodedGUIOptions, 'removable'); - } - - /** - * { - * "freitexttyp": "allin", - * "titel": "Lorem ipsum ", - * "freitext": "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. \nAt vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. ", - * "kuendigungsrelevant": "", - * "gueltigkeit": { - * "guioptions": { - * "sharedstatemode": "reflect" - * }, - * "data": { - * "gueltig_ab": "1.1.2010", - * "gueltig_bis": "" - * } - */ - private function mapData(&$decoded) - { - $decodedData = null; - if (!$this->getJSONData($decodedData, $decoded, 'data')) - { - throw new \Exception('missing data'); - } - $this->getJSONDataString($this->data['freitexttyp'], $decodedData, 'freitexttyp'); - $this->getJSONDataString($this->data['titel'], $decodedData, 'titel'); - $this->getJSONDataString($this->data['freitext'], $decodedData, 'freitext'); - $gueltigkeit = new GUIGueltigkeit(); - $gueltigkeit->mapJSON($decodedData['gueltigkeit']); - $this->data['gueltigkeit'] = $gueltigkeit; - } - - private function mapGBS(&$decoded) - { - $decodedGbsList = []; - if (!$this->getJSONData($decodedGbsList, $decoded, 'gbs')) - { - throw new \Exception('missing gbs'); - } - $guiGBS = null; - foreach ($decodedGbsList as $decodedGbs) { - $guiGBS = new GUIGehaltsbestandteil(); - $guiGBS->mapJSON($decodedGbs); - $this->gbs[] = $guiGBS; - } - } - - public function generateVertragsbestandteil($id) { - // TODO - } - - public function jsonSerialize() { - return [ - "type" => $this->type, - "guioptions" => $this->guioptions, - "data" => $this->data, - "gbs" => $this->gbs]; - } - -} \ No newline at end of file diff --git a/application/libraries/vertragsbestandteil/gui/JSONData.php b/application/libraries/vertragsbestandteil/gui/JSONData.php deleted file mode 100644 index 77ea19ce4..000000000 --- a/application/libraries/vertragsbestandteil/gui/JSONData.php +++ /dev/null @@ -1,53 +0,0 @@ -format('Y-m-d'); -} \ No newline at end of file From 0061cf255c518b73b1effa7819218304756b0c1c Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Wed, 12 Apr 2023 15:22:10 +0200 Subject: [PATCH 045/263] add GehaltsbestandteilLib --- .../VertragsbestandteilTest.php | 27 ++ .../Gehaltsbestandteil.php | 380 ++++++++++-------- .../GehaltsbestandteilLib.php | 89 ++++ .../Vertragsbestandteil.php | 18 + .../VertragsbestandteilLib.php | 4 +- .../Gehaltsbestandteil_model.php | 11 +- 6 files changed, 353 insertions(+), 176 deletions(-) create mode 100644 application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php diff --git a/application/controllers/jobs/vertragsbestandteil_test/VertragsbestandteilTest.php b/application/controllers/jobs/vertragsbestandteil_test/VertragsbestandteilTest.php index 407a5ba24..d22ddb85f 100644 --- a/application/controllers/jobs/vertragsbestandteil_test/VertragsbestandteilTest.php +++ b/application/controllers/jobs/vertragsbestandteil_test/VertragsbestandteilTest.php @@ -17,6 +17,8 @@ class VertragsbestandteilTest extends JOB_Controller $this->load->library('vertragsbestandteil/VertragsbestandteilLib', null, 'VertragsbestandteilLib'); + $this->load->library('vertragsbestandteil/GehaltsbestandteilLib', + null, 'GehaltsbestandteilLib'); } public function testFetch() @@ -84,4 +86,29 @@ class VertragsbestandteilTest extends JOB_Controller echo "Insert failed.\n"; } } + + public function testGehaltsbestandteilInsert() + { + $data = new stdClass(); + $data->gehaltsbestandteil_id = 2; + /* + $data->dienstverhaeltnis_id = 39; + $data->vertragsbestandteil_id = 123; + $data->gehaltstyp_kurzbz = 'zulage'; + $data->von = '2023-04-01'; + $data->bis = '2023-08-31'; + $data->anmerkung = 'test anmerkung'; + $data->grundbetrag = 100; + $data->betrag_valorisiert = 100; + $data->valorisierung = true; + */ + $data->auszahlungen = 12; + + $gb = new \vertragsbestandteil\Gehaltsbestandteil(); + $gb->hydrateByStdClass($data); + + print_r($gb->toStdClass()); + + $this->GehaltsbestandteilLib->storeGehaltsbestandteil($gb); + } } diff --git a/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php b/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php index e911c4228..0fc786124 100644 --- a/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php +++ b/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php @@ -1,185 +1,245 @@ gehaltsbestandteil_id) && $this->setGehaltsbestandteil_id($data->gehaltsbestandteil_id); + isset($data->dienstverhaeltnis_id) && $this->setDienstverhaeltnis_id($data->dienstverhaeltnis_id); + isset($data->vertragsbestandteil_id) && $this->setVertragsbestandteil_id($data->vertragsbestandteil_id); + isset($data->gehaltstyp_kurzbz) && $this->setGehaltstyp_kurzbz($data->gehaltstyp_kurzbz); + isset($data->von) && $this->setVon($data->von); + isset($data->bis) && $this->setBis($data->bis); + isset($data->anmerkung) && $this->setAnmerkung($data->anmerkung); + isset($data->grundbetrag) && $this->setGrundbetrag($data->grundbetrag); + isset($data->betrag_valorisiert) && $this->setBetrag_valorisiert($data->betrag_valorisiert); + isset($data->valorisierungssperre) && $this->setValorisierungssperre($data->valorisierungssperre); + isset($data->valorisierung) && $this->setValorisierung($data->valorisierung); + isset($data->auszahlungen) && $this->setAuszahlungen($data->auszahlungen); + + isset($data->insertamum) && $this->setInsertamum($data->insertamum); + isset($data->insertvon) && $this->setInsertvon($data->insertvon); + isset($data->updateamum) && $this->setUpdateamum($data->updateamum); + isset($data->updatevon) && $this->setUpdatevon($data->updatevon); + } + + public function getGehaltsbestandteil_id() { return $this->gehaltsbestandteil_id; } - /** - * Set the value of gehaltsbestandteil_id - */ - public function setGehaltsbestandteilId($gehaltsbestandteil_id): self + public function getDienstverhaeltnis_id() { - $this->gehaltsbestandteil_id = $gehaltsbestandteil_id; - - return $this; + return $this->dienstverhaeltnis_id; + } + + public function getVertragsbestandteil_id() + { + return $this->vertragsbestandteil_id; + } + + public function getGehaltstyp_kurzbz() + { + return $this->gehaltstyp_kurzbz; + } + + public function getVon() + { + return $this->von; + } + + public function getBis() + { + return $this->bis; } - /** - * Get the value of anmerkung - */ public function getAnmerkung() { return $this->anmerkung; } - /** - * Set the value of anmerkung - */ - public function setAnmerkung($anmerkung): self - { - $this->anmerkung = $anmerkung; - - return $this; - } - - /** - * Get the value of grundbetrag - */ public function getGrundbetrag() { return $this->grundbetrag; } - /** - * Set the value of grundbetrag - */ - public function setGrundbetrag($grundbetrag): self - { - $this->grundbetrag = $grundbetrag; - - return $this; - } - - /** - * Get the value of betrag_valorisiert - */ - public function getBetragValorisiert() + public function getBetrag_valorisiert() { return $this->betrag_valorisiert; } - /** - * Set the value of betrag_valorisiert - */ - public function setBetragValorisiert($betrag_valorisiert): self - { - $this->betrag_valorisiert = $betrag_valorisiert; - - return $this; - } - - /** - * Get the value of valorisieren - */ - public function getValorisieren() - { - return $this->valorisieren; - } - - /** - * Set the value of valorisieren - */ - public function setValorisieren($valorisieren): self - { - $this->valorisieren = $valorisieren; - - return $this; - } - - /** - * Get the value of dienstverhaeltnis_id - */ - public function getGehaltDienstverhaeltnisID() - { - return $this->gehalt_dienstverhaeltnis_id; - } - - /** - * Set the value of dienstverhaeltnis_id - */ - public function setGehaltDienstverhaeltnisID($dienstverhaeltnis_id): self - { - $this->gehalt_dienstverhaeltnis_id = $dienstverhaeltnis_id; - - return $this; - } - - /** - * Get the value of gehaltstyp_kurzbz - */ - public function getGehaltstypKurzbz() - { - return $this->gehaltstyp_kurzbz; - } - - /** - * Set the value of gehaltstyp_kurzbz - */ - public function setGehaltstypKurzbz($gehaltstyp_kurzbz): self - { - $this->gehaltstyp_kurzbz = $gehaltstyp_kurzbz; - - return $this; - } - - /** - * Get the value of valorisierungssperre - */ public function getValorisierungssperre() { return $this->valorisierungssperre; } - /** - * Set the value of valorisierungssperre - */ - public function setValorisierungssperre($valorisierungssperre): self + public function getValorisierung() { - $this->valorisierungssperre = $valorisierungssperre; + return $this->valorisierung; + } + public function getAuszahlungen() + { + return $this->auszahlungen; + } + + public function getInsertamum() + { + return $this->insertamum; + } + + public function getInsertvon() + { + return $this->insertvon; + } + + public function getUpdateamum() + { + return $this->updateamum; + } + + public function getUpdatevon() + { + return $this->updatevon; + } + + public function setGehaltsbestandteil_id($gehaltsbestandteil_id) + { + $this->gehaltsbestandteil_id = $gehaltsbestandteil_id; return $this; } + public function setDienstverhaeltnis_id($dienstverhaeltnis_id) + { + $this->dienstverhaeltnis_id = $dienstverhaeltnis_id; + return $this; + } + + public function setVertragsbestandteil_id($vertragsbestandteil_id) + { + $this->vertragsbestandteil_id = $vertragsbestandteil_id; + return $this; + } + + public function setGehaltstyp_kurzbz($gehaltstyp_kurzbz) + { + $this->gehaltstyp_kurzbz = $gehaltstyp_kurzbz; + return $this; + } + + public function setVon($von) + { + $this->von = $von; + return $this; + } + + public function setBis($bis) + { + $this->bis = $bis; + return $this; + } + + public function setAnmerkung($anmerkung) + { + $this->anmerkung = $anmerkung; + return $this; + } + + public function setGrundbetrag($grundbetrag) + { + $this->grundbetrag = $grundbetrag; + return $this; + } + + public function setBetrag_valorisiert($betrag_valorisiert) + { + $this->betrag_valorisiert = $betrag_valorisiert; + return $this; + } + + public function setValorisierungssperre($valorisierungssperre) + { + $this->valorisierungssperre = $valorisierungssperre; + return $this; + } + + public function setValorisierung($valorisierung) + { + $this->valorisierung = $valorisierung; + return $this; + } + + public function setAuszahlungen($auszahlungen) + { + $this->auszahlungen = $auszahlungen; + return $this; + } + + public function setInsertamum($insertamum) + { + $this->insertamum = $insertamum; + return $this; + } + + public function setInsertvon($insertvon) + { + $this->insertvon = $insertvon; + return $this; + } + + public function setUpdateamum($updateamum) + { + $this->updateamum = $updateamum; + return $this; + } + + public function setUpdatevon($updatevon) + { + $this->updatevon = $updatevon; + return $this; + } + public function toStdClass(): \stdClass { - $tmp = array( - 'gueltig_ab' => $this->getGueltigAb(), - 'gueltig_bis' => $this->getGueltigBis(), - 'gehalt_dienstverhaeltnis_id' => $this->getGehaltDienstverhaeltnisID(), + $tmp = array( + 'gehaltsbestandteil_id' => $this->getGehaltsbestandteil_id(), + 'dienstverhaeltnis_id' => $this->getDienstverhaeltnis_id(), + 'vertragsbestandteil_id' => $this->getVertragsbestandteil_id(), + 'gehaltstyp_kurzbz' => $this->getGehaltstyp_kurzbz(), + 'von' => $this->getVon(), + 'bis' => $this->getBis(), + 'anmerkung' => $this->getAnmerkung(), 'grundbetrag' => $this->getGrundbetrag(), - 'betrag_valorisiert' => $this->getBetragValorisiert(), - 'valorisieren' => $this->getValorisieren(), - 'gehaltstyp_kurzbz' => $this->getGehaltstypKurzbz(), + 'betrag_valorisiert' => $this->getBetrag_valorisiert(), 'valorisierungssperre' => $this->getValorisierungssperre(), - 'anmerkung' => $this->getAnmerkung() + 'valorisierung' => $this->getValorisierung(), + 'auszahlungen' => $this->getAuszahlungen(), + 'insertamum' => $this->getInsertamum(), + 'insertvon' => $this->getInsertvon(), + 'updateamum' => $this->getUpdateamum(), + 'updatevon' => $this->getUpdatevon() ); $tmp = array_filter($tmp, function($v) { @@ -192,50 +252,24 @@ class Gehaltsbestandteil public function __toString() { $txt = <<getGehaltsbestandteil_id()} + dienstverhaeltnis_id: {$this->getDienstverhaeltnis_id()} + vertragsbestandteil_id: {$this->getVertragsbestandteil_id()} + gehaltstyp_kurzbz: {$this->getGehaltstyp_kurzbz()} von: {$this->getVon()} bis: {$this->getBis()} + anmerkung: {$this->getAnmerkung()} grundbetrag: {$this->getGrundbetrag()} - valorisieren: {$this->getValorisieren()} + betrag_valorisiert: {$this->getBetrag_valorisiert()} + valorisierungssperre: {$this->getValorisierungssperre()} + valorisierung: {$this->getValorisierung()} + auszahlungen: {$this->getAuszahlungen()} + insertamum: {$this->getInsertamum()} + insertvon: {$this->getInsertvon()} + updateamum: {$this->getUpdateamum()} + updatevon: {$this->getUpdatevon()} EOTXT; - return parent::__toString() . $txt; + return $txt; } - - - - /** - * Get the value of gueltig_ab - */ - public function getGueltigAb() - { - return $this->gueltig_ab; - } - - /** - * Set the value of gueltig_ab - */ - public function setGueltigAb($gueltig_ab): self - { - $this->gueltig_ab = $gueltig_ab; - - return $this; - } - - /** - * Get the value of gueltig_bis - */ - public function getGueltigBis() - { - return $this->gueltig_bis; - } - - /** - * Set the value of gueltig_bis - */ - public function setGueltigBis($gueltig_bis): self - { - $this->gueltig_bis = $gueltig_bis; - - return $this; - } } diff --git a/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php b/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php new file mode 100644 index 000000000..ad5418738 --- /dev/null +++ b/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php @@ -0,0 +1,89 @@ +CI = get_instance(); + $this->CI->load->model('vertragsbestandteil/Gehaltsbestandteil_model', + 'GehaltsbestandteilModel'); + $this->GehaltsbestandteilModel = $this->CI->GehaltsbestandteilModel; + } + + public function fetchGehaltsbestandteile($dienstverhaeltnis_id, $stichtag=null) + { + return $this->GehaltsbestandteilModel->getGehaltsbestandteile($dienstverhaeltnis_id, $stichtag); + } + + public function fetchGehaltsbestandteil($gehaltsbestandteil_id) + { + return $this->GehaltsbestandteilModel->getGehaltsbestandteil($gehaltsbestandteil_id); + } + + public function storeGehaltsbestandteile($gehaltsbestandteile) + { + foreach( $gehaltsbestandteile as $gehaltsbestandteil ) + { + $this->storeGehaltsbestandteil($gehaltsbestandteil); + } + } + + public function storeGehaltsbestandteil(Gehaltsbestandteil $gehaltsbestandteil) + { + try + { + if( intval($gehaltsbestandteil->getGehaltsbestandteil_id()) > 0 ) + { + $this->updateGehaltsbestandteil($gehaltsbestandteil); + } + else + { + $this->insertGehaltsbestandteil($gehaltsbestandteil); + } + } + catch (Exception $ex) + { + log_message('debug', "Storing Gehaltsbestandteil failed. " . $ex->getMessage()); + throw new Exception('Storing Gehaltsbestandteil failed.'); + } + } + + protected function insertGehaltsbestandteil(Gehaltsbestandteil $gehaltsbestandteil) + { + $ret = $this->GehaltsbestandteilModel->insert($gehaltsbestandteil->toStdClass(), + $this->GehaltsbestandteilModel->getEncryptedColumns()); + if( hasData($ret) ) + { + $gehaltsbestandteil->setGehaltsbestandteil_id(getData($ret)); + } + else + { + throw new Exception('error inserting gehaltsbestandteil'); + } + } + + protected function updateGehaltsbestandteil(Gehaltsbestandteil $gehaltsbestandteil) + { + $gehaltsbestandteil->setUpdateamum(strftime('%Y-%m-%d %H:%M:%S')); + $ret = $this->GehaltsbestandteilModel->update($gehaltsbestandteil->getGehaltsbestandteil_id(), + $gehaltsbestandteil->toStdClass(), + $this->GehaltsbestandteilModel->getEncryptedColumns()); + + if(isError($ret) ) + { + throw new Exception('error updating gehaltsbestandteil'); + } + } +} diff --git a/application/libraries/vertragsbestandteil/Vertragsbestandteil.php b/application/libraries/vertragsbestandteil/Vertragsbestandteil.php index 1d1101e44..a8e600d7f 100644 --- a/application/libraries/vertragsbestandteil/Vertragsbestandteil.php +++ b/application/libraries/vertragsbestandteil/Vertragsbestandteil.php @@ -18,6 +18,13 @@ abstract class Vertragsbestandteil implements \JsonSerializable protected $updateamum; protected $updatevon; + protected $gehaltsbestandteile; + + public function __construct() + { + $this->gehaltsbestandteile = array(); + } + public function hydrateByStdClass($data) { isset($data->vertragsbestandteil_id) && $this->setVertragsbestandteil_id($data->vertragsbestandteil_id); @@ -30,6 +37,17 @@ abstract class Vertragsbestandteil implements \JsonSerializable isset($data->updatevon) && $this->setUpdatevon($data->updatevon); } + public function addGehaltsbestandteil(Gehaltsbestandteil $gehaltsbestandteil) + { + $this->gehaltsbestandteile[] = $gehaltsbestandteil; + return $this; + } + + public function getGehaltsbestandteile() + { + return $this->gehaltsbestandteile; + } + public function getVertragsbestandteil_id() { return $this->vertragsbestandteil_id; diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php index 38b152523..fd65c3972 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php @@ -6,6 +6,7 @@ require_once __DIR__ . '/VertragsbestandteilZeitaufzeichnung.php'; require_once __DIR__ . '/VertragsbestandteilKuendigungsfrist.php'; require_once __DIR__ . '/VertragsbestandteilFreitext.php'; require_once __DIR__ . '/VertragsbestandteilFactory.php'; +require_once __DIR__ . '/GehaltsbestandteilLib.php'; use vertragsbestandteil\Vertragsbestandteil; use vertragsbestandteil\VertragsbestandteilFactory; @@ -136,8 +137,7 @@ class VertragsbestandteilLib protected function updateVertragsbestandteil(Vertragsbestandteil $vertragsbestandteil) { - $vertragsbestandteil->setUpdateamum(strftime('%Y-%m-%d %H:%M')) - ->setUpdatevon('ma0080'); + $vertragsbestandteil->setUpdateamum(strftime('%Y-%m-%d %H:%M:%S')); $vertragsbestandteil->beforePersist(); $ret = $this->VertragsbestandteilModel->update($vertragsbestandteil->getVertragsbestandteil_id(), $vertragsbestandteil->baseToStdClass()); diff --git a/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php b/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php index fce950012..ad48e68e0 100644 --- a/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php +++ b/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php @@ -14,7 +14,16 @@ class Gehaltsbestandteil_model extends DB_Model implements IEncryption public function getEncryptedColumns(): array { - return ['grundbetrag' => 'ENCRYPTIONKEY', 'betrag_valorisiert' => 'ENCRYPTIONKEY']; + return array( + 'grundbetrag' => array( + DB_Model::CRYPT_CAST => 'numeric', + DB_Model::CRYPT_PASSWORD_NAME => 'ENCRYPTIONKEY' + ), + 'betrag_valorisiert' => array( + DB_Model::CRYPT_CAST => 'numeric', + DB_Model::CRYPT_PASSWORD_NAME => 'ENCRYPTIONKEY' + ) + ); } public function getCurrentGBTByDV($dienstverhaeltnis_id) From c2e956f7f3f329980fa8a53367d38e17c4d64f1b Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Wed, 12 Apr 2023 15:32:22 +0200 Subject: [PATCH 046/263] use GehaltsbestandteilLib in VertragsbestandteilLib --- .../VertragsbestandteilLib.php | 61 +++++++++---------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php index fd65c3972..e154d0b43 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php @@ -6,7 +6,6 @@ require_once __DIR__ . '/VertragsbestandteilZeitaufzeichnung.php'; require_once __DIR__ . '/VertragsbestandteilKuendigungsfrist.php'; require_once __DIR__ . '/VertragsbestandteilFreitext.php'; require_once __DIR__ . '/VertragsbestandteilFactory.php'; -require_once __DIR__ . '/GehaltsbestandteilLib.php'; use vertragsbestandteil\Vertragsbestandteil; use vertragsbestandteil\VertragsbestandteilFactory; @@ -21,13 +20,20 @@ class VertragsbestandteilLib protected $CI; /** @var Vertragsbestandteil_model */ protected $VertragsbestandteilModel; - + /** + * @var GehaltsbestandteilLib + */ + protected $GehaltsbestandteilLib; + public function __construct() { $this->CI = get_instance(); $this->CI->load->model('vertragsbestandteil/Vertragsbestandteil_model', 'VertragsbestandteilModel'); $this->VertragsbestandteilModel = $this->CI->VertragsbestandteilModel; + $this->CI->load->library('vertragsbestandteil/GehaltsbestandteilLib', + null, 'GehaltsbestandteilLib'); + $this->GehaltsbestandteilLib = $this->CI->GehaltsbestandteilLib; } public function handleGUIData($guidata, $employeeUID, $userUID) @@ -82,8 +88,7 @@ class VertragsbestandteilLib } } - protected function insertVertragsbestandteil(Vertragsbestandteil $vertragsbestandteil, - Vertragsbestandteil $vertragsbestandteil_secondary = null /* i.e. Gehaltsbestandteil connected to Stunden*/) + protected function insertVertragsbestandteil(Vertragsbestandteil $vertragsbestandteil) { $vertragsbestandteil->beforePersist(); $ret = $this->VertragsbestandteilModel->insert($vertragsbestandteil->baseToStdClass()); @@ -105,34 +110,17 @@ class VertragsbestandteilLib throw new Exception('error updating vertragsbestandteil ' . $vertragsbestandteil->getVertragsbestandteiltyp_kurzbz()); } - - if ($vertragsbestandteil_secondary == null) return; - - if (!is_array($vertragsbestandteil_secondary)) - { - $vertragsbestandteil_secondary = [$vertragsbestandteil_secondary]; - } - - foreach ($vertragsbestandteil_secondary as $vb) - { - $specialisedModel = VertragsbestandteilFactory::getVertragsbestandteilDBModel( - $vb->getVertragsbestandteiltyp_kurzbz()); - - if ($specialisedModel instanceof IEncryption) - { - $retspecial = $specialisedModel->insert($vb->toStdClass(), $specialisedModel->getEncryptedColumns()); - } else - { - $retspecial = $specialisedModel->insert($vb->toStdClass()); - } - - if(isError($retspecial) ) - { - throw new Exception('error updating secondary vertragsbestandteil ' - . $vb->getVertragsbestandteiltyp_kurzbz()); - } - } + try + { + $gehaltsbestandteile = $vertragsbestandteil->getGehaltsbestandteile(); + $this->GehaltsbestandteilLib->storeGehaltsbestandteile($gehaltsbestandteile); + } + catch(Exception $ex) + { + throw new Exception('VertragsbestandteilLib insertVertragsbestandteil ' + . 'failed to store Gehaltsbestandteile. ' . $ex->getMessage()); + } } protected function updateVertragsbestandteil(Vertragsbestandteil $vertragsbestandteil) @@ -157,5 +145,16 @@ class VertragsbestandteilLib throw new Exception('error updating vertragsbestandteil ' . $vertragsbestandteil->getVertragsbestandteiltyp_kurzbz()); } + + try + { + $gehaltsbestandteile = $vertragsbestandteil->getGehaltsbestandteile(); + $this->GehaltsbestandteilLib->storeGehaltsbestandteile($gehaltsbestandteile); + } + catch(Exception $ex) + { + throw new Exception('VertragsbestandteilLib updateVertragsbestandteil ' + . 'failed to store Gehaltsbestandteile. ' . $ex->getMessage()); + } } } From 9e6d78dd1d7a13232b9c2bd7dd54cd9aecb76501 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Wed, 12 Apr 2023 16:26:55 +0200 Subject: [PATCH 047/263] set Dienstverhaeltnis_id and Vertragsbestandteil_id on child Gehaltsbestandteile when added or changed --- .../vertragsbestandteil/Vertragsbestandteil.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/application/libraries/vertragsbestandteil/Vertragsbestandteil.php b/application/libraries/vertragsbestandteil/Vertragsbestandteil.php index a8e600d7f..e55337a01 100644 --- a/application/libraries/vertragsbestandteil/Vertragsbestandteil.php +++ b/application/libraries/vertragsbestandteil/Vertragsbestandteil.php @@ -39,6 +39,8 @@ abstract class Vertragsbestandteil implements \JsonSerializable public function addGehaltsbestandteil(Gehaltsbestandteil $gehaltsbestandteil) { + $gehaltsbestandteil->setDienstverhaeltnis_id($this->getDienstverhaeltnis_id()); + $gehaltsbestandteil->setVertragsbestandteil_id($this->getVertragsbestandteil_id()); $this->gehaltsbestandteile[] = $gehaltsbestandteil; return $this; } @@ -96,12 +98,20 @@ abstract class Vertragsbestandteil implements \JsonSerializable public function setVertragsbestandteil_id($vertragsbestandteil_id) { $this->vertragsbestandteil_id = $vertragsbestandteil_id; + foreach ($this->gehaltsbestandteile as $gehaltsbestandteil) + { + $gehaltsbestandteil->setVertragsbestandteil_id($vertragsbestandteil_id); + } return $this; } public function setDienstverhaeltnis_id($dienstverhaeltnis_id) { $this->dienstverhaeltnis_id = $dienstverhaeltnis_id; + foreach ($this->gehaltsbestandteile as $gehaltsbestandteil) + { + $gehaltsbestandteil->setDienstverhaeltnis_id($dienstverhaeltnis_id); + } return $this; } From e462a71b6d509e0c23e99ec6c0e766aef7910ba2 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Wed, 12 Apr 2023 16:50:00 +0200 Subject: [PATCH 048/263] call parent constructor --- .../vertragsbestandteil/VertragsbestandteilBefristung.php | 1 + .../vertragsbestandteil/VertragsbestandteilFreitext.php | 1 + .../vertragsbestandteil/VertragsbestandteilFunktion.php | 1 + .../libraries/vertragsbestandteil/VertragsbestandteilKarenz.php | 1 + .../vertragsbestandteil/VertragsbestandteilKuendigungsfrist.php | 1 + .../libraries/vertragsbestandteil/VertragsbestandteilLehre.php | 1 + .../libraries/vertragsbestandteil/VertragsbestandteilStunden.php | 1 + .../vertragsbestandteil/VertragsbestandteilUrlaubsanspruch.php | 1 + .../vertragsbestandteil/VertragsbestandteilZeitaufzeichnung.php | 1 + 9 files changed, 9 insertions(+) diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilBefristung.php b/application/libraries/vertragsbestandteil/VertragsbestandteilBefristung.php index a2585b5e9..fb37a5a4b 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilBefristung.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilBefristung.php @@ -11,6 +11,7 @@ class VertragsbestandteilBefristung extends Vertragsbestandteil public function __construct() { + parent::__construct(); $this->setVertragsbestandteiltyp_kurzbz( VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_BEFRISTUNG); } diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilFreitext.php b/application/libraries/vertragsbestandteil/VertragsbestandteilFreitext.php index c878dc24b..5904ee1dd 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilFreitext.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilFreitext.php @@ -12,6 +12,7 @@ class VertragsbestandteilFreitext extends Vertragsbestandteil public function __construct() { + parent::__construct(); $this->setVertragsbestandteiltyp_kurzbz( VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_FREITEXT); } diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php b/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php index a0ab364e0..54184dcb8 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php @@ -18,6 +18,7 @@ class VertragsbestandteilFunktion extends Vertragsbestandteil public function __construct() { + parent::__construct(); $this->benutzerfunktiondata = null; $this->setVertragsbestandteiltyp_kurzbz( diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilKarenz.php b/application/libraries/vertragsbestandteil/VertragsbestandteilKarenz.php index 3c9f7b38d..540389ae3 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilKarenz.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilKarenz.php @@ -12,6 +12,7 @@ class VertragsbestandteilKarenz extends Vertragsbestandteil public function __construct() { + parent::__construct(); $this->setVertragsbestandteiltyp_kurzbz( VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_KARENZ); } diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilKuendigungsfrist.php b/application/libraries/vertragsbestandteil/VertragsbestandteilKuendigungsfrist.php index 18b220b37..9fe99c6d9 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilKuendigungsfrist.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilKuendigungsfrist.php @@ -11,6 +11,7 @@ class VertragsbestandteilKuendigungsfrist extends Vertragsbestandteil public function __construct() { + parent::__construct(); $this->setVertragsbestandteiltyp_kurzbz( VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_KUENDIGUNGSFRIST); } diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilLehre.php b/application/libraries/vertragsbestandteil/VertragsbestandteilLehre.php index 2c665cbf5..2e6fe8bc3 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilLehre.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilLehre.php @@ -10,6 +10,7 @@ class VertragsbestandteilLehre extends Vertragsbestandteil public function __construct() { + parent::__construct(); $this->setVertragsbestandteiltyp_kurzbz( VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_LEHRE); } diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilStunden.php b/application/libraries/vertragsbestandteil/VertragsbestandteilStunden.php index 8aba3fc2e..741319140 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilStunden.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilStunden.php @@ -19,6 +19,7 @@ class VertragsbestandteilStunden extends Vertragsbestandteil public function __construct() { + parent::__construct(); $this->setVertragsbestandteiltyp_kurzbz( VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_STUNDEN); } diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch.php b/application/libraries/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch.php index 285d7e8ad..69861c5d5 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch.php @@ -10,6 +10,7 @@ class VertragsbestandteilUrlaubsanspruch extends Vertragsbestandteil public function __construct() { + parent::__construct(); $this->setVertragsbestandteiltyp_kurzbz( VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_URLAUBSANSPRUCH); } diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilZeitaufzeichnung.php b/application/libraries/vertragsbestandteil/VertragsbestandteilZeitaufzeichnung.php index fb715304c..a0365315e 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilZeitaufzeichnung.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilZeitaufzeichnung.php @@ -12,6 +12,7 @@ class VertragsbestandteilZeitaufzeichnung extends Vertragsbestandteil public function __construct() { + parent::__construct(); $this->setVertragsbestandteiltyp_kurzbz( VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_ZEITAUFZEICHNUNG); } From 29485a090bd8dcc39e883e3dff6c2931d34b7bce Mon Sep 17 00:00:00 2001 From: Werner Masik Date: Fri, 14 Apr 2023 15:51:58 +0200 Subject: [PATCH 049/263] removed remaining unit test for GUI --- .../vertragsbestandteil/gui/FormDataTest.php | 40 -- .../GUIVertragsbestandteilFunktionTest.php | 39 -- ...ertragsbestandteilKuendigungsfristTest.php | 36 -- .../gui/GUIVertragsbestandteilStundenTest.php | 77 ---- ...ertragsbestandteilZeitaufzeichnungTest.php | 39 -- .../GUIVertragsbestandteilZusatzvbTest.php | 41 -- .../gui/GuiHandlerTest.php | 41 -- .../vertragsbestandteil/gui/funktion01.json | 241 ------------ .../gui/kuendigungsfrist01.json | 263 ------------- .../vertragsbestandteil/gui/readme.txt | 6 - .../vertragsbestandteil/gui/stunden01.json | 241 ------------ .../gui/zeitaufzeichnung01.json | 264 ------------- .../vertragsbestandteil/gui/zusatz01.json | 354 ------------------ 13 files changed, 1682 deletions(-) delete mode 100644 system/UnitTests/vertragsbestandteil/gui/FormDataTest.php delete mode 100644 system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilFunktionTest.php delete mode 100644 system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilKuendigungsfristTest.php delete mode 100644 system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilStundenTest.php delete mode 100644 system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilZeitaufzeichnungTest.php delete mode 100644 system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilZusatzvbTest.php delete mode 100644 system/UnitTests/vertragsbestandteil/gui/GuiHandlerTest.php delete mode 100644 system/UnitTests/vertragsbestandteil/gui/funktion01.json delete mode 100644 system/UnitTests/vertragsbestandteil/gui/kuendigungsfrist01.json delete mode 100644 system/UnitTests/vertragsbestandteil/gui/readme.txt delete mode 100644 system/UnitTests/vertragsbestandteil/gui/stunden01.json delete mode 100644 system/UnitTests/vertragsbestandteil/gui/zeitaufzeichnung01.json delete mode 100644 system/UnitTests/vertragsbestandteil/gui/zusatz01.json diff --git a/system/UnitTests/vertragsbestandteil/gui/FormDataTest.php b/system/UnitTests/vertragsbestandteil/gui/FormDataTest.php deleted file mode 100644 index 7bfaee017..000000000 --- a/system/UnitTests/vertragsbestandteil/gui/FormDataTest.php +++ /dev/null @@ -1,40 +0,0 @@ -mapJSON($decoded); - // Dienstverhaeltnis - $dataDV = $formDataMapper->getData(); - $this->assertNotEmpty($dataDV); - $this->assertNotEmpty($dataDV['unternehmen']); - $this->assertEquals('gst', $dataDV['unternehmen']); - $this->assertNull($dataDV['dienstverhaeltnisid']); - $this->assertNotEmpty($dataDV['vertragsart_kurzbz']); - $this->assertEquals('echterdv', $dataDV['vertragsart_kurzbz']); - $this->assertNotEmpty($dataDV['gueltigkeit']); - $this->assertNotEmpty($dataDV['gueltigkeit']->getGuioptions()); - $this->assertNotEmpty($dataDV['gueltigkeit']->getData()); - $this->assertNotEmpty($dataDV['gueltigkeit']->getData()['gueltig_ab']); - // Vertragsbestandteile - $vbs = $formDataMapper->getVbs(); - $this->assertNotEmpty($vbs); - } - - - -} \ No newline at end of file diff --git a/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilFunktionTest.php b/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilFunktionTest.php deleted file mode 100644 index 7369cd026..000000000 --- a/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilFunktionTest.php +++ /dev/null @@ -1,39 +0,0 @@ -mapJSON($decoded); - // VBS - $vbs = $formDataMapper->getVbs(); - $this->assertNotEmpty($vbs); - $this->assertNotEmpty($vbs['fc5f4ab8-4652-40e4-9ac3-e76bbf7310af']); - $vbsMapper = new GUIVertragsbestandteilFunktion(); - $vbsMapper->mapJSON($vbs['fc5f4ab8-4652-40e4-9ac3-e76bbf7310af']); - $vbsData=$vbsMapper->getData(); - $this->assertNotEmpty($vbsData['funktion']); - $this->assertEquals('Leitung', $vbsData['funktion']); - // GBS - $this->assertEmpty($vbsMapper->getGbs()); - - - } - - - -} \ No newline at end of file diff --git a/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilKuendigungsfristTest.php b/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilKuendigungsfristTest.php deleted file mode 100644 index a36c749c9..000000000 --- a/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilKuendigungsfristTest.php +++ /dev/null @@ -1,36 +0,0 @@ -mapJSON($decoded); - // VBS - $vbs = $formDataMapper->getVbs(); - $this->assertNotEmpty($vbs); - $this->assertNotEmpty($vbs['6ae61b45-99a8-406b-b583-9f0353dd834f']); - $vbsMapper = new GUIVertragsbestandteilKuendigungsfrist(); - $vbsMapper->mapJSON($vbs['6ae61b45-99a8-406b-b583-9f0353dd834f']); - $vbsData=$vbsMapper->getData(); - $this->assertNotEmpty($vbsData['arbeitgeber_frist']); - $this->assertNotEmpty($vbsData['arbeitnehmer_frist']); - - } - - - -} \ No newline at end of file diff --git a/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilStundenTest.php b/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilStundenTest.php deleted file mode 100644 index 5716d3bed..000000000 --- a/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilStundenTest.php +++ /dev/null @@ -1,77 +0,0 @@ -mapJSON($decoded); - // VBS - $vbs = $formDataMapper->getVbs(); - $this->assertNotEmpty($vbs); - $this->assertNotEmpty($vbs['73a60d69-cbd5-40f0-bcb1-ed0ccdd4a9fd']); - $vbsMapper = new GUIVertragsbestandteilStunden(); - $vbsMapper->mapJSON($vbs['73a60d69-cbd5-40f0-bcb1-ed0ccdd4a9fd']); - $vbsData=$vbsMapper->getData(); - var_dump($vbsData); - $this->assertNotEmpty($vbsData['stunden']); - $this->assertEquals(38.5, $vbsData['stunden']); - // GBS - $this->assertNotEmpty($vbsMapper->getGbs()); - - foreach ($vbsMapper->getGbs() as $gbs) - { - $this->assertNotEmpty($gbs->getData()); - $gbsData = $gbs->getData(); - $this->assertNotEmpty($gbsData['gehaltstyp']); - $this->assertNotEmpty($gbsData['betrag']); - $this->assertNotEmpty($gbsData['gueltigkeit']); - $this->assertNotEmpty($gbsData['valorisierung']); - } - } - - public function testMapJSON_02() - { - $jsondata = file_get_contents('./system/UnitTests/vertragsbestandteil/gui/funktion01.json'); - $decoded = json_decode($jsondata, true); - $formDataMapper = new FormData(); - $formDataMapper->mapJSON($decoded); - // VBS - $vbs = $formDataMapper->getVbs(); - $this->assertNotEmpty($vbs); - $this->assertNotEmpty($vbs['98704748-0ef0-4a70-94b7-5d8e719c2b3e']); - $vbsMapper = new GUIVertragsbestandteilStunden(); - $vbsMapper->mapJSON($vbs['98704748-0ef0-4a70-94b7-5d8e719c2b3e']); - $vbsData=$vbsMapper->getData(); - $this->assertNotEmpty($vbsData['stunden']); - $this->assertEquals(38.5, $vbsData['stunden']); - $this->assertNotEmpty($vbsData['gueltigkeit']->getData()); - // GBS - $this->assertNotEmpty($vbsMapper->getGbs()); - - foreach ($vbsMapper->getGbs() as $gbs) - { - $this->assertNotEmpty($gbs->getData()); - $gbsData = $gbs->getData(); - $this->assertNotEmpty($gbsData['gehaltstyp']); - $this->assertNotEmpty($gbsData['betrag']); - $this->assertNotEmpty($gbsData['gueltigkeit']); - $this->assertEmpty($gbsData['valorisierung']); - $this->assertNotEmpty($gbsData['gueltigkeit']->getData()); - } - } - -} \ No newline at end of file diff --git a/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilZeitaufzeichnungTest.php b/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilZeitaufzeichnungTest.php deleted file mode 100644 index f76d65aee..000000000 --- a/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilZeitaufzeichnungTest.php +++ /dev/null @@ -1,39 +0,0 @@ -mapJSON($decoded); - // VBS - $vbs = $formDataMapper->getVbs(); - $this->assertNotEmpty($vbs); - $this->assertNotEmpty($vbs['7625d25d-8fd9-476b-94a6-4fbb72c147d4']); - $vbsMapper = new GUIVertragsbestandteilZeitaufzeichnung(); - $vbsMapper->mapJSON($vbs['7625d25d-8fd9-476b-94a6-4fbb72c147d4']); - $vbsData=$vbsMapper->getData(); - $this->assertNotEmpty($vbsData['zeitaufzeichnung']); - $this->assertTrue($vbsData['zeitaufzeichnung']); - $this->assertEmpty($vbsData['azgrelevant']); - $this->assertNotEmpty($vbsData['homeoffice']); - $this->assertTrue($vbsData['homeoffice']); - - } - - - -} \ No newline at end of file diff --git a/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilZusatzvbTest.php b/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilZusatzvbTest.php deleted file mode 100644 index 705919f5a..000000000 --- a/system/UnitTests/vertragsbestandteil/gui/GUIVertragsbestandteilZusatzvbTest.php +++ /dev/null @@ -1,41 +0,0 @@ -mapJSON($decoded); - // VBS - $vbs = $formDataMapper->getVbs(); - $this->assertNotEmpty($vbs); - $this->assertNotEmpty($vbs['b168a3bb-d0e2-407f-8192-525a5ab59b22']); - $vbsMapper = new GUIVertragsbestandteilZusatzvereinbarung(); - $vbsMapper->mapJSON($vbs['b168a3bb-d0e2-407f-8192-525a5ab59b22']); - $vbsData=$vbsMapper->getData(); - $this->assertNotEmpty($vbsData['freitexttyp']); - $this->assertEquals('allin', $vbsData['freitexttyp']); - $this->assertNotEmpty($vbsData['titel']); - $this->assertEquals('Lorem ipsum', $vbsData['titel']); - // GBS - $this->assertEmpty($vbsMapper->getGbs()); - - - } - - - -} \ No newline at end of file diff --git a/system/UnitTests/vertragsbestandteil/gui/GuiHandlerTest.php b/system/UnitTests/vertragsbestandteil/gui/GuiHandlerTest.php deleted file mode 100644 index fa808ff1d..000000000 --- a/system/UnitTests/vertragsbestandteil/gui/GuiHandlerTest.php +++ /dev/null @@ -1,41 +0,0 @@ -load->helper('hlp_common'); - self::$CI->load->helper('hlp_return_object'); - } - - - public function testHandleInsert(): void - { - $jsondata = file_get_contents('./system/UnitTests/vertragsbestandteil/gui/stunden01.json'); - $this->assertNotEmpty($jsondata); - $GH = new GUIHandler($this->employeeUID, $this->userUID); - $res = $GH->handle($jsondata); - } - - - - public function test_true() - { - $this->assertTrue(true); - } - - - -} \ No newline at end of file diff --git a/system/UnitTests/vertragsbestandteil/gui/funktion01.json b/system/UnitTests/vertragsbestandteil/gui/funktion01.json deleted file mode 100644 index 5130a317e..000000000 --- a/system/UnitTests/vertragsbestandteil/gui/funktion01.json +++ /dev/null @@ -1,241 +0,0 @@ -{ - "type": "formdata", - "children": [ - { - "type": "tabs", - "guioptions": {}, - "children": [ - { - "type": "tab", - "guioptions": { - "title": "Allgemein", - "id": "allgemein" - }, - "children": [ - { - "type": "dv", - "guioptions": {}, - "children": [] - }, - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Kündigungsfrist", - "vertragsbestandteiltyp": "vertragsbestandteilkuendigungsfrist" - }, - "children": [] - }, - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Befristung", - "vertragsbestandteiltyp": "vertragsbestandteilfreitext", - "childdefaults": { - "guioptions": { - "canhavegehaltsbestandteile": false, - "disabled": [ - "freitexttyp" - ], - "hidden": [ - "titel", - "freitext" - ] - }, - "data": { - "freitexttyp": "befristung", - "titel": "Befristung", - "freitext": "befristeter Dienstvertrag" - } - } - }, - "children": [] - } - ] - }, - { - "type": "tab", - "guioptions": { - "title": "Arbeitszeit & Basisgehalt", - "id": "arbeitszeit" - }, - "children": [ - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Arbeitszeit", - "vertragsbestandteiltyp": "vertragsbestandteilstunden", - "errors": [ - "test1", - "test2" - ], - "infos": [] - }, - "children": [ - "98704748-0ef0-4a70-94b7-5d8e719c2b3e" - ] - }, - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Zeitaufzeichnung", - "vertragsbestandteiltyp": "vertragsbestandteilzeitaufzeichnung", - "errors": [], - "infos": [] - }, - "children": [] - } - ] - }, - { - "type": "tab", - "guioptions": { - "title": "Funktionen", - "id": "funktionen" - }, - "children": [ - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Funktion", - "vertragsbestandteiltyp": "vertragsbestandteilfunktion", - "errors": [], - "infos": [] - }, - "children": [ - "fc5f4ab8-4652-40e4-9ac3-e76bbf7310af" - ] - } - ] - }, - { - "type": "tab", - "guioptions": { - "title": "Zusatzvereinbarungen", - "id": "zusatzvereinbarungen" - }, - "children": [ - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Zusatzvereinbarungen", - "vertragsbestandteiltyp": "vertragsbestandteilfreitext" - }, - "children": [] - } - ] - }, - { - "type": "tab", - "guioptions": { - "title": "Sonstiges", - "id": "sonstiges" - }, - "children": [ - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Kündigungsfrist", - "vertragsbestandteiltyp": "vertragsbestandteilkuendigungsfrist", - "errors": [], - "infos": [] - }, - "children": [] - } - ] - } - ] - } - ], - "data": { - "dienstverhaeltnisid": null, - "unternehmen": "gst", - "vertragsart_kurzbz": "echterdv", - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "set" - }, - "data": { - "gueltig_ab": "1.1.2001", - "gueltig_bis": "" - } - } - }, - "vbs": { - "98704748-0ef0-4a70-94b7-5d8e719c2b3e": { - "type": "vertragsbestandteilstunden", - "guioptions": { - "id": "98704748-0ef0-4a70-94b7-5d8e719c2b3e", - "infos": [ - "test info 1", - "test info 2" - ], - "errors": [ - "test error 1", - "test error 2" - ] - }, - "data": { - "stunden": 38.5, - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "reflect" - }, - "data": { - "gueltig_ab": "1.1.2001", - "gueltig_bis": "" - } - } - }, - "gbs": [ - { - "type": "gehaltsbestandteil", - "guioptions": { - "infos": [ - "test info 1", - "test info 2" - ], - "errors": [ - "test error 1", - "test error 2" - ] - }, - "data": { - "gehaltstyp": "grund", - "betrag": "3500", - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "reflect" - }, - "data": { - "gueltig_ab": "1.1.2001", - "gueltig_bis": "" - } - }, - "valorisierung": "" - } - } - ] - }, - "fc5f4ab8-4652-40e4-9ac3-e76bbf7310af": { - "type": "vertragsbestandteilfunktion", - "guioptions": { - "id": "fc5f4ab8-4652-40e4-9ac3-e76bbf7310af" - }, - "data": { - "funktion": "Leitung", - "orget": "", - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "reflect" - }, - "data": { - "gueltig_ab": "1.1.2001", - "gueltig_bis": "" - } - } - }, - "gbs": [] - } - } - } - \ No newline at end of file diff --git a/system/UnitTests/vertragsbestandteil/gui/kuendigungsfrist01.json b/system/UnitTests/vertragsbestandteil/gui/kuendigungsfrist01.json deleted file mode 100644 index 4e279a047..000000000 --- a/system/UnitTests/vertragsbestandteil/gui/kuendigungsfrist01.json +++ /dev/null @@ -1,263 +0,0 @@ -{ - "type": "formdata", - "children": [ - { - "type": "tabs", - "guioptions": {}, - "children": [ - { - "type": "tab", - "guioptions": { - "title": "Allgemein", - "id": "allgemein" - }, - "children": [ - { - "type": "dv", - "guioptions": {}, - "children": [] - }, - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Kündigungsfrist", - "vertragsbestandteiltyp": "vertragsbestandteilkuendigungsfrist" - }, - "children": [ - "6ae61b45-99a8-406b-b583-9f0353dd834f" - ] - }, - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Befristung", - "vertragsbestandteiltyp": "vertragsbestandteilfreitext", - "childdefaults": { - "guioptions": { - "canhavegehaltsbestandteile": false, - "disabled": [ - "freitexttyp" - ], - "hidden": [ - "titel", - "freitext" - ] - }, - "data": { - "freitexttyp": "befristung", - "titel": "Befristung", - "freitext": "befristeter Dienstvertrag" - } - } - }, - "children": [] - } - ] - }, - { - "type": "tab", - "guioptions": { - "title": "Arbeitszeit & Basisgehalt", - "id": "arbeitszeit" - }, - "children": [ - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Arbeitszeit", - "vertragsbestandteiltyp": "vertragsbestandteilstunden", - "errors": [ - "test1", - "test2" - ], - "infos": [] - }, - "children": [ - "98704748-0ef0-4a70-94b7-5d8e719c2b3e" - ] - }, - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Zeitaufzeichnung", - "vertragsbestandteiltyp": "vertragsbestandteilzeitaufzeichnung", - "errors": [], - "infos": [] - }, - "children": [] - } - ] - }, - { - "type": "tab", - "guioptions": { - "title": "Funktionen", - "id": "funktionen" - }, - "children": [ - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Funktion", - "vertragsbestandteiltyp": "vertragsbestandteilfunktion", - "errors": [], - "infos": [] - }, - "children": [ - "fc5f4ab8-4652-40e4-9ac3-e76bbf7310af" - ] - } - ] - }, - { - "type": "tab", - "guioptions": { - "title": "Zusatzvereinbarungen", - "id": "zusatzvereinbarungen" - }, - "children": [ - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Zusatzvereinbarungen", - "vertragsbestandteiltyp": "vertragsbestandteilfreitext" - }, - "children": [] - } - ] - }, - { - "type": "tab", - "guioptions": { - "title": "Sonstiges", - "id": "sonstiges" - }, - "children": [ - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Kündigungsfrist", - "vertragsbestandteiltyp": "vertragsbestandteilkuendigungsfrist", - "errors": [], - "infos": [] - }, - "children": [] - } - ] - } - ] - } - ], - "data": { - "dienstverhaeltnisid": null, - "unternehmen": "gst", - "vertragsart_kurzbz": "echterdv", - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "set" - }, - "data": { - "gueltig_ab": "1.1.2001", - "gueltig_bis": "" - } - } - }, - "vbs": { - "98704748-0ef0-4a70-94b7-5d8e719c2b3e": { - "type": "vertragsbestandteilstunden", - "guioptions": { - "id": "98704748-0ef0-4a70-94b7-5d8e719c2b3e", - "infos": [ - "test info 1", - "test info 2" - ], - "errors": [ - "test error 1", - "test error 2" - ] - }, - "data": { - "stunden": "38,5", - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "reflect" - }, - "data": { - "gueltig_ab": "1.1.2001", - "gueltig_bis": "" - } - } - }, - "gbs": [ - { - "type": "gehaltsbestandteil", - "guioptions": { - "infos": [ - "test info 1", - "test info 2" - ], - "errors": [ - "test error 1", - "test error 2" - ] - }, - "data": { - "gehaltstyp": "grund", - "betrag": "3500", - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "reflect" - }, - "data": { - "gueltig_ab": "1.1.2001", - "gueltig_bis": "" - } - }, - "valorisierung": "" - } - } - ] - }, - "fc5f4ab8-4652-40e4-9ac3-e76bbf7310af": { - "type": "vertragsbestandteilfunktion", - "guioptions": { - "id": "fc5f4ab8-4652-40e4-9ac3-e76bbf7310af" - }, - "data": { - "funktion": "Leitung", - "orget": "", - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "reflect" - }, - "data": { - "gueltig_ab": "1.1.2001", - "gueltig_bis": "" - } - } - }, - "gbs": [] - }, - "6ae61b45-99a8-406b-b583-9f0353dd834f": { - "type": "vertragsbestandteilkuendigungsfrist", - "guioptions": { - "id": "6ae61b45-99a8-406b-b583-9f0353dd834f", - "removeable": true - }, - "data": { - "arbeitgeber_frist": "8", - "arbeitnehmer_frist": "4", - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "reflect" - }, - "data": { - "gueltig_ab": "1.1.2001", - "gueltig_bis": "" - } - } - } - } - } - } - \ No newline at end of file diff --git a/system/UnitTests/vertragsbestandteil/gui/readme.txt b/system/UnitTests/vertragsbestandteil/gui/readme.txt deleted file mode 100644 index 7aaeab96f..000000000 --- a/system/UnitTests/vertragsbestandteil/gui/readme.txt +++ /dev/null @@ -1,6 +0,0 @@ - - -testen: - -./vendor/bin/phpunit system/UnitTests/vertragsbestandteil/gui/FormDataTest.php -./vendor/bin/phpunit system/UnitTests/vertragsbestandteil/gui/GuiHandlerTest.php \ No newline at end of file diff --git a/system/UnitTests/vertragsbestandteil/gui/stunden01.json b/system/UnitTests/vertragsbestandteil/gui/stunden01.json deleted file mode 100644 index 48295f742..000000000 --- a/system/UnitTests/vertragsbestandteil/gui/stunden01.json +++ /dev/null @@ -1,241 +0,0 @@ -{ - "type": "formdata", - "children": [ - { - "type": "tabs", - "guioptions": {}, - "children": [ - { - "type": "tab", - "guioptions": { - "title": "Allgemein", - "id": "allgemein" - }, - "children": [ - { - "type": "dv", - "guioptions": {}, - "children": [] - }, - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Kündigungsfrist", - "vertragsbestandteiltyp": "vertragsbestandteilkuendigungsfrist" - }, - "children": [] - }, - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Befristung", - "vertragsbestandteiltyp": "vertragsbestandteilfreitext", - "childdefaults": { - "guioptions": { - "canhavegehaltsbestandteile": false, - "disabled": [ - "freitexttyp" - ], - "hidden": [ - "titel", - "freitext" - ] - }, - "data": { - "freitexttyp": "befristung", - "titel": "Befristung", - "freitext": "befristeter Dienstvertrag" - } - } - }, - "children": [] - } - ] - }, - { - "type": "tab", - "guioptions": { - "title": "Arbeitszeit & Basisgehalt", - "id": "arbeitszeit" - }, - "children": [ - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Arbeitszeit", - "vertragsbestandteiltyp": "vertragsbestandteilstunden", - "errors": [ - "test1", - "test2" - ], - "infos": [] - }, - "children": [ - "73a60d69-cbd5-40f0-bcb1-ed0ccdd4a9fd" - ] - }, - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Zeitaufzeichnung", - "vertragsbestandteiltyp": "vertragsbestandteilzeitaufzeichnung", - "errors": [], - "infos": [] - }, - "children": [] - } - ] - }, - { - "type": "tab", - "guioptions": { - "title": "Funktionen", - "id": "funktionen" - }, - "children": [ - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Funktion", - "vertragsbestandteiltyp": "vertragsbestandteilfunktion", - "errors": [], - "infos": [] - }, - "children": [ - "a0e35f18-e4d9-4dc3-8001-1b689360782a" - ] - } - ] - }, - { - "type": "tab", - "guioptions": { - "title": "Zusatzvereinbarungen", - "id": "zusatzvereinbarungen" - }, - "children": [ - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Zusatzvereinbarungen", - "vertragsbestandteiltyp": "vertragsbestandteilfreitext" - }, - "children": [] - } - ] - }, - { - "type": "tab", - "guioptions": { - "title": "Sonstiges", - "id": "sonstiges" - }, - "children": [ - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Kündigungsfrist", - "vertragsbestandteiltyp": "vertragsbestandteilkuendigungsfrist", - "errors": [], - "infos": [] - }, - "children": [] - } - ] - } - ] - } - ], - "data": { - "dienstverhaeltnisid": null, - "unternehmen": "gst", - "vertragsart_kurzbz": "echterdv", - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "set" - }, - "data": { - "gueltig_ab": "1.1.2011", - "gueltig_bis": "" - } - } - }, - "vbs": { - "73a60d69-cbd5-40f0-bcb1-ed0ccdd4a9fd": { - "type": "vertragsbestandteilstunden", - "guioptions": { - "id": "73a60d69-cbd5-40f0-bcb1-ed0ccdd4a9fd", - "infos": [ - "test info 1", - "test info 2" - ], - "errors": [ - "test error 1", - "test error 2" - ] - }, - "data": { - "stunden": 38.5, - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "reflect" - }, - "data": { - "gueltig_ab": "1.1.2011", - "gueltig_bis": "" - } - } - }, - "gbs": [ - { - "type": "gehaltsbestandteil", - "guioptions": { - "infos": [ - "test info 1", - "test info 2" - ], - "errors": [ - "test error 1", - "test error 2" - ] - }, - "data": { - "gehaltstyp": "grund", - "betrag": "3334", - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "reflect" - }, - "data": { - "gueltig_ab": "1.1.2011", - "gueltig_bis": "" - } - }, - "valorisierung": true - } - } - ] - }, - "a0e35f18-e4d9-4dc3-8001-1b689360782a": { - "type": "vertragsbestandteilfunktion", - "guioptions": { - "id": "a0e35f18-e4d9-4dc3-8001-1b689360782a" - }, - "data": { - "funktion": "Leitung", - "orget": "", - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "reflect" - }, - "data": { - "gueltig_ab": "1.1.2011", - "gueltig_bis": "" - } - } - }, - "gbs": [] - } - } -} - \ No newline at end of file diff --git a/system/UnitTests/vertragsbestandteil/gui/zeitaufzeichnung01.json b/system/UnitTests/vertragsbestandteil/gui/zeitaufzeichnung01.json deleted file mode 100644 index ce3d48a8d..000000000 --- a/system/UnitTests/vertragsbestandteil/gui/zeitaufzeichnung01.json +++ /dev/null @@ -1,264 +0,0 @@ -{ - "type": "formdata", - "children": [ - { - "type": "tabs", - "guioptions": {}, - "children": [ - { - "type": "tab", - "guioptions": { - "title": "Allgemein", - "id": "allgemein" - }, - "children": [ - { - "type": "dv", - "guioptions": {}, - "children": [] - }, - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Kündigungsfrist", - "vertragsbestandteiltyp": "vertragsbestandteilkuendigungsfrist" - }, - "children": [] - }, - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Befristung", - "vertragsbestandteiltyp": "vertragsbestandteilfreitext", - "childdefaults": { - "guioptions": { - "canhavegehaltsbestandteile": false, - "disabled": [ - "freitexttyp" - ], - "hidden": [ - "titel", - "freitext" - ] - }, - "data": { - "freitexttyp": "befristung", - "titel": "Befristung", - "freitext": "befristeter Dienstvertrag" - } - } - }, - "children": [] - } - ] - }, - { - "type": "tab", - "guioptions": { - "title": "Arbeitszeit & Basisgehalt", - "id": "arbeitszeit" - }, - "children": [ - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Arbeitszeit", - "vertragsbestandteiltyp": "vertragsbestandteilstunden", - "errors": [ - "test1", - "test2" - ], - "infos": [] - }, - "children": [ - "439336ad-05ee-4b2a-9a0c-df7dc1c7245e" - ] - }, - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Zeitaufzeichnung", - "vertragsbestandteiltyp": "vertragsbestandteilzeitaufzeichnung", - "errors": [], - "infos": [] - }, - "children": [ - "7625d25d-8fd9-476b-94a6-4fbb72c147d4" - ] - } - ] - }, - { - "type": "tab", - "guioptions": { - "title": "Funktionen", - "id": "funktionen" - }, - "children": [ - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Funktion", - "vertragsbestandteiltyp": "vertragsbestandteilfunktion", - "errors": [], - "infos": [] - }, - "children": [ - "81c92565-82fe-40ec-ad35-454c3218fb3b" - ] - } - ] - }, - { - "type": "tab", - "guioptions": { - "title": "Zusatzvereinbarungen", - "id": "zusatzvereinbarungen" - }, - "children": [ - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Zusatzvereinbarungen", - "vertragsbestandteiltyp": "vertragsbestandteilfreitext" - }, - "children": [] - } - ] - }, - { - "type": "tab", - "guioptions": { - "title": "Sonstiges", - "id": "sonstiges" - }, - "children": [ - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Kündigungsfrist", - "vertragsbestandteiltyp": "vertragsbestandteilkuendigungsfrist", - "errors": [], - "infos": [] - }, - "children": [] - } - ] - } - ] - } - ], - "data": { - "dienstverhaeltnisid": null, - "unternehmen": "", - "vertragsart_kurzbz": "", - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "set" - }, - "data": { - "gueltig_ab": "", - "gueltig_bis": "" - } - } - }, - "vbs": { - "439336ad-05ee-4b2a-9a0c-df7dc1c7245e": { - "type": "vertragsbestandteilstunden", - "guioptions": { - "id": "439336ad-05ee-4b2a-9a0c-df7dc1c7245e", - "infos": [ - "test info 1", - "test info 2" - ], - "errors": [ - "test error 1", - "test error 2" - ] - }, - "data": { - "stunden": "38,5", - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "reflect" - }, - "data": { - "gueltig_ab": "", - "gueltig_bis": "" - } - } - }, - "gbs": [ - { - "type": "gehaltsbestandteil", - "guioptions": { - "infos": [ - "test info 1", - "test info 2" - ], - "errors": [ - "test error 1", - "test error 2" - ] - }, - "data": { - "gehaltstyp": "", - "betrag": "", - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "reflect" - }, - "data": { - "gueltig_ab": "", - "gueltig_bis": "" - } - }, - "valorisierung": true - } - } - ] - }, - "81c92565-82fe-40ec-ad35-454c3218fb3b": { - "type": "vertragsbestandteilfunktion", - "guioptions": { - "id": "81c92565-82fe-40ec-ad35-454c3218fb3b" - }, - "data": { - "funktion": "Leitung", - "orget": "", - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "reflect" - }, - "data": { - "gueltig_ab": "", - "gueltig_bis": "" - } - } - }, - "gbs": [] - }, - "7625d25d-8fd9-476b-94a6-4fbb72c147d4": { - "type": "vertragsbestandteilzeitaufzeichnung", - "guioptions": { - "id": "7625d25d-8fd9-476b-94a6-4fbb72c147d4", - "removeable": true - }, - "data": { - "zeitaufzeichnung": true, - "azgrelevant": "", - "homeoffice": true, - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "reflect" - }, - "data": { - "gueltig_ab": "", - "gueltig_bis": "" - } - } - } - } - } - } - \ No newline at end of file diff --git a/system/UnitTests/vertragsbestandteil/gui/zusatz01.json b/system/UnitTests/vertragsbestandteil/gui/zusatz01.json deleted file mode 100644 index b5d63b0a2..000000000 --- a/system/UnitTests/vertragsbestandteil/gui/zusatz01.json +++ /dev/null @@ -1,354 +0,0 @@ -{ - "type": "formdata", - "children": [ - { - "type": "tabs", - "guioptions": {}, - "children": [ - { - "type": "tab", - "guioptions": { - "title": "Allgemein", - "id": "allgemein" - }, - "children": [ - { - "type": "dv", - "guioptions": {}, - "children": [] - }, - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Kündigungsfrist", - "vertragsbestandteiltyp": "vertragsbestandteilkuendigungsfrist" - }, - "children": [] - }, - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Befristung", - "vertragsbestandteiltyp": "vertragsbestandteilfreitext", - "childdefaults": { - "guioptions": { - "canhavegehaltsbestandteile": false, - "disabled": [ - "freitexttyp" - ], - "hidden": [ - "titel", - "freitext" - ] - }, - "data": { - "freitexttyp": "befristung", - "titel": "Befristung", - "freitext": "befristeter Dienstvertrag" - } - } - }, - "children": [] - } - ] - }, - { - "type": "tab", - "guioptions": { - "title": "Arbeitszeit & Basisgehalt", - "id": "arbeitszeit" - }, - "children": [ - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Arbeitszeit", - "vertragsbestandteiltyp": "vertragsbestandteilstunden", - "errors": [ - "test1", - "test2" - ], - "infos": [] - }, - "children": [ - "5671ff88-9580-4b20-8bbf-a744bc353485" - ] - }, - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Zeitaufzeichnung", - "vertragsbestandteiltyp": "vertragsbestandteilzeitaufzeichnung", - "errors": [], - "infos": [] - }, - "children": [ - "484f7166-7792-4cc7-b906-0db09c65bbf4" - ] - } - ] - }, - { - "type": "tab", - "guioptions": { - "title": "Funktionen", - "id": "funktionen" - }, - "children": [ - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Funktion", - "vertragsbestandteiltyp": "vertragsbestandteilfunktion", - "errors": [], - "infos": [] - }, - "children": [ - "2c38c937-3157-4404-ad33-dfad2ed15633", - "b983791e-ff2e-4eeb-891e-b786c90daf69" - ] - } - ] - }, - { - "type": "tab", - "guioptions": { - "title": "Zusatzvereinbarungen", - "id": "zusatzvereinbarungen" - }, - "children": [ - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Zusatzvereinbarungen", - "vertragsbestandteiltyp": "vertragsbestandteilfreitext" - }, - "children": [ - "b168a3bb-d0e2-407f-8192-525a5ab59b22" - ] - } - ] - }, - { - "type": "tab", - "guioptions": { - "title": "Sonstiges", - "id": "sonstiges" - }, - "children": [ - { - "type": "vertragsbestandteillist", - "guioptions": { - "title": "Kündigungsfrist", - "vertragsbestandteiltyp": "vertragsbestandteilkuendigungsfrist", - "errors": [], - "infos": [] - }, - "children": [ - "b7c613f2-f82b-45af-bc6a-9c5cefb41e91" - ] - } - ] - } - ] - } - ], - "data": { - "dienstverhaeltnisid": null, - "unternehmen": "", - "vertragsart_kurzbz": "", - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "set" - }, - "data": { - "gueltig_ab": "1.1.2010", - "gueltig_bis": "" - } - } - }, - "vbs": { - "5671ff88-9580-4b20-8bbf-a744bc353485": { - "type": "vertragsbestandteilstunden", - "guioptions": { - "id": "5671ff88-9580-4b20-8bbf-a744bc353485", - "infos": [ - "test info 1", - "test info 2" - ], - "errors": [ - "test error 1", - "test error 2" - ] - }, - "data": { - "stunden": "38,5", - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "reflect" - }, - "data": { - "gueltig_ab": "1.1.2010", - "gueltig_bis": "" - } - } - }, - "gbs": [ - { - "type": "gehaltsbestandteil", - "guioptions": { - "infos": [ - "test info 1", - "test info 2" - ], - "errors": [ - "test error 1", - "test error 2" - ] - }, - "data": { - "gehaltstyp": "", - "betrag": "", - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "reflect" - }, - "data": { - "gueltig_ab": "1.1.2010", - "gueltig_bis": "" - } - }, - "valorisierung": "" - } - } - ] - }, - "2c38c937-3157-4404-ad33-dfad2ed15633": { - "type": "vertragsbestandteilfunktion", - "guioptions": { - "id": "2c38c937-3157-4404-ad33-dfad2ed15633" - }, - "data": { - "funktion": "Leitung", - "orget": "sdf", - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "reflect" - }, - "data": { - "gueltig_ab": "1.1.2010", - "gueltig_bis": "" - } - } - }, - "gbs": [ - { - "type": "gehaltsbestandteil", - "guioptions": { - "id": "a5df7915-6935-47d8-9751-f8f8d63d188b", - "removeable": true - }, - "data": { - "gehaltstyp": "zulage", - "betrag": "111", - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "reflect" - }, - "data": { - "gueltig_ab": "1.1.2010", - "gueltig_bis": "" - } - }, - "valorisierung": true - } - } - ] - }, - "b983791e-ff2e-4eeb-891e-b786c90daf69": { - "type": "vertragsbestandteilfunktion", - "guioptions": { - "id": "b983791e-ff2e-4eeb-891e-b786c90daf69", - "removeable": true - }, - "data": { - "funktion": "", - "orget": "", - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "reflect" - }, - "data": { - "gueltig_ab": "1.1.2010", - "gueltig_bis": "" - } - } - }, - "gbs": [] - }, - "b168a3bb-d0e2-407f-8192-525a5ab59b22": { - "type": "vertragsbestandteilfreitext", - "guioptions": { - "id": "b168a3bb-d0e2-407f-8192-525a5ab59b22", - "removeable": true - }, - "data": { - "freitexttyp": "allin", - "titel": "Lorem ipsum", - "freitext": "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. \nAt vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. ", - "kuendigungsrelevant": "", - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "reflect" - }, - "data": { - "gueltig_ab": "1.1.2010", - "gueltig_bis": "" - } - } - }, - "gbs": [] - }, - "b7c613f2-f82b-45af-bc6a-9c5cefb41e91": { - "type": "vertragsbestandteilkuendigungsfrist", - "guioptions": { - "id": "b7c613f2-f82b-45af-bc6a-9c5cefb41e91", - "removeable": true - }, - "data": { - "arbeitgeber_frist": "", - "arbeitnehmer_frist": "", - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "reflect" - }, - "data": { - "gueltig_ab": "1.1.2010", - "gueltig_bis": "" - } - } - } - }, - "484f7166-7792-4cc7-b906-0db09c65bbf4": { - "type": "vertragsbestandteilzeitaufzeichnung", - "guioptions": { - "id": "484f7166-7792-4cc7-b906-0db09c65bbf4", - "removeable": true - }, - "data": { - "zeitaufzeichnung": true, - "azgrelevant": false, - "homeoffice": true, - "gueltigkeit": { - "guioptions": { - "sharedstatemode": "reflect" - }, - "data": { - "gueltig_ab": "1.1.2010", - "gueltig_bis": "" - } - } - } - } - } - } \ No newline at end of file From c90da4b50e808fd130c8051957eb323f47c13adc Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 18 Apr 2023 13:26:08 +0200 Subject: [PATCH 050/263] start to implement validation --- .../Vertragsbestandteil.php | 19 +++++++++++++++++++ .../VertragsbestandteilFunktion.php | 10 ++++++++++ 2 files changed, 29 insertions(+) diff --git a/application/libraries/vertragsbestandteil/Vertragsbestandteil.php b/application/libraries/vertragsbestandteil/Vertragsbestandteil.php index e55337a01..0070babe7 100644 --- a/application/libraries/vertragsbestandteil/Vertragsbestandteil.php +++ b/application/libraries/vertragsbestandteil/Vertragsbestandteil.php @@ -20,9 +20,14 @@ abstract class Vertragsbestandteil implements \JsonSerializable protected $gehaltsbestandteile; + protected $isvalid; + protected $validationerrors; + public function __construct() { $this->gehaltsbestandteile = array(); + $this->isvalid = false; + $this->validationerrors = array(); } public function hydrateByStdClass($data) @@ -203,5 +208,19 @@ EOTXT; // can be overridden in childs } + public function isValid() + { + return $this->isvalid; + } + + public function getValidationErrors() + { + return $this->validationerrors; + } + + public function validate() { + return array(); + } + public abstract function toStdClass(); } diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php b/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php index 54184dcb8..25135cfd1 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php @@ -101,4 +101,14 @@ EOTXT; 'insertvon' => getAuthUID() ); } + + public function validate() + { + if( (inval($this->benutzerfunktion_id) < 1) + && ($this->benutzerfunktiondata === NULL) ) { + $this->isvalid = false; + $this->validationerrors[] = 'Eine bestehende Funktion oder eine ' + . 'Funktion und eine Organisationseinheit müssen ausgewählt sein.'; + } + } } From 535578c399cccdba7007dd69c5884ad04209f676 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 18 Apr 2023 13:30:56 +0200 Subject: [PATCH 051/263] validation --- .../libraries/vertragsbestandteil/Vertragsbestandteil.php | 8 +++++++- .../vertragsbestandteil/VertragsbestandteilFunktion.php | 5 +++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/application/libraries/vertragsbestandteil/Vertragsbestandteil.php b/application/libraries/vertragsbestandteil/Vertragsbestandteil.php index 0070babe7..161fc65f4 100644 --- a/application/libraries/vertragsbestandteil/Vertragsbestandteil.php +++ b/application/libraries/vertragsbestandteil/Vertragsbestandteil.php @@ -219,7 +219,13 @@ EOTXT; } public function validate() { - return array(); + if( count($this->validationerrors) > 0 ) { + $this->isvalid = false; + } else { + $this->isvalid = true; + } + + return $this->isvalid; } public abstract function toStdClass(); diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php b/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php index 25135cfd1..0e3475fa5 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php @@ -104,11 +104,12 @@ EOTXT; public function validate() { - if( (inval($this->benutzerfunktion_id) < 1) + if( (intval($this->benutzerfunktion_id) < 1) && ($this->benutzerfunktiondata === NULL) ) { - $this->isvalid = false; $this->validationerrors[] = 'Eine bestehende Funktion oder eine ' . 'Funktion und eine Organisationseinheit müssen ausgewählt sein.'; } + + parent::validate(); } } From 138cfd662d721c3a26e601d6c2ac6e4a50df3321 Mon Sep 17 00:00:00 2001 From: Werner Masik Date: Tue, 18 Apr 2023 13:50:07 +0200 Subject: [PATCH 052/263] added return --- .../vertragsbestandteil/VertragsbestandteilFunktion.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php b/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php index 0e3475fa5..facc0cbd0 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php @@ -110,6 +110,6 @@ EOTXT; . 'Funktion und eine Organisationseinheit müssen ausgewählt sein.'; } - parent::validate(); + return parent::validate(); } } From f54351c7a3f7a1354549790fac0376309c514e6f Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 20 Apr 2023 16:38:56 +0200 Subject: [PATCH 053/263] - added missing model --- application/controllers/system/MigrateContract.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/controllers/system/MigrateContract.php b/application/controllers/system/MigrateContract.php index 8a1b6fff6..88eb4f910 100644 --- a/application/controllers/system/MigrateContract.php +++ b/application/controllers/system/MigrateContract.php @@ -67,6 +67,7 @@ class MigrateContract extends CLI_Controller $this->load->model('vertragsbestandteil/VertragsbestandteilZeitaufzeichnung_model','VertragsbestandteilZeitaufzeichnungModel'); $this->load->model('vertragsbestandteil/VertragsbestandteilFreitext_model','VertragsbestandteilFreitextModel'); $this->load->model('vertragsbestandteil/VertragsbestandteilFunktion_model','VertragsbestandteilFunktionModel'); + $this->load->model('vertragsbestandteil/VertragsbestandteilKarenz_model','VertragsbestandteilKarenzModel'); $failed = false; $this->db->trans_begin(); From b726f2ca5e1c53a6543949e9b829820c883a6f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Mon, 24 Apr 2023 07:14:42 +0200 Subject: [PATCH 054/263] Vertragsstunden mit 0.00 werden wie NULL behandelt --- .../controllers/system/MigrateContract.php | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/application/controllers/system/MigrateContract.php b/application/controllers/system/MigrateContract.php index 88eb4f910..8c6f0ad7c 100644 --- a/application/controllers/system/MigrateContract.php +++ b/application/controllers/system/MigrateContract.php @@ -1,8 +1,8 @@ load->model('codex/bisverwendung_model', 'BisVerwendungModel'); $this->load->model('person/benutzerfunktion_model', 'BenutzerfunktionModel'); - + $this->matching_ba1_vertragsart = array( '101'=>'DV zum Bund', '102'=>'DV anderen Gebietskörperschaft', @@ -109,7 +109,7 @@ class MigrateContract extends CLI_Controller { $vbs_id = getData($resultVBS); echo 'VBS:'.$vbs_id; - + switch($row_vbs['vertragsbestandteiltyp_kurzbz']) { case 'stunden': @@ -157,7 +157,7 @@ class MigrateContract extends CLI_Controller $this->db->trans_rollback(); } } - + private function _insertVBSKarenz($vbs_id, $row_vbs) { return $this->VertragsbestandteilKarenzModel->insert( @@ -284,7 +284,7 @@ class MigrateContract extends CLI_Controller $karenztyp = 'bildungskarenz'; else $karenztyp = 'elternkarenz'; - + // VBS anlegen und Funktion zuweisen $newVBSIndex = $this->_getNewVBSIndex($contracts, $dv); $contracts['dv'][$dv]['vbs'][$newVBSIndex]['vertragsbestandteiltyp_kurzbz'] = 'karenz'; @@ -294,10 +294,10 @@ class MigrateContract extends CLI_Controller $contracts['dv'][$dv]['vbs'][$newVBSIndex]['geplanter_geburtstermin'] = null; $contracts['dv'][$dv]['vbs'][$newVBSIndex]['tatsaechlicher_geburtstermin'] = null; $contracts['dv'][$dv]['vbs'][$newVBSIndex]['hint'] = 'Dauer:'.$dauer; - } + } } - /** + /** * Holt die Funktionen die Vertragsrelevant sind und verknüpft diese */ private function _addVertragsbestandteilFunktion(&$contracts, $user) @@ -325,7 +325,7 @@ class MigrateContract extends CLI_Controller && ($row_contract['bis'] == '' || $row_contract['bis'] >= $row_funktion->datum_von) && ( ( - isset($row_funktion->datum_bis) && isset($row_contract['bis']) + isset($row_funktion->datum_bis) && isset($row_contract['bis']) && $row_funktion->datum_bis <= $row_contract['bis'] ) || $row_funktion->datum_bis == '' @@ -371,7 +371,7 @@ class MigrateContract extends CLI_Controller } /** - * Prueft ob schon ein Vertragsbestandteil fuer Zeitaufzeichnung vorhanden ist das in den Zeitraum passt + * Prueft ob schon ein Vertragsbestandteil fuer Zeitaufzeichnung vorhanden ist das in den Zeitraum passt * bzw direkt anschließt. Wenn es direkt anschließend ist und die Art gleich sind wird die Laufzeit verlaengert * Ansonsten wird ein neuer VBS angelegt */ @@ -383,7 +383,7 @@ class MigrateContract extends CLI_Controller { if ($row_vbs['vertragsbestandteiltyp_kurzbz'] == 'zeitaufzeichnung') { - if ($this->_isVBSAngrenzend($row_verwendung, $row_vbs) + if ($this->_isVBSAngrenzend($row_verwendung, $row_vbs) && $row_vbs['zeitaufzeichnung'] == $row_verwendung->zeitaufzeichnungspflichtig && $row_vbs['azgrelevant'] == $row_verwendung->azgrelevant && $row_vbs['homeoffice'] == $row_verwendung->homeoffice @@ -446,14 +446,14 @@ class MigrateContract extends CLI_Controller } /** - * Prueft ob schon ein Vertragsbestandteil mit diesem Stundenausmass vorhanden ist das in den Zeitraum passt + * Prueft ob schon ein Vertragsbestandteil mit diesem Stundenausmass vorhanden ist das in den Zeitraum passt * bzw direkt anschließt. Wenn es direkt anschließend ist und die Stunden gleich sind wird die Laufzeit verlaengert * Ansonsten wird ein neuer VBS angelegt */ private function _addVertragsbestandteilStunden(&$contracts, $dv, $row_verwendung) { // Nur anlegen wenn im aktuellen Eintrag auch Stunden eingetragen sind - if ($row_verwendung->vertragsstunden != '') + if ($row_verwendung->vertragsstunden != '' && $row_verwendung->vertragsstunden != '0.00') { if (isset($contracts['dv'][$dv]['vbs'])) { @@ -462,7 +462,7 @@ class MigrateContract extends CLI_Controller if ($row_vbs['vertragsbestandteiltyp_kurzbz'] == 'stunden') { if ($this->_isVBSAngrenzend($row_verwendung, $row_vbs) && $row_vbs['wochenstunden'] == $row_verwendung->vertragsstunden) - { + { // stunden bleiben gleich - Ende des VBS verlaengern $contracts['dv'][$dv]['vbs'][$index_vbs]['bis'] = $row_verwendung->ende; return true; @@ -522,8 +522,8 @@ class MigrateContract extends CLI_Controller (isset($row_dv['bis']) && $row_verwendung->ende != '' && ($row_dv['bis'] == '' || $row_dv['bis'] >= $row_verwendung->ende) ) || // direkt angrenzend an dieses DV - (isset($row_dv['bis']) - && ($row_dv['bis'] == '' + (isset($row_dv['bis']) + && ($row_dv['bis'] == '' || $row_dv['bis'] == $dtstart->sub(new DateInterval('P1D'))->format('Y-m-d') ) ) @@ -535,7 +535,7 @@ class MigrateContract extends CLI_Controller } } } - + $newDvIndex = $this->_getNewDVIndex($contracts); $contracts['dv'][$newDvIndex]['mitarbeiter_uid'] = $row_verwendung->mitarbeiter_uid; $contracts['dv'][$newDvIndex]['von'] = $row_verwendung->beginn; @@ -564,7 +564,7 @@ class MigrateContract extends CLI_Controller { if (isset($contracts['dv']) && is_array($contracts['dv'])) return max(array_keys($contracts['dv'])) + 1; - else + else return 0; } } From 2163ddcdf5f73c0adba41d2d528024128cebcdbd Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 25 Apr 2023 09:22:03 +0200 Subject: [PATCH 055/263] add Interface IValidation, implement validate stub in all Vertragsbestandteile and Gehaltsbestandteil and DV --- .../vertragsbestandteil/Dienstverhaeltnis.php | 34 ++++++++++- .../Gehaltsbestandteil.php | 34 ++++++++++- .../vertragsbestandteil/IValidation.php | 16 +++++ .../Vertragsbestandteil.php | 2 +- .../VertragsbestandteilBefristung.php | 6 +- .../VertragsbestandteilFreitext.php | 5 ++ .../VertragsbestandteilKarenz.php | 5 +- .../VertragsbestandteilKuendigungsfrist.php | 5 +- .../VertragsbestandteilLehre.php | 5 +- .../VertragsbestandteilStunden.php | 5 ++ .../VertragsbestandteilUrlaubsanspruch.php | 5 +- .../VertragsbestandteilZeitaufzeichnung.php | 5 +- .../Gehaltsbestandteil_model.php | 61 ++++++++++++++++++- 13 files changed, 175 insertions(+), 13 deletions(-) create mode 100644 application/libraries/vertragsbestandteil/IValidation.php diff --git a/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php b/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php index aa89fe781..78efe36b3 100644 --- a/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php +++ b/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php @@ -11,7 +11,7 @@ const TYPE_ECHT_FREI = 'echterfreier'; const TYPE_WERKVERTRAG = 'werkvertrag'; const TYPE_UEBERLASSUNG = 'ueberlassungsvertrag'; -class Dienstverhaeltnis { +class Dienstverhaeltnis implements IValidation { /** @var integer */ protected $dienstverhaeltnis_id; /** @var integer */ @@ -20,7 +20,16 @@ class Dienstverhaeltnis { protected $vertragsart_kurzbz; protected $gueltig_ab; protected $gueltig_bis; + + protected $isvalid; + protected $validationerrors; + public function __construct() + { + $this->isvalid = false; + $this->validationerrors = array(); + } + public function toStdClass(): \stdClass { $tmp = array( @@ -141,4 +150,27 @@ EOTXT; return $this; } + + public function isValid() + { + return $this->isvalid; + } + + public function getValidationErrors() + { + return $this->validationerrors; + } + + public function validate() { + //do Validation here + + // return status after Validation + if( count($this->validationerrors) > 0 ) { + $this->isvalid = false; + } else { + $this->isvalid = true; + } + + return $this->isvalid; + } } \ No newline at end of file diff --git a/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php b/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php index 0fc786124..88fce2e4e 100644 --- a/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php +++ b/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php @@ -4,7 +4,7 @@ namespace vertragsbestandteil; /** * Salary always depends on employment (Dienstverhältnis) and optionally on part of contract (Vetragsbestandteil) */ -class Gehaltsbestandteil +class Gehaltsbestandteil implements IValidation { protected $gehaltsbestandteil_id; protected $dienstverhaeltnis_id; @@ -23,7 +23,16 @@ class Gehaltsbestandteil protected $insertvon; protected $updateamum; protected $updatevon; + + protected $isvalid; + protected $validationerrors; + public function __construct() + { + $this->isvalid = false; + $this->validationerrors = array(); + } + public function hydrateByStdClass($data) { isset($data->gehaltsbestandteil_id) && $this->setGehaltsbestandteil_id($data->gehaltsbestandteil_id); @@ -272,4 +281,27 @@ class Gehaltsbestandteil EOTXT; return $txt; } + + public function isValid() + { + return $this->isvalid; + } + + public function getValidationErrors() + { + return $this->validationerrors; + } + + public function validate() { + //do Validation here + + // return status after Validation + if( count($this->validationerrors) > 0 ) { + $this->isvalid = false; + } else { + $this->isvalid = true; + } + + return $this->isvalid; + } } diff --git a/application/libraries/vertragsbestandteil/IValidation.php b/application/libraries/vertragsbestandteil/IValidation.php new file mode 100644 index 000000000..2898ec41b --- /dev/null +++ b/application/libraries/vertragsbestandteil/IValidation.php @@ -0,0 +1,16 @@ +execQuery($qry, array($dienstverhaeltnis_id), $this->getEncryptedColumns()); - } + + public function getGehaltsbestandteile($dienstverhaeltnis_id=1, $stichtag=null) + { + $stichtagclause = ''; + if( !is_null($stichtag) ) + { + $date = strftime('%Y-%m-%d', strtotime($stichtag)); + $stichtagclause = 'AND ' . $this->escape($date) + . ' BETWEEN COALESCE(v.von, \'1970-01-01\'::date)' + . ' AND COALESCE(v.bis, \'2170-01-01\'::date)'; + } -} \ No newline at end of file + $sql = <<execReadOnlyQuery( + $query, + array($dienstverhaeltnis_id), + $this->getEncryptedColumns() + ); + + $gehaltsbestandteile = array(); + if( null !== ($rows = getData($query)) ) + { + foreach( $rows as $row ) { + $tmpgb = new Gehaltsbestandteil(); + $tmpgb->hydrateByStdClass($row); + $gehaltsbestandteile[] = $tmpgb; + } + } + + return $gehaltsbestandteile; + } + + + public function getGehaltsbestandteil($id) + { + $query = $this->load($id, $this->getEncryptedColumns()); + $gehaltsbestandteil = null; + + if( null !== ($row = getData($query)) ) + { + $gehaltsbestandteil = new Gehaltsbestandteil(); + $gehaltsbestandteil->hydrateByStdClass($row[0]); + } + + return $gehaltsbestandteil; + } +} From 7a4f55bb0ca2378e5e1cf9009b4b07587fca9921 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 25 Apr 2023 09:27:40 +0200 Subject: [PATCH 056/263] require interface IValidation --- application/libraries/vertragsbestandteil/Dienstverhaeltnis.php | 1 + .../libraries/vertragsbestandteil/GehaltsbestandteilLib.php | 1 + .../libraries/vertragsbestandteil/VertragsbestandteilLib.php | 1 + 3 files changed, 3 insertions(+) diff --git a/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php b/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php index 78efe36b3..5511f8fba 100644 --- a/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php +++ b/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php @@ -1,4 +1,5 @@ Date: Tue, 25 Apr 2023 16:07:42 +0200 Subject: [PATCH 057/263] Fixes: code quality checks --- application/config/db_crypt.php | 2 +- application/core/DB_Model.php | 63 ++++++++++------------ application/libraries/FilterCmptLib.php | 8 +-- application/libraries/FilterWidgetLib.php | 10 ++-- application/libraries/TableWidgetLib.php | 2 +- application/models/person/Person_model.php | 16 ++++-- application/widgets/FilterWidget.php | 4 +- application/widgets/TableWidget.php | 19 +------ 8 files changed, 56 insertions(+), 68 deletions(-) diff --git a/application/config/db_crypt.php b/application/config/db_crypt.php index 72f8c30d8..b9360861b 100644 --- a/application/config/db_crypt.php +++ b/application/config/db_crypt.php @@ -3,7 +3,7 @@ /** * Copyright (C) 2023 fhcomplete.org * - * This program is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/application/core/DB_Model.php b/application/core/DB_Model.php index 062bc06c2..d554d8c5c 100644 --- a/application/core/DB_Model.php +++ b/application/core/DB_Model.php @@ -17,6 +17,8 @@ * along with this program. If not, see . */ +use \stdClass as stdClass; + if (!defined('BASEPATH')) exit('No direct script access allowed'); /** @@ -120,7 +122,8 @@ class DB_Model extends CI_Model if (is_null($this->dbTable)) return error('The given database table name is not valid', EXIT_MODEL); // If this table has UDF and the validation of them is ok - if (isError($validate = $this->_prepareUDFsWrite($data, $this->dbTable))) return $validate; + $validate = $this->_prepareUDFsWrite($data, $this->dbTable); + if (isError($validate)) return $validate; // Add the pgp_sym_eccrypt postgresql function to the set clause if needed $this->_addEncrypt($encryptedColumns, $data); @@ -174,7 +177,8 @@ class DB_Model extends CI_Model if (is_null($this->dbTable)) return error('The given database table name is not valid', EXIT_MODEL); // If this table has UDF and the validation of them is ok - if (isError($validate = $this->_prepareUDFsWrite($data, $this->dbTable, $id))) return $validate; + $validate = $this->_prepareUDFsWrite($data, $this->dbTable, $id); + if (isError($validate)) return $validate; $tmpId = $id; @@ -341,7 +345,8 @@ class DB_Model extends CI_Model // NOTE: $this->db->list_fields($tables[$t]) doesn't work if there are two tables with // the same name in two different schemas, use this workaround $fields = array(); - if (isSuccess($lstColumns = $this->_list_columns($schemaAndTable->schema, $schemaAndTable->table))) + $lstColumns = $this->_list_columns($schemaAndTable->schema, $schemaAndTable->table); + if (isSuccess($lstColumns)) { $fields = $lstColumns->retval; } @@ -419,7 +424,8 @@ class DB_Model extends CI_Model $tmpFilteredArray = array_filter(get_object_vars($sideTableObj)); if (isset($tmpFilteredArray) && count($tmpFilteredArray) > 0) { - if (($k = $this->_findMainTable($mainTableObj, $returnArray)) === false) + $k = $this->_findMainTable($mainTableObj, $returnArray); + if ($k === false) { $mainTableObj->{$sideTableProperty} = array($sideTableObj); $returnArray[$returnArrayCounter++] = $mainTableObj; @@ -802,8 +808,7 @@ class DB_Model extends CI_Model $cleanedQuery = trim(preg_replace('/\t|\n|\r|;/', '', $query)); // // - if ( - (stripos($cleanedQuery, 'INSERT') > 0 || stripos($cleanedQuery, 'INSERT') == false) + if ((stripos($cleanedQuery, 'INSERT') > 0 || stripos($cleanedQuery, 'INSERT') == false) && (stripos($cleanedQuery, 'UPDATE') > 0 || stripos($cleanedQuery, 'UPDATE') == false) && (stripos($cleanedQuery, 'CREATE') > 0 || stripos($cleanedQuery, 'CREATE') == false) && (stripos($cleanedQuery, 'DELETE') > 0 || stripos($cleanedQuery, 'DELETE') == false) @@ -881,7 +886,8 @@ class DB_Model extends CI_Model $result->schema = DB_Model::DEFAULT_SCHEMA; // If a schema is specified - if (($pos = strpos($schemaAndTable, '.')) !== false) + $pos = strpos($schemaAndTable, '.'); + if ($pos !== false) { $result->schema = substr($schemaAndTable, 0, $pos); $result->table = substr($schemaAndTable, $pos + 1); @@ -911,9 +917,8 @@ class DB_Model extends CI_Model && array_key_exists(self::CRYPT_PASSWORD_NAME, $encryptedColumns[$column])) { // Password to encrypt data - $encryptionPassword = $this->config->item(self::CRYPT_CONF_PASSWORDS)[ - $encryptedColumns[$column][self::CRYPT_PASSWORD_NAME] - ]; + $cryptConfPasswords = $this->config->item(self::CRYPT_CONF_PASSWORDS); + $encryptionPassword = $cryptConfPasswords[$encryptedColumns[$column][self::CRYPT_PASSWORD_NAME]]; // Add the encrypted column to the set clause without escaping $this->db->set( @@ -952,15 +957,11 @@ class DB_Model extends CI_Model && array_key_exists(self::CRYPT_PASSWORD_NAME, $definition)) { // And if exists the wanted password to decrypt in the configs - if (array_key_exists( - $definition[self::CRYPT_PASSWORD_NAME], - $this->config->item(self::CRYPT_CONF_PASSWORDS)) - ) + if (array_key_exists($definition[self::CRYPT_PASSWORD_NAME], $this->config->item(self::CRYPT_CONF_PASSWORDS))) { // Password to decrypt data - $decryptionPassword = $this->config->item(self::CRYPT_CONF_PASSWORDS)[ - $definition[self::CRYPT_PASSWORD_NAME] - ]; + $cryptConfPasswords = $this->config->item(self::CRYPT_CONF_PASSWORDS); + $decryptionPassword = $cryptConfPasswords[$definition[self::CRYPT_PASSWORD_NAME]]; // Find and replace all the occurrences of the provided encrypted columns // with the postgresql decryption function @@ -997,15 +998,11 @@ class DB_Model extends CI_Model && array_key_exists(self::CRYPT_PASSWORD_NAME, $definition)) { // And if exists the wanted password to decrypt in the configs - if (array_key_exists( - $definition[self::CRYPT_PASSWORD_NAME], - $this->config->item(self::CRYPT_CONF_PASSWORDS)) - ) + if (array_key_exists($definition[self::CRYPT_PASSWORD_NAME], $this->config->item(self::CRYPT_CONF_PASSWORDS))) { // Password to decrypt data - $decryptionPassword = $this->config->item(self::CRYPT_CONF_PASSWORDS)[ - $definition[self::CRYPT_PASSWORD_NAME] - ]; + $cryptConfPasswords = $this->config->item(self::CRYPT_CONF_PASSWORDS); + $decryptionPassword = $cryptConfPasswords[$definition[self::CRYPT_PASSWORD_NAME]]; // ----------------------------------------- // SELECT @@ -1063,14 +1060,12 @@ class DB_Model extends CI_Model ) { // Then rename the column using the postgresql decryption function - $tmpWhere[ - sprintf( - self::CRYPT_WHERE_TEMPLATE, - $encryptedColumn, - $decryptionPassword, - $definition[self::CRYPT_CAST] - ).$operator - ] = $condition; + $tmpWhere[sprintf( + self::CRYPT_WHERE_TEMPLATE, + $encryptedColumn, + $decryptionPassword, + $definition[self::CRYPT_CAST] + ).$operator] = $condition; } else // otherwise copy the column as it is { @@ -1127,11 +1122,11 @@ class DB_Model extends CI_Model { if ($id != null) { - $prepareUDFsWrite = $this->udflib->prepareUDFsWrite($data, $this->dbTable, $this->_getUDFsNoPerms($id)); + $prepareUDFsWrite = $this->udflib->prepareUDFsWrite($data, $schemaAndTable, $this->_getUDFsNoPerms($id)); } else { - $prepareUDFsWrite = $this->udflib->prepareUDFsWrite($data, $this->dbTable); + $prepareUDFsWrite = $this->udflib->prepareUDFsWrite($data, $schemaAndTable); } } diff --git a/application/libraries/FilterCmptLib.php b/application/libraries/FilterCmptLib.php index 3e885b6e7..8b13ae3e5 100644 --- a/application/libraries/FilterCmptLib.php +++ b/application/libraries/FilterCmptLib.php @@ -508,10 +508,12 @@ class FilterCmptLib $saveCustomFilter = true; } - if ($saveCustomFilter === true) + if ($saveCustomFilter === true) { - $this->_setSessionElement(FilterCmptLib::SESSION_SIDE_MENU, - $this->_generateFilterMenu($this->_app, $this->_datasetName)); + $this->_setSessionElement( + FilterCmptLib::SESSION_SIDE_MENU, + $this->_generateFilterMenu($this->_app, $this->_datasetName) + ); } return $saveCustomFilter; diff --git a/application/libraries/FilterWidgetLib.php b/application/libraries/FilterWidgetLib.php index 72a749d60..9968767d9 100644 --- a/application/libraries/FilterWidgetLib.php +++ b/application/libraries/FilterWidgetLib.php @@ -19,6 +19,8 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); +use \stdClass as stdClass; + /** * FilterWidget logic */ @@ -139,7 +141,7 @@ class FilterWidgetLib /** * Gets the CI instance and loads message helper */ - public function __construct($params = null) + public function __construct() { $this->_ci =& get_instance(); // get code igniter instance } @@ -409,7 +411,7 @@ class FilterWidgetLib 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)) { @@ -470,7 +472,8 @@ class FilterWidgetLib 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) + $pos = array_search($selectedField, $selectedFields); + if ($pos !== false) { // Then remove it and shift the rest of elements by one if needed array_splice($selectedFields, $pos, 1); @@ -769,7 +772,6 @@ class FilterWidgetLib $this->_ci->load->library('NavigationLib', array(self::NAVIGATION_PAGE => $navigationPage)); $filterMenu = null; - $currentMenu = $this->_ci->navigationlib->getSessionMenu(); // The navigation menu currently stored in session $session = $this->getSession(); // The filter currently stored in session (the one that is currently used) if ($session != null) diff --git a/application/libraries/TableWidgetLib.php b/application/libraries/TableWidgetLib.php index 9637122a7..3af99cca7 100644 --- a/application/libraries/TableWidgetLib.php +++ b/application/libraries/TableWidgetLib.php @@ -93,7 +93,7 @@ class TableWidgetLib /** * Gets the CI instance and loads message helper */ - public function __construct($params = null) + public function __construct() { $this->_ci =& get_instance(); // get code igniter instance } diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php index cf99099fe..c326f23ad 100644 --- a/application/models/person/Person_model.php +++ b/application/models/person/Person_model.php @@ -88,7 +88,7 @@ class Person_model extends DB_Model if (isset($person['svnr']) && $person['svnr'] != '') { $this->PersonModel->addOrder('svnr', 'DESC'); - $result = $this->PersonModel->loadWhere(array( + $result = $this->PersonModel->loadWhere(array( 'person_id != ' => $person['person_id'], 'SUBSTRING(svnr FROM 1 FOR 10) = ' => $person['svnr']) ); @@ -156,7 +156,8 @@ class Person_model extends DB_Model 'lower(nachname) like '.$this->db->escape('%'.$filter.'%')." OR lower(vorname) like ".$this->db->escape('%'.$filter.'%')." OR lower(nachname || ' ' || vorname) like ".$this->db->escape('%'.$filter.'%')." - OR lower(vorname || ' ' || nachname) like ".$this->db->escape('%'.$filter.'%')); + OR lower(vorname || ' ' || nachname) like ".$this->db->escape('%'.$filter.'%') + ); return $result; } @@ -170,8 +171,12 @@ class Person_model extends DB_Model */ public function getPersonStammdaten($person_id, $zustellung_only = false) { - $this->addSelect('public.tbl_person.*, tbl_person.staatsbuergerschaft AS staatsbuergerschaft_code, tbl_person.geburtsnation AS geburtsnation_code, - s.kurztext as staatsbuergerschaft, g.kurztext as geburtsnation'); + $this->addSelect('public.tbl_person.*, + tbl_person.staatsbuergerschaft AS staatsbuergerschaft_code, + tbl_person.geburtsnation AS geburtsnation_code, + s.kurztext as staatsbuergerschaft, + g.kurztext as geburtsnation' + ); $this->addJoin('bis.tbl_nation s', 'public.tbl_person.staatsbuergerschaft = s.nation_code', 'LEFT'); $this->addJoin('bis.tbl_nation g', 'public.tbl_person.geburtsnation = g.nation_code', 'LEFT'); @@ -276,7 +281,8 @@ class Person_model extends DB_Model */ public function getFullName($uid) { - if (!$result = getData($this->getByUid($uid))[0]) + $result = getData($this->getByUid($uid))[0]; + if (!$result) { show_error('Failed loading person'); } diff --git a/application/widgets/FilterWidget.php b/application/widgets/FilterWidget.php index 4c40e434a..45bcf7e04 100644 --- a/application/widgets/FilterWidget.php +++ b/application/widgets/FilterWidget.php @@ -554,7 +554,7 @@ class FilterWidget extends Widget private function _setFilterMenu() { // Generates the filters structure array - $filterMenu = $this->filterwidgetlib->generateFilterMenu( + $this->filterwidgetlib->generateFilterMenu( $this->router->directory.$this->router->class.'/'.$this->router->method ); } @@ -633,7 +633,7 @@ class FilterWidget extends Widget { $columnsNames = array(); - foreach ($columns as $key => $obj) + foreach ($columns as $obj) { if (isset($obj->name)) { diff --git a/application/widgets/TableWidget.php b/application/widgets/TableWidget.php index a1a15d508..e59efce10 100644 --- a/application/widgets/TableWidget.php +++ b/application/widgets/TableWidget.php @@ -440,24 +440,6 @@ class TableWidget extends Widget return !isset($class) ? '' : $class; } - /** - * Utility method that retrieves the name of the columns present in a table JSON definition - */ - private function _getColumnsNames($columns) - { - $columnsNames = array(); - - foreach ($columns as $key => $obj) - { - if (isset($obj->name)) - { - $columnsNames[] = $obj->name; - } - } - - return $columnsNames; - } - /** * Loads a view using the given viewName and eventually other parameters */ @@ -467,3 +449,4 @@ class TableWidget extends Widget $ci->load->view($viewName, $parameters); } } + From 10fb68a532743052f38d282a9a94764f06d3b259 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 25 Apr 2023 17:23:57 +0200 Subject: [PATCH 058/263] Dienstverhaeltnis Class updated, VertragsbestandteilLib can save Dienstverhaeltnis --- .../vertragsbestandteil/Dienstverhaeltnis.php | 215 +++++++++++------- .../VertragsbestandteilLib.php | 55 +++++ 2 files changed, 186 insertions(+), 84 deletions(-) diff --git a/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php b/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php index 5511f8fba..187325c7d 100644 --- a/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php +++ b/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php @@ -1,8 +1,8 @@ validationerrors = array(); } + public function hydrateByStdClass($data) + { + isset($data->dienstverhaeltnis_id) && $this->setDienstverhaeltnis_id($data->dienstverhaeltnis_id); + isset($data->mitarbeiter_uid) && $this->setMitarbeiter_uid($data->mitarbeiter_uid); + isset($data->vertragsart_kurzbz) && $this->setVertragsart_kurzbz($data->vertragsart_kurzbz); + isset($data->oe_kurzbz) && $this->setOe_kurzbz($data->oe_kurzbz); + isset($data->von) && $this->setVon($data->von); + isset($data->bis) && $this->setBis($data->bis); + isset($data->insertamum) && $this->setInsertamum($data->insertamum); + isset($data->insertvon) && $this->setInsertvon($data->insertvon); + isset($data->updateamum) && $this->setUpdateamum($data->updateamum); + isset($data->updatevon) && $this->setUpdatevon($data->updatevon); + } + public function toStdClass(): \stdClass { $tmp = array( 'dienstverhaeltnis_id' => $this->getDienstverhaeltnisId(), 'vertragsart_kurzbz' => $this->getVertragsartKurzbz(), - 'unternehmen' => $this->getUnternehmen(), + 'oe_kurzbz' => $this->getUnternehmen(), 'gueltig_ab' => $this->getGueltigAb(), 'gueltig_bis' => $this->getGueltigBis(), ); @@ -61,96 +77,115 @@ EOTXT; return $txt; } + public function getDienstverhaeltnis_id() + { + return $this->dienstverhaeltnis_id; + } - /** - * Get the value of dienstverhaeltnis_id - */ - public function getDienstverhaeltnisId() - { - return $this->dienstverhaeltnis_id; - } + public function getMitarbeiter_uid() + { + return $this->mitarbeiter_uid; + } - /** - * Set the value of dienstverhaeltnis_id - */ - public function setDienstverhaeltnisId($dienstverhaeltnis_id): self - { - $this->dienstverhaeltnis_id = $dienstverhaeltnis_id; + public function getVertragsart_kurzbz() + { + return $this->vertragsart_kurzbz; + } - return $this; - } + public function getOe_kurzbz() + { + return $this->oe_kurzbz; + } - /** - * Get the value of unternehmen - */ - public function getUnternehmen() - { - return $this->unternehmen; - } + public function getVon() + { + return $this->von; + } - /** - * Set the value of unternehmen - */ - public function setUnternehmen($unternehmen): self - { - $this->unternehmen = $unternehmen; + public function getBis() + { + return $this->bis; + } - return $this; - } + public function getInsertamum() + { + return $this->insertamum; + } - /** - * Get the value of vertragsart_kurzbz - */ - public function getVertragsartKurzbz() - { - return $this->vertragsart_kurzbz; - } + public function getInsertvon() + { + return $this->insertvon; + } - /** - * Set the value of vertragsart_kurzbz - */ - public function setVertragsartKurzbz($vertragsart_kurzbz): self - { - $this->vertragsart_kurzbz = $vertragsart_kurzbz; + public function getUpdateamum() + { + return $this->updateamum; + } - return $this; - } + public function getUpdatevon() + { + return $this->updatevon; + } - /** - * Get the value of gueltig_ab - */ - public function getGueltigAb() - { - return $this->gueltig_ab; - } + public function setDienstverhaeltnis_id($dienstverhaeltnis_id) + { + $this->dienstverhaeltnis_id = $dienstverhaeltnis_id; + return $this; + } - /** - * Set the value of gueltig_ab - */ - public function setGueltigAb($gueltig_ab): self - { - $this->gueltig_ab = $gueltig_ab; + public function setMitarbeiter_uid($mitarbeiter_uid) + { + $this->mitarbeiter_uid = $mitarbeiter_uid; + return $this; + } - return $this; - } + public function setVertragsart_kurzbz($vertragsart_kurzbz) + { + $this->vertragsart_kurzbz = $vertragsart_kurzbz; + return $this; + } - /** - * Get the value of gueltig_bis - */ - public function getGueltigBis() - { - return $this->gueltig_bis; - } + public function setOe_kurzbz($oe_kurzbz) + { + $this->oe_kurzbz = $oe_kurzbz; + return $this; + } - /** - * Set the value of gueltig_bis - */ - public function setGueltigBis($gueltig_bis): self - { - $this->gueltig_bis = $gueltig_bis; + public function setVon($von) + { + $this->von = $von; + return $this; + } - return $this; - } + public function setBis($bis) + { + $this->bis = $bis; + return $this; + } + + public function setInsertamum($insertamum) + { + $this->insertamum = $insertamum; + return $this; + } + + public function setInsertvon($insertvon) + { + $this->insertvon = $insertvon; + return $this; + } + + public function setUpdateamum($updateamum) + { + $this->updateamum = $updateamum; + return $this; + } + + public function setUpdatevon($updatevon) + { + $this->updatevon = $updatevon; + return $this; + } public function isValid() { @@ -165,6 +200,18 @@ EOTXT; public function validate() { //do Validation here + if( empty($this->mitarbeiter_uid) ) { + $this->validationerrors[] = 'Mitarbeiter_UID fehlt.'; + } + + if( empty($this->oe_kurzbz) ) { + $this->validationerrors[] = 'Unternehmen fehlt.'; + } + + if( empty($this->vertragsart_kurzbz) ) { + $this->validationerrors[] = 'Vertragsart fehlt.'; + } + // return status after Validation if( count($this->validationerrors) > 0 ) { $this->isvalid = false; diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php index d846bfc6c..57f93bd44 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php @@ -1,5 +1,6 @@ CI = get_instance(); + $this->CI->load->model('vertragsbestandteil/Dienstverhaeltnis_model', + 'DienstverhaeltnisModel'); + $this->DienstverhaeltnisModel = $this->CI->DienstverhaeltnisModel; $this->CI->load->model('vertragsbestandteil/Vertragsbestandteil_model', 'VertragsbestandteilModel'); $this->VertragsbestandteilModel = $this->CI->VertragsbestandteilModel; @@ -51,6 +58,18 @@ class VertragsbestandteilLib return $ret; } + public function fetchDienstverhaeltnis($dienstverhaeltnis_id) + { + $result = $this->DienstverhaeltnisModel->load($dienstverhaeltnis_id); + $dv = null; + if(null !== ($row = getData($result))) + { + $dv = new Dienstverhaeltnis(); + $dv->hydrateByStdClass($row[0]); + } + return $dv; + } + public function fetchVertragsbestandteile($dienstverhaeltnis_id, $stichtag=null) { return $this->VertragsbestandteilModel->getVertragsbestandteile($dienstverhaeltnis_id, $stichtag); @@ -61,6 +80,18 @@ class VertragsbestandteilLib return $this->VertragsbestandteilModel->getVertragsbestandteil($vertragsbestandteil_id); } + public function storeDienstverhaeltnis(Dienstverhaeltnis $dv) + { + if( inval($dv->getDienstverhaeltnis_id()) > 0 ) + { + $this->insertDienstverhaeltnis($dv); + } + else + { + $this->updateDienstverhaeltnis($dv); + } + } + public function storeVertragsbestandteil(Vertragsbestandteil $vertragsbestandteil) { $this->CI->db->trans_begin(); @@ -89,6 +120,19 @@ class VertragsbestandteilLib } } + protected function insertDienstverhaeltnis(Dienstverhaeltnis $dv) + { + $ret = $this->DienstverhaeltnisModel->insert($dv->toStdClass()); + if( hasData($ret) ) + { + $dv->setDienstverhaeltnis_id(getData($ret)); + } + else + { + throw new Exception('error inserting dienstverhaeltnis'); + } + } + protected function insertVertragsbestandteil(Vertragsbestandteil $vertragsbestandteil) { $vertragsbestandteil->beforePersist(); @@ -123,6 +167,17 @@ class VertragsbestandteilLib . 'failed to store Gehaltsbestandteile. ' . $ex->getMessage()); } } + + protected function updateDienstverhaeltnis(Dienstverhaeltnis $dv) + { + $dv->setUpdateamum(strftime('%Y-%m-%d %H:%M:%S')); + $ret = $this->DienstverhaeltnisModel->update($dv->getDienstverhaeltnis_id(), + $dv->toStdClass()); + if(isError($ret) ) + { + throw new Exception('error updating dienstverhaeltnis'); + } + } protected function updateVertragsbestandteil(Vertragsbestandteil $vertragsbestandteil) { From b4e4f91b2225f03e9374e045dfae0f8a35204033 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 25 Apr 2023 20:20:02 +0200 Subject: [PATCH 059/263] more validation --- .../vertragsbestandteil/VertragsbestandteilStunden.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilStunden.php b/application/libraries/vertragsbestandteil/VertragsbestandteilStunden.php index 6f5ad18ab..e99d5e10e 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilStunden.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilStunden.php @@ -80,6 +80,10 @@ EOTXT; public function validate() { + if( (floatval($this->benutzerfunktion_id) < 1 ) ) { + $this->validationerrors[] = 'Stunden zu niedrig.'; + } + return parent::validate(); } } From e3ec4cd5aa96274be3b9292c5d30771f8c6e0ded Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Mon, 1 May 2023 20:50:07 +0200 Subject: [PATCH 060/263] fix method names, handle insertamum updateamum insertvon updatevon in libs --- .../vertragsbestandteil/Dienstverhaeltnis.php | 25 ++++++++++++------- .../Gehaltsbestandteil.php | 5 +++- .../GehaltsbestandteilLib.php | 8 +++++- .../VertragsbestandteilLib.php | 19 ++++++++++---- .../VertragsbestandteilStunden.php | 2 +- 5 files changed, 42 insertions(+), 17 deletions(-) diff --git a/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php b/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php index 187325c7d..5cc264138 100644 --- a/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php +++ b/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php @@ -50,11 +50,16 @@ class Dienstverhaeltnis implements IValidation { public function toStdClass(): \stdClass { $tmp = array( - 'dienstverhaeltnis_id' => $this->getDienstverhaeltnisId(), - 'vertragsart_kurzbz' => $this->getVertragsartKurzbz(), - 'oe_kurzbz' => $this->getUnternehmen(), - 'gueltig_ab' => $this->getGueltigAb(), - 'gueltig_bis' => $this->getGueltigBis(), + 'dienstverhaeltnis_id' => $this->getDienstverhaeltnis_id(), + 'mitarbeiter_uid' => $this->getMitarbeiter_uid(), + 'vertragsart_kurzbz' => $this->getVertragsart_kurzbz(), + 'oe_kurzbz' => $this->getOe_kurzbz(), + 'von' => $this->getVon(), + 'bis' => $this->getBis(), + 'insertamum' => $this->getInsertamum(), + 'insertvon' => $this->getInsertvon(), + 'updateamum' => $this->getUpdateamum(), + 'updatevon' => $this->getUpdatevon() ); $tmp = array_filter($tmp, function($v) { @@ -68,10 +73,12 @@ class Dienstverhaeltnis implements IValidation { public function __toString() { $txt = <<getDienstverhaeltnisId()} - vertragsart_kurzbz: {$this->getVertragsartKurzbz()} - gueltig_ab: {$this->getGueltigAb()} - gueltig_bis: {$this->getGueltigBis()} + dienstverhaeltnis_id: {$this->getDienstverhaeltnis_id()} + mitarbeiter_uid: {$this->getMitarbeiter_uid()} + vertragsart_kurzbz: {$this->getVertragsart_kurzbz()} + oe_kurzbz: {$this->getOe_kurzbz()} + von: {$this->getVon()} + bis: {$this->getBis()} EOTXT; return $txt; diff --git a/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php b/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php index 88fce2e4e..3c0824f25 100644 --- a/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php +++ b/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php @@ -294,7 +294,10 @@ EOTXT; public function validate() { //do Validation here - + if( empty($this->grundbetrag) ) + { + $this->validationerrors[] = "Betrag fehlt."; + } // return status after Validation if( count($this->validationerrors) > 0 ) { $this->isvalid = false; diff --git a/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php b/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php index 3859eba43..e72de9cd9 100644 --- a/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php +++ b/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php @@ -15,8 +15,11 @@ class GehaltsbestandteilLib /** @var Gehaltsbestandteil_model */ protected $GehaltsbestandteilModel; + protected $loggedInUser; + public function __construct() { + $this->loggedInUser = getAuthUID(); $this->CI = get_instance(); $this->CI->load->model('vertragsbestandteil/Gehaltsbestandteil_model', 'GehaltsbestandteilModel'); @@ -63,6 +66,8 @@ class GehaltsbestandteilLib protected function insertGehaltsbestandteil(Gehaltsbestandteil $gehaltsbestandteil) { + $gehaltsbestandteil->setInsertvon($this->loggedInUser) + ->setInsertamum(strftime('%Y-%m-%d %H:%M:%S')); $ret = $this->GehaltsbestandteilModel->insert($gehaltsbestandteil->toStdClass(), $this->GehaltsbestandteilModel->getEncryptedColumns()); if( hasData($ret) ) @@ -77,7 +82,8 @@ class GehaltsbestandteilLib protected function updateGehaltsbestandteil(Gehaltsbestandteil $gehaltsbestandteil) { - $gehaltsbestandteil->setUpdateamum(strftime('%Y-%m-%d %H:%M:%S')); + $gehaltsbestandteil->setUpdatevon($this->loggedInUser) + ->setUpdateamum(strftime('%Y-%m-%d %H:%M:%S')); $ret = $this->GehaltsbestandteilModel->update($gehaltsbestandteil->getGehaltsbestandteil_id(), $gehaltsbestandteil->toStdClass(), $this->GehaltsbestandteilModel->getEncryptedColumns()); diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php index 57f93bd44..8e1420495 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php @@ -30,8 +30,11 @@ class VertragsbestandteilLib */ protected $GehaltsbestandteilLib; + protected $loggedInUser; + public function __construct() { + $this->loggedInUser = getAuthUID(); $this->CI = get_instance(); $this->CI->load->model('vertragsbestandteil/Dienstverhaeltnis_model', 'DienstverhaeltnisModel'); @@ -82,13 +85,13 @@ class VertragsbestandteilLib public function storeDienstverhaeltnis(Dienstverhaeltnis $dv) { - if( inval($dv->getDienstverhaeltnis_id()) > 0 ) + if( intval($dv->getDienstverhaeltnis_id()) > 0 ) { - $this->insertDienstverhaeltnis($dv); + $this->updateDienstverhaeltnis($dv); } else { - $this->updateDienstverhaeltnis($dv); + $this->insertDienstverhaeltnis($dv); } } @@ -122,6 +125,8 @@ class VertragsbestandteilLib protected function insertDienstverhaeltnis(Dienstverhaeltnis $dv) { + $dv->setInsertvon($this->loggedInUser) + ->setInsertamum(strftime('%Y-%m-%d %H:%M:%S')); $ret = $this->DienstverhaeltnisModel->insert($dv->toStdClass()); if( hasData($ret) ) { @@ -135,6 +140,8 @@ class VertragsbestandteilLib protected function insertVertragsbestandteil(Vertragsbestandteil $vertragsbestandteil) { + $vertragsbestandteil->setInsertvon($this->loggedInUser) + ->setInsertamum(strftime('%Y-%m-%d %H:%M:%S')); $vertragsbestandteil->beforePersist(); $ret = $this->VertragsbestandteilModel->insert($vertragsbestandteil->baseToStdClass()); if( hasData($ret) ) @@ -170,7 +177,8 @@ class VertragsbestandteilLib protected function updateDienstverhaeltnis(Dienstverhaeltnis $dv) { - $dv->setUpdateamum(strftime('%Y-%m-%d %H:%M:%S')); + $dv->setUpdatevon($this->loggedInUser) + ->setUpdateamum(strftime('%Y-%m-%d %H:%M:%S')); $ret = $this->DienstverhaeltnisModel->update($dv->getDienstverhaeltnis_id(), $dv->toStdClass()); if(isError($ret) ) @@ -181,7 +189,8 @@ class VertragsbestandteilLib protected function updateVertragsbestandteil(Vertragsbestandteil $vertragsbestandteil) { - $vertragsbestandteil->setUpdateamum(strftime('%Y-%m-%d %H:%M:%S')); + $vertragsbestandteil->setUpdatevon($this->loggedInUser) + ->setUpdateamum(strftime('%Y-%m-%d %H:%M:%S')); $vertragsbestandteil->beforePersist(); $ret = $this->VertragsbestandteilModel->update($vertragsbestandteil->getVertragsbestandteil_id(), $vertragsbestandteil->baseToStdClass()); diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilStunden.php b/application/libraries/vertragsbestandteil/VertragsbestandteilStunden.php index e99d5e10e..fd4436f72 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilStunden.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilStunden.php @@ -80,7 +80,7 @@ EOTXT; public function validate() { - if( (floatval($this->benutzerfunktion_id) < 1 ) ) { + if( (floatval($this->wochenstunden) < 1 ) ) { $this->validationerrors[] = 'Stunden zu niedrig.'; } From eb7b73fee95264afe5c53a9a70e90b3c8076ec23 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 2 May 2023 16:00:13 +0200 Subject: [PATCH 061/263] cleanup according to current vertragsbestandteil db tables --- .../vertragsbestandteil/Dienstverhaeltnis.php | 26 ++++- .../Gehaltsbestandteil.php | 16 +++ .../Vertragsbestandteil.php | 15 +++ .../VertragsbestandteilBefristung.php | 92 ----------------- .../VertragsbestandteilFactory.php | 99 ++++++++----------- .../VertragsbestandteilLehre.php | 69 ------------- .../VertragsbestandteilLib.php | 10 ++ .../VertragsbestandteilStunden.php | 27 +++-- .../Dienstverhaeltnis_model.php | 26 +++++ .../VertragsbestandteilBefristung_model.php | 14 --- .../VertragsbestandteilKV_model.php | 12 --- .../Vertragsbestandteil_model.php | 52 ++++++---- 12 files changed, 184 insertions(+), 274 deletions(-) delete mode 100644 application/libraries/vertragsbestandteil/VertragsbestandteilBefristung.php delete mode 100644 application/libraries/vertragsbestandteil/VertragsbestandteilLehre.php delete mode 100644 application/models/vertragsbestandteil/VertragsbestandteilBefristung_model.php delete mode 100644 application/models/vertragsbestandteil/VertragsbestandteilKV_model.php diff --git a/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php b/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php index 5cc264138..3bd36aa78 100644 --- a/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php +++ b/application/libraries/vertragsbestandteil/Dienstverhaeltnis.php @@ -204,8 +204,11 @@ EOTXT; return $this->validationerrors; } - public function validate() { + public function validate() { //do Validation here + $ci = get_instance(); + $ci->load->library('vertragsbestandteil/VertragsbestandteilLib', + null, 'VertragsbestandteilLib'); if( empty($this->mitarbeiter_uid) ) { $this->validationerrors[] = 'Mitarbeiter_UID fehlt.'; @@ -219,6 +222,27 @@ EOTXT; $this->validationerrors[] = 'Vertragsart fehlt.'; } + $von = \DateTimeImmutable::createFromFormat('Y-m-d', $this->von); + $bis = \DateTimeImmutable::createFromFormat('Y-m-d', $this->bis); + + if( false === $von ) { + $this->validationerrors[] = 'Beginn muss ein gültiges Datum sein.'; + } + + if( $this->bis !== null && $bis === false ) { + $this->validationerrors[] = 'Ende muss ein gültiges Datum oder leer sein.'; + } + + if( $this-> bis !== null && $von && $bis && $von > $bis ) { + $this->validationerrors[] = 'Das Beginndatum muss vor dem Endedatum liegen.'; + } + + // TODO check for overlapping DVs + if( $ci->VertragsbestandteilLib->isOverlappingExistingDV($this) ) + { + $this->validationerrors[] = 'Es existiert bereits ein überlappendes Dienstverhältnis'; + } + // return status after Validation if( count($this->validationerrors) > 0 ) { $this->isvalid = false; diff --git a/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php b/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php index 3c0824f25..b3b2271db 100644 --- a/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php +++ b/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php @@ -298,6 +298,22 @@ EOTXT; { $this->validationerrors[] = "Betrag fehlt."; } + + $von = \DateTimeImmutable::createFromFormat('Y-m-d', $this->von); + $bis = \DateTimeImmutable::createFromFormat('Y-m-d', $this->bis); + + if( false === $von ) { + $this->validationerrors[] = 'Beginn muss ein gültiges Datum sein.'; + } + + if( $this->bis !== null && $bis === false ) { + $this->validationerrors[] = 'Ende muss ein gültiges Datum oder leer sein.'; + } + + if( $this-> bis !== null && $von && $bis && $von > $bis ) { + $this->validationerrors[] = 'Das Beginndatum muss vor dem Endedatum liegen.'; + } + // return status after Validation if( count($this->validationerrors) > 0 ) { $this->isvalid = false; diff --git a/application/libraries/vertragsbestandteil/Vertragsbestandteil.php b/application/libraries/vertragsbestandteil/Vertragsbestandteil.php index 7f0b2946f..04a8161c4 100644 --- a/application/libraries/vertragsbestandteil/Vertragsbestandteil.php +++ b/application/libraries/vertragsbestandteil/Vertragsbestandteil.php @@ -219,6 +219,21 @@ EOTXT; } public function validate() { + $von = \DateTimeImmutable::createFromFormat('Y-m-d', $this->von); + $bis = \DateTimeImmutable::createFromFormat('Y-m-d', $this->bis); + + if( false === $von ) { + $this->validationerrors[] = 'Beginn muss ein gültiges Datum sein.'; + } + + if( $this->bis !== null && $bis === false ) { + $this->validationerrors[] = 'Ende muss ein gültiges Datum oder leer sein.'; + } + + if( $this-> bis !== null && $von && $bis && $von > $bis ) { + $this->validationerrors[] = 'Das Beginndatum muss vor dem Endedatum liegen.'; + } + if( count($this->validationerrors) > 0 ) { $this->isvalid = false; } else { diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilBefristung.php b/application/libraries/vertragsbestandteil/VertragsbestandteilBefristung.php deleted file mode 100644 index a3d062577..000000000 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilBefristung.php +++ /dev/null @@ -1,92 +0,0 @@ -setVertragsbestandteiltyp_kurzbz( - VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_BEFRISTUNG); - } - - public function hydrateByStdClass($data) - { - parent::hydrateByStdClass($data); - isset($data->befristet) && $this->setBefristet($data->befristet); - isset($data->befristet_bis) && $this->setBefristetBis($data->befristet_bis); - } - - - /** - * Get the value of befristet - */ - public function getBefristet() - { - return $this->befristet; - } - - /** - * Set the value of befristet - */ - public function setBefristet($befristet): self - { - $this->befristet = $befristet; - - return $this; - } - - /** - * Get the value of befristet_bis - */ - public function getBefristetBis() - { - return $this->befristet_bis; - } - - /** - * Set the value of befristet_bis - */ - public function setBefristetBis($befristet_bis): self - { - $this->befristet_bis = $befristet_bis; - - return $this; - } - - public function toStdClass(): \stdClass - { - $tmp = array( - 'vertragsbestandteil_id' => $this->getVertragsbestandteil_id(), - 'befristet' => $this->getBefristet(), - 'befristet_bis' => $this->getBefristetBis() - ); - - $tmp = array_filter($tmp, function($v) { - return !is_null($v); - }); - - return (object) $tmp; - } - - public function __toString() - { - $txt = <<getBefristet()} - befristet_bis: {$this->getBefristetBis()} - -EOTXT; - return parent::__toString() . $txt; - } - - public function validate() - { - return parent::validate(); - } -} diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilFactory.php b/application/libraries/vertragsbestandteil/VertragsbestandteilFactory.php index a00417272..220ee5dff 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilFactory.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilFactory.php @@ -35,39 +35,13 @@ class VertragsbestandteilFactory $vertragsbestandteil = null; switch ($vertragsbestandteiltyp_kurzbz) { - - case self::VERTRAGSBESTANDTEIL_STUNDEN: - $vertragsbestandteil = new VertragsbestandteilStunden(); - $vertragsbestandteil->hydrateByStdClass($data); - break; - - case self::VERTRAGSBESTANDTEIL_FUNKTION: - $vertragsbestandteil = new VertragsbestandteilFunktion(); - $vertragsbestandteil->hydrateByStdClass($data); - break; - - case self::VERTRAGSBESTANDTEIL_GEHALT: - $vertragsbestandteil = new VertragsbestandteilGehalt(); - $vertragsbestandteil->hydrateByStdClass($data); - break; - - case self::VERTRAGSBESTANDTEIL_KUENDIGUNGSFRIST: - $vertragsbestandteil = new VertragsbestandteilKuendigungsfrist(); - $vertragsbestandteil->hydrateByStdClass($data); - break; - case self::VERTRAGSBESTANDTEIL_FREITEXT: $vertragsbestandteil = new VertragsbestandteilFreitext(); $vertragsbestandteil->hydrateByStdClass($data); break; - - case self::VERTRAGSBESTANDTEIL_ZEITAUFZEICHNUNG: - $vertragsbestandteil = new VertragsbestandteilZeitaufzeichnung(); - $vertragsbestandteil->hydrateByStdClass($data); - break; - - case self::VERTRAGSBESTANDTEIL_BEFRISTUNG: - $vertragsbestandteil = new VertragsbestandteilBefristung(); + + case self::VERTRAGSBESTANDTEIL_FUNKTION: + $vertragsbestandteil = new VertragsbestandteilFunktion(); $vertragsbestandteil->hydrateByStdClass($data); break; @@ -76,11 +50,26 @@ class VertragsbestandteilFactory $vertragsbestandteil->hydrateByStdClass($data); break; + case self::VERTRAGSBESTANDTEIL_KUENDIGUNGSFRIST: + $vertragsbestandteil = new VertragsbestandteilKuendigungsfrist(); + $vertragsbestandteil->hydrateByStdClass($data); + break; + + case self::VERTRAGSBESTANDTEIL_STUNDEN: + $vertragsbestandteil = new VertragsbestandteilStunden(); + $vertragsbestandteil->hydrateByStdClass($data); + break; + case self::VERTRAGSBESTANDTEIL_URLAUBSANSPRUCH: $vertragsbestandteil = new VertragsbestandteilUrlaubsanspruch(); $vertragsbestandteil->hydrateByStdClass($data); break; - + + case self::VERTRAGSBESTANDTEIL_ZEITAUFZEICHNUNG: + $vertragsbestandteil = new VertragsbestandteilZeitaufzeichnung(); + $vertragsbestandteil->hydrateByStdClass($data); + break; + default: throw new Exception('Unknown vertragsbestandteiltyp_kurzbz ' . $vertragsbestandteiltyp_kurzbz); @@ -96,28 +85,22 @@ class VertragsbestandteilFactory $vertragsbestandteildbmodel = null; switch ($vertragsbestandteil_kurzbz) { - case self::VERTRAGSBESTANDTEIL_STUNDEN: - $CI->load->model('vertragsbestandteil/VertragsbestandteilStunden_model', - 'VertragsbestandteilStunden_model'); - $vertragsbestandteildbmodel = $CI->VertragsbestandteilStunden_model; + case self::VERTRAGSBESTANDTEIL_FREITEXT: + $CI->load->model('vertragsbestandteil/VertragsbestandteilFreitext_model', + 'VertragsbestandteilFreitext_model'); + $vertragsbestandteildbmodel = $CI->VertragsbestandteilFreitext_model; break; - + case self::VERTRAGSBESTANDTEIL_FUNKTION: $CI->load->model('vertragsbestandteil/VertragsbestandteilFunktion_model', 'VertragsbestandteilFunktion_model'); $vertragsbestandteildbmodel = $CI->VertragsbestandteilFunktion_model; break; - - case self::VERTRAGSBESTANDTEIL_GEHALT: - $CI->load->model('vertragsbestandteil/Gehaltsbestandteil_model', - 'Gehaltsbestandteil_model'); - $vertragsbestandteildbmodel = $CI->Gehaltsbestandteil_model; - break; - - case self::VERTRAGSBESTANDTEIL_FREITEXT: - $CI->load->model('vertragsbestandteil/VertragsbestandteilFreitext_model', - 'VertragsbestandteilFreitext_model'); - $vertragsbestandteildbmodel = $CI->VertragsbestandteilFreitext_model; + + case self::VERTRAGSBESTANDTEIL_KARENZ: + $CI->load->model('vertragsbestandteil/VertragsbestandteilKarenz_model', + 'VertragsbestandteilKarenz_model'); + $vertragsbestandteildbmodel = $CI->VertragsbestandteilKarenz_model; break; case self::VERTRAGSBESTANDTEIL_KUENDIGUNGSFRIST: @@ -125,24 +108,24 @@ class VertragsbestandteilFactory 'VertragsbestandteilKuendigungsfrist_model'); $vertragsbestandteildbmodel = $CI->VertragsbestandteilKuendigungsfrist_model; break; - - case self::VERTRAGSBESTANDTEIL_KARENZ: - $CI->load->model('vertragsbestandteil/VertragsbestandteilKarenz_model', - 'VertragsbestandteilKarenz_model'); - $vertragsbestandteildbmodel = $CI->VertragsbestandteilKarenz_model; + + case self::VERTRAGSBESTANDTEIL_STUNDEN: + $CI->load->model('vertragsbestandteil/VertragsbestandteilStunden_model', + 'VertragsbestandteilStunden_model'); + $vertragsbestandteildbmodel = $CI->VertragsbestandteilStunden_model; break; - - case self::VERTRAGSBESTANDTEIL_ZEITAUFZEICHNUNG: - $CI->load->model('vertragsbestandteil/VertragsbestandteilZeitaufzeichnung_model', - 'VertragsbestandteilZeitaufzeichnung_model'); - $vertragsbestandteildbmodel = $CI->VertragsbestandteilZeitaufzeichnung_model; - break; - + case self::VERTRAGSBESTANDTEIL_URLAUBSANSPRUCH: $CI->load->model('vertragsbestandteil/VertragsbestandteilUrlaubsanspruch_model', 'VertragsbestandteilUrlaubsanspruch_model'); $vertragsbestandteildbmodel = $CI->VertragsbestandteilUrlaubsanspruch_model; break; + + case self::VERTRAGSBESTANDTEIL_ZEITAUFZEICHNUNG: + $CI->load->model('vertragsbestandteil/VertragsbestandteilZeitaufzeichnung_model', + 'VertragsbestandteilZeitaufzeichnung_model'); + $vertragsbestandteildbmodel = $CI->VertragsbestandteilZeitaufzeichnung_model; + break; default: throw new Exception('Unknown vertragsbestandteil_kurzbz ' diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilLehre.php b/application/libraries/vertragsbestandteil/VertragsbestandteilLehre.php deleted file mode 100644 index 28a9447a4..000000000 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilLehre.php +++ /dev/null @@ -1,69 +0,0 @@ -setVertragsbestandteiltyp_kurzbz( - VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_LEHRE); - } - - public function hydrateByStdClass($data) - { - parent::hydrateByStdClass($data); - isset($data->inkludierte_lehre) && $this->setInkludierteLehre($data->inkludierte_lehre); - } - - /** - * Get the value of inkludierte_lehre - */ - public function getInkludierteLehre() - { - return $this->inkludierte_lehre; - } - - /** - * Set the value of inkludierte_lehre - */ - public function setInkludierteLehre($inkludierte_lehre): self - { - $this->inkludierte_lehre = $inkludierte_lehre; - - return $this; - } - - public function toStdClass(): \stdClass - { - $tmp = array( - 'vertragsbestandteil_id' => $this->getVertragsbestandteil_id(), - 'inkludierte_lehre' => $this->getInkludierteLehre(), - ); - - $tmp = array_filter($tmp, function($v) { - return !is_null($v); - }); - - return (object) $tmp; - } - - public function __toString() - { - $txt = <<getInkludierteLehre()} - -EOTXT; - return parent::__toString() . $txt; - } - - public function validate() - { - return parent::validate(); - } -} diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php index 8e1420495..0928255ee 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php @@ -222,4 +222,14 @@ class VertragsbestandteilLib . 'failed to store Gehaltsbestandteile. ' . $ex->getMessage()); } } + + public function isOverlappingExistingDV(Dienstverhaeltnis $dv) + { + return $this->DienstverhaeltnisModel->isOverlappingExistingDV( + $dv->getMitarbeiter_uid(), + $dv->getOe_kurzbz(), + $dv->getVon(), + $dv->getBis() + ); + } } diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilStunden.php b/application/libraries/vertragsbestandteil/VertragsbestandteilStunden.php index fd4436f72..b5c522e8b 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilStunden.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilStunden.php @@ -15,7 +15,7 @@ use vertragsbestandteil\VertragsbestandteilFactory; class VertragsbestandteilStunden extends Vertragsbestandteil { protected $wochenstunden; - protected $karenz; + protected $teilzeittyp_kurzbz; public function __construct() { @@ -28,7 +28,7 @@ class VertragsbestandteilStunden extends Vertragsbestandteil { parent::hydrateByStdClass($data); isset($data->wochenstunden) && $this->setWochenstunden($data->wochenstunden); - isset($data->karenz) && $this->setKarenz($data->karenz); + isset($data->teilzeittyp_kurzbz) && $this->setTeilzeittyp_kurzbz($data->teilzeittyp_kurzbz); } public function getWochenstunden() @@ -36,9 +36,9 @@ class VertragsbestandteilStunden extends Vertragsbestandteil return $this->wochenstunden; } - public function getKarenz() + public function getTeilzeittyp_kurzbz() { - return $this->karenz; + return $this->teilzeittyp_kurzbz; } public function setWochenstunden($wochenstunden) @@ -47,9 +47,9 @@ class VertragsbestandteilStunden extends Vertragsbestandteil return $this; } - public function setKarenz($karenz) + public function setTeilzeittyp_kurzbz($teilzeittyp_kurzbz) { - $this->karenz = $karenz; + $this->teilzeittyp_kurzbz = $teilzeittyp_kurzbz; return $this; } @@ -58,7 +58,7 @@ class VertragsbestandteilStunden extends Vertragsbestandteil $tmp = array( 'vertragsbestandteil_id' => $this->getVertragsbestandteil_id(), 'wochenstunden' => $this->getWochenstunden(), - 'karenz' => $this->getKarenz() + 'teilzeittyp_kurzbz' => $this->getTeilzeittyp_kurzbz() ); $tmp = array_filter($tmp, function($v) { @@ -72,7 +72,7 @@ class VertragsbestandteilStunden extends Vertragsbestandteil { $txt = <<getWochenstunden()} - karenz: {$this->getKarenz()} + teilzeittyp_kurzbz: {$this->getTeilzeittyp_kurzbz()} EOTXT; return parent::__toString() . $txt; @@ -80,8 +80,15 @@ EOTXT; public function validate() { - if( (floatval($this->wochenstunden) < 1 ) ) { - $this->validationerrors[] = 'Stunden zu niedrig.'; + if( !(filter_var($this->wochenstunden, FILTER_VALIDATE_FLOAT, + array( + 'options' => array( + 'min_range' => 0, + 'max_range' => 100 + ) + ) + )) ) { + $this->validationerrors[] = 'Stunden muss eine Kommazahl im Bereichs 0 bis 100 sein.'; } return parent::validate(); diff --git a/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php b/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php index 3c43a6fb1..00b2b764d 100644 --- a/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php +++ b/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php @@ -73,4 +73,30 @@ class Dienstverhaeltnis_model extends DB_Model return $this->execQuery($qry, array($uid)); } + public function isOverlappingExistingDV($mitarbeiter_uid, $oe_kurzbz, $von, $bis) + { + $query = <<= dv.von +EOSQL; + + $ret = $this->execReadOnlyQuery($query, + array($mitarbeiter_uid, $oe_kurzbz, $von, $bis)); + + if( ($dvcount = getData($ret)) && ($dvcount[0]->dvcount > 0) ) { + return true; + } + + return false; + } } \ No newline at end of file diff --git a/application/models/vertragsbestandteil/VertragsbestandteilBefristung_model.php b/application/models/vertragsbestandteil/VertragsbestandteilBefristung_model.php deleted file mode 100644 index 9166b1c06..000000000 --- a/application/models/vertragsbestandteil/VertragsbestandteilBefristung_model.php +++ /dev/null @@ -1,14 +0,0 @@ -dbTable = 'hr.tbl_vertragsbestandteil_befristung'; - $this->pk = 'vertragsbestandteil_id'; - } -} diff --git a/application/models/vertragsbestandteil/VertragsbestandteilKV_model.php b/application/models/vertragsbestandteil/VertragsbestandteilKV_model.php deleted file mode 100644 index 197d44530..000000000 --- a/application/models/vertragsbestandteil/VertragsbestandteilKV_model.php +++ /dev/null @@ -1,12 +0,0 @@ -dbTable = 'hr.tbl_vertragsbestandteil_kv'; - $this->pk = 'vertragsbestandteil_id'; - } -} diff --git a/application/models/vertragsbestandteil/Vertragsbestandteil_model.php b/application/models/vertragsbestandteil/Vertragsbestandteil_model.php index 3dd6bf6cb..74a3e6964 100644 --- a/application/models/vertragsbestandteil/Vertragsbestandteil_model.php +++ b/application/models/vertragsbestandteil/Vertragsbestandteil_model.php @@ -31,21 +31,29 @@ class Vertragsbestandteil_model extends DB_Model $sql = <<escape($dienstverhaeltnis_id)} {$stichtagclause} @@ -77,21 +85,29 @@ EOSQL; $sql = <<escape($id)} ; From b43b7fe95da4614e147c9b4c92705b5921b2ec5d Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 4 May 2023 09:38:18 +0200 Subject: [PATCH 062/263] Added new Vertragsbestandteil Class and few methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit . load() . isZAPflichtig() -- Check ob im übergebenen Monat ZApflichtig. . getZAPflichtig() -- Holt alle Vertragsbestandteile, die ZApflichtig sind . isAllin() -- Check, ob im übergebenen Monat Vertragsbestandteil AllIn hat. --- include/vertragsbestandteil.class.php | 451 ++++++++++++++++++++++++++ 1 file changed, 451 insertions(+) create mode 100644 include/vertragsbestandteil.class.php diff --git a/include/vertragsbestandteil.class.php b/include/vertragsbestandteil.class.php new file mode 100644 index 000000000..50b0b7b66 --- /dev/null +++ b/include/vertragsbestandteil.class.php @@ -0,0 +1,451 @@ +, + */ +/** + * Klasse Vertragsbestandteil + * @create 29.03.2023 + */ +require_once(dirname(__FILE__).'/basis_db.class.php'); + +class vertragsbestandteil extends basis_db +{ + public $new; // boolean + public $result = array(); + + //Tabellenspalten + public $vertragsbestandteil_id; // serial + public $dienstverhaeltnis_id; // integer + public $vertragsbestandteiltyp_kurzbz; // varchar(32) + public $von; // date + public $bis; // date + public $insertamum; // timestamp + public $insertvon; // varchar(32) + public $updateamum; // timestamp + public $updatevon; // varchar(32) + + /** + * Konstruktor + * @param $vertragsbestandteil_id ID des Vertragsbestandteils, der geladen werden soll (Default=null) + */ + public function __construct($vertragsbestandteil_id = null) + { + parent::__construct(); + + if($vertragsbestandteil_id != null) + $this->load($vertragsbestandteil_id); + } + + /** + * Laedt den Vertragsbestandteil mit der uebergebenen ID. + * @return true wenn ok, false im Fehlerfall + */ + public function load($vertragsbestandteil_id) + { + $qry = "SELECT * FROM hr.tbl_vertragsbestandteil WHERE vertragsbestandteil_id = ". $this->db_add_param($vertragsbestandteil_id, FHC_INTEGER); + + if (!$this->db_query($qry)) + { + $this->errormsg = 'Fehler bei einer Datenbankabfrage'; + return false; + } + + if($row = $this->db_fetch_object()) + { + $this->vertragsbestandteil_id = $row->vertragsbestandteil_id; + $this->dienstverhaeltnis_id = $row->dienstverhaeltnis_id; + $this->vertragsbestandteiltyp_kurzbz = $row->vertragsbestandteiltyp_kurzbz; + $this->von = $row->von; + $this->bis = $row->bis; + $this->insertvon = $row->insertvon; + $this->updateamum = $row->updateamum; + $this->updatevon = $row->updatevon; + } + else + { + $this->errormsg = 'Es ist kein Datensatz mit dieser ID vorhanden'; + return false; + } + + return true; + } + + /** + * Prueft ob MitarbeiterIn im Monat des uebergebenen $datums zeitaufzeichnungspflichtig ist. + * Wenn kein Datum übergeben wird, wird das heutige Datum gesetzt. + * + * @param $mitarbeiter_uid + * @param string $timestamp DD-MM-YYYY + * @return bool + */ + public function isZaPflichtig($mitarbeiter_uid, $datum = null) + { + + $timestamp = is_null($datum) ? 'NOW()' : '(date('. $this->db_add_param($datum).'))'; + + $qry = 'SELECT + vbt.vertragsbestandteil_id, vbt.dienstverhaeltnis_id, vbt.vertragsbestandteiltyp_kurzbz, + vbt.von, vbt.bis, vbt.insertamum, vbt.insertvon, vbt.updateamum, vbt.updatevon, + vbtza.zeitaufzeichnung, vbtza.azgrelevant, vbtza.homeoffice + FROM hr.tbl_vertragsbestandteil_zeitaufzeichnung vbtza + JOIN hr.tbl_vertragsbestandteil vbt USING (vertragsbestandteil_id) + JOIN hr.tbl_dienstverhaeltnis dv USING (dienstverhaeltnis_id) + -- Dienstverhältnis(se) des Mitarbeiters + WHERE dv.mitarbeiter_uid = '. $this->db_add_param($mitarbeiter_uid). ' + -- Zeitaufzeichnungspflichtig... + AND zeitaufzeichnung = TRUE + -- ...im aktuellen Monat (default) oder im Monat des übergebenen $datums + AND ((date_trunc(\'month\', '. $timestamp. ')::date < vbt.bis AND (date_trunc(\'month\', '. $timestamp. ') + interval \'1 month - 1 day\')::date > vbt.von) OR (vbt.bis IS NULL AND (date_trunc(\'month\', '. $timestamp. ') + interval \'1 month - 1 day\')::date > vbt.von)) + -- Vorerst nur check, ob zumindest eine aufrechte Zeitaufzeichnungspflicht. Später Unterscheidung nach Dienstverhältnis. + --ORDER BY vbt.von DESC --aktuellster + LIMIT 1'; + + if ($result = $this->db_query($qry)) + { + if ($this->db_num_rows($result) > 0) + { + $this->result = array(); + + while ($row = $this->db_fetch_object()) + { + $obj = new stdClass(); + + $obj->vertragsbestandteil_id = $row->vertragsbestandteil_id; + $obj->dienstverhaeltnis_id = $row->dienstverhaeltnis_id; + $obj->vertragsbestandteiltyp_kurzbz = $row->vertragsbestandteiltyp_kurzbz; + $obj->von = $row->von; + $obj->bis = $row->bis; + $obj->insertamum = $row->insertamum; + $obj->insertvon = $row->insertvon; + $obj->updateamum = $row->updateamum; + $obj->updatevon = $row->updatevon; + $obj->zeitaufzeichnung = $row->zeitaufzeichnung; + $obj->azgrelevant = $row->azgrelevant; + $obj->homeoffice = $row->homeoffice; + + $this->result[] = $obj; + } + return true; + } + else + { + return false; + } + } + else + { + $this->errormsg = "Fehler bei der Abfrage aufgetreten"; + return false; + } + + } + + /** + * Holt alle Vertragsbestandteile, die eine Zeitaufzeichnungspflicht haben. + * + * Set order DESC limit 1 to retrieve only most recent Vertragsbestandteil. + * Set order ASC limit 1 to retrieve only first Vertragsbestandteil. + * + * @param $mitarbeiter_uid + * @param string $order + * @param null $limit + * @return bool + */ + public function getZaPflichtig($mitarbeiter_uid, $order = 'DESC', $limit = null) + { + if ($order !== 'ASC' && $order !== 'DESC') + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + + $qry = 'SELECT + vbt.vertragsbestandteil_id, vbt.dienstverhaeltnis_id, vbt.vertragsbestandteiltyp_kurzbz, + vbt.von, vbt.bis, vbt.insertamum, vbt.insertvon, vbt.updateamum, vbt.updatevon, + vbtza.zeitaufzeichnung, vbtza.azgrelevant, vbtza.homeoffice + FROM hr.tbl_vertragsbestandteil_zeitaufzeichnung vbtza + JOIN hr.tbl_vertragsbestandteil vbt USING (vertragsbestandteil_id) + JOIN hr.tbl_dienstverhaeltnis dv USING (dienstverhaeltnis_id) + -- Dienstverhältnis(se) des Mitarbeiters + WHERE dv.mitarbeiter_uid = '. $this->db_add_param($mitarbeiter_uid). ' + -- Zeitaufzeichnungspflichtig + AND zeitaufzeichnung = TRUE + -- Vertragsbestandteile sind aktuell, liegen nach dem GoLive und starten vor dem aktuellen Monatsletzten + AND( + (COALESCE(vbt.bis, NOW()::date) > '. $this->db_add_param(CASETIME_TIMESHEET_GOLIVE). '::date) AND + (vbt.von < (date_trunc(\'month\', NOW()) + interval \'1 month - 1 day\')::date) + ) + ORDER BY vbt.von ' . $order; + + + if (!is_null($limit)) + { + $qry .= ' LIMIT ' . $this->db_add_param($limit, FHC_INTEGER); + } + + if ($result = $this->db_query($qry)) + { + if ($this->db_num_rows($result) > 0) + { + $this->result = array(); + + while ($row = $this->db_fetch_object()) + { + $obj = new stdClass(); + + $obj->vertragsbestandteil_id = $row->vertragsbestandteil_id; + $obj->dienstverhaeltnis_id = $row->dienstverhaeltnis_id; + $obj->vertragsbestandteiltyp_kurzbz = $row->vertragsbestandteiltyp_kurzbz; + $obj->von = $row->von; + $obj->bis = $row->bis; + $obj->insertamum = $row->insertamum; + $obj->insertvon = $row->insertvon; + $obj->updateamum = $row->updateamum; + $obj->updatevon = $row->updatevon; + $obj->zeitaufzeichnung = $row->zeitaufzeichnung; + $obj->azgrelevant = $row->azgrelevant; + $obj->homeoffice = $row->homeoffice; + + $this->result[] = $obj; + } + return true; + } + else + { + return false; + } + } + else + { + $this->errormsg = "Fehler bei der Abfrage aufgetreten"; + return false; + } + + } + + /** + * Prueft ob MitarbeiterIn im Monat des uebergebenen $datums AZG-relevant ist. + * Wenn kein Datum übergeben wird, wird das heutige Datum gesetzt. + * + * @param $mitarbeiter_uid + * @param string $timestamp DD-MM-YYYY + * @return bool + */ + public function isAzgRelevant($mitarbeiter_uid, $datum = null) + { + + $timestamp = is_null($datum) ? 'NOW()' : '(date('. $this->db_add_param($datum).'))'; + + $qry = 'SELECT + vbt.vertragsbestandteil_id, vbt.dienstverhaeltnis_id, vbt.vertragsbestandteiltyp_kurzbz, + vbt.von, vbt.bis, vbt.insertamum, vbt.insertvon, vbt.updateamum, vbt.updatevon, + vbtza.zeitaufzeichnung, vbtza.azgrelevant, vbtza.homeoffice + FROM hr.tbl_vertragsbestandteil_zeitaufzeichnung vbtza + JOIN hr.tbl_vertragsbestandteil vbt USING (vertragsbestandteil_id) + JOIN hr.tbl_dienstverhaeltnis dv USING (dienstverhaeltnis_id) + -- Dienstverhältnis(se) des Mitarbeiters + WHERE dv.mitarbeiter_uid = '. $this->db_add_param($mitarbeiter_uid). ' + -- AZG-relevant... + AND azgrelevant = TRUE + -- ...im aktuellen Monat (default) oder im Monat des übergebenen $datums + AND ((date_trunc(\'month\', '. $timestamp. ')::date < vbt.bis AND (date_trunc(\'month\', '. $timestamp. ') + interval \'1 month - 1 day\')::date > vbt.von) OR (vbt.bis IS NULL AND (date_trunc(\'month\', '. $timestamp. ') + interval \'1 month - 1 day\')::date > vbt.von)) + -- Vorerst nur check, ob zumindest eine aufrechte Zeitaufzeichnungspflicht. Später Unterscheidung nach Dienstverhältnis. + --ORDER BY vbt.von DESC --aktuellster + LIMIT 1'; + + if ($result = $this->db_query($qry)) + { + if ($this->db_num_rows($result) > 0) + { + $this->result = array(); + + while ($row = $this->db_fetch_object()) + { + $obj = new stdClass(); + + $obj->vertragsbestandteil_id = $row->vertragsbestandteil_id; + $obj->dienstverhaeltnis_id = $row->dienstverhaeltnis_id; + $obj->vertragsbestandteiltyp_kurzbz = $row->vertragsbestandteiltyp_kurzbz; + $obj->von = $row->von; + $obj->bis = $row->bis; + $obj->insertamum = $row->insertamum; + $obj->insertvon = $row->insertvon; + $obj->updateamum = $row->updateamum; + $obj->updatevon = $row->updatevon; + $obj->zeitaufzeichnung = $row->zeitaufzeichnung; + $obj->azgrelevant = $row->azgrelevant; + $obj->homeoffice = $row->homeoffice; + + $this->result[] = $obj; + } + return true; + } + else + { + return false; + } + } + else + { + $this->errormsg = "Fehler bei der Abfrage aufgetreten"; + return false; + } + + } + + /** + * Prueft ob MitarbeiterIn im Monat des uebergebenen $datums AZG-relevant ist. + * Wenn kein Datum übergeben wird, wird das heutige Datum gesetzt. + * + * @param $mitarbeiter_uid + * @param string $timestamp DD-MM-YYYY + * @return bool + */ + public function hasHomeoffice($mitarbeiter_uid, $datum = null) + { + + $timestamp = is_null($datum) ? 'NOW()' : '(date('. $this->db_add_param($datum).'))'; + + $qry = 'SELECT + vbt.vertragsbestandteil_id, vbt.dienstverhaeltnis_id, vbt.vertragsbestandteiltyp_kurzbz, + vbt.von, vbt.bis, vbt.insertamum, vbt.insertvon, vbt.updateamum, vbt.updatevon, + vbtza.zeitaufzeichnung, vbtza.azgrelevant, vbtza.homeoffice + FROM hr.tbl_vertragsbestandteil_zeitaufzeichnung vbtza + JOIN hr.tbl_vertragsbestandteil vbt USING (vertragsbestandteil_id) + JOIN hr.tbl_dienstverhaeltnis dv USING (dienstverhaeltnis_id) + -- Dienstverhältnis(se) des Mitarbeiters + WHERE dv.mitarbeiter_uid = '. $this->db_add_param($mitarbeiter_uid). ' + -- Homeoffice... + AND homeoffice = TRUE + -- ...im aktuellen Monat (default) oder im Monat des übergebenen $datums + AND ((date_trunc(\'month\', '. $timestamp. ')::date < vbt.bis AND (date_trunc(\'month\', '. $timestamp. ') + interval \'1 month - 1 day\')::date > vbt.von) OR (vbt.bis IS NULL AND (date_trunc(\'month\', '. $timestamp. ') + interval \'1 month - 1 day\')::date > vbt.von)) + -- Vorerst nur check, ob zumindest eine aufrechte Zeitaufzeichnungspflicht. Später Unterscheidung nach Dienstverhältnis. + --ORDER BY vbt.von DESC --aktuellster + LIMIT 1'; + + if ($result = $this->db_query($qry)) + { + if ($this->db_num_rows($result) > 0) + { + $this->result = array(); + + while ($row = $this->db_fetch_object()) + { + $obj = new stdClass(); + + $obj->vertragsbestandteil_id = $row->vertragsbestandteil_id; + $obj->dienstverhaeltnis_id = $row->dienstverhaeltnis_id; + $obj->vertragsbestandteiltyp_kurzbz = $row->vertragsbestandteiltyp_kurzbz; + $obj->von = $row->von; + $obj->bis = $row->bis; + $obj->insertamum = $row->insertamum; + $obj->insertvon = $row->insertvon; + $obj->updateamum = $row->updateamum; + $obj->updatevon = $row->updatevon; + $obj->zeitaufzeichnung = $row->zeitaufzeichnung; + $obj->azgrelevant = $row->azgrelevant; + $obj->homeoffice = $row->homeoffice; + + $this->result[] = $obj; + } + return true; + } + else + { + return false; + } + } + else + { + $this->errormsg = "Fehler bei der Abfrage aufgetreten"; + return false; + } + + } + + /** + * Prueft ob MitarbeiterIn im Monat des uebergebenen $datums einen Allin Vertragsbestandteil hat. + * Wenn kein Datum übergeben wird, wird das heutige Datum gesetzt. + * + * @param $mitarbeiter_uid + * @param string $datum + * @return bool + */ + public function isAllin($mitarbeiter_uid, $datum = null) + { + $timestamp = is_null($datum) ? 'NOW()' : '(date('. $this->db_add_param($datum).'))'; + + $qry = 'SELECT + vbt.vertragsbestandteil_id, vbt.dienstverhaeltnis_id, vbt.vertragsbestandteiltyp_kurzbz, + vbt.von, vbt.bis, vbt.insertamum, vbt.insertvon, vbt.updateamum, vbt.updatevon, + vbtft.freitexttyp_kurzbz, vbtftt.bezeichnung, vbtft.titel, vbtft.anmerkung + FROM hr.tbl_vertragsbestandteil_freitext vbtft + JOIN hr.tbl_vertragsbestandteil vbt USING (vertragsbestandteil_id) + JOIN hr.tbl_dienstverhaeltnis dv USING (dienstverhaeltnis_id) + JOIN hr.tbl_vertragsbestandteil_freitexttyp vbtftt USING (freitexttyp_kurzbz) + -- Dienstverhältnis(se) des Mitarbeiters + WHERE dv.mitarbeiter_uid = '. $this->db_add_param($mitarbeiter_uid). ' + -- All-In + AND freitexttyp_kurzbz = \'allin\' + -- Vertragsbestandteil Freitext ist im Monat des übergebenen $datums + AND ((date_trunc(\'month\', '. $timestamp. ')::date < vbt.bis AND (date_trunc(\'month\', '. $timestamp. ') + interval \'1 month - 1 day\')::date > vbt.von) OR (vbt.bis IS NULL AND (date_trunc(\'month\', '. $timestamp. ') + interval \'1 month - 1 day\')::date > vbt.von)) + -- Vorerst nur check, ob zumindest ein aufrechter Allin Vertragsbestandteil. Später Unterscheidung nach Dienstverhältnis. + --ORDER BY vbt.von DESC -- aktuellster + LIMIT 1'; + + if ($result = $this->db_query($qry)) + { + if ($this->db_num_rows($result) > 0) + { + $this->result = array(); + + while ($row = $this->db_fetch_object()) + { + $obj = new stdClass(); + + $obj->vertragsbestandteil_id = $row->vertragsbestandteil_id; + $obj->dienstverhaeltnis_id = $row->dienstverhaeltnis_id; + $obj->vertragsbestandteiltyp_kurzbz = $row->vertragsbestandteiltyp_kurzbz; + $obj->von = $row->von; + $obj->bis = $row->bis; + $obj->insertamum = $row->insertamum; + $obj->insertvon = $row->insertvon; + $obj->updateamum = $row->updateamum; + $obj->updatevon = $row->updatevon; + $obj->freitexttyp_kurzbz = $row->freitexttyp_kurzbz; + $obj->bezeichnung = $row->bezeichnung; + $obj->titel = $row->titel; + $obj->anmerkung = $row->anmerkung; + + $this->result[] = $obj; + } + return true; + } + else + { + return false; + } + } + else + { + $this->errormsg = "Fehler bei der Abfrage aufgetreten"; + return false; + } + } +} +?> From dbee8d96891b0cd9788b542800b68d79d055bbb8 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 4 May 2023 09:39:12 +0200 Subject: [PATCH 063/263] Changed: Check homeoffice an neue Vertragsstruktur angepasst --- include/zeitaufzeichnung_import_csv.class.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/zeitaufzeichnung_import_csv.class.php b/include/zeitaufzeichnung_import_csv.class.php index 8a8e8bb2f..71f3ab75f 100644 --- a/include/zeitaufzeichnung_import_csv.class.php +++ b/include/zeitaufzeichnung_import_csv.class.php @@ -1,6 +1,7 @@ datum->formatDatum($data[self::STARTDT], 'Y-m-d'); - $verwendung = new bisverwendung(); - $verwendung->getVerwendungDatum($data[self::USER], $vonCSV); - foreach ($verwendung->result as $v) { - if ($v->homeoffice) { - $this->zeit->homeoffice = true; - } else { - $this->addWarning($this->p->t("zeitaufzeichnung/homeofficeNichtErlaubt", [$vonCSV])); - $this->zeit->homeoffice = false; - } - } + $vbt = new vertragsbestandteil(); + $homeoffice = $vbt->hasHomeoffice($data[self::USER], $vonCSV); + + if ($homeoffice) { + $this->zeit->homeoffice = true; + } else { + $this->addWarning($this->p->t("zeitaufzeichnung/homeofficeNichtErlaubt", [$vonCSV])); + $this->zeit->homeoffice = false; + } } } } From 8e736389313740d4566dd3d8c44a522efb31efd8 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 4 May 2023 09:41:50 +0200 Subject: [PATCH 064/263] Changed: Check homeoffice an neue Vertragsstruktur angepasst --- .../tools/zeitaufzeichnung_bisverwendung.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/cis/private/tools/zeitaufzeichnung_bisverwendung.php b/cis/private/tools/zeitaufzeichnung_bisverwendung.php index 2f430ecda..742afe7eb 100644 --- a/cis/private/tools/zeitaufzeichnung_bisverwendung.php +++ b/cis/private/tools/zeitaufzeichnung_bisverwendung.php @@ -32,6 +32,7 @@ require_once('../../../include/mitarbeiter.class.php'); require_once('../../../include/zeitaufzeichnung.class.php'); require_once('../../../include/projekt.class.php'); require_once('../../../include/bisverwendung.class.php'); +require_once('../../../include/vertragsbestandteil.class.php'); if ((isset($_GET['uid'])) && (isset($_GET['day']))) { @@ -57,18 +58,8 @@ if ((isset($_GET['uid'])) && (isset($_GET['day']))) $day = $_GET['day']; - $verwendung = new bisverwendung(); - - $verwendung->getVerwendungDatum($uid, $day); - $homeoffice = false; - - foreach ($verwendung->result as $v) - { - if ($v->homeoffice) - { - $homeoffice = true; - } - } + $vbt = new vertragsbestandteil(); + $homeoffice = $vbt->hasHomeoffice($uid, $day); echo json_encode($homeoffice); From d2b6aab88134de34ca426cf44221c962a3c40487 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 4 May 2023 09:42:30 +0200 Subject: [PATCH 065/263] Changed: AZG-relvant an neue Vertragsstruktur angepasst --- cis/private/tools/zeitaufzeichnung.php | 32 ++++++++++++++------------ 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/cis/private/tools/zeitaufzeichnung.php b/cis/private/tools/zeitaufzeichnung.php index 773582177..700f987e2 100644 --- a/cis/private/tools/zeitaufzeichnung.php +++ b/cis/private/tools/zeitaufzeichnung.php @@ -46,6 +46,7 @@ require_once('../../../include/studiensemester.class.php'); require_once('../../../include/benutzerberechtigung.class.php'); require_once('../../../include/zeitaufzeichnung_import_csv.class.php'); require_once('../../../include/zeitaufzeichnung_import_post.class.php'); +require_once('../../../include/vertragsbestandteil.class.php'); $sprache = getSprache(); $p=new phrasen($sprache); @@ -303,7 +304,7 @@ echo ' Monat=Datum.substring(3,5); Jahr=Datum.substring(6,10); var day = Jahr + "-" + Monat + "-" + Tag; - checkBisverwendung(day,uid); + checkZeitaufzeichnung(day,uid); checkZeitsperre(day,uid); } ) @@ -762,14 +763,15 @@ echo ' Monat=Datum.substring(3,5); Jahr=Datum.substring(6,10); var checkedDay = Jahr + "-" + Monat + "-" + Tag; - checkBisverwendung(checkedDay, uid); + checkZeitaufzeichnung(checkedDay, uid); checkZeitsperre(checkedDay, uid); } - function checkBisverwendung(day, uid) + function checkZeitaufzeichnung(day, uid) { + /* Checkt nicht mehr Bisverwendung, sondern Vertragsbestandteil Zeitaufzeichnung */ $.ajax({ - url: "zeitaufzeichnung_bisverwendung.php", + url: "zeitaufzeichnung_bisverwendung.php", data: { day: day, uid: uid @@ -1577,21 +1579,21 @@ if ($projekt->getProjekteMitarbeiter($user, true)) $linkInformation = APP_ROOT. 'skin/images/information.png'; $za = new zeitaufzeichnung(); - $verwendung = new bisverwendung(); + if ($za->checkPausenErrors($user, $tag)) { - $verwendung->getVerwendungDatum($user, $tag); - foreach ($verwendung->result as $v) + $vbt = new vertragsbestandteil(); + $isAzgrelevant = $vbt->isAzgRelevant($user, $tag); + + if ($isAzgrelevant) { - if ($v->azgrelevant) - { - $pausefehlt_str = ' -- Pause fehlt oder zu kurz -- '; - } - else - { - $pausefehlt_str = ' -- Pause fehlt --'; - } + $pausefehlt_str = ' -- Pause fehlt oder zu kurz -- '; } + else + { + $pausefehlt_str = ' -- Pause fehlt --'; + } + } $tagessaldo = date('H:i', ($tagessaldo)); From 4f03b61c6eb743478a7d1713e7213625bf828c55 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 4 May 2023 13:43:54 +0200 Subject: [PATCH 066/263] - stunden bestandteil bei karenz mit 0 stunden verlaengern --- application/controllers/system/MigrateContract.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/application/controllers/system/MigrateContract.php b/application/controllers/system/MigrateContract.php index 8c6f0ad7c..7583fedb3 100644 --- a/application/controllers/system/MigrateContract.php +++ b/application/controllers/system/MigrateContract.php @@ -4,7 +4,7 @@ * Vertragsstruktur im HR Schema * * Aufruf: - * php index.ci.php system/MigrateContracts/index/oesi + * php index.ci.php system/MigrateContract/index/oesi */ if (! defined('BASEPATH')) exit('No direct script access allowed'); @@ -350,7 +350,7 @@ class MigrateContract extends CLI_Controller if ($dtende_fkt < $dtende_dv) $endedatum = $row_funktion->datum_bis; else - $endedatum = $row_contract['von']; + $endedatum = $row_contract['bis']; // VBS anlegen und Funktion zuweisen $newVBSIndex = $this->_getNewVBSIndex($contracts, $dv); @@ -453,15 +453,15 @@ class MigrateContract extends CLI_Controller private function _addVertragsbestandteilStunden(&$contracts, $dv, $row_verwendung) { // Nur anlegen wenn im aktuellen Eintrag auch Stunden eingetragen sind - if ($row_verwendung->vertragsstunden != '' && $row_verwendung->vertragsstunden != '0.00') + if ($row_verwendung->vertragsstunden != '') { if (isset($contracts['dv'][$dv]['vbs'])) { foreach ($contracts['dv'][$dv]['vbs'] as $index_vbs=>$row_vbs) { - if ($row_vbs['vertragsbestandteiltyp_kurzbz'] == 'stunden') + if ($row_vbs['vertragsbestandteiltyp_kurzbz'] == 'stunden' || ($row_vbs['vertragsbestandteiltyp_kurzbz'] == 'karenz' && $row_verwendung->vertragsstunden === '0.00')) { - if ($this->_isVBSAngrenzend($row_verwendung, $row_vbs) && $row_vbs['wochenstunden'] == $row_verwendung->vertragsstunden) + if ($this->_isVBSAngrenzend($row_verwendung, $row_vbs) && ($row_vbs['wochenstunden'] == $row_verwendung->vertragsstunden || $row_verwendung->vertragsstunden === '0.00')) { // stunden bleiben gleich - Ende des VBS verlaengern $contracts['dv'][$dv]['vbs'][$index_vbs]['bis'] = $row_verwendung->ende; From 1c0129466a60c3965ea999f5a7161b3f34ad56d3 Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 4 May 2023 15:23:51 +0200 Subject: [PATCH 067/263] Bugfix: added a check to DB_Model->_addEncrypt method on the parameter encryptedColumns --- application/core/DB_Model.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/application/core/DB_Model.php b/application/core/DB_Model.php index d554d8c5c..d286d1d54 100644 --- a/application/core/DB_Model.php +++ b/application/core/DB_Model.php @@ -906,6 +906,9 @@ class DB_Model extends CI_Model */ private function _addEncrypt($encryptedColumns, &$data) { + // If encryptedColumns is not defined then exit + if (isEmptyArray($encryptedColumns)) return; + $tmpData = array(); // Temporary array used to copy not encrypted columns // For each column that is going to be inserted/updated From defe4e2f936012384b981af1a264ba9a09eb2d5c Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 4 May 2023 15:33:08 +0200 Subject: [PATCH 068/263] Added new interface application/core/IEncryption.php --- application/core/IEncryption.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 application/core/IEncryption.php diff --git a/application/core/IEncryption.php b/application/core/IEncryption.php new file mode 100644 index 000000000..6b9132c23 --- /dev/null +++ b/application/core/IEncryption.php @@ -0,0 +1,24 @@ +. + */ + +interface IEncryption +{ + public function getEncryptedColumns(): array; +} + From 42ff682700b21959cf917ce5368a9656b618e2b0 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Fri, 5 May 2023 08:20:29 +0200 Subject: [PATCH 069/263] add validations --- .../VertragsbestandteilKuendigungsfrist.php | 22 +++++++++++++++++++ .../VertragsbestandteilStunden.php | 2 +- .../VertragsbestandteilUrlaubsanspruch.php | 11 ++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilKuendigungsfrist.php b/application/libraries/vertragsbestandteil/VertragsbestandteilKuendigungsfrist.php index a539bb271..1d2788b57 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilKuendigungsfrist.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilKuendigungsfrist.php @@ -86,6 +86,28 @@ EOTXT; public function validate() { + if( !(filter_var($this->arbeitgeber_frist, FILTER_VALIDATE_INT, + array( + 'options' => array( + 'min_range' => 0, + 'max_range' => 52 + ) + ) + )) ) { + $this->validationerrors[] = 'Arbeitgeberfrist muss eine Wochenanzahl im Bereich 1 bis 52 sein.'; + } + + if( !(filter_var($this->arbeitnehmer_frist, FILTER_VALIDATE_INT, + array( + 'options' => array( + 'min_range' => 1, + 'max_range' => 52 + ) + ) + )) ) { + $this->validationerrors[] = 'Arbeitnehmerfrist muss eine Wochenanzahl im Bereich 1 bis 52 sein.'; + } + return parent::validate(); } } diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilStunden.php b/application/libraries/vertragsbestandteil/VertragsbestandteilStunden.php index b5c522e8b..d11e04994 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilStunden.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilStunden.php @@ -88,7 +88,7 @@ EOTXT; ) ) )) ) { - $this->validationerrors[] = 'Stunden muss eine Kommazahl im Bereichs 0 bis 100 sein.'; + $this->validationerrors[] = 'Stunden muss eine Kommazahl im Bereich 0 bis 100 sein.'; } return parent::validate(); diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch.php b/application/libraries/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch.php index 60c928f1f..48c985afb 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch.php @@ -64,6 +64,17 @@ EOTXT; public function validate() { + if( !(filter_var($this->tage, FILTER_VALIDATE_INT, + array( + 'options' => array( + 'min_range' => 1, + 'max_range' => 50 + ) + ) + )) ) { + $this->validationerrors[] = 'Arbeitgeberfrist muss eine Tagesanzahl im Bereich 1 bis 50 sein.'; + } + return parent::validate(); } } From 2c0e815fe8e4125ca5df6b2dc661915b1a54ef09 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Fri, 5 May 2023 11:43:02 +0200 Subject: [PATCH 070/263] add validations --- .../libraries/vertragsbestandteil/Gehaltsbestandteil.php | 5 +++++ .../vertragsbestandteil/VertragsbestandteilFunktion.php | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php b/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php index b3b2271db..130c18547 100644 --- a/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php +++ b/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php @@ -294,6 +294,11 @@ EOTXT; public function validate() { //do Validation here + if( empty($this->gehaltstyp_kurzbz) ) + { + $this->validationerrors[] = "Ein Gehaltstyp muss ausgewählt sein."; + } + if( empty($this->grundbetrag) ) { $this->validationerrors[] = "Betrag fehlt."; diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php b/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php index facc0cbd0..846e3e671 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php @@ -91,6 +91,11 @@ EOTXT; protected function createBenutzerfunktionData($data) { + if( empty($data->funktion) || empty($data->orget) ) + { + return; + } + $this->benutzerfunktiondata = (object) array( 'funktion_kurzbz' => $data->funktion, 'oe_kurzbz' => $data->orget, From d131212d221ebd31ccf2c4b5f44b55609b7baf2b Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Fri, 5 May 2023 14:20:07 +0200 Subject: [PATCH 071/263] composer update --- composer.lock | 1966 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 1928 insertions(+), 38 deletions(-) diff --git a/composer.lock b/composer.lock index 72f13c76f..ad715f642 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d530cc4d7bd81812535eb64e87ba04f4", + "content-hash": "12acec21673c71641f7f1a6586ec666f", "packages": [ { "name": "afarkas/html5shiv", @@ -35,6 +35,10 @@ ], "description": "Defacto way to enable use of HTML5 sectioning elements in legacy Internet Explorer.", "homepage": "http://paulirish.com/2011/the-history-of-the-html5-shiv/", + "support": { + "issues": "https://github.com/aFarkas/html5shiv/issues", + "source": "https://github.com/aFarkas/html5shiv/tree/3.7.3" + }, "time": "2015-07-20T20:04:00+00:00" }, { @@ -130,6 +134,16 @@ "keywords": [ "qr code" ], + "support": { + "issues": "https://github.com/chillerlan/php-qrcode/issues", + "source": "https://github.com/chillerlan/php-qrcode/tree/v2.0.x" + }, + "funding": [ + { + "url": "https://ko-fi.com/codemasher", + "type": "ko_fi" + } + ], "time": "2020-04-12T07:38:35+00:00" }, { @@ -178,6 +192,10 @@ "helper", "trait" ], + "support": { + "issues": "https://github.com/chillerlan/php-traits/issues", + "source": "https://github.com/chillerlan/php-traits" + }, "abandoned": true, "time": "2018-06-22T00:30:47+00:00" }, @@ -218,6 +236,10 @@ ], "description": "REST Server for the CodeIgniter framework", "homepage": "https://github.com/chriskacerguis/codeigniter-restserver", + "support": { + "issues": "https://github.com/chriskacerguis/codeigniter-restserver/issues", + "source": "https://github.com/chriskacerguis/codeigniter-restserver" + }, "time": "2017-09-23T16:44:55+00:00" }, { @@ -236,6 +258,10 @@ }, "type": "library", "notification-url": "https://packagist.org/downloads/", + "support": { + "issues": "https://github.com/akiyatkin/tablesorter/issues", + "source": "https://github.com/akiyatkin/tablesorter/tree/master" + }, "time": "2016-09-02T11:31:54+00:00" }, { @@ -269,6 +295,13 @@ ], "description": "The CodeIgniter framework", "homepage": "https://codeigniter.com", + "support": { + "forum": "http://forum.codeigniter.com/", + "issues": "https://github.com/bcit-ci/CodeIgniter/issues", + "slack": "https://codeigniterchat.slack.com", + "source": "https://github.com/bcit-ci/CodeIgniter", + "wiki": "https://github.com/bcit-ci/CodeIgniter/wiki" + }, "time": "2022-03-03T13:21:49+00:00" }, { @@ -573,6 +606,10 @@ ], "description": "Shim repository for Angular.js", "homepage": "http://angularjs.org", + "support": { + "issues": "https://github.com/components/angular.js/issues", + "source": "https://github.com/components/angular.js/tree/master" + }, "time": "2015-06-07T20:10:38+00:00" }, { @@ -615,6 +652,13 @@ ], "description": "jQuery JavaScript Library", "homepage": "http://jquery.com", + "support": { + "forum": "http://forum.jquery.com", + "irc": "irc://irc.freenode.org/jquery", + "issues": "https://github.com/jquery/jquery/issues", + "source": "https://github.com/jquery/jquery", + "wiki": "http://docs.jquery.com/" + }, "time": "2021-03-20T19:13:42+00:00" }, { @@ -700,6 +744,10 @@ } ], "description": "jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library. Whether you're building highly interactive web applications or you just need to add a date picker to a form control, jQuery UI is the perfect choice.", + "support": { + "issues": "https://github.com/components/jqueryui/issues", + "source": "https://github.com/components/jqueryui/tree/master" + }, "time": "2016-09-16T05:47:55+00:00" }, { @@ -749,6 +797,10 @@ "captcha", "security" ], + "support": { + "issues": "https://github.com/dapphp/securimage/issues", + "source": "https://github.com/dapphp/securimage/tree/master" + }, "abandoned": true, "time": "2018-03-09T06:07:41+00:00" }, @@ -812,6 +864,12 @@ "rdfa", "sparql" ], + "support": { + "forum": "http://groups.google.com/group/easyrdf/", + "irc": "irc://chat.freenode.net/easyrdf", + "issues": "http://github.com/njh/easyrdf/issues", + "source": "https://github.com/easyrdf/easyrdf/tree/0.9.1" + }, "time": "2015-02-27T09:45:49+00:00" }, { @@ -890,6 +948,10 @@ "faker", "fixtures" ], + "support": { + "issues": "https://github.com/fzaninotto/Faker/issues", + "source": "https://github.com/fzaninotto/Faker/tree/v1.9.2" + }, "abandoned": true, "time": "2020-12-11T09:56:16+00:00" }, @@ -1012,6 +1074,10 @@ "json", "schema" ], + "support": { + "issues": "https://github.com/justinrainbow/json-schema/issues", + "source": "https://github.com/justinrainbow/json-schema/tree/master" + }, "time": "2014-08-25T02:48:14+00:00" }, { @@ -1046,6 +1112,10 @@ } ], "description": "A framework-agnostic PHP Implementation for generating simple forms based on json-schema", + "support": { + "issues": "https://github.com/kingsquare/json-schema-form/issues", + "source": "https://github.com/kingsquare/json-schema-form/tree/master" + }, "time": "2014-07-10T12:27:19+00:00" }, { @@ -1106,6 +1176,10 @@ "keywords": [ "markdown" ], + "support": { + "issues": "https://github.com/michelf/php-markdown/issues", + "source": "https://github.com/michelf/php-markdown/tree/lib" + }, "time": "2015-03-01T12:03:08+00:00" }, { @@ -1153,20 +1227,24 @@ "uri", "url" ], + "support": { + "issues": "https://github.com/lanthaler/IRI/issues", + "source": "https://github.com/lanthaler/IRI/tree/master" + }, "time": "2014-01-21T13:43:39+00:00" }, { "name": "ml/json-ld", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/lanthaler/JsonLD.git", - "reference": "c74a1aed5979ed1cfb1be35a55a305fd30e30b93" + "reference": "537e68e87a6bce23e57c575cd5dcac1f67ce25d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lanthaler/JsonLD/zipball/c74a1aed5979ed1cfb1be35a55a305fd30e30b93", - "reference": "c74a1aed5979ed1cfb1be35a55a305fd30e30b93", + "url": "https://api.github.com/repos/lanthaler/JsonLD/zipball/537e68e87a6bce23e57c575cd5dcac1f67ce25d8", + "reference": "537e68e87a6bce23e57c575cd5dcac1f67ce25d8", "shasum": "" }, "require": { @@ -1202,7 +1280,11 @@ "JSON-LD", "jsonld" ], - "time": "2020-06-16T17:45:06+00:00" + "support": { + "issues": "https://github.com/lanthaler/JsonLD/issues", + "source": "https://github.com/lanthaler/JsonLD/tree/1.2.1" + }, + "time": "2022-09-29T08:45:17+00:00" }, { "name": "moment/momentjs", @@ -1262,6 +1344,14 @@ "sorting", "table" ], + "support": { + "docs": "https://mottie.github.io/tablesorter/docs/index.html", + "email": "wowmotty@gmail.com", + "irc": "irc://irc.freenode.org/tablesorter", + "issues": "https://github.com/Mottie/tablesorter/issues", + "source": "https://github.com/Mottie/tablesorter", + "wiki": "https://github.com/Mottie/tablesorter/wiki" + }, "time": "2020-03-03T13:46:03+00:00" }, { @@ -1312,6 +1402,10 @@ "rest", "restful" ], + "support": { + "issues": "https://github.com/nategood/httpful/issues", + "source": "https://github.com/nategood/httpful/tree/v0.2.20" + }, "time": "2015-10-26T16:11:30+00:00" }, { @@ -1365,6 +1459,12 @@ "plaintext", "textile" ], + "support": { + "irc": "irc://irc.freenode.net/textile", + "issues": "https://github.com/textile/php-textile/issues", + "source": "https://github.com/textile/php-textile", + "wiki": "https://github.com/textile/php-textile/wiki" + }, "time": "2022-05-01T17:05:16+00:00" }, { @@ -1420,16 +1520,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "2.0.37", + "version": "2.0.42", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "c812fbb4d6b4d7f30235ab7298a12f09ba13b37c" + "reference": "665d289f59e646a259ebf13f29be7f6f54cab24b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/c812fbb4d6b4d7f30235ab7298a12f09ba13b37c", - "reference": "c812fbb4d6b4d7f30235ab7298a12f09ba13b37c", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/665d289f59e646a259ebf13f29be7f6f54cab24b", + "reference": "665d289f59e646a259ebf13f29be7f6f54cab24b", "shasum": "" }, "require": { @@ -1444,7 +1544,8 @@ "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.", "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.", "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", - "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations." + "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations.", + "ext-xml": "Install the XML extension to load XML formatted public keys." }, "type": "library", "autoload": { @@ -1507,7 +1608,25 @@ "x.509", "x509" ], - "time": "2022-04-04T04:57:45+00:00" + "support": { + "issues": "https://github.com/phpseclib/phpseclib/issues", + "source": "https://github.com/phpseclib/phpseclib/tree/2.0.42" + }, + "funding": [ + { + "url": "https://github.com/terrafrost", + "type": "github" + }, + { + "url": "https://www.patreon.com/phpseclib", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib", + "type": "tidelift" + } + ], + "time": "2023-03-06T12:45:53+00:00" }, { "name": "rmariuzzo/jquery-checkboxes", @@ -1587,6 +1706,23 @@ "polyfill", "portable" ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.19.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-10-23T09:01:57+00:00" }, { @@ -1706,8 +1842,30 @@ "keywords": [ "templating" ], + "support": { + "issues": "https://github.com/twigphp/Twig/issues", + "source": "https://github.com/twigphp/Twig/tree/1.x" + }, "time": "2020-02-11T05:59:23+00:00" }, + { + "name": "vuejs/vuedatepicker_css", + "version": "4.2.3", + "dist": { + "type": "file", + "url": "https://unpkg.com/@vuepic/vue-datepicker@4.2.3/dist/main.css" + }, + "type": "library" + }, + { + "name": "vuejs/vuedatepicker_js", + "version": "4.2.3", + "dist": { + "type": "file", + "url": "https://unpkg.com/@vuepic/vue-datepicker@4.2.3/dist/vue-datepicker.iife.js" + }, + "type": "library" + }, { "name": "vuejs/vuejs3", "version": "3.2.33", @@ -1779,6 +1937,24 @@ "regex", "regular expression" ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/1.0.1" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], "time": "2022-01-21T20:24:37+00:00" }, { @@ -1826,20 +2002,160 @@ "Xdebug", "performance" ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/2.0.5" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], "time": "2022-02-24T20:20:32+00:00" }, { - "name": "nikic/php-parser", - "version": "v4.14.0", + "name": "doctrine/instantiator", + "version": "1.0.5", "source": { "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1" + "url": "https://github.com/doctrine/instantiator.git", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/34bea19b6e03d8153165d8f30bba4c3be86184c1", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.0.5" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2015-06-14T21:17:01+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^4.1" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.x" + }, + "time": "2017-10-19T19:58:43+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.15.4", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6bb5176bc4af8bcb7d926f88718db9b96a2d4290", + "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290", "shasum": "" }, "require": { @@ -1878,20 +2194,24 @@ "parser", "php" ], - "time": "2022-05-31T20:59:12+00:00" + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.4" + }, + "time": "2023-03-05T19:49:14+00:00" }, { "name": "pdepend/pdepend", - "version": "2.10.3", + "version": "2.13.0", "source": { "type": "git", "url": "https://github.com/pdepend/pdepend.git", - "reference": "da3166a06b4a89915920a42444f707122a1584c9" + "reference": "31be7cd4f305f3f7b52af99c1cb13fc938d1cfad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pdepend/pdepend/zipball/da3166a06b4a89915920a42444f707122a1584c9", - "reference": "da3166a06b4a89915920a42444f707122a1584c9", + "url": "https://api.github.com/repos/pdepend/pdepend/zipball/31be7cd4f305f3f7b52af99c1cb13fc938d1cfad", + "reference": "31be7cd4f305f3f7b52af99c1cb13fc938d1cfad", "shasum": "" }, "require": { @@ -1925,26 +2245,309 @@ "BSD-3-Clause" ], "description": "Official version of pdepend to be handled with Composer", - "time": "2022-02-23T07:53:09+00:00" + "support": { + "issues": "https://github.com/pdepend/pdepend/issues", + "source": "https://github.com/pdepend/pdepend/tree/2.13.0" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/pdepend/pdepend", + "type": "tidelift" + } + ], + "time": "2023-02-28T20:56:15+00:00" }, { - "name": "phpmd/phpmd", - "version": "2.12.0", + "name": "phar-io/manifest", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/phpmd/phpmd.git", - "reference": "c0b678ba71902f539c27c14332aa0ddcf14388ec" + "url": "https://github.com/phar-io/manifest.git", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpmd/phpmd/zipball/c0b678ba71902f539c27c14332aa0ddcf14388ec", - "reference": "c0b678ba71902f539c27c14332aa0ddcf14388ec", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^1.0.1", + "php": "^5.6 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/master" + }, + "time": "2017-03-05T18:14:27+00:00" + }, + { + "name": "phar-io/version", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/master" + }, + "time": "2017-03-05T17:38:23+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/master" + }, + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "4.3.4", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/da3fd972d6bafd628114f7e7e036f45944b62e9c", + "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0", + "phpdocumentor/type-resolver": "~0.4 || ^1.0.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "doctrine/instantiator": "^1.0.5", + "mockery/mockery": "^1.0", + "phpdocumentor/type-resolver": "0.4.*", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/release/4.x" + }, + "time": "2019-12-28T18:55:12+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.5.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "cf842904952e64e703800d094cdf34e715a8a3ae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/cf842904952e64e703800d094cdf34e715a8a3ae", + "reference": "cf842904952e64e703800d094cdf34e715a8a3ae", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/master" + }, + "time": "2017-12-30T13:23:38+00:00" + }, + { + "name": "phpmd/phpmd", + "version": "2.13.0", + "source": { + "type": "git", + "url": "https://github.com/phpmd/phpmd.git", + "reference": "dad0228156856b3ad959992f9748514fa943f3e3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpmd/phpmd/zipball/dad0228156856b3ad959992f9748514fa943f3e3", + "reference": "dad0228156856b3ad959992f9748514fa943f3e3", "shasum": "" }, "require": { "composer/xdebug-handler": "^1.0 || ^2.0 || ^3.0", "ext-xml": "*", - "pdepend/pdepend": "^2.10.3", + "pdepend/pdepend": "^2.12.1", "php": ">=5.3.9" }, "require-dev": { @@ -1997,20 +2600,31 @@ "phpmd", "pmd" ], - "time": "2022-03-24T13:33:01+00:00" + "support": { + "irc": "irc://irc.freenode.org/phpmd", + "issues": "https://github.com/phpmd/phpmd/issues", + "source": "https://github.com/phpmd/phpmd/tree/2.13.0" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/phpmd/phpmd", + "type": "tidelift" + } + ], + "time": "2022-09-10T08:44:15+00:00" }, { "name": "phpmetrics/phpmetrics", - "version": "v2.8.1", + "version": "v2.8.2", "source": { "type": "git", "url": "https://github.com/phpmetrics/PhpMetrics.git", - "reference": "e279f7317390f642339941b693359e9a181817a7" + "reference": "4b77140a11452e63c7a9b98e0648320bf6710090" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpmetrics/PhpMetrics/zipball/e279f7317390f642339941b693359e9a181817a7", - "reference": "e279f7317390f642339941b693359e9a181817a7", + "url": "https://api.github.com/repos/phpmetrics/PhpMetrics/zipball/4b77140a11452e63c7a9b98e0648320bf6710090", + "reference": "4b77140a11452e63c7a9b98e0648320bf6710090", "shasum": "" }, "require": { @@ -2061,7 +2675,242 @@ "quality", "testing" ], - "time": "2022-03-24T10:19:51+00:00" + "support": { + "issues": "https://github.com/PhpMetrics/PhpMetrics/issues", + "source": "https://github.com/phpmetrics/PhpMetrics/tree/v2.8.2" + }, + "time": "2023-03-08T15:03:36+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "v1.10.3", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "451c3cd1418cf640de218914901e51b064abb093" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", + "reference": "451c3cd1418cf640de218914901e51b064abb093", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", + "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5 || ^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10.x-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\": "src/Prophecy" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/v1.10.3" + }, + "time": "2020-03-05T15:02:03+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "5.3.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "c89677919c5dd6d3b3852f230a663118762218ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", + "reference": "c89677919c5dd6d3b3852f230a663118762218ac", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.0", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^2.0.1", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.0", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-xdebug": "^2.5.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/5.3" + }, + "time": "2018-04-06T15:36:58+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "irc": "irc://irc.freenode.net/phpunit", + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/1.4.5" + }, + "time": "2017-11-27T13:52:08+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" + }, + "time": "2015-06-21T13:50:34+00:00" }, { "name": "phpunit/php-timer", @@ -2110,8 +2959,218 @@ "keywords": [ "timer" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/master" + }, "time": "2017-02-26T11:10:40+00:00" }, + { + "name": "phpunit/php-token-stream", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "791198a2c6254db10131eecfe8c06670700904db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", + "source": "https://github.com/sebastianbergmann/php-token-stream/tree/master" + }, + "abandoned": true, + "time": "2017-11-27T05:48:46+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "6.5.14", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bac23fe7ff13dbdb461481f706f0e9fe746334b7", + "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "^1.6.1", + "phar-io/manifest": "^1.0.1", + "phar-io/version": "^1.0", + "php": "^7.0", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^5.3", + "phpunit/php-file-iterator": "^1.4.3", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^1.0.9", + "phpunit/phpunit-mock-objects": "^5.0.9", + "sebastian/comparator": "^2.1", + "sebastian/diff": "^2.0", + "sebastian/environment": "^3.1", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^1.0", + "sebastian/version": "^2.0.1" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2", + "phpunit/dbunit": "<3.0" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "^1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.5.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/6.5.14" + }, + "time": "2019-02-01T05:22:47+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "5.0.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.5", + "php": "^7.0", + "phpunit/php-text-template": "^1.2.1", + "sebastian/exporter": "^3.1" + }, + "conflict": { + "phpunit/phpunit": "<6.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.5.11" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit-mock-objects/issues", + "source": "https://github.com/sebastianbergmann/phpunit-mock-objects/tree/5.0.10" + }, + "abandoned": true, + "time": "2018-08-09T05:50:03+00:00" + }, { "name": "psr/container", "version": "1.0.0", @@ -2159,6 +3218,10 @@ "container-interop", "psr" ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/master" + }, "time": "2017-02-14T16:28:37+00:00" }, { @@ -2206,8 +3269,321 @@ "psr", "psr-3" ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, "time": "2021-05-03T11:20:27+00:00" }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/1de8cd5c010cb153fcd68b8d0f64606f523f7619", + "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "phpunit/phpunit": "^8.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T08:15:22+00:00" + }, + { + "name": "sebastian/comparator", + "version": "2.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/diff": "^2.0 || ^3.0", + "sebastian/exporter": "^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/master" + }, + "time": "2018-02-01T13:46:46+00:00" + }, + { + "name": "sebastian/diff", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/master" + }, + "time": "2017-08-03T08:09:46+00:00" + }, + { + "name": "sebastian/environment", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/master" + }, + "time": "2017-07-01T08:51:00+00:00" + }, + { + "name": "sebastian/exporter", + "version": "3.1.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/73a9676f2833b9a7c36968f9d882589cd75511e6", + "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6", + "shasum": "" + }, + "require": { + "php": ">=7.0", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^8.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-09-14T06:00:17+00:00" + }, { "name": "sebastian/finder-facade", "version": "1.2.2", @@ -2245,9 +3621,180 @@ ], "description": "FinderFacade is a convenience wrapper for Symfony's Finder component.", "homepage": "https://github.com/sebastianbergmann/finder-facade", + "support": { + "issues": "https://github.com/sebastianbergmann/finder-facade/issues", + "source": "https://github.com/sebastianbergmann/finder-facade/tree/master" + }, "abandoned": true, "time": "2017-11-18T17:31:49+00:00" }, + { + "name": "sebastian/global-state", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/2.0.0" + }, + "time": "2017-04-27T15:39:26+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "3.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", + "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", + "shasum": "" + }, + "require": { + "php": ">=7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/3.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:40:27+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", + "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/1.1.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:37:18+00:00" + }, { "name": "sebastian/phpcpd", "version": "3.0.1", @@ -2296,8 +3843,122 @@ ], "description": "Copy/Paste Detector (CPD) for PHP code.", "homepage": "https://github.com/sebastianbergmann/phpcpd", + "support": { + "issues": "https://github.com/sebastianbergmann/phpcpd/issues", + "source": "https://github.com/sebastianbergmann/phpcpd/tree/master" + }, + "abandoned": true, "time": "2017-11-16T08:49:28+00:00" }, + { + "name": "sebastian/recursion-context", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/367dcba38d6e1977be014dc4b22f47a484dac7fb", + "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:34:24+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/master" + }, + "time": "2015-07-28T20:34:47+00:00" + }, { "name": "sebastian/version", "version": "2.0.1", @@ -2339,6 +4000,10 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/master" + }, "time": "2016-10-03T07:35:21+00:00" }, { @@ -2390,6 +4055,11 @@ "phpcs", "standards" ], + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, "time": "2021-12-12T21:44:58+00:00" }, { @@ -2449,6 +4119,23 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/config/tree/v3.4.47" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-10-24T10:57:07+00:00" }, { @@ -2516,6 +4203,23 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/console/tree/v3.4.47" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-10-24T10:57:07+00:00" }, { @@ -2567,6 +4271,23 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/debug/tree/v3.4.47" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "abandoned": "symfony/error-handler", "time": "2020-10-24T10:57:07+00:00" }, @@ -2634,6 +4355,23 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/dependency-injection/tree/v3.4.47" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-10-24T10:57:07+00:00" }, { @@ -2679,6 +4417,23 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v3.4.47" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-10-24T10:57:07+00:00" }, { @@ -2723,6 +4478,23 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v3.4.47" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-11-16T17:02:08+00:00" }, { @@ -2786,6 +4558,23 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.19.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-10-23T09:01:57+00:00" }, { @@ -2829,8 +4618,109 @@ ], "description": "The classes contained within this repository extend the standard DOM to use exceptions at all occasions of errors instead of PHP warnings or notices. They also add various custom methods and shortcuts for convenience and to simplify the usage of DOM.", "homepage": "https://github.com/theseer/fDOMDocument", + "support": { + "issues": "https://github.com/theseer/fDOMDocument/issues", + "source": "https://github.com/theseer/fDOMDocument/tree/1.6.7" + }, "abandoned": true, "time": "2022-01-25T23:10:35+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9", + "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/master" + }, + "time": "2019-06-13T22:48:21+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.9.1", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", + "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0 || ^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<3.9.1" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36 || ^7.5.13" + }, + "type": "library", + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.9.1" + }, + "time": "2020-07-08T17:02:28+00:00" } ], "aliases": [], @@ -2842,5 +4732,5 @@ "php": ">=5.6.40" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.2.0" } From d361c4eb26ba660c98f6ab3f1b92fe315726c04b Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Fri, 5 May 2023 15:47:23 +0200 Subject: [PATCH 072/263] use img-thumbnail css class instead of rounded circle --- public/css/components/searchbar.css | 1 + public/js/components/searchbar/employee.js | 2 +- public/js/components/searchbar/person.js | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/public/css/components/searchbar.css b/public/css/components/searchbar.css index 506612dbb..cecda1ff6 100644 --- a/public/css/components/searchbar.css +++ b/public/css/components/searchbar.css @@ -33,6 +33,7 @@ .searchbar_icon { grid-column-start: icon; grid-column-end: span 1; + margin-right: .75em; } .searchbar_data { diff --git a/public/js/components/searchbar/employee.js b/public/js/components/searchbar/employee.js index 3cf3a1350..1de7a5014 100644 --- a/public/js/components/searchbar/employee.js +++ b/public/js/components/searchbar/employee.js @@ -15,7 +15,7 @@ export default {
+ class="img-thumbnail" height="100" />
diff --git a/public/js/components/searchbar/person.js b/public/js/components/searchbar/person.js index 19a884666..441e2089f 100644 --- a/public/js/components/searchbar/person.js +++ b/public/js/components/searchbar/person.js @@ -15,7 +15,7 @@ export default {
+ class="img-thumbnail" height="100" />
From 7045827450a15692e40aed7c3fc16c6746925b25 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 9 May 2023 16:14:01 +0200 Subject: [PATCH 073/263] bufix Urlaubsanspruch --- .../libraries/vertragsbestandteil/VertragsbestandteilLib.php | 1 + .../vertragsbestandteil/VertragsbestandteilUrlaubsanspruch.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php index 0928255ee..6df37263c 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php @@ -6,6 +6,7 @@ require_once __DIR__ . '/VertragsbestandteilStunden.php'; require_once __DIR__ . '/VertragsbestandteilFunktion.php'; require_once __DIR__ . '/VertragsbestandteilZeitaufzeichnung.php'; require_once __DIR__ . '/VertragsbestandteilKuendigungsfrist.php'; +require_once __DIR__ . '/VertragsbestandteilUrlaubsanspruch.php'; require_once __DIR__ . '/VertragsbestandteilFreitext.php'; require_once __DIR__ . '/VertragsbestandteilFactory.php'; diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch.php b/application/libraries/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch.php index 48c985afb..fde150317 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch.php @@ -72,7 +72,7 @@ EOTXT; ) ) )) ) { - $this->validationerrors[] = 'Arbeitgeberfrist muss eine Tagesanzahl im Bereich 1 bis 50 sein.'; + $this->validationerrors[] = 'Urlaubsanspruch muss eine Tagesanzahl im Bereich 1 bis 50 sein.'; } return parent::validate(); From 4786ff503a05a2fcef1adb00e2980ba80aa2fd83 Mon Sep 17 00:00:00 2001 From: Werner Masik Date: Tue, 9 May 2023 17:24:11 +0200 Subject: [PATCH 074/263] added organisation to current contract info --- .../models/vertragsbestandteil/Dienstverhaeltnis_model.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php b/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php index 00b2b764d..305f6620e 100644 --- a/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php +++ b/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php @@ -27,6 +27,8 @@ class Dienstverhaeltnis_model extends DB_Model tbl_mitarbeiter.fixangestellt, tbl_person.person_id, tbl_benutzer.alias, + org.oe_kurzbz, + org.bezeichnung oe_bezeichnung, dv.von, dv.bis, dv.vertragsart_kurzbz, @@ -36,6 +38,7 @@ class Dienstverhaeltnis_model extends DB_Model JOIN tbl_benutzer ON tbl_mitarbeiter.mitarbeiter_uid::text = tbl_benutzer.uid::text JOIN tbl_person USING (person_id) JOIN hr.tbl_dienstverhaeltnis dv ON(tbl_benutzer.uid::text = dv.mitarbeiter_uid::text) + JOIN public.tbl_organisationseinheit org USING(oe_kurzbz) WHERE tbl_benutzer.uid=? ORDER BY dv.von desc "; From cd66397740a2cdea2f122f244a4bdaabc7c1b713 Mon Sep 17 00:00:00 2001 From: Werner Masik Date: Tue, 16 May 2023 10:03:50 +0200 Subject: [PATCH 075/263] add current date to DV selection query --- .../Dienstverhaeltnis_model.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php b/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php index 305f6620e..5544aa6d9 100644 --- a/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php +++ b/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php @@ -48,8 +48,12 @@ class Dienstverhaeltnis_model extends DB_Model } - public function getCurrentDVByPersonUID($uid) + public function getCurrentDVByPersonUID($uid, $dateAsUnixTS) { + + $date = DateTime::createFromFormat( 'U', $dateAsUnixTS ); + $datestring = $date->format("Y-m-d"); + $qry = " SELECT dv.dienstverhaeltnis_id, @@ -61,19 +65,19 @@ class Dienstverhaeltnis_model extends DB_Model tbl_person.person_id, tbl_benutzer.alias, dv.von, - dv.bis, - dv.vertragsart_kurzbz, + dv.bis, + dv.vertragsart_kurzbz, dv.updateamum, dv.updatevon FROM tbl_mitarbeiter JOIN tbl_benutzer ON tbl_mitarbeiter.mitarbeiter_uid::text = tbl_benutzer.uid::text JOIN tbl_person USING (person_id) JOIN hr.tbl_dienstverhaeltnis dv ON(tbl_benutzer.uid::text = dv.mitarbeiter_uid::text) - WHERE tbl_benutzer.uid=? and (dv.von<=CURRENT_DATE::text::date and (dv.bis is null OR dv.bis>=CURRENT_DATE::text::date)) + WHERE tbl_benutzer.uid=? and (dv.von<=? and (dv.bis is null OR dv.bis>=?)) ORDER BY dv.von desc "; - return $this->execQuery($qry, array($uid)); + return $this->execQuery($qry, array($uid, $datestring, $datestring)); } public function isOverlappingExistingDV($mitarbeiter_uid, $oe_kurzbz, $von, $bis) From 394091283074bd0429ae94a2dd55d2aa2ad6b789 Mon Sep 17 00:00:00 2001 From: Werner Masik Date: Tue, 16 May 2023 10:04:56 +0200 Subject: [PATCH 076/263] fix attribute name valorisieren to valorisierung --- .../models/vertragsbestandteil/Gehaltsbestandteil_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php b/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php index fcee5257a..a7fecedc9 100644 --- a/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php +++ b/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php @@ -38,7 +38,7 @@ class Gehaltsbestandteil_model extends DB_Model implements IEncryption dienstverhaeltnis_id, gehaltstyp_kurzbz, valorisierungssperre, - valorisieren, + gbt.valorisierung, grundbetrag, betrag_valorisiert, gt.bezeichnung as gehaltstyp_bezeichnung From a198a740f48f6f223ba7a51ef4a11af8a06722ad Mon Sep 17 00:00:00 2001 From: Werner Masik Date: Tue, 16 May 2023 17:04:37 +0200 Subject: [PATCH 077/263] fix json_serialize --- .../libraries/vertragsbestandteil/Vertragsbestandteil.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/libraries/vertragsbestandteil/Vertragsbestandteil.php b/application/libraries/vertragsbestandteil/Vertragsbestandteil.php index 04a8161c4..73e2bcd8d 100644 --- a/application/libraries/vertragsbestandteil/Vertragsbestandteil.php +++ b/application/libraries/vertragsbestandteil/Vertragsbestandteil.php @@ -184,7 +184,9 @@ abstract class Vertragsbestandteil implements \JsonSerializable, IValidation public function jsonSerialize() { - return get_object_vars($this); + $vars = get_object_vars($this); + unset($vars['CI']); + return $vars; } public function __toString() From 24bf2f95a2ccfe069d69846fe782d0c25b89def0 Mon Sep 17 00:00:00 2001 From: Werner Masik Date: Tue, 16 May 2023 17:05:49 +0200 Subject: [PATCH 078/263] update vertragsbestandteile --- .../VertragsbestandteilFreitext.php | 1 + .../VertragsbestandteilFunktion.php | 19 ++++ .../Gehaltsbestandteil_model.php | 24 +++- .../Vertragsbestandteil_model.php | 105 +++++++++--------- 4 files changed, 94 insertions(+), 55 deletions(-) diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilFreitext.php b/application/libraries/vertragsbestandteil/VertragsbestandteilFreitext.php index e79254e85..eb6d84350 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilFreitext.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilFreitext.php @@ -21,6 +21,7 @@ class VertragsbestandteilFreitext extends Vertragsbestandteil { parent::hydrateByStdClass($data); isset($data->freitexttyp) && $this->setFreitexttypKurzbz($data->freitexttyp); + isset($data->freitexttyp_kurzbz) && $this->setFreitexttypKurzbz($data->freitexttyp_kurzbz); isset($data->titel) && $this->setTitel($data->titel); isset($data->freitext) && $this->setAnmerkung($data->freitext); } diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php b/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php index 846e3e671..727d2b548 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php @@ -73,8 +73,11 @@ EOTXT; { parent::hydrateByStdClass($data); isset($data->benutzerfunktionid) && $this->setBenutzerfunktion_id($data->benutzerfunktionid); + isset($data->benutzerfunktion_id) && $this->setBenutzerfunktion_id($data->benutzerfunktion_id); isset($data->funktion) && isset($data->orget) && isset($data->mitarbeiter_uid) && $this->createBenutzerfunktionData($data); + isset($data->funktion_bezeichnung) && isset($data->oe_bezeichnung) + && $this->createBenutzerfunktionData4Display($data); } @@ -106,6 +109,22 @@ EOTXT; 'insertvon' => getAuthUID() ); } + + protected function createBenutzerfunktionData4Display($data) + { + if( empty($data->funktion_bezeichnung) || empty($data->oe_bezeichnung) ) + { + return; + } + + $this->benutzerfunktiondata = (object) array( + 'funktion_kurzbz' => $data->funktion_kurzbz, + 'funktion_bezeichnung' => $data->funktion_bezeichnung, + 'oe_kurzbz' => $data->oe_kurzbz, + 'oe_bezeichnung' => $data->oe_bezeichnung, + 'oe_kurzbz_sap' => $data->oe_kurzbz_sap + ); + } public function validate() { diff --git a/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php b/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php index a7fecedc9..8236867ba 100644 --- a/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php +++ b/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php @@ -28,7 +28,7 @@ class Gehaltsbestandteil_model extends DB_Model implements IEncryption } public function getCurrentGBTByDV($dienstverhaeltnis_id) - { + {/* $qry = " SELECT gehaltsbestandteil_id, @@ -39,13 +39,31 @@ class Gehaltsbestandteil_model extends DB_Model implements IEncryption gehaltstyp_kurzbz, valorisierungssperre, gbt.valorisierung, - grundbetrag, - betrag_valorisiert, + grundbetrag as grund_betrag_decrypted, + betrag_valorisiert as betrag_val_decrypted, gt.bezeichnung as gehaltstyp_bezeichnung FROM hr.tbl_gehaltsbestandteil gbt JOIN hr.tbl_gehaltstyp gt using(gehaltstyp_kurzbz) WHERE gbt.dienstverhaeltnis_id=? AND (gbt.von<=CURRENT_DATE::text::date and (gbt.bis is null OR gbt.bis>=CURRENT_DATE::text::date)) ORDER BY gt.sort + "; */ + + $qry = " + SELECT + gehaltsbestandteil_id, + von, + bis, + anmerkung, + dienstverhaeltnis_id, + gehaltstyp_kurzbz, + valorisierungssperre, + gbt.valorisierung, + grundbetrag as grund_betrag_decrypted, + betrag_valorisiert as betrag_val_decrypted, + gt.bezeichnung as gehaltstyp_bezeichnung + FROM hr.tbl_gehaltsbestandteil gbt JOIN hr.tbl_gehaltstyp gt using(gehaltstyp_kurzbz) + WHERE gbt.dienstverhaeltnis_id=? + ORDER BY gt.sort "; return $this->execQuery($qry, array($dienstverhaeltnis_id), $this->getEncryptedColumns()); diff --git a/application/models/vertragsbestandteil/Vertragsbestandteil_model.php b/application/models/vertragsbestandteil/Vertragsbestandteil_model.php index 74a3e6964..2c6273c8b 100644 --- a/application/models/vertragsbestandteil/Vertragsbestandteil_model.php +++ b/application/models/vertragsbestandteil/Vertragsbestandteil_model.php @@ -17,6 +17,48 @@ class Vertragsbestandteil_model extends DB_Model $this->pk = 'vertragsbestandteil_id'; } + protected function getVertragsbestandteilSQL() + { + $sql = <<getVertragsbestandteilSQL()} WHERE v.dienstverhaeltnis_id = {$this->escape($dienstverhaeltnis_id)} {$stichtagclause} @@ -61,10 +79,16 @@ class Vertragsbestandteil_model extends DB_Model EOSQL; // echo $sql . "\n\n"; - $query = $this->db->query($sql); // TODO add decryption + $query = $this->execReadOnlyQuery($sql); // TODO add decryption + $data = getData($query); + + if ($data == null) + { + return array(); + } $vertragsbestandteile = array(); - foreach( $query->result() as $row ) { + foreach( $data as $row ) { try { $vertragsbestandteile[] = VertragsbestandteilFactory::getVertragsbestandteil($row); @@ -75,6 +99,7 @@ EOSQL; } } + $dummy = json_encode($vertragsbestandteile); return $vertragsbestandteile; } @@ -83,31 +108,7 @@ EOSQL; { $sql = <<getVertragsbestandteilSQL()} WHERE v.vertragsbestandteil_id = {$this->escape($id)} ; From 5f198114f7dd2a522b316b739cb7c6594a8383ee Mon Sep 17 00:00:00 2001 From: Werner Masik Date: Tue, 23 May 2023 17:03:13 +0200 Subject: [PATCH 079/263] added popperjs because bootstrap5 requires it --- application/views/templates/FHC-Footer.php | 6 +++++- composer.json | 12 ++++++++++++ composer.lock | 9 +++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/application/views/templates/FHC-Footer.php b/application/views/templates/FHC-Footer.php index 272dd5542..8c0b8a4e9 100644 --- a/application/views/templates/FHC-Footer.php +++ b/application/views/templates/FHC-Footer.php @@ -60,7 +60,11 @@ if ($bootstrap3 === true) generateJSsInclude('vendor/twbs/bootstrap3/dist/js/bootstrap.min.js'); // Bootstrap 5 JS - if ($bootstrap5 === true) generateJSsInclude('vendor/twbs/bootstrap5/dist/js/bootstrap.min.js'); + if ($bootstrap5 === true) + { + generateJSsInclude('vendor/popperjs/popperjs2/core@2'); + generateJSsInclude('vendor/twbs/bootstrap5/dist/js/bootstrap.min.js'); + } // Moment JS if ($momentjs2 === true) diff --git a/composer.json b/composer.json index 229b83a98..42b6bfad9 100644 --- a/composer.json +++ b/composer.json @@ -326,6 +326,17 @@ } } }, + { + "type": "package", + "package": { + "name": "popperjs/popperjs2", + "version": "2.11.6", + "dist": { + "url": "https://unpkg.com/@popperjs/core@2", + "type": "file" + } + } + }, { "type": "package", "package": { @@ -440,6 +451,7 @@ "tomazdragar/simplecropper": "1.0", "twbs/bootstrap3": "3.4.*", "twbs/bootstrap5": "5.1.*", + "popperjs/popperjs2": "2.11.*", "vuejs/vuejs3": "3.2.33", "vuejs/vuerouter4": "4.1.3", diff --git a/composer.lock b/composer.lock index ad715f642..1a0916853 100644 --- a/composer.lock +++ b/composer.lock @@ -1780,6 +1780,15 @@ }, "type": "library" }, + { + "name": "popperjs/popperjs2", + "version": "2.11.6", + "dist": { + "type": "file", + "url": "https://unpkg.com/@popperjs/core@2" + }, + "type": "library" + }, { "name": "twig/twig", "version": "v1.42.5", From f6f2defc8c6fa9587dbbc1680bae95965d5595e1 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Tue, 23 May 2023 18:48:18 +0200 Subject: [PATCH 080/263] Bismeldestichtag: added table --- system/dbupdate_3.4.php | 2 + ...student_status_nach_bismeldung_sperren.php | 39 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 system/dbupdate_3.4/29144_prestudent_status_nach_bismeldung_sperren.php diff --git a/system/dbupdate_3.4.php b/system/dbupdate_3.4.php index 679c21b87..01dd9ea8f 100644 --- a/system/dbupdate_3.4.php +++ b/system/dbupdate_3.4.php @@ -37,6 +37,7 @@ require_once('dbupdate_3.4/10001_tempus_mitarbeiter_kurzbz_bei_reservierungen_an require_once('dbupdate_3.4/27949_infocenter_zurueckstellen_mit_grund.php'); require_once('dbupdate_3.4/27107_vilesci_erfassung_abwesenheiten_reinigung.php'); require_once('dbupdate_3.4/24913_tabelle_raumtyp_neues_attribut_aktiv.php'); +require_once('dbupdate_3.4/29144_prestudent_status_nach_bismeldung_sperren.php'); // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

Pruefe Tabellen und Attribute!

'; @@ -55,6 +56,7 @@ $tabellen=array( "bis.tbl_bisfunktion" => array("bisverwendung_id","studiengang_kz","sws","updateamum","updatevon","insertamum","insertvon","ext_id"), "bis.tbl_bisio" => array("bisio_id","mobilitaetsprogramm_code","nation_code","von","bis","zweck_code","student_uid","updateamum","updatevon","insertamum","insertvon","ext_id","ort","universitaet","lehreinheit_id","ects_erworben","ects_angerechnet","herkunftsland_code"), "bis.tbl_bisio_zweck" => array("bisio_id","zweck_code"), + "bis.tbl_bismeldestichtag" => array("studiensemester_kurzbz","meldestichtag"), "bis.tbl_bisstandort" => array("standort_code","bezeichnung","aktiv","insertamum","insertvon","updateamum","updatevon"), "bis.tbl_bisverwendung" => array("bisverwendung_id","ba1code","ba2code","vertragsstunden","beschausmasscode","verwendung_code","mitarbeiter_uid","hauptberufcode","hauptberuflich","habilitation","beginn","ende","updateamum","updatevon","insertamum","insertvon","ext_id","dv_art","inkludierte_lehre","zeitaufzeichnungspflichtig","azgrelevant", "homeoffice"), "bis.tbl_bundesland" => array("bundesland_code","kurzbz","bezeichnung"), diff --git a/system/dbupdate_3.4/29144_prestudent_status_nach_bismeldung_sperren.php b/system/dbupdate_3.4/29144_prestudent_status_nach_bismeldung_sperren.php new file mode 100644 index 000000000..0d5819c49 --- /dev/null +++ b/system/dbupdate_3.4/29144_prestudent_status_nach_bismeldung_sperren.php @@ -0,0 +1,39 @@ +db_query('SELECT 1 FROM bis.tbl_bismeldestichtag LIMIT 1')) +{ + $qry = 'CREATE TABLE bis.tbl_bismeldestichtag ( + studiensemester_kurzbz varchar(16), + meldestichtag date NOT NULL, + insertamum timestamp DEFAULT NOW(), + insertvon varchar(32), + updateamum timestamp, + updatevon varchar(32) + ); + + COMMENT ON TABLE bis.tbl_bismeldestichtag IS \'Deadline Dates for BIS reporting\'; + + ALTER TABLE bis.tbl_bismeldestichtag ADD CONSTRAINT pk_bismeldestichtag PRIMARY KEY (studiensemester_kurzbz); + + ALTER TABLE bis.tbl_bismeldestichtag ADD CONSTRAINT fk_bismeldestichtag_studiensemester_kurzbz FOREIGN KEY (studiensemester_kurzbz) REFERENCES public.tbl_studiensemester(studiensemester_kurzbz) ON UPDATE CASCADE ON DELETE RESTRICT;'; + + if (!$db->db_query($qry)) + echo 'bis.tbl_bismeldestichtag: '.$db->db_last_error().'
'; + else + echo '
bis.tbl_bismeldestichtag table created'; + + $qry = 'GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE bis.tbl_bismeldestichtag TO web;'; + if (!$db->db_query($qry)) + echo 'bis.tbl_bismeldestichtag: '.$db->db_last_error().'
'; + else + echo '
Granted privileges to web on bis.tbl_bismeldestichtag'; + + $qry = 'GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE bis.tbl_bismeldestichtag TO vilesci;'; + if (!$db->db_query($qry)) + echo 'bis.tbl_bismeldestichtag: '.$db->db_last_error().'
'; + else + echo '
Granted privileges to vilesci on bis.tbl_bismeldestichtag'; +} From 38509d530aa90db203f1b39c6557787e0aab0ea1 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Wed, 24 May 2023 17:54:04 +0200 Subject: [PATCH 081/263] prepare list of vbs with gbs --- .../Gehaltsbestandteil.php | 9 +++++- .../Vertragsbestandteil.php | 6 ++++ .../VertragsbestandteilLib.php | 26 +++++++++++++++- .../Gehaltsbestandteil_model.php | 30 +++++++++---------- .../Vertragsbestandteil_model.php | 10 +++++-- 5 files changed, 62 insertions(+), 19 deletions(-) diff --git a/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php b/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php index 130c18547..f48a969c8 100644 --- a/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php +++ b/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php @@ -4,7 +4,7 @@ namespace vertragsbestandteil; /** * Salary always depends on employment (Dienstverhältnis) and optionally on part of contract (Vetragsbestandteil) */ -class Gehaltsbestandteil implements IValidation +class Gehaltsbestandteil implements IValidation, \JsonSerializable { protected $gehaltsbestandteil_id; protected $dienstverhaeltnis_id; @@ -230,6 +230,13 @@ class Gehaltsbestandteil implements IValidation return $this; } + public function jsonSerialize() + { + $vars = get_object_vars($this); + unset($vars['CI']); + return $vars; + } + public function toStdClass(): \stdClass { $tmp = array( diff --git a/application/libraries/vertragsbestandteil/Vertragsbestandteil.php b/application/libraries/vertragsbestandteil/Vertragsbestandteil.php index 73e2bcd8d..ffda62e08 100644 --- a/application/libraries/vertragsbestandteil/Vertragsbestandteil.php +++ b/application/libraries/vertragsbestandteil/Vertragsbestandteil.php @@ -100,6 +100,12 @@ abstract class Vertragsbestandteil implements \JsonSerializable, IValidation return $this->updatevon; } + public function setGehaltsbestandteile($gehaltsbestandteile) + { + $this->gehaltsbestandteile = $gehaltsbestandteile; + return $this; + } + public function setVertragsbestandteil_id($vertragsbestandteil_id) { $this->vertragsbestandteil_id = $vertragsbestandteil_id; diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php index 6df37263c..d47b89342 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php @@ -76,7 +76,31 @@ class VertragsbestandteilLib public function fetchVertragsbestandteile($dienstverhaeltnis_id, $stichtag=null) { - return $this->VertragsbestandteilModel->getVertragsbestandteile($dienstverhaeltnis_id, $stichtag); + $vbs = $this->VertragsbestandteilModel->getVertragsbestandteile($dienstverhaeltnis_id, $stichtag); + $gbs = $this->GehaltsbestandteilLib->fetchGehaltsbestandteile($dienstverhaeltnis_id, $stichtag); + + $gbsByVBid = array(); + foreach( $gbs as $gb ) + { + if( intval($gb->getVertragsbestandteil_id()) > 0 ) + { + if( !isset($gbsByVBid[$gb->getVertragsbestandteil_id()]) + || !is_array($gbsByVBid[$gb->getVertragsbestandteil_id()]) ) { + $gbsByVBid[$gb->getVertragsbestandteil_id()] = array(); + } + $gbsByVBid[$gb->getVertragsbestandteil_id()][] = $gb; + } + } + + foreach ($vbs as $vb) + { + if( isset($gbsByVBid[$vb->getVertragsbestandteil_id()]) ) + { + $vb->setGehaltsbestandteile($gbsByVBid[$vb->getVertragsbestandteil_id()]); + } + } + + return $vbs; } public function fetchVertragsbestandteil($vertragsbestandteil_id) diff --git a/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php b/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php index 8236867ba..e3da82766 100644 --- a/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php +++ b/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php @@ -69,31 +69,31 @@ class Gehaltsbestandteil_model extends DB_Model implements IEncryption return $this->execQuery($qry, array($dienstverhaeltnis_id), $this->getEncryptedColumns()); } - public function getGehaltsbestandteile($dienstverhaeltnis_id=1, $stichtag=null) + public function getGehaltsbestandteile($dienstverhaeltnis_id, $stichtag=null, $includefuture=false) { $stichtagclause = ''; if( !is_null($stichtag) ) { $date = strftime('%Y-%m-%d', strtotime($stichtag)); - $stichtagclause = 'AND ' . $this->escape($date) - . ' BETWEEN COALESCE(v.von, \'1970-01-01\'::date)' - . ' AND COALESCE(v.bis, \'2170-01-01\'::date)'; + $stichtagclause = 'AND (' . $this->escape($date) + . ' BETWEEN COALESCE(von, \'1970-01-01\'::date)' + . ' AND COALESCE(bis, \'2170-01-01\'::date)'; + if( $includefuture ) + { + $stichtagclause .= ' OR COALESCE(v.von, \'1970-01-01\'::date) > ' + . $this->escape($date); + } + $stichtagclause .= ')'; } - $sql = <<addSelect('*'); + $where = <<escape($dienstverhaeltnis_id)} {$stichtagclause} - ; EOSQL; - $query = $this->execReadOnlyQuery( - $query, - array($dienstverhaeltnis_id), + $query = $this->loadWhere( + $where, $this->getEncryptedColumns() ); diff --git a/application/models/vertragsbestandteil/Vertragsbestandteil_model.php b/application/models/vertragsbestandteil/Vertragsbestandteil_model.php index 2c6273c8b..913fd6c34 100644 --- a/application/models/vertragsbestandteil/Vertragsbestandteil_model.php +++ b/application/models/vertragsbestandteil/Vertragsbestandteil_model.php @@ -59,15 +59,21 @@ EOSQL; return $sql; } - public function getVertragsbestandteile($dienstverhaeltnis_id=1, $stichtag=null) + public function getVertragsbestandteile($dienstverhaeltnis_id, $stichtag=null, $includefuture=false) { $stichtagclause = ''; if( !is_null($stichtag) ) { $date = strftime('%Y-%m-%d', strtotime($stichtag)); - $stichtagclause = 'AND ' . $this->escape($date) + $stichtagclause = 'AND (' . $this->escape($date) . ' BETWEEN COALESCE(v.von, \'1970-01-01\'::date)' . ' AND COALESCE(v.bis, \'2170-01-01\'::date)'; + if( $includefuture ) + { + $stichtagclause .= ' OR COALESCE(v.von, \'1970-01-01\'::date) > ' + . $this->escape($date); + } + $stichtagclause .= ')'; } $sql = << Date: Thu, 25 May 2023 11:08:37 +0200 Subject: [PATCH 082/263] remover popper from composer.lock --- composer.lock | 1074 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 767 insertions(+), 307 deletions(-) diff --git a/composer.lock b/composer.lock index 1a0916853..553dcaee0 100644 --- a/composer.lock +++ b/composer.lock @@ -1648,20 +1648,23 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.19.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "aed596913b70fae57be53d86faa2e9ef85a2297b" + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/aed596913b70fae57be53d86faa2e9ef85a2297b", - "reference": "aed596913b70fae57be53d86faa2e9ef85a2297b", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" }, "suggest": { "ext-ctype": "For best performance" @@ -1669,7 +1672,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.19-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1707,7 +1710,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.19.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" }, "funding": [ { @@ -1723,7 +1726,7 @@ "type": "tidelift" } ], - "time": "2020-10-23T09:01:57+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "tapmodo/jcrop", @@ -1780,41 +1783,32 @@ }, "type": "library" }, - { - "name": "popperjs/popperjs2", - "version": "2.11.6", - "dist": { - "type": "file", - "url": "https://unpkg.com/@popperjs/core@2" - }, - "type": "library" - }, { "name": "twig/twig", - "version": "v1.42.5", + "version": "v1.44.7", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "87b2ea9d8f6fd014d0621ca089bb1b3769ea3f8e" + "reference": "0887422319889e442458e48e2f3d9add1a172ad5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/87b2ea9d8f6fd014d0621ca089bb1b3769ea3f8e", - "reference": "87b2ea9d8f6fd014d0621ca089bb1b3769ea3f8e", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/0887422319889e442458e48e2f3d9add1a172ad5", + "reference": "0887422319889e442458e48e2f3d9add1a172ad5", "shasum": "" }, "require": { - "php": ">=5.5.0", + "php": ">=7.2.5", "symfony/polyfill-ctype": "^1.8" }, "require-dev": { "psr/container": "^1.0", - "symfony/phpunit-bridge": "^4.4|^5.0" + "symfony/phpunit-bridge": "^4.4.9|^5.0.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.42-dev" + "dev-master": "1.44-dev" } }, "autoload": { @@ -1853,9 +1847,19 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/1.x" + "source": "https://github.com/twigphp/Twig/tree/v1.44.7" }, - "time": "2020-02-11T05:59:23+00:00" + "funding": [ + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/twig/twig", + "type": "tidelift" + } + ], + "time": "2022-09-28T08:38:36+00:00" }, { "name": "vuejs/vuedatepicker_css", @@ -1897,30 +1901,30 @@ "packages-dev": [ { "name": "composer/pcre", - "version": "1.0.1", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560" + "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/67a32d7d6f9f560b726ab25a061b38ff3a80c560", - "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560", + "url": "https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", + "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "phpstan/phpstan": "^1.3", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^4.2 || ^5" + "symfony/phpunit-bridge": "^5" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.x-dev" + "dev-main": "3.x-dev" } }, "autoload": { @@ -1948,7 +1952,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/1.0.1" + "source": "https://github.com/composer/pcre/tree/3.1.0" }, "funding": [ { @@ -1964,31 +1968,31 @@ "type": "tidelift" } ], - "time": "2022-01-21T20:24:37+00:00" + "time": "2022-11-17T09:50:14+00:00" }, { "name": "composer/xdebug-handler", - "version": "2.0.5", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "9e36aeed4616366d2b690bdce11f71e9178c579a" + "reference": "ced299686f41dce890debac69273b47ffe98a40c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/9e36aeed4616366d2b690bdce11f71e9178c579a", - "reference": "9e36aeed4616366d2b690bdce11f71e9178c579a", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", + "reference": "ced299686f41dce890debac69273b47ffe98a40c", "shasum": "" }, "require": { - "composer/pcre": "^1", - "php": "^5.3.2 || ^7.0 || ^8.0", + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", "psr/log": "^1 || ^2 || ^3" }, "require-dev": { "phpstan/phpstan": "^1.0", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0" + "symfony/phpunit-bridge": "^6.0" }, "type": "library", "autoload": { @@ -2014,7 +2018,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/2.0.5" + "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" }, "funding": [ { @@ -2030,38 +2034,79 @@ "type": "tidelift" } ], - "time": "2022-02-24T20:20:32+00:00" + "time": "2022-02-25T21:32:43+00:00" }, { - "name": "doctrine/instantiator", - "version": "1.0.5", + "name": "doctrine/deprecations", + "version": "v1.0.0", "source": { "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "url": "https://github.com/doctrine/deprecations.git", + "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1|^8.0" }, "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "doctrine/coding-standard": "^9", + "phpunit/phpunit": "^7.5|^8.5|^9.5", + "psr/log": "^1|^2|^3" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" } }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/v1.0.0" + }, + "time": "2022-05-02T15:47:09+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9 || ^11", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.16 || ^1", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.30 || ^5.4" + }, + "type": "library", "autoload": { "psr-4": { "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" @@ -2075,18 +2120,18 @@ { "name": "Marco Pivetta", "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" + "homepage": "https://ocramius.github.io/" } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", "keywords": [ "constructor", "instantiate" ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.0.5" + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" }, "funding": [ { @@ -2102,29 +2147,33 @@ "type": "tidelift" } ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2022-12-30T00:15:36+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.7.0", + "version": "1.11.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" }, "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^4.1" + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", "autoload": { @@ -2149,22 +2198,28 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.x" + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" }, - "time": "2017-10-19T19:58:43+00:00" + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2023-03-08T13:26:56+00:00" }, { "name": "nikic/php-parser", - "version": "v4.15.4", + "version": "v4.15.5", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290" + "reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6bb5176bc4af8bcb7d926f88718db9b96a2d4290", - "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/11e2663a5bc9db5d714eedb4277ee300403b4a9e", + "reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e", "shasum": "" }, "require": { @@ -2205,9 +2260,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.4" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.5" }, - "time": "2023-03-05T19:49:14+00:00" + "time": "2023-05-19T20:20:00+00:00" }, { "name": "pdepend/pdepend", @@ -2378,35 +2433,30 @@ }, { "name": "phpdocumentor/reflection-common", - "version": "1.0.1", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", "shasum": "" }, "require": { - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit": "^4.6" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-2.x": "2.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] + "phpDocumentor\\Reflection\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2430,47 +2480,44 @@ ], "support": { "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/master" + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" }, - "time": "2017-09-11T18:02:19+00:00" + "time": "2020-06-27T09:03:43+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.4", + "version": "5.3.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c" + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/da3fd972d6bafd628114f7e7e036f45944b62e9c", - "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", "shasum": "" }, "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0", - "phpdocumentor/type-resolver": "~0.4 || ^1.0.0", - "webmozart/assert": "^1.0" + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" }, "require-dev": { - "doctrine/instantiator": "^1.0.5", - "mockery/mockery": "^1.0", - "phpdocumentor/type-resolver": "0.4.*", - "phpunit/phpunit": "^6.4" + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.x-dev" + "dev-master": "5.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] + "phpDocumentor\\Reflection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -2481,41 +2528,53 @@ { "name": "Mike van Riel", "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/release/4.x" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" }, - "time": "2019-12-28T18:55:12+00:00" + "time": "2021-10-19T17:43:47+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.5.1", + "version": "1.7.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "cf842904952e64e703800d094cdf34e715a8a3ae" + "reference": "dfc078e8af9c99210337325ff5aa152872c98714" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/cf842904952e64e703800d094cdf34e715a8a3ae", - "reference": "cf842904952e64e703800d094cdf34e715a8a3ae", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/dfc078e8af9c99210337325ff5aa152872c98714", + "reference": "dfc078e8af9c99210337325ff5aa152872c98714", "shasum": "" }, "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0" + "doctrine/deprecations": "^1.0", + "php": "^7.4 || ^8.0", + "phpdocumentor/reflection-common": "^2.0", + "phpstan/phpdoc-parser": "^1.13" }, "require-dev": { - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^6.4" + "ext-tokenizer": "*", + "phpbench/phpbench": "^1.2", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^9.5", + "rector/rector": "^0.13.9", + "vimeo/psalm": "^4.25" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-1.x": "1.x-dev" } }, "autoload": { @@ -2533,11 +2592,12 @@ "email": "me@mikevanriel.com" } ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/master" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.1" }, - "time": "2017-12-30T13:23:38+00:00" + "time": "2023-03-27T19:02:04+00:00" }, { "name": "phpmd/phpmd", @@ -2757,6 +2817,52 @@ }, "time": "2020-03-05T15:02:03+00:00" }, + { + "name": "phpstan/phpdoc-parser", + "version": "1.21.0", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "6df62b08faef4f899772bc7c3bbabb93d2b7a21c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/6df62b08faef4f899772bc7c3bbabb93d2b7a21c", + "reference": "6df62b08faef4f899772bc7c3bbabb93d2b7a21c", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "nikic/php-parser": "^4.15", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.5", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "symfony/process": "^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "support": { + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.21.0" + }, + "time": "2023-05-17T13:13:44+00:00" + }, { "name": "phpunit/php-code-coverage", "version": "5.3.2", @@ -3182,27 +3288,22 @@ }, { "name": "psr/container", - "version": "1.0.0", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=7.4.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" @@ -3215,7 +3316,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common Container Interface (PHP FIG PSR-11)", @@ -3229,9 +3330,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/master" + "source": "https://github.com/php-fig/container/tree/1.1.2" }, - "time": "2017-02-14T16:28:37+00:00" + "time": "2021-11-05T16:50:12+00:00" }, { "name": "psr/log", @@ -3595,23 +3696,27 @@ }, { "name": "sebastian/finder-facade", - "version": "1.2.2", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/finder-facade.git", - "reference": "4a3174709c2dc565fe5fb26fcf827f6a1fc7b09f" + "reference": "167c45d131f7fc3d159f56f191a0a22228765e16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/finder-facade/zipball/4a3174709c2dc565fe5fb26fcf827f6a1fc7b09f", - "reference": "4a3174709c2dc565fe5fb26fcf827f6a1fc7b09f", + "url": "https://api.github.com/repos/sebastianbergmann/finder-facade/zipball/167c45d131f7fc3d159f56f191a0a22228765e16", + "reference": "167c45d131f7fc3d159f56f191a0a22228765e16", "shasum": "" }, "require": { - "symfony/finder": "~2.3|~3.0|~4.0", - "theseer/fdomdocument": "~1.3" + "php": "^7.1", + "symfony/finder": "^2.3|^3.0|^4.0|^5.0", + "theseer/fdomdocument": "^1.6" }, "type": "library", + "extra": { + "branch-alias": [] + }, "autoload": { "classmap": [ "src/" @@ -3632,10 +3737,10 @@ "homepage": "https://github.com/sebastianbergmann/finder-facade", "support": { "issues": "https://github.com/sebastianbergmann/finder-facade/issues", - "source": "https://github.com/sebastianbergmann/finder-facade/tree/master" + "source": "https://github.com/sebastianbergmann/finder-facade/tree/1.2" }, "abandoned": true, - "time": "2017-11-18T17:31:49+00:00" + "time": "2020-01-16T08:08:45+00:00" }, { "name": "sebastian/global-state", @@ -4073,32 +4178,35 @@ }, { "name": "symfony/config", - "version": "v3.4.47", + "version": "v5.4.21", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "bc6b3fd3930d4b53a60b42fe2ed6fc466b75f03f" + "reference": "2a6b1111d038adfa15d52c0871e540f3b352d1e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/bc6b3fd3930d4b53a60b42fe2ed6fc466b75f03f", - "reference": "bc6b3fd3930d4b53a60b42fe2ed6fc466b75f03f", + "url": "https://api.github.com/repos/symfony/config/zipball/2a6b1111d038adfa15d52c0871e540f3b352d1e4", + "reference": "2a6b1111d038adfa15d52c0871e540f3b352d1e4", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/filesystem": "~2.8|~3.0|~4.0", - "symfony/polyfill-ctype": "~1.8" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/filesystem": "^4.4|^5.0|^6.0", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-php80": "^1.16", + "symfony/polyfill-php81": "^1.22" }, "conflict": { - "symfony/dependency-injection": "<3.3", - "symfony/finder": "<3.3" + "symfony/finder": "<4.4" }, "require-dev": { - "symfony/dependency-injection": "~3.3|~4.0", - "symfony/event-dispatcher": "~3.3|~4.0", - "symfony/finder": "~3.3|~4.0", - "symfony/yaml": "~3.0|~4.0" + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", + "symfony/messenger": "^4.4|^5.0|^6.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/yaml": "^4.4|^5.0|^6.0" }, "suggest": { "symfony/yaml": "To use the yaml reference dumper" @@ -4126,10 +4234,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Config Component", + "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v3.4.47" + "source": "https://github.com/symfony/config/tree/v5.4.21" }, "funding": [ { @@ -4145,41 +4253,47 @@ "type": "tidelift" } ], - "time": "2020-10-24T10:57:07+00:00" + "time": "2023-02-14T08:03:56+00:00" }, { "name": "symfony/console", - "version": "v3.4.47", + "version": "v4.4.49", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "a10b1da6fc93080c180bba7219b5ff5b7518fe81" + "reference": "33fa45ffc81fdcc1ca368d4946da859c8cdb58d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a10b1da6fc93080c180bba7219b5ff5b7518fe81", - "reference": "a10b1da6fc93080c180bba7219b5ff5b7518fe81", + "url": "https://api.github.com/repos/symfony/console/zipball/33fa45ffc81fdcc1ca368d4946da859c8cdb58d9", + "reference": "33fa45ffc81fdcc1ca368d4946da859c8cdb58d9", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/debug": "~2.8|~3.0|~4.0", - "symfony/polyfill-mbstring": "~1.0" + "php": ">=7.1.3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.8", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2" }, "conflict": { + "psr/log": ">=3", "symfony/dependency-injection": "<3.4", + "symfony/event-dispatcher": "<4.3|>=5", + "symfony/lock": "<4.4", "symfony/process": "<3.3" }, "provide": { - "psr/log-implementation": "1.0" + "psr/log-implementation": "1.0|2.0" }, "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~3.3|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~2.8|~3.0|~4.0", - "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.3|~4.0" + "psr/log": "^1|^2", + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", + "symfony/event-dispatcher": "^4.3", + "symfony/lock": "^4.4|^5.0", + "symfony/process": "^3.4|^4.0|^5.0", + "symfony/var-dumper": "^4.3|^5.0" }, "suggest": { "psr/log": "For using the console logger", @@ -4210,10 +4324,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Console Component", + "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/console/tree/v3.4.47" + "source": "https://github.com/symfony/console/tree/v4.4.49" }, "funding": [ { @@ -4229,108 +4343,45 @@ "type": "tidelift" } ], - "time": "2020-10-24T10:57:07+00:00" - }, - { - "name": "symfony/debug", - "version": "v3.4.47", - "source": { - "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "ab42889de57fdfcfcc0759ab102e2fd4ea72dcae" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/ab42889de57fdfcfcc0759ab102e2fd4ea72dcae", - "reference": "ab42889de57fdfcfcc0759ab102e2fd4ea72dcae", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" - }, - "require-dev": { - "symfony/http-kernel": "~2.8|~3.0|~4.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Debug Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/debug/tree/v3.4.47" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "abandoned": "symfony/error-handler", - "time": "2020-10-24T10:57:07+00:00" + "time": "2022-11-05T17:10:16+00:00" }, { "name": "symfony/dependency-injection", - "version": "v3.4.47", + "version": "v5.4.23", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "51d2a2708c6ceadad84393f8581df1dcf9e5e84b" + "reference": "bb7b7988c898c94f5338e16403c52b5a3cae1d93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/51d2a2708c6ceadad84393f8581df1dcf9e5e84b", - "reference": "51d2a2708c6ceadad84393f8581df1dcf9e5e84b", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/bb7b7988c898c94f5338e16403c52b5a3cae1d93", + "reference": "bb7b7988c898c94f5338e16403c52b5a3cae1d93", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "psr/container": "^1.0" + "php": ">=7.2.5", + "psr/container": "^1.1.1", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16", + "symfony/polyfill-php81": "^1.22", + "symfony/service-contracts": "^1.1.6|^2" }, "conflict": { - "symfony/config": "<3.3.7", - "symfony/finder": "<3.3", - "symfony/proxy-manager-bridge": "<3.4", - "symfony/yaml": "<3.4" + "ext-psr": "<1.1|>=2", + "symfony/config": "<5.3", + "symfony/finder": "<4.4", + "symfony/proxy-manager-bridge": "<4.4", + "symfony/yaml": "<4.4.26" }, "provide": { - "psr/container-implementation": "1.0" + "psr/container-implementation": "1.0", + "symfony/service-implementation": "1.0|2.0" }, "require-dev": { - "symfony/config": "~3.3|~4.0", - "symfony/expression-language": "~2.8|~3.0|~4.0", - "symfony/yaml": "~3.4|~4.0" + "symfony/config": "^5.3|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/yaml": "^4.4.26|^5.0|^6.0" }, "suggest": { "symfony/config": "", @@ -4362,10 +4413,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony DependencyInjection Component", + "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v3.4.47" + "source": "https://github.com/symfony/dependency-injection/tree/v5.4.23" }, "funding": [ { @@ -4381,25 +4432,94 @@ "type": "tidelift" } ], - "time": "2020-10-24T10:57:07+00:00" + "time": "2023-04-21T15:04:16+00:00" }, { - "name": "symfony/filesystem", - "version": "v3.4.47", + "name": "symfony/deprecation-contracts", + "version": "v2.5.2", "source": { "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "e58d7841cddfed6e846829040dca2cca0ebbbbb3" + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/e58d7841cddfed6e846829040dca2cca0ebbbbb3", - "reference": "e58d7841cddfed6e846829040dca2cca0ebbbbb3", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-ctype": "~1.8" + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:53:40+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v5.4.23", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5", + "reference": "b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -4424,10 +4544,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Filesystem Component", + "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v3.4.47" + "source": "https://github.com/symfony/filesystem/tree/v5.4.23" }, "funding": [ { @@ -4443,24 +4563,26 @@ "type": "tidelift" } ], - "time": "2020-10-24T10:57:07+00:00" + "time": "2023-03-02T11:38:35+00:00" }, { "name": "symfony/finder", - "version": "v3.4.47", + "version": "v5.4.21", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "b6b6ad3db3edb1b4b1c1896b1975fb684994de6e" + "reference": "078e9a5e1871fcfe6a5ce421b539344c21afef19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/b6b6ad3db3edb1b4b1c1896b1975fb684994de6e", - "reference": "b6b6ad3db3edb1b4b1c1896b1975fb684994de6e", + "url": "https://api.github.com/repos/symfony/finder/zipball/078e9a5e1871fcfe6a5ce421b539344c21afef19", + "reference": "078e9a5e1871fcfe6a5ce421b539344c21afef19", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -4485,10 +4607,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Finder Component", + "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v3.4.47" + "source": "https://github.com/symfony/finder/tree/v5.4.21" }, "funding": [ { @@ -4504,24 +4626,27 @@ "type": "tidelift" } ], - "time": "2020-11-16T17:02:08+00:00" + "time": "2023-02-16T09:33:00+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.19.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "b5f7b932ee6fa802fc792eabd77c4c88084517ce" + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b5f7b932ee6fa802fc792eabd77c4c88084517ce", - "reference": "b5f7b932ee6fa802fc792eabd77c4c88084517ce", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" }, "suggest": { "ext-mbstring": "For best performance" @@ -4529,7 +4654,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.19-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4568,7 +4693,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.19.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" }, "funding": [ { @@ -4584,7 +4709,331 @@ "type": "tidelift" } ], - "time": "2020-10-23T09:01:57+00:00" + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9", + "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a", + "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v2.5.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c", + "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.1", + "symfony/deprecation-contracts": "^2.1|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v2.5.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-05-30T19:17:29+00:00" }, { "name": "theseer/fdomdocument", @@ -4636,23 +5085,23 @@ }, { "name": "theseer/tokenizer", - "version": "1.1.3", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9" + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9", - "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", "shasum": "" }, "require": { "ext-dom": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", - "php": "^7.0" + "php": "^7.2 || ^8.0" }, "type": "library", "autoload": { @@ -4674,36 +5123,47 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/master" + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" }, - "time": "2019-06-13T22:48:21+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2021-07-28T10:34:58+00:00" }, { "name": "webmozart/assert", - "version": "1.9.1", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0 || ^8.0", - "symfony/polyfill-ctype": "^1.8" + "ext-ctype": "*", + "php": "^7.2 || ^8.0" }, "conflict": { "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<3.9.1" + "vimeo/psalm": "<4.6.1 || 4.6.2" }, "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" + "phpunit/phpunit": "^8.5.13" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -4727,9 +5187,9 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.9.1" + "source": "https://github.com/webmozarts/assert/tree/1.11.0" }, - "time": "2020-07-08T17:02:28+00:00" + "time": "2022-06-03T18:03:27+00:00" } ], "aliases": [], @@ -4741,5 +5201,5 @@ "php": ">=5.6.40" }, "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.1.0" } From b9e9399ca21edfc2cc7e1abbac721e7ae0887055 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 25 May 2023 12:12:37 +0200 Subject: [PATCH 083/263] Adapted: Icon-Layout in Vertical Split . etwas vergroessert um besser mit der Maus zu greifen . Icon und Icon-Farbe geaendert --- public/css/components/verticalsplit.css | 2 +- public/js/components/verticalsplit/verticalsplit.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/css/components/verticalsplit.css b/public/css/components/verticalsplit.css index b4185c5a3..8d8599ec4 100644 --- a/public/css/components/verticalsplit.css +++ b/public/css/components/verticalsplit.css @@ -41,7 +41,7 @@ .splitaction { display: inline-block; - width: 25px; + width: 42px; cursor: pointer; } diff --git a/public/js/components/verticalsplit/verticalsplit.js b/public/js/components/verticalsplit/verticalsplit.js index 746229ea9..53a1833fb 100644 --- a/public/js/components/verticalsplit/verticalsplit.js +++ b/public/js/components/verticalsplit/verticalsplit.js @@ -23,13 +23,13 @@ export default { :class="this.topOrBottomClass" @mousedown="this.dragStart">
- + - + - +
From 542b6cc98597868aa11d9dfaecb15a1266d69321 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 25 May 2023 12:13:40 +0200 Subject: [PATCH 084/263] Adapted: Image-Thumbnails entfernt Stattdessen class 'rounded'. Passt besser zu FHC CD. --- public/js/components/searchbar/employee.js | 2 +- public/js/components/searchbar/person.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/js/components/searchbar/employee.js b/public/js/components/searchbar/employee.js index 1de7a5014..333cf0224 100644 --- a/public/js/components/searchbar/employee.js +++ b/public/js/components/searchbar/employee.js @@ -15,7 +15,7 @@ export default {
+ class="rounded" height="120" />
diff --git a/public/js/components/searchbar/person.js b/public/js/components/searchbar/person.js index 441e2089f..ca7229185 100644 --- a/public/js/components/searchbar/person.js +++ b/public/js/components/searchbar/person.js @@ -15,7 +15,7 @@ export default {
+ class="rounded" height="120" />
From f08072133c2fa2c1ce9aa05272d13a57070f693a Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 25 May 2023 12:15:24 +0200 Subject: [PATCH 085/263] Fixed: Suchcontainer nicht mehr verschoben Groesse und Alignment an Suchfeld gebunden. --- public/css/components/searchbar.css | 8 ++++++-- public/js/components/searchbar/searchbar.js | 7 ++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/public/css/components/searchbar.css b/public/css/components/searchbar.css index cecda1ff6..2bbaf9d67 100644 --- a/public/css/components/searchbar.css +++ b/public/css/components/searchbar.css @@ -15,13 +15,17 @@ position: absolute; z-index: 9998; background-color: #fff; - border: 2px solid #666; + border: 1px solid lightgrey; padding: 1rem; overflow-y: auto; + top: 100%; + width: 100%; + left: 0; + right: 0; } .searchbar_result { - border-bottom: 1px solid #666; + border-bottom: 1px solid lightgrey; margin-bottom: 1rem; } diff --git a/public/js/components/searchbar/searchbar.js b/public/js/components/searchbar/searchbar.js index 7c0993e8a..c46f87839 100644 --- a/public/js/components/searchbar/searchbar.js +++ b/public/js/components/searchbar/searchbar.js @@ -27,7 +27,7 @@ export default { organisationunit: organisationunit }, template: ` -
Date: Thu, 25 May 2023 12:17:06 +0200 Subject: [PATCH 086/263] Minor Adaptation: Suche statt Search, Settings button Layout korrigiert --- public/js/components/searchbar/searchbar.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/js/components/searchbar/searchbar.js b/public/js/components/searchbar/searchbar.js index c46f87839..155ea495b 100644 --- a/public/js/components/searchbar/searchbar.js +++ b/public/js/components/searchbar/searchbar.js @@ -31,9 +31,9 @@ export default { @focusin="this.searchfocusin" @focusout="this.searchfocusout">
- + v-model="this.searchsettings.searchstr" class="form-control" + type="search" placeholder="Suche..." aria-label="Search"> +
Date: Thu, 25 May 2023 15:47:16 +0200 Subject: [PATCH 087/263] adapt overlapping DVs Check to not consider current DV if edited, but consider karenzen --- .../VertragsbestandteilLib.php | 3 ++- .../Dienstverhaeltnis_model.php | 23 ++++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php index d47b89342..535a9f137 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php @@ -254,7 +254,8 @@ class VertragsbestandteilLib $dv->getMitarbeiter_uid(), $dv->getOe_kurzbz(), $dv->getVon(), - $dv->getBis() + $dv->getBis(), + $dv->getDienstverhaeltnis_id() ); } } diff --git a/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php b/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php index 5544aa6d9..97d6c9b94 100644 --- a/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php +++ b/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php @@ -80,8 +80,10 @@ class Dienstverhaeltnis_model extends DB_Model return $this->execQuery($qry, array($uid, $datestring, $datestring)); } - public function isOverlappingExistingDV($mitarbeiter_uid, $oe_kurzbz, $von, $bis) + public function isOverlappingExistingDV($mitarbeiter_uid, $oe_kurzbz, $von, $bis, $dvid=null) { + $dvidclause = (intval($dvid) > 0) ? 'AND dv.dienstverhaeltnis_id != ' . $dvid : ''; + $query = <<= dv.von + COALESCE(?::date, '2170-12-31'::date) >= dv.von + AND ( + SELECT + COUNT(*) AS karenzen + FROM + hr.tbl_vertragsbestandteil vb + WHERE + vb.dienstverhaeltnis_id = dv.dienstverhaeltnis_id + AND + vb.vertragsbestandteiltyp_kurzbz = 'karenz' + AND + ?::date >= COALESCE(vb.von, '1970-01-01'::date) + AND + COALESCE(?::date, '2170-12-31'::date) <= COALESCE(vb.bis, '2170-12-31') + ) = 0 + {$dvidclause} EOSQL; $ret = $this->execReadOnlyQuery($query, - array($mitarbeiter_uid, $oe_kurzbz, $von, $bis)); + array($mitarbeiter_uid, $oe_kurzbz, $von, $bis, $von, $bis)); if( ($dvcount = getData($ret)) && ($dvcount[0]->dvcount > 0) ) { return true; From a47a74694083e873cfa8b3dc2f4979af57977d85 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Thu, 25 May 2023 15:53:40 +0200 Subject: [PATCH 088/263] add require for vertragsbestandteil_karenz --- .../libraries/vertragsbestandteil/VertragsbestandteilLib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php index 535a9f137..d0ca06126 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php @@ -8,6 +8,7 @@ require_once __DIR__ . '/VertragsbestandteilZeitaufzeichnung.php'; require_once __DIR__ . '/VertragsbestandteilKuendigungsfrist.php'; require_once __DIR__ . '/VertragsbestandteilUrlaubsanspruch.php'; require_once __DIR__ . '/VertragsbestandteilFreitext.php'; +require_once __DIR__ . '/VertragsbestandteilKarenz.php'; require_once __DIR__ . '/VertragsbestandteilFactory.php'; use vertragsbestandteil\Dienstverhaeltnis; From 0a179c963f6a77af978432baaf2f432e50cf4e2a Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Thu, 25 May 2023 16:35:44 +0200 Subject: [PATCH 089/263] bismeldestichtag: added meldestichtag_id to table, created bismeldestichtag class, improved comment for prestudentstatuschecks in studentDBML --- content/student/studentDBDML.php | 7 +- include/bismeldestichtag.class.php | 144 ++++++++++++++++++ system/dbupdate_3.4.php | 2 +- ...student_status_nach_bismeldung_sperren.php | 25 ++- 4 files changed, 172 insertions(+), 6 deletions(-) create mode 100644 include/bismeldestichtag.class.php diff --git a/content/student/studentDBDML.php b/content/student/studentDBDML.php index 2d5c9e0b8..c5818ebb3 100644 --- a/content/student/studentDBDML.php +++ b/content/student/studentDBDML.php @@ -74,6 +74,7 @@ require_once('../../include/reihungstest.class.php'); require_once('../../include/studienplan.class.php'); require_once('../../include/mobilitaet.class.php'); require_once('../../include/studienordnung.class.php'); +require_once('../../include/bismeldestichtag.class.php'); $user = get_uid(); $db = new basis_db(); @@ -383,7 +384,7 @@ function isBuchungAllowedToChange($buchung_obj) * @param $new_status_ausbildungssemester Ausbildungssemester des neuen/zu ändernen Status * @param $old_status_studiensemester Studiensemester des alten Status, leer wenn neuer Status * @param $old_status_ausbildungssemester Ausbildungssemester des alten Status, leer wenn neuer Status - * @return array + * @return array mit error = true und Fehlerbeschreibung wenn ungültig, andernfalls error = false */ function checkStatusaenderung( $prestudent_id, $status_kurzbz, $new_status_studiensemester, $new_status_datum, $new_status_ausbildungssemester, @@ -417,7 +418,7 @@ function checkStatusaenderung( $studiensemester->load($new_status_studiensemester); $new_status_semesterstart = new DateTime($studiensemester->start); - // Alle bisherigen prestudentstatus nach Datum sortiert + // Alle prestudentstatus nach Datum sortiert $qry = "SELECT status_kurzbz, studiensemester_kurzbz, ausbildungssemester, datum, sem.start AS studiensemester_start FROM public.tbl_prestudentstatus pss JOIN public.tbl_studiensemester sem USING (studiensemester_kurzbz) @@ -464,7 +465,7 @@ function checkStatusaenderung( // Gültige Zeitabfolge, bestehenden Status hinzufügen $statusArr[] = $row; } - // oder Neuer/editierter Statuseintrag nach bestehendem Statuseintrag + // oder Neuer/editierter Statuseintrag vor bestehendem Statuseintrag elseif ($new_status_datum <= $status_datum && $new_status_semesterstart <= $studiensemester_start) { // Gültige Zeitabfolge, bestehenden Status hinzufügen diff --git a/include/bismeldestichtag.class.php b/include/bismeldestichtag.class.php new file mode 100644 index 000000000..e4b3746a6 --- /dev/null +++ b/include/bismeldestichtag.class.php @@ -0,0 +1,144 @@ +, + */ +require_once(dirname(__FILE__).'/basis_db.class.php'); + +class bismeldestichtag extends basis_db +{ + //Tabellenspalten + public $meldestichtag_id; // integer + public $meldestichtag; // date + public $studiensemester_kurzbz; // varchar(16) + public $insertamum; // timestamp + public $insertvon; // varchar(16) + public $updateamum; // timestamp + public $updatevon; // varchar(16) + + // ErgebnisArray + public $result=array(); + + /** + * Konstruktor - Uebergibt die Connection und laedt optional einen Meldestichtag + * @param $meldestichtag_id Stichtag der geladen werden soll (default=null) + */ + public function __construct($meldestichtag_id=null) + { + parent::__construct(); + + if(!is_null($meldestichtag_id)) + $this->load($meldestichtag_id); + } + + /** + * Laedt Meldestichtag mit der uebergebenen ID + * @param $meldestichtag_id ID des Stichtags der geladen werden soll + */ + public function load($meldestichtag_id) + { + $qry = "SELECT * FROM bis.tbl_meldestichtag WHERE meldestichtag_id=".$this->db_add_param($meldestichtag_id, FHC_INTEGER); + + if($this->db_query($qry)) + { + if($row = $this->db_fetch_object()) + { + $this->meldestichtag_id = $row->meldestichtag_id; + $this->meldestichtag = $row->meldestichtag; + $this->studiensemester_kurzbz = $row->studiensemester_kurzbz; + $this->insertamum = $row->insertamum; + $this->insertvon = $row->insertvon; + $this->updateamum = $row->updateamum; + $this->updatevon = $row->updatevon; + return true; + } + else + { + $this->errormsg = 'Kein Eintrag gefunden'; + return false; + } + } + else + { + $this->errormsg = "Fehler beim Laden des Stichtags"; + return false; + } + } + + /** + * Prueft die Variablen vor dem Speichern + * auf Gueltigkeit. + * @return true wenn ok, false im Fehlerfall + */ + protected function validate() + { + return true; + } + + /** + * Liefert die Antwort eines Pruefling zu einer Frage + * + * @param $pruefling_id + * @param $frage_id + * @return boolean + */ + public function getLastMeldestichtag($studiensemester_kurzbz = null) + { + $qry = "SELECT + meldestichtag, studiensemester_kurzbz + FROM + bis.tbl_meldestichtag"; + + if (isset($studiensemester_kurzbz)) + { + $qry .= " + WHERE + studiensemester_kurzbz=".$this->db_add_param($studiensemester_kurzbz); + } + + $qry .= " + ORDER BY + meldestichtag DESC + LIMIT 1;" + + if($this->db_query($qry)) + { + while($row = $this->db_fetch_object()) + { + $obj = new antwort(); + + $obj->meldestichtag_id = $row->meldestichtag_id; + $obj->meldestichtag = $row->meldestichtag; + $obj->studiensemester_kurzbz = $row->studiensemester_kurzbz; + $obj->insertamum = $row->insertamum; + $obj->insertvon = $row->insertvon; + $obj->updateamum = $row->updateamum; + $obj->updatevon = $row->updatevon; + + $this->result[] = $obj; + } + + return true; + } + else + { + $this->errormsg = 'Meldestichtag konnte nicht geladen werden'; + return false; + } + } +} +?> diff --git a/system/dbupdate_3.4.php b/system/dbupdate_3.4.php index 01dd9ea8f..f9920900b 100644 --- a/system/dbupdate_3.4.php +++ b/system/dbupdate_3.4.php @@ -56,7 +56,7 @@ $tabellen=array( "bis.tbl_bisfunktion" => array("bisverwendung_id","studiengang_kz","sws","updateamum","updatevon","insertamum","insertvon","ext_id"), "bis.tbl_bisio" => array("bisio_id","mobilitaetsprogramm_code","nation_code","von","bis","zweck_code","student_uid","updateamum","updatevon","insertamum","insertvon","ext_id","ort","universitaet","lehreinheit_id","ects_erworben","ects_angerechnet","herkunftsland_code"), "bis.tbl_bisio_zweck" => array("bisio_id","zweck_code"), - "bis.tbl_bismeldestichtag" => array("studiensemester_kurzbz","meldestichtag"), + "bis.tbl_bismeldestichtag" => array("meldestichtag_id", "meldestichtag", "studiensemester_kurzbz"), "bis.tbl_bisstandort" => array("standort_code","bezeichnung","aktiv","insertamum","insertvon","updateamum","updatevon"), "bis.tbl_bisverwendung" => array("bisverwendung_id","ba1code","ba2code","vertragsstunden","beschausmasscode","verwendung_code","mitarbeiter_uid","hauptberufcode","hauptberuflich","habilitation","beginn","ende","updateamum","updatevon","insertamum","insertvon","ext_id","dv_art","inkludierte_lehre","zeitaufzeichnungspflichtig","azgrelevant", "homeoffice"), "bis.tbl_bundesland" => array("bundesland_code","kurzbz","bezeichnung"), diff --git a/system/dbupdate_3.4/29144_prestudent_status_nach_bismeldung_sperren.php b/system/dbupdate_3.4/29144_prestudent_status_nach_bismeldung_sperren.php index 0d5819c49..b3e2eed7c 100644 --- a/system/dbupdate_3.4/29144_prestudent_status_nach_bismeldung_sperren.php +++ b/system/dbupdate_3.4/29144_prestudent_status_nach_bismeldung_sperren.php @@ -6,8 +6,9 @@ if (! defined('DB_NAME')) exit('No direct script access allowed'); if (!$result = @$db->db_query('SELECT 1 FROM bis.tbl_bismeldestichtag LIMIT 1')) { $qry = 'CREATE TABLE bis.tbl_bismeldestichtag ( - studiensemester_kurzbz varchar(16), + meldestichtag_id integer, meldestichtag date NOT NULL, + studiensemester_kurzbz varchar(16) NOT NULL, insertamum timestamp DEFAULT NOW(), insertvon varchar(32), updateamum timestamp, @@ -16,7 +17,15 @@ if (!$result = @$db->db_query('SELECT 1 FROM bis.tbl_bismeldestichtag LIMIT 1')) COMMENT ON TABLE bis.tbl_bismeldestichtag IS \'Deadline Dates for BIS reporting\'; - ALTER TABLE bis.tbl_bismeldestichtag ADD CONSTRAINT pk_bismeldestichtag PRIMARY KEY (studiensemester_kurzbz); + ALTER TABLE bis.tbl_bismeldestichtag ADD CONSTRAINT pk_bismeldestichtag PRIMARY KEY (meldestichtag_id); + + CREATE SEQUENCE bis.tbl_meldestichtag_meldestichtag_id_seq + INCREMENT BY 1 + NO MAXVALUE + NO MINVALUE + CACHE 1; + + ALTER TABLE bis.tbl_bismeldestichtag ALTER COLUMN meldestichtag_id SET DEFAULT nextval(\'tbl_meldestichtag_meldestichtag_id_seq\'); ALTER TABLE bis.tbl_bismeldestichtag ADD CONSTRAINT fk_bismeldestichtag_studiensemester_kurzbz FOREIGN KEY (studiensemester_kurzbz) REFERENCES public.tbl_studiensemester(studiensemester_kurzbz) ON UPDATE CASCADE ON DELETE RESTRICT;'; @@ -36,4 +45,16 @@ if (!$result = @$db->db_query('SELECT 1 FROM bis.tbl_bismeldestichtag LIMIT 1')) echo 'bis.tbl_bismeldestichtag: '.$db->db_last_error().'
'; else echo '
Granted privileges to vilesci on bis.tbl_bismeldestichtag'; + + $qry = 'GRANT SELECT, UPDATE ON SEQUENCE bis.tbl_meldestichtag_meldestichtag_id_seq TO web;'; + if (!$db->db_query($qry)) + echo 'bis.tbl_meldestichtag_meldestichtag_id_seq: '.$db->db_last_error().'
'; + else + echo '
Granted privileges to web on bis.tbl_meldestichtag_meldestichtag_id_seq'; + + $qry = 'GRANT SELECT, UPDATE ON SEQUENCE bis.tbl_meldestichtag_meldestichtag_id_seq TO vilesci;'; + if (!$db->db_query($qry)) + echo 'bis.tbl_meldestichtag_meldestichtag_id_seq: '.$db->db_last_error().'
'; + else + echo '
Granted privileges to vilesci on bis.tbl_meldestichtag_meldestichtag_id_seq'; } From ec000fbf833fbfd01706932af5d31ade33ca76c6 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 30 May 2023 19:13:27 +0200 Subject: [PATCH 090/263] changes for aenderung and korrektur --- .../GehaltsbestandteilLib.php | 13 +++++++-- .../VertragsbestandteilFunktion.php | 29 +++++++++++++++++-- .../VertragsbestandteilLib.php | 29 ++++++++++++++++--- .../Gehaltsbestandteil_model.php | 3 +- .../Vertragsbestandteil_model.php | 26 ++++++++++------- 5 files changed, 80 insertions(+), 20 deletions(-) diff --git a/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php b/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php index e72de9cd9..e182b53d0 100644 --- a/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php +++ b/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php @@ -26,9 +26,9 @@ class GehaltsbestandteilLib $this->GehaltsbestandteilModel = $this->CI->GehaltsbestandteilModel; } - public function fetchGehaltsbestandteile($dienstverhaeltnis_id, $stichtag=null) + public function fetchGehaltsbestandteile($dienstverhaeltnis_id, $stichtag=null, $includefuture=false) { - return $this->GehaltsbestandteilModel->getGehaltsbestandteile($dienstverhaeltnis_id, $stichtag); + return $this->GehaltsbestandteilModel->getGehaltsbestandteile($dienstverhaeltnis_id, $stichtag, $includefuture); } public function fetchGehaltsbestandteil($gehaltsbestandteil_id) @@ -93,4 +93,13 @@ class GehaltsbestandteilLib throw new Exception('error updating gehaltsbestandteil'); } } + + public function deleteGehaltsbestandteil(Gehaltsbestandteil $gehaltsbestandteil) + { + $ret = $this->GehaltsbestandteilModel->delete($gehaltsbestandteil->getGehaltsbestandteil_id()); + if(isError($ret) ) + { + throw new Exception('error deleting gehaltsbestandteil'); + } + } } diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php b/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php index 727d2b548..21cb861d4 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilFunktion.php @@ -31,6 +31,31 @@ class VertragsbestandteilFunktion extends Vertragsbestandteil public function beforePersist() { + if( isset($this->benutzerfunktion_id) && intval($this->benutzerfunktion_id) > 0 ) + { + $this->beforePersitExisting(); + } + else + { + $this->beforePersitNew(); + } + } + + protected function beforePersitExisting() { + $data = (object) array( + 'datum_bis' => $this->getBis(), + 'updateamum' => strftime('%Y-%m-%d %H:%M:%S'), + 'updatevon' => getAuthUID() + ); + $ret = $this->CI->BenutzerfunktionModel->update($this->getBenutzerfunktion_id(), $data); + + if(isError($ret) ) + { + throw new Exception('failed to update Benutzerfunktion'); + } + } + + protected function beforePersitNew() { if( $this->benutzerfunktiondata === null) { return; @@ -43,9 +68,9 @@ class VertragsbestandteilFunktion extends Vertragsbestandteil throw new Exception('failed to create Benutzerfunktion'); } - $this->setBenutzerfunktion_id(getData($ret)); + $this->setBenutzerfunktion_id(getData($ret)); } - + public function toStdClass() { $tmp = array( diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php index d0ca06126..e178e6a59 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php @@ -21,7 +21,10 @@ use vertragsbestandteil\VertragsbestandteilFactory; * @author bambi */ class VertragsbestandteilLib -{ +{ + const INCLUDE_FUTURE = true; + const DO_NOT_INCLUDE_FUTURE = false; + protected $CI; /** @var Dienstverhaeltnis_model */ protected $DienstverhaeltnisModel; @@ -75,10 +78,10 @@ class VertragsbestandteilLib return $dv; } - public function fetchVertragsbestandteile($dienstverhaeltnis_id, $stichtag=null) + public function fetchVertragsbestandteile($dienstverhaeltnis_id, $stichtag=null, $includefuture=false) { - $vbs = $this->VertragsbestandteilModel->getVertragsbestandteile($dienstverhaeltnis_id, $stichtag); - $gbs = $this->GehaltsbestandteilLib->fetchGehaltsbestandteile($dienstverhaeltnis_id, $stichtag); + $vbs = $this->VertragsbestandteilModel->getVertragsbestandteile($dienstverhaeltnis_id, $stichtag, $includefuture); + $gbs = $this->GehaltsbestandteilLib->fetchGehaltsbestandteile($dienstverhaeltnis_id, $stichtag, $includefuture); $gbsByVBid = array(); foreach( $gbs as $gb ) @@ -259,4 +262,22 @@ class VertragsbestandteilLib $dv->getDienstverhaeltnis_id() ); } + + public function deleteVertragsbestandteil(Vertragsbestandteil $vertragsbestandteil) + { + $specialisedModel = VertragsbestandteilFactory::getVertragsbestandteilDBModel( + $vertragsbestandteil->getVertragsbestandteiltyp_kurzbz()); + $retspecial = $specialisedModel->delete($vertragsbestandteil->getVertragsbestandteil_id()); + if(isError($retspecial) ) + { + throw new Exception('error deleting vertragsbestandteil ' + . $vertragsbestandteil->getVertragsbestandteiltyp_kurzbz()); + } + + $ret = $this->VertragsbestandteilModel->delete($vertragsbestandteil->getVertragsbestandteil_id()); + if(isError($ret) ) + { + throw new Exception('error deleting vertragsbestandteil'); + } + } } diff --git a/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php b/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php index e3da82766..ef63a12a9 100644 --- a/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php +++ b/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php @@ -80,7 +80,7 @@ class Gehaltsbestandteil_model extends DB_Model implements IEncryption . ' AND COALESCE(bis, \'2170-01-01\'::date)'; if( $includefuture ) { - $stichtagclause .= ' OR COALESCE(v.von, \'1970-01-01\'::date) > ' + $stichtagclause .= ' OR COALESCE(von, \'1970-01-01\'::date) > ' . $this->escape($date); } $stichtagclause .= ')'; @@ -113,6 +113,7 @@ EOSQL; public function getGehaltsbestandteil($id) { + $this->addSelect('*'); $query = $this->load($id, $this->getEncryptedColumns()); $gehaltsbestandteil = null; diff --git a/application/models/vertragsbestandteil/Vertragsbestandteil_model.php b/application/models/vertragsbestandteil/Vertragsbestandteil_model.php index 913fd6c34..a5df8ed0d 100644 --- a/application/models/vertragsbestandteil/Vertragsbestandteil_model.php +++ b/application/models/vertragsbestandteil/Vertragsbestandteil_model.php @@ -120,19 +120,23 @@ EOSQL; ; EOSQL; - // echo $sql . "\n\n"; - $query = $this->db->query($sql); - - $vertragsbestandteil = array(); - try + $query = $this->execReadOnlyQuery($sql); + + $vertragsbestandteil = null; + + if( hasData($query) ) { - $vertragsbestandteile = VertragsbestandteilFactory::getVertragsbestandteil($row); // TODO add decryption + $data = getData($query)[0]; + try + { + $vertragsbestandteil = VertragsbestandteilFactory::getVertragsbestandteil($data); // TODO add decryption + } + catch (Exception $ex) + { + echo $ex->getMessage() . "\n"; + } } - catch (Exception $ex) - { - echo $ex->getMessage() . "\n"; - } - + return $vertragsbestandteil; } From 42197c39ed188cb2f6b74972b9d627e83b2c3899 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Sat, 3 Jun 2023 15:18:06 +0200 Subject: [PATCH 091/263] FAS prestudents status: check is Meldestichtag is reached and disable input if it is, bismeldestichtag table: added sequence primary key --- content/student/studentDBDML.php | 38 +++++++++++++++- content/student/studentoverlay.js.php | 8 +++- content/student/studentrolledialog.xul.php | 30 ++++++++----- include/bismeldestichtag.class.php | 45 ++++++++++++++++--- ...student_status_nach_bismeldung_sperren.php | 9 ++-- 5 files changed, 104 insertions(+), 26 deletions(-) diff --git a/content/student/studentDBDML.php b/content/student/studentDBDML.php index c5818ebb3..b08d977e8 100644 --- a/content/student/studentDBDML.php +++ b/content/student/studentDBDML.php @@ -995,6 +995,18 @@ if(!$error) { $new_status_datum = isset($_POST['datum']) ? $_POST['datum'] : date('Y-m-d'); + $bismeldestichtag = new bismeldestichtag(); + + $meldestichtag_erreicht = $bismeldestichtag->checkMeldestichtagErreicht($studiensemester, $new_status_datum); + + if ($meldestichtag_erreicht === true) + { + $return = false; + $error = true; + $errormsg .= 'Studentstatus mit Datum oder Semesterende vor erreichtem Meldestichtag können nicht hinzugefügt werden.'; + $anzahl_fehler++; + } + $check_statusaenderung_result = checkStatusaenderung( $prestudent_id, $_POST['status_kurzbz'], @@ -1205,13 +1217,24 @@ if(!$error) if(isset($_POST['studiensemester_kurzbz']) && isset($_POST['status_kurzbz']) && isset($_POST['prestudent_id']) && is_numeric($_POST['prestudent_id']) && - isset($_POST['ausbildungssemester']) && is_numeric($_POST['ausbildungssemester'])) + isset($_POST['ausbildungssemester']) && is_numeric($_POST['ausbildungssemester']) && + isset($_POST['datum'])) { - if($_POST['status_kurzbz']=='Student' && !$rechte->isBerechtigt('admin', null, 'suid') && !$rechte->isBerechtigt('student/keine_studstatuspruefung', null, 'suid')) + $erweiterteBerechtigungen = $rechte->isBerechtigt('admin', null, 'suid') || $rechte->isBerechtigt('student/keine_studstatuspruefung', null, 'suid'); + + $bismeldestichtag = new bismeldestichtag(); + $meldestichtag_erreicht = $bismeldestichtag->checkMeldestichtagErreicht($_POST['studiensemester_kurzbz'], $_POST['datum']); + + if($_POST['status_kurzbz']=='Student' && !$erweiterteBerechtigungen) { $return = false; $errormsg = 'Studentenrolle kann nur durch den Administrator geloescht werden'; } + elseif ($meldestichtag_erreicht && !$erweiterteBerechtigungen) + { + $return = false; + $errormsg = 'Studentstatus mit Datum oder Semesterende vor erreichtem Meldestichtag können nicht gelöscht werden.'; + } else { $qry = "SELECT count(*) as anzahl FROM public.tbl_prestudentstatus WHERE prestudent_id=".$db->db_add_param($_POST['prestudent_id'], FHC_INTEGER); @@ -1531,6 +1554,17 @@ if(!$error) $error = true; $errormsg = isset($check_statusaenderung_result['errormsg']) ? $check_statusaenderung_result['errormsg'] : ''; } + + // Prüfung, ob Meldestichtag erreicht ist + $bismeldestichtag = new bismeldestichtag(); + $meldestichtag_erreicht = $bismeldestichtag->checkMeldestichtagErreicht($_POST['studiensemester_kurzbz'], $_POST['datum']); + + if ($meldestichtag_erreicht === true) + { + $return = false; + $error = true; + $errormsg = 'Studentstatus mit Datum oder Semesterende vor erreichtem Meldestichtag können nicht hinzugefügt werden.'; + } } if(!$error) diff --git a/content/student/studentoverlay.js.php b/content/student/studentoverlay.js.php index d9686d5e3..f2dffc041 100644 --- a/content/student/studentoverlay.js.php +++ b/content/student/studentoverlay.js.php @@ -2000,6 +2000,7 @@ function StudentPrestudentRolleDelete() var studiensemester_kurzbz = getTreeCellText(tree, 'student-prestudent-tree-rolle-studiensemester_kurzbz', tree.currentIndex); var prestudent_id = getTreeCellText(tree, 'student-prestudent-tree-rolle-prestudent_id', tree.currentIndex); var ausbildungssemester = getTreeCellText(tree, 'student-prestudent-tree-rolle-ausbildungssemester', tree.currentIndex); + var datum = getTreeCellText(tree, 'student-prestudent-tree-rolle-datum', tree.currentIndex); studiengang_kz = document.getElementById('student-prestudent-menulist-studiengang_kz').value; if(confirm('Diese Rolle wirklich loeschen?')) @@ -2028,6 +2029,7 @@ function StudentPrestudentRolleDelete() req.add('studiensemester_kurzbz', studiensemester_kurzbz); req.add('ausbildungssemester', ausbildungssemester); req.add('studiengang_kz', studiengang_kz); + req.add('datum', datum); var response = req.executePOST(); @@ -2059,6 +2061,7 @@ function StudentPrestudentRolleDelete() req.add('studiensemester_kurzbz', studiensemester_kurzbz); req.add('ausbildungssemester', ausbildungssemester); req.add('studiengang_kz', studiengang_kz); + req.add('datum', datum); var response = req.executePOST(); @@ -2151,8 +2154,9 @@ function StudentRolleBearbeiten() var studiensemester_kurzbz = getTreeCellText(tree, 'student-prestudent-tree-rolle-studiensemester_kurzbz', tree.currentIndex); var prestudent_id = getTreeCellText(tree, 'student-prestudent-tree-rolle-prestudent_id', tree.currentIndex); var ausbildungssemester = getTreeCellText(tree, 'student-prestudent-tree-rolle-ausbildungssemester', tree.currentIndex); + var datum = getTreeCellText(tree, 'student-prestudent-tree-rolle-datum', tree.currentIndex); - window.open('content/student/studentrolledialog.xul.php?prestudent_id='+prestudent_id+'&status_kurzbz='+status_kurzbz+'&studiensemester_kurzbz='+studiensemester_kurzbz+'&ausbildungssemester='+ausbildungssemester,"Status","status=no, width=500, height=450, centerscreen, resizable"); + window.open('content/student/studentrolledialog.xul.php?prestudent_id='+prestudent_id+'&status_kurzbz='+status_kurzbz+'&studiensemester_kurzbz='+studiensemester_kurzbz+'&ausbildungssemester='+ausbildungssemester+'&datum='+datum,"Status","status=no, width=500, height=450, centerscreen, resizable"); } // **** @@ -2210,7 +2214,7 @@ function StudentRolleSpeichern(dialog, studiensemester_old, ausbildungssemester_ timepart_arr[i] = '00'; } } - + arr = datepart.split('.'); if(arr[0].length==1) diff --git a/content/student/studentrolledialog.xul.php b/content/student/studentrolledialog.xul.php index ef2c0919a..37ec0e983 100644 --- a/content/student/studentrolledialog.xul.php +++ b/content/student/studentrolledialog.xul.php @@ -31,6 +31,7 @@ require_once('../../include/person.class.php'); require_once('../../include/prestudent.class.php'); require_once('../../include/studienplan.class.php'); require_once('../../include/benutzerberechtigung.class.php'); +require_once('../../include/bismeldestichtag.class.php'); echo ''."\n"; @@ -58,6 +59,11 @@ if(isset($_GET['ausbildungssemester'])) else $ausbildungssemester=''; +if(isset($_GET['datum'])) + $datum=$_GET['datum']; +else + $datum=''; + $vorname = ''; $nachname = ''; if($prestudent_id!='') @@ -67,6 +73,10 @@ if($prestudent_id!='') $vorname = $prestudent->vorname; $nachname = $prestudent->nachname; + + // Prüfen, ob Studnetrolle vor dem aktuellen Meldestichtag ist. In diesem Fall darf die Rolle nicht mehr bearbeitet werden. + $bismeldestichtag = new bismeldestichtag(); + $disabled = $bismeldestichtag->checkMeldestichtagErreicht($studiensemester_kurzbz, $datum) ? ' disabled="true"' : ''; } $db = new basis_db(); $user=get_uid(); @@ -112,7 +122,7 @@ $user=get_uid();