From 14a7b0a92199732b3cdc94868317c832c4637239 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 23 Jan 2018 09:41:09 +0100 Subject: [PATCH] added Statusgrund Bezeichnung for Logging, replaced array constant for backwards compatibility --- .../system/infocenter/InfocenterDetails.php | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/application/controllers/system/infocenter/InfocenterDetails.php b/application/controllers/system/infocenter/InfocenterDetails.php index 288588bb8..329facd4d 100644 --- a/application/controllers/system/infocenter/InfocenterDetails.php +++ b/application/controllers/system/infocenter/InfocenterDetails.php @@ -12,10 +12,10 @@ class InfocenterDetails extends VileSci_Controller //app and Verarbeitungstaetigkeit name for logging const APP = 'aufnahme'; const TAETIGKEIT = 'bewerbung'; - const LOGPARAMS = array( + private $logparams = array( 'saveformalgep' => array('logtype' => 'Action', 'name' => 'document formally checked', 'message' => 'document %s formally checked, set to %s'), 'savezgv' => array('logtype' => 'Action', 'name' => 'ZGV saved', 'message' => 'ZGV saved for degree program %s, prestudentid %s'), - 'abgewiesen' => array('logtype' => 'Processstate', 'name' => 'Interessent rejected', 'message' => 'Interessent with prestudentid %s was rejected for degree program %s'), + 'abgewiesen' => array('logtype' => 'Processstate', 'name' => 'Interessent rejected', 'message' => 'Interessent with prestudentid %s was rejected for degree program %s, reason: %s'), 'freigegeben' => array('logtype' => 'Processstate', 'name' => 'Interessent confirmed', 'message' => 'status Interessent for prestudentid %s was confirmed for degree program %s'), 'savenotiz' => array('logtype' => 'Action', 'name' => 'note added', 'message' => 'note with title %s was added') ); @@ -276,7 +276,17 @@ class InfocenterDetails extends VileSci_Controller $logdata = $this->__getPersonAndStudiengangFromPrestudent($prestudent_id); - $this->__log($logdata['person_id'], 'abgewiesen', array($prestudent_id, $logdata['studiengang_kurzbz'])); + //statusgrund bezeichnung for logging + $this->StatusgrundModel->addSelect('bezeichnung_mehrsprachig'); + $result = $this->StatusgrundModel->load($statusgrund); + if ($result->error) + { + show_error($result->retval); + } + + $statusgrund_bez = $result->retval[0]->bezeichnung_mehrsprachig[1]; + + $this->__log($logdata['person_id'], 'abgewiesen', array($prestudent_id, $logdata['studiengang_kurzbz'], $statusgrund_bez)); $this->__redirectToStart($prestudent_id, 'ZgvPruef'); } @@ -400,9 +410,9 @@ class InfocenterDetails extends VileSci_Controller */ private function __log($person_id, $logname, $messageparams) { - $logparams = $this::LOGPARAMS[$logname]; - $this->personloglib->log($person_id, $logparams['logtype'], - array('name' => $logparams['name'], 'message' => vsprintf($logparams['message'], $messageparams), 'success' => 'true'), + $logdata = $this->logparams[$logname]; + $this->personloglib->log($person_id, $logdata['logtype'], + array('name' => $logdata['name'], 'message' => vsprintf($logdata['message'], $messageparams), 'success' => 'true'), $this::TAETIGKEIT, $this::APP, null, $this->uid); }