diff --git a/application/config/roles.php b/application/config/roles.php index c1891b62f..a95a94215 100644 --- a/application/config/roles.php +++ b/application/config/roles.php @@ -56,7 +56,7 @@ $config['roles'] = array 'basis/adresse','basis/akte','basis/kontakt','basis/log','basis/nation','basis/notiz','basis/notizzuordnung', 'basis/person','basis/prestudent','basis/prestudentstatus','basis/status','basis/zgv','basis/zgvmaster', 'lehre/studienplan','system/filters','fs/dms','basis/message','basis/benutzerrolle', 'basis/sprache', - 'system/personlock' + 'system/personlock','basis/benutzerfunktion','system/vorlagestudiengang' ) ) ); diff --git a/application/controllers/ViewMessage.php b/application/controllers/ViewMessage.php index fa294a4ec..48c0a09f1 100644 --- a/application/controllers/ViewMessage.php +++ b/application/controllers/ViewMessage.php @@ -33,7 +33,7 @@ class ViewMessage extends CI_Controller // Load model MessageToken_model, not calling the authentication system $this->load->model('system/MessageToken_model', 'MessageTokenModel'); } - + /** * Using the MessageTokenModel instead of MessageLib to allow * viewing the message without prompting the login @@ -50,32 +50,37 @@ class ViewMessage extends CI_Controller if (is_array($msg->retval) && count($msg->retval) > 0) { $setReadMessageStatusByToken = $this->MessageTokenModel->setReadMessageStatusByToken($token); - + if (isError($setReadMessageStatusByToken)) { show_error($msg->$setReadMessageStatusByToken); } - + $sender_id = $msg->retval[0]->sender_id; $receiver_id = $msg->retval[0]->receiver_id; $sender = $this->MessageTokenModel->getSenderData($sender_id); - + // To decide how to change the redirection $isEmployee = $this->MessageTokenModel->isEmployee($receiver_id); if (!is_bool($isEmployee) && isError($isEmployee)) { show_error($isEmployee); } - + + if($this->config->item('redirect_view_message_url') != '') + $href = APP_ROOT . $this->config->item('redirect_view_message_url') . $token; + else + $href = ''; + $data = array ( 'sender_id' => $sender_id, 'sender' => $sender->retval[0], 'message' => $msg->retval[0], 'isEmployee' => $isEmployee, - 'href' => APP_ROOT . $this->config->item('redirect_view_message_url') . $token + 'href' => $href ); - + $this->load->view('system/messageHTML.php', $data); } } -} \ No newline at end of file +} diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 92932b8ea..03d98dd14 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -69,6 +69,7 @@ class InfoCenter extends VileSci_Controller // Loads libraries $this->load->library('DmsLib'); $this->load->library('PersonLogLib'); + $this->load->library('MailLib'); $this->load->library('WidgetLib'); $this->_setAuthUID(); // sets property uid @@ -313,7 +314,7 @@ class InfoCenter extends VileSci_Controller $lastStatus = $lastStatus->retval[0]; //check if still Interessent and not freigegeben yet - if($lastStatus->status_kurzbz === 'Interessent' && !isset($lastStatus->bestaetigtam)) + if ($lastStatus->status_kurzbz === 'Interessent' && !isset($lastStatus->bestaetigtam)) { $result = $this->PrestudentstatusModel->update( array( @@ -542,11 +543,23 @@ class InfoCenter extends VileSci_Controller */ private function _loadPersonData($person_id) { - $lockedby = $this->PersonLockModel->checkIfLocked($person_id); + $locked = $this->PersonLockModel->checkIfLocked($person_id, self::APP); - if (isError($lockedby)) + if (isError($locked)) { - show_error($lockedby->retval); + show_error($locked->retval); + } + + $lockedby = null; + + //mark red if locked by other user + $lockedbyother = false; + + if (isset($locked->retval[0]->uid)) + { + $lockedby = $locked->retval[0]->uid; + if ($lockedby !== $this->uid) + $lockedbyother = true; } $stammdaten = $this->PersonModel->getPersonStammdaten($person_id, true); @@ -599,7 +612,8 @@ class InfoCenter extends VileSci_Controller $messagelink = base_url('/index.ci.php/system/Messages/write/'.$user_person->retval[0]->person_id); $data = array ( - 'lockedby' => isset($lockedby->retval[0]->uid) ? $lockedby->retval[0]->uid : null, + 'lockedby' => $lockedby, + 'lockedbyother' => $lockedbyother, 'stammdaten' => $stammdaten->retval, 'dokumente' => $dokumente->retval, 'dokumente_nachgereicht' => $dokumente_nachgereicht->retval, @@ -741,4 +755,9 @@ class InfoCenter extends VileSci_Controller $this->uid ); } +/* + private function _sendFreigabeMail() + { + $this->maillib->send('alex@alex-ThinkCentre-M900', 'karpen_ko@hotmail.com', 'test', 'test'); + }*/ } diff --git a/application/core/DB_Model.php b/application/core/DB_Model.php index 3dc5e85ac..be9e39082 100644 --- a/application/core/DB_Model.php +++ b/application/core/DB_Model.php @@ -540,6 +540,21 @@ class DB_Model extends FHC_Model return $this->db->escape($value); } + /** + * This method call the method escape_like_str from class CI_DB_driver, therefore: + * this method should be used when strings are to be used in LIKE conditions so that LIKE wildcards (‘%’, ‘_’) + * in the string are also properly escaped. + * NOTE: The escape_like_str() method uses ‘!’ (exclamation mark) to escape special characters for LIKE conditions. + * Because this method escapes partial strings that you would wrap in quotes yourself, it cannot automatically + * add the ESCAPE '!' condition for you, and so you’ll have to manually do that. + * + * @return void + */ + public function escapeLike($value) + { + return $this->db->escape_like_str($value); + } + /** * Convert PG-Boolean to PHP-Boolean * diff --git a/application/libraries/MessageLib.php b/application/libraries/MessageLib.php index 3b5f8093b..3daac4590 100644 --- a/application/libraries/MessageLib.php +++ b/application/libraries/MessageLib.php @@ -426,42 +426,78 @@ class MessageLib if ((!is_null($result->retval[$i]->receiver) && $result->retval[$i]->receiver != '') || (!is_null($result->retval[$i]->employeecontact) && $result->retval[$i]->employeecontact != '')) { - $href = $this->ci->config->item('message_server').$this->ci->config->item('message_html_view_url').$result->retval[0]->token; - // Using a template for the html email body - $body = $this->ci->parser->parse( - 'templates/mailHTML', - array( - 'href' => $href, - 'subject' => $result->retval[0]->subject, - 'body' => $result->retval[0]->body - ), - true - ); + $href = $this->ci->config->item('message_server').$this->ci->config->item('message_html_view_url').$result->retval[$i]->token; + + $vorlage = $this->ci->vorlagelib->loadVorlagetext('MessageMailHTML'); + + if(hasData($vorlage)) + { + // Using a template for the html email body + $body = $this->ci->parser->parse_string( + $vorlage->retval[0]->text, + array( + 'href' => $href, + 'subject' => $result->retval[$i]->subject, + 'body' => $result->retval[$i]->body + ), + true + ); + } + else + { + // Using a template for the html email body + $body = $this->ci->parser->parse( + 'templates/mailHTML', + array( + 'href' => $href, + 'subject' => $result->retval[$i]->subject, + 'body' => $result->retval[$i]->body + ), + true + ); + } if (is_null($body) || $body == '') { $this->ci->loglib->logError('Error while parsing the mail template'); } - // Using a template for the plain text email body - $altBody = $this->ci->parser->parse( - 'templates/mailTXT', - array( - 'href' => $href, - 'subject' => $result->retval[0]->subject, - 'body' => $result->retval[0]->body - ), - true - ); + $vorlage = $this->ci->vorlagelib->loadVorlagetext('MessageMailTXT'); + if(hasData($vorlage)) + { + // Using a template for the plain text email body + $altBody = $this->ci->parser->parse_string( + $vorlage->retval[0]->text, + array( + 'href' => $href, + 'subject' => $result->retval[$i]->subject, + 'body' => $result->retval[$i]->body + ), + true + ); + } + else + { + // Using a template for the plain text email body + $altBody = $this->ci->parser->parse( + 'templates/mailTXT', + array( + 'href' => $href, + 'subject' => $result->retval[$i]->subject, + 'body' => $result->retval[$i]->body + ), + true + ); + } if (is_null($altBody) || $altBody == '') { $this->ci->loglib->logError('Error while parsing the mail template'); } - // If the sender kontakt does not exist, then system-sender is used if empty + // If the sender is not an employee, then system-sender is used if empty $sender = ''; - if (!is_null($result->retval[0]->sender) && $result->retval[0]->sender != '') + if (!is_null($result->retval[0]->senderemployeecontact) && $result->retval[0]->senderemployeecontact != '') { - $sender = $result->retval[0]->sender; + $sender = $result->retval[0]->senderemployeecontact.'@'.DOMAIN; } $receiverContact = $result->retval[$i]->receiver; @@ -571,15 +607,32 @@ class MessageLib { // Using a template for the html email body $href = $this->ci->config->item('message_server').$this->ci->config->item('message_html_view_url').$result->retval[0]->token; - $bodyMsg = $this->ci->parser->parse( - 'templates/mailHTML', - array( - 'href' => $href, - 'subject' => $result->retval[0]->subject, - 'body' => $result->retval[0]->body - ), - true - ); + + $vorlage = $this->ci->vorlagelib->loadVorlagetext('MessageMailHTML'); + if(hasData($vorlage)) + { + $bodyMsg = $this->ci->parser->parse_string( + $vorlage->retval[0]->text, + array( + 'href' => $href, + 'subject' => $result->retval[0]->subject, + 'body' => $result->retval[0]->body + ), + true + ); + } + else + { + $bodyMsg = $this->ci->parser->parse( + 'templates/mailHTML', + array( + 'href' => $href, + 'subject' => $result->retval[0]->subject, + 'body' => $result->retval[0]->body + ), + true + ); + } if (is_null($bodyMsg) || $bodyMsg == '') { // $body = $result->retval[0]->body; @@ -587,15 +640,31 @@ class MessageLib } // Using a template for the plain text email body - $altBody = $this->ci->parser->parse( - 'templates/mailTXT', - array( - 'href' => $href, - 'subject' => $result->retval[0]->subject, - 'body' => $result->retval[0]->body - ), - true - ); + $vorlage = $this->ci->vorlagelib->loadVorlagetext('MessageMailHTML'); + if(hasData($vorlage)) + { + $altBody = $this->ci->parser->parse_string( + $vorlage->retval[0]->text, + array( + 'href' => $href, + 'subject' => $result->retval[0]->subject, + 'body' => $result->retval[0]->body + ), + true + ); + } + else + { + $altBody = $this->ci->parser->parse( + 'templates/mailTXT', + array( + 'href' => $href, + 'subject' => $result->retval[0]->subject, + 'body' => $result->retval[0]->body + ), + true + ); + } if (is_null($altBody) || $altBody == '') { $this->ci->loglib->logError('Error while parsing the plain text mail template'); @@ -606,11 +675,11 @@ class MessageLib $bodyMsg = $altBody = $body; } - // If the sender kontakt does not exist, then system-sender is used if empty + // If the sender is not an employee, then system-sender is used if empty $sender = ''; - if (!is_null($result->retval[0]->sender) && $result->retval[0]->sender != '') + if (!is_null($result->retval[0]->senderemployeecontact) && $result->retval[0]->senderemployeecontact != '') { - $sender = $result->retval[0]->sender; + $sender = $result->retval[0]->senderemployeecontact.'@'.DOMAIN; } $receiverContact = $result->retval[0]->receiver; diff --git a/application/libraries/VorlageLib.php b/application/libraries/VorlageLib.php index 81ce44149..7ea3de93d 100644 --- a/application/libraries/VorlageLib.php +++ b/application/libraries/VorlageLib.php @@ -9,9 +9,9 @@ class VorlageLib /** * Loads parser library and OrganisationseinheitLib library */ - public function __construct() - { - require_once APPPATH.'config/message.php'; + public function __construct() + { + require_once APPPATH.'config/message.php'; $this->ci =& get_instance(); @@ -21,83 +21,83 @@ class VorlageLib $this->ci->load->model('system/Vorlage_model', 'VorlageModel'); $this->ci->load->model('system/Vorlagestudiengang_model', 'VorlageStudiengangModel'); - $this->ci->load->helper('language'); - // Loads helper message to manage returning messages + $this->ci->load->helper('language'); + // Loads helper message to manage returning messages $this->ci->load->helper('message'); - //$this->ci->lang->load('fhcomplete'); - } + //$this->ci->lang->load('fhcomplete'); + } /** - * getVorlage() - will load a spezific Template - * - * @param int $vorlage_kurzbz REQUIRED - * @return struct - */ - public function getVorlage($vorlage_kurzbz) - { - if (empty($vorlage_kurzbz)) - return error(MSG_ERR_INVALID_MSG_ID); - - $vorlage = $this->ci->VorlageModel->load($vorlage_kurzbz); - return $vorlage; - } - - /** - * getSubMessages() - will return all Messages subordinated from a specified message. - * - * @param int $msg_id REQUIRED - * @return array - */ - public function getVorlageByMimetype($mimetype = null) - { - $vorlage = $this->ci->VorlageModel->loadWhere(array('mimetype' => $mimetype)); - return $vorlage; - } - - /** - * saveVorlage() - will save a spezific Template. - * - * @param array $data REQUIRED - * @return array - */ - public function saveVorlage($vorlage_kurzbz, $data) - { - if (empty($data)) - return error(MSG_ERR_INVALID_MSG_ID); - - $vorlage = $this->ci->VorlageModel->update($vorlage_kurzbz, $data); - return $vorlage; - } - - /** - * getVorlagetextByVorlage() - will load tbl_vorlagestudiengang for a spezific Template. - * - * @param string $vorlage_kurzbz REQUIRED - * @return array - */ - public function getVorlagetextByVorlage($vorlage_kurzbz) + * getVorlage() - will load a spezific Template + * + * @param int $vorlage_kurzbz REQUIRED + * @return struct + */ + public function getVorlage($vorlage_kurzbz) { - if (empty($vorlage_kurzbz)) - return error($this->ci->lang->line('fhc_'.FHC_INVALIDID, false)); + if (empty($vorlage_kurzbz)) + return error(MSG_ERR_INVALID_MSG_ID); - $vorlage = $this->ci->VorlageStudiengangModel->loadWhere(array('vorlage_kurzbz' => $vorlage_kurzbz)); - return $vorlage; - } + $vorlage = $this->ci->VorlageModel->load($vorlage_kurzbz); + return $vorlage; + } /** - * loadVorlagetext() - will load the best fitting Template. - * - * @param string $vorlage_kurzbz REQUIRED - * @param string $oe_kurzbz OPTIONAL - * @param string $orgform_kurzbz OPTIONAL + * getSubMessages() - will return all Messages subordinated from a specified message. + * + * @param int $msg_id REQUIRED + * @return array + */ + public function getVorlageByMimetype($mimetype = null) + { + $vorlage = $this->ci->VorlageModel->loadWhere(array('mimetype' => $mimetype)); + return $vorlage; + } + + /** + * saveVorlage() - will save a spezific Template. + * + * @param array $data REQUIRED + * @return array + */ + public function saveVorlage($vorlage_kurzbz, $data) + { + if (empty($data)) + return error(MSG_ERR_INVALID_MSG_ID); + + $vorlage = $this->ci->VorlageModel->update($vorlage_kurzbz, $data); + return $vorlage; + } + + /** + * getVorlagetextByVorlage() - will load tbl_vorlagestudiengang for a spezific Template. + * + * @param string $vorlage_kurzbz REQUIRED + * @return array + */ + public function getVorlagetextByVorlage($vorlage_kurzbz) + { + if (empty($vorlage_kurzbz)) + return error($this->ci->lang->line('fhc_'.FHC_INVALIDID, false)); + + $vorlage = $this->ci->VorlageStudiengangModel->loadWhere(array('vorlage_kurzbz' => $vorlage_kurzbz)); + return $vorlage; + } + + /** + * loadVorlagetext() - will load the best fitting Template. + * + * @param string $vorlage_kurzbz REQUIRED + * @param string $oe_kurzbz OPTIONAL + * @param string $orgform_kurzbz OPTIONAL * @param string $sprache OPTIONAL - * @return array - */ - public function loadVorlagetext($vorlage_kurzbz, $oe_kurzbz = null, $orgform_kurzbz = null, $sprache = null) + * @return array + */ + public function loadVorlagetext($vorlage_kurzbz, $oe_kurzbz = null, $orgform_kurzbz = null, $sprache = null) { - if (empty($vorlage_kurzbz)) - return error($this->ci->lang->line('fhc_'.FHC_INVALIDID, false)); - + if (empty($vorlage_kurzbz)) + return error($this->ci->lang->line('fhc_'.FHC_INVALIDID, false)); + // Try to search the template with the given vorlage_kurzbz and other parameters if present $queryParameters = array("vorlage_kurzbz" => $vorlage_kurzbz, "aktiv" => true); @@ -120,7 +120,7 @@ class VorlageLib { // Builds where clause $where = $this->_where($vorlage_kurzbz, $orgform_kurzbz, $sprache); - + $vorlage = $this->ci->organisationseinheitlib->treeSearch( 'public', 'tbl_vorlagestudiengang', @@ -133,17 +133,17 @@ class VorlageLib ); } - return $vorlage; - } + return $vorlage; + } - /** - * _where - */ - private function _where($vorlage_kurzbz, $orgform_kurzbz, $sprache) - { + /** + * _where + */ + private function _where($vorlage_kurzbz, $orgform_kurzbz, $sprache) + { // Builds where clause $where = "vorlage_kurzbz = ".$this->ci->VorlageModel->escape($vorlage_kurzbz); - + if (is_null($sprache)) { $where .= " AND sprache IS NULL"; @@ -152,60 +152,60 @@ class VorlageLib { $where .= " AND sprache = ".$this->ci->VorlageModel->escape($sprache); } - + $where .= " AND aktiv = true"; - + return $where; - } + } /** - * insertVorlagetext() - will load tbl_vorlagestudiengang for a spezific Template. - * - * @param string $vorlage_kurzbz REQUIRED - * @return array - */ - public function insertVorlagetext($data) + * insertVorlagetext() - will load tbl_vorlagestudiengang for a spezific Template. + * + * @param string $vorlage_kurzbz REQUIRED + * @return array + */ + public function insertVorlagetext($data) { - $vorlagetext = $this->ci->VorlageStudiengangModel->insert($data); - return $vorlagetext; - } + $vorlagetext = $this->ci->VorlageStudiengangModel->insert($data); + return $vorlagetext; + } /** - * loadVorlagetext() - will load tbl_vorlagestudiengang for a spezific Template. - * - * @param string $vorlage_kurzbz REQUIRED - * @return array - */ - public function getVorlagetextById($vorlagestudiengang_id) + * loadVorlagetext() - will load tbl_vorlagestudiengang for a spezific Template. + * + * @param string $vorlage_kurzbz REQUIRED + * @return array + */ + public function getVorlagetextById($vorlagestudiengang_id) { - $vorlagetext = $this->ci->VorlageStudiengangModel->load($vorlagestudiengang_id); - return $vorlagetext; - } + $vorlagetext = $this->ci->VorlageStudiengangModel->load($vorlagestudiengang_id); + return $vorlagetext; + } /** - * saveVorlagetext() - will load tbl_vorlagestudiengang for a spezific Template. - * - * @param string $vorlage_kurzbz REQUIRED - * @return array - */ - public function updateVorlagetext($vorlagestudiengang_id, $data) + * saveVorlagetext() - will load tbl_vorlagestudiengang for a spezific Template. + * + * @param string $vorlage_kurzbz REQUIRED + * @return array + */ + public function updateVorlagetext($vorlagestudiengang_id, $data) { - $vorlagetext = $this->ci->VorlageStudiengangModel->update($vorlagestudiengang_id, $data); - return $vorlagetext; - } + $vorlagetext = $this->ci->VorlageStudiengangModel->update($vorlagestudiengang_id, $data); + return $vorlagetext; + } /** - * parseVorlagetext() - will parse a Vorlagetext. - * - * @param string $text REQUIRED - * @param array $data REQUIRED - * @return string - */ - public function parseVorlagetext($text, $data = array()) + * parseVorlagetext() - will parse a Vorlagetext. + * + * @param string $text REQUIRED + * @param array $data REQUIRED + * @return string + */ + public function parseVorlagetext($text, $data = array()) { - if (empty($text)) - return error($this->ci->lang->line('fhc_'.FHC_INVALIDID, false)); + if (empty($text)) + return error($this->ci->lang->line('fhc_'.FHC_INVALIDID, false)); $text = $this->ci->parser->parse_string($text, $data, true); return $text; - } + } } diff --git a/application/models/system/PersonLock_model.php b/application/models/system/PersonLock_model.php index 1a3edd917..1d106b789 100644 --- a/application/models/system/PersonLock_model.php +++ b/application/models/system/PersonLock_model.php @@ -17,31 +17,29 @@ class PersonLock_model extends DB_Model } /** - * checks if a specific person is locked. By default, looks for any entries in locktable for the person. - * Alternatively, looks only for locks in a certain app + * Checks if a specific person is locked. By default, looks for entries with no app in locktable for the person. + * Alternatively, looks only for locks in a certain app. * @param $person_id * @param null $app * @return array all locks for a person if locked, null otherwise */ public function checkIfLocked($person_id, $app = null) { - $lockdata = $app === null ? array('person_id' => $person_id) : array('person_id' => $person_id, 'app' => $app); + $lockdata = array('person_id' => $person_id, 'app' => $app); $result = $this->loadWhere($lockdata); - if($result->error) + if ($result->error) return error($result->retval); + + if (count($result->retval) > 0) + return success($result->retval); else - { - if(count($result->retval) > 0) - return success($result->retval); - else - return success(null); - } + return success(null); } /** - * locks a person. returns null if person was not locked (e.g. when already locked) + * Locks a person. Returns null if person was not locked (e.g. when already locked). * @param $person_id * @param $uid user who locks the person * @param $app optional, application in which person is locked @@ -51,19 +49,19 @@ class PersonLock_model extends DB_Model { $locked = $this->checkIfLocked($person_id, $app); - if($locked->error) + if ($locked->error) return error($locked->retval); //insert only if not already locked - if($locked->retval === null) + if ($locked->retval === null) return $this->insert(array('person_id' => $person_id, 'uid' => $uid, 'app' => $app)); else return success(null); } /** - * remove a lock for a person. By default, removes any entries in locktable for the person - * Alternatively, removes only locks in a certain app + * Remove a lock for a person. By default, removes any entries in locktable for the person. + * Alternatively, removes only locks in a certain app. * @param $person_id * @param null $app * @return array deleted lock ids if person was locked, null otherwise @@ -79,7 +77,7 @@ class PersonLock_model extends DB_Model foreach ($locks->retval as $lock) { $result = $this->delete($lock->lock_id); - if($result->error) + if ($result->error) return error($result->retval); $deleted[] = $lock; diff --git a/application/models/system/Recipient_model.php b/application/models/system/Recipient_model.php index 40ef39f65..b9e170fbf 100644 --- a/application/models/system/Recipient_model.php +++ b/application/models/system/Recipient_model.php @@ -261,6 +261,7 @@ class Recipient_model extends DB_Model ks.kontakt as sender, kr.kontakt as receiver, mu.mitarbeiter_uid as employeeContact, + ms.mitarbeiter_uid as senderemployeeContact, mr.person_id as receiver_id, mr.token, mm.subject, @@ -278,7 +279,13 @@ class Recipient_model extends DB_Model m.mitarbeiter_uid FROM public.tbl_benutzer b INNER JOIN public.tbl_mitarbeiter m ON(b.uid = m.mitarbeiter_uid) WHERE b.aktiv = TRUE - ) mu ON (mu.person_id = mr.person_id)'; + ) mu ON (mu.person_id = mr.person_id) + LEFT JOIN ( + SELECT b.person_id, + m.mitarbeiter_uid + FROM public.tbl_benutzer b INNER JOIN public.tbl_mitarbeiter m ON(b.uid = m.mitarbeiter_uid) + WHERE b.aktiv = TRUE + ) ms ON (ms.person_id = mm.person_id)'; $parametersArray = array($kontaktType, $kontaktType); diff --git a/application/views/system/infocenter/infocenter.php b/application/views/system/infocenter/infocenter.php index a61e8b392..3ceaf1fa1 100644 --- a/application/views/system/infocenter/infocenter.php +++ b/application/views/system/infocenter/infocenter.php @@ -4,6 +4,7 @@ array( 'title' => 'Info Center', 'jquery' => true, + 'jqueryui' => true, 'bootstrap' => true, 'fontawesome' => true, 'sbadmintemplate' => true, diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 28b2d018e..540125560 100644 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -1,4 +1,7 @@ ' SELECT @@ -60,8 +63,10 @@ AND ps.person_id = p.person_id AND tbl_studiengang.typ in(\'b\') LIMIT 1 - ) AS "AnzahlAbgeschickt" + ) AS "AnzahlAbgeschickt", + pl.zeitpunkt AS "LockDate" FROM public.tbl_person p + LEFT JOIN (SELECT person_id, zeitpunkt FROM system.tbl_person_lock WHERE app = \''.$APP.'\') pl USING(person_id) WHERE EXISTS( SELECT 1 @@ -135,7 +140,24 @@ } } + if ($fieldName == 'LockDate') + { + if ($datasetRaw->{$fieldName} == '01.01.1970 01:00:00') + { + $datasetRaw->{$fieldName} = 'Not locked'; + } + } + return $datasetRaw; + }, + 'markRow' => function($datasetRaw) { + + if ($datasetRaw->LockDate != '') + { + return true; + } + + return false; } ); @@ -147,7 +169,7 @@ } else { - $filterWidgetArray['app'] = 'infocenter'; + $filterWidgetArray['app'] = $APP; $filterWidgetArray['datasetName'] = 'PersonActions'; $filterWidgetArray['filterKurzbz'] = 'InfoCenterNotSentApplicationAll'; } diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php index 0db3a7cdb..6b672cd87 100644 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -36,7 +36,7 @@ ?>