mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 02:12:17 +00:00
Merge branch 'master' of https://github.com/FH-Complete/FHC-Core
This commit is contained in:
@@ -207,6 +207,7 @@ $config['fhc_acl'] = array
|
||||
'system.tbl_udf' => 'system/udf',
|
||||
'system.tbl_extensions' => 'system/extensions',
|
||||
'system.tbl_log' => 'basis/log',
|
||||
'system.tbl_person_lock' => 'system/personlock',
|
||||
'testtool.tbl_ablauf' => 'basis/ablauf',
|
||||
'testtool.tbl_antwort' => 'basis/antwort',
|
||||
'testtool.tbl_frage' => 'basis/frage',
|
||||
|
||||
@@ -55,7 +55,8 @@ $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'
|
||||
'lehre/studienplan','system/filters','fs/dms','basis/message','basis/benutzerrolle', 'basis/sprache',
|
||||
'system/personlock'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -10,19 +10,19 @@ class Messages extends VileSci_Controller
|
||||
*
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Loads the message library
|
||||
$this->load->library('MessageLib');
|
||||
// Loads the message library
|
||||
$this->load->library('MessageLib');
|
||||
|
||||
// Loads the widget library
|
||||
// Loads the widget library
|
||||
$this->load->library('WidgetLib');
|
||||
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
|
||||
$this->_setAuthUID(); // sets property uid
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* write
|
||||
|
||||
@@ -64,10 +64,12 @@ class InfoCenter extends VileSci_Controller
|
||||
$this->load->model('person/person_model', 'PersonModel');
|
||||
$this->load->model('system/message_model', 'MessageModel');
|
||||
$this->load->model('system/filters_model', 'FiltersModel');
|
||||
$this->load->model('system/personLock_model', 'PersonLockModel');
|
||||
|
||||
// Loads libraries
|
||||
$this->load->library('DmsLib');
|
||||
$this->load->library('PersonLogLib');
|
||||
$this->load->library('MailLib');
|
||||
$this->load->library('WidgetLib');
|
||||
|
||||
$this->_setAuthUID(); // sets property uid
|
||||
@@ -110,10 +112,20 @@ class InfoCenter extends VileSci_Controller
|
||||
if (!is_numeric($person_id))
|
||||
show_error('person id is not numeric!');
|
||||
|
||||
$persondata = $this->_loadPersonData($person_id);
|
||||
if (!isset($persondata))
|
||||
$personexists = $this->PersonModel->load($person_id);
|
||||
if(isError($personexists))
|
||||
show_error($personexists->retval);
|
||||
|
||||
if (empty($personexists->retval[0]))
|
||||
show_error('person does not exist!');
|
||||
|
||||
//mark person as locked for editing
|
||||
$result = $this->PersonLockModel->lockPerson($person_id, $this->uid, self::APP);
|
||||
|
||||
if(isError($result))
|
||||
show_error($result->retval);
|
||||
|
||||
$persondata = $this->_loadPersonData($person_id);
|
||||
$prestudentdata = $this->_loadPrestudentData($person_id);
|
||||
|
||||
$this->load->view(
|
||||
@@ -129,6 +141,20 @@ class InfoCenter extends VileSci_Controller
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* unlocks page from edit by a person, redirects to overview filter page
|
||||
* @param $person_id
|
||||
*/
|
||||
public function unlockPerson($person_id)
|
||||
{
|
||||
$result = $this->PersonLockModel->unlockPerson($person_id, self::APP);
|
||||
|
||||
if(isError($result))
|
||||
show_error($result->retval);
|
||||
|
||||
redirect(self::URL_PREFIX);
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves if a document has been formal geprueft. saves current timestamp if checked as geprueft, or null if not.
|
||||
*/
|
||||
@@ -235,7 +261,7 @@ class InfoCenter extends VileSci_Controller
|
||||
}
|
||||
|
||||
//check if still Interessent and not freigegeben yet
|
||||
if($lastStatus->retval[0]->status_kurzbz === 'Interessent' && !isset($lastStatus->retval[0]->bestaetigtam))
|
||||
if ($lastStatus->retval[0]->status_kurzbz === 'Interessent' && !isset($lastStatus->retval[0]->bestaetigtam))
|
||||
{
|
||||
$result = $this->PrestudentstatusModel->insert(
|
||||
array(
|
||||
@@ -288,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(
|
||||
@@ -517,6 +543,25 @@ class InfoCenter extends VileSci_Controller
|
||||
*/
|
||||
private function _loadPersonData($person_id)
|
||||
{
|
||||
$locked = $this->PersonLockModel->checkIfLocked($person_id, self::APP);
|
||||
|
||||
if (isError($locked))
|
||||
{
|
||||
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);
|
||||
|
||||
if (isError($stammdaten))
|
||||
@@ -567,6 +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' => $lockedby,
|
||||
'lockedbyother' => $lockedbyother,
|
||||
'stammdaten' => $stammdaten->retval,
|
||||
'dokumente' => $dokumente->retval,
|
||||
'dokumente_nachgereicht' => $dokumente_nachgereicht->retval,
|
||||
@@ -606,7 +653,7 @@ class InfoCenter extends VileSci_Controller
|
||||
|
||||
$zgvpruefung = $prestudent->retval[0];
|
||||
|
||||
if(isset($zgvpruefung->prestudentstatus))
|
||||
if (isset($zgvpruefung->prestudentstatus))
|
||||
{
|
||||
$position = strpos($zgvpruefung->prestudentstatus->anmerkung, 'Alt:');
|
||||
|
||||
@@ -708,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');
|
||||
}*/
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ class LogLib
|
||||
$function = $backtrace_arr[$functionIndex]['function'];
|
||||
}
|
||||
|
||||
if (isset($backtrace_arr[$lineIndex]['line']) && $backgrace_arr[$lineIndex]['line'] != '')
|
||||
if (isset($backtrace_arr[$lineIndex]['line']) && $backtrace_arr[$lineIndex]['line'] != '')
|
||||
{
|
||||
$line = $backtrace_arr[$lineIndex]['line'];
|
||||
}
|
||||
|
||||
@@ -58,6 +58,14 @@ class MailLib
|
||||
$alias = $this->alias_from_system;
|
||||
}
|
||||
}
|
||||
if (defined('MAIL_FROM') && MAIL_FROM != '')
|
||||
{
|
||||
$from = MAIL_FROM;
|
||||
if (is_null($alias) || $alias == '')
|
||||
{
|
||||
$alias = $this->alias_from_system;
|
||||
}
|
||||
}
|
||||
|
||||
$this->ci->email->from($from, $alias);
|
||||
|
||||
@@ -65,12 +73,14 @@ class MailLib
|
||||
$recipient = $to;
|
||||
$recipientCC = $cc;
|
||||
$recipientBCC = $bcc;
|
||||
if ($this->validateEmailAddress(MAIL_DEBUG))
|
||||
if (defined('MAIL_DEBUG') && MAIL_DEBUG != '')
|
||||
{
|
||||
// if is it valid use it!!!
|
||||
$recipient = MAIL_DEBUG;
|
||||
$recipientCC = MAIL_DEBUG;
|
||||
$recipientBCC = MAIL_DEBUG;
|
||||
if ($recipientCC != '')
|
||||
$recipientCC = MAIL_DEBUG;
|
||||
if ($recipientBCC != '')
|
||||
$recipientBCC = MAIL_DEBUG;
|
||||
}
|
||||
|
||||
$this->ci->email->to($recipient);
|
||||
|
||||
@@ -15,7 +15,7 @@ class MessageLib
|
||||
public function __construct()
|
||||
{
|
||||
// Get code igniter instance
|
||||
$this->ci =& get_instance();
|
||||
$this->ci =& get_instance();
|
||||
|
||||
// Loads message configuration
|
||||
$this->ci->config->load('message');
|
||||
@@ -41,70 +41,70 @@ class MessageLib
|
||||
$this->ci->load->helper('message');
|
||||
|
||||
// Loads phrases
|
||||
$this->ci->lang->load('message');
|
||||
}
|
||||
$this->ci->lang->load('message');
|
||||
}
|
||||
|
||||
/**
|
||||
* getMessage() - returns the specified received message for a specified person
|
||||
*/
|
||||
public function getMessage($msg_id, $person_id)
|
||||
{
|
||||
if (empty($msg_id))
|
||||
return $this->_error('', MSG_ERR_INVALID_MSG_ID);
|
||||
/**
|
||||
* getMessage() - returns the specified received message for a specified person
|
||||
*/
|
||||
public function getMessage($msg_id, $person_id)
|
||||
{
|
||||
if (empty($msg_id))
|
||||
return $this->_error('', MSG_ERR_INVALID_MSG_ID);
|
||||
if (empty($person_id))
|
||||
return $this->_error('', MSG_ERR_INVALID_RECIPIENTS);
|
||||
return $this->_error('', MSG_ERR_INVALID_RECIPIENTS);
|
||||
|
||||
$msg = $this->ci->RecipientModel->getMessage($msg_id, $person_id);
|
||||
|
||||
return $msg;
|
||||
}
|
||||
return $msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* getMessagesByUID() - will return all messages, including the latest status for specified user. It don´t returns Attachments.
|
||||
*/
|
||||
public function getMessagesByUID($uid, $oe_kurzbz = null, $all = false)
|
||||
{
|
||||
if (empty($uid))
|
||||
return $this->_error('', MSG_ERR_INVALID_MSG_ID);
|
||||
* getMessagesByUID() - will return all messages, including the latest status for specified user. It don´t returns Attachments.
|
||||
*/
|
||||
public function getMessagesByUID($uid, $oe_kurzbz = null, $all = false)
|
||||
{
|
||||
if (empty($uid))
|
||||
return $this->_error('', MSG_ERR_INVALID_MSG_ID);
|
||||
|
||||
$msg = $this->ci->RecipientModel->getMessagesByUID($uid, $oe_kurzbz, $all);
|
||||
|
||||
return $msg;
|
||||
}
|
||||
return $msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* getMessagesByPerson() - will return all messages, including the latest status for specified user. It don´t returns Attachments.
|
||||
*/
|
||||
public function getMessagesByPerson($person_id, $oe_kurzbz = null, $all = false)
|
||||
{
|
||||
if (empty($person_id))
|
||||
return $this->_error('', MSG_ERR_INVALID_MSG_ID);
|
||||
* getMessagesByPerson() - will return all messages, including the latest status for specified user. It don´t returns Attachments.
|
||||
*/
|
||||
public function getMessagesByPerson($person_id, $oe_kurzbz = null, $all = false)
|
||||
{
|
||||
if (empty($person_id))
|
||||
return $this->_error('', MSG_ERR_INVALID_MSG_ID);
|
||||
|
||||
$msg = $this->ci->RecipientModel->getMessagesByPerson($person_id, $oe_kurzbz, $all);
|
||||
|
||||
return $msg;
|
||||
}
|
||||
return $msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* getSentMessagesByPerson() - Get all sent messages from a person identified by person_id
|
||||
*/
|
||||
public function getSentMessagesByPerson($person_id, $oe_kurzbz = null, $all = false)
|
||||
{
|
||||
if (empty($person_id))
|
||||
return $this->_error('', MSG_ERR_INVALID_MSG_ID);
|
||||
* getSentMessagesByPerson() - Get all sent messages from a person identified by person_id
|
||||
*/
|
||||
public function getSentMessagesByPerson($person_id, $oe_kurzbz = null, $all = false)
|
||||
{
|
||||
if (empty($person_id))
|
||||
return $this->_error('', MSG_ERR_INVALID_MSG_ID);
|
||||
|
||||
$msg = $this->ci->MessageModel->getMessagesByPerson($person_id, $oe_kurzbz, $all);
|
||||
|
||||
return $msg;
|
||||
}
|
||||
return $msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* getMessageByToken
|
||||
*/
|
||||
public function getMessageByToken($token)
|
||||
{
|
||||
if (empty($token))
|
||||
return $this->_error('', MSG_ERR_INVALID_TOKEN);
|
||||
* getMessageByToken
|
||||
*/
|
||||
public function getMessageByToken($token)
|
||||
{
|
||||
if (empty($token))
|
||||
return $this->_error('', MSG_ERR_INVALID_TOKEN);
|
||||
|
||||
$result = $this->ci->RecipientModel->getMessageByToken($token);
|
||||
if (hasData($result))
|
||||
@@ -138,43 +138,43 @@ class MessageLib
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* getCountUnreadMessages
|
||||
*/
|
||||
public function getCountUnreadMessages($person_id, $oe_kurzbz = null)
|
||||
{
|
||||
if (!is_numeric($person_id))
|
||||
return $this->_error('', MSG_ERR_INVALID_RECIPIENTS);
|
||||
/**
|
||||
* getCountUnreadMessages
|
||||
*/
|
||||
public function getCountUnreadMessages($person_id, $oe_kurzbz = null)
|
||||
{
|
||||
if (!is_numeric($person_id))
|
||||
return $this->_error('', MSG_ERR_INVALID_RECIPIENTS);
|
||||
|
||||
$msg = $this->ci->RecipientModel->getCountUnreadMessages($person_id, $oe_kurzbz);
|
||||
|
||||
return $msg;
|
||||
}
|
||||
return $msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* updateMessageStatus() - will change status on message for particular user
|
||||
/**
|
||||
* updateMessageStatus() - will change status on message for particular user
|
||||
* NOTE: it performs an insert, NOT an update
|
||||
*/
|
||||
public function updateMessageStatus($message_id, $person_id, $status)
|
||||
{
|
||||
if (empty($message_id))
|
||||
{
|
||||
return $this->_error('', MSG_ERR_INVALID_MSG_ID);
|
||||
}
|
||||
*/
|
||||
public function updateMessageStatus($message_id, $person_id, $status)
|
||||
{
|
||||
if (empty($message_id))
|
||||
{
|
||||
return $this->_error('', MSG_ERR_INVALID_MSG_ID);
|
||||
}
|
||||
|
||||
if (empty($person_id))
|
||||
{
|
||||
return $this->_error('', MSG_ERR_INVALID_USER_ID);
|
||||
}
|
||||
if (empty($person_id))
|
||||
{
|
||||
return $this->_error('', MSG_ERR_INVALID_USER_ID);
|
||||
}
|
||||
|
||||
// NOTE: Not use empty otherwise if status is 0 it returns an error
|
||||
if (!isset($status))
|
||||
{
|
||||
return $this->_error('', MSG_ERR_INVALID_STATUS_ID);
|
||||
}
|
||||
if (!isset($status))
|
||||
{
|
||||
return $this->_error('', MSG_ERR_INVALID_STATUS_ID);
|
||||
}
|
||||
|
||||
// Searches if the status is already present
|
||||
$result = $this->ci->MsgStatusModel->load(array($message_id, $person_id, $status));
|
||||
@@ -195,17 +195,17 @@ class MessageLib
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* sendMessage() - sends new internal message. This function will create a new thread
|
||||
*/
|
||||
public function sendMessage($sender_id, $receiver_id, $subject, $body, $priority = PRIORITY_NORMAL, $relationmessage_id = null, $oe_kurzbz = null, $multiPartMime = true)
|
||||
{
|
||||
if (!is_numeric($sender_id))
|
||||
{
|
||||
/**
|
||||
* sendMessage() - sends new internal message. This function will create a new thread
|
||||
*/
|
||||
public function sendMessage($sender_id, $receiver_id, $subject, $body, $priority = PRIORITY_NORMAL, $relationmessage_id = null, $oe_kurzbz = null, $multiPartMime = true)
|
||||
{
|
||||
if (!is_numeric($sender_id))
|
||||
{
|
||||
$sender_id = $this->ci->config->item('system_person_id');
|
||||
}
|
||||
}
|
||||
|
||||
$receivers = $this->_getReceivers($receiver_id, $oe_kurzbz);
|
||||
|
||||
@@ -270,17 +270,17 @@ class MessageLib
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* sendMessageVorlage() - sends new internal message using a template
|
||||
*/
|
||||
public function sendMessageVorlage($sender_id, $receiver_id, $vorlage_kurzbz, $oe_kurzbz, $data, $relationmessage_id = null, $orgform_kurzbz = null, $multiPartMime = true)
|
||||
{
|
||||
if (!is_numeric($sender_id))
|
||||
{
|
||||
* sendMessageVorlage() - sends new internal message using a template
|
||||
*/
|
||||
public function sendMessageVorlage($sender_id, $receiver_id, $vorlage_kurzbz, $oe_kurzbz, $data, $relationmessage_id = null, $orgform_kurzbz = null, $multiPartMime = true)
|
||||
{
|
||||
if (!is_numeric($sender_id))
|
||||
{
|
||||
$sender_id = $this->ci->config->item('system_person_id');
|
||||
}
|
||||
}
|
||||
|
||||
$receivers = $this->_getReceivers($receiver_id, $oe_kurzbz);
|
||||
|
||||
@@ -387,7 +387,7 @@ class MessageLib
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all the messages from DB and sends them via email
|
||||
@@ -464,16 +464,16 @@ class MessageLib
|
||||
$sender = $result->retval[0]->sender;
|
||||
}
|
||||
|
||||
$receiverContanct = $result->retval[$i]->receiver;
|
||||
$receiverContact = $result->retval[$i]->receiver;
|
||||
if (!is_null($result->retval[$i]->employeecontact) && $result->retval[$i]->employeecontact != '')
|
||||
{
|
||||
$receiverContanct = $result->retval[$i]->employeecontact.'@'.DOMAIN;
|
||||
$receiverContact = $result->retval[$i]->employeecontact.'@'.DOMAIN;
|
||||
}
|
||||
|
||||
// Sending email
|
||||
$sent = $this->ci->maillib->send(
|
||||
$sender,
|
||||
$receiverContanct,
|
||||
$receiverContact,
|
||||
$result->retval[$i]->subject,
|
||||
$body,
|
||||
null,
|
||||
@@ -613,16 +613,16 @@ class MessageLib
|
||||
$sender = $result->retval[0]->sender;
|
||||
}
|
||||
|
||||
$receiverContanct = $result->retval[0]->receiver;
|
||||
$receiverContact = $result->retval[0]->receiver;
|
||||
if (!is_null($result->retval[0]->employeecontact) && $result->retval[0]->employeecontact != '')
|
||||
{
|
||||
$receiverContanct = $result->retval[0]->employeecontact.'@'.DOMAIN;
|
||||
$receiverContact = $result->retval[0]->employeecontact.'@'.DOMAIN;
|
||||
}
|
||||
|
||||
// Sending email
|
||||
$sent = $this->ci->maillib->send(
|
||||
$sender,
|
||||
$receiverContanct,
|
||||
$receiverContact,
|
||||
is_null($subject) ? $result->retval[0]->subject : $subject, // if parameter subject is not null, use it!
|
||||
$bodyMsg,
|
||||
null,
|
||||
@@ -689,8 +689,8 @@ class MessageLib
|
||||
return $sent;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Private methods
|
||||
// ------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Update the table tbl_msg_recipient
|
||||
@@ -736,29 +736,29 @@ class MessageLib
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the receivers id that are enabled to read messages for that oe_kurzbz
|
||||
*/
|
||||
private function _getReceiversByOekurzbz($oe_kurzbz)
|
||||
{
|
||||
* Gets the receivers id that are enabled to read messages for that oe_kurzbz
|
||||
*/
|
||||
private function _getReceiversByOekurzbz($oe_kurzbz)
|
||||
{
|
||||
// Load Benutzerfunktion_model
|
||||
$this->ci->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
|
||||
// Join with table public.tbl_benutzer on field uid
|
||||
$this->ci->BenutzerfunktionModel->addJoin('public.tbl_benutzer', 'uid');
|
||||
// Get all the valid receivers id using the oe_kurzbz
|
||||
$receivers = $this->ci->BenutzerfunktionModel->loadWhere(
|
||||
'oe_kurzbz = \''.$oe_kurzbz.'\''.
|
||||
' AND funktion_kurzbz = \''.$this->ci->config->item('assistent_function').'\''.
|
||||
'oe_kurzbz = '.$this->ci->db->escape($oe_kurzbz).
|
||||
' AND funktion_kurzbz = '.$this->ci->db->escape($this->ci->config->item('assistent_function')).
|
||||
' AND (NOW() BETWEEN COALESCE(datum_von, NOW()) AND COALESCE(datum_bis, NOW()))'
|
||||
);
|
||||
|
||||
return $receivers;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the receivers id
|
||||
*/
|
||||
private function _getReceivers($receiver_id, $oe_kurzbz = null)
|
||||
{
|
||||
/**
|
||||
* Gets the receivers id
|
||||
*/
|
||||
private function _getReceivers($receiver_id, $oe_kurzbz = null)
|
||||
{
|
||||
$receivers = null;
|
||||
|
||||
// If no receiver_id is given...
|
||||
@@ -782,13 +782,13 @@ class MessageLib
|
||||
}
|
||||
|
||||
return $receivers;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given receiver id is a valid person
|
||||
*/
|
||||
private function _checkReceiverId($receiver_id)
|
||||
{
|
||||
/**
|
||||
* Checks if the given receiver id is a valid person
|
||||
*/
|
||||
private function _checkReceiverId($receiver_id)
|
||||
{
|
||||
// Load Person_model
|
||||
$this->ci->load->model('person/Person_model', 'PersonModel');
|
||||
$result = $this->ci->PersonModel->load($receiver_id);
|
||||
@@ -798,13 +798,13 @@ class MessageLib
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save a message in DB
|
||||
**/
|
||||
private function _saveMessage($sender_id, $receiver_id, $subject, $body, $relationmessage_id, $oe_kurzbz)
|
||||
{
|
||||
/**
|
||||
* Save a message in DB
|
||||
**/
|
||||
private function _saveMessage($sender_id, $receiver_id, $subject, $body, $relationmessage_id, $oe_kurzbz)
|
||||
{
|
||||
// Starts db transaction
|
||||
$this->ci->db->trans_start(false);
|
||||
|
||||
@@ -854,27 +854,27 @@ class MessageLib
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper for function error
|
||||
*/
|
||||
private function _error($retval = '', $code = null)
|
||||
{
|
||||
/**
|
||||
* Wrapper for function error
|
||||
*/
|
||||
private function _error($retval = '', $code = null)
|
||||
{
|
||||
return error($retval, $code, MessageLib::MSG_INDX_PREFIX);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper for function success
|
||||
*/
|
||||
private function _success($retval = '', $code = null)
|
||||
{
|
||||
/**
|
||||
* Wrapper for function success
|
||||
*/
|
||||
private function _success($retval = '', $code = null)
|
||||
{
|
||||
return success($retval, $code, MessageLib::MSG_INDX_PREFIX);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function parseMessageText($text, $data = array())
|
||||
{
|
||||
return $this->ci->parser->parse_string($text, $data, true);
|
||||
|
||||
@@ -209,5 +209,4 @@ class Person_model extends DB_Model
|
||||
|
||||
return $this->loadWhere(array('uid' => $uid));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Enables content locking.
|
||||
* An entry in the locktable means certain content is marked locked and a user is its editor.
|
||||
*/
|
||||
class PersonLock_model extends DB_Model
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'system.tbl_person_lock';
|
||||
$this->pk = 'lock_id';
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 = array('person_id' => $person_id, 'app' => $app);
|
||||
|
||||
$result = $this->loadWhere($lockdata);
|
||||
|
||||
if ($result->error)
|
||||
return error($result->retval);
|
||||
|
||||
if (count($result->retval) > 0)
|
||||
return success($result->retval);
|
||||
else
|
||||
return success(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @return array inserted lock id if person was locked, null otherwise
|
||||
*/
|
||||
public function lockPerson($person_id, $uid, $app = null)
|
||||
{
|
||||
$locked = $this->checkIfLocked($person_id, $app);
|
||||
|
||||
if ($locked->error)
|
||||
return error($locked->retval);
|
||||
|
||||
//insert only if not already locked
|
||||
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.
|
||||
* @param $person_id
|
||||
* @param null $app
|
||||
* @return array deleted lock ids if person was locked, null otherwise
|
||||
*/
|
||||
public function unlockPerson($person_id, $app = null)
|
||||
{
|
||||
$deleted = array();
|
||||
$locks = $this->checkIfLocked($person_id, $app);
|
||||
|
||||
if ($locks->retval === null)
|
||||
return success(null);
|
||||
|
||||
foreach ($locks->retval as $lock)
|
||||
{
|
||||
$result = $this->delete($lock->lock_id);
|
||||
if ($result->error)
|
||||
return error($result->retval);
|
||||
|
||||
$deleted[] = $lock;
|
||||
}
|
||||
|
||||
return success($deleted);
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@
|
||||
'sbadmintemplate' => true,
|
||||
'tablesorter' => true,
|
||||
'customCSSs' => 'skin/tablesort_bootstrap.css',
|
||||
'customJSs' => array('include/js/infocenterPersonDataset.js', 'include/js/bootstrapper.js')
|
||||
'customJSs' => array('include/js/bootstrapper.js', 'include/js/infocenter/infocenterPersonDataset.js')
|
||||
)
|
||||
);
|
||||
?>
|
||||
@@ -41,9 +41,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$("#tableDataset").addClass('table table-bordered table-responsive');
|
||||
</script>
|
||||
</body>
|
||||
|
||||
<?php $this->load->view('templates/FHC-Footer'); ?>
|
||||
|
||||
@@ -1,19 +1,27 @@
|
||||
<?php
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
'title' => 'InfocenterDetails',
|
||||
'jquery' => true,
|
||||
'bootstrap' => true,
|
||||
'fontawesome' => true,
|
||||
'jqueryui' => true,
|
||||
'tablesorter' => true,
|
||||
'tinymce' => true,
|
||||
'sbadmintemplate' => true,
|
||||
'customCSSs' => array('skin/admintemplate.css', 'skin/tablesort_bootstrap.css'),
|
||||
'customJSs' => 'include/js/bootstrapper.js'
|
||||
)
|
||||
);
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
'title' => 'InfocenterDetails',
|
||||
'jquery' => true,
|
||||
'bootstrap' => true,
|
||||
'fontawesome' => true,
|
||||
'jqueryui' => true,
|
||||
'tablesorter' => true,
|
||||
'tinymce' => true,
|
||||
'sbadmintemplate' => true,
|
||||
'customCSSs' =>
|
||||
array(
|
||||
'skin/admintemplate.css',
|
||||
'skin/tablesort_bootstrap.css'
|
||||
),
|
||||
'customJSs' =>
|
||||
array(
|
||||
'include/js/bootstrapper.js',
|
||||
'include/js/tablesort/tablesort.js',
|
||||
'include/js/infocenter/infocenterDetails.js')
|
||||
)
|
||||
);
|
||||
?>
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
@@ -28,13 +36,26 @@ $this->load->view(
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h3 class="page-header">Infocenter
|
||||
Details: <?php echo $stammdaten->vorname.' '.$stammdaten->nachname ?>
|
||||
</h3>
|
||||
<div class="row<?php if($lockedbyother) echo ' alert-danger' ?>">
|
||||
<div class="col-lg-8">
|
||||
<h3 class="page-header">
|
||||
Infocenter Details: <?php echo $stammdaten->vorname.' '.$stammdaten->nachname ?>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="headerright text-right">
|
||||
wird bearbeitet von:
|
||||
<?php
|
||||
if(isset($lockedby)):
|
||||
echo $lockedby;
|
||||
?>
|
||||
|
||||
<a href="../unlockPerson/<?php echo $stammdaten->person_id; ?>"><i class="fa fa-sign-out"></i> Freigeben</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<section>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
@@ -124,27 +145,9 @@ $this->load->view(
|
||||
</div> <!-- ./wrapper -->
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(
|
||||
function ()
|
||||
{
|
||||
//initialise table sorter
|
||||
addTablesorter("doctable", [[2, 1], [1, 0]], ["zebra"]);
|
||||
addTablesorter("nachgdoctable", [[2, 0], [1, 1]], ["zebra"]);
|
||||
addTablesorter("msgtable", [[0, 1], [2, 0]], ["zebra", "filter"]);
|
||||
addTablesorter("logtable", [[0, 1]], ["filter"]);
|
||||
addTablesorter("notiztable", [[0, 1]], ["filter"]);
|
||||
|
||||
//add pager
|
||||
togglePager(23, "logtable", "logpager");
|
||||
togglePager(10, "notiztable", "notizpager");
|
||||
|
||||
//initialise datepicker
|
||||
$.datepicker.setDefaults($.datepicker.regional['de']);
|
||||
$(".dateinput").datepicker({
|
||||
"dateFormat": "dd.mm.yy"
|
||||
});
|
||||
|
||||
//add click events to "formal geprüft" checkboxes
|
||||
<?php foreach($dokumente as $dokument): ?>
|
||||
|
||||
@@ -157,75 +160,8 @@ $this->load->view(
|
||||
}
|
||||
<?php endforeach ?>
|
||||
|
||||
//prevent opening modal when Statusgrund not chosen
|
||||
$("#absageModal").on('show.bs.modal', function (e)
|
||||
{
|
||||
if ($("[name=statusgrund]").val() === "null")
|
||||
{
|
||||
$("#statusgrselect").addClass("has-error");
|
||||
return e.preventDefault();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$("[name=statusgrund]").change(function ()
|
||||
{
|
||||
$("#statusgrselect").removeClass("has-error");
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
function addTablesorter(tableid, sortList, widgets)
|
||||
{
|
||||
$("#" + tableid).tablesorter(
|
||||
{
|
||||
theme: "default",
|
||||
dateFormat: "ddmmyyyy",
|
||||
sortList: sortList,
|
||||
widgets: widgets
|
||||
}
|
||||
);
|
||||
|
||||
//hide filters if less than 2 datarows (+ 2 for headings and filter row itself)
|
||||
if ($("#" + tableid + " tr").length < 4)
|
||||
{
|
||||
$("#" + tableid + " tr.tablesorter-filter-row").hide();
|
||||
}
|
||||
}
|
||||
|
||||
function togglePager(size, tableid, pagerid)
|
||||
{
|
||||
var html =
|
||||
'<div id="' + pagerid + '" class="pager"> ' +
|
||||
'<form class="form-inline">' +
|
||||
'<i class="fa fa-step-backward first"></i> ' +
|
||||
'<i class="fa fa-backward prev"></i>' +
|
||||
'<span class="pagedisplay"></span>' +
|
||||
'<i class="fa fa-forward next"></i> ' +
|
||||
'<i class="fa fa-step-forward last"></i>' +
|
||||
'</form>' +
|
||||
'</div>';
|
||||
|
||||
var rowcount = $("#" + tableid + " tr").length;
|
||||
|
||||
//not show pager if on first table page
|
||||
if (rowcount > size)
|
||||
{
|
||||
var table = $("#" + tableid);
|
||||
table.after(html);
|
||||
|
||||
table.tablesorterPager(
|
||||
{
|
||||
container: $("#" + pagerid),
|
||||
size: size,
|
||||
cssDisabled: 'disabled',
|
||||
savePages: false,
|
||||
output: '{startRow} – {endRow} / {totalRows} Zeilen'
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
||||
@@ -80,7 +80,9 @@
|
||||
<?php echo isset($adresse) ? $adresse->strasse.', '.$adresse->plz.' '.$adresse->ort : '' ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo ($adresse->heimatadresse === true ? 'Heimatadresse' : '').($adresse->heimatadresse === true && $adresse->rechnungsadresse === true ? ', ' : '').($adresse->rechnungsadresse === true ? 'Rechnungsadresse' : ''); ?>
|
||||
<?php echo ($adresse->heimatadresse === true ? 'Heimatadresse' : '').
|
||||
($adresse->heimatadresse === true && $adresse->rechnungsadresse === true ? ', ' : '').
|
||||
($adresse->rechnungsadresse === true ? 'Rechnungsadresse' : ''); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
@@ -103,13 +105,4 @@
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
//add submit event to message send link
|
||||
$("#sendmsglink").click(
|
||||
function ()
|
||||
{
|
||||
$("#sendmsgform").submit();
|
||||
}
|
||||
);
|
||||
</script>
|
||||
</div>
|
||||
@@ -35,7 +35,7 @@
|
||||
<?php
|
||||
if (isset($zgvpruefung->prestudentstatus->status_kurzbz))
|
||||
{
|
||||
echo $zgvpruefung->prestudentstatus->status_kurzbz.(isset($zgvpruefung->prestudentstatus->bezeichnung_statusgrund[0]) && $zgvpruefung->prestudentstatus->status_kurzbz === 'Abgewiesener' ? ' ('.$zgvpruefung->prestudentstatus->bezeichnung_statusgrund[0].')' : '');
|
||||
echo $zgvpruefung->prestudentstatus->status_kurzbz.(isset($zgvpruefung->prestudentstatus->bezeichnung_statusgrund[0]) ? ' ('.$zgvpruefung->prestudentstatus->bezeichnung_statusgrund[0].')' : '');
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
@@ -57,12 +57,12 @@
|
||||
<div class="form-group">
|
||||
<label>Orgform: </label>
|
||||
<span style="display: inline-block">
|
||||
<?php
|
||||
$separator = (isset($zgvpruefung->prestudentstatus->orgform)) ? ', ' : '';
|
||||
echo (isset($zgvpruefung->prestudentstatus->orgform) ? $zgvpruefung->prestudentstatus->orgform : '')
|
||||
.(isset($zgvpruefung->prestudentstatus->sprachedetails->bezeichnung) ? $separator.$zgvpruefung->prestudentstatus->sprachedetails->bezeichnung[0] : '')
|
||||
.(isset($zgvpruefung->prestudentstatus->alternative) ? ' ('.$zgvpruefung->prestudentstatus->alternative.')' : '') ?>
|
||||
</span>
|
||||
<?php
|
||||
$separator = (isset($zgvpruefung->prestudentstatus->orgform)) ? ', ' : '';
|
||||
echo (isset($zgvpruefung->prestudentstatus->orgform) ? $zgvpruefung->prestudentstatus->orgform : '')
|
||||
.(isset($zgvpruefung->prestudentstatus->sprachedetails->bezeichnung) ? $separator.$zgvpruefung->prestudentstatus->sprachedetails->bezeichnung[0] : '')
|
||||
.(isset($zgvpruefung->prestudentstatus->alternative) ? ' ('.$zgvpruefung->prestudentstatus->alternative.')' : '') ?>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user