mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
fix method names, handle insertamum updateamum insertvon updatevon in libs
This commit is contained in:
@@ -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 = <<<EOTXT
|
||||
dienstverhaeltnis_id: {$this->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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -80,7 +80,7 @@ EOTXT;
|
||||
|
||||
public function validate()
|
||||
{
|
||||
if( (floatval($this->benutzerfunktion_id) < 1 ) ) {
|
||||
if( (floatval($this->wochenstunden) < 1 ) ) {
|
||||
$this->validationerrors[] = 'Stunden zu niedrig.';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user