mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 16:44:28 +00:00
API Calls codeception
Fixed translations
This commit is contained in:
@@ -39,11 +39,11 @@ class Person extends REST_Controller
|
||||
|
||||
$result = $this->PersonModel->getPerson($personID, $code, $email);
|
||||
|
||||
if(is_object($result))
|
||||
if(is_object($result) && $result->num_rows() > 0)
|
||||
{
|
||||
$payload = [
|
||||
'success' => TRUE,
|
||||
'message' => 'People found',
|
||||
'message' => 'Person found',
|
||||
'data' => $result->result()
|
||||
];
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
|
||||
@@ -32,7 +32,7 @@ class Course extends REST_Controller
|
||||
{
|
||||
$result = $this->CourseModel->getEnabledCourses();
|
||||
|
||||
if(is_object($result))
|
||||
if(is_object($result) && $result->num_rows() > 0)
|
||||
{
|
||||
$payload = [
|
||||
'success' => TRUE,
|
||||
|
||||
@@ -28,17 +28,17 @@ class Plan extends REST_Controller
|
||||
$this->PlanModel->setAddonID($this->_getAddonID());
|
||||
}
|
||||
|
||||
public function getCurricula()
|
||||
public function getPlan()
|
||||
{
|
||||
$courseOfStudiesID = $this->get('studiengang_kz');
|
||||
|
||||
$result = $this->PlanModel->getCurricula($courseOfStudiesID);
|
||||
$result = $this->PlanModel->getPlan($courseOfStudiesID);
|
||||
|
||||
if(is_object($result))
|
||||
if(is_object($result) && $result->num_rows() > 0)
|
||||
{
|
||||
$payload = [
|
||||
'success' => TRUE,
|
||||
'message' => 'Curricula found',
|
||||
'message' => 'Plan found',
|
||||
'data' => $result->result()
|
||||
];
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
@@ -47,7 +47,7 @@ class Plan extends REST_Controller
|
||||
{
|
||||
$payload = [
|
||||
'success' => FALSE,
|
||||
'message' => 'Curricula not found'
|
||||
'message' => 'Plan not found'
|
||||
];
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
class Plan_model extends DB_Model
|
||||
{
|
||||
//
|
||||
protected $_curriculaQuery = "SELECT DISTINCT tbl_studienplan.*
|
||||
protected $_planQuery = "SELECT DISTINCT tbl_studienplan.*
|
||||
FROM lehre.tbl_studienplan JOIN lehre.tbl_studienordnung USING(studienordnung_id)
|
||||
WHERE tbl_studienordnung.studiengang_kz = ?";
|
||||
|
||||
@@ -18,7 +18,7 @@ class Plan_model extends DB_Model
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function getCurricula($courseOfStudiesID)
|
||||
public function getPlan($courseOfStudiesID)
|
||||
{
|
||||
$result = NULL;
|
||||
|
||||
@@ -26,7 +26,7 @@ class Plan_model extends DB_Model
|
||||
// All the code should be put inside this if statement
|
||||
if($this->_checkPermissions())
|
||||
{
|
||||
$result = $this->db->query($this->_curriculaQuery, array($courseOfStudiesID));
|
||||
$result = $this->db->query($this->_planQuery, array($courseOfStudiesID));
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
Reference in New Issue
Block a user