mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-22 17:32:18 +00:00
Merge branch 'master' into feature-17512/Issues_Plausibilitaetspruefungen
This commit is contained in:
@@ -138,7 +138,7 @@ class Studiensemester extends Auth_Controller
|
||||
$start = $this->input->post("semstart");
|
||||
$ende = $this->input->post("semende");
|
||||
$studienjahr_kurzbz = $this->input->post("studienjahrkurzbz");
|
||||
$beschreibung = $this->input->post("beschreibung");
|
||||
$beschreibung = isEmptyString($this->input->post("beschreibung")) ? null : $this->input->post("beschreibung");
|
||||
$onlinebewerbung = $this->input->post("onlinebewerbung");
|
||||
$onlinebewerbung = isset($onlinebewerbung);
|
||||
|
||||
|
||||
@@ -423,7 +423,7 @@ class InfoCenter extends Auth_Controller
|
||||
if (hasData($akte))
|
||||
{
|
||||
$akte = getData($akte);
|
||||
if ($akte->person_id === $person_id)
|
||||
if ($akte->person_id === (int)$person_id)
|
||||
{
|
||||
$result = $this->aktelib->remove($akte_id);
|
||||
|
||||
|
||||
@@ -340,20 +340,25 @@ class FilterWidgetLib
|
||||
{
|
||||
$filterDefinition = $filters[$filtersCounter]; // definition of one filter
|
||||
|
||||
if ($filtersCounter > 0)
|
||||
$where .= ' AND '; // if it's NOT the last one
|
||||
|
||||
if (!isEmptyString($filterDefinition->name)) // if the name of the applied filter is valid
|
||||
// If the name of the applied filter is valid
|
||||
if (!isEmptyString($filterDefinition->name))
|
||||
{
|
||||
// ...build the condition
|
||||
$where .= '"'.$filterDefinition->name.'"'.$this->_getDatasetQueryCondition($filterDefinition);
|
||||
// Build the query conditions
|
||||
$datasetQueryCondition = $this->_getDatasetQueryCondition($filterDefinition);
|
||||
|
||||
// If the built condition is valid then add it to the query clause
|
||||
if (!isEmptyString($datasetQueryCondition))
|
||||
{
|
||||
// // If this is NOT the first one
|
||||
if ($filtersCounter > 0) $where .= ' AND ';
|
||||
|
||||
$where .= '"'.$filterDefinition->name.'"'.$datasetQueryCondition;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($where != '') // if the SQL where clause was built
|
||||
{
|
||||
$datasetQuery .= ' WHERE '.$where;
|
||||
}
|
||||
// If the SQL where clause was built
|
||||
if ($where != '') $datasetQuery .= ' WHERE '.$where;
|
||||
}
|
||||
|
||||
return $datasetQuery;
|
||||
|
||||
@@ -528,6 +528,13 @@ class Messages_model extends CI_Model
|
||||
*/
|
||||
public function sendReply($receiver_id, $subject, $body, $relationmessage_id, $token)
|
||||
{
|
||||
// Checks that the receiver_id, relationmessage_id and token belongs to the same message
|
||||
$crossedDataResult = $this->MessageTokenModel->crossClientData($token, $relationmessage_id, $receiver_id);
|
||||
if (isError($crossedDataResult)) show_error(getError($crossedDataResult));
|
||||
if (!hasData($crossedDataResult)) show_error(
|
||||
'The parameters token, relationmessage_id and receiver_id do not belong to the same message'
|
||||
);
|
||||
|
||||
// Retrieves message sender information
|
||||
$senderResult = $this->MessageTokenModel->getSenderData($receiver_id);
|
||||
if (isError($senderResult)) show_error(getError($senderResult));
|
||||
|
||||
@@ -176,4 +176,20 @@ class MessageToken_model extends DB_Model
|
||||
|
||||
return $this->execQuery($sql, array($oe_kurzbz));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function crossClientData($token, $relationmessage_id, $receiver_id)
|
||||
{
|
||||
$sql = 'SELECT mm.message_id
|
||||
FROM public.tbl_msg_message mm
|
||||
JOIN public.tbl_msg_recipient mr USING(message_id)
|
||||
WHERE mr.token = ?
|
||||
AND mm.message_id = ?
|
||||
AND mm.person_id = ?';
|
||||
|
||||
return $this->execQuery($sql, array($token, $relationmessage_id, $receiver_id));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user