mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-22 17:32:18 +00:00
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:
@@ -157,13 +157,13 @@ class Person_model extends DB_Model
|
||||
* gets Stammdaten for a person, including contactdata in textform from other tables
|
||||
* nation, kontakt, adresse
|
||||
* @param $person_id
|
||||
* @return array
|
||||
* @return array, null when no person found
|
||||
*/
|
||||
public function getPersonStammdaten($person_id)
|
||||
{
|
||||
$this->addSelect('tbl_person.*, s.kurztext as staatsbuergerschaft, g.kurztext as geburtsnation');
|
||||
$this->addJoin('bis.tbl_nation s', 'tbl_person.staatsbuergerschaft = s.nation_code', 'LEFT');
|
||||
$this->addJoin('bis.tbl_nation g', 'tbl_person.geburtsnation = g.nation_code', 'LEFT');
|
||||
$this->addSelect('public.tbl_person.*, s.kurztext as staatsbuergerschaft, g.kurztext as geburtsnation');
|
||||
$this->addJoin('bis.tbl_nation s', 'public.tbl_person.staatsbuergerschaft = s.nation_code', 'LEFT');
|
||||
$this->addJoin('bis.tbl_nation g', 'public.tbl_person.geburtsnation = g.nation_code', 'LEFT');
|
||||
|
||||
$person = $this->load($person_id);
|
||||
|
||||
@@ -194,4 +194,18 @@ class Person_model extends DB_Model
|
||||
|
||||
return success($stammdaten);
|
||||
}
|
||||
|
||||
/**
|
||||
* gets person data from uid
|
||||
* @param $uid
|
||||
* @return array
|
||||
*/
|
||||
public function getByUid($uid)
|
||||
{
|
||||
$this->addSelect('vorname, nachname, gebdatum, person_id');
|
||||
$this->addJoin('tbl_benutzer', 'person_id');
|
||||
|
||||
return $this->loadWhere(array('uid' => $uid));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user