mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
Merge branch 'ci' of https://github.com/FH-Complete/FHC-Core into ci
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
*/
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
if (!defined("BASEPATH")) exit("No direct script access allowed");
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Reihungstest extends APIv1_Controller
|
||||
{
|
||||
@@ -23,9 +23,9 @@ class Reihungstest extends APIv1_Controller
|
||||
{
|
||||
parent::__construct();
|
||||
// Load model ReihungstestModel
|
||||
$this->load->model("crm/Reihungstest_model", "ReihungstestModel");
|
||||
$this->load->model('crm/Reihungstest_model', 'ReihungstestModel');
|
||||
// Load library ReihungstestLib
|
||||
$this->load->library("ReihungstestLib");
|
||||
$this->load->library('ReihungstestLib');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -33,7 +33,7 @@ class Reihungstest extends APIv1_Controller
|
||||
*/
|
||||
public function getReihungstest()
|
||||
{
|
||||
$reihungstestID = $this->get("reihungstest_id");
|
||||
$reihungstestID = $this->get('reihungstest_id');
|
||||
|
||||
if (isset($reihungstestID))
|
||||
{
|
||||
@@ -52,20 +52,20 @@ class Reihungstest extends APIv1_Controller
|
||||
*/
|
||||
public function getByStudiengangStudiensemester()
|
||||
{
|
||||
$studiengang_kz = $this->get("studiengang_kz");
|
||||
$studiensemester_kurzbz = $this->get("studiensemester_kurzbz");
|
||||
$available = $this->get("available");
|
||||
$studiengang_kz = $this->get('studiengang_kz');
|
||||
$studiensemester_kurzbz = $this->get('studiensemester_kurzbz');
|
||||
$available = $this->get('available');
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$parametersArray = array("studiengang_kz" => $studiengang_kz);
|
||||
$parametersArray = array('studiengang_kz' => $studiengang_kz);
|
||||
if (isset($studiensemester_kurzbz))
|
||||
{
|
||||
$parametersArray["studiensemester_kurzbz"] = $studiensemester_kurzbz;
|
||||
$parametersArray['studiensemester_kurzbz'] = $studiensemester_kurzbz;
|
||||
}
|
||||
if (isset($available))
|
||||
{
|
||||
$parametersArray["anmeldefrist >="] = "NOW()";
|
||||
$parametersArray['anmeldefrist >='] = 'NOW()';
|
||||
}
|
||||
$result = $this->ReihungstestModel->loadWhere($parametersArray);
|
||||
|
||||
@@ -82,12 +82,33 @@ class Reihungstest extends APIv1_Controller
|
||||
*/
|
||||
public function getReihungstestByPersonID()
|
||||
{
|
||||
$person_id = $this->get("person_id");
|
||||
$available = $this->get("available");
|
||||
$person_id = $this->get('person_id');
|
||||
$available = $this->get('available');
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$result = $this->reihungstestlib->getReihungstestByPersonID($person_id, $available);
|
||||
$result = $this->ReihungstestLib->getReihungstestByPersonID($person_id, $available);
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function getAvailableReihungstestByPersonId()
|
||||
{
|
||||
$person_id = $this->get('person_id');
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
|
||||
$result = $this->StudiengangModel->getAvailableReihungstestByPersonId($person_id);
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
@@ -104,9 +125,9 @@ class Reihungstest extends APIv1_Controller
|
||||
{
|
||||
if ($this->_validate($this->post()))
|
||||
{
|
||||
if (isset($this->post()["reihungstest_id"]))
|
||||
if (isset($this->post()['reihungstest_id']))
|
||||
{
|
||||
$result = $this->ReihungstestModel->update($this->post()["reihungstest_id"], $this->post());
|
||||
$result = $this->ReihungstestModel->update($this->post()['reihungstest_id'], $this->post());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
if (! defined("BASEPATH")) exit("No direct script access allowed");
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -14,8 +14,8 @@ class ReihungstestLib
|
||||
{
|
||||
$this->ci =& get_instance();
|
||||
|
||||
$this->ci->load->model("crm/RtPerson_model", "RtPersonModel");
|
||||
$this->ci->load->model("crm/Reihungstest_model", "ReihungstestModel");
|
||||
$this->ci->load->model('crm/RtPerson_model', 'RtPersonModel');
|
||||
$this->ci->load->model('crm/Reihungstest_model', 'ReihungstestModel');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -31,7 +31,7 @@ class ReihungstestLib
|
||||
*/
|
||||
public function updatePersonReihungstest($ddReihungstest)
|
||||
{
|
||||
$pksArray = array($ddReihungstest["person_id"], $ddReihungstest["rt_id"]);
|
||||
$pksArray = array($ddReihungstest['person_id'], $ddReihungstest['rt_id']);
|
||||
|
||||
return $this->ci->RtPersonModel->update($pksArray, $ddReihungstest);
|
||||
}
|
||||
@@ -41,7 +41,7 @@ class ReihungstestLib
|
||||
*/
|
||||
public function deletePersonReihungstest($ddReihungstest)
|
||||
{
|
||||
return $this->ci->RtPersonModel->delete($ddReihungstest["rt_person_id"], $ddReihungstest);
|
||||
return $this->ci->RtPersonModel->delete($ddReihungstest['rt_person_id'], $ddReihungstest);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -49,15 +49,15 @@ class ReihungstestLib
|
||||
*/
|
||||
public function getReihungstestByPersonID($person_id, $available = null)
|
||||
{
|
||||
$this->ci->ReihungstestModel->addJoin("public.tbl_rt_person", "reihungstest_id = rt_id");
|
||||
$this->ci->ReihungstestModel->addJoin("public.tbl_person", "person_id");
|
||||
$this->ci->ReihungstestModel->addJoin("public.tbl_ort", "tbl_ort.ort_kurzbz = tbl_rt_person.ort_kurzbz", "LEFT");
|
||||
$this->ci->ReihungstestModel->addJoin('public.tbl_rt_person', 'reihungstest_id = rt_id');
|
||||
$this->ci->ReihungstestModel->addJoin('public.tbl_person', 'person_id');
|
||||
$this->ci->ReihungstestModel->addJoin('public.tbl_ort', 'tbl_ort.ort_kurzbz = tbl_rt_person.ort_kurzbz', 'LEFT');
|
||||
|
||||
$parametersArray = array("person_id" => $person_id);
|
||||
$parametersArray = array('person_id' => $person_id);
|
||||
|
||||
if (isset($available))
|
||||
{
|
||||
$parametersArray["anmeldefrist >="] = "NOW()";
|
||||
$parametersArray['anmeldefrist >='] = 'NOW()';
|
||||
}
|
||||
|
||||
return $this->ci->ReihungstestModel->loadWhere($parametersArray);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
class Reihungstest_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
@@ -10,5 +10,5 @@ class Reihungstest_model extends DB_Model
|
||||
parent::__construct();
|
||||
$this->dbTable = 'public.tbl_reihungstest';
|
||||
$this->pk = 'reihungstest_id';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -225,4 +225,61 @@ class Studiengang_model extends DB_Model
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function getAvailableReihungstestByPersonId($person_id)
|
||||
{
|
||||
if (($isEntitled = $this->isEntitled('lehre.tbl_studienordnung', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('lehre.tbl_studienplan', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
/*if (($isEntitled = $this->isEntitled('public.tbl_rt_studienplan', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;*/
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_reihungstest', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_prestudentstatus', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_prestudent', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
|
||||
$this->addJoin('lehre.tbl_studienordnung', 'studiengang_kz');
|
||||
|
||||
$this->addJoin('lehre.tbl_studienplan', 'studienordnung_id');
|
||||
|
||||
$this->addJoin('public.tbl_rt_studienplan', 'studienplan_id');
|
||||
|
||||
$this->addJoin('public.tbl_reihungstest', 'reihungstest_id');
|
||||
|
||||
$this->addJoin('public.tbl_prestudentstatus', 'studienplan_id');
|
||||
|
||||
$this->addJoin('public.tbl_prestudent', 'prestudent_id');
|
||||
|
||||
$this->addOrder('tbl_studiengang.studiengang_kz, tbl_reihungstest.stufe');
|
||||
|
||||
return $this->loadTree(
|
||||
'tbl_studiengang',
|
||||
array('tbl_reihungstest'),
|
||||
'tbl_prestudentstatus.status_kurzbz = \'Interessent\'
|
||||
AND (tbl_prestudentstatus.rt_stufe = tbl_reihungstest.stufe OR tbl_reihungstest.stufe IS NULL)
|
||||
AND tbl_reihungstest.oeffentlich = TRUE
|
||||
AND tbl_reihungstest.datum > NOW()
|
||||
AND tbl_reihungstest.anmeldefrist >= NOW()
|
||||
AND COALESCE (
|
||||
tbl_reihungstest.max_teilnehmer,
|
||||
(
|
||||
SELECT SUM(arbeitsplaetze)
|
||||
FROM public.tbl_ort JOIN public.tbl_rt_ort USING(ort_kurzbz)
|
||||
WHERE rt_id = tbl_reihungstest.reihungstest_id
|
||||
)
|
||||
) - (
|
||||
SELECT COUNT(*)
|
||||
FROM public.tbl_rt_person
|
||||
WHERE rt_id = tbl_reihungstest.reihungstest_id
|
||||
) > 0
|
||||
AND person_id = ' . $person_id,
|
||||
array('reihungstest')
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,7 @@ class authentication extends auth
|
||||
|| $username=='lektor1'
|
||||
|| $username=='lektor2'
|
||||
|| $username=='lektor3'
|
||||
|| $username == 'aufname'))
|
||||
|| $username == 'aufnahme'))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user