From 66e400013a30115a9a412147a097a60e329c2ce4 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Tue, 14 Jul 2026 13:30:32 +0200 Subject: [PATCH] bei status setzen fuer zgv pruefung message rausschicken --- .../system/infocenter/Rueckstellung.php | 31 +++++++++++++++++++ public/js/infocenter/rueckstellung.js | 1 + 2 files changed, 32 insertions(+) diff --git a/application/controllers/system/infocenter/Rueckstellung.php b/application/controllers/system/infocenter/Rueckstellung.php index b1f2b60b7..2a122348f 100644 --- a/application/controllers/system/infocenter/Rueckstellung.php +++ b/application/controllers/system/infocenter/Rueckstellung.php @@ -7,6 +7,8 @@ class Rueckstellung extends Auth_Controller private $_ci; // Code igniter instance private $_uid; + const ZGV_UEBERPRUEFUNG_MAIL_VORLAGE = 'ZGVUEP'; + public function __construct() { parent::__construct( @@ -23,6 +25,7 @@ class Rueckstellung extends Auth_Controller $this->load->model('crm/RueckstellungStatus_model', 'RueckstellungStatusModel'); $this->load->model('person/Person_model', 'PersonModel'); $this->load->library('PersonLogLib'); + $this->load->library('MessageLib'); $this->_setAuthUID(); // sets property uid @@ -78,6 +81,8 @@ class Rueckstellung extends Auth_Controller $this->_log($person_id, $status_kurzbz); + if ($status_kurzbz === 'onhold_zgv') + $this->sendRueckstellungMessage($person_id); $this->outputJson($result); } @@ -104,6 +109,10 @@ class Rueckstellung extends Auth_Controller if (isError($result)) $this->terminateWithJsonError(getError($result)); $this->_log($person, $status_kurzbz); + + if ($status_kurzbz === 'onhold_zgv') + $this->sendRueckstellungMessage($person); + } $this->outputJsonSuccess("Erfolgreich gespeichert!"); } @@ -160,4 +169,26 @@ class Rueckstellung extends Auth_Controller $this->_uid ); } + + private function sendRueckstellungMessage($person_id) + { + $person = $this->_ci->PersonModel->load($person_id); + + if (hasData($person)) + { + $person = getData($person)[0]; + + return $this->messagelib->sendMessageUserTemplate( + $person_id, + self::ZGV_UEBERPRUEFUNG_MAIL_VORLAGE, + array( + 'anrede' => $person->anrede, + 'nachname' => $person->nachname + ), + null, + getAuthPersonId(), + 'infocenter' + ); + } + } } \ No newline at end of file diff --git a/public/js/infocenter/rueckstellung.js b/public/js/infocenter/rueckstellung.js index 553478115..3673b8b8c 100644 --- a/public/js/infocenter/rueckstellung.js +++ b/public/js/infocenter/rueckstellung.js @@ -75,6 +75,7 @@ var Rueckstellung = { if (FHC_AjaxClient.hasData(data)) { Rueckstellung.get(personid); + InfocenterDetails._refreshMessages(); InfocenterDetails._refreshLog() } else