mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-21 17:02:19 +00:00
Merge branch 'ci' of https://github.com/FH-Complete/FHC-Core into ci
Conflicts: application/core/FHC_Model.php
This commit is contained in:
@@ -12,7 +12,7 @@ class Dms_model extends DB_Model
|
||||
$this->pk = 'dms_id';
|
||||
}
|
||||
|
||||
protected function insertDmsVersion($data)
|
||||
public function insertDmsVersion($data)
|
||||
{
|
||||
$tableName = 'campus.tbl_dms_version';
|
||||
|
||||
@@ -27,7 +27,7 @@ class Dms_model extends DB_Model
|
||||
return $this->_error($this->db->error(), FHC_DB_ERROR);
|
||||
}
|
||||
|
||||
protected function updateDmsVersion($id, $data)
|
||||
public function updateDmsVersion($id, $data)
|
||||
{
|
||||
$tableName = 'campus.tbl_dms_version';
|
||||
|
||||
|
||||
@@ -11,30 +11,50 @@ class Prestudent_model extends DB_Model
|
||||
$this->dbTable = 'public.tbl_prestudent';
|
||||
$this->pk = 'prestudent_id';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function loadPrestudentPerson($prestudentID)
|
||||
public function getLastStatus($prestudent_id, $studiensemester_kurzbz = '', $status_kurzbz = '')
|
||||
{
|
||||
// Check the rights
|
||||
if (! $this->fhc_db_acl->isBerechtigt('basis/person', 's'))
|
||||
return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> basis/person', FHC_MODEL_ERROR);
|
||||
// Checks if the operation is permitted by the API caller
|
||||
if (! $this->fhc_db_acl->isBerechtigt($this->acl['public.tbl_prestudentstatus'], 's'))
|
||||
return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl['public.tbl_prestudentstatus'], FHC_MODEL_ERROR);
|
||||
|
||||
// Prepare SQL-Query
|
||||
$this->db->select('*')
|
||||
->from('public.tbl_prestudent')
|
||||
->join('public.tbl_person', 'person_id')
|
||||
->where('prestudent_id', $prestudentID);
|
||||
// Do the query
|
||||
$result = $this->db->get()->result_object();
|
||||
if (! $this->fhc_db_acl->isBerechtigt($this->acl['lehre.tbl_studienplan'], 's'))
|
||||
return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl['lehre.tbl_studienplan'], FHC_MODEL_ERROR);
|
||||
|
||||
// Return the result
|
||||
if ($result)
|
||||
return $this->_success($result);
|
||||
if (! $this->fhc_db_acl->isBerechtigt($this->acl['public.tbl_status'], 's'))
|
||||
return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl['public.tbl_status'], FHC_MODEL_ERROR);
|
||||
|
||||
$query = "SELECT tbl_prestudentstatus.*,
|
||||
bezeichnung AS studienplan_bezeichnung,
|
||||
tbl_status.bezeichnung_mehrsprachig
|
||||
FROM public.tbl_prestudentstatus LEFT JOIN lehre.tbl_studienplan USING (studienplan_id)
|
||||
JOIN public.tbl_status USING (status_kurzbz)
|
||||
WHERE tbl_status.status_kurzbz = tbl_prestudentstatus.status_kurzbz
|
||||
AND prestudent_id = ?";
|
||||
|
||||
$parametersArray = array($prestudent_id);
|
||||
|
||||
if ($studiensemester_kurzbz != '')
|
||||
{
|
||||
array_push($parametersArray, $studiensemester_kurzbz);
|
||||
$query .= ' AND studiensemester_kurzbz = ?';
|
||||
}
|
||||
if ($status_kurzbz != '')
|
||||
{
|
||||
array_push($parametersArray, $status_kurzbz);
|
||||
$query .= ' AND status_kurzbz = ?';
|
||||
}
|
||||
|
||||
$query .= ' ORDER BY datum DESC, insertamum DESC, ext_id DESC LIMIT 1';
|
||||
|
||||
$result = $this->db->query($query, $parametersArray);
|
||||
|
||||
if (is_object($result))
|
||||
return $this->_success($result->result());
|
||||
else
|
||||
return $this->_error($this->db->error(), FHC_DB_ERROR);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -23,29 +23,19 @@ class Message_model extends DB_Model
|
||||
* @param integer $person_id REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
function getMessage($msg_id, $person_id)
|
||||
/*function getMessage($msg_id)
|
||||
{
|
||||
// Validate
|
||||
if (empty($msg_id))
|
||||
{
|
||||
return $this->_invalid_id(MSG_ERR_INVALID_MSG_ID);
|
||||
}
|
||||
if (empty($person_id))
|
||||
{
|
||||
return $this->_invalid_id(MSG_ERR_INVALID_USER_ID);
|
||||
}
|
||||
$sql = 'SELECT m.*, s.status, t.subject, ' . "CONCAT(vorname, ' ', nachname) as user_name" .
|
||||
' FROM ' . $this->db->dbprefix . 'tbl_msg_message m ' .
|
||||
' JOIN ' . $this->db->dbprefix . 'tbl_msg_thread t ON (m.thread_id = t.thread_id) ' .
|
||||
' JOIN ' . $this->db->dbprefix . 'public.tbl_person' . ' ON (' . 'tbl_person.person_id' . ' = m.sender_id) '.
|
||||
' JOIN ' . $this->db->dbprefix . 'tbl_msg_status s ON (s.message_id = m.message_id AND s.person_id = ? ) ' .
|
||||
' WHERE m.message_id = ? ' ;
|
||||
$result = $this->db->query($sql, array($person_id, $msg_id));
|
||||
|
||||
$sql = 'SELECT * FROM tbl_msg_message JOIN tbl_person USING (person_id) WHERE message_id=?' ;
|
||||
$result = $this->db->query($sql, array($msg_id));
|
||||
if ($result)
|
||||
return $this->_success($result->result_array());
|
||||
return $this->_success($result->result());
|
||||
else
|
||||
return $this->_general_error();
|
||||
}
|
||||
return $this->_error($this->db->error(), FHC_DB_ERROR);
|
||||
}*/
|
||||
/** -----------------------------------------------------------------
|
||||
* Get a Full Thread
|
||||
* get_full_thread() - will return a entire thread, including the status for specified user.
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
class Recipient_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'public.tbl_msg_recipient';
|
||||
$this->pk = array('person_id', 'message_id');
|
||||
$this->hasSequence = false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user