mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-15 19:19:28 +00:00
- Method parseMessageText of controller system/messages/Messages could accept also the prestudent_id parameter
- If prestudent_id parameter then CLMessagesModel->parseMessageTextPrestudent is called - Fixed show_error(getData error in model CLMessagesModel - Added new method parseMessageTextPrestudent to model CLMessagesModel - Method _prepareHtmlWriteTemplate of model CLMessagesModel now checks if data are from a prestudent and then uses MessageLib->getMessageVarsPrestudent - Added new method getMessageVarsPrestudent to MessageLib - Function parseMessageText in js/messaging/messageWrite.js could call system/messages/Messages/parseMessageText with prestudent_id parameter
This commit is contained in:
@@ -190,6 +190,30 @@ class MessageLib
|
||||
return $messageVarsPerson; // otherwise returns the error
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves message vars from view vw_msg_vars
|
||||
*/
|
||||
public function getMessageVarsPrestudent()
|
||||
{
|
||||
// Retrieves message vars from view vw_msg_vars
|
||||
$messageVars = $this->_ci->MessageModel->getMessageVars();
|
||||
if (isSuccess($messageVars)) // if everything is ok
|
||||
{
|
||||
$variablesArray = array();
|
||||
$tmpVariablesArray = getData($messageVars);
|
||||
|
||||
// Starts from 1 to skip the first element which is person_id
|
||||
for ($i = 1; $i < count($tmpVariablesArray); $i++)
|
||||
{
|
||||
$variablesArray['{'.str_replace(' ', '_', strtolower($tmpVariablesArray[$i])).'}'] = $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