mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-26 00:54:27 +00:00
- Renamed classes, methods and properties names in german
- All the controllers exends APIv1_Controller rather than REST_Controller - Codeceptions modified to be compliant to changes
This commit is contained in:
@@ -60,7 +60,7 @@ $autoload['packages'] = array();
|
||||
*/
|
||||
|
||||
//$autoload['libraries'] = array();
|
||||
$autoload['libraries'] = array('Session', 'Template', 'FHC_Auth');
|
||||
$autoload['libraries'] = array('Session', 'FHC_Auth');
|
||||
|
||||
/*
|
||||
| -------------------------------------------------------------------
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
if(!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Nation extends REST_Controller
|
||||
class Nation extends APIv1_Controller
|
||||
{
|
||||
/**
|
||||
* Course API constructor.
|
||||
@@ -30,10 +30,7 @@ class Nation extends REST_Controller
|
||||
|
||||
public function getAll()
|
||||
{
|
||||
$notLocked = $this->get('ohnesperre');
|
||||
$orderEnglish = $this->get('orderEnglish');
|
||||
|
||||
$result = $this->NationModel->getAll($notLocked, $orderEnglish);
|
||||
$result = $this->NationModel->getAll($this->get('ohnesperre'), $this->get('orderEnglish'));
|
||||
|
||||
if(is_object($result))
|
||||
{
|
||||
@@ -56,9 +53,9 @@ class Nation extends REST_Controller
|
||||
$this->response($payload, $httpstatus);
|
||||
}
|
||||
|
||||
public function getFederalState()
|
||||
public function getBundesland()
|
||||
{
|
||||
$result = $this->NationModel->getFederalState();
|
||||
$result = $this->NationModel->getBundesland();
|
||||
|
||||
if(is_object($result))
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
if(!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Plan extends REST_Controller
|
||||
class Studiengang extends APIv1_Controller
|
||||
{
|
||||
/**
|
||||
* Course API constructor.
|
||||
@@ -23,22 +23,20 @@ class Plan extends REST_Controller
|
||||
{
|
||||
parent::__construct();
|
||||
// Load model PersonModel
|
||||
$this->load->model('studies/plan_model', 'PlanModel');
|
||||
$this->load->model('lehre/studiengang_model', 'StudiengangModel');
|
||||
// Load set the addonID of the model to let to check the permissions
|
||||
$this->PlanModel->setAddonID($this->_getAddonID());
|
||||
$this->StudiengangModel->setAddonID($this->_getAddonID());
|
||||
}
|
||||
|
||||
public function getPlan()
|
||||
public function getAllForBewerbung()
|
||||
{
|
||||
$courseOfStudiesID = $this->get('studiengang_kz');
|
||||
|
||||
$result = $this->PlanModel->getPlan($courseOfStudiesID);
|
||||
$result = $this->StudiengangModel->getAllForBewerbung();
|
||||
|
||||
if(is_object($result) && $result->num_rows() > 0)
|
||||
{
|
||||
$payload = [
|
||||
'success' => TRUE,
|
||||
'message' => 'Plan found',
|
||||
'message' => 'Courses found',
|
||||
'data' => $result->result()
|
||||
];
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
@@ -47,7 +45,7 @@ class Plan extends REST_Controller
|
||||
{
|
||||
$payload = [
|
||||
'success' => FALSE,
|
||||
'message' => 'Plan not found'
|
||||
'message' => 'No courses found'
|
||||
];
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
if(!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Course extends REST_Controller
|
||||
class Studienplan extends APIv1_Controller
|
||||
{
|
||||
/**
|
||||
* Course API constructor.
|
||||
@@ -23,20 +23,20 @@ class Course extends REST_Controller
|
||||
{
|
||||
parent::__construct();
|
||||
// Load model PersonModel
|
||||
$this->load->model('studies/course_model', 'CourseModel');
|
||||
$this->load->model('lehre/studienplan_model', 'StudienplanModel');
|
||||
// Load set the addonID of the model to let to check the permissions
|
||||
$this->CourseModel->setAddonID($this->_getAddonID());
|
||||
$this->StudienplanModel->setAddonID($this->_getAddonID());
|
||||
}
|
||||
|
||||
public function getEnabledCourses()
|
||||
public function getStudienplaene()
|
||||
{
|
||||
$result = $this->CourseModel->getEnabledCourses();
|
||||
$result = $this->StudienplanModel->getStudienplaene($this->get('studiengang_kz'));
|
||||
|
||||
if(is_object($result) && $result->num_rows() > 0)
|
||||
{
|
||||
$payload = [
|
||||
'success' => TRUE,
|
||||
'message' => 'Courses found',
|
||||
'message' => 'Plan found',
|
||||
'data' => $result->result()
|
||||
];
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
@@ -45,7 +45,7 @@ class Course extends REST_Controller
|
||||
{
|
||||
$payload = [
|
||||
'success' => FALSE,
|
||||
'message' => 'No courses found'
|
||||
'message' => 'Plan not found'
|
||||
];
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
}
|
||||
|
||||
@@ -90,9 +90,9 @@ class Person extends APIv1_Controller
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function postInterestedStudent()
|
||||
public function postPrestudent()
|
||||
{
|
||||
$result = $this->PersonModel->saveInterestedStudent($this->post());
|
||||
$result = $this->PersonModel->savePrestudent($this->post());
|
||||
|
||||
if($result === TRUE)
|
||||
{
|
||||
|
||||
@@ -8,9 +8,9 @@ class FHC_Model extends CI_Model
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->helper('language');
|
||||
//$this->load->helper('fhc_db_acl');
|
||||
$this->load->helper('fhc_db_acl');
|
||||
$this->lang->load('fhcomplete');
|
||||
$this->load->library('FHC_DB_ACL');
|
||||
//$this->load->library('FHC_DB_ACL');
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------------------
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
class Nation_model extends DB_Model
|
||||
{
|
||||
protected $_federalStateQuery = "SELECT * FROM bis.tbl_bundesland";
|
||||
protected $_bundeslandQuery = "SELECT * FROM bis.tbl_bundesland";
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -55,7 +55,7 @@ class Nation_model extends DB_Model
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function getFederalState()
|
||||
public function getBundesland()
|
||||
{
|
||||
$result = NULL;
|
||||
|
||||
@@ -63,7 +63,7 @@ class Nation_model extends DB_Model
|
||||
// All the code should be put inside this if statement
|
||||
if(isAllowed($this->getAddonID(), 'nation'))
|
||||
{
|
||||
$result = $this->db->query($this->_federalStateQuery);
|
||||
$result = $this->db->query($this->_bundeslandQuery);
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
class Course_model extends DB_Model
|
||||
class Studiengang_model extends DB_Model
|
||||
{
|
||||
//
|
||||
protected $_enabledCoursesQuery = "SELECT DISTINCT studiengang_kz,
|
||||
protected $_allForBewerbungQuery = "SELECT DISTINCT studiengang_kz,
|
||||
typ,
|
||||
organisationseinheittyp_kurzbz,
|
||||
studiengangbezeichnung,
|
||||
@@ -27,7 +27,7 @@ class Course_model extends DB_Model
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function getEnabledCourses()
|
||||
public function getAllForBewerbung()
|
||||
{
|
||||
$result = NULL;
|
||||
|
||||
@@ -35,7 +35,7 @@ class Course_model extends DB_Model
|
||||
// All the code should be put inside this if statement
|
||||
if(isAllowed($this->getAddonID(), 'course'))
|
||||
{
|
||||
$result = $this->db->query($this->_enabledCoursesQuery);
|
||||
$result = $this->db->query($this->_allForBewerbungQuery);
|
||||
}
|
||||
|
||||
return $result;
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
class Studienplan_model extends DB_Model
|
||||
{
|
||||
//
|
||||
protected $_studienplaeneQuery = "SELECT DISTINCT tbl_studienplan.*
|
||||
FROM lehre.tbl_studienplan JOIN lehre.tbl_studienordnung USING(studienordnung_id)
|
||||
WHERE tbl_studienordnung.studiengang_kz = ?";
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function getStudienplaene($studiengang_kz)
|
||||
{
|
||||
$result = NULL;
|
||||
|
||||
// Checks if the operation is permitted by the API caller
|
||||
// All the code should be put inside this if statement
|
||||
if(isAllowed($this->getAddonID(), 'plan'))
|
||||
{
|
||||
$result = $this->db->query($this->_studienplaeneQuery, array($studiengang_kz));
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -327,13 +327,13 @@ class Person_model extends DB_Model
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function saveInterestedStudent($interestedStudent = NULL)
|
||||
public function savePrestudent($interestedStudent = NULL)
|
||||
{
|
||||
// Checks if the operation is permitted by the API caller
|
||||
// All the code should be put inside this if statement
|
||||
if(isAllowed($this->getAddonID(), 'person'))
|
||||
{
|
||||
return $this->_saveInterestedStudent($interestedStudent);
|
||||
return $this->_savePrestudent($interestedStudent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -342,7 +342,7 @@ class Person_model extends DB_Model
|
||||
*
|
||||
* @return bool true when everything goes right, otherwise false
|
||||
*/
|
||||
private function _saveInterestedStudent($interestedStudent = NULL)
|
||||
private function _savePrestudent($interestedStudent = NULL)
|
||||
{
|
||||
if(!isset($interestedStudent))
|
||||
{
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
|
||||
class Plan_model extends DB_Model
|
||||
{
|
||||
//
|
||||
protected $_planQuery = "SELECT DISTINCT tbl_studienplan.*
|
||||
FROM lehre.tbl_studienplan JOIN lehre.tbl_studienordnung USING(studienordnung_id)
|
||||
WHERE tbl_studienordnung.studiengang_kz = ?";
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function getPlan($courseOfStudiesID)
|
||||
{
|
||||
$result = NULL;
|
||||
|
||||
// Checks if the operation is permitted by the API caller
|
||||
// All the code should be put inside this if statement
|
||||
if(isAllowed($this->getAddonID(), 'plan'))
|
||||
{
|
||||
$result = $this->db->query($this->_planQuery, array($courseOfStudiesID));
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user