diff --git a/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php b/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php index 74dc35672..27ca95107 100644 --- a/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php +++ b/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php @@ -49,6 +49,7 @@ class GehaltsbestandteilLib { try { + $this->setUIDtoPGSQL(); if( intval($gehaltsbestandteil->getGehaltsbestandteil_id()) > 0 ) { $this->updateGehaltsbestandteil($gehaltsbestandteil); @@ -109,6 +110,7 @@ class GehaltsbestandteilLib public function deleteGehaltsbestandteil(Gehaltsbestandteil $gehaltsbestandteil) { + $this->setUIDtoPGSQL(); $ret = $this->GehaltsbestandteilModel->delete($gehaltsbestandteil->getGehaltsbestandteil_id()); if (isError($ret)) @@ -119,6 +121,7 @@ class GehaltsbestandteilLib public function endGehaltsbestandteil(Gehaltsbestandteil $gehaltsbestandteil, $enddate) { + $this->setUIDtoPGSQL(); if( $gehaltsbestandteil->getBis() !== null && $gehaltsbestandteil->getBis() < $enddate ) { return; @@ -136,4 +139,14 @@ class GehaltsbestandteilLib throw new Exception('error ending gehaltsbestandteil'); } } + + protected function setUIDtoPGSQL() { + $ret = $this->GehaltsbestandteilModel + ->execReadOnlyQuery('SET LOCAL pv21.uid TO \'' + . $this->loggedInUser . '\''); + if(isError($ret)) + { + throw new Exception('error setting uid to pgsql'); + } + } } diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php index eb335d767..053453025 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php @@ -456,8 +456,9 @@ class VertragsbestandteilLib } protected function setUIDtoPGSQL() { - $uid = getAuthUID(); - $ret = $this->VertragsbestandteilModel->execReadOnlyQuery('SET LOCAL pv21.uid TO \'' . $uid . '\''); + $ret = $this->VertragsbestandteilModel + ->execReadOnlyQuery('SET LOCAL pv21.uid TO \'' + . $this->loggedInUser . '\''); if(isError($ret)) { throw new Exception('error setting uid to pgsql');