Renamed 'Meine Felder'-msg names and small method adaptation to retrieve fields

Signed-off-by: Cris <[email protected]>
This commit is contained in:
Cris
2020-05-28 09:42:51 +02:00
parent 046994f14b
commit 634401485a
3 changed files with 25 additions and 8 deletions
+3 -3
View File
@@ -222,7 +222,7 @@ class MessageLib
public function getMessageVarsLoggedInUser()
{
// Retrieves message vars from view vw_msg_vars
$messageVars = $this->_ci->MessageModel->getMsgVarsDataLoggedInUser();
$messageVars = $this->_ci->MessageModel->getMsgVarsLoggedInUser();
if (isSuccess($messageVars)) // if everything is ok
{
$variablesArray = array();
@@ -231,8 +231,8 @@ class MessageLib
// 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]);
$variablesArray['{'.str_replace(' ', '_', strtolower($tmpVariablesArray[$i])).'}']
= strtoupper($tmpVariablesArray[$i]);
}
return success($variablesArray);
@@ -171,6 +171,23 @@ class Message_model extends DB_Model
return error($this->db->error(), FHC_DB_ERROR);
}
}
/**
* Get message variables for logged in user
*/
public function getMsgVarsLoggedInUser()
{
$result = $this->db->query('SELECT * FROM public.vw_msg_vars_user WHERE 0 = 1');
if ($result)
{
return success($result->list_fields());
}
else
{
return error($this->db->error(), FHC_DB_ERROR);
}
}
/**
* getMsgVarsDataByPrestudentId