mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
Merge branch 'master' into udf
This commit is contained in:
@@ -34,11 +34,11 @@ class Prestudent extends APIv1_Controller
|
||||
public function getPrestudent()
|
||||
{
|
||||
$prestudentID = $this->get('prestudent_id');
|
||||
|
||||
|
||||
if (isset($prestudentID))
|
||||
{
|
||||
$result = $this->PrestudentModel->load($prestudentID);
|
||||
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
@@ -46,18 +46,18 @@ class Prestudent extends APIv1_Controller
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function getPrestudentByPersonID()
|
||||
{
|
||||
$person_id = $this->get('person_id');
|
||||
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$result = $this->PrestudentModel->load(array('person_id' => $person_id));
|
||||
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
@@ -65,7 +65,7 @@ class Prestudent extends APIv1_Controller
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
@@ -73,14 +73,14 @@ class Prestudent extends APIv1_Controller
|
||||
{
|
||||
$prestudent_id = $this->get('prestudent_id');
|
||||
$titel = $this->get('titel');
|
||||
|
||||
|
||||
if (isset($prestudent_id) && isset($titel))
|
||||
{
|
||||
// Loads model Notiz_model
|
||||
$this->load->model('person/Notiz_model', 'NotizModel');
|
||||
|
||||
|
||||
$result = $this->NotizModel->getSpecialization($prestudent_id, $titel);
|
||||
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
@@ -88,7 +88,7 @@ class Prestudent extends APIv1_Controller
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
@@ -98,7 +98,7 @@ class Prestudent extends APIv1_Controller
|
||||
$studiensemester_kurzbz = $this->get('studiensemester_kurzbz');
|
||||
$studiengang_kz = $this->get('studiengang_kz');
|
||||
$status_kurzbz = $this->get('status_kurzbz');
|
||||
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$result = $this->PrestudentModel->getLastStatuses(
|
||||
@@ -107,7 +107,7 @@ class Prestudent extends APIv1_Controller
|
||||
$studiengang_kz,
|
||||
$status_kurzbz
|
||||
);
|
||||
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
@@ -115,21 +115,56 @@ class Prestudent extends APIv1_Controller
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get all Persons with a Status in the define Timerange
|
||||
* Additionally ALL Prestudents of this person are included.
|
||||
* (Not only the ones with the status)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function getPrestudentsPerStatus()
|
||||
{
|
||||
$this->load->model('person/person_model', 'PersonModel');
|
||||
$status_kurzbz = $this->get('status_kurzbz');
|
||||
$von = $this->get('von');
|
||||
$bis = $this->get('bis');
|
||||
|
||||
if (isset($status_kurzbz) && isset($von) && isset($bis))
|
||||
{
|
||||
$result = $this->PersonModel->getPersonFromStatus(
|
||||
$status_kurzbz,
|
||||
$von,
|
||||
$bis
|
||||
);
|
||||
|
||||
// Remove person images from result array to reduce useless traffic
|
||||
foreach($result->retval as $key=>$val)
|
||||
{
|
||||
unset($result->retval[$key]->foto);
|
||||
}
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function postRmSpecialization()
|
||||
{
|
||||
$notiz_id = $this->post()['notiz_id'];
|
||||
|
||||
|
||||
if (isset($notiz_id))
|
||||
{
|
||||
// Loads model Notiz_model
|
||||
$this->load->model('person/Notiz_model', 'NotizModel');
|
||||
|
||||
|
||||
$result = $this->NotizModel->rmSpecialization($notiz_id);
|
||||
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
@@ -137,7 +172,7 @@ class Prestudent extends APIv1_Controller
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
@@ -146,14 +181,14 @@ class Prestudent extends APIv1_Controller
|
||||
$prestudent_id = $this->post()['prestudent_id'];
|
||||
$titel = $this->post()['titel'];
|
||||
$text = $this->post()['text'];
|
||||
|
||||
|
||||
if (isset($prestudent_id) && isset($titel) && isset($text))
|
||||
{
|
||||
// Loads model Notiz_model
|
||||
$this->load->model('person/Notiz_model', 'NotizModel');
|
||||
|
||||
|
||||
$result = $this->NotizModel->addSpecialization($prestudent_id, $titel, $text);
|
||||
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
@@ -168,7 +203,7 @@ class Prestudent extends APIv1_Controller
|
||||
public function postPrestudent()
|
||||
{
|
||||
$prestudent = $this->post();
|
||||
|
||||
|
||||
if ($this->_validate($this->post()))
|
||||
{
|
||||
if (isset($prestudent['prestudent_id']))
|
||||
@@ -179,7 +214,7 @@ class Prestudent extends APIv1_Controller
|
||||
{
|
||||
$result = $this->PrestudentModel->insert($prestudent);
|
||||
}
|
||||
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
@@ -187,7 +222,7 @@ class Prestudent extends APIv1_Controller
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
@@ -196,7 +231,7 @@ class Prestudent extends APIv1_Controller
|
||||
if ($this->_validate($this->delete()))
|
||||
{
|
||||
$result = $this->PrestudentModel->delete($this->delete()['prestudent_id']);
|
||||
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
@@ -204,28 +239,28 @@ class Prestudent extends APIv1_Controller
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function postAddReihungstest()
|
||||
{
|
||||
$ddReihungstest = $this->post();
|
||||
|
||||
|
||||
if ($this->_validateReihungstest($ddReihungstest))
|
||||
{
|
||||
if(isset($ddReihungstest['new']) && $ddReihungstest['new'] == true)
|
||||
{
|
||||
// Remove new parameter to avoid DB insert errors
|
||||
unset($ddReihungstest['new']);
|
||||
|
||||
|
||||
$result = $this->reihungstestlib->insertPersonReihungstest($ddReihungstest);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->reihungstestlib->updatePersonReihungstest($ddReihungstest);
|
||||
}
|
||||
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
@@ -233,18 +268,18 @@ class Prestudent extends APIv1_Controller
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function postDelReihungstest()
|
||||
{
|
||||
$ddReihungstest = $this->post();
|
||||
|
||||
|
||||
if (isset($ddReihungstest['rt_person_id']))
|
||||
{
|
||||
$result = $this->reihungstestlib->deletePersonReihungstest($ddReihungstest);
|
||||
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
@@ -252,19 +287,19 @@ class Prestudent extends APIv1_Controller
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function _validate($prestudent = NULL)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private function _validateReihungstest($ddReihungstest = NULL)
|
||||
{
|
||||
if (!isset($ddReihungstest['person_id']) || !isset($ddReihungstest['rt_id']) || !isset($ddReihungstest['studienplan_id']))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,11 +35,11 @@ class Prestudentstatus extends APIv1_Controller
|
||||
$studiensemester_kurzbz = $this->get('studiensemester_kurzbz');
|
||||
$status_kurzbz = $this->get('status_kurzbz');
|
||||
$prestudent_id = $this->get('prestudent_id');
|
||||
|
||||
|
||||
if (isset($ausbildungssemester) && isset($studiensemester_kurzbz) && isset($status_kurzbz) && isset($prestudent_id))
|
||||
{
|
||||
$result = $this->PrestudentstatusModel->load(array($ausbildungssemester, $studiensemester_kurzbz, $status_kurzbz, $prestudent_id));
|
||||
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
@@ -47,7 +47,7 @@ class Prestudentstatus extends APIv1_Controller
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
@@ -56,11 +56,11 @@ class Prestudentstatus extends APIv1_Controller
|
||||
$prestudent_id = $this->get("prestudent_id");
|
||||
$studiensemester_kurzbz = $this->get("studiensemester_kurzbz");
|
||||
$status_kurzbz = $this->get("status_kurzbz");
|
||||
|
||||
|
||||
if (isset($prestudent_id))
|
||||
{
|
||||
$result = $this->PrestudentstatusModel->getLastStatus($prestudent_id, $studiensemester_kurzbz, $status_kurzbz);
|
||||
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
@@ -75,14 +75,14 @@ class Prestudentstatus extends APIv1_Controller
|
||||
public function postPrestudentstatus()
|
||||
{
|
||||
$prestudentstatus = $this->post();
|
||||
|
||||
|
||||
if ($this->_validate($prestudentstatus))
|
||||
{
|
||||
if(isset($prestudentstatus['new']) && $prestudentstatus['new'] == true)
|
||||
{
|
||||
// Remove new parameter to avoid DB insert errors
|
||||
unset($prestudentstatus['new']);
|
||||
|
||||
|
||||
$result = $this->PrestudentstatusModel->insert($prestudentstatus);
|
||||
}
|
||||
else
|
||||
@@ -95,7 +95,7 @@ class Prestudentstatus extends APIv1_Controller
|
||||
|
||||
$result = $this->PrestudentstatusModel->update($pksArray, $prestudentstatus);
|
||||
}
|
||||
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
@@ -103,14 +103,14 @@ class Prestudentstatus extends APIv1_Controller
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function deletePrestudentstatus()
|
||||
{
|
||||
$prestudentstatus = $this->delete();
|
||||
|
||||
|
||||
if ($this->_validate($prestudentstatus))
|
||||
{
|
||||
$pksArray = array($prestudentstatus['ausbildungssemester'],
|
||||
@@ -120,7 +120,7 @@ class Prestudentstatus extends APIv1_Controller
|
||||
);
|
||||
|
||||
$result = $this->PrestudentstatusModel->delete($pksArray);
|
||||
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
@@ -128,9 +128,34 @@ class Prestudentstatus extends APIv1_Controller
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function _validate($prestudentstatus = null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list of Status entries of a prestudent according to the filter
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function getStatusByFilter()
|
||||
{
|
||||
$prestudent_id = $this->get("prestudent_id");
|
||||
$status_kurzbz = $this->get("status_kurzbz");
|
||||
$ausbildungssemester = $this->get("ausbildungssemester");
|
||||
$studiensemester_kurzbz = $this->get("studiensemester_kurzbz");
|
||||
|
||||
if (isset($prestudent_id))
|
||||
{
|
||||
$result = $this->PrestudentstatusModel->getStatusByFilter($prestudent_id, $status_kurzbz, $ausbildungssemester, $studiensemester_kurzbz);
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user