enabled sending messages with person ids as receivers, person data can be retrieved by uid, link in infocenter details to send message

This commit is contained in:
alex
2018-02-01 10:26:37 +01:00
parent 77da816b5e
commit b9e7dc38cc
7 changed files with 251 additions and 50 deletions
@@ -102,6 +102,23 @@ class Message_model extends DB_Model
}
}
/**
* getMessageVars for person
*/
public function getMessageVarsPerson()
{
$result = $this->db->query('SELECT * FROM public.vw_msg_vars_person WHERE 0 = 1');
if ($result)
{
return success($result->list_fields());
}
else
{
return error($this->db->error(), FHC_DB_ERROR);
}
}
/**
* getMsgVarsDataByPrestudentId
*/
@@ -111,4 +128,14 @@ class Message_model extends DB_Model
return $this->execQuery(sprintf($query, is_array($prestudent_id) ? 'IN' : '='), array($prestudent_id));
}
/**
* getMsgVarsDataByPersonId
*/
public function getMsgVarsDataByPersonId($person_id)
{
$query = 'SELECT * FROM public.vw_msg_vars_person WHERE person_id %s ?';
return $this->execQuery(sprintf($query, is_array($person_id) ? 'IN' : '='), array($person_id));
}
}