mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-21 17:02:19 +00:00
Added logic to provide fields of logged in user in Messaging system
Signed-off-by: Cris <hainberg@technikum-wien.at>
This commit is contained in:
@@ -833,6 +833,26 @@ class Messages_model extends CI_Model
|
||||
|
||||
$variables[] = $tmpVar;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Retrieves message vars of logged in user from database view vw_msg_vars_person
|
||||
$result = null;
|
||||
|
||||
// If data contains a prestudent id
|
||||
$result = $this->messagelib->getMessageVarsLoggedInUser();
|
||||
|
||||
if (isError($result)) show_error(getError($result));
|
||||
|
||||
// Then builds an array that contains objects with field name and field description of logged in user data
|
||||
$user_fields = array();
|
||||
foreach (getData($result) as $id => $description)
|
||||
{
|
||||
$obj = new stdClass();
|
||||
$obj->id = $id;
|
||||
$obj->description = $description;
|
||||
|
||||
$user_fields[] = $obj;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Retrieves the sender id
|
||||
@@ -853,6 +873,7 @@ class Messages_model extends CI_Model
|
||||
'subject' => $replySubject,
|
||||
'body' => $replyBody,
|
||||
'variables' => $variables,
|
||||
'user_fields' => $user_fields,
|
||||
'organisationUnits' => getData($organisationUnits),
|
||||
'senderIsAdmin' => getData($senderIsAdmin),
|
||||
'recipientsArray' => $recipientsArray,
|
||||
|
||||
Reference in New Issue
Block a user