gehaltsbestandteillib set uid to pgsql

This commit is contained in:
Harald Bamberger
2023-08-01 14:37:07 +02:00
parent c8703d3215
commit 8eeb0d9ca7
2 changed files with 16 additions and 2 deletions
@@ -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');
}
}
}
@@ -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');