mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 18:02:18 +00:00
- Added functions isSuccess, isError and hasData in message helper
- Updated the code using these new functions
This commit is contained in:
@@ -53,7 +53,7 @@ class Nation extends APIv1_Controller
|
||||
$result = $this->NationModel->addOrder('engltext');
|
||||
}
|
||||
|
||||
if ($result->error == EXIT_SUCCESS)
|
||||
if (isSuccess($result))
|
||||
{
|
||||
if ($this->get('ohnesperre'))
|
||||
{
|
||||
|
||||
@@ -118,12 +118,7 @@ class Studiensemester extends APIv1_Controller
|
||||
$result = $this->StudiensemesterModel->loadWhere(array('start <=' => 'NOW()', 'ende >=' => 'NOW()'));
|
||||
}
|
||||
|
||||
if (is_object($result) && $result->error == EXIT_SUCCESS && is_array($result->retval) &&
|
||||
count($result->retval) > 0)
|
||||
{
|
||||
// Return $result
|
||||
}
|
||||
else
|
||||
if (!hasData($result))
|
||||
{
|
||||
$this->StudiensemesterModel->addOrder('ende');
|
||||
$this->StudiensemesterModel->addLimit(1);
|
||||
|
||||
@@ -93,7 +93,7 @@ class Person extends APIv1_Controller
|
||||
$person = $this->_parseData($this->post());
|
||||
$validation = $this->_validate($this->post());
|
||||
|
||||
if (is_object($validation) && $validation->error == EXIT_SUCCESS)
|
||||
if (isSuccess($validation))
|
||||
{
|
||||
if(isset($person["person_id"]) && !(is_null($person["person_id"])) && ($person["person_id"] != ""))
|
||||
{
|
||||
|
||||
@@ -112,7 +112,7 @@ class Message extends APIv1_Controller
|
||||
{
|
||||
$validation = $this->_validatePostMessage($this->post());
|
||||
|
||||
if (is_object($validation) && $validation->error == EXIT_SUCCESS)
|
||||
if (isSuccess($validation))
|
||||
{
|
||||
$result = $this->messagelib->sendMessage(
|
||||
isset($this->post()['person_id']) ? $this->post()['person_id'] : null,
|
||||
@@ -139,7 +139,7 @@ class Message extends APIv1_Controller
|
||||
{
|
||||
$validation = $this->_validatePostMessageVorlage($this->post());
|
||||
|
||||
if (is_object($validation) && $validation->error == EXIT_SUCCESS)
|
||||
if (isSuccess($validation))
|
||||
{
|
||||
$result = $this->messagelib->sendMessageVorlage(
|
||||
isset($this->post()['sender_id']) ? $this->post()['sender_id'] : null,
|
||||
|
||||
Reference in New Issue
Block a user