From 58a921b500ff7779879d77a91d72ffc12f4eed70 Mon Sep 17 00:00:00 2001 From: Werner Masik Date: Thu, 30 Apr 2026 09:47:12 +0200 Subject: [PATCH 1/4] changed lohnguide kommentar data type to text --- system/dbupdate_3.4/70376_lohnguide.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/dbupdate_3.4/70376_lohnguide.php b/system/dbupdate_3.4/70376_lohnguide.php index 6cf2be38e..b5e9fcce2 100644 --- a/system/dbupdate_3.4/70376_lohnguide.php +++ b/system/dbupdate_3.4/70376_lohnguide.php @@ -264,8 +264,8 @@ CREATE TABLE IF NOT EXISTS hr.tbl_vertragsbestandteil_lohnguide ( stellenbezeichnung varchar(255), fachrichtung_kurzbz character varying(32) NOT NULL, modellstelle_kurzbz character varying(32) NOT NULL, - kommentar_person varchar(255), - kommentar_modellstelle varchar(255), + kommentar_person text, + kommentar_modellstelle text, CONSTRAINT tbl_vertragsbestandteil_lohnguide_pk PRIMARY KEY (vertragsbestandteil_id), CONSTRAINT tbl_vertragsbestandteil_fk FOREIGN KEY (vertragsbestandteil_id) REFERENCES hr.tbl_vertragsbestandteil (vertragsbestandteil_id) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE, CONSTRAINT tbl_vertragsbestandteil_lohnguide_fachrichtung_fk FOREIGN KEY (fachrichtung_kurzbz) REFERENCES hr.tbl_lohnguide_fachrichtung (fachrichtung_kurzbz) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE, From 7f13c128f11486e092467989536a4760bacd4fb3 Mon Sep 17 00:00:00 2001 From: Werner Masik Date: Mon, 4 May 2026 20:35:51 +0200 Subject: [PATCH 2/4] allow null value for vordienstzeit; changed comparison in markDirty to !== (because of 0 vs. null issue) --- .../AbstractBestandteil.php | 2 +- .../VertragsbestandteilLohnguide.php | 28 +++++++++++-------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/application/libraries/vertragsbestandteil/AbstractBestandteil.php b/application/libraries/vertragsbestandteil/AbstractBestandteil.php index ccd05f5e2..a375ad0c1 100644 --- a/application/libraries/vertragsbestandteil/AbstractBestandteil.php +++ b/application/libraries/vertragsbestandteil/AbstractBestandteil.php @@ -40,7 +40,7 @@ abstract class AbstractBestandteil implements IValidation if( is_bool($new_value) && ($old_value !== $new_value) ) { $this->modifiedcolumns[$columnname] = $columnname; - } else if($old_value != $new_value) { + } else if($old_value !== $new_value) { $this->modifiedcolumns[$columnname] = $columnname; } } diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilLohnguide.php b/application/libraries/vertragsbestandteil/VertragsbestandteilLohnguide.php index 0e071f36b..71104fa91 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilLohnguide.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilLohnguide.php @@ -137,19 +137,25 @@ EOTXT; return parent::__toString() . $txt; } - /* public function validate() + public function validate() { - if( !(filter_var($this->tage, FILTER_VALIDATE_INT, - array( - 'options' => array( - 'min_range' => 1, - 'max_range' => 50 - ) - ) - )) ) { - $this->validationerrors[] = 'Urlaubsanspruch muss eine Tagesanzahl im Bereich 1 bis 50 sein.'; + $value = $this->vordienstzeit; + + if ($value === null || $value === '') { + $result = null; // allow null value + } else { + $result = filter_var($value, FILTER_VALIDATE_INT, [ + 'options' => [ + 'min_range' => 0, + 'max_range' => 100 + ] + ]); + + if ($result === false) { + $this->validationerrors[] = 'Vordienstjahre muss eine ganze Zahl (0 bis 100) enthalten oder leer sein.'; + } } return parent::validate(); - } */ + } } From d27071528f20dd189c1fe6993518fa986cdd7651 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Wed, 13 May 2026 11:16:18 +0200 Subject: [PATCH 3/4] revert change to comparision in markDirty Method --- .../libraries/vertragsbestandteil/AbstractBestandteil.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/libraries/vertragsbestandteil/AbstractBestandteil.php b/application/libraries/vertragsbestandteil/AbstractBestandteil.php index a375ad0c1..09e736580 100644 --- a/application/libraries/vertragsbestandteil/AbstractBestandteil.php +++ b/application/libraries/vertragsbestandteil/AbstractBestandteil.php @@ -40,7 +40,7 @@ abstract class AbstractBestandteil implements IValidation if( is_bool($new_value) && ($old_value !== $new_value) ) { $this->modifiedcolumns[$columnname] = $columnname; - } else if($old_value !== $new_value) { + } else if($old_value != $new_value) { $this->modifiedcolumns[$columnname] = $columnname; } } From 68d97a5e97a8e208e6ce917adb76e5f7907f55c8 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Wed, 13 May 2026 11:42:25 +0200 Subject: [PATCH 4/4] handle case where old value or new value and not both are null explicitly in markDirty Method --- .../libraries/vertragsbestandteil/AbstractBestandteil.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/application/libraries/vertragsbestandteil/AbstractBestandteil.php b/application/libraries/vertragsbestandteil/AbstractBestandteil.php index 09e736580..4e1e8b9d0 100644 --- a/application/libraries/vertragsbestandteil/AbstractBestandteil.php +++ b/application/libraries/vertragsbestandteil/AbstractBestandteil.php @@ -40,6 +40,8 @@ abstract class AbstractBestandteil implements IValidation if( is_bool($new_value) && ($old_value !== $new_value) ) { $this->modifiedcolumns[$columnname] = $columnname; + } else if(is_null($old_value) xor is_null($new_value)) { + $this->modifiedcolumns[$columnname] = $columnname; } else if($old_value != $new_value) { $this->modifiedcolumns[$columnname] = $columnname; }