mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-15 02:59:28 +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:
@@ -215,6 +215,31 @@ class MessageLib
|
||||
|
||||
return $messageVars; // otherwise returns the error
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves message vars of the logged in user from view vw_msg_vars_user
|
||||
*/
|
||||
public function getMessageVarsLoggedInUser()
|
||||
{
|
||||
// Retrieves message vars from view vw_msg_vars
|
||||
$messageVars = $this->_ci->MessageModel->getMsgVarsDataLoggedInUser();
|
||||
if (isSuccess($messageVars)) // if everything is ok
|
||||
{
|
||||
$variablesArray = array();
|
||||
$tmpVariablesArray = getData($messageVars);
|
||||
|
||||
// Starts from 1 to skip the first element which is uid
|
||||
for ($i = 1; $i < count($tmpVariablesArray); $i++)
|
||||
{
|
||||
$variablesArray['{my_'.str_replace(' ', '_', strtolower($tmpVariablesArray[$i])).'}']
|
||||
= 'my_'. strtoupper($tmpVariablesArray[$i]);
|
||||
}
|
||||
|
||||
return success($variablesArray);
|
||||
}
|
||||
|
||||
return $messageVars; // otherwise returns the error
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves organisation units for each role that a user plays inside that organisation unit
|
||||
|
||||
Reference in New Issue
Block a user