From 6d093dc4ed1980315686c3e730d77c7086267af4 Mon Sep 17 00:00:00 2001 From: paolo Date: Mon, 9 May 2016 18:19:58 +0200 Subject: [PATCH 01/31] - DB_Model added new functionalities - Codeception changed - Studiengang_model fixed message error - Removed File and File_model, they will be replaced by Dms and Dms_model - Added new permissions in fhcomplete config file --- application/config/fhcomplete.php | 3 ++ application/controllers/api/v1/File.php | 45 ------------------- application/core/DB_Model.php | 23 ++++++++++ application/models/File_model.php | 42 ----------------- .../models/organisation/Studiengang_model.php | 2 +- tests/codeception/tests/api/v1/CourseCept.php | 12 ----- tests/codeception/tests/api/v1/NationCept.php | 15 ++----- tests/codeception/tests/api/v1/PersonCept.php | 4 +- tests/codeception/tests/api/v1/PlanCept.php | 12 ----- .../tests/api/v1/StudiengangCept.php | 10 +++++ .../tests/api/v1/StudienplanCept.php | 10 +++++ 11 files changed, 52 insertions(+), 126 deletions(-) delete mode 100644 application/controllers/api/v1/File.php delete mode 100644 application/models/File_model.php delete mode 100644 tests/codeception/tests/api/v1/CourseCept.php delete mode 100644 tests/codeception/tests/api/v1/PlanCept.php create mode 100644 tests/codeception/tests/api/v1/StudiengangCept.php create mode 100644 tests/codeception/tests/api/v1/StudienplanCept.php diff --git a/application/config/fhcomplete.php b/application/config/fhcomplete.php index 37bb2a457..6479a3863 100644 --- a/application/config/fhcomplete.php +++ b/application/config/fhcomplete.php @@ -9,6 +9,9 @@ $config['fhc_acl'] = array 'bis.tbl_nation' => 'basis/nation', 'bis.tbl_lgartcode' => 'basis/lgartcode', + 'campus.tbl_dms' => 'basis/tbl_dms', + 'campus.tbl_dms_version' => 'basis/tbl_dms_version', + 'lehre.tbl_studienplan' => 'basis/studienplan', 'lehre.tbl_studienordnung' => 'basis/studienordnung', 'lehre.vw_studienplan' => 'basis/vw_studienplan', diff --git a/application/controllers/api/v1/File.php b/application/controllers/api/v1/File.php deleted file mode 100644 index 6ae23d3a5..000000000 --- a/application/controllers/api/v1/File.php +++ /dev/null @@ -1,45 +0,0 @@ -load->model('file_model', 'FileModel'); - // Load set the uid of the model to let to check the permissions - $this->FileModel->setUID($this->_getUID()); - } - - /** - * @return void - */ - public function postFile() - { - $result = $this->FileModel->saveFile($this->post()); - - if($result === TRUE) - { - $httpstatus = REST_Controller::HTTP_OK; - $payload = [ - 'success' => true, - 'message' => 'File saved.' - ]; - $payload['data'] = $result; - } - else - { - $payload = [ - 'success' => false, - 'message' => 'Could not save file.' - ]; - $httpstatus = REST_Controller::HTTP_OK; - } - $this->response($payload, $httpstatus); - } -} \ No newline at end of file diff --git a/application/core/DB_Model.php b/application/core/DB_Model.php index c7b387faa..777c9b26c 100644 --- a/application/core/DB_Model.php +++ b/application/core/DB_Model.php @@ -223,6 +223,29 @@ class DB_Model extends FHC_Model return $this->_success(TRUE); } + + /** --------------------------------------------------------------- + * Add limit clause + * + * @return void + */ + public function addLimit($start = null, $end = null) + { + // Check Class-Attributes and parameters + if(!is_numeric($start) || (is_numeric($start) && $start <= 0)) + return $this->_error(lang('fhc_'.FHC_NODBTABLE), FHC_MODEL_ERROR); + + if(is_numeric($end) && $end > $start) + { + $this->db->limit($start, $end); + } + else + { + $this->db->limit($start); + } + + return $this->_success(TRUE); + } /** --------------------------------------------------------------- * Delete data from DB-Table diff --git a/application/models/File_model.php b/application/models/File_model.php deleted file mode 100644 index 7e2638fb4..000000000 --- a/application/models/File_model.php +++ /dev/null @@ -1,42 +0,0 @@ -getUID(), 'file')) - { - if($this->_validate($file)) - { - $result = $this->_write($file); - } - } - - return $result; - } - - private function _validate($file = NULL) - { - return TRUE; - } - - private function _write($file = NULL) - { - return TRUE; - } -} \ No newline at end of file diff --git a/application/models/organisation/Studiengang_model.php b/application/models/organisation/Studiengang_model.php index f2fc37ed5..a7f4b3f91 100644 --- a/application/models/organisation/Studiengang_model.php +++ b/application/models/organisation/Studiengang_model.php @@ -34,7 +34,7 @@ class Studiengang_model extends DB_Model return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl['lehre.vw_studienplan'], FHC_MODEL_ERROR); if (! $this->fhc_db_acl->isBerechtigt($this->acl['bis.tbl_lgartcode'], 's')) - return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl['lehre.vw_studienplan'], FHC_MODEL_ERROR); + return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl['bis.tbl_lgartcode'], FHC_MODEL_ERROR); return $this->db->query($allForBewerbungQuery); } diff --git a/tests/codeception/tests/api/v1/CourseCept.php b/tests/codeception/tests/api/v1/CourseCept.php deleted file mode 100644 index 8f43b91af..000000000 --- a/tests/codeception/tests/api/v1/CourseCept.php +++ /dev/null @@ -1,12 +0,0 @@ -wantTo('Test API call v1/lehre/studiengang/AllForBewerbung'); -$I->amHttpAuthenticated("admin", "1q2w3"); -$I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org'); -$I->sendGET('v1/lehre/studiengang/AllForBewerbung'); -$I->seeResponseCodeIs(200); -$I->seeResponseIsJson(); -$I->seeResponseContainsJson([ - 'success' => TRUE, - 'message' => 'Courses found']); \ No newline at end of file diff --git a/tests/codeception/tests/api/v1/NationCept.php b/tests/codeception/tests/api/v1/NationCept.php index 081931b76..c441a4249 100644 --- a/tests/codeception/tests/api/v1/NationCept.php +++ b/tests/codeception/tests/api/v1/NationCept.php @@ -1,19 +1,10 @@ wantTo('Test API call v1/nation All and FederalState'); +$I->wantTo('Test API call v1/codex/nation All and FederalState'); $I->amHttpAuthenticated("admin", "1q2w3"); $I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org'); -$I->sendGET('v1/nation/All'); +$I->sendGET('v1/codex/nation/All'); $I->seeResponseCodeIs(200); $I->seeResponseIsJson(); -$I->seeResponseContainsJson([ - 'success' => TRUE, - 'message' => 'Nation found']); - -$I->sendGET('v1/nation/Bundesland'); -$I->seeResponseCodeIs(200); -$I->seeResponseIsJson(); -$I->seeResponseContainsJson([ - 'success' => TRUE, - 'message' => 'Bundesland found']); \ No newline at end of file +$I->seeResponseContainsJson(['error' => 0]); \ No newline at end of file diff --git a/tests/codeception/tests/api/v1/PersonCept.php b/tests/codeception/tests/api/v1/PersonCept.php index af4edd27c..ab292bba6 100644 --- a/tests/codeception/tests/api/v1/PersonCept.php +++ b/tests/codeception/tests/api/v1/PersonCept.php @@ -25,8 +25,8 @@ $I->sendGET('v1/person/person/Person', array('code' => '12345')); $I->seeResponseCodeIs(200); $I->seeResponseIsJson(); $I->seeResponseContainsJson([ - 'success' => false, - 'message' => 'Person not found']); + 'error' => 0, + 'retval' => array()]); $I->sendGET('v1/person/person/Person', array('code' => '01234567C', 'email' => 'harvey.joshuah@calva.dev')); $I->seeResponseCodeIs(200); diff --git a/tests/codeception/tests/api/v1/PlanCept.php b/tests/codeception/tests/api/v1/PlanCept.php deleted file mode 100644 index 90ed424e0..000000000 --- a/tests/codeception/tests/api/v1/PlanCept.php +++ /dev/null @@ -1,12 +0,0 @@ -wantTo('Test API call v1/lehre/studienplan/Studienplaene'); -$I->amHttpAuthenticated("admin", "1q2w3"); -$I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org'); -$I->sendGET('v1/lehre/studienplan/Studienplaene', array('studiengang_kz' => 1)); -$I->seeResponseCodeIs(200); -$I->seeResponseIsJson(); -$I->seeResponseContainsJson([ - 'success' => TRUE, - 'message' => 'Plan found']); \ No newline at end of file diff --git a/tests/codeception/tests/api/v1/StudiengangCept.php b/tests/codeception/tests/api/v1/StudiengangCept.php new file mode 100644 index 000000000..de1b37ae0 --- /dev/null +++ b/tests/codeception/tests/api/v1/StudiengangCept.php @@ -0,0 +1,10 @@ +wantTo('Test API call v1/organisation/studiengang/AllForBewerbung'); +$I->amHttpAuthenticated("admin", "1q2w3"); +$I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org'); +$I->sendGET('v1/organisation/studiengang/AllForBewerbung'); +$I->seeResponseCodeIs(200); +$I->seeResponseIsJson(); +$I->seeResponseContainsJson(['error' => 0]); \ No newline at end of file diff --git a/tests/codeception/tests/api/v1/StudienplanCept.php b/tests/codeception/tests/api/v1/StudienplanCept.php new file mode 100644 index 000000000..78a2ce600 --- /dev/null +++ b/tests/codeception/tests/api/v1/StudienplanCept.php @@ -0,0 +1,10 @@ +wantTo('Test API call v1/organisation/studienplan/Studienplaene'); +$I->amHttpAuthenticated("admin", "1q2w3"); +$I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org'); +$I->sendGET('v1/organisation/studienplan/Studienplaene', array('studiengang_kz' => 1)); +$I->seeResponseCodeIs(200); +$I->seeResponseIsJson(); +$I->seeResponseContainsJson(['error' => 0]); \ No newline at end of file From 44ebe15c9cab8fbbf8396d255648b8afda0f5d14 Mon Sep 17 00:00:00 2001 From: paolo Date: Tue, 10 May 2016 13:05:02 +0200 Subject: [PATCH 02/31] - Method getCheckBewerbung implemented with new standard - Added new permission in fhcomplete.php config file --- application/config/fhcomplete.php | 1 + .../controllers/api/v1/person/Person.php | 40 +++------- .../models/organisation/Studiengang_model.php | 16 ++-- application/models/person/Person_model.php | 76 +++++++++++-------- 4 files changed, 65 insertions(+), 68 deletions(-) diff --git a/application/config/fhcomplete.php b/application/config/fhcomplete.php index 6479a3863..ba1f8eff1 100644 --- a/application/config/fhcomplete.php +++ b/application/config/fhcomplete.php @@ -18,6 +18,7 @@ $config['fhc_acl'] = array 'public.tbl_person' => 'basis/person', 'public.tbl_kontakt' => 'basis/kontakt', + 'public.tbl_benutzer' => 'basis/benutzer', 'public.tbl_prestudent' => 'basis/person', 'public.tbl_prestudentstatus' => 'basis/person', 'public.tbl_organisationseinheit' => 'basis/organisationseinheit', diff --git a/application/controllers/api/v1/person/Person.php b/application/controllers/api/v1/person/Person.php index ea708f8e5..9ffc14d45 100644 --- a/application/controllers/api/v1/person/Person.php +++ b/application/controllers/api/v1/person/Person.php @@ -93,43 +93,21 @@ class Person extends APIv1_Controller */ public function getCheckBewerbung() { - $result = $this->PersonModel->checkBewerbung($this->get("email"), $this->get("studiensemester_kurzbz")); - $httpstatus = REST_Controller::HTTP_OK; - $payload = [ - 'success' => true, - 'message' => 'Bewerbung exists.' - ]; - $payload['data'] = $result; - $this->response($payload, $httpstatus); - } - - /** - * @return void - */ - public function getCheckZugangscodePerson() - { - $result = $this->PersonModel->checkZugangscodePerson($this->get("code")); - $httpstatus = REST_Controller::HTTP_OK; - if(!empty($result)) + $email = $this->get('email'); + $studiensemester_kurzbz = $this->get('studiensemester_kurzbz'); + + if(isset($email)) { - $payload = [ - 'success' => true, - 'message' => 'Zugangscode exists.' - ]; - $payload['data'] = $result; + $result = $this->PersonModel->checkBewerbung($email, $studiensemester_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); } else { - $payload = [ - 'success' => false, - 'message' => 'Zugangscode does not exist.' - ]; - $httpstatus = REST_Controller::HTTP_OK; + $this->response(); } - - $this->response($payload, $httpstatus); } - + private function _validate($person = NULL) { if(!isset($person)) diff --git a/application/models/organisation/Studiengang_model.php b/application/models/organisation/Studiengang_model.php index a7f4b3f91..661dabfd6 100644 --- a/application/models/organisation/Studiengang_model.php +++ b/application/models/organisation/Studiengang_model.php @@ -16,6 +16,13 @@ class Studiengang_model extends DB_Model */ public function getAllForBewerbung() { + // Checks if the operation is permitted by the API caller + if (! $this->fhc_db_acl->isBerechtigt($this->acl['lehre.vw_studienplan'], 's')) + return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl['lehre.vw_studienplan'], FHC_MODEL_ERROR); + + if (! $this->fhc_db_acl->isBerechtigt($this->acl['bis.tbl_lgartcode'], 's')) + return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl['bis.tbl_lgartcode'], FHC_MODEL_ERROR); + $allForBewerbungQuery = "SELECT DISTINCT studiengang_kz, typ, organisationseinheittyp_kurzbz, @@ -29,13 +36,8 @@ class Studiengang_model extends DB_Model AND aktiv IS TRUE ORDER BY typ, studiengangbezeichnung, tbl_lgartcode.bezeichnung ASC"; - // Checks if the operation is permitted by the API caller - if (! $this->fhc_db_acl->isBerechtigt($this->acl['lehre.vw_studienplan'], 's')) - return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl['lehre.vw_studienplan'], FHC_MODEL_ERROR); + $result = $this->db->query($allForBewerbungQuery); - if (! $this->fhc_db_acl->isBerechtigt($this->acl['bis.tbl_lgartcode'], 's')) - return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl['bis.tbl_lgartcode'], FHC_MODEL_ERROR); - - return $this->db->query($allForBewerbungQuery); + return $this->_success($result->result()); } } \ No newline at end of file diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php index 1a9192a88..fc8ad108a 100644 --- a/application/models/person/Person_model.php +++ b/application/models/person/Person_model.php @@ -15,41 +15,57 @@ class Person_model extends DB_Model /** * */ - /*public function checkBewerbung($email, $studiensemester_kurzbz = NULL) + public function checkBewerbung($email, $studiensemester_kurzbz = NULL) { - $this->db->distinct(); - + // Checks if the operation is permitted by the API caller + if (! $this->fhc_db_acl->isBerechtigt($this->acl['public.tbl_person'], 's')) + return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl['public.tbl_person'], FHC_MODEL_ERROR); + + if (! $this->fhc_db_acl->isBerechtigt($this->acl['public.tbl_kontakt'], 's')) + return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl['public.tbl_kontakt'], FHC_MODEL_ERROR); + + if (! $this->fhc_db_acl->isBerechtigt($this->acl['public.tbl_benutzer'], 's')) + return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl['public.tbl_benutzer'], FHC_MODEL_ERROR); + + if (! $this->fhc_db_acl->isBerechtigt($this->acl['public.tbl_prestudent'], 's')) + return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl['public.tbl_prestudent'], FHC_MODEL_ERROR); + + if (! $this->fhc_db_acl->isBerechtigt($this->acl['public.tbl_prestudentstatus'], 's')) + return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl['public.tbl_prestudentstatus'], FHC_MODEL_ERROR); + + $result = NULL; + if(is_null($studiensemester_kurzbz)) { - $this->db->select("p.person_id, p.zugangscode, p.insertamum") - ->from("public.tbl_person p") - ->join("public.tbl_kontakt k", "p.person_id=k.person_id") - ->join("public.tbl_benutzer b", "p.person_id=b.person_id", "left") - ->where("k.kontakttyp", 'email') - ->where("(kontakt='" . $email . "'" . - " OR alias ||'@technikum-wien.at'='" . $email . "'" . - " OR uid ||'@technikum-wien.at'='" . $email . "')") - ->order_by("p.insertamum", "DESC") - ->limit(1) - ; + $checkBewerbungQuery = "SELECT DISTINCT p.person_id, p.zugangscode, p.insertamum + FROM public.tbl_person p JOIN public.tbl_kontakt k ON p.person_id = k.person_id + LEFT JOIN public.tbl_benutzer b ON p.person_id = b.person_id + WHERE k.kontakttyp = 'email' + AND (kontakt = ? OR alias || '@technikum-wien.at' = ? OR uid || '@technikum-wien.at' = ?) + ORDER BY p.insertamum DESC + LIMIT 1"; + + $result = $this->db->query($checkBewerbungQuery, array($email, $email, $email)); } else { - $this->db->select("p.person_id,p.zugangscode,p.insertamum") - ->from("public.tbl_person p") - ->join("public.tbl_kontakt k", "p.person_id=k.person_id") - ->join("public.tbl_benutzer b", "p.person_id=b.person_id", "left") - ->join("public.tbl_prestudent ps", "p.person_id=ps.person_id") - ->join("public.tbl_prestudentstatus pst", "pst.prestudent_id=ps.prestudent_id") - ->where("k.kontakttyp", 'email') - ->where("(kontakt='" . $email . "'" . - " OR alias ||'@technikum-wien.at'='" . $email . "'" . - " OR uid ||'@technikum-wien.at'='" . $email . "')") - ->where("studiensemester_kurzbz='" . $studiensemester_kurzbz . "'") - ->order_by("p.insertamum", "DESC") - ->limit(1) - ; + $checkBewerbungQuery = "SELECT DISTINCT p.person_id, p.zugangscode, p.insertamum + FROM public.tbl_person p JOIN public.tbl_kontakt k ON p.person_id = k.person_id + LEFT JOIN public.tbl_benutzer b ON p.person_id = b.person_id + JOIN public.tbl_prestudent ps ON p.person_id = ps.person_id + JOIN public.tbl_prestudentstatus pst ON pst.prestudent_id = ps.prestudent_id + WHERE k.kontakttyp = 'email' + AND (kontakt = ? OR alias || '@technikum-wien.at' = ? OR uid || '@technikum-wien.at' = ?) + AND studiensemester_kurzbz = ? + ORDER BY p.insertamum DESC + LIMIT 1"; + + $result = $this->db->query($checkBewerbungQuery, array($email, $email, $email, $studiensemester_kurzbz)); } - return $this->db->get()->result_array(); - }*/ + + if(is_object($result)) + return $this->_success($result->result()); + else + return $this->_error($this->db->error(), FHC_DB_ERROR); + } } \ No newline at end of file From 440cac91d6c0f6f8318dac0a3413f657d1d2e3ae Mon Sep 17 00:00:00 2001 From: Stefan Puraner Date: Tue, 10 May 2016 13:46:01 +0200 Subject: [PATCH 03/31] person model: added method that return list of db columns --- .../controllers/api/v1/person/Person.php | 3 +- application/models/person/Person_model.php | 44 ++++++++++++++++++- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/application/controllers/api/v1/person/Person.php b/application/controllers/api/v1/person/Person.php index ea708f8e5..7fcec6231 100644 --- a/application/controllers/api/v1/person/Person.php +++ b/application/controllers/api/v1/person/Person.php @@ -60,7 +60,8 @@ class Person extends APIv1_Controller } else { - $this->response(); + $fields = $this->PersonModel->getFields(); + $this->response($fields, REST_Controller::HTTP_OK); } } diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php index 1a9192a88..7a8f0978d 100644 --- a/application/models/person/Person_model.php +++ b/application/models/person/Person_model.php @@ -11,11 +11,51 @@ class Person_model extends DB_Model $this->dbTable = 'public.tbl_person'; $this->pk = 'person_id'; } + + public function getFields() + { + $fields = array( + //Tabellenspalten + "person_id" => NULL, + "sprache" => NULL, + "anrede" => NULL, + "titelpost" => NULL, + "titelpre" => NULL, + "nachname" => NULL, + "vorname" => NULL, + "vornamen" => NULL, + "gebdatum" => NULL, + "gebort" => NULL, + "gebzeit" => NULL, + "foto" => NULL, + "anmerkungen" => NULL, + "homepage" => NULL, + "svnr" => NULL, + "ersatzkennzeichen" => NULL, + "familienstand" => NULL, + "anzahlkinder" => NULL, + "aktiv"=>TRUE, + "insertamum" => NULL, + "insertvon" => NULL, + "updateamum" => NULL, + "updatevon" => NULL, + "geschlecht" => "u", + "staatsbuergerschaft" => NULL, + "geburtsnation" => NULL, + "ext_id" => NULL, + "kurzbeschreibung"> NULL, + "zugangscode" => NULL, + "foto_sperre" => FALSE, + "matr_nr"=> NULL + ); + + return $this->_success($fields); + } /** * */ - /*public function checkBewerbung($email, $studiensemester_kurzbz = NULL) + public function checkBewerbung($email, $studiensemester_kurzbz = NULL) { $this->db->distinct(); @@ -51,5 +91,5 @@ class Person_model extends DB_Model ; } return $this->db->get()->result_array(); - }*/ + } } \ No newline at end of file From e624540c160453525cc1e4830ee0a2e529f6d0ed Mon Sep 17 00:00:00 2001 From: Paminger Date: Tue, 10 May 2016 14:12:33 +0200 Subject: [PATCH 04/31] Message --- application/config/fhcomplete.php | 4 +- application/config/migration.php | 4 +- application/controllers/DBTools.php | 3 +- application/controllers/ModelTest.php | 6 +- .../{message => system}/Message.php | 0 application/core/FHC_Model.php | 5 +- application/migrations/008_message.php | 78 +- application/models/system/Message_model.php | 4178 +++-------------- application/models/system/Thread_model.php | 14 + include/studiengang.class.php | 2 +- 10 files changed, 667 insertions(+), 3627 deletions(-) rename application/controllers/{message => system}/Message.php (100%) create mode 100644 application/models/system/Thread_model.php diff --git a/application/config/fhcomplete.php b/application/config/fhcomplete.php index d82f90165..4db7d6fca 100644 --- a/application/config/fhcomplete.php +++ b/application/config/fhcomplete.php @@ -10,5 +10,7 @@ $config['fhc_acl'] = array 'public.tbl_prestudent' => 'basis/person', 'public.tbl_prestudentstatus' => 'basis/person', 'public.tbl_organisationseinheit' => 'basis/organisationseinheit', - 'public.tbl_sprache' => 'admin' + 'public.tbl_sprache' => 'admin', + 'public.tbl_msg_thread' => 'admin', + 'public.tbl_msg_message' => 'admin' ); diff --git a/application/config/migration.php b/application/config/migration.php index b4732b46e..886f95e24 100755 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -23,7 +23,7 @@ $config['migration_enabled'] = TRUE; | be upgraded / downgraded to. | */ -$config['migration_version'] = 008; +$config['migration_version'] = 007; /* |-------------------------------------------------------------------------- @@ -55,7 +55,7 @@ $config['migration_type'] = 'sequential'; | will migrate up. This must be set. | */ -$config['migration_table'] = 'ci_migrations'; +$config['migration_table'] = 'system.ci_migrations'; /* |-------------------------------------------------------------------------- diff --git a/application/controllers/DBTools.php b/application/controllers/DBTools.php index f68c67a3a..ea0b61e6f 100644 --- a/application/controllers/DBTools.php +++ b/application/controllers/DBTools.php @@ -48,6 +48,7 @@ class DBTools extends FHC_Controller if (ENVIRONMENT !== 'development') exit('Wowsers! You don\'t want to do that!'); $this->load->database('system'); //Use the system-Connection for DB-Manipulation + $this->config->load('migration'); $this->load->library('migration'); // If not set, set it @@ -301,7 +302,7 @@ class DBTools extends FHC_Controller */ private function __getVersion() { - $row = $this->db->get('ci_migrations')->row(); + $row = $this->db->get($this->config->item('migration_table'))->row(); return $row ? $row->version : 0; } } diff --git a/application/controllers/ModelTest.php b/application/controllers/ModelTest.php index 430021d26..3e89a3dbc 100755 --- a/application/controllers/ModelTest.php +++ b/application/controllers/ModelTest.php @@ -28,7 +28,7 @@ class ModelTest extends FHC_Controller $res = $this->Person_model->getPerson(null, 'asdf\' OR person_id=1; SELECT 1; --'); var_dump($res->result_object()); - $this->load->model('person/Prestudent_model'); + $this->load->model('crm/Prestudent_model'); $id=null; // Insert PreStudent @@ -79,7 +79,7 @@ class ModelTest extends FHC_Controller var_dump($res->retval); // Insert PreStudentStatus - $this->load->model('person/Prestudentstatus_model'); + $this->load->model('crm/Prestudentstatus_model'); $data = array ( 'prestudent_id' => $id, @@ -155,7 +155,7 @@ class ModelTest extends FHC_Controller else var_dump($res->retval); - $this->load->model('core/Sprache_model'); + $this->load->model('system/Sprache_model'); // Insert Sprache $data = array ( diff --git a/application/controllers/message/Message.php b/application/controllers/system/Message.php similarity index 100% rename from application/controllers/message/Message.php rename to application/controllers/system/Message.php diff --git a/application/core/FHC_Model.php b/application/core/FHC_Model.php index f31ad6b78..8afcbb7cc 100644 --- a/application/core/FHC_Model.php +++ b/application/core/FHC_Model.php @@ -1,5 +1,6 @@ session->uid; else $uid = null; - $this->load->library('FHC_DB_ACL',array('uid' => $uid)); + $this->load->library('FHC_DB_ACL', array('uid' => $uid)); } /** --------------------------------------------------------------- diff --git a/application/migrations/008_message.php b/application/migrations/008_message.php index 64e94b718..b5133a983 100644 --- a/application/migrations/008_message.php +++ b/application/migrations/008_message.php @@ -6,57 +6,59 @@ class Migration_Message extends CI_Migration { public function up() { - if (!$this->db->table_exists('msg_messages')) + if (! $this->db->table_exists('public.tbl_msg_message')) { - $query= ' - CREATE TABLE msg_messages ( - id serial, + $query= " + CREATE TABLE public.tbl_msg_message ( + message_id serial, thread_id bigint NOT NULL, body text NOT NULL, priority smallint NOT NULL DEFAULT 0, - sender_id bigint NOT NULL, + person_id bigint NOT NULL, cdate timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (id) + PRIMARY KEY (message_id) ); - GRANT SELECT ON TABLE msg_messages TO web; - GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE msg_messages TO admin; - GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE msg_messages TO vilesci; - GRANT SELECT, UPDATE ON SEQUENCE msg_messages_id_seq TO web; - GRANT SELECT, UPDATE ON SEQUENCE msg_messages_id_seq TO admin; - GRANT SELECT, UPDATE ON SEQUENCE msg_messages_id_seq TO vilesci; + COMMENT ON COLUMN public.tbl_msg_message.person_id IS 'Sender'; + COMMENT ON COLUMN public.tbl_msg_message.priority IS 'Codex in config/message.php'; + GRANT SELECT ON TABLE public.tbl_msg_message TO web; + GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tbl_msg_message TO admin; + GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tbl_msg_message TO vilesci; + GRANT SELECT, UPDATE ON SEQUENCE public.tbl_msg_message_message_id_seq TO web; + GRANT SELECT, UPDATE ON SEQUENCE public.tbl_msg_message_message_id_seq TO admin; + GRANT SELECT, UPDATE ON SEQUENCE public.tbl_msg_message_message_id_seq TO vilesci; - CREATE TABLE msg_participants ( - user_id bigint NOT NULL, + CREATE TABLE public.tbl_msg_participant ( + person_id bigint NOT NULL, thread_id bigint NOT NULL, cdate timestamp NOT NULL DEFAULT now(), - PRIMARY KEY (user_id,thread_id) + PRIMARY KEY (person_id,thread_id) ); - GRANT SELECT ON TABLE msg_participants TO web; - GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE msg_participants TO admin; - GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE msg_participants TO vilesci; + GRANT SELECT ON TABLE public.tbl_msg_participant TO web; + GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tbl_msg_participant TO admin; + GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tbl_msg_participant TO vilesci; - CREATE TABLE msg_status ( + CREATE TABLE public.tbl_msg_status ( message_id bigint NOT NULL, - user_id bigint NOT NULL, + person_id bigint NOT NULL, status smallint NOT NULL, - PRIMARY KEY (message_id,user_id) + PRIMARY KEY (message_id,person_id) ); - GRANT SELECT ON TABLE msg_status TO web; - GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE msg_status TO admin; - GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE msg_status TO vilesci; + GRANT SELECT ON TABLE public.tbl_msg_status TO web; + GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tbl_msg_status TO admin; + GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tbl_msg_status TO vilesci; - CREATE TABLE msg_threads ( - id serial, + CREATE TABLE public.tbl_msg_thread ( + thread_id serial, subject text, - PRIMARY KEY (id) + PRIMARY KEY (thread_id) ); - GRANT SELECT ON TABLE msg_threads TO web; - GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE msg_threads TO admin; - GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE msg_threads TO vilesci; - GRANT SELECT, UPDATE ON SEQUENCE msg_threads_id_seq TO web; - GRANT SELECT, UPDATE ON SEQUENCE msg_threads_id_seq TO admin; - GRANT SELECT, UPDATE ON SEQUENCE msg_threads_id_seq TO vilesci; -'; + GRANT SELECT ON TABLE public.tbl_msg_thread TO web; + GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tbl_msg_thread TO admin; + GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tbl_msg_thread TO vilesci; + GRANT SELECT, UPDATE ON SEQUENCE public.tbl_msg_thread_thread_id_seq TO web; + GRANT SELECT, UPDATE ON SEQUENCE public.tbl_msg_thread_thread_id_seq TO admin; + GRANT SELECT, UPDATE ON SEQUENCE public.tbl_msg_thread_thread_id_seq TO vilesci; +"; if (!$this->db->simple_query($query)) { echo "Error creating Basis DB-Schema!"; @@ -66,10 +68,10 @@ class Migration_Message extends CI_Migration { public function down() { - $this->dbforge->drop_table('msg_messages'); - $this->dbforge->drop_table('msg_participants'); - $this->dbforge->drop_table('msg_status'); - $this->dbforge->drop_table('msg_threads'); + $this->dbforge->drop_table('public.tbl_msg_message'); + $this->dbforge->drop_table('public.tbl_msg_participant'); + $this->dbforge->drop_table('public.tbl_msg_status'); + $this->dbforge->drop_table('public.tbl_msg_thread'); } } diff --git a/application/models/system/Message_model.php b/application/models/system/Message_model.php index 059ff2d45..d2f503eea 100644 --- a/application/models/system/Message_model.php +++ b/application/models/system/Message_model.php @@ -1,3582 +1,602 @@ + - - - - - - +class Message_model extends DB_Model +{ + /** + * Constructor + */ + public function __construct() + { + parent::__construct(); + require_once APPPATH.'config/message.php'; + $this->lang->load('message'); + $this->dbTable = 'public.tbl_msg_message'; + $this->pk = 'message_id'; + } + + /** ----------------------------------------------------------------- + * getMessage() - will return a single message, including the status for specified user. + * + * @param integer $msg_id EQUIRED + * @param integer $person_id REQUIRED + * @return array + */ + function getMessage($msg_id, $person_id) + { + // Validate + if (empty($msg_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_MSG_ID); + } + if (empty($person_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_USER_ID); + } + $sql = 'SELECT m.*, s.status, t.subject, ' . "CONCAT(vorname, ' ', nachname) as user_name" . + ' FROM ' . $this->db->dbprefix . 'tbl_msg_message m ' . + ' JOIN ' . $this->db->dbprefix . 'tbl_msg_thread t ON (m.thread_id = t.thread_id) ' . + ' JOIN ' . $this->db->dbprefix . 'public.tbl_person' . ' ON (' . 'tbl_person.person_id' . ' = m.sender_id) '. + ' JOIN ' . $this->db->dbprefix . 'tbl_msg_status s ON (s.message_id = m.message_id AND s.person_id = ? ) ' . + ' WHERE m.message_id = ? ' ; + $result = $this->db->query($sql, array($person_id, $msg_id)); + if ($result) + return $this->_success($result->result_array()); + else + return $this->_general_error(); + } + /** ----------------------------------------------------------------- + * Get a Full Thread + * get_full_thread() - will return a entire thread, including the status for specified user. + * + * @param integer $thread_id REQUIRED + * @param integer $person_id REQUIRED + * @param boolean $full_thread OPTIONAL - If true, user will also see messages from thread posted BEFORE user became participant + * @param string $order_by OPTIONAL + * @return array + */ + function get_full_thread($thread_id, $person_id, $full_thread = FALSE, $order_by = 'ASC') + { + // Validate + if (empty($thread_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_THREAD_ID); + } + if (empty($person_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_USER_ID); + } + $sql = 'SELECT m.*, s.status, t.subject, '."CONCAT(vorname, ' ', nachname) as user_name" . + ' FROM ' . $this->db->dbprefix . 'tbl_msg_participant p ' . + ' JOIN ' . $this->db->dbprefix . 'tbl_msg_thread t ON (t.thread_id = p.thread_id) ' . + ' JOIN ' . $this->db->dbprefix . 'tbl_msg_message m ON (m.thread_id = t.thread_id) ' . + ' JOIN ' . $this->db->dbprefix . 'public.tbl_person' . ' ON (' . 'tbl_person.person_id' . ' = m.sender_id) '. + ' JOIN ' . $this->db->dbprefix . 'tbl_msg_status s ON (s.message_id = m.message_id AND s.person_id = ? ) ' . + ' WHERE p.person_id = ? ' . + ' AND p.thread_id = ? '; + if ( ! $full_thread) + { + $sql .= ' AND m.cdate >= p.cdate'; + } + $sql .= ' ORDER BY m.cdate ' . $order_by; + $result = $this->db->query($sql, array($person_id, $person_id, $thread_id)); + if ($result) + return $this->_success($result->result_array()); + else + return $this->_general_error(); + } + /** ----------------------------------------------------------------- + * get_all_threads() - will return all threads for user, including the status for specified user. + * + * @param integer $person_id REQUIRED + * @param boolean $full_thread OPTIONAL - If true, user will also see messages from thread posted BEFORE user became participant + * @param string $order_by OPTIONAL + * @return array + */ + function get_all_threads($person_id, $full_thread = FALSE, $order_by = 'asc') + { + if (empty($person_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_USER_ID); + } + $sql = 'SELECT m.*, s.status, t.subject, '."CONCAT(vorname, ' ', nachname) as user_name" . + ' FROM ' . $this->db->dbprefix . 'tbl_msg_participant p ' . + ' JOIN ' . $this->db->dbprefix . 'tbl_msg_thread t ON (t.thread_id = p.thread_id) ' . + ' JOIN ' . $this->db->dbprefix . 'tbl_msg_message m ON (m.thread_id = t.thread_id) ' . + ' JOIN ' . $this->db->dbprefix . 'public.tbl_person' . ' ON (' . 'tbl_person.person_id' . ' = m.sender_id) '. + ' JOIN ' . $this->db->dbprefix . 'tbl_msg_status s ON (s.message_id = m.message_id AND s.person_id = ? ) ' . + ' WHERE p.person_id = ? ' ; + if (!$full_thread) + { + $sql .= ' AND m.cdate >= p.cdate'; + } + $sql .= ' ORDER BY t.thread_id ' . $order_by. ', m.cdate '. $order_by; + $result = $this->db->query($sql, array($person_id, $person_id)); + if ($result) + return $this->_success($result->result_array()); + else + return $this->_general_error(); + } + /** ----------------------------------------------------------------- + * Get all Threads Grouped + * get_all_threads_grouped() - will return all threads for user, including the status for specified user. + * - messages are grouped in threads. + * + * @param integer $person_id REQUIRED + * @param boolean $full_thread OPTIONAL - If true, user will also see messages from thread posted BEFORE user became participant + * @param string $order_by OPTIONAL + * @return array + */ + function get_all_threads_grouped($person_id, $full_thread = FALSE, $order_by = 'ASC') + { + if (empty($person_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_USER_ID); + } + $message = $this->get_all_threads($person_id, $full_thread, $order_by); + if (is_array($message)) + { + $threads = array(); + foreach ($message as $msg) + { + if ( ! isset($threads[$msg['thread_id']])) + { + $threads[$msg['thread_id']]['thread_id'] = $msg['thread_id']; + $threads[$msg['thread_id']]['messages'] = array($msg); + } + else + { + $threads[$msg['thread_id']]['messages'][] = $msg; + } + } + return $this->_success($threads); + } + // General Error Occurred + return $this->_general_error(); + } + /** ----------------------------------------------------------------- + * Change Message Status + * update_message_status() - will change status on message for particular user + * + * @param integer $msg_id REQUIRED + * @param integer $person_id REQUIRED + * @param integer $status_id REQUIRED - should come from config/message.php list of constants + * @return array + */ + function update_message_status($msg_id, $person_id, $status_id) + { + // Validate + if (empty($msg_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_MSG_ID); + } + if (empty($person_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_USER_ID); + } + if (empty($status_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_STATUS_ID); + } + $this->db->where(array('message_id' => $msg_id, 'person_id' => $person_id )); + $this->db->update('tbl_msg_status', array('status' => $status_id )); + $rows = $this->db->affected_rows(); + if ($rows == 1) + return $this->_success($rows, MSG_STATUS_UPDATE); + else + return $this->_general_error(); + } + /** ----------------------------------------------------------------- + * Add a Participant + * add_participant() - adds user to existing thread + * + * @param integer $thread_id REQUIRED + * @param integer $person_id REQUIRED + * @return array + */ + function addParticipant($thread_id, $person_id) + { + + if (empty($thread_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_THREAD_ID); + } + if (empty($person_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_USER_ID); + } + if ( ! $this->valid_new_participant($thread_id, $person_id)) + { + $this->_participant_error(MSG_ERR_PARTICIPANT_EXISTS); + } + if ( ! $this->application_user($person_id)) + { + $this->_participant_error(MSG_ERR_PARTICIPANT_NONSYSTEM); + } + $this->db->trans_start(); + $participants[] = array('thread_id' => $thread_id,'person_id' => $person_id); + $this->_insert_participants($participants); + // Get Messages by Thread + $messages = $this->_get_messages_by_thread_id($thread_id); + foreach ($messages as $message) + { + $statuses[] = array('message_id' => $message['message_id'], 'person_id' => $person_id, 'status' => MSG_STATUS_UNREAD); + } + $this->_insert_statuses($statuses); + $this->db->trans_complete(); + if ($this->db->trans_status() === FALSE) + { + $this->db->trans_rollback(); + return $this->_general_error(); + } + return $this->_success(NULL, MSG_PARTICIPANT_ADDED); + } + /** --------------------------------------------------------------- + * Remove a Participant + * remove_participant() - removes user from existing thread + * + * @param integer $thread_id REQUIRED + * @param integer $person_id REQUIRED + * @return array + */ + function remove_participant($thread_id, $person_id) + { + // Validate + if (empty($thread_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_THREAD_ID); + } + if (empty($person_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_USER_ID); + } + $this->db->trans_start(); + $this->_delete_participant($thread_id, $person_id); + $this->_delete_statuses($thread_id, $person_id); + $this->db->trans_complete(); + if ($this->db->trans_status() === FALSE) + { + $this->db->trans_rollback(); + return $this->_success(NULL, MSG_PARTICIPANT_REMOVED); + } + return $this->_general_error(); + } + /** ---------------------------------------------------------------- + * Send a New Message + * send_new_message() - sends new internal message. This function will create a new thread + * + * @param integer $sender_id REQUIRED + * @param mixed $recipients REQUIRED - a single integer or an array of integers, representing person_ids + * @param string $subject + * @param string $body + * @param integer $priority + * @return array + */ + function send_new_message($sender_id, $recipients, $subject, $body, $priority) + { + // Validate + if (empty($sender_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_SENDER_ID); + } + if (empty($recipients)) + { + return array( + 'err' => 1, + 'code' => MSG_ERR_INVALID_RECIPIENTS, + 'msg' => lang('mahana_'.MSG_ERR_INVALID_RECIPIENTS) + ); + } + $this->db->trans_start(); + $thread_id = $this->_insert_thread($subject); + $msg_id = $this->_insert_message($thread_id, $sender_id, $body, $priority); + // Create batch inserts + $participants[] = array('thread_id' => $thread_id,'person_id' => $sender_id); + $statuses[] = array('message_id' => $msg_id, 'person_id' => $sender_id,'status' => MSG_STATUS_READ); + if ( ! is_array($recipients) ) + { + if ($sender_id != $recipients) + { + $participants[] = array('thread_id' => $thread_id,'person_id' => $recipients); + $statuses[] = array('message_id' => $msg_id, 'person_id' => $recipients, 'status' => MSG_STATUS_UNREAD); + } + } + else + { + foreach ($recipients as $recipient) + { + if ($sender_id != $recipient) + { + $participants[] = array('thread_id' => $thread_id,'person_id' => $recipient); + $statuses[] = array('message_id' => $msg_id, 'person_id' => $recipient, 'status' => MSG_STATUS_UNREAD); + } + } + } + $participants=array_unique($participants, SORT_REGULAR); // Clean if sender and recipient is the same + $this->_insert_participants($participants); + $this->_insert_statuses($statuses); + $this->db->trans_complete(); + if ($this->db->trans_status() === FALSE) + { + $this->db->trans_rollback(); + return $this->_general_error(); + } + return $this->_success($thread_id, MSG_MESSAGE_SENT); + } + /** -------------------------------------------------------------- + * Reply to Message + * reply_to_message() - replies to internal message. This function will NOT create a new thread or participant list + * + * @param integer $msg_id REQUIRED + * @param integer $sender_id REQUIRED + * @param string $subject + * @param string $body + * @param integer $priority + * @return array + */ + function reply_to_message($reply_msg_id, $sender_id, $body, $priority) + { + // Validate + if (empty($sender_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_SENDER_ID); + } + if (empty($msg_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_MSG_ID); + } + $this->db->trans_start(); + // Get the thread id to keep messages together + if ( ! $thread_id = $this->_get_thread_id_from_message($reply_msg_id)) + { + return FALSE; + } + // Add this message + $msg_id = $this->_insert_message($thread_id, $sender_id, $body, $priority); + if ($recipients = $this->_get_thread_participants($thread_id, $sender_id)) + { + $statuses[] = array('message_id' => $msg_id, 'person_id' => $sender_id,'status' => MSG_STATUS_READ); + foreach ($recipients as $recipient) + { + $statuses[] = array('message_id' => $msg_id, 'person_id' => $recipient['person_id'], 'status' => MSG_STATUS_UNREAD); + } + $this->_insert_statuses($statuses); + } + $this->db->trans_complete(); + if ($this->db->trans_status() === FALSE) + { + $this->db->trans_rollback(); + return $this->_general_error(); + } + return $this->_success($msg_id, MSG_MESSAGE_SENT); + } + /** ---------------------------------------------------------------- + * Get Participant List + * get_participant_list() - returns list of participants on given thread. If sender_id set, sender_id will be left off list + * + * @param integer $thread_id REQUIRED + * @param integer $sender_id REQUIRED + * @return array + */ + function get_participant_list($thread_id, $sender_id = 0) + { + // Validate + if (empty($thread_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_THREAD_ID); + } + + if ($results = $this->_get_thread_participants($thread_id, $sender_id)) + return $this->_success($results); + else + return $this->_general_error(); + } + /** ---------------------------------------------------------------- + * Get Message Count + * get_msg_count() - returns integer with count of message for user, by status. defaults to new messages + * + * @param integer $person_id REQUIRED + * @param integer $status_id OPTIONAL - defaults to "Unread" + * @return array + */ + function get_msg_count($person_id, $status_id = MSG_STATUS_UNREAD) + { + if (empty($person_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_USER_ID); + } + $result = $this->db->select('COUNT(*) AS msg_count')->where(array('person_id' => $person_id, 'status' => $status_id ))->get('tbl_msg_status'); + $rows = $result->row()->msg_count; + + if (is_numeric($rows)) + return $this->_success($rows); + else + return $this->_general_error(); + } + // ------------------------------------------------------------------------ + /** + * Valid New Participant - because of CodeIgniter's DB Class return style, + * it is safer to check for uniqueness first + * + * @param integer $thread_id + * @param integer $person_id + * @return boolean + */ + function valid_new_participant($thread_id, $person_id) + { + $sql = 'SELECT COUNT(*) AS count ' . + ' FROM ' . $this->db->dbprefix . 'tbl_msg_participant p ' . + ' WHERE p.thread_id = ? ' . + ' AND p.person_id = ? '; + $query = $this->db->query($sql, array($thread_id, $person_id)); + if ($query->row()->count) + { + return FALSE; + } + return TRUE; + } - - - - - - - - - - - - - - FHC-Core/Message_model.php at ci · FH-Complete/FHC-Core - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Skip to content - - - - - - - - - - - - - -
- -
-
- - -
-
-
- -
-
- - - -
    - -
  • -
    - -
    - - - - Unwatch - - - - -
    - -
    -
    -
    -
  • - -
  • - -
    - -
    - - -
    -
    - - -
    - -
  • - -
  • - - - Fork - - - - - -
  • -
- -

- - /FHC-Core - -

- -
- -
- -
-
- - - - - - - -
+ /** --------------------------------------------------------------- + * Application User + * + * @param integer $person_id` + * @return boolean + */ + function application_user($person_id) + { + $sql = 'SELECT COUNT(*) AS count ' . + ' FROM ' . $this->db->dbprefix . 'public.tbl_person' . + ' WHERE ' . 'tbl_person.person_id' . ' = ?' ; + $query = $this->db->query($sql, array($person_id)); + if ($query->row()->count) + { + return TRUE; + } + return FALSE; + } -
- - - -
- -
- - Find file - - -
- -
- - -
- - - 3b39752 - - - - - -
- - -
- - -
- -
-
-
- -
- Raw - Blame - History -
- - - - - -
- -
- -
- -
- 704 lines (589 sloc) - - 21.1 KB -
-
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Message_model extends DB_Model
{
public function __construct()
{
parent::__construct();
require_once APPPATH.'config/message.php';
//$this->load->helper('language');
$this->lang->load('message');
}
/** -----------------------------------------------------------------
* get_message() - will return a single message, including the status for specified user.
*
* @param integer $msg_id EQUIRED
* @param integer $user_id REQUIRED
* @return array
*/
function getMessage($msg_id, $user_id)
{
// Validate
if (empty($msg_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_MSG_ID);
}
if (empty($user_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_USER_ID);
}
$sql = 'SELECT m.*, s.status, t.subject, ' . USER_TABLE_USERNAME .
' FROM ' . $this->db->dbprefix . 'msg_messages m ' .
' JOIN ' . $this->db->dbprefix . 'msg_threads t ON (m.thread_id = t.id) ' .
' JOIN ' . $this->db->dbprefix . USER_TABLE_TABLENAME . ' ON (' . USER_TABLE_ID . ' = m.sender_id) '.
' JOIN ' . $this->db->dbprefix . 'msg_status s ON (s.message_id = m.id AND s.user_id = ? ) ' .
' WHERE m.id = ? ' ;
$result = $this->db->query($sql, array($user_id, $msg_id));
if ($result)
return $this->_success($result->result_array());
else
return $this->_general_error();
}
/** -----------------------------------------------------------------
* Get a Full Thread
* get_full_thread() - will return a entire thread, including the status for specified user.
*
* @param integer $thread_id REQUIRED
* @param integer $user_id REQUIRED
* @param boolean $full_thread OPTIONAL - If true, user will also see messages from thread posted BEFORE user became participant
* @param string $order_by OPTIONAL
* @return array
*/
function get_full_thread($thread_id, $user_id, $full_thread = FALSE, $order_by = 'ASC')
{
// Validate
if (empty($thread_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_THREAD_ID);
}
if (empty($user_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_USER_ID);
}
$sql = 'SELECT m.*, s.status, t.subject, '.USER_TABLE_USERNAME .
' FROM ' . $this->db->dbprefix . 'msg_participants p ' .
' JOIN ' . $this->db->dbprefix . 'msg_threads t ON (t.id = p.thread_id) ' .
' JOIN ' . $this->db->dbprefix . 'msg_messages m ON (m.thread_id = t.id) ' .
' JOIN ' . $this->db->dbprefix . USER_TABLE_TABLENAME . ' ON (' . USER_TABLE_ID . ' = m.sender_id) '.
' JOIN ' . $this->db->dbprefix . 'msg_status s ON (s.message_id = m.id AND s.user_id = ? ) ' .
' WHERE p.user_id = ? ' .
' AND p.thread_id = ? ';
if ( ! $full_thread)
{
$sql .= ' AND m.cdate >= p.cdate';
}
$sql .= ' ORDER BY m.cdate ' . $order_by;
$result = $this->db->query($sql, array($user_id, $user_id, $thread_id));
if ($result)
return $this->_success($result->result_array());
else
return $this->_general_error();
}
/** -----------------------------------------------------------------
* get_all_threads() - will return all threads for user, including the status for specified user.
*
* @param integer $user_id REQUIRED
* @param boolean $full_thread OPTIONAL - If true, user will also see messages from thread posted BEFORE user became participant
* @param string $order_by OPTIONAL
* @return array
*/
function get_all_threads($user_id, $full_thread = FALSE, $order_by = 'asc')
{
if (empty($user_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_USER_ID);
}
$sql = 'SELECT m.*, s.status, t.subject, '.USER_TABLE_USERNAME .
' FROM ' . $this->db->dbprefix . 'msg_participants p ' .
' JOIN ' . $this->db->dbprefix . 'msg_threads t ON (t.id = p.thread_id) ' .
' JOIN ' . $this->db->dbprefix . 'msg_messages m ON (m.thread_id = t.id) ' .
' JOIN ' . $this->db->dbprefix . USER_TABLE_TABLENAME . ' ON (' . USER_TABLE_ID . ' = m.sender_id) '.
' JOIN ' . $this->db->dbprefix . 'msg_status s ON (s.message_id = m.id AND s.user_id = ? ) ' .
' WHERE p.user_id = ? ' ;
if (!$full_thread)
{
$sql .= ' AND m.cdate >= p.cdate';
}
$sql .= ' ORDER BY t.id ' . $order_by. ', m.cdate '. $order_by;
$result = $this->db->query($sql, array($user_id, $user_id));
if ($result)
return $this->_success($result->result_array());
else
return $this->_general_error();
}
/** -----------------------------------------------------------------
* Get all Threads Grouped
* get_all_threads_grouped() - will return all threads for user, including the status for specified user.
* - messages are grouped in threads.
*
* @param integer $user_id REQUIRED
* @param boolean $full_thread OPTIONAL - If true, user will also see messages from thread posted BEFORE user became participant
* @param string $order_by OPTIONAL
* @return array
*/
function get_all_threads_grouped($user_id, $full_thread = FALSE, $order_by = 'ASC')
{
if (empty($user_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_USER_ID);
}
$message = $this->get_all_threads($user_id, $full_thread, $order_by);
if (is_array($message))
{
$threads = array();
foreach ($message as $msg)
{
if ( ! isset($threads[$msg['thread_id']]))
{
$threads[$msg['thread_id']]['thread_id'] = $msg['thread_id'];
$threads[$msg['thread_id']]['messages'] = array($msg);
}
else
{
$threads[$msg['thread_id']]['messages'][] = $msg;
}
}
return $this->_success($threads);
}
// General Error Occurred
return $this->_general_error();
}
/** -----------------------------------------------------------------
* Change Message Status
* update_message_status() - will change status on message for particular user
*
* @param integer $msg_id REQUIRED
* @param integer $user_id REQUIRED
* @param integer $status_id REQUIRED - should come from config/message.php list of constants
* @return array
*/
function update_message_status($msg_id, $user_id, $status_id)
{
// Validate
if (empty($msg_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_MSG_ID);
}
if (empty($user_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_USER_ID);
}
if (empty($status_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_STATUS_ID);
}
$this->db->where(array('message_id' => $msg_id, 'user_id' => $user_id ));
$this->db->update('msg_status', array('status' => $status_id ));
$rows = $this->db->affected_rows();
if ($rows == 1)
return $this->_success($rows, MSG_STATUS_UPDATE);
else
return $this->_general_error();
}
/** -----------------------------------------------------------------
* Add a Participant
* add_participant() - adds user to existing thread
*
* @param integer $thread_id REQUIRED
* @param integer $user_id REQUIRED
* @return array
*/
function add_participant($thread_id, $user_id)
{
if (empty($thread_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_THREAD_ID);
}
if (empty($user_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_USER_ID);
}
if ( ! $this->valid_new_participant($thread_id, $user_id))
{
$this->_participant_error(MSG_ERR_PARTICIPANT_EXISTS);
}
if ( ! $this->application_user($user_id))
{
$this->_participant_error(MSG_ERR_PARTICIPANT_NONSYSTEM);
}
$this->db->trans_start();
$participants[] = array('thread_id' => $thread_id,'user_id' => $user_id);
$this->_insert_participants($participants);
// Get Messages by Thread
$messages = $this->_get_messages_by_thread_id($thread_id);
foreach ($messages as $message)
{
$statuses[] = array('message_id' => $message['id'], 'user_id' => $user_id, 'status' => MSG_STATUS_UNREAD);
}
$this->_insert_statuses($statuses);
$this->db->trans_complete();
if ($this->db->trans_status() === FALSE)
{
$this->db->trans_rollback();
return $this->_general_error();
}
return $this->_success(NULL, MSG_PARTICIPANT_ADDED);
}
/** ---------------------------------------------------------------
* Remove a Participant
* remove_participant() - removes user from existing thread
*
* @param integer $thread_id REQUIRED
* @param integer $user_id REQUIRED
* @return array
*/
function remove_participant($thread_id, $user_id)
{
// Validate
if (empty($thread_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_THREAD_ID);
}
if (empty($user_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_USER_ID);
}
$this->db->trans_start();
$this->_delete_participant($thread_id, $user_id);
$this->_delete_statuses($thread_id, $user_id);
$this->db->trans_complete();
if ($this->db->trans_status() === FALSE)
{
$this->db->trans_rollback();
return $this->_success(NULL, MSG_PARTICIPANT_REMOVED);
}
return $this->_general_error();
}
/** ----------------------------------------------------------------
* Send a New Message
* send_new_message() - sends new internal message. This function will create a new thread
*
* @param integer $sender_id REQUIRED
* @param mixed $recipients REQUIRED - a single integer or an array of integers, representing user_ids
* @param string $subject
* @param string $body
* @param integer $priority
* @return array
*/
function send_new_message($sender_id, $recipients, $subject, $body, $priority)
{
// Validate
if (empty($sender_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_SENDER_ID);
}
if (empty($recipients))
{
return array(
'err' => 1,
'code' => MSG_ERR_INVALID_RECIPIENTS,
'msg' => lang('mahana_'.MSG_ERR_INVALID_RECIPIENTS)
);
}
$this->db->trans_start();
$thread_id = $this->_insert_thread($subject);
$msg_id = $this->_insert_message($thread_id, $sender_id, $body, $priority);
// Create batch inserts
$participants[] = array('thread_id' => $thread_id,'user_id' => $sender_id);
$statuses[] = array('message_id' => $msg_id, 'user_id' => $sender_id,'status' => MSG_STATUS_READ);
if ( ! is_array($recipients) )
{
if ($sender_id != $recipients)
{
$participants[] = array('thread_id' => $thread_id,'user_id' => $recipients);
$statuses[] = array('message_id' => $msg_id, 'user_id' => $recipients, 'status' => MSG_STATUS_UNREAD);
}
}
else
{
foreach ($recipients as $recipient)
{
if ($sender_id != $recipient)
{
$participants[] = array('thread_id' => $thread_id,'user_id' => $recipient);
$statuses[] = array('message_id' => $msg_id, 'user_id' => $recipient, 'status' => MSG_STATUS_UNREAD);
}
}
}
$participants=array_unique($participants, SORT_REGULAR); // Clean if sender and recipient is the same
$this->_insert_participants($participants);
$this->_insert_statuses($statuses);
$this->db->trans_complete();
if ($this->db->trans_status() === FALSE)
{
$this->db->trans_rollback();
return $this->_general_error();
}
return $this->_success($thread_id, MSG_MESSAGE_SENT);
}
/** --------------------------------------------------------------
* Reply to Message
* reply_to_message() - replies to internal message. This function will NOT create a new thread or participant list
*
* @param integer $msg_id REQUIRED
* @param integer $sender_id REQUIRED
* @param string $subject
* @param string $body
* @param integer $priority
* @return array
*/
function reply_to_message($reply_msg_id, $sender_id, $body, $priority)
{
// Validate
if (empty($sender_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_SENDER_ID);
}
if (empty($msg_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_MSG_ID);
}
$this->db->trans_start();
// Get the thread id to keep messages together
if ( ! $thread_id = $this->_get_thread_id_from_message($reply_msg_id))
{
return FALSE;
}
// Add this message
$msg_id = $this->_insert_message($thread_id, $sender_id, $body, $priority);
if ($recipients = $this->_get_thread_participants($thread_id, $sender_id))
{
$statuses[] = array('message_id' => $msg_id, 'user_id' => $sender_id,'status' => MSG_STATUS_READ);
foreach ($recipients as $recipient)
{
$statuses[] = array('message_id' => $msg_id, 'user_id' => $recipient['user_id'], 'status' => MSG_STATUS_UNREAD);
}
$this->_insert_statuses($statuses);
}
$this->db->trans_complete();
if ($this->db->trans_status() === FALSE)
{
$this->db->trans_rollback();
return $this->_general_error();
}
return $this->_success($msg_id, MSG_MESSAGE_SENT);
}
/** ----------------------------------------------------------------
* Get Participant List
* get_participant_list() - returns list of participants on given thread. If sender_id set, sender_id will be left off list
*
* @param integer $thread_id REQUIRED
* @param integer $sender_id REQUIRED
* @return array
*/
function get_participant_list($thread_id, $sender_id = 0)
{
// Validate
if (empty($thread_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_THREAD_ID);
}
if ($results = $this->_get_thread_participants($thread_id, $sender_id))
return $this->_success($results);
else
return $this->_general_error();
}
/** ----------------------------------------------------------------
* Get Message Count
* get_msg_count() - returns integer with count of message for user, by status. defaults to new messages
*
* @param integer $user_id REQUIRED
* @param integer $status_id OPTIONAL - defaults to "Unread"
* @return array
*/
function get_msg_count($user_id, $status_id = MSG_STATUS_UNREAD)
{
if (empty($user_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_USER_ID);
}
$result = $this->db->select('COUNT(*) AS msg_count')->where(array('user_id' => $user_id, 'status' => $status_id ))->get('msg_status');
$rows = $result->row()->msg_count;
if (is_numeric($rows))
return $this->_success($rows);
else
return $this->_general_error();
}
// ------------------------------------------------------------------------
/**
* Valid New Participant - because of CodeIgniter's DB Class return style,
* it is safer to check for uniqueness first
*
* @param integer $thread_id
* @param integer $user_id
* @return boolean
*/
function valid_new_participant($thread_id, $user_id)
{
$sql = 'SELECT COUNT(*) AS count ' .
' FROM ' . $this->db->dbprefix . 'msg_participants p ' .
' WHERE p.thread_id = ? ' .
' AND p.user_id = ? ';
$query = $this->db->query($sql, array($thread_id, $user_id));
if ($query->row()->count)
{
return FALSE;
}
return TRUE;
}
/** ---------------------------------------------------------------
* Application User
*
* @param integer $user_id`
* @return boolean
*/
function application_user($user_id)
{
$sql = 'SELECT COUNT(*) AS count ' .
' FROM ' . $this->db->dbprefix . USER_TABLE_TABLENAME .
' WHERE ' . USER_TABLE_ID . ' = ?' ;
$query = $this->db->query($sql, array($user_id));
if ($query->row()->count)
{
return TRUE;
}
return FALSE;
}
// ------------------------------------------------------------------------
// Private Functions from here out!
// ------------------------------------------------------------------------
/**
* Insert Thread
*
* @param string $subject
* @return integer
*/
private function _insert_thread($subject)
{
$insert_id = $this->db->insert('msg_threads', array('subject' => $subject));
return $this->db->insert_id();
}
/**
* Insert Message
*
* @param integer $thread_id
* @param integer $sender_id
* @param string $body
* @param integer $priority
* @return integer
*/
private function _insert_message($thread_id, $sender_id, $body, $priority)
{
$insert['thread_id'] = $thread_id;
$insert['sender_id'] = $sender_id;
$insert['body'] = $body;
$insert['priority'] = $priority;
$insert_id = $this->db->insert('msg_messages', $insert);
return $this->db->insert_id();
}
/**
* Insert Participants
*
* @param array $participants
* @return bool
*/
private function _insert_participants($participants)
{
return $this->db->insert_batch('msg_participants', $participants);
}
/**
* Insert Statuses
*
* @param array $statuses
* @return bool
*/
private function _insert_statuses($statuses)
{
return $this->db->insert_batch('msg_status', $statuses);
}
/**
* Get Thread ID from Message
*
* @param integer $msg_id
* @return integer
*/
private function _get_thread_id_from_message($msg_id)
{
$query = $this->db->select('thread_id')->get_where('msg_messages', array('id' => $msg_id));
if ($query->num_rows())
{
return $query->row()->thread_id;
}
return 0;
}
/**
* Get Messages by Thread
*
* @param integer $thread_id
* @return array
*/
private function _get_messages_by_thread_id($thread_id)
{
$query = $this->db->get_where('msg_messages', array('thread_id' => $thread_id));
return $query->result_array();
}
/**
* Get Thread Particpiants
*
* @param integer $thread_id
* @param integer $sender_id
* @return array
*/
private function _get_thread_participants($thread_id, $sender_id = 0)
{
$array['thread_id'] = $thread_id;
if ($sender_id) // If $sender_id 0, no one to exclude
{
$array['msg_participants.user_id != '] = $sender_id;
}
$this->db->select('msg_participants.user_id, '.USER_TABLE_USERNAME, FALSE);
$this->db->join(USER_TABLE_TABLENAME, 'msg_participants.user_id = ' . USER_TABLE_ID);
$query = $this->db->get_where('msg_participants', $array);
return $query->result_array();
}
/**
* Delete Participant
*
* @param integer $thread_id
* @param integer $user_id
* @return boolean
*/
private function _delete_participant($thread_id, $user_id)
{
$this->db->delete('msg_participants', array('thread_id' => $thread_id, 'user_id' => $user_id));
if ($this->db->affected_rows() > 0)
{
return TRUE;
}
return FALSE;
}
/**
* Delete Statuses
*
* @param integer $thread_id
* @param integer $user_id
* @return boolean
*/
private function _delete_statuses($thread_id, $user_id)
{
$sql = 'DELETE s FROM msg_status s ' .
' JOIN ' . $this->db->dbprefix . 'msg_messages m ON (m.id = s.message_id) ' .
' WHERE m.thread_id = ? ' .
' AND s.user_id = ? ';
$query = $this->db->query($sql, array($thread_id, $user_id));
return TRUE;
}
/** ---------------------------------------------------------------
* Error Particpant Exists
*
* @return array
*/
private function _participant_error($error = '')
{
return array(
'err' => 1,
'code' => 1,
'msg' => lang('mahana_' . $error)
);
}
}
/* end of file message_model.php */
- -
- -
- - - - -
- -
- - -
-
- -
- - - - - - - - -
- - - Something went wrong with that request. Please try again. -
- - - - - - - - - - - - - - - - + // ------------------------------------------------------------------------ + // Private Functions from here out! + // ------------------------------------------------------------------------ + /** + * Insert Thread + * + * @param string $subject + * @return integer + */ + private function _insert_thread($subject) + { + $insert_id = $this->db->insert('tbl_msg_thread', array('subject' => $subject)); + return $this->db->insert_id(); + } + /** + * Insert Message + * + * @param integer $thread_id + * @param integer $sender_id + * @param string $body + * @param integer $priority + * @return integer + */ + private function _insert_message($thread_id, $sender_id, $body, $priority) + { + $insert['thread_id'] = $thread_id; + $insert['sender_id'] = $sender_id; + $insert['body'] = $body; + $insert['priority'] = $priority; + $insert_id = $this->db->insert('tbl_msg_message', $insert); + return $this->db->insert_id(); + } + /** + * Insert Participants + * + * @param array $participants + * @return bool + */ + private function _insert_participants($participants) + { + return $this->db->insert_batch('tbl_msg_participant', $participants); + } + /** + * Insert Statuses + * + * @param array $statuses + * @return bool + */ + private function _insert_statuses($statuses) + { + return $this->db->insert_batch('tbl_msg_status', $statuses); + } + /** + * Get Thread ID from Message + * + * @param integer $msg_id + * @return integer + */ + private function _get_thread_id_from_message($msg_id) + { + $query = $this->db->select('thread_id')->get_where('tbl_msg_message', array('id' => $msg_id)); + if ($query->num_rows()) + { + return $query->row()->thread_id; + } + return 0; + } + /** + * Get Messages by Thread + * + * @param integer $thread_id + * @return array + */ + private function _get_messages_by_thread_id($thread_id) + { + $query = $this->db->get_where('tbl_msg_message', array('thread_id' => $thread_id)); + return $query->result_array(); + } + /** + * Get Thread Particpiants + * + * @param integer $thread_id + * @param integer $sender_id + * @return array + */ + private function _get_thread_participants($thread_id, $sender_id = 0) + { + $array['thread_id'] = $thread_id; + if ($sender_id) // If $sender_id 0, no one to exclude + { + $array['tbl_msg_participant.person_id != '] = $sender_id; + } + $this->db->select('tbl_msg_participant.person_id, '."CONCAT(vorname, ' ', nachname) as user_name", FALSE); + $this->db->join('public.tbl_person', 'tbl_msg_participant.person_id = ' . 'tbl_person.person_id'); + $query = $this->db->get_where('tbl_msg_participant', $array); + return $query->result_array(); + } + /** + * Delete Participant + * + * @param integer $thread_id + * @param integer $person_id + * @return boolean + */ + private function _delete_participant($thread_id, $person_id) + { + $this->db->delete('tbl_msg_participant', array('thread_id' => $thread_id, 'person_id' => $person_id)); + if ($this->db->affected_rows() > 0) + { + return TRUE; + } + return FALSE; + } + /** + * Delete Statuses + * + * @param integer $thread_id + * @param integer $person_id + * @return boolean + */ + private function _delete_statuses($thread_id, $person_id) + { + $sql = 'DELETE s FROM tbl_msg_status s ' . + ' JOIN ' . $this->db->dbprefix . 'tbl_msg_message m ON (m.message_id = s.message_id) ' . + ' WHERE m.thread_id = ? ' . + ' AND s.person_id = ? '; + $query = $this->db->query($sql, array($thread_id, $person_id)); + return TRUE; + } + /** --------------------------------------------------------------- + * Error Particpant Exists + * + * @return array + */ + private function _participant_error($error = '') + { + return array( + 'err' => 1, + 'code' => 1, + 'msg' => lang('mahana_' . $error) + ); + } +} +/* end of file message_model.php */ diff --git a/application/models/system/Thread_model.php b/application/models/system/Thread_model.php new file mode 100644 index 000000000..f5f1ee3ca --- /dev/null +++ b/application/models/system/Thread_model.php @@ -0,0 +1,14 @@ +dbTable = 'public.tbl_msg_thread'; + $this->pk = 'thread_id'; + } +} diff --git a/include/studiengang.class.php b/include/studiengang.class.php index f2c8069f2..dfc433110 100755 --- a/include/studiengang.class.php +++ b/include/studiengang.class.php @@ -31,7 +31,7 @@ if (function_exists('get_instance')) else require_once(dirname(__FILE__).'/../ci_hack.php'); -require_once(dirname(__FILE__).'/../application/models/lehre/Studiengang_model.php'); +require_once(dirname(__FILE__).'/../application/models/organisation/Studiengang_model.php'); class studiengang extends Studiengang_model { From 4b1691361bf2a6b25428392a0ad49ddd2d4debf1 Mon Sep 17 00:00:00 2001 From: Paminger Date: Tue, 10 May 2016 14:37:13 +0200 Subject: [PATCH 05/31] Merge --- application/config/fhcomplete.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/application/config/fhcomplete.php b/application/config/fhcomplete.php index 54bb146d4..2a3b16462 100644 --- a/application/config/fhcomplete.php +++ b/application/config/fhcomplete.php @@ -22,12 +22,7 @@ $config['fhc_acl'] = array 'public.tbl_prestudent' => 'basis/person', 'public.tbl_prestudentstatus' => 'basis/person', 'public.tbl_organisationseinheit' => 'basis/organisationseinheit', -<<<<<<< HEAD 'public.tbl_sprache' => 'admin', 'public.tbl_msg_thread' => 'admin', 'public.tbl_msg_message' => 'admin' ); -======= - 'public.tbl_sprache' => 'admin' -); ->>>>>>> 44ebe15c9cab8fbbf8396d255648b8afda0f5d14 From 91684799129c6de1852a9bf43bce9d36c34610f0 Mon Sep 17 00:00:00 2001 From: paolo Date: Tue, 10 May 2016 15:30:00 +0200 Subject: [PATCH 06/31] - Moved class Studiengang to Studiengang2 to prevent class name conflicts - Added a route rule to let to call Studiengang2 controller with the urn /api/v1/organisation/studiengang/ - Moved Kontank controller to /api/v1/person - Kontakt controller has two method getKontakt and postKontakt --- application/config/routes.php | 5 +- application/controllers/api/v1/Kontakt.php | 80 ------------------- .../api/v1/organisation/Studiengang2.php | 34 ++++++++ .../controllers/api/v1/person/Kontakt.php | 70 ++++++++++++++++ application/core/FHC_Model.php | 9 ++- application/models/person/Kontakt_model.php | 38 +-------- 6 files changed, 113 insertions(+), 123 deletions(-) delete mode 100644 application/controllers/api/v1/Kontakt.php create mode 100644 application/controllers/api/v1/organisation/Studiengang2.php create mode 100644 application/controllers/api/v1/person/Kontakt.php diff --git a/application/config/routes.php b/application/config/routes.php index 968ee1396..0bdb099c2 100755 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -49,8 +49,9 @@ defined('BASEPATH') OR exit('No direct script access allowed'); | Examples: my-controller/index -> my_controller/index | my-controller/my-method -> my_controller/my_method */ -$route['person/(:any)'] = 'person/view/$1'; -$route['person'] = 'person'; $route['default_controller'] = 'Vilesci'; $route['404_override'] = ''; $route['translate_uri_dashes'] = FALSE; + +// Class name conflicts +$route['api/v1/organisation/studiengang/(:any)'] = 'api/v1/organisation/studiengang2/$1'; \ No newline at end of file diff --git a/application/controllers/api/v1/Kontakt.php b/application/controllers/api/v1/Kontakt.php deleted file mode 100644 index 7f9c05112..000000000 --- a/application/controllers/api/v1/Kontakt.php +++ /dev/null @@ -1,80 +0,0 @@ -load->model('kontakt/Kontakt_model'); - } - - public function kontaktPerson_get() - { - $result = $this->Kontakt_model->getKontaktPerson($this->get("person_id")); - if($result != FALSE) - { - $httpstatus = REST_Controller::HTTP_OK; - $payload = [ - 'success' => true, - 'message' => 'Kontakt found.' - ]; - $payload['data'] = $result; - } - else - { - $payload = [ - 'success' => false, - 'message' => 'Could not find Kontakt.' - ]; - $httpstatus = REST_Controller::HTTP_OK; - } - - $this->response($payload, $httpstatus); - } - - public function kontakt_post() - { - $result = $this->Kontakt_model->saveKontakt($this->post()); - if($result != FALSE) - { - $httpstatus = REST_Controller::HTTP_OK; - $payload = [ - 'success' => true, - 'message' => 'Kontakt saved.' - ]; - $payload['data'] = $result; - } - else - { - $payload = [ - 'success' => false, - 'message' => 'Could not save Kontakt.' - ]; - $httpstatus = REST_Controller::HTTP_OK; - } - - $this->response($payload, $httpstatus); - } - -} diff --git a/application/controllers/api/v1/organisation/Studiengang2.php b/application/controllers/api/v1/organisation/Studiengang2.php new file mode 100644 index 000000000..237a85f11 --- /dev/null +++ b/application/controllers/api/v1/organisation/Studiengang2.php @@ -0,0 +1,34 @@ +load->model('organisation/studiengang_model', 'StudiengangModel'); + // Load set the uid of the model to let to check the permissions + $this->StudiengangModel->setUID($this->_getUID()); + } + + public function getAllForBewerbung() + { + $this->response($this->StudiengangModel->getAllForBewerbung(), REST_Controller::HTTP_OK); + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/person/Kontakt.php b/application/controllers/api/v1/person/Kontakt.php new file mode 100644 index 000000000..759f69120 --- /dev/null +++ b/application/controllers/api/v1/person/Kontakt.php @@ -0,0 +1,70 @@ +load->model('person/kontakt_model', 'KontaktModel'); + // Load set the uid of the model to let to check the permissions + $this->KontaktModel->setUID($this->_getUID()); + } + + public function getKontakt() + { + $personID = $this->get("person_id"); + + if(isset($personID)) + { + $result = $this->KontaktModel->loadWhere(array('person_id' => $personID)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + public function postKontakt() + { + $post = $this->post(); + + if(is_array($post)) + { + if(isset($post['kontakt_id'])) + { + $result = $this->KontaktModel->update($post['kontakt_id'], $post); + } + else + { + $result = $this->KontaktModel->insert($post); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } +} \ No newline at end of file diff --git a/application/core/FHC_Model.php b/application/core/FHC_Model.php index 6f0e5337b..d4c6d3b12 100644 --- a/application/core/FHC_Model.php +++ b/application/core/FHC_Model.php @@ -10,12 +10,13 @@ class FHC_Model extends CI_Model $this->load->helper('language'); $this->lang->load('fhc_model'); $this->lang->load('fhcomplete'); - if (is_null($uid) && isset($this->session->uid)) + + $uid = NULL; + if(is_null($uid) && isset($this->session->uid)) + { $uid = $this->session->uid; - else - $uid = null; + } $this->load->library('FHC_DB_ACL', array('uid' => $uid)); - //$this->load->library('FHC_DB_ACL'); } /** --------------------------------------------------------------- diff --git a/application/models/person/Kontakt_model.php b/application/models/person/Kontakt_model.php index 8bd905641..5c25f563e 100644 --- a/application/models/person/Kontakt_model.php +++ b/application/models/person/Kontakt_model.php @@ -1,7 +1,6 @@ dbTable = 'public.tbl_kontakt'; $this->pk = 'kontakt_id'; } - - public function saveKontakt($kontakt) - { - //TODO check berechtigung -// if ($this->fhc_db_acl->bb->isBerechtigt('person', 'sui')) -// { - $data = array( - "person_id"=>$kontakt["person_id"], - "kontakttyp"=>$kontakt["kontakttyp"], - "kontakt"=>$kontakt["kontakt"], - "insertvon"=>$kontakt["insertvon"], - "insertamum"=>date('Y-m-d H:i:s') - ); - if($this->db->insert("public.tbl_kontakt", $data)){ - return $this->db->insert_id(); - } - else - { - return false; - } -// } -// else -// { -// return "Nicht berechtigt"; -// } - } - - public function getKontaktPerson($person_id) - { - $this->db->select("*") - ->from("public.tbl_kontakt k") - ->where("k.person_id", $person_id); - - return $this->db->get()->result_array(); - } -} +} \ No newline at end of file From 4413a64860e986be9fd7d9663c532bdcb6173ab5 Mon Sep 17 00:00:00 2001 From: paolo Date: Wed, 11 May 2016 10:40:08 +0200 Subject: [PATCH 07/31] - Added new permission to access to tbl_bundesland table using basis/nation - Added bundesland controller and model --- application/config/fhcomplete.php | 1 + .../controllers/api/v1/codex/Bundesland.php | 37 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 application/controllers/api/v1/codex/Bundesland.php diff --git a/application/config/fhcomplete.php b/application/config/fhcomplete.php index 2a3b16462..3b862bf12 100644 --- a/application/config/fhcomplete.php +++ b/application/config/fhcomplete.php @@ -6,6 +6,7 @@ $config['fhc_version'] = '3.2'; $config['fhc_acl'] = array ( + 'bis.tbl_bundesland' => 'basis/nation', 'bis.tbl_nation' => 'basis/nation', 'bis.tbl_lgartcode' => 'basis/lgartcode', diff --git a/application/controllers/api/v1/codex/Bundesland.php b/application/controllers/api/v1/codex/Bundesland.php new file mode 100644 index 000000000..ad5c8e29a --- /dev/null +++ b/application/controllers/api/v1/codex/Bundesland.php @@ -0,0 +1,37 @@ +load->model('codex/bundesland_model', 'BundeslandModel'); + // Load set the uid of the model to let to check the permissions + $this->BundeslandModel->setUID($this->_getUID()); + } + + public function getAll() + { + $result = $this->BundeslandModel->loadWhole(); + + $this->response($result, REST_Controller::HTTP_OK); + } +} \ No newline at end of file From b0c1e50e47f47621c70fd495f9b359958850f126 Mon Sep 17 00:00:00 2001 From: Stefan Puraner Date: Wed, 11 May 2016 11:56:18 +0200 Subject: [PATCH 08/31] added workaround for parsing data --- application/config/config.php | 2 +- .../controllers/api/v1/person/Kontakt.php | 19 ++++++++- .../controllers/api/v1/person/Person.php | 31 +++++++++++--- application/models/person/Person_model.php | 40 ------------------- 4 files changed, 43 insertions(+), 49 deletions(-) diff --git a/application/config/config.php b/application/config/config.php index 68b85b62f..96b966b37 100755 --- a/application/config/config.php +++ b/application/config/config.php @@ -207,7 +207,7 @@ $config['directory_trigger'] = 'd'; | your log files will fill up very fast. | */ -$config['log_threshold'] = 0; +$config['log_threshold'] = 4; /* |-------------------------------------------------------------------------- diff --git a/application/controllers/api/v1/person/Kontakt.php b/application/controllers/api/v1/person/Kontakt.php index 759f69120..5a59507dc 100644 --- a/application/controllers/api/v1/person/Kontakt.php +++ b/application/controllers/api/v1/person/Kontakt.php @@ -41,13 +41,13 @@ class Kontakt extends APIv1_Controller } else { - $this->response(); + $this->response(); } } public function postKontakt() { - $post = $this->post(); + $post = $this->_parseData($this->post()); if(is_array($post)) { @@ -67,4 +67,19 @@ class Kontakt extends APIv1_Controller $this->response(); } } + + private function _parseData($person) + { + if(is_array($person)) + { + foreach($person as $key=>$value) + { + if($value === "") + { + $person[$key] = null; + } + } + return $person; + } + } } \ No newline at end of file diff --git a/application/controllers/api/v1/person/Person.php b/application/controllers/api/v1/person/Person.php index c3ea2e7ab..e44410847 100644 --- a/application/controllers/api/v1/person/Person.php +++ b/application/controllers/api/v1/person/Person.php @@ -60,8 +60,7 @@ class Person extends APIv1_Controller } else { - $fields = $this->PersonModel->getFields(); - $this->response($fields, REST_Controller::HTTP_OK); + $this->response(); } } @@ -70,15 +69,17 @@ class Person extends APIv1_Controller */ public function postPerson() { + $person = $this->_parseData($this->post()); + if($this->_validate($this->post())) { - if(isset($this->post()['person_id'])) + if(isset($person['person_id']) && !(is_null($person["person_id"])) && ($person["person_id"] != "")) { - $result = $this->PersonModel->update($this->post()['person_id'], $this->post()); + $result = $this->PersonModel->update($person['person_id'], $person); } else { - $result = $this->PersonModel->insert($this->post()); + $result = $this->PersonModel->insert($person); } $this->response($result, REST_Controller::HTTP_OK); @@ -108,6 +109,21 @@ class Person extends APIv1_Controller $this->response(); } } + + private function _parseData($person) + { + if(is_array($person)) + { + foreach($person as $key=>$value) + { + if($value === "") + { + $person[$key] = null; + } + } + return $person; + } + } private function _validate($person = NULL) { @@ -115,7 +131,10 @@ class Person extends APIv1_Controller { return false; } - + + //TODO + return true; + $person['nachname'] = trim($person['nachname']); $person['vorname'] = trim($person['vorname']); $person['vornamen'] = trim($person['vornamen']); diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php index 613a3cb76..171f3a47e 100644 --- a/application/models/person/Person_model.php +++ b/application/models/person/Person_model.php @@ -11,46 +11,6 @@ class Person_model extends DB_Model $this->dbTable = 'public.tbl_person'; $this->pk = 'person_id'; } - - public function getFields() - { - $fields = array( - //Tabellenspalten - "person_id" => NULL, - "sprache" => NULL, - "anrede" => NULL, - "titelpost" => NULL, - "titelpre" => NULL, - "nachname" => NULL, - "vorname" => NULL, - "vornamen" => NULL, - "gebdatum" => NULL, - "gebort" => NULL, - "gebzeit" => NULL, - "foto" => NULL, - "anmerkungen" => NULL, - "homepage" => NULL, - "svnr" => NULL, - "ersatzkennzeichen" => NULL, - "familienstand" => NULL, - "anzahlkinder" => NULL, - "aktiv"=>TRUE, - "insertamum" => NULL, - "insertvon" => NULL, - "updateamum" => NULL, - "updatevon" => NULL, - "geschlecht" => "u", - "staatsbuergerschaft" => NULL, - "geburtsnation" => NULL, - "ext_id" => NULL, - "kurzbeschreibung"> NULL, - "zugangscode" => NULL, - "foto_sperre" => FALSE, - "matr_nr"=> NULL - ); - - return $this->_success($fields); - } /** * From 0132356094d290a78a4ad987a9291ef4972b9291 Mon Sep 17 00:00:00 2001 From: paolo Date: Wed, 11 May 2016 15:12:35 +0200 Subject: [PATCH 09/31] - Added new permission to access to tbl_addresse table using basis/adresse - Added adresse controller and model --- application/config/fhcomplete.php | 3 +- .../controllers/api/v1/person/Adresse.php | 70 +++++++++++++++++++ 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 application/controllers/api/v1/person/Adresse.php diff --git a/application/config/fhcomplete.php b/application/config/fhcomplete.php index 3b862bf12..9e56b1a88 100644 --- a/application/config/fhcomplete.php +++ b/application/config/fhcomplete.php @@ -17,6 +17,7 @@ $config['fhc_acl'] = array 'lehre.tbl_studienordnung' => 'basis/studienordnung', 'lehre.vw_studienplan' => 'basis/vw_studienplan', + 'public.tbl_adresse' => 'basis/adresse', 'public.tbl_person' => 'basis/person', 'public.tbl_kontakt' => 'basis/kontakt', 'public.tbl_benutzer' => 'basis/benutzer', @@ -26,4 +27,4 @@ $config['fhc_acl'] = array 'public.tbl_sprache' => 'admin', 'public.tbl_msg_thread' => 'admin', 'public.tbl_msg_message' => 'admin' -); +); \ No newline at end of file diff --git a/application/controllers/api/v1/person/Adresse.php b/application/controllers/api/v1/person/Adresse.php new file mode 100644 index 000000000..1560f2a4d --- /dev/null +++ b/application/controllers/api/v1/person/Adresse.php @@ -0,0 +1,70 @@ +load->model('person/adresse_model', 'AdresseModel'); + // Load set the uid of the model to let to check the permissions + $this->AdresseModel->setUID($this->_getUID()); + } + + public function getAdresse() + { + $personID = $this->get("person_id"); + + if(isset($personID)) + { + $result = $this->AdresseModel->loadWhere(array('person_id' => $personID)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + public function postAdresse() + { + $post = $this->post(); + + if(is_array($post)) + { + if(isset($post['adresse_id'])) + { + $result = $this->AdresseModel->update($post['adresse_id'], $post); + } + else + { + $result = $this->AdresseModel->insert($post); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } +} \ No newline at end of file From 63db2326ed2157a3e8983a0977cf4e877e94c7d3 Mon Sep 17 00:00:00 2001 From: paolo Date: Thu, 12 May 2016 10:05:29 +0200 Subject: [PATCH 10/31] - Added new permission to access to tbl_studiengang table using basis/studiengang - Added method getStudiengang to class Studiengang2 to get a studiengang from pk - Added method addDistinct to class DB_Model to add the distinct clause to a query --- application/config/fhcomplete.php | 2 ++ .../api/v1/organisation/Studiengang2.php | 16 ++++++++++++++++ application/core/DB_Model.php | 10 ++++++++++ 3 files changed, 28 insertions(+) diff --git a/application/config/fhcomplete.php b/application/config/fhcomplete.php index 9e56b1a88..b0af59794 100644 --- a/application/config/fhcomplete.php +++ b/application/config/fhcomplete.php @@ -24,6 +24,8 @@ $config['fhc_acl'] = array 'public.tbl_prestudent' => 'basis/person', 'public.tbl_prestudentstatus' => 'basis/person', 'public.tbl_organisationseinheit' => 'basis/organisationseinheit', + 'public.tbl_studiengang' => 'basis/studiengang', + 'public.tbl_sprache' => 'admin', 'public.tbl_msg_thread' => 'admin', 'public.tbl_msg_message' => 'admin' diff --git a/application/controllers/api/v1/organisation/Studiengang2.php b/application/controllers/api/v1/organisation/Studiengang2.php index 237a85f11..0a05e020a 100644 --- a/application/controllers/api/v1/organisation/Studiengang2.php +++ b/application/controllers/api/v1/organisation/Studiengang2.php @@ -27,6 +27,22 @@ class Studiengang2 extends APIv1_Controller $this->StudiengangModel->setUID($this->_getUID()); } + public function getStudiengang() + { + $studiengang_kz = $this->get('studiengang_kz'); + + if(isset($studiengang_kz)) + { + $result = $this->StudiengangModel->load($studiengang_kz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + public function getAllForBewerbung() { $this->response($this->StudiengangModel->getAllForBewerbung(), REST_Controller::HTTP_OK); diff --git a/application/core/DB_Model.php b/application/core/DB_Model.php index 777c9b26c..5cf38c121 100644 --- a/application/core/DB_Model.php +++ b/application/core/DB_Model.php @@ -224,6 +224,16 @@ class DB_Model extends FHC_Model return $this->_success(TRUE); } + /** --------------------------------------------------------------- + * Add distinct clause + * + * @return void + */ + public function addDistinct() + { + $this->db->distinct(); + } + /** --------------------------------------------------------------- * Add limit clause * From d48f586af224662f0f84d7692755ebf3f683e11d Mon Sep 17 00:00:00 2001 From: paolo Date: Thu, 12 May 2016 13:54:31 +0200 Subject: [PATCH 11/31] - Added new permission to access to tbl_preinteressent table using basis/preinteressent - Added controller Preinteressent with method to read/write from/in the DB --- application/config/fhcomplete.php | 1 + .../controllers/api/v1/crm/Preinteressent.php | 90 +++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 application/controllers/api/v1/crm/Preinteressent.php diff --git a/application/config/fhcomplete.php b/application/config/fhcomplete.php index b0af59794..0cb2db31d 100644 --- a/application/config/fhcomplete.php +++ b/application/config/fhcomplete.php @@ -21,6 +21,7 @@ $config['fhc_acl'] = array 'public.tbl_person' => 'basis/person', 'public.tbl_kontakt' => 'basis/kontakt', 'public.tbl_benutzer' => 'basis/benutzer', + 'public.tbl_preinteressent' => 'basis/preinteressent', 'public.tbl_prestudent' => 'basis/person', 'public.tbl_prestudentstatus' => 'basis/person', 'public.tbl_organisationseinheit' => 'basis/organisationseinheit', diff --git a/application/controllers/api/v1/crm/Preinteressent.php b/application/controllers/api/v1/crm/Preinteressent.php new file mode 100644 index 000000000..fbfa6bb94 --- /dev/null +++ b/application/controllers/api/v1/crm/Preinteressent.php @@ -0,0 +1,90 @@ +load->model('crm/preinteressent_model', 'PreinteressentModel'); + // Load set the uid of the model to let to check the permissions + $this->PreinteressentModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getPreinteressent() + { + $preinteressent_id = $this->get('preinteressent_id'); + + if(isset($preinteressent_id)) + { + $result = $this->PreinteressentModel->load($preinteressent_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postPreinteressent() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['preinteressent_id'])) + { + $result = $this->PreinteressentModel->update($this->post()['preinteressent_id'], $this->post()); + } + else + { + $result = $this->PreinteressentModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($preinteressent) + { + if($preinteressent['person_id'] == '') + { + //$this->errormsg = 'Person_id muss angegeben werden'; + return false; + } + + if($preinteressent['aufmerksamdurch_kurzbz'] == '') + { + //$this->errormsg = 'Aufmerksamdurch muss angegeben werden'; + return false; + } + + return true; + } +} \ No newline at end of file From f76b83ef647fdce8051cf5d45db1e8be93bb18ed Mon Sep 17 00:00:00 2001 From: paolo Date: Thu, 12 May 2016 16:55:21 +0200 Subject: [PATCH 12/31] - Fixed include of ci_db_extra.php in ci_hack.php - Added delete for table public.tbl_preinteressent in dump.sql --- ci_hack.php | 3 +-- tests/codeception/_data/dump.sql | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ci_hack.php b/ci_hack.php index 8bafa5f7b..a7cfe5d02 100755 --- a/ci_hack.php +++ b/ci_hack.php @@ -369,5 +369,4 @@ require_once(dirname(__FILE__).'/application/core/FHC_Model.php'); $model=new CI_Model(); // Traits -require_once(dirname(__FILE__).'db_extra.php'); - +require_once(dirname(__FILE__).'/ci_db_extra.php'); \ No newline at end of file diff --git a/tests/codeception/_data/dump.sql b/tests/codeception/_data/dump.sql index d72b8d895..62deaa687 100644 --- a/tests/codeception/_data/dump.sql +++ b/tests/codeception/_data/dump.sql @@ -15,6 +15,8 @@ DELETE FROM public.tbl_ort; DELETE FROM public.tbl_kontakt WHERE person_id > 2; -- EMPTY public.tbl_benutzer DELETE FROM public.tbl_benutzer WHERE person_id > 2; +-- EMPTY public.tbl_preinteressent +DELETE FROM public.tbl_preinteressent WHERE person_id > 2; -- EMPTY public.tbl_person DELETE FROM public.tbl_person WHERE person_id > 2; From de9e92e3b0aae3a1f17e1c31c5771b0a4ea48ac9 Mon Sep 17 00:00:00 2001 From: paolo Date: Fri, 13 May 2016 19:00:40 +0200 Subject: [PATCH 13/31] - Added permissions for every DB tables that has a model - Added all controllers for every model - All controller has a load and a insert/update method --- application/config/fhcomplete.php | 225 ++++++++++++++++-- .../api/v1/accounting/Aufteilung.php | 78 ++++++ .../api/v1/accounting/Bestelldetail.php | 78 ++++++ .../api/v1/accounting/Bestelldetailtag.php | 78 ++++++ .../api/v1/accounting/Bestellstatus.php | 78 ++++++ .../api/v1/accounting/Bestellung.php | 78 ++++++ .../api/v1/accounting/Bestellungtag.php | 78 ++++++ .../controllers/api/v1/accounting/Buchung.php | 78 ++++++ .../api/v1/accounting/Buchungstyp.php | 78 ++++++ .../controllers/api/v1/accounting/Budget.php | 78 ++++++ .../controllers/api/v1/accounting/Konto.php | 78 ++++++ .../api/v1/accounting/Kostenstelle.php | 78 ++++++ .../api/v1/accounting/Rechnung.php | 78 ++++++ .../api/v1/accounting/Rechnungsbetrag.php | 78 ++++++ .../api/v1/accounting/Rechnungstyp.php | 78 ++++++ .../controllers/api/v1/accounting/Vertrag.php | 78 ++++++ .../api/v1/accounting/Vertragsstatus.php | 78 ++++++ .../api/v1/accounting/Vertragstyp.php | 78 ++++++ .../api/v1/accounting/Zahlungstyp.php | 78 ++++++ .../controllers/api/v1/codex/Akadgrad.php | 78 ++++++ .../controllers/api/v1/codex/Archiv.php | 78 ++++++ .../api/v1/codex/Aufmerksamdurch.php | 78 ++++++ .../controllers/api/v1/codex/Ausbildung.php | 78 ++++++ .../api/v1/codex/Berufstaetigkeit.php | 78 ++++++ .../api/v1/codex/Beschaeftigungsausmass.php | 78 ++++++ .../controllers/api/v1/codex/Besqual.php | 78 ++++++ .../controllers/api/v1/codex/Bisfunktion.php | 78 ++++++ .../controllers/api/v1/codex/Bisio.php | 78 ++++++ .../controllers/api/v1/codex/Bisorgform.php | 78 ++++++ .../api/v1/codex/Bisverwendung.php | 78 ++++++ .../api/v1/codex/Entwicklungsteam.php | 78 ++++++ .../controllers/api/v1/codex/Gemeinde.php | 78 ++++++ .../controllers/api/v1/codex/Hauptberuf.php | 78 ++++++ .../controllers/api/v1/codex/Lehrform.php | 78 ++++++ .../controllers/api/v1/codex/Lgartcode.php | 78 ++++++ .../api/v1/codex/Mobilitaetsprogramm.php | 78 ++++++ application/controllers/api/v1/codex/Note.php | 78 ++++++ .../controllers/api/v1/codex/Orgform.php | 78 ++++++ .../controllers/api/v1/codex/Verwendung.php | 78 ++++++ application/controllers/api/v1/codex/Zgv.php | 78 ++++++ .../controllers/api/v1/codex/Zgvdoktor.php | 78 ++++++ .../controllers/api/v1/codex/Zgvgruppe.php | 78 ++++++ .../controllers/api/v1/codex/Zgvmaster.php | 78 ++++++ .../controllers/api/v1/codex/Zweck.php | 78 ++++++ .../controllers/api/v1/content/Ampel.php | 78 ++++++ .../controllers/api/v1/content/Content.php | 78 ++++++ .../api/v1/content/Contentchild.php | 78 ++++++ .../api/v1/content/Contentgruppe.php | 78 ++++++ .../controllers/api/v1/content/Contentlog.php | 78 ++++++ .../api/v1/content/Contentsprache.php | 78 ++++++ .../controllers/api/v1/content/Dms.php | 69 ++++++ .../controllers/api/v1/content/Infoscreen.php | 78 ++++++ .../controllers/api/v1/content/News.php | 78 ++++++ .../controllers/api/v1/content/Template.php | 78 ++++++ .../api/v1/content/Veranstaltung.php | 78 ++++++ .../v1/content/Veranstaltungskategorie.php | 78 ++++++ application/controllers/api/v1/crm/Akte.php | 78 ++++++ .../api/v1/crm/Aufnahmeschluessel.php | 78 ++++++ .../controllers/api/v1/crm/Aufnahmetermin.php | 78 ++++++ .../api/v1/crm/Aufnahmetermintyp.php | 78 ++++++ .../api/v1/crm/Bewerbungstermine.php | 78 ++++++ .../controllers/api/v1/crm/Buchungstyp.php | 78 ++++++ .../controllers/api/v1/crm/Dokument.php | 78 ++++++ .../api/v1/crm/Dokumentprestudent.php | 78 ++++++ .../api/v1/crm/Dokumentstudiengang.php | 78 ++++++ application/controllers/api/v1/crm/Konto.php | 78 ++++++ .../controllers/api/v1/crm/Preincoming.php | 78 ++++++ .../api/v1/crm/Preinteressentstudiengang.php | 78 ++++++ .../controllers/api/v1/crm/Preoutgoing.php | 78 ++++++ .../controllers/api/v1/crm/Prestudent.php | 78 ++++++ .../api/v1/crm/Prestudentstatus.php | 78 ++++++ .../controllers/api/v1/crm/Reihungstest.php | 78 ++++++ application/controllers/api/v1/crm/Status.php | 78 ++++++ .../controllers/api/v1/crm/Student.php | 78 ++++++ .../api/v1/organisation/Erhalter.php | 78 ++++++ .../api/v1/organisation/Fachbereich.php | 78 ++++++ .../api/v1/organisation/Ferien.php | 78 ++++++ .../api/v1/organisation/Geschaeftsjahr.php | 78 ++++++ .../api/v1/organisation/Gruppe.php | 78 ++++++ .../api/v1/organisation/Lehrverband.php | 78 ++++++ .../v1/organisation/Organisationseinheit.php | 78 ++++++ .../organisation/Organisationseinheittyp.php | 78 ++++++ .../api/v1/organisation/Semesterwochen.php | 78 ++++++ .../api/v1/organisation/Service.php | 78 ++++++ .../api/v1/organisation/Standort.php | 78 ++++++ .../api/v1/organisation/Statistik.php | 78 ++++++ .../api/v1/organisation/Studiengangstyp.php | 78 ++++++ .../api/v1/organisation/Studienjahr.php | 78 ++++++ .../api/v1/organisation/Studienordnung.php | 78 ++++++ .../v1/organisation/Studienordnungstatus.php | 78 ++++++ .../api/v1/organisation/Studienplatz.php | 78 ++++++ .../api/v1/organisation/Studiensemester.php | 78 ++++++ .../api/v1/person/Bankverbindung.php | 78 ++++++ .../controllers/api/v1/person/Benutzer.php | 78 ++++++ .../api/v1/person/Benutzerfunktion.php | 78 ++++++ .../api/v1/person/Benutzergruppe.php | 78 ++++++ .../controllers/api/v1/person/Fotostatus.php | 78 ++++++ .../controllers/api/v1/person/Freebusy.php | 78 ++++++ .../controllers/api/v1/person/Freebusytyp.php | 78 ++++++ .../api/v1/person/Kontaktmedium.php | 78 ++++++ .../controllers/api/v1/person/Kontakttyp.php | 78 ++++++ .../controllers/api/v1/person/Notiz.php | 78 ++++++ .../api/v1/person/Notizzuordnung.php | 78 ++++++ .../controllers/api/v1/project/Aktivitaet.php | 78 ++++++ .../api/v1/project/Aufwandstyp.php | 78 ++++++ .../controllers/api/v1/project/Projekt.php | 78 ++++++ .../api/v1/project/Projekt_ressource.php | 78 ++++++ .../api/v1/project/Projektphase.php | 78 ++++++ .../api/v1/project/Projekttask.php | 78 ++++++ .../controllers/api/v1/project/Ressource.php | 78 ++++++ .../api/v1/project/Scrumsprint.php | 78 ++++++ .../controllers/api/v1/project/Scrumteam.php | 78 ++++++ .../api/v1/ressource/Betriebsmittel.php | 78 ++++++ .../api/v1/ressource/Betriebsmittelperson.php | 78 ++++++ .../api/v1/ressource/Betriebsmittelstatus.php | 78 ++++++ .../api/v1/ressource/Betriebsmitteltyp.php | 78 ++++++ .../controllers/api/v1/ressource/Coodle.php | 78 ++++++ .../api/v1/ressource/Erreichbarkeit.php | 78 ++++++ .../controllers/api/v1/ressource/Firma.php | 78 ++++++ .../controllers/api/v1/ressource/Firmatag.php | 78 ++++++ .../api/v1/ressource/Firmentyp.php | 78 ++++++ .../controllers/api/v1/ressource/Funktion.php | 78 ++++++ .../api/v1/ressource/Lehrmittel.php | 78 ++++++ .../api/v1/ressource/Mitarbeiter.php | 78 ++++++ .../controllers/api/v1/ressource/Ort.php | 78 ++++++ .../api/v1/ressource/Ortraumtyp.php | 78 ++++++ .../v1/ressource/Personfunktionstandort.php | 78 ++++++ .../controllers/api/v1/ressource/Raumtyp.php | 78 ++++++ .../api/v1/ressource/Reservierung.php | 78 ++++++ .../api/v1/ressource/Resturlaub.php | 78 ++++++ .../controllers/api/v1/ressource/Stunde.php | 78 ++++++ .../api/v1/ressource/Stundenplan.php | 78 ++++++ .../api/v1/ressource/Stundenplandev.php | 78 ++++++ .../api/v1/ressource/Zeitaufzeichnung.php | 78 ++++++ .../api/v1/ressource/Zeitfenster.php | 78 ++++++ .../api/v1/ressource/Zeitsperre.php | 78 ++++++ .../api/v1/ressource/Zeitsperretyp.php | 78 ++++++ .../api/v1/ressource/Zeitwunsch.php | 78 ++++++ .../controllers/api/v1/system/Appdaten.php | 78 ++++++ .../api/v1/system/Benutzerrolle.php | 78 ++++++ .../api/v1/system/Berechtigung.php | 78 ++++++ .../controllers/api/v1/system/Cronjob.php | 78 ++++++ .../controllers/api/v1/system/Filter.php | 78 ++++++ application/controllers/api/v1/system/Log.php | 78 ++++++ .../controllers/api/v1/system/Message.php | 78 ++++++ .../controllers/api/v1/system/Rolle.php | 78 ++++++ .../api/v1/system/Rolleberechtigung.php | 78 ++++++ .../controllers/api/v1/system/Server.php | 78 ++++++ .../controllers/api/v1/system/Sprache.php | 78 ++++++ application/controllers/api/v1/system/Tag.php | 78 ++++++ .../controllers/api/v1/system/Thread.php | 78 ++++++ .../controllers/api/v1/system/Variable.php | 78 ++++++ .../controllers/api/v1/system/Vorlage.php | 78 ++++++ .../api/v1/system/Vorlagestudiengang.php | 78 ++++++ .../api/v1/system/Webservicelog.php | 78 ++++++ .../api/v1/system/Webservicerecht.php | 78 ++++++ .../api/v1/system/Webservicetyp.php | 78 ++++++ .../controllers/api/v1/system/message_old.php | 78 ++++++ .../controllers/api/v1/testtool/Ablauf.php | 78 ++++++ .../controllers/api/v1/testtool/Antwort.php | 78 ++++++ .../controllers/api/v1/testtool/Frage.php | 78 ++++++ .../controllers/api/v1/testtool/Gebiet.php | 78 ++++++ .../controllers/api/v1/testtool/Kategorie.php | 78 ++++++ .../controllers/api/v1/testtool/Kriterien.php | 78 ++++++ .../controllers/api/v1/testtool/Pruefling.php | 78 ++++++ .../controllers/api/v1/testtool/Vorschlag.php | 78 ++++++ include/dms.class.php | 8 +- 167 files changed, 13079 insertions(+), 15 deletions(-) create mode 100644 application/controllers/api/v1/accounting/Aufteilung.php create mode 100644 application/controllers/api/v1/accounting/Bestelldetail.php create mode 100644 application/controllers/api/v1/accounting/Bestelldetailtag.php create mode 100644 application/controllers/api/v1/accounting/Bestellstatus.php create mode 100644 application/controllers/api/v1/accounting/Bestellung.php create mode 100644 application/controllers/api/v1/accounting/Bestellungtag.php create mode 100644 application/controllers/api/v1/accounting/Buchung.php create mode 100644 application/controllers/api/v1/accounting/Buchungstyp.php create mode 100644 application/controllers/api/v1/accounting/Budget.php create mode 100644 application/controllers/api/v1/accounting/Konto.php create mode 100644 application/controllers/api/v1/accounting/Kostenstelle.php create mode 100644 application/controllers/api/v1/accounting/Rechnung.php create mode 100644 application/controllers/api/v1/accounting/Rechnungsbetrag.php create mode 100644 application/controllers/api/v1/accounting/Rechnungstyp.php create mode 100644 application/controllers/api/v1/accounting/Vertrag.php create mode 100644 application/controllers/api/v1/accounting/Vertragsstatus.php create mode 100644 application/controllers/api/v1/accounting/Vertragstyp.php create mode 100644 application/controllers/api/v1/accounting/Zahlungstyp.php create mode 100644 application/controllers/api/v1/codex/Akadgrad.php create mode 100644 application/controllers/api/v1/codex/Archiv.php create mode 100644 application/controllers/api/v1/codex/Aufmerksamdurch.php create mode 100644 application/controllers/api/v1/codex/Ausbildung.php create mode 100644 application/controllers/api/v1/codex/Berufstaetigkeit.php create mode 100644 application/controllers/api/v1/codex/Beschaeftigungsausmass.php create mode 100644 application/controllers/api/v1/codex/Besqual.php create mode 100644 application/controllers/api/v1/codex/Bisfunktion.php create mode 100644 application/controllers/api/v1/codex/Bisio.php create mode 100644 application/controllers/api/v1/codex/Bisorgform.php create mode 100644 application/controllers/api/v1/codex/Bisverwendung.php create mode 100644 application/controllers/api/v1/codex/Entwicklungsteam.php create mode 100644 application/controllers/api/v1/codex/Gemeinde.php create mode 100644 application/controllers/api/v1/codex/Hauptberuf.php create mode 100644 application/controllers/api/v1/codex/Lehrform.php create mode 100644 application/controllers/api/v1/codex/Lgartcode.php create mode 100644 application/controllers/api/v1/codex/Mobilitaetsprogramm.php create mode 100644 application/controllers/api/v1/codex/Note.php create mode 100644 application/controllers/api/v1/codex/Orgform.php create mode 100644 application/controllers/api/v1/codex/Verwendung.php create mode 100644 application/controllers/api/v1/codex/Zgv.php create mode 100644 application/controllers/api/v1/codex/Zgvdoktor.php create mode 100644 application/controllers/api/v1/codex/Zgvgruppe.php create mode 100644 application/controllers/api/v1/codex/Zgvmaster.php create mode 100644 application/controllers/api/v1/codex/Zweck.php create mode 100644 application/controllers/api/v1/content/Ampel.php create mode 100644 application/controllers/api/v1/content/Content.php create mode 100644 application/controllers/api/v1/content/Contentchild.php create mode 100644 application/controllers/api/v1/content/Contentgruppe.php create mode 100644 application/controllers/api/v1/content/Contentlog.php create mode 100644 application/controllers/api/v1/content/Contentsprache.php create mode 100644 application/controllers/api/v1/content/Dms.php create mode 100644 application/controllers/api/v1/content/Infoscreen.php create mode 100644 application/controllers/api/v1/content/News.php create mode 100644 application/controllers/api/v1/content/Template.php create mode 100644 application/controllers/api/v1/content/Veranstaltung.php create mode 100644 application/controllers/api/v1/content/Veranstaltungskategorie.php create mode 100644 application/controllers/api/v1/crm/Akte.php create mode 100644 application/controllers/api/v1/crm/Aufnahmeschluessel.php create mode 100644 application/controllers/api/v1/crm/Aufnahmetermin.php create mode 100644 application/controllers/api/v1/crm/Aufnahmetermintyp.php create mode 100644 application/controllers/api/v1/crm/Bewerbungstermine.php create mode 100644 application/controllers/api/v1/crm/Buchungstyp.php create mode 100644 application/controllers/api/v1/crm/Dokument.php create mode 100644 application/controllers/api/v1/crm/Dokumentprestudent.php create mode 100644 application/controllers/api/v1/crm/Dokumentstudiengang.php create mode 100644 application/controllers/api/v1/crm/Konto.php create mode 100644 application/controllers/api/v1/crm/Preincoming.php create mode 100644 application/controllers/api/v1/crm/Preinteressentstudiengang.php create mode 100644 application/controllers/api/v1/crm/Preoutgoing.php create mode 100644 application/controllers/api/v1/crm/Prestudent.php create mode 100644 application/controllers/api/v1/crm/Prestudentstatus.php create mode 100644 application/controllers/api/v1/crm/Reihungstest.php create mode 100644 application/controllers/api/v1/crm/Status.php create mode 100644 application/controllers/api/v1/crm/Student.php create mode 100644 application/controllers/api/v1/organisation/Erhalter.php create mode 100644 application/controllers/api/v1/organisation/Fachbereich.php create mode 100644 application/controllers/api/v1/organisation/Ferien.php create mode 100644 application/controllers/api/v1/organisation/Geschaeftsjahr.php create mode 100644 application/controllers/api/v1/organisation/Gruppe.php create mode 100644 application/controllers/api/v1/organisation/Lehrverband.php create mode 100644 application/controllers/api/v1/organisation/Organisationseinheit.php create mode 100644 application/controllers/api/v1/organisation/Organisationseinheittyp.php create mode 100644 application/controllers/api/v1/organisation/Semesterwochen.php create mode 100644 application/controllers/api/v1/organisation/Service.php create mode 100644 application/controllers/api/v1/organisation/Standort.php create mode 100644 application/controllers/api/v1/organisation/Statistik.php create mode 100644 application/controllers/api/v1/organisation/Studiengangstyp.php create mode 100644 application/controllers/api/v1/organisation/Studienjahr.php create mode 100644 application/controllers/api/v1/organisation/Studienordnung.php create mode 100644 application/controllers/api/v1/organisation/Studienordnungstatus.php create mode 100644 application/controllers/api/v1/organisation/Studienplatz.php create mode 100644 application/controllers/api/v1/organisation/Studiensemester.php create mode 100644 application/controllers/api/v1/person/Bankverbindung.php create mode 100644 application/controllers/api/v1/person/Benutzer.php create mode 100644 application/controllers/api/v1/person/Benutzerfunktion.php create mode 100644 application/controllers/api/v1/person/Benutzergruppe.php create mode 100644 application/controllers/api/v1/person/Fotostatus.php create mode 100644 application/controllers/api/v1/person/Freebusy.php create mode 100644 application/controllers/api/v1/person/Freebusytyp.php create mode 100644 application/controllers/api/v1/person/Kontaktmedium.php create mode 100644 application/controllers/api/v1/person/Kontakttyp.php create mode 100644 application/controllers/api/v1/person/Notiz.php create mode 100644 application/controllers/api/v1/person/Notizzuordnung.php create mode 100644 application/controllers/api/v1/project/Aktivitaet.php create mode 100644 application/controllers/api/v1/project/Aufwandstyp.php create mode 100644 application/controllers/api/v1/project/Projekt.php create mode 100644 application/controllers/api/v1/project/Projekt_ressource.php create mode 100644 application/controllers/api/v1/project/Projektphase.php create mode 100644 application/controllers/api/v1/project/Projekttask.php create mode 100644 application/controllers/api/v1/project/Ressource.php create mode 100644 application/controllers/api/v1/project/Scrumsprint.php create mode 100644 application/controllers/api/v1/project/Scrumteam.php create mode 100644 application/controllers/api/v1/ressource/Betriebsmittel.php create mode 100644 application/controllers/api/v1/ressource/Betriebsmittelperson.php create mode 100644 application/controllers/api/v1/ressource/Betriebsmittelstatus.php create mode 100644 application/controllers/api/v1/ressource/Betriebsmitteltyp.php create mode 100644 application/controllers/api/v1/ressource/Coodle.php create mode 100644 application/controllers/api/v1/ressource/Erreichbarkeit.php create mode 100644 application/controllers/api/v1/ressource/Firma.php create mode 100644 application/controllers/api/v1/ressource/Firmatag.php create mode 100644 application/controllers/api/v1/ressource/Firmentyp.php create mode 100644 application/controllers/api/v1/ressource/Funktion.php create mode 100644 application/controllers/api/v1/ressource/Lehrmittel.php create mode 100644 application/controllers/api/v1/ressource/Mitarbeiter.php create mode 100644 application/controllers/api/v1/ressource/Ort.php create mode 100644 application/controllers/api/v1/ressource/Ortraumtyp.php create mode 100644 application/controllers/api/v1/ressource/Personfunktionstandort.php create mode 100644 application/controllers/api/v1/ressource/Raumtyp.php create mode 100644 application/controllers/api/v1/ressource/Reservierung.php create mode 100644 application/controllers/api/v1/ressource/Resturlaub.php create mode 100644 application/controllers/api/v1/ressource/Stunde.php create mode 100644 application/controllers/api/v1/ressource/Stundenplan.php create mode 100644 application/controllers/api/v1/ressource/Stundenplandev.php create mode 100644 application/controllers/api/v1/ressource/Zeitaufzeichnung.php create mode 100644 application/controllers/api/v1/ressource/Zeitfenster.php create mode 100644 application/controllers/api/v1/ressource/Zeitsperre.php create mode 100644 application/controllers/api/v1/ressource/Zeitsperretyp.php create mode 100644 application/controllers/api/v1/ressource/Zeitwunsch.php create mode 100644 application/controllers/api/v1/system/Appdaten.php create mode 100644 application/controllers/api/v1/system/Benutzerrolle.php create mode 100644 application/controllers/api/v1/system/Berechtigung.php create mode 100644 application/controllers/api/v1/system/Cronjob.php create mode 100644 application/controllers/api/v1/system/Filter.php create mode 100644 application/controllers/api/v1/system/Log.php create mode 100644 application/controllers/api/v1/system/Message.php create mode 100644 application/controllers/api/v1/system/Rolle.php create mode 100644 application/controllers/api/v1/system/Rolleberechtigung.php create mode 100644 application/controllers/api/v1/system/Server.php create mode 100644 application/controllers/api/v1/system/Sprache.php create mode 100644 application/controllers/api/v1/system/Tag.php create mode 100644 application/controllers/api/v1/system/Thread.php create mode 100644 application/controllers/api/v1/system/Variable.php create mode 100644 application/controllers/api/v1/system/Vorlage.php create mode 100644 application/controllers/api/v1/system/Vorlagestudiengang.php create mode 100644 application/controllers/api/v1/system/Webservicelog.php create mode 100644 application/controllers/api/v1/system/Webservicerecht.php create mode 100644 application/controllers/api/v1/system/Webservicetyp.php create mode 100644 application/controllers/api/v1/system/message_old.php create mode 100644 application/controllers/api/v1/testtool/Ablauf.php create mode 100644 application/controllers/api/v1/testtool/Antwort.php create mode 100644 application/controllers/api/v1/testtool/Frage.php create mode 100644 application/controllers/api/v1/testtool/Gebiet.php create mode 100644 application/controllers/api/v1/testtool/Kategorie.php create mode 100644 application/controllers/api/v1/testtool/Kriterien.php create mode 100644 application/controllers/api/v1/testtool/Pruefling.php create mode 100644 application/controllers/api/v1/testtool/Vorschlag.php diff --git a/application/config/fhcomplete.php b/application/config/fhcomplete.php index 0cb2db31d..b26fb4769 100644 --- a/application/config/fhcomplete.php +++ b/application/config/fhcomplete.php @@ -6,26 +6,223 @@ $config['fhc_version'] = '3.2'; $config['fhc_acl'] = array ( - 'bis.tbl_bundesland' => 'basis/nation', - 'bis.tbl_nation' => 'basis/nation', + 'bis.tbl_archiv' => 'basis/archiv', + 'bis.tbl_ausbildung' => 'basis/ausbildung', + 'bis.tbl_berufstaetigkeit' => 'basis/berufstaetigkeit', + 'bis.tbl_beschaeftigungsausmass' => 'basis/beschaeftigungsausmass', + 'bis.tbl_besqual' => 'basis/besqual', + 'bis.tbl_bisfunktion' => 'basis/bisfunktion', + 'bis.tbl_bisio' => 'basis/bisio', + 'bis.tbl_bisorgform' => 'basis/bisorgform', + 'bis.tbl_bisverwendung' => 'basis/bisverwendung', + 'bis.tbl_bundesland' => 'basis/bundesland', + 'bis.tbl_entwicklungsteam' => 'basis/entwicklungsteam', + 'bis.tbl_gemeinde' => 'basis/gemeinde', + 'bis.tbl_hauptberuf' => 'basis/hauptberuf', 'bis.tbl_lgartcode' => 'basis/lgartcode', - - 'campus.tbl_dms' => 'basis/tbl_dms', - 'campus.tbl_dms_version' => 'basis/tbl_dms_version', - - 'lehre.tbl_studienplan' => 'basis/studienplan', + 'bis.tbl_mobilitaetsprogramm' => 'basis/mobilitaetsprogramm', + 'bis.tbl_nation' => 'basis/nation', + 'bis.tbl_orgform' => 'basis/orgform', + 'bis.tbl_verwendung' => 'basis/verwendung', + 'bis.tbl_zgv' => 'basis/zgv', + 'bis.tbl_zgvdoktor' => 'basis/zgvdoktor', + 'bis.tbl_zgvgruppe' => 'basis/zgvgruppe', + 'bis.tbl_zgvmaster' => 'basis/zgvmaster', + 'bis.tbl_zweck' => 'basis/zweck', + 'campus.tbl_abgabe' => 'basis/abgabe', + 'campus.tbl_anwesenheit' => 'basis/anwesenheit', + 'campus.tbl_beispiel' => 'basis/beispiel', + 'campus.tbl_content' => 'basis/content', + 'campus.tbl_contentchild' => 'basis/contentchild', + 'campus.tbl_contentgruppe' => 'basis/contentgruppe', + 'campus.tbl_contentlog' => 'basis/contentlog', + 'campus.tbl_contentsprache' => 'basis/contentsprache', + 'campus.tbl_coodle' => 'basis/coodle', + 'campus.tbl_dms' => 'basis/dms', + 'campus.tbl_erreichbarkeit' => 'basis/erreichbarkeit', + 'campus.tbl_feedback' => 'basis/feedback', + 'campus.tbl_freebusy' => 'basis/freebusy', + 'campus.tbl_freebusytyp' => 'basis/freebusytyp', + 'campus.tbl_infoscreen' => 'basis/infoscreen', + 'campus.tbl_legesamtnote' => 'basis/legesamtnote', + 'campus.tbl_lvgesamtnote' => 'basis/lvgesamtnote', + 'campus.tbl_lvinfo' => 'basis/lvinfo', + 'campus.tbl_news' => 'basis/news', + 'campus.tbl_notenschluessel' => 'basis/notenschluessel', + 'campus.tbl_notenschluesseluebung' => 'basis/notenschluesseluebung', + 'campus.tbl_paabgabe' => 'basis/paabgabe', + 'campus.tbl_paabgabetyp' => 'basis/paabgabetyp', + 'campus.tbl_pruefung' => 'basis/pruefung', + 'campus.tbl_pruefungsanmeldung' => 'basis/pruefungsanmeldung', + 'campus.tbl_pruefungsfenster' => 'basis/pruefungsfenster', + 'campus.tbl_pruefungsstatus' => 'basis/pruefungsstatus', + 'campus.tbl_pruefungstermin' => 'basis/pruefungstermin', + 'campus.tbl_reservierung' => 'basis/reservierung', + 'campus.tbl_resturlaub' => 'basis/resturlaub', + 'campus.tbl_studentbeispiel' => 'basis/studentbeispiel', + 'campus.tbl_studentuebung' => 'basis/studentuebung', + 'campus.tbl_template' => 'basis/template', + 'campus.tbl_uebung' => 'basis/uebung', + 'campus.tbl_veranstaltung' => 'basis/veranstaltung', + 'campus.tbl_veranstaltungskategorie' => 'basis/veranstaltungskategorie', + 'campus.tbl_zeitaufzeichnung' => 'basis/zeitaufzeichnung', + 'campus.tbl_zeitsperre' => 'basis/zeitsperre', + 'campus.tbl_zeitsperretyp' => 'basis/zeitsperretyp', + 'campus.tbl_zeitwunsch' => 'basis/zeitwunsch', + 'fue.tbl_aktivitaet' => 'basis/aktivitaet', + 'fue.tbl_aufwandstyp' => 'basis/aufwandstyp', + 'fue.tbl_projekt' => 'basis/projekt', + 'fue.tbl_projekt_ressource' => 'basis/projekt_ressource', + 'fue.tbl_projektphase' => 'basis/projektphase', + 'fue.tbl_projekttask' => 'basis/projekttask', + 'fue.tbl_ressource' => 'basis/ressource', + 'fue.tbl_scrumsprint' => 'basis/scrumsprint', + 'fue.tbl_scrumteam' => 'basis/scrumteam', + 'lehre.tbl_abschlussbeurteilung' => 'basis/abschlussbeurteilung', + 'lehre.tbl_abschlusspruefung' => 'basis/abschlusspruefung', + 'lehre.tbl_akadgrad' => 'basis/akadgrad', + 'lehre.tbl_anrechnung' => 'basis/anrechnung', + 'lehre.tbl_betreuerart' => 'basis/betreuerart', + 'lehre.tbl_ferien' => 'basis/ferien', + 'lehre.tbl_lehreinheit' => 'basis/lehreinheit', + 'lehre.tbl_lehreinheitgruppe' => 'basis/lehreinheitgruppe', + 'lehre.tbl_lehreinheitmitarbeiter' => 'basis/lehreinheitmitarbeiter', + 'lehre.tbl_lehrfach' => 'basis/lehrfach', + 'lehre.tbl_lehrform' => 'basis/lehrform', + 'lehre.tbl_lehrfunktion' => 'basis/lehrfunktion', + 'lehre.tbl_lehrmittel' => 'basis/lehrmittel', + 'lehre.tbl_lehrtyp' => 'basis/lehrtyp', + 'lehre.tbl_lehrveranstaltung' => 'basis/lehrveranstaltung', + 'lehre.tbl_lvangebot' => 'basis/lvangebot', + 'lehre.tbl_lvregel' => 'basis/lvregel', + 'lehre.tbl_lvregeltyp' => 'basis/lvregeltyp', + 'lehre.tbl_moodle' => 'basis/moodle', + 'lehre.tbl_note' => 'basis/note', + 'lehre.tbl_notenschluessel' => 'basis/notenschluessel', + 'lehre.tbl_notenschluesselaufteilung' => 'basis/notenschluesselaufteilung', + 'lehre.tbl_notenschluesselzuordnung' => 'basis/notenschluesselzuordnung', + 'lehre.tbl_projektarbeit' => 'basis/projektarbeit', + 'lehre.tbl_projektbetreuer' => 'basis/projektbetreuer', + 'lehre.tbl_projekttyp' => 'basis/projekttyp', + 'lehre.tbl_pruefung' => 'basis/pruefung', + 'lehre.tbl_pruefungstyp' => 'basis/pruefungstyp', 'lehre.tbl_studienordnung' => 'basis/studienordnung', - 'lehre.vw_studienplan' => 'basis/vw_studienplan', - + 'lehre.tbl_studienordnungstatus' => 'basis/studienordnungstatus', + 'lehre.tbl_studienplan' => 'basis/studienplan', + 'lehre.tbl_studienplatz' => 'basis/studienplatz', + 'lehre.tbl_stunde' => 'basis/stunde', + 'lehre.tbl_stundenplan' => 'basis/stundenplan', + 'lehre.tbl_stundenplandev' => 'basis/stundenplandev', + 'lehre.tbl_vertrag' => 'basis/vertrag', + 'lehre.tbl_vertragsstatus' => 'basis/vertragsstatus', + 'lehre.tbl_vertragstyp' => 'basis/vertragstyp', + 'lehre.tbl_zeitfenster' => 'basis/zeitfenster', + 'lehre.tbl_zeugnis' => 'basis/zeugnis', + 'lehre.tbl_zeugnisnote' => 'basis/zeugnisnote', 'public.tbl_adresse' => 'basis/adresse', - 'public.tbl_person' => 'basis/person', - 'public.tbl_kontakt' => 'basis/kontakt', + 'public.tbl_akte' => 'basis/akte', + 'public.tbl_ampel' => 'basis/ampel', + 'public.tbl_aufmerksamdurch' => 'basis/aufmerksamdurch', + 'public.tbl_aufnahmeschluessel' => 'basis/aufnahmeschluessel', + 'public.tbl_aufnahmetermin' => 'basis/aufnahmetermin', + 'public.tbl_aufnahmetermintyp' => 'basis/aufnahmetermintyp', + 'public.tbl_bankverbindung' => 'basis/bankverbindung', 'public.tbl_benutzer' => 'basis/benutzer', - 'public.tbl_preinteressent' => 'basis/preinteressent', - 'public.tbl_prestudent' => 'basis/person', - 'public.tbl_prestudentstatus' => 'basis/person', + 'public.tbl_benutzerfunktion' => 'basis/benutzerfunktion', + 'public.tbl_benutzergruppe' => 'basis/benutzergruppe', + 'public.tbl_bewerbungstermine' => 'basis/bewerbungstermine', + 'public.tbl_buchungstyp' => 'basis/buchungstyp', + 'public.tbl_dokument' => 'basis/dokument', + 'public.tbl_dokumentprestudent' => 'basis/dokumentprestudent', + 'public.tbl_dokumentstudiengang' => 'basis/dokumentstudiengang', + 'public.tbl_erhalter' => 'basis/erhalter', + 'public.tbl_fachbereich' => 'basis/fachbereich', + 'public.tbl_filter' => 'basis/filter', + 'public.tbl_firma' => 'basis/firma', + 'public.tbl_firmatag' => 'basis/firmatag', + 'public.tbl_firmentyp' => 'basis/firmentyp', + 'public.tbl_fotostatus' => 'basis/fotostatus', + 'public.tbl_funktion' => 'basis/funktion', + 'public.tbl_geschaeftsjahr' => 'basis/geschaeftsjahr', + 'public.tbl_gruppe' => 'basis/gruppe', + 'public.tbl_kontakt' => 'basis/kontakt', + 'public.tbl_kontaktmedium' => 'basis/kontaktmedium', + 'public.tbl_kontakttyp' => 'basis/kontakttyp', + 'public.tbl_konto' => 'basis/konto', + 'public.tbl_lehrverband' => 'basis/lehrverband', + 'public.tbl_log' => 'basis/log', + 'public.tbl_mitarbeiter' => 'basis/mitarbeiter', + 'public.tbl_msg_message' => 'basis/msg_message', + 'public.tbl_msg_thread' => 'basis/msg_thread', + 'public.tbl_notiz' => 'basis/notiz', + 'public.tbl_notizzuordnung' => 'basis/notizzuordnung', 'public.tbl_organisationseinheit' => 'basis/organisationseinheit', + 'public.tbl_organisationseinheittyp' => 'basis/organisationseinheittyp', + 'public.tbl_ort' => 'basis/ort', + 'public.tbl_ortraumtyp' => 'basis/ortraumtyp', + 'public.tbl_person' => 'basis/person', + 'public.tbl_personfunktionstandort' => 'basis/personfunktionstandort', + 'public.tbl_preincoming' => 'basis/preincoming', + 'public.tbl_preinteressent' => 'basis/preinteressent', + 'public.tbl_preinteressentstudiengang' => 'basis/preinteressentstudiengang', + 'public.tbl_preoutgoing' => 'basis/preoutgoing', + 'public.tbl_prestudent' => 'basis/prestudent', + 'public.tbl_prestudentstatus' => 'basis/prestudentstatus', + 'public.tbl_raumtyp' => 'basis/raumtyp', + 'public.tbl_reihungstest' => 'basis/reihungstest', + 'public.tbl_semesterwochen' => 'basis/semesterwochen', + 'public.tbl_service' => 'basis/service', + 'public.tbl_sprache' => 'basis/sprache', + 'public.tbl_standort' => 'basis/standort', + 'public.tbl_statistik' => 'basis/statistik', + 'public.tbl_status' => 'basis/status', + 'public.tbl_student' => 'basis/student', + 'public.tbl_studentlehrverband' => 'basis/studentlehrverband', 'public.tbl_studiengang' => 'basis/studiengang', + 'public.tbl_studiengangstyp' => 'basis/studiengangstyp', + 'public.tbl_studienjahr' => 'basis/studienjahr', + 'public.tbl_studiensemester' => 'basis/studiensemester', + 'public.tbl_tag' => 'basis/tag', + 'public.tbl_variable' => 'basis/variable', + 'public.tbl_vorlage' => 'basis/vorlage', + 'public.tbl_vorlagestudiengang' => 'basis/vorlagestudiengang', + 'system.tbl_appdaten' => 'basis/appdaten', + 'system.tbl_benutzerrolle' => 'basis/benutzerrolle', + 'system.tbl_berechtigung' => 'basis/berechtigung', + 'system.tbl_cronjob' => 'basis/cronjob', + 'system.tbl_rolle' => 'basis/rolle', + 'system.tbl_rolleberechtigung' => 'basis/rolleberechtigung', + 'system.tbl_server' => 'basis/server', + 'system.tbl_webservicelog' => 'basis/webservicelog', + 'system.tbl_webservicerecht' => 'basis/webservicerecht', + 'system.tbl_webservicetyp' => 'basis/webservicetyp', + 'testtool.tbl_ablauf' => 'basis/ablauf', + 'testtool.tbl_antwort' => 'basis/antwort', + 'testtool.tbl_frage' => 'basis/frage', + 'testtool.tbl_gebiet' => 'basis/gebiet', + 'testtool.tbl_kategorie' => 'basis/kategorie', + 'testtool.tbl_kriterien' => 'basis/kriterien', + 'testtool.tbl_pruefling' => 'basis/pruefling', + 'testtool.tbl_vorschlag' => 'basis/vorschlag', + 'wawi.tbl_aufteilung' => 'basis/aufteilung', + 'wawi.tbl_bestelldetail' => 'basis/bestelldetail', + 'wawi.tbl_bestelldetailtag' => 'basis/bestelldetailtag', + 'wawi.tbl_bestellstatus' => 'basis/bestellstatus', + 'wawi.tbl_bestellung' => 'basis/bestellung', + 'wawi.tbl_bestellungtag' => 'basis/bestellungtag', + 'wawi.tbl_betriebsmittel' => 'basis/betriebsmittel', + 'wawi.tbl_betriebsmittelperson' => 'basis/betriebsmittelperson', + 'wawi.tbl_betriebsmittelstatus' => 'basis/betriebsmittelstatus', + 'wawi.tbl_betriebsmitteltyp' => 'basis/betriebsmitteltyp', + 'wawi.tbl_buchung' => 'basis/buchung', + 'wawi.tbl_buchungstyp' => 'basis/buchungstyp', + 'wawi.tbl_budget' => 'basis/budget', + 'wawi.tbl_konto' => 'basis/konto', + 'wawi.tbl_kostenstelle' => 'basis/kostenstelle', + 'wawi.tbl_rechnung' => 'basis/rechnung', + 'wawi.tbl_rechnungsbetrag' => 'basis/rechnungsbetrag', + 'wawi.tbl_rechnungstyp' => 'basis/rechnungstyp', + 'wawi.tbl_zahlungstyp' => 'basis/zahlungstyp', 'public.tbl_sprache' => 'admin', 'public.tbl_msg_thread' => 'admin', diff --git a/application/controllers/api/v1/accounting/Aufteilung.php b/application/controllers/api/v1/accounting/Aufteilung.php new file mode 100644 index 000000000..3c4c6f4ef --- /dev/null +++ b/application/controllers/api/v1/accounting/Aufteilung.php @@ -0,0 +1,78 @@ +load->model('accounting/aufteilung_model', 'AufteilungModel'); + // Load set the uid of the model to let to check the permissions + $this->AufteilungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAufteilung() + { + $aufteilungID = $this->get('aufteilung_id'); + + if(isset($aufteilungID)) + { + $result = $this->AufteilungModel->load($aufteilungID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAufteilung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['aufteilung_id'])) + { + $result = $this->AufteilungModel->update($this->post()['aufteilung_id'], $this->post()); + } + else + { + $result = $this->AufteilungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($aufteilung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Bestelldetail.php b/application/controllers/api/v1/accounting/Bestelldetail.php new file mode 100644 index 000000000..696bc7479 --- /dev/null +++ b/application/controllers/api/v1/accounting/Bestelldetail.php @@ -0,0 +1,78 @@ +load->model('accounting/bestelldetail_model', 'BestelldetailModel'); + // Load set the uid of the model to let to check the permissions + $this->BestelldetailModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBestelldetail() + { + $bestelldetailID = $this->get('bestelldetail_id'); + + if(isset($bestelldetailID)) + { + $result = $this->BestelldetailModel->load($bestelldetailID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBestelldetail() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['bestelldetail_id'])) + { + $result = $this->BestelldetailModel->update($this->post()['bestelldetail_id'], $this->post()); + } + else + { + $result = $this->BestelldetailModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($bestelldetail = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Bestelldetailtag.php b/application/controllers/api/v1/accounting/Bestelldetailtag.php new file mode 100644 index 000000000..ff268324d --- /dev/null +++ b/application/controllers/api/v1/accounting/Bestelldetailtag.php @@ -0,0 +1,78 @@ +load->model('accounting/bestelldetailtag_model', 'BestelldetailtagModel'); + // Load set the uid of the model to let to check the permissions + $this->BestelldetailtagModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBestelldetailtag() + { + $bestelldetailtagID = $this->get('bestelldetailtag_id'); + + if(isset($bestelldetailtagID)) + { + $result = $this->BestelldetailtagModel->load($bestelldetailtagID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBestelldetailtag() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['bestelldetailtag_id'])) + { + $result = $this->BestelldetailtagModel->update($this->post()['bestelldetailtag_id'], $this->post()); + } + else + { + $result = $this->BestelldetailtagModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($bestelldetailtag = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Bestellstatus.php b/application/controllers/api/v1/accounting/Bestellstatus.php new file mode 100644 index 000000000..b9646ed2b --- /dev/null +++ b/application/controllers/api/v1/accounting/Bestellstatus.php @@ -0,0 +1,78 @@ +load->model('accounting/bestellstatus_model', 'BestellstatusModel'); + // Load set the uid of the model to let to check the permissions + $this->BestellstatusModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBestellstatus() + { + $bestellstatusID = $this->get('bestellstatus_id'); + + if(isset($bestellstatusID)) + { + $result = $this->BestellstatusModel->load($bestellstatusID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBestellstatus() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['bestellstatus_id'])) + { + $result = $this->BestellstatusModel->update($this->post()['bestellstatus_id'], $this->post()); + } + else + { + $result = $this->BestellstatusModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($bestellstatus = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Bestellung.php b/application/controllers/api/v1/accounting/Bestellung.php new file mode 100644 index 000000000..be35b38ce --- /dev/null +++ b/application/controllers/api/v1/accounting/Bestellung.php @@ -0,0 +1,78 @@ +load->model('accounting/bestellung_model', 'BestellungModel'); + // Load set the uid of the model to let to check the permissions + $this->BestellungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBestellung() + { + $bestellungID = $this->get('bestellung_id'); + + if(isset($bestellungID)) + { + $result = $this->BestellungModel->load($bestellungID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBestellung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['bestellung_id'])) + { + $result = $this->BestellungModel->update($this->post()['bestellung_id'], $this->post()); + } + else + { + $result = $this->BestellungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($bestellung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Bestellungtag.php b/application/controllers/api/v1/accounting/Bestellungtag.php new file mode 100644 index 000000000..d803e538c --- /dev/null +++ b/application/controllers/api/v1/accounting/Bestellungtag.php @@ -0,0 +1,78 @@ +load->model('accounting/bestellungtag_model', 'BestellungtagModel'); + // Load set the uid of the model to let to check the permissions + $this->BestellungtagModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBestellungtag() + { + $bestellungtagID = $this->get('bestellungtag_id'); + + if(isset($bestellungtagID)) + { + $result = $this->BestellungtagModel->load($bestellungtagID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBestellungtag() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['bestellungtag_id'])) + { + $result = $this->BestellungtagModel->update($this->post()['bestellungtag_id'], $this->post()); + } + else + { + $result = $this->BestellungtagModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($bestellungtag = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Buchung.php b/application/controllers/api/v1/accounting/Buchung.php new file mode 100644 index 000000000..64c785360 --- /dev/null +++ b/application/controllers/api/v1/accounting/Buchung.php @@ -0,0 +1,78 @@ +load->model('accounting/buchung_model', 'BuchungModel'); + // Load set the uid of the model to let to check the permissions + $this->BuchungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBuchung() + { + $buchungID = $this->get('buchung_id'); + + if(isset($buchungID)) + { + $result = $this->BuchungModel->load($buchungID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBuchung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['buchung_id'])) + { + $result = $this->BuchungModel->update($this->post()['buchung_id'], $this->post()); + } + else + { + $result = $this->BuchungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($buchung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Buchungstyp.php b/application/controllers/api/v1/accounting/Buchungstyp.php new file mode 100644 index 000000000..eee0ccfa0 --- /dev/null +++ b/application/controllers/api/v1/accounting/Buchungstyp.php @@ -0,0 +1,78 @@ +load->model('accounting/buchungstyp_model', 'BuchungstypModel'); + // Load set the uid of the model to let to check the permissions + $this->BuchungstypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBuchungstyp() + { + $buchungstypID = $this->get('buchungstyp_id'); + + if(isset($buchungstypID)) + { + $result = $this->BuchungstypModel->load($buchungstypID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBuchungstyp() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['buchungstyp_id'])) + { + $result = $this->BuchungstypModel->update($this->post()['buchungstyp_id'], $this->post()); + } + else + { + $result = $this->BuchungstypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($buchungstyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Budget.php b/application/controllers/api/v1/accounting/Budget.php new file mode 100644 index 000000000..3b89afbff --- /dev/null +++ b/application/controllers/api/v1/accounting/Budget.php @@ -0,0 +1,78 @@ +load->model('accounting/budget_model', 'BudgetModel'); + // Load set the uid of the model to let to check the permissions + $this->BudgetModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBudget() + { + $budgetID = $this->get('budget_id'); + + if(isset($budgetID)) + { + $result = $this->BudgetModel->load($budgetID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBudget() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['budget_id'])) + { + $result = $this->BudgetModel->update($this->post()['budget_id'], $this->post()); + } + else + { + $result = $this->BudgetModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($budget = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Konto.php b/application/controllers/api/v1/accounting/Konto.php new file mode 100644 index 000000000..e6e6da763 --- /dev/null +++ b/application/controllers/api/v1/accounting/Konto.php @@ -0,0 +1,78 @@ +load->model('accounting/konto_model', 'KontoModel'); + // Load set the uid of the model to let to check the permissions + $this->KontoModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getKonto() + { + $kontoID = $this->get('konto_id'); + + if(isset($kontoID)) + { + $result = $this->KontoModel->load($kontoID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postKonto() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['konto_id'])) + { + $result = $this->KontoModel->update($this->post()['konto_id'], $this->post()); + } + else + { + $result = $this->KontoModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($konto = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Kostenstelle.php b/application/controllers/api/v1/accounting/Kostenstelle.php new file mode 100644 index 000000000..2bc39e212 --- /dev/null +++ b/application/controllers/api/v1/accounting/Kostenstelle.php @@ -0,0 +1,78 @@ +load->model('accounting/kostenstelle_model', 'KostenstelleModel'); + // Load set the uid of the model to let to check the permissions + $this->KostenstelleModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getKostenstelle() + { + $kostenstelleID = $this->get('kostenstelle_id'); + + if(isset($kostenstelleID)) + { + $result = $this->KostenstelleModel->load($kostenstelleID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postKostenstelle() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['kostenstelle_id'])) + { + $result = $this->KostenstelleModel->update($this->post()['kostenstelle_id'], $this->post()); + } + else + { + $result = $this->KostenstelleModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($kostenstelle = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Rechnung.php b/application/controllers/api/v1/accounting/Rechnung.php new file mode 100644 index 000000000..a0ffcbbb3 --- /dev/null +++ b/application/controllers/api/v1/accounting/Rechnung.php @@ -0,0 +1,78 @@ +load->model('accounting/rechnung_model', 'RechnungModel'); + // Load set the uid of the model to let to check the permissions + $this->RechnungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getRechnung() + { + $rechnungID = $this->get('rechnung_id'); + + if(isset($rechnungID)) + { + $result = $this->RechnungModel->load($rechnungID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postRechnung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['rechnung_id'])) + { + $result = $this->RechnungModel->update($this->post()['rechnung_id'], $this->post()); + } + else + { + $result = $this->RechnungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($rechnung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Rechnungsbetrag.php b/application/controllers/api/v1/accounting/Rechnungsbetrag.php new file mode 100644 index 000000000..82f96c051 --- /dev/null +++ b/application/controllers/api/v1/accounting/Rechnungsbetrag.php @@ -0,0 +1,78 @@ +load->model('accounting/rechnungsbetrag_model', 'RechnungsbetragModel'); + // Load set the uid of the model to let to check the permissions + $this->RechnungsbetragModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getRechnungsbetrag() + { + $rechnungsbetragID = $this->get('rechnungsbetrag_id'); + + if(isset($rechnungsbetragID)) + { + $result = $this->RechnungsbetragModel->load($rechnungsbetragID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postRechnungsbetrag() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['rechnungsbetrag_id'])) + { + $result = $this->RechnungsbetragModel->update($this->post()['rechnungsbetrag_id'], $this->post()); + } + else + { + $result = $this->RechnungsbetragModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($rechnungsbetrag = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Rechnungstyp.php b/application/controllers/api/v1/accounting/Rechnungstyp.php new file mode 100644 index 000000000..deefa6243 --- /dev/null +++ b/application/controllers/api/v1/accounting/Rechnungstyp.php @@ -0,0 +1,78 @@ +load->model('accounting/rechnungstyp_model', 'RechnungstypModel'); + // Load set the uid of the model to let to check the permissions + $this->RechnungstypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getRechnungstyp() + { + $rechnungstypID = $this->get('rechnungstyp_id'); + + if(isset($rechnungstypID)) + { + $result = $this->RechnungstypModel->load($rechnungstypID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postRechnungstyp() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['rechnungstyp_id'])) + { + $result = $this->RechnungstypModel->update($this->post()['rechnungstyp_id'], $this->post()); + } + else + { + $result = $this->RechnungstypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($rechnungstyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Vertrag.php b/application/controllers/api/v1/accounting/Vertrag.php new file mode 100644 index 000000000..1136567ac --- /dev/null +++ b/application/controllers/api/v1/accounting/Vertrag.php @@ -0,0 +1,78 @@ +load->model('accounting/vertrag_model', 'VertragModel'); + // Load set the uid of the model to let to check the permissions + $this->VertragModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getVertrag() + { + $vertragID = $this->get('vertrag_id'); + + if(isset($vertragID)) + { + $result = $this->VertragModel->load($vertragID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postVertrag() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['vertrag_id'])) + { + $result = $this->VertragModel->update($this->post()['vertrag_id'], $this->post()); + } + else + { + $result = $this->VertragModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($vertrag = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Vertragsstatus.php b/application/controllers/api/v1/accounting/Vertragsstatus.php new file mode 100644 index 000000000..d40a26a09 --- /dev/null +++ b/application/controllers/api/v1/accounting/Vertragsstatus.php @@ -0,0 +1,78 @@ +load->model('accounting/vertragsstatus_model', 'VertragsstatusModel'); + // Load set the uid of the model to let to check the permissions + $this->VertragsstatusModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getVertragsstatus() + { + $vertragsstatusID = $this->get('vertragsstatus_id'); + + if(isset($vertragsstatusID)) + { + $result = $this->VertragsstatusModel->load($vertragsstatusID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postVertragsstatus() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['vertragsstatus_id'])) + { + $result = $this->VertragsstatusModel->update($this->post()['vertragsstatus_id'], $this->post()); + } + else + { + $result = $this->VertragsstatusModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($vertragsstatus = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Vertragstyp.php b/application/controllers/api/v1/accounting/Vertragstyp.php new file mode 100644 index 000000000..0052292bc --- /dev/null +++ b/application/controllers/api/v1/accounting/Vertragstyp.php @@ -0,0 +1,78 @@ +load->model('accounting/vertragstyp_model', 'VertragstypModel'); + // Load set the uid of the model to let to check the permissions + $this->VertragstypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getVertragstyp() + { + $vertragstypID = $this->get('vertragstyp_id'); + + if(isset($vertragstypID)) + { + $result = $this->VertragstypModel->load($vertragstypID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postVertragstyp() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['vertragstyp_id'])) + { + $result = $this->VertragstypModel->update($this->post()['vertragstyp_id'], $this->post()); + } + else + { + $result = $this->VertragstypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($vertragstyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Zahlungstyp.php b/application/controllers/api/v1/accounting/Zahlungstyp.php new file mode 100644 index 000000000..86aa911df --- /dev/null +++ b/application/controllers/api/v1/accounting/Zahlungstyp.php @@ -0,0 +1,78 @@ +load->model('accounting/zahlungstyp_model', 'ZahlungstypModel'); + // Load set the uid of the model to let to check the permissions + $this->ZahlungstypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getZahlungstyp() + { + $zahlungstypID = $this->get('zahlungstyp_id'); + + if(isset($zahlungstypID)) + { + $result = $this->ZahlungstypModel->load($zahlungstypID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postZahlungstyp() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['zahlungstyp_id'])) + { + $result = $this->ZahlungstypModel->update($this->post()['zahlungstyp_id'], $this->post()); + } + else + { + $result = $this->ZahlungstypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($zahlungstyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Akadgrad.php b/application/controllers/api/v1/codex/Akadgrad.php new file mode 100644 index 000000000..45518d146 --- /dev/null +++ b/application/controllers/api/v1/codex/Akadgrad.php @@ -0,0 +1,78 @@ +load->model('codex/akadgrad_model', 'AkadgradModel'); + // Load set the uid of the model to let to check the permissions + $this->AkadgradModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAkadgrad() + { + $akadgradID = $this->get('akadgrad_id'); + + if(isset($akadgradID)) + { + $result = $this->AkadgradModel->load($akadgradID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAkadgrad() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['akadgrad_id'])) + { + $result = $this->AkadgradModel->update($this->post()['akadgrad_id'], $this->post()); + } + else + { + $result = $this->AkadgradModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($akadgrad = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Archiv.php b/application/controllers/api/v1/codex/Archiv.php new file mode 100644 index 000000000..7918d9bb5 --- /dev/null +++ b/application/controllers/api/v1/codex/Archiv.php @@ -0,0 +1,78 @@ +load->model('codex/archiv_model', 'ArchivModel'); + // Load set the uid of the model to let to check the permissions + $this->ArchivModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getArchiv() + { + $archivID = $this->get('archiv_id'); + + if(isset($archivID)) + { + $result = $this->ArchivModel->load($archivID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postArchiv() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['archiv_id'])) + { + $result = $this->ArchivModel->update($this->post()['archiv_id'], $this->post()); + } + else + { + $result = $this->ArchivModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($archiv = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Aufmerksamdurch.php b/application/controllers/api/v1/codex/Aufmerksamdurch.php new file mode 100644 index 000000000..55c6b0b19 --- /dev/null +++ b/application/controllers/api/v1/codex/Aufmerksamdurch.php @@ -0,0 +1,78 @@ +load->model('codex/aufmerksamdurch_model', 'AufmerksamdurchModel'); + // Load set the uid of the model to let to check the permissions + $this->AufmerksamdurchModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAufmerksamdurch() + { + $aufmerksamdurchID = $this->get('aufmerksamdurch_id'); + + if(isset($aufmerksamdurchID)) + { + $result = $this->AufmerksamdurchModel->load($aufmerksamdurchID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAufmerksamdurch() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['aufmerksamdurch_id'])) + { + $result = $this->AufmerksamdurchModel->update($this->post()['aufmerksamdurch_id'], $this->post()); + } + else + { + $result = $this->AufmerksamdurchModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($aufmerksamdurch = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Ausbildung.php b/application/controllers/api/v1/codex/Ausbildung.php new file mode 100644 index 000000000..a99468033 --- /dev/null +++ b/application/controllers/api/v1/codex/Ausbildung.php @@ -0,0 +1,78 @@ +load->model('codex/ausbildung_model', 'AusbildungModel'); + // Load set the uid of the model to let to check the permissions + $this->AusbildungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAusbildung() + { + $ausbildungID = $this->get('ausbildung_id'); + + if(isset($ausbildungID)) + { + $result = $this->AusbildungModel->load($ausbildungID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAusbildung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['ausbildung_id'])) + { + $result = $this->AusbildungModel->update($this->post()['ausbildung_id'], $this->post()); + } + else + { + $result = $this->AusbildungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($ausbildung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Berufstaetigkeit.php b/application/controllers/api/v1/codex/Berufstaetigkeit.php new file mode 100644 index 000000000..82355d130 --- /dev/null +++ b/application/controllers/api/v1/codex/Berufstaetigkeit.php @@ -0,0 +1,78 @@ +load->model('codex/berufstaetigkeit_model', 'BerufstaetigkeitModel'); + // Load set the uid of the model to let to check the permissions + $this->BerufstaetigkeitModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBerufstaetigkeit() + { + $berufstaetigkeitID = $this->get('berufstaetigkeit_id'); + + if(isset($berufstaetigkeitID)) + { + $result = $this->BerufstaetigkeitModel->load($berufstaetigkeitID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBerufstaetigkeit() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['berufstaetigkeit_id'])) + { + $result = $this->BerufstaetigkeitModel->update($this->post()['berufstaetigkeit_id'], $this->post()); + } + else + { + $result = $this->BerufstaetigkeitModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($berufstaetigkeit = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Beschaeftigungsausmass.php b/application/controllers/api/v1/codex/Beschaeftigungsausmass.php new file mode 100644 index 000000000..58c439eae --- /dev/null +++ b/application/controllers/api/v1/codex/Beschaeftigungsausmass.php @@ -0,0 +1,78 @@ +load->model('codex/beschaeftigungsausmass_model', 'BeschaeftigungsausmassModel'); + // Load set the uid of the model to let to check the permissions + $this->BeschaeftigungsausmassModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBeschaeftigungsausmass() + { + $beschaeftigungsausmassID = $this->get('beschaeftigungsausmass_id'); + + if(isset($beschaeftigungsausmassID)) + { + $result = $this->BeschaeftigungsausmassModel->load($beschaeftigungsausmassID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBeschaeftigungsausmass() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['beschaeftigungsausmass_id'])) + { + $result = $this->BeschaeftigungsausmassModel->update($this->post()['beschaeftigungsausmass_id'], $this->post()); + } + else + { + $result = $this->BeschaeftigungsausmassModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($beschaeftigungsausmass = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Besqual.php b/application/controllers/api/v1/codex/Besqual.php new file mode 100644 index 000000000..3c304ba7e --- /dev/null +++ b/application/controllers/api/v1/codex/Besqual.php @@ -0,0 +1,78 @@ +load->model('codex/besqual_model', 'BesqualModel'); + // Load set the uid of the model to let to check the permissions + $this->BesqualModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBesqual() + { + $besqualID = $this->get('besqual_id'); + + if(isset($besqualID)) + { + $result = $this->BesqualModel->load($besqualID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBesqual() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['besqual_id'])) + { + $result = $this->BesqualModel->update($this->post()['besqual_id'], $this->post()); + } + else + { + $result = $this->BesqualModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($besqual = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Bisfunktion.php b/application/controllers/api/v1/codex/Bisfunktion.php new file mode 100644 index 000000000..b0d90eb7e --- /dev/null +++ b/application/controllers/api/v1/codex/Bisfunktion.php @@ -0,0 +1,78 @@ +load->model('codex/bisfunktion_model', 'BisfunktionModel'); + // Load set the uid of the model to let to check the permissions + $this->BisfunktionModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBisfunktion() + { + $bisfunktionID = $this->get('bisfunktion_id'); + + if(isset($bisfunktionID)) + { + $result = $this->BisfunktionModel->load($bisfunktionID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBisfunktion() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['bisfunktion_id'])) + { + $result = $this->BisfunktionModel->update($this->post()['bisfunktion_id'], $this->post()); + } + else + { + $result = $this->BisfunktionModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($bisfunktion = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Bisio.php b/application/controllers/api/v1/codex/Bisio.php new file mode 100644 index 000000000..405089d0e --- /dev/null +++ b/application/controllers/api/v1/codex/Bisio.php @@ -0,0 +1,78 @@ +load->model('codex/bisio_model', 'BisioModel'); + // Load set the uid of the model to let to check the permissions + $this->BisioModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBisio() + { + $bisioID = $this->get('bisio_id'); + + if(isset($bisioID)) + { + $result = $this->BisioModel->load($bisioID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBisio() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['bisio_id'])) + { + $result = $this->BisioModel->update($this->post()['bisio_id'], $this->post()); + } + else + { + $result = $this->BisioModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($bisio = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Bisorgform.php b/application/controllers/api/v1/codex/Bisorgform.php new file mode 100644 index 000000000..07ee00c76 --- /dev/null +++ b/application/controllers/api/v1/codex/Bisorgform.php @@ -0,0 +1,78 @@ +load->model('codex/bisorgform_model', 'BisorgformModel'); + // Load set the uid of the model to let to check the permissions + $this->BisorgformModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBisorgform() + { + $bisorgformID = $this->get('bisorgform_id'); + + if(isset($bisorgformID)) + { + $result = $this->BisorgformModel->load($bisorgformID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBisorgform() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['bisorgform_id'])) + { + $result = $this->BisorgformModel->update($this->post()['bisorgform_id'], $this->post()); + } + else + { + $result = $this->BisorgformModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($bisorgform = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Bisverwendung.php b/application/controllers/api/v1/codex/Bisverwendung.php new file mode 100644 index 000000000..5ec5499da --- /dev/null +++ b/application/controllers/api/v1/codex/Bisverwendung.php @@ -0,0 +1,78 @@ +load->model('codex/bisverwendung_model', 'BisverwendungModel'); + // Load set the uid of the model to let to check the permissions + $this->BisverwendungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBisverwendung() + { + $bisverwendungID = $this->get('bisverwendung_id'); + + if(isset($bisverwendungID)) + { + $result = $this->BisverwendungModel->load($bisverwendungID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBisverwendung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['bisverwendung_id'])) + { + $result = $this->BisverwendungModel->update($this->post()['bisverwendung_id'], $this->post()); + } + else + { + $result = $this->BisverwendungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($bisverwendung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Entwicklungsteam.php b/application/controllers/api/v1/codex/Entwicklungsteam.php new file mode 100644 index 000000000..8f9912ec4 --- /dev/null +++ b/application/controllers/api/v1/codex/Entwicklungsteam.php @@ -0,0 +1,78 @@ +load->model('codex/entwicklungsteam_model', 'EntwicklungsteamModel'); + // Load set the uid of the model to let to check the permissions + $this->EntwicklungsteamModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getEntwicklungsteam() + { + $entwicklungsteamID = $this->get('entwicklungsteam_id'); + + if(isset($entwicklungsteamID)) + { + $result = $this->EntwicklungsteamModel->load($entwicklungsteamID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postEntwicklungsteam() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['entwicklungsteam_id'])) + { + $result = $this->EntwicklungsteamModel->update($this->post()['entwicklungsteam_id'], $this->post()); + } + else + { + $result = $this->EntwicklungsteamModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($entwicklungsteam = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Gemeinde.php b/application/controllers/api/v1/codex/Gemeinde.php new file mode 100644 index 000000000..0b4a6d623 --- /dev/null +++ b/application/controllers/api/v1/codex/Gemeinde.php @@ -0,0 +1,78 @@ +load->model('codex/gemeinde_model', 'GemeindeModel'); + // Load set the uid of the model to let to check the permissions + $this->GemeindeModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getGemeinde() + { + $gemeindeID = $this->get('gemeinde_id'); + + if(isset($gemeindeID)) + { + $result = $this->GemeindeModel->load($gemeindeID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postGemeinde() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['gemeinde_id'])) + { + $result = $this->GemeindeModel->update($this->post()['gemeinde_id'], $this->post()); + } + else + { + $result = $this->GemeindeModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($gemeinde = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Hauptberuf.php b/application/controllers/api/v1/codex/Hauptberuf.php new file mode 100644 index 000000000..c7ace1644 --- /dev/null +++ b/application/controllers/api/v1/codex/Hauptberuf.php @@ -0,0 +1,78 @@ +load->model('codex/hauptberuf_model', 'HauptberufModel'); + // Load set the uid of the model to let to check the permissions + $this->HauptberufModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getHauptberuf() + { + $hauptberufID = $this->get('hauptberuf_id'); + + if(isset($hauptberufID)) + { + $result = $this->HauptberufModel->load($hauptberufID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postHauptberuf() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['hauptberuf_id'])) + { + $result = $this->HauptberufModel->update($this->post()['hauptberuf_id'], $this->post()); + } + else + { + $result = $this->HauptberufModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($hauptberuf = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Lehrform.php b/application/controllers/api/v1/codex/Lehrform.php new file mode 100644 index 000000000..4ea4c1aa7 --- /dev/null +++ b/application/controllers/api/v1/codex/Lehrform.php @@ -0,0 +1,78 @@ +load->model('codex/lehrform_model', 'LehrformModel'); + // Load set the uid of the model to let to check the permissions + $this->LehrformModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getLehrform() + { + $lehrformID = $this->get('lehrform_id'); + + if(isset($lehrformID)) + { + $result = $this->LehrformModel->load($lehrformID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postLehrform() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['lehrform_id'])) + { + $result = $this->LehrformModel->update($this->post()['lehrform_id'], $this->post()); + } + else + { + $result = $this->LehrformModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($lehrform = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Lgartcode.php b/application/controllers/api/v1/codex/Lgartcode.php new file mode 100644 index 000000000..73f19743f --- /dev/null +++ b/application/controllers/api/v1/codex/Lgartcode.php @@ -0,0 +1,78 @@ +load->model('codex/lgartcode_model', 'LgartcodeModel'); + // Load set the uid of the model to let to check the permissions + $this->LgartcodeModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getLgartcode() + { + $lgartcodeID = $this->get('lgartcode_id'); + + if(isset($lgartcodeID)) + { + $result = $this->LgartcodeModel->load($lgartcodeID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postLgartcode() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['lgartcode_id'])) + { + $result = $this->LgartcodeModel->update($this->post()['lgartcode_id'], $this->post()); + } + else + { + $result = $this->LgartcodeModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($lgartcode = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Mobilitaetsprogramm.php b/application/controllers/api/v1/codex/Mobilitaetsprogramm.php new file mode 100644 index 000000000..289f679de --- /dev/null +++ b/application/controllers/api/v1/codex/Mobilitaetsprogramm.php @@ -0,0 +1,78 @@ +load->model('codex/mobilitaetsprogramm_model', 'MobilitaetsprogrammModel'); + // Load set the uid of the model to let to check the permissions + $this->MobilitaetsprogrammModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getMobilitaetsprogramm() + { + $mobilitaetsprogrammID = $this->get('mobilitaetsprogramm_id'); + + if(isset($mobilitaetsprogrammID)) + { + $result = $this->MobilitaetsprogrammModel->load($mobilitaetsprogrammID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postMobilitaetsprogramm() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['mobilitaetsprogramm_id'])) + { + $result = $this->MobilitaetsprogrammModel->update($this->post()['mobilitaetsprogramm_id'], $this->post()); + } + else + { + $result = $this->MobilitaetsprogrammModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($mobilitaetsprogramm = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Note.php b/application/controllers/api/v1/codex/Note.php new file mode 100644 index 000000000..5a4ff9540 --- /dev/null +++ b/application/controllers/api/v1/codex/Note.php @@ -0,0 +1,78 @@ +load->model('codex/note_model', 'NoteModel'); + // Load set the uid of the model to let to check the permissions + $this->NoteModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getNote() + { + $noteID = $this->get('note_id'); + + if(isset($noteID)) + { + $result = $this->NoteModel->load($noteID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postNote() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['note_id'])) + { + $result = $this->NoteModel->update($this->post()['note_id'], $this->post()); + } + else + { + $result = $this->NoteModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($note = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Orgform.php b/application/controllers/api/v1/codex/Orgform.php new file mode 100644 index 000000000..fc2041538 --- /dev/null +++ b/application/controllers/api/v1/codex/Orgform.php @@ -0,0 +1,78 @@ +load->model('codex/orgform_model', 'OrgformModel'); + // Load set the uid of the model to let to check the permissions + $this->OrgformModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getOrgform() + { + $orgformID = $this->get('orgform_id'); + + if(isset($orgformID)) + { + $result = $this->OrgformModel->load($orgformID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postOrgform() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['orgform_id'])) + { + $result = $this->OrgformModel->update($this->post()['orgform_id'], $this->post()); + } + else + { + $result = $this->OrgformModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($orgform = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Verwendung.php b/application/controllers/api/v1/codex/Verwendung.php new file mode 100644 index 000000000..5f6f371b3 --- /dev/null +++ b/application/controllers/api/v1/codex/Verwendung.php @@ -0,0 +1,78 @@ +load->model('codex/verwendung_model', 'VerwendungModel'); + // Load set the uid of the model to let to check the permissions + $this->VerwendungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getVerwendung() + { + $verwendungID = $this->get('verwendung_id'); + + if(isset($verwendungID)) + { + $result = $this->VerwendungModel->load($verwendungID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postVerwendung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['verwendung_id'])) + { + $result = $this->VerwendungModel->update($this->post()['verwendung_id'], $this->post()); + } + else + { + $result = $this->VerwendungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($verwendung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Zgv.php b/application/controllers/api/v1/codex/Zgv.php new file mode 100644 index 000000000..c23508b06 --- /dev/null +++ b/application/controllers/api/v1/codex/Zgv.php @@ -0,0 +1,78 @@ +load->model('codex/zgv_model', 'ZgvModel'); + // Load set the uid of the model to let to check the permissions + $this->ZgvModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getZgv() + { + $zgvID = $this->get('zgv_id'); + + if(isset($zgvID)) + { + $result = $this->ZgvModel->load($zgvID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postZgv() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['zgv_id'])) + { + $result = $this->ZgvModel->update($this->post()['zgv_id'], $this->post()); + } + else + { + $result = $this->ZgvModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($zgv = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Zgvdoktor.php b/application/controllers/api/v1/codex/Zgvdoktor.php new file mode 100644 index 000000000..2e51460d5 --- /dev/null +++ b/application/controllers/api/v1/codex/Zgvdoktor.php @@ -0,0 +1,78 @@ +load->model('codex/zgvdoktor_model', 'ZgvdoktorModel'); + // Load set the uid of the model to let to check the permissions + $this->ZgvdoktorModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getZgvdoktor() + { + $zgvdoktorID = $this->get('zgvdoktor_id'); + + if(isset($zgvdoktorID)) + { + $result = $this->ZgvdoktorModel->load($zgvdoktorID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postZgvdoktor() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['zgvdoktor_id'])) + { + $result = $this->ZgvdoktorModel->update($this->post()['zgvdoktor_id'], $this->post()); + } + else + { + $result = $this->ZgvdoktorModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($zgvdoktor = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Zgvgruppe.php b/application/controllers/api/v1/codex/Zgvgruppe.php new file mode 100644 index 000000000..ac07691c1 --- /dev/null +++ b/application/controllers/api/v1/codex/Zgvgruppe.php @@ -0,0 +1,78 @@ +load->model('codex/zgvgruppe_model', 'ZgvgruppeModel'); + // Load set the uid of the model to let to check the permissions + $this->ZgvgruppeModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getZgvgruppe() + { + $zgvgruppeID = $this->get('zgvgruppe_id'); + + if(isset($zgvgruppeID)) + { + $result = $this->ZgvgruppeModel->load($zgvgruppeID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postZgvgruppe() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['zgvgruppe_id'])) + { + $result = $this->ZgvgruppeModel->update($this->post()['zgvgruppe_id'], $this->post()); + } + else + { + $result = $this->ZgvgruppeModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($zgvgruppe = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Zgvmaster.php b/application/controllers/api/v1/codex/Zgvmaster.php new file mode 100644 index 000000000..49d56396b --- /dev/null +++ b/application/controllers/api/v1/codex/Zgvmaster.php @@ -0,0 +1,78 @@ +load->model('codex/zgvmaster_model', 'ZgvmasterModel'); + // Load set the uid of the model to let to check the permissions + $this->ZgvmasterModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getZgvmaster() + { + $zgvmasterID = $this->get('zgvmaster_id'); + + if(isset($zgvmasterID)) + { + $result = $this->ZgvmasterModel->load($zgvmasterID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postZgvmaster() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['zgvmaster_id'])) + { + $result = $this->ZgvmasterModel->update($this->post()['zgvmaster_id'], $this->post()); + } + else + { + $result = $this->ZgvmasterModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($zgvmaster = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Zweck.php b/application/controllers/api/v1/codex/Zweck.php new file mode 100644 index 000000000..d6163c400 --- /dev/null +++ b/application/controllers/api/v1/codex/Zweck.php @@ -0,0 +1,78 @@ +load->model('codex/zweck_model', 'ZweckModel'); + // Load set the uid of the model to let to check the permissions + $this->ZweckModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getZweck() + { + $zweckID = $this->get('zweck_id'); + + if(isset($zweckID)) + { + $result = $this->ZweckModel->load($zweckID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postZweck() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['zweck_id'])) + { + $result = $this->ZweckModel->update($this->post()['zweck_id'], $this->post()); + } + else + { + $result = $this->ZweckModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($zweck = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/content/Ampel.php b/application/controllers/api/v1/content/Ampel.php new file mode 100644 index 000000000..8dd654023 --- /dev/null +++ b/application/controllers/api/v1/content/Ampel.php @@ -0,0 +1,78 @@ +load->model('content/ampel_model', 'AmpelModel'); + // Load set the uid of the model to let to check the permissions + $this->AmpelModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAmpel() + { + $ampelID = $this->get('ampel_id'); + + if(isset($ampelID)) + { + $result = $this->AmpelModel->load($ampelID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAmpel() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['ampel_id'])) + { + $result = $this->AmpelModel->update($this->post()['ampel_id'], $this->post()); + } + else + { + $result = $this->AmpelModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($ampel = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/content/Content.php b/application/controllers/api/v1/content/Content.php new file mode 100644 index 000000000..510a4536e --- /dev/null +++ b/application/controllers/api/v1/content/Content.php @@ -0,0 +1,78 @@ +load->model('content/content_model', 'ContentModel'); + // Load set the uid of the model to let to check the permissions + $this->ContentModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getContent() + { + $contentID = $this->get('content_id'); + + if(isset($contentID)) + { + $result = $this->ContentModel->load($contentID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postContent() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['content_id'])) + { + $result = $this->ContentModel->update($this->post()['content_id'], $this->post()); + } + else + { + $result = $this->ContentModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($content = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/content/Contentchild.php b/application/controllers/api/v1/content/Contentchild.php new file mode 100644 index 000000000..72b1f0cfe --- /dev/null +++ b/application/controllers/api/v1/content/Contentchild.php @@ -0,0 +1,78 @@ +load->model('content/contentchild_model', 'ContentchildModel'); + // Load set the uid of the model to let to check the permissions + $this->ContentchildModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getContentchild() + { + $contentchildID = $this->get('contentchild_id'); + + if(isset($contentchildID)) + { + $result = $this->ContentchildModel->load($contentchildID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postContentchild() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['contentchild_id'])) + { + $result = $this->ContentchildModel->update($this->post()['contentchild_id'], $this->post()); + } + else + { + $result = $this->ContentchildModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($contentchild = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/content/Contentgruppe.php b/application/controllers/api/v1/content/Contentgruppe.php new file mode 100644 index 000000000..2421d7144 --- /dev/null +++ b/application/controllers/api/v1/content/Contentgruppe.php @@ -0,0 +1,78 @@ +load->model('content/contentgruppe_model', 'ContentgruppeModel'); + // Load set the uid of the model to let to check the permissions + $this->ContentgruppeModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getContentgruppe() + { + $contentgruppeID = $this->get('contentgruppe_id'); + + if(isset($contentgruppeID)) + { + $result = $this->ContentgruppeModel->load($contentgruppeID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postContentgruppe() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['contentgruppe_id'])) + { + $result = $this->ContentgruppeModel->update($this->post()['contentgruppe_id'], $this->post()); + } + else + { + $result = $this->ContentgruppeModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($contentgruppe = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/content/Contentlog.php b/application/controllers/api/v1/content/Contentlog.php new file mode 100644 index 000000000..99e1fd030 --- /dev/null +++ b/application/controllers/api/v1/content/Contentlog.php @@ -0,0 +1,78 @@ +load->model('content/contentlog_model', 'ContentlogModel'); + // Load set the uid of the model to let to check the permissions + $this->ContentlogModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getContentlog() + { + $contentlogID = $this->get('contentlog_id'); + + if(isset($contentlogID)) + { + $result = $this->ContentlogModel->load($contentlogID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postContentlog() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['contentlog_id'])) + { + $result = $this->ContentlogModel->update($this->post()['contentlog_id'], $this->post()); + } + else + { + $result = $this->ContentlogModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($contentlog = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/content/Contentsprache.php b/application/controllers/api/v1/content/Contentsprache.php new file mode 100644 index 000000000..bf255116d --- /dev/null +++ b/application/controllers/api/v1/content/Contentsprache.php @@ -0,0 +1,78 @@ +load->model('content/contentsprache_model', 'ContentspracheModel'); + // Load set the uid of the model to let to check the permissions + $this->ContentspracheModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getContentsprache() + { + $contentspracheID = $this->get('contentsprache_id'); + + if(isset($contentspracheID)) + { + $result = $this->ContentspracheModel->load($contentspracheID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postContentsprache() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['contentsprache_id'])) + { + $result = $this->ContentspracheModel->update($this->post()['contentsprache_id'], $this->post()); + } + else + { + $result = $this->ContentspracheModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($contentsprache = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/content/Dms.php b/application/controllers/api/v1/content/Dms.php new file mode 100644 index 000000000..36e48f892 --- /dev/null +++ b/application/controllers/api/v1/content/Dms.php @@ -0,0 +1,69 @@ +load->model('content/dms_model', 'DmsModel'); + // Load set the uid of the model to let to check the permissions + $this->DmsModel->setUID($this->_getUID()); + } + + /** + * + */ + public function getDms() + { + $dms_id = $this->get('dms_id'); + $version = $this->get('version'); + + if(isset($dms_id)) + { + $result = $this->DmsModel->addJoin('campus.tbl_dms_version', 'dms_id'); + if($result->error == EXIT_SUCCESS) + { + $result = $this->DmsModel->addOrder('version', 'DESC'); + if($result->error == EXIT_SUCCESS) + { + $result = $this->DmsModel->addLimit(1); + if($result->error == EXIT_SUCCESS) + { + if(!isset($version)) + { + $result = $this->DmsModel->loadWhere(array('dms_id' => $dms_id)); + } + else + { + $result = $this->DmsModel->loadWhere(array('dms_id' => $dms_id, 'version' => $version)); + } + } + } + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/content/Infoscreen.php b/application/controllers/api/v1/content/Infoscreen.php new file mode 100644 index 000000000..4b39d9e1c --- /dev/null +++ b/application/controllers/api/v1/content/Infoscreen.php @@ -0,0 +1,78 @@ +load->model('content/infoscreen_model', 'InfoscreenModel'); + // Load set the uid of the model to let to check the permissions + $this->InfoscreenModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getInfoscreen() + { + $infoscreenID = $this->get('infoscreen_id'); + + if(isset($infoscreenID)) + { + $result = $this->InfoscreenModel->load($infoscreenID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postInfoscreen() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['infoscreen_id'])) + { + $result = $this->InfoscreenModel->update($this->post()['infoscreen_id'], $this->post()); + } + else + { + $result = $this->InfoscreenModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($infoscreen = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/content/News.php b/application/controllers/api/v1/content/News.php new file mode 100644 index 000000000..3568dee60 --- /dev/null +++ b/application/controllers/api/v1/content/News.php @@ -0,0 +1,78 @@ +load->model('content/news_model', 'NewsModel'); + // Load set the uid of the model to let to check the permissions + $this->NewsModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getNews() + { + $newsID = $this->get('news_id'); + + if(isset($newsID)) + { + $result = $this->NewsModel->load($newsID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postNews() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['news_id'])) + { + $result = $this->NewsModel->update($this->post()['news_id'], $this->post()); + } + else + { + $result = $this->NewsModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($news = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/content/Template.php b/application/controllers/api/v1/content/Template.php new file mode 100644 index 000000000..73a6f4173 --- /dev/null +++ b/application/controllers/api/v1/content/Template.php @@ -0,0 +1,78 @@ +load->model('content/template_model', 'TemplateModel'); + // Load set the uid of the model to let to check the permissions + $this->TemplateModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getTemplate() + { + $templateID = $this->get('template_id'); + + if(isset($templateID)) + { + $result = $this->TemplateModel->load($templateID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postTemplate() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['template_id'])) + { + $result = $this->TemplateModel->update($this->post()['template_id'], $this->post()); + } + else + { + $result = $this->TemplateModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($template = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/content/Veranstaltung.php b/application/controllers/api/v1/content/Veranstaltung.php new file mode 100644 index 000000000..ccbe54d0a --- /dev/null +++ b/application/controllers/api/v1/content/Veranstaltung.php @@ -0,0 +1,78 @@ +load->model('content/veranstaltung_model', 'VeranstaltungModel'); + // Load set the uid of the model to let to check the permissions + $this->VeranstaltungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getVeranstaltung() + { + $veranstaltungID = $this->get('veranstaltung_id'); + + if(isset($veranstaltungID)) + { + $result = $this->VeranstaltungModel->load($veranstaltungID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postVeranstaltung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['veranstaltung_id'])) + { + $result = $this->VeranstaltungModel->update($this->post()['veranstaltung_id'], $this->post()); + } + else + { + $result = $this->VeranstaltungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($veranstaltung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/content/Veranstaltungskategorie.php b/application/controllers/api/v1/content/Veranstaltungskategorie.php new file mode 100644 index 000000000..999c60bb8 --- /dev/null +++ b/application/controllers/api/v1/content/Veranstaltungskategorie.php @@ -0,0 +1,78 @@ +load->model('content/veranstaltungskategorie_model', 'VeranstaltungskategorieModel'); + // Load set the uid of the model to let to check the permissions + $this->VeranstaltungskategorieModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getVeranstaltungskategorie() + { + $veranstaltungskategorieID = $this->get('veranstaltungskategorie_id'); + + if(isset($veranstaltungskategorieID)) + { + $result = $this->VeranstaltungskategorieModel->load($veranstaltungskategorieID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postVeranstaltungskategorie() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['veranstaltungskategorie_id'])) + { + $result = $this->VeranstaltungskategorieModel->update($this->post()['veranstaltungskategorie_id'], $this->post()); + } + else + { + $result = $this->VeranstaltungskategorieModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($veranstaltungskategorie = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Akte.php b/application/controllers/api/v1/crm/Akte.php new file mode 100644 index 000000000..63984bc86 --- /dev/null +++ b/application/controllers/api/v1/crm/Akte.php @@ -0,0 +1,78 @@ +load->model('crm/akte_model', 'AkteModel'); + // Load set the uid of the model to let to check the permissions + $this->AkteModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAkte() + { + $akteID = $this->get('akte_id'); + + if(isset($akteID)) + { + $result = $this->AkteModel->load($akteID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAkte() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['akte_id'])) + { + $result = $this->AkteModel->update($this->post()['akte_id'], $this->post()); + } + else + { + $result = $this->AkteModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($akte = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Aufnahmeschluessel.php b/application/controllers/api/v1/crm/Aufnahmeschluessel.php new file mode 100644 index 000000000..d232428f1 --- /dev/null +++ b/application/controllers/api/v1/crm/Aufnahmeschluessel.php @@ -0,0 +1,78 @@ +load->model('crm/aufnahmeschluessel_model', 'AufnahmeschluesselModel'); + // Load set the uid of the model to let to check the permissions + $this->AufnahmeschluesselModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAufnahmeschluessel() + { + $aufnahmeschluesselID = $this->get('aufnahmeschluessel_id'); + + if(isset($aufnahmeschluesselID)) + { + $result = $this->AufnahmeschluesselModel->load($aufnahmeschluesselID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAufnahmeschluessel() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['aufnahmeschluessel_id'])) + { + $result = $this->AufnahmeschluesselModel->update($this->post()['aufnahmeschluessel_id'], $this->post()); + } + else + { + $result = $this->AufnahmeschluesselModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($aufnahmeschluessel = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Aufnahmetermin.php b/application/controllers/api/v1/crm/Aufnahmetermin.php new file mode 100644 index 000000000..0d11fd24b --- /dev/null +++ b/application/controllers/api/v1/crm/Aufnahmetermin.php @@ -0,0 +1,78 @@ +load->model('crm/aufnahmetermin_model', 'AufnahmeterminModel'); + // Load set the uid of the model to let to check the permissions + $this->AufnahmeterminModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAufnahmetermin() + { + $aufnahmeterminID = $this->get('aufnahmetermin_id'); + + if(isset($aufnahmeterminID)) + { + $result = $this->AufnahmeterminModel->load($aufnahmeterminID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAufnahmetermin() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['aufnahmetermin_id'])) + { + $result = $this->AufnahmeterminModel->update($this->post()['aufnahmetermin_id'], $this->post()); + } + else + { + $result = $this->AufnahmeterminModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($aufnahmetermin = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Aufnahmetermintyp.php b/application/controllers/api/v1/crm/Aufnahmetermintyp.php new file mode 100644 index 000000000..d3cf29e25 --- /dev/null +++ b/application/controllers/api/v1/crm/Aufnahmetermintyp.php @@ -0,0 +1,78 @@ +load->model('crm/aufnahmetermintyp_model', 'AufnahmetermintypModel'); + // Load set the uid of the model to let to check the permissions + $this->AufnahmetermintypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAufnahmetermintyp() + { + $aufnahmetermintypID = $this->get('aufnahmetermintyp_id'); + + if(isset($aufnahmetermintypID)) + { + $result = $this->AufnahmetermintypModel->load($aufnahmetermintypID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAufnahmetermintyp() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['aufnahmetermintyp_id'])) + { + $result = $this->AufnahmetermintypModel->update($this->post()['aufnahmetermintyp_id'], $this->post()); + } + else + { + $result = $this->AufnahmetermintypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($aufnahmetermintyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Bewerbungstermine.php b/application/controllers/api/v1/crm/Bewerbungstermine.php new file mode 100644 index 000000000..1e438af0f --- /dev/null +++ b/application/controllers/api/v1/crm/Bewerbungstermine.php @@ -0,0 +1,78 @@ +load->model('crm/bewerbungstermine_model', 'BewerbungstermineModel'); + // Load set the uid of the model to let to check the permissions + $this->BewerbungstermineModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBewerbungstermine() + { + $bewerbungstermineID = $this->get('bewerbungstermine_id'); + + if(isset($bewerbungstermineID)) + { + $result = $this->BewerbungstermineModel->load($bewerbungstermineID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBewerbungstermine() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['bewerbungstermine_id'])) + { + $result = $this->BewerbungstermineModel->update($this->post()['bewerbungstermine_id'], $this->post()); + } + else + { + $result = $this->BewerbungstermineModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($bewerbungstermine = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Buchungstyp.php b/application/controllers/api/v1/crm/Buchungstyp.php new file mode 100644 index 000000000..280d2ab69 --- /dev/null +++ b/application/controllers/api/v1/crm/Buchungstyp.php @@ -0,0 +1,78 @@ +load->model('crm/buchungstyp_model', 'BuchungstypModel'); + // Load set the uid of the model to let to check the permissions + $this->BuchungstypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBuchungstyp() + { + $buchungstypID = $this->get('buchungstyp_id'); + + if(isset($buchungstypID)) + { + $result = $this->BuchungstypModel->load($buchungstypID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBuchungstyp() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['buchungstyp_id'])) + { + $result = $this->BuchungstypModel->update($this->post()['buchungstyp_id'], $this->post()); + } + else + { + $result = $this->BuchungstypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($buchungstyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Dokument.php b/application/controllers/api/v1/crm/Dokument.php new file mode 100644 index 000000000..579b09320 --- /dev/null +++ b/application/controllers/api/v1/crm/Dokument.php @@ -0,0 +1,78 @@ +load->model('crm/dokument_model', 'DokumentModel'); + // Load set the uid of the model to let to check the permissions + $this->DokumentModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getDokument() + { + $dokumentID = $this->get('dokument_id'); + + if(isset($dokumentID)) + { + $result = $this->DokumentModel->load($dokumentID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postDokument() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['dokument_id'])) + { + $result = $this->DokumentModel->update($this->post()['dokument_id'], $this->post()); + } + else + { + $result = $this->DokumentModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($dokument = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Dokumentprestudent.php b/application/controllers/api/v1/crm/Dokumentprestudent.php new file mode 100644 index 000000000..ff7a1f228 --- /dev/null +++ b/application/controllers/api/v1/crm/Dokumentprestudent.php @@ -0,0 +1,78 @@ +load->model('crm/dokumentprestudent_model', 'DokumentprestudentModel'); + // Load set the uid of the model to let to check the permissions + $this->DokumentprestudentModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getDokumentprestudent() + { + $dokumentprestudentID = $this->get('dokumentprestudent_id'); + + if(isset($dokumentprestudentID)) + { + $result = $this->DokumentprestudentModel->load($dokumentprestudentID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postDokumentprestudent() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['dokumentprestudent_id'])) + { + $result = $this->DokumentprestudentModel->update($this->post()['dokumentprestudent_id'], $this->post()); + } + else + { + $result = $this->DokumentprestudentModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($dokumentprestudent = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Dokumentstudiengang.php b/application/controllers/api/v1/crm/Dokumentstudiengang.php new file mode 100644 index 000000000..2006198b9 --- /dev/null +++ b/application/controllers/api/v1/crm/Dokumentstudiengang.php @@ -0,0 +1,78 @@ +load->model('crm/dokumentstudiengang_model', 'DokumentstudiengangModel'); + // Load set the uid of the model to let to check the permissions + $this->DokumentstudiengangModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getDokumentstudiengang() + { + $dokumentstudiengangID = $this->get('dokumentstudiengang_id'); + + if(isset($dokumentstudiengangID)) + { + $result = $this->DokumentstudiengangModel->load($dokumentstudiengangID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postDokumentstudiengang() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['dokumentstudiengang_id'])) + { + $result = $this->DokumentstudiengangModel->update($this->post()['dokumentstudiengang_id'], $this->post()); + } + else + { + $result = $this->DokumentstudiengangModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($dokumentstudiengang = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Konto.php b/application/controllers/api/v1/crm/Konto.php new file mode 100644 index 000000000..30035e871 --- /dev/null +++ b/application/controllers/api/v1/crm/Konto.php @@ -0,0 +1,78 @@ +load->model('crm/konto_model', 'KontoModel'); + // Load set the uid of the model to let to check the permissions + $this->KontoModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getKonto() + { + $kontoID = $this->get('konto_id'); + + if(isset($kontoID)) + { + $result = $this->KontoModel->load($kontoID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postKonto() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['konto_id'])) + { + $result = $this->KontoModel->update($this->post()['konto_id'], $this->post()); + } + else + { + $result = $this->KontoModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($konto = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Preincoming.php b/application/controllers/api/v1/crm/Preincoming.php new file mode 100644 index 000000000..2d60add2e --- /dev/null +++ b/application/controllers/api/v1/crm/Preincoming.php @@ -0,0 +1,78 @@ +load->model('crm/preincoming_model', 'PreincomingModel'); + // Load set the uid of the model to let to check the permissions + $this->PreincomingModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getPreincoming() + { + $preincomingID = $this->get('preincoming_id'); + + if(isset($preincomingID)) + { + $result = $this->PreincomingModel->load($preincomingID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postPreincoming() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['preincoming_id'])) + { + $result = $this->PreincomingModel->update($this->post()['preincoming_id'], $this->post()); + } + else + { + $result = $this->PreincomingModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($preincoming = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Preinteressentstudiengang.php b/application/controllers/api/v1/crm/Preinteressentstudiengang.php new file mode 100644 index 000000000..f89dad7d4 --- /dev/null +++ b/application/controllers/api/v1/crm/Preinteressentstudiengang.php @@ -0,0 +1,78 @@ +load->model('crm/preinteressentstudiengang_model', 'PreinteressentstudiengangModel'); + // Load set the uid of the model to let to check the permissions + $this->PreinteressentstudiengangModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getPreinteressentstudiengang() + { + $preinteressentstudiengangID = $this->get('preinteressentstudiengang_id'); + + if(isset($preinteressentstudiengangID)) + { + $result = $this->PreinteressentstudiengangModel->load($preinteressentstudiengangID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postPreinteressentstudiengang() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['preinteressentstudiengang_id'])) + { + $result = $this->PreinteressentstudiengangModel->update($this->post()['preinteressentstudiengang_id'], $this->post()); + } + else + { + $result = $this->PreinteressentstudiengangModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($preinteressentstudiengang = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Preoutgoing.php b/application/controllers/api/v1/crm/Preoutgoing.php new file mode 100644 index 000000000..16b622416 --- /dev/null +++ b/application/controllers/api/v1/crm/Preoutgoing.php @@ -0,0 +1,78 @@ +load->model('crm/preoutgoing_model', 'PreoutgoingModel'); + // Load set the uid of the model to let to check the permissions + $this->PreoutgoingModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getPreoutgoing() + { + $preoutgoingID = $this->get('preoutgoing_id'); + + if(isset($preoutgoingID)) + { + $result = $this->PreoutgoingModel->load($preoutgoingID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postPreoutgoing() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['preoutgoing_id'])) + { + $result = $this->PreoutgoingModel->update($this->post()['preoutgoing_id'], $this->post()); + } + else + { + $result = $this->PreoutgoingModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($preoutgoing = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Prestudent.php b/application/controllers/api/v1/crm/Prestudent.php new file mode 100644 index 000000000..78e83a9c2 --- /dev/null +++ b/application/controllers/api/v1/crm/Prestudent.php @@ -0,0 +1,78 @@ +load->model('crm/prestudent_model', 'PrestudentModel'); + // Load set the uid of the model to let to check the permissions + $this->PrestudentModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getPrestudent() + { + $prestudentID = $this->get('prestudent_id'); + + if(isset($prestudentID)) + { + $result = $this->PrestudentModel->load($prestudentID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postPrestudent() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['prestudent_id'])) + { + $result = $this->PrestudentModel->update($this->post()['prestudent_id'], $this->post()); + } + else + { + $result = $this->PrestudentModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($prestudent = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Prestudentstatus.php b/application/controllers/api/v1/crm/Prestudentstatus.php new file mode 100644 index 000000000..d1032d36e --- /dev/null +++ b/application/controllers/api/v1/crm/Prestudentstatus.php @@ -0,0 +1,78 @@ +load->model('crm/prestudentstatus_model', 'PrestudentstatusModel'); + // Load set the uid of the model to let to check the permissions + $this->PrestudentstatusModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getPrestudentstatus() + { + $prestudentstatusID = $this->get('prestudentstatus_id'); + + if(isset($prestudentstatusID)) + { + $result = $this->PrestudentstatusModel->load($prestudentstatusID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postPrestudentstatus() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['prestudentstatus_id'])) + { + $result = $this->PrestudentstatusModel->update($this->post()['prestudentstatus_id'], $this->post()); + } + else + { + $result = $this->PrestudentstatusModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($prestudentstatus = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Reihungstest.php b/application/controllers/api/v1/crm/Reihungstest.php new file mode 100644 index 000000000..162b8a50e --- /dev/null +++ b/application/controllers/api/v1/crm/Reihungstest.php @@ -0,0 +1,78 @@ +load->model('crm/reihungstest_model', 'ReihungstestModel'); + // Load set the uid of the model to let to check the permissions + $this->ReihungstestModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getReihungstest() + { + $reihungstestID = $this->get('reihungstest_id'); + + if(isset($reihungstestID)) + { + $result = $this->ReihungstestModel->load($reihungstestID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postReihungstest() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['reihungstest_id'])) + { + $result = $this->ReihungstestModel->update($this->post()['reihungstest_id'], $this->post()); + } + else + { + $result = $this->ReihungstestModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($reihungstest = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Status.php b/application/controllers/api/v1/crm/Status.php new file mode 100644 index 000000000..2973b602b --- /dev/null +++ b/application/controllers/api/v1/crm/Status.php @@ -0,0 +1,78 @@ +load->model('crm/status_model', 'StatusModel'); + // Load set the uid of the model to let to check the permissions + $this->StatusModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStatus() + { + $statusID = $this->get('status_id'); + + if(isset($statusID)) + { + $result = $this->StatusModel->load($statusID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStatus() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['status_id'])) + { + $result = $this->StatusModel->update($this->post()['status_id'], $this->post()); + } + else + { + $result = $this->StatusModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($status = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Student.php b/application/controllers/api/v1/crm/Student.php new file mode 100644 index 000000000..6986484e4 --- /dev/null +++ b/application/controllers/api/v1/crm/Student.php @@ -0,0 +1,78 @@ +load->model('crm/student_model', 'StudentModel'); + // Load set the uid of the model to let to check the permissions + $this->StudentModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStudent() + { + $studentID = $this->get('student_id'); + + if(isset($studentID)) + { + $result = $this->StudentModel->load($studentID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStudent() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['student_id'])) + { + $result = $this->StudentModel->update($this->post()['student_id'], $this->post()); + } + else + { + $result = $this->StudentModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($student = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Erhalter.php b/application/controllers/api/v1/organisation/Erhalter.php new file mode 100644 index 000000000..c52b953ed --- /dev/null +++ b/application/controllers/api/v1/organisation/Erhalter.php @@ -0,0 +1,78 @@ +load->model('organisation/erhalter_model', 'ErhalterModel'); + // Load set the uid of the model to let to check the permissions + $this->ErhalterModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getErhalter() + { + $erhalterID = $this->get('erhalter_id'); + + if(isset($erhalterID)) + { + $result = $this->ErhalterModel->load($erhalterID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postErhalter() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['erhalter_id'])) + { + $result = $this->ErhalterModel->update($this->post()['erhalter_id'], $this->post()); + } + else + { + $result = $this->ErhalterModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($erhalter = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Fachbereich.php b/application/controllers/api/v1/organisation/Fachbereich.php new file mode 100644 index 000000000..7a6008b31 --- /dev/null +++ b/application/controllers/api/v1/organisation/Fachbereich.php @@ -0,0 +1,78 @@ +load->model('organisation/fachbereich_model', 'FachbereichModel'); + // Load set the uid of the model to let to check the permissions + $this->FachbereichModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getFachbereich() + { + $fachbereichID = $this->get('fachbereich_id'); + + if(isset($fachbereichID)) + { + $result = $this->FachbereichModel->load($fachbereichID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postFachbereich() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['fachbereich_id'])) + { + $result = $this->FachbereichModel->update($this->post()['fachbereich_id'], $this->post()); + } + else + { + $result = $this->FachbereichModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($fachbereich = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Ferien.php b/application/controllers/api/v1/organisation/Ferien.php new file mode 100644 index 000000000..55ba26f66 --- /dev/null +++ b/application/controllers/api/v1/organisation/Ferien.php @@ -0,0 +1,78 @@ +load->model('organisation/ferien_model', 'FerienModel'); + // Load set the uid of the model to let to check the permissions + $this->FerienModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getFerien() + { + $ferienID = $this->get('ferien_id'); + + if(isset($ferienID)) + { + $result = $this->FerienModel->load($ferienID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postFerien() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['ferien_id'])) + { + $result = $this->FerienModel->update($this->post()['ferien_id'], $this->post()); + } + else + { + $result = $this->FerienModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($ferien = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Geschaeftsjahr.php b/application/controllers/api/v1/organisation/Geschaeftsjahr.php new file mode 100644 index 000000000..2b12cb87b --- /dev/null +++ b/application/controllers/api/v1/organisation/Geschaeftsjahr.php @@ -0,0 +1,78 @@ +load->model('organisation/geschaeftsjahr_model', 'GeschaeftsjahrModel'); + // Load set the uid of the model to let to check the permissions + $this->GeschaeftsjahrModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getGeschaeftsjahr() + { + $geschaeftsjahrID = $this->get('geschaeftsjahr_id'); + + if(isset($geschaeftsjahrID)) + { + $result = $this->GeschaeftsjahrModel->load($geschaeftsjahrID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postGeschaeftsjahr() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['geschaeftsjahr_id'])) + { + $result = $this->GeschaeftsjahrModel->update($this->post()['geschaeftsjahr_id'], $this->post()); + } + else + { + $result = $this->GeschaeftsjahrModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($geschaeftsjahr = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Gruppe.php b/application/controllers/api/v1/organisation/Gruppe.php new file mode 100644 index 000000000..3e6d70f92 --- /dev/null +++ b/application/controllers/api/v1/organisation/Gruppe.php @@ -0,0 +1,78 @@ +load->model('organisation/gruppe_model', 'GruppeModel'); + // Load set the uid of the model to let to check the permissions + $this->GruppeModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getGruppe() + { + $gruppeID = $this->get('gruppe_id'); + + if(isset($gruppeID)) + { + $result = $this->GruppeModel->load($gruppeID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postGruppe() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['gruppe_id'])) + { + $result = $this->GruppeModel->update($this->post()['gruppe_id'], $this->post()); + } + else + { + $result = $this->GruppeModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($gruppe = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Lehrverband.php b/application/controllers/api/v1/organisation/Lehrverband.php new file mode 100644 index 000000000..2a249ac1e --- /dev/null +++ b/application/controllers/api/v1/organisation/Lehrverband.php @@ -0,0 +1,78 @@ +load->model('organisation/lehrverband_model', 'LehrverbandModel'); + // Load set the uid of the model to let to check the permissions + $this->LehrverbandModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getLehrverband() + { + $lehrverbandID = $this->get('lehrverband_id'); + + if(isset($lehrverbandID)) + { + $result = $this->LehrverbandModel->load($lehrverbandID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postLehrverband() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['lehrverband_id'])) + { + $result = $this->LehrverbandModel->update($this->post()['lehrverband_id'], $this->post()); + } + else + { + $result = $this->LehrverbandModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($lehrverband = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Organisationseinheit.php b/application/controllers/api/v1/organisation/Organisationseinheit.php new file mode 100644 index 000000000..217ce7990 --- /dev/null +++ b/application/controllers/api/v1/organisation/Organisationseinheit.php @@ -0,0 +1,78 @@ +load->model('organisation/organisationseinheit_model', 'OrganisationseinheitModel'); + // Load set the uid of the model to let to check the permissions + $this->OrganisationseinheitModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getOrganisationseinheit() + { + $organisationseinheitID = $this->get('organisationseinheit_id'); + + if(isset($organisationseinheitID)) + { + $result = $this->OrganisationseinheitModel->load($organisationseinheitID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postOrganisationseinheit() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['organisationseinheit_id'])) + { + $result = $this->OrganisationseinheitModel->update($this->post()['organisationseinheit_id'], $this->post()); + } + else + { + $result = $this->OrganisationseinheitModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($organisationseinheit = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Organisationseinheittyp.php b/application/controllers/api/v1/organisation/Organisationseinheittyp.php new file mode 100644 index 000000000..56bd1ac23 --- /dev/null +++ b/application/controllers/api/v1/organisation/Organisationseinheittyp.php @@ -0,0 +1,78 @@ +load->model('organisation/organisationseinheittyp_model', 'OrganisationseinheittypModel'); + // Load set the uid of the model to let to check the permissions + $this->OrganisationseinheittypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getOrganisationseinheittyp() + { + $organisationseinheittypID = $this->get('organisationseinheittyp_id'); + + if(isset($organisationseinheittypID)) + { + $result = $this->OrganisationseinheittypModel->load($organisationseinheittypID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postOrganisationseinheittyp() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['organisationseinheittyp_id'])) + { + $result = $this->OrganisationseinheittypModel->update($this->post()['organisationseinheittyp_id'], $this->post()); + } + else + { + $result = $this->OrganisationseinheittypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($organisationseinheittyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Semesterwochen.php b/application/controllers/api/v1/organisation/Semesterwochen.php new file mode 100644 index 000000000..c1530ac7c --- /dev/null +++ b/application/controllers/api/v1/organisation/Semesterwochen.php @@ -0,0 +1,78 @@ +load->model('organisation/semesterwochen_model', 'SemesterwochenModel'); + // Load set the uid of the model to let to check the permissions + $this->SemesterwochenModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getSemesterwochen() + { + $semesterwochenID = $this->get('semesterwochen_id'); + + if(isset($semesterwochenID)) + { + $result = $this->SemesterwochenModel->load($semesterwochenID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postSemesterwochen() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['semesterwochen_id'])) + { + $result = $this->SemesterwochenModel->update($this->post()['semesterwochen_id'], $this->post()); + } + else + { + $result = $this->SemesterwochenModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($semesterwochen = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Service.php b/application/controllers/api/v1/organisation/Service.php new file mode 100644 index 000000000..ff62e9e0a --- /dev/null +++ b/application/controllers/api/v1/organisation/Service.php @@ -0,0 +1,78 @@ +load->model('organisation/service_model', 'ServiceModel'); + // Load set the uid of the model to let to check the permissions + $this->ServiceModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getService() + { + $serviceID = $this->get('service_id'); + + if(isset($serviceID)) + { + $result = $this->ServiceModel->load($serviceID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postService() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['service_id'])) + { + $result = $this->ServiceModel->update($this->post()['service_id'], $this->post()); + } + else + { + $result = $this->ServiceModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($service = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Standort.php b/application/controllers/api/v1/organisation/Standort.php new file mode 100644 index 000000000..50afc8dac --- /dev/null +++ b/application/controllers/api/v1/organisation/Standort.php @@ -0,0 +1,78 @@ +load->model('organisation/standort_model', 'StandortModel'); + // Load set the uid of the model to let to check the permissions + $this->StandortModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStandort() + { + $standortID = $this->get('standort_id'); + + if(isset($standortID)) + { + $result = $this->StandortModel->load($standortID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStandort() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['standort_id'])) + { + $result = $this->StandortModel->update($this->post()['standort_id'], $this->post()); + } + else + { + $result = $this->StandortModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($standort = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Statistik.php b/application/controllers/api/v1/organisation/Statistik.php new file mode 100644 index 000000000..8d372a1ac --- /dev/null +++ b/application/controllers/api/v1/organisation/Statistik.php @@ -0,0 +1,78 @@ +load->model('organisation/statistik_model', 'StatistikModel'); + // Load set the uid of the model to let to check the permissions + $this->StatistikModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStatistik() + { + $statistikID = $this->get('statistik_id'); + + if(isset($statistikID)) + { + $result = $this->StatistikModel->load($statistikID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStatistik() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['statistik_id'])) + { + $result = $this->StatistikModel->update($this->post()['statistik_id'], $this->post()); + } + else + { + $result = $this->StatistikModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($statistik = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Studiengangstyp.php b/application/controllers/api/v1/organisation/Studiengangstyp.php new file mode 100644 index 000000000..94e6072f8 --- /dev/null +++ b/application/controllers/api/v1/organisation/Studiengangstyp.php @@ -0,0 +1,78 @@ +load->model('organisation/studiengangstyp_model', 'StudiengangstypModel'); + // Load set the uid of the model to let to check the permissions + $this->StudiengangstypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStudiengangstyp() + { + $studiengangstypID = $this->get('studiengangstyp_id'); + + if(isset($studiengangstypID)) + { + $result = $this->StudiengangstypModel->load($studiengangstypID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStudiengangstyp() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['studiengangstyp_id'])) + { + $result = $this->StudiengangstypModel->update($this->post()['studiengangstyp_id'], $this->post()); + } + else + { + $result = $this->StudiengangstypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($studiengangstyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Studienjahr.php b/application/controllers/api/v1/organisation/Studienjahr.php new file mode 100644 index 000000000..1c90497e2 --- /dev/null +++ b/application/controllers/api/v1/organisation/Studienjahr.php @@ -0,0 +1,78 @@ +load->model('organisation/studienjahr_model', 'StudienjahrModel'); + // Load set the uid of the model to let to check the permissions + $this->StudienjahrModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStudienjahr() + { + $studienjahrID = $this->get('studienjahr_id'); + + if(isset($studienjahrID)) + { + $result = $this->StudienjahrModel->load($studienjahrID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStudienjahr() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['studienjahr_id'])) + { + $result = $this->StudienjahrModel->update($this->post()['studienjahr_id'], $this->post()); + } + else + { + $result = $this->StudienjahrModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($studienjahr = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Studienordnung.php b/application/controllers/api/v1/organisation/Studienordnung.php new file mode 100644 index 000000000..10e561435 --- /dev/null +++ b/application/controllers/api/v1/organisation/Studienordnung.php @@ -0,0 +1,78 @@ +load->model('organisation/studienordnung_model', 'StudienordnungModel'); + // Load set the uid of the model to let to check the permissions + $this->StudienordnungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStudienordnung() + { + $studienordnungID = $this->get('studienordnung_id'); + + if(isset($studienordnungID)) + { + $result = $this->StudienordnungModel->load($studienordnungID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStudienordnung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['studienordnung_id'])) + { + $result = $this->StudienordnungModel->update($this->post()['studienordnung_id'], $this->post()); + } + else + { + $result = $this->StudienordnungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($studienordnung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Studienordnungstatus.php b/application/controllers/api/v1/organisation/Studienordnungstatus.php new file mode 100644 index 000000000..af6f4bf73 --- /dev/null +++ b/application/controllers/api/v1/organisation/Studienordnungstatus.php @@ -0,0 +1,78 @@ +load->model('organisation/studienordnungstatus_model', 'StudienordnungstatusModel'); + // Load set the uid of the model to let to check the permissions + $this->StudienordnungstatusModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStudienordnungstatus() + { + $studienordnungstatusID = $this->get('studienordnungstatus_id'); + + if(isset($studienordnungstatusID)) + { + $result = $this->StudienordnungstatusModel->load($studienordnungstatusID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStudienordnungstatus() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['studienordnungstatus_id'])) + { + $result = $this->StudienordnungstatusModel->update($this->post()['studienordnungstatus_id'], $this->post()); + } + else + { + $result = $this->StudienordnungstatusModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($studienordnungstatus = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Studienplatz.php b/application/controllers/api/v1/organisation/Studienplatz.php new file mode 100644 index 000000000..d88c116a7 --- /dev/null +++ b/application/controllers/api/v1/organisation/Studienplatz.php @@ -0,0 +1,78 @@ +load->model('organisation/studienplatz_model', 'StudienplatzModel'); + // Load set the uid of the model to let to check the permissions + $this->StudienplatzModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStudienplatz() + { + $studienplatzID = $this->get('studienplatz_id'); + + if(isset($studienplatzID)) + { + $result = $this->StudienplatzModel->load($studienplatzID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStudienplatz() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['studienplatz_id'])) + { + $result = $this->StudienplatzModel->update($this->post()['studienplatz_id'], $this->post()); + } + else + { + $result = $this->StudienplatzModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($studienplatz = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Studiensemester.php b/application/controllers/api/v1/organisation/Studiensemester.php new file mode 100644 index 000000000..aad98aa5d --- /dev/null +++ b/application/controllers/api/v1/organisation/Studiensemester.php @@ -0,0 +1,78 @@ +load->model('organisation/studiensemester_model', 'StudiensemesterModel'); + // Load set the uid of the model to let to check the permissions + $this->StudiensemesterModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStudiensemester() + { + $studiensemesterID = $this->get('studiensemester_id'); + + if(isset($studiensemesterID)) + { + $result = $this->StudiensemesterModel->load($studiensemesterID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStudiensemester() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['studiensemester_id'])) + { + $result = $this->StudiensemesterModel->update($this->post()['studiensemester_id'], $this->post()); + } + else + { + $result = $this->StudiensemesterModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($studiensemester = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/person/Bankverbindung.php b/application/controllers/api/v1/person/Bankverbindung.php new file mode 100644 index 000000000..ca9dc4dc8 --- /dev/null +++ b/application/controllers/api/v1/person/Bankverbindung.php @@ -0,0 +1,78 @@ +load->model('person/bankverbindung_model', 'BankverbindungModel'); + // Load set the uid of the model to let to check the permissions + $this->BankverbindungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBankverbindung() + { + $bankverbindungID = $this->get('bankverbindung_id'); + + if(isset($bankverbindungID)) + { + $result = $this->BankverbindungModel->load($bankverbindungID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBankverbindung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['bankverbindung_id'])) + { + $result = $this->BankverbindungModel->update($this->post()['bankverbindung_id'], $this->post()); + } + else + { + $result = $this->BankverbindungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($bankverbindung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/person/Benutzer.php b/application/controllers/api/v1/person/Benutzer.php new file mode 100644 index 000000000..84cd8f0ac --- /dev/null +++ b/application/controllers/api/v1/person/Benutzer.php @@ -0,0 +1,78 @@ +load->model('person/benutzer_model', 'BenutzerModel'); + // Load set the uid of the model to let to check the permissions + $this->BenutzerModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBenutzer() + { + $benutzerID = $this->get('benutzer_id'); + + if(isset($benutzerID)) + { + $result = $this->BenutzerModel->load($benutzerID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBenutzer() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['benutzer_id'])) + { + $result = $this->BenutzerModel->update($this->post()['benutzer_id'], $this->post()); + } + else + { + $result = $this->BenutzerModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($benutzer = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/person/Benutzerfunktion.php b/application/controllers/api/v1/person/Benutzerfunktion.php new file mode 100644 index 000000000..88d301432 --- /dev/null +++ b/application/controllers/api/v1/person/Benutzerfunktion.php @@ -0,0 +1,78 @@ +load->model('person/benutzerfunktion_model', 'BenutzerfunktionModel'); + // Load set the uid of the model to let to check the permissions + $this->BenutzerfunktionModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBenutzerfunktion() + { + $benutzerfunktionID = $this->get('benutzerfunktion_id'); + + if(isset($benutzerfunktionID)) + { + $result = $this->BenutzerfunktionModel->load($benutzerfunktionID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBenutzerfunktion() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['benutzerfunktion_id'])) + { + $result = $this->BenutzerfunktionModel->update($this->post()['benutzerfunktion_id'], $this->post()); + } + else + { + $result = $this->BenutzerfunktionModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($benutzerfunktion = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/person/Benutzergruppe.php b/application/controllers/api/v1/person/Benutzergruppe.php new file mode 100644 index 000000000..b2817766e --- /dev/null +++ b/application/controllers/api/v1/person/Benutzergruppe.php @@ -0,0 +1,78 @@ +load->model('person/benutzergruppe_model', 'BenutzergruppeModel'); + // Load set the uid of the model to let to check the permissions + $this->BenutzergruppeModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBenutzergruppe() + { + $benutzergruppeID = $this->get('benutzergruppe_id'); + + if(isset($benutzergruppeID)) + { + $result = $this->BenutzergruppeModel->load($benutzergruppeID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBenutzergruppe() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['benutzergruppe_id'])) + { + $result = $this->BenutzergruppeModel->update($this->post()['benutzergruppe_id'], $this->post()); + } + else + { + $result = $this->BenutzergruppeModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($benutzergruppe = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/person/Fotostatus.php b/application/controllers/api/v1/person/Fotostatus.php new file mode 100644 index 000000000..f72aca84a --- /dev/null +++ b/application/controllers/api/v1/person/Fotostatus.php @@ -0,0 +1,78 @@ +load->model('person/fotostatus_model', 'FotostatusModel'); + // Load set the uid of the model to let to check the permissions + $this->FotostatusModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getFotostatus() + { + $fotostatusID = $this->get('fotostatus_id'); + + if(isset($fotostatusID)) + { + $result = $this->FotostatusModel->load($fotostatusID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postFotostatus() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['fotostatus_id'])) + { + $result = $this->FotostatusModel->update($this->post()['fotostatus_id'], $this->post()); + } + else + { + $result = $this->FotostatusModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($fotostatus = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/person/Freebusy.php b/application/controllers/api/v1/person/Freebusy.php new file mode 100644 index 000000000..bbfb9f9b9 --- /dev/null +++ b/application/controllers/api/v1/person/Freebusy.php @@ -0,0 +1,78 @@ +load->model('person/freebusy_model', 'FreebusyModel'); + // Load set the uid of the model to let to check the permissions + $this->FreebusyModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getFreebusy() + { + $freebusyID = $this->get('freebusy_id'); + + if(isset($freebusyID)) + { + $result = $this->FreebusyModel->load($freebusyID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postFreebusy() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['freebusy_id'])) + { + $result = $this->FreebusyModel->update($this->post()['freebusy_id'], $this->post()); + } + else + { + $result = $this->FreebusyModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($freebusy = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/person/Freebusytyp.php b/application/controllers/api/v1/person/Freebusytyp.php new file mode 100644 index 000000000..400c82477 --- /dev/null +++ b/application/controllers/api/v1/person/Freebusytyp.php @@ -0,0 +1,78 @@ +load->model('person/freebusytyp_model', 'FreebusytypModel'); + // Load set the uid of the model to let to check the permissions + $this->FreebusytypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getFreebusytyp() + { + $freebusytypID = $this->get('freebusytyp_id'); + + if(isset($freebusytypID)) + { + $result = $this->FreebusytypModel->load($freebusytypID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postFreebusytyp() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['freebusytyp_id'])) + { + $result = $this->FreebusytypModel->update($this->post()['freebusytyp_id'], $this->post()); + } + else + { + $result = $this->FreebusytypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($freebusytyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/person/Kontaktmedium.php b/application/controllers/api/v1/person/Kontaktmedium.php new file mode 100644 index 000000000..898988278 --- /dev/null +++ b/application/controllers/api/v1/person/Kontaktmedium.php @@ -0,0 +1,78 @@ +load->model('person/kontaktmedium_model', 'KontaktmediumModel'); + // Load set the uid of the model to let to check the permissions + $this->KontaktmediumModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getKontaktmedium() + { + $kontaktmediumID = $this->get('kontaktmedium_id'); + + if(isset($kontaktmediumID)) + { + $result = $this->KontaktmediumModel->load($kontaktmediumID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postKontaktmedium() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['kontaktmedium_id'])) + { + $result = $this->KontaktmediumModel->update($this->post()['kontaktmedium_id'], $this->post()); + } + else + { + $result = $this->KontaktmediumModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($kontaktmedium = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/person/Kontakttyp.php b/application/controllers/api/v1/person/Kontakttyp.php new file mode 100644 index 000000000..ea179dd2a --- /dev/null +++ b/application/controllers/api/v1/person/Kontakttyp.php @@ -0,0 +1,78 @@ +load->model('person/kontakttyp_model', 'KontakttypModel'); + // Load set the uid of the model to let to check the permissions + $this->KontakttypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getKontakttyp() + { + $kontakttypID = $this->get('kontakttyp_id'); + + if(isset($kontakttypID)) + { + $result = $this->KontakttypModel->load($kontakttypID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postKontakttyp() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['kontakttyp_id'])) + { + $result = $this->KontakttypModel->update($this->post()['kontakttyp_id'], $this->post()); + } + else + { + $result = $this->KontakttypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($kontakttyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/person/Notiz.php b/application/controllers/api/v1/person/Notiz.php new file mode 100644 index 000000000..82711fc32 --- /dev/null +++ b/application/controllers/api/v1/person/Notiz.php @@ -0,0 +1,78 @@ +load->model('person/notiz_model', 'NotizModel'); + // Load set the uid of the model to let to check the permissions + $this->NotizModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getNotiz() + { + $notizID = $this->get('notiz_id'); + + if(isset($notizID)) + { + $result = $this->NotizModel->load($notizID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postNotiz() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['notiz_id'])) + { + $result = $this->NotizModel->update($this->post()['notiz_id'], $this->post()); + } + else + { + $result = $this->NotizModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($notiz = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/person/Notizzuordnung.php b/application/controllers/api/v1/person/Notizzuordnung.php new file mode 100644 index 000000000..a86a32aa4 --- /dev/null +++ b/application/controllers/api/v1/person/Notizzuordnung.php @@ -0,0 +1,78 @@ +load->model('person/notizzuordnung_model', 'NotizzuordnungModel'); + // Load set the uid of the model to let to check the permissions + $this->NotizzuordnungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getNotizzuordnung() + { + $notizzuordnungID = $this->get('notizzuordnung_id'); + + if(isset($notizzuordnungID)) + { + $result = $this->NotizzuordnungModel->load($notizzuordnungID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postNotizzuordnung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['notizzuordnung_id'])) + { + $result = $this->NotizzuordnungModel->update($this->post()['notizzuordnung_id'], $this->post()); + } + else + { + $result = $this->NotizzuordnungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($notizzuordnung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/project/Aktivitaet.php b/application/controllers/api/v1/project/Aktivitaet.php new file mode 100644 index 000000000..434a6a458 --- /dev/null +++ b/application/controllers/api/v1/project/Aktivitaet.php @@ -0,0 +1,78 @@ +load->model('project/aktivitaet_model', 'AktivitaetModel'); + // Load set the uid of the model to let to check the permissions + $this->AktivitaetModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAktivitaet() + { + $aktivitaetID = $this->get('aktivitaet_id'); + + if(isset($aktivitaetID)) + { + $result = $this->AktivitaetModel->load($aktivitaetID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAktivitaet() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['aktivitaet_id'])) + { + $result = $this->AktivitaetModel->update($this->post()['aktivitaet_id'], $this->post()); + } + else + { + $result = $this->AktivitaetModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($aktivitaet = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/project/Aufwandstyp.php b/application/controllers/api/v1/project/Aufwandstyp.php new file mode 100644 index 000000000..754cbcf1c --- /dev/null +++ b/application/controllers/api/v1/project/Aufwandstyp.php @@ -0,0 +1,78 @@ +load->model('project/aufwandstyp_model', 'AufwandstypModel'); + // Load set the uid of the model to let to check the permissions + $this->AufwandstypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAufwandstyp() + { + $aufwandstypID = $this->get('aufwandstyp_id'); + + if(isset($aufwandstypID)) + { + $result = $this->AufwandstypModel->load($aufwandstypID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAufwandstyp() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['aufwandstyp_id'])) + { + $result = $this->AufwandstypModel->update($this->post()['aufwandstyp_id'], $this->post()); + } + else + { + $result = $this->AufwandstypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($aufwandstyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/project/Projekt.php b/application/controllers/api/v1/project/Projekt.php new file mode 100644 index 000000000..eab850c88 --- /dev/null +++ b/application/controllers/api/v1/project/Projekt.php @@ -0,0 +1,78 @@ +load->model('project/projekt_model', 'ProjektModel'); + // Load set the uid of the model to let to check the permissions + $this->ProjektModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getProjekt() + { + $projektID = $this->get('projekt_id'); + + if(isset($projektID)) + { + $result = $this->ProjektModel->load($projektID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postProjekt() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['projekt_id'])) + { + $result = $this->ProjektModel->update($this->post()['projekt_id'], $this->post()); + } + else + { + $result = $this->ProjektModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($projekt = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/project/Projekt_ressource.php b/application/controllers/api/v1/project/Projekt_ressource.php new file mode 100644 index 000000000..37eecc0f4 --- /dev/null +++ b/application/controllers/api/v1/project/Projekt_ressource.php @@ -0,0 +1,78 @@ +load->model('project/projekt_ressource_model', 'Projekt_ressourceModel'); + // Load set the uid of the model to let to check the permissions + $this->Projekt_ressourceModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getProjekt_ressource() + { + $projekt_ressourceID = $this->get('projekt_ressource_id'); + + if(isset($projekt_ressourceID)) + { + $result = $this->Projekt_ressourceModel->load($projekt_ressourceID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postProjekt_ressource() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['projekt_ressource_id'])) + { + $result = $this->Projekt_ressourceModel->update($this->post()['projekt_ressource_id'], $this->post()); + } + else + { + $result = $this->Projekt_ressourceModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($projekt_ressource = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/project/Projektphase.php b/application/controllers/api/v1/project/Projektphase.php new file mode 100644 index 000000000..667ac6dd7 --- /dev/null +++ b/application/controllers/api/v1/project/Projektphase.php @@ -0,0 +1,78 @@ +load->model('project/projektphase_model', 'ProjektphaseModel'); + // Load set the uid of the model to let to check the permissions + $this->ProjektphaseModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getProjektphase() + { + $projektphaseID = $this->get('projektphase_id'); + + if(isset($projektphaseID)) + { + $result = $this->ProjektphaseModel->load($projektphaseID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postProjektphase() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['projektphase_id'])) + { + $result = $this->ProjektphaseModel->update($this->post()['projektphase_id'], $this->post()); + } + else + { + $result = $this->ProjektphaseModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($projektphase = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/project/Projekttask.php b/application/controllers/api/v1/project/Projekttask.php new file mode 100644 index 000000000..2c48e8ce8 --- /dev/null +++ b/application/controllers/api/v1/project/Projekttask.php @@ -0,0 +1,78 @@ +load->model('project/projekttask_model', 'ProjekttaskModel'); + // Load set the uid of the model to let to check the permissions + $this->ProjekttaskModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getProjekttask() + { + $projekttaskID = $this->get('projekttask_id'); + + if(isset($projekttaskID)) + { + $result = $this->ProjekttaskModel->load($projekttaskID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postProjekttask() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['projekttask_id'])) + { + $result = $this->ProjekttaskModel->update($this->post()['projekttask_id'], $this->post()); + } + else + { + $result = $this->ProjekttaskModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($projekttask = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/project/Ressource.php b/application/controllers/api/v1/project/Ressource.php new file mode 100644 index 000000000..1d4060dd7 --- /dev/null +++ b/application/controllers/api/v1/project/Ressource.php @@ -0,0 +1,78 @@ +load->model('project/ressource_model', 'RessourceModel'); + // Load set the uid of the model to let to check the permissions + $this->RessourceModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getRessource() + { + $ressourceID = $this->get('ressource_id'); + + if(isset($ressourceID)) + { + $result = $this->RessourceModel->load($ressourceID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postRessource() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['ressource_id'])) + { + $result = $this->RessourceModel->update($this->post()['ressource_id'], $this->post()); + } + else + { + $result = $this->RessourceModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($ressource = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/project/Scrumsprint.php b/application/controllers/api/v1/project/Scrumsprint.php new file mode 100644 index 000000000..a0338913d --- /dev/null +++ b/application/controllers/api/v1/project/Scrumsprint.php @@ -0,0 +1,78 @@ +load->model('project/scrumsprint_model', 'ScrumsprintModel'); + // Load set the uid of the model to let to check the permissions + $this->ScrumsprintModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getScrumsprint() + { + $scrumsprintID = $this->get('scrumsprint_id'); + + if(isset($scrumsprintID)) + { + $result = $this->ScrumsprintModel->load($scrumsprintID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postScrumsprint() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['scrumsprint_id'])) + { + $result = $this->ScrumsprintModel->update($this->post()['scrumsprint_id'], $this->post()); + } + else + { + $result = $this->ScrumsprintModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($scrumsprint = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/project/Scrumteam.php b/application/controllers/api/v1/project/Scrumteam.php new file mode 100644 index 000000000..dd5f3e29a --- /dev/null +++ b/application/controllers/api/v1/project/Scrumteam.php @@ -0,0 +1,78 @@ +load->model('project/scrumteam_model', 'ScrumteamModel'); + // Load set the uid of the model to let to check the permissions + $this->ScrumteamModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getScrumteam() + { + $scrumteamID = $this->get('scrumteam_id'); + + if(isset($scrumteamID)) + { + $result = $this->ScrumteamModel->load($scrumteamID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postScrumteam() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['scrumteam_id'])) + { + $result = $this->ScrumteamModel->update($this->post()['scrumteam_id'], $this->post()); + } + else + { + $result = $this->ScrumteamModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($scrumteam = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Betriebsmittel.php b/application/controllers/api/v1/ressource/Betriebsmittel.php new file mode 100644 index 000000000..b57902e67 --- /dev/null +++ b/application/controllers/api/v1/ressource/Betriebsmittel.php @@ -0,0 +1,78 @@ +load->model('ressource/betriebsmittel_model', 'BetriebsmittelModel'); + // Load set the uid of the model to let to check the permissions + $this->BetriebsmittelModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBetriebsmittel() + { + $betriebsmittelID = $this->get('betriebsmittel_id'); + + if(isset($betriebsmittelID)) + { + $result = $this->BetriebsmittelModel->load($betriebsmittelID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBetriebsmittel() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['betriebsmittel_id'])) + { + $result = $this->BetriebsmittelModel->update($this->post()['betriebsmittel_id'], $this->post()); + } + else + { + $result = $this->BetriebsmittelModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($betriebsmittel = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Betriebsmittelperson.php b/application/controllers/api/v1/ressource/Betriebsmittelperson.php new file mode 100644 index 000000000..a097e0247 --- /dev/null +++ b/application/controllers/api/v1/ressource/Betriebsmittelperson.php @@ -0,0 +1,78 @@ +load->model('ressource/betriebsmittelperson_model', 'BetriebsmittelpersonModel'); + // Load set the uid of the model to let to check the permissions + $this->BetriebsmittelpersonModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBetriebsmittelperson() + { + $betriebsmittelpersonID = $this->get('betriebsmittelperson_id'); + + if(isset($betriebsmittelpersonID)) + { + $result = $this->BetriebsmittelpersonModel->load($betriebsmittelpersonID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBetriebsmittelperson() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['betriebsmittelperson_id'])) + { + $result = $this->BetriebsmittelpersonModel->update($this->post()['betriebsmittelperson_id'], $this->post()); + } + else + { + $result = $this->BetriebsmittelpersonModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($betriebsmittelperson = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Betriebsmittelstatus.php b/application/controllers/api/v1/ressource/Betriebsmittelstatus.php new file mode 100644 index 000000000..9f9b126c1 --- /dev/null +++ b/application/controllers/api/v1/ressource/Betriebsmittelstatus.php @@ -0,0 +1,78 @@ +load->model('ressource/betriebsmittelstatus_model', 'BetriebsmittelstatusModel'); + // Load set the uid of the model to let to check the permissions + $this->BetriebsmittelstatusModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBetriebsmittelstatus() + { + $betriebsmittelstatusID = $this->get('betriebsmittelstatus_id'); + + if(isset($betriebsmittelstatusID)) + { + $result = $this->BetriebsmittelstatusModel->load($betriebsmittelstatusID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBetriebsmittelstatus() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['betriebsmittelstatus_id'])) + { + $result = $this->BetriebsmittelstatusModel->update($this->post()['betriebsmittelstatus_id'], $this->post()); + } + else + { + $result = $this->BetriebsmittelstatusModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($betriebsmittelstatus = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Betriebsmitteltyp.php b/application/controllers/api/v1/ressource/Betriebsmitteltyp.php new file mode 100644 index 000000000..10c966ead --- /dev/null +++ b/application/controllers/api/v1/ressource/Betriebsmitteltyp.php @@ -0,0 +1,78 @@ +load->model('ressource/betriebsmitteltyp_model', 'BetriebsmitteltypModel'); + // Load set the uid of the model to let to check the permissions + $this->BetriebsmitteltypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBetriebsmitteltyp() + { + $betriebsmitteltypID = $this->get('betriebsmitteltyp_id'); + + if(isset($betriebsmitteltypID)) + { + $result = $this->BetriebsmitteltypModel->load($betriebsmitteltypID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBetriebsmitteltyp() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['betriebsmitteltyp_id'])) + { + $result = $this->BetriebsmitteltypModel->update($this->post()['betriebsmitteltyp_id'], $this->post()); + } + else + { + $result = $this->BetriebsmitteltypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($betriebsmitteltyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Coodle.php b/application/controllers/api/v1/ressource/Coodle.php new file mode 100644 index 000000000..d938d3ed2 --- /dev/null +++ b/application/controllers/api/v1/ressource/Coodle.php @@ -0,0 +1,78 @@ +load->model('ressource/coodle_model', 'CoodleModel'); + // Load set the uid of the model to let to check the permissions + $this->CoodleModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getCoodle() + { + $coodleID = $this->get('coodle_id'); + + if(isset($coodleID)) + { + $result = $this->CoodleModel->load($coodleID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postCoodle() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['coodle_id'])) + { + $result = $this->CoodleModel->update($this->post()['coodle_id'], $this->post()); + } + else + { + $result = $this->CoodleModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($coodle = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Erreichbarkeit.php b/application/controllers/api/v1/ressource/Erreichbarkeit.php new file mode 100644 index 000000000..68719e459 --- /dev/null +++ b/application/controllers/api/v1/ressource/Erreichbarkeit.php @@ -0,0 +1,78 @@ +load->model('ressource/erreichbarkeit_model', 'ErreichbarkeitModel'); + // Load set the uid of the model to let to check the permissions + $this->ErreichbarkeitModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getErreichbarkeit() + { + $erreichbarkeitID = $this->get('erreichbarkeit_id'); + + if(isset($erreichbarkeitID)) + { + $result = $this->ErreichbarkeitModel->load($erreichbarkeitID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postErreichbarkeit() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['erreichbarkeit_id'])) + { + $result = $this->ErreichbarkeitModel->update($this->post()['erreichbarkeit_id'], $this->post()); + } + else + { + $result = $this->ErreichbarkeitModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($erreichbarkeit = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Firma.php b/application/controllers/api/v1/ressource/Firma.php new file mode 100644 index 000000000..14fab7838 --- /dev/null +++ b/application/controllers/api/v1/ressource/Firma.php @@ -0,0 +1,78 @@ +load->model('ressource/firma_model', 'FirmaModel'); + // Load set the uid of the model to let to check the permissions + $this->FirmaModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getFirma() + { + $firmaID = $this->get('firma_id'); + + if(isset($firmaID)) + { + $result = $this->FirmaModel->load($firmaID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postFirma() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['firma_id'])) + { + $result = $this->FirmaModel->update($this->post()['firma_id'], $this->post()); + } + else + { + $result = $this->FirmaModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($firma = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Firmatag.php b/application/controllers/api/v1/ressource/Firmatag.php new file mode 100644 index 000000000..5115ba465 --- /dev/null +++ b/application/controllers/api/v1/ressource/Firmatag.php @@ -0,0 +1,78 @@ +load->model('ressource/firmatag_model', 'FirmatagModel'); + // Load set the uid of the model to let to check the permissions + $this->FirmatagModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getFirmatag() + { + $firmatagID = $this->get('firmatag_id'); + + if(isset($firmatagID)) + { + $result = $this->FirmatagModel->load($firmatagID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postFirmatag() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['firmatag_id'])) + { + $result = $this->FirmatagModel->update($this->post()['firmatag_id'], $this->post()); + } + else + { + $result = $this->FirmatagModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($firmatag = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Firmentyp.php b/application/controllers/api/v1/ressource/Firmentyp.php new file mode 100644 index 000000000..ba58242ba --- /dev/null +++ b/application/controllers/api/v1/ressource/Firmentyp.php @@ -0,0 +1,78 @@ +load->model('ressource/firmentyp_model', 'FirmentypModel'); + // Load set the uid of the model to let to check the permissions + $this->FirmentypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getFirmentyp() + { + $firmentypID = $this->get('firmentyp_id'); + + if(isset($firmentypID)) + { + $result = $this->FirmentypModel->load($firmentypID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postFirmentyp() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['firmentyp_id'])) + { + $result = $this->FirmentypModel->update($this->post()['firmentyp_id'], $this->post()); + } + else + { + $result = $this->FirmentypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($firmentyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Funktion.php b/application/controllers/api/v1/ressource/Funktion.php new file mode 100644 index 000000000..1894983a7 --- /dev/null +++ b/application/controllers/api/v1/ressource/Funktion.php @@ -0,0 +1,78 @@ +load->model('ressource/funktion_model', 'FunktionModel'); + // Load set the uid of the model to let to check the permissions + $this->FunktionModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getFunktion() + { + $funktionID = $this->get('funktion_id'); + + if(isset($funktionID)) + { + $result = $this->FunktionModel->load($funktionID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postFunktion() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['funktion_id'])) + { + $result = $this->FunktionModel->update($this->post()['funktion_id'], $this->post()); + } + else + { + $result = $this->FunktionModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($funktion = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Lehrmittel.php b/application/controllers/api/v1/ressource/Lehrmittel.php new file mode 100644 index 000000000..c1b1a0b9d --- /dev/null +++ b/application/controllers/api/v1/ressource/Lehrmittel.php @@ -0,0 +1,78 @@ +load->model('ressource/lehrmittel_model', 'LehrmittelModel'); + // Load set the uid of the model to let to check the permissions + $this->LehrmittelModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getLehrmittel() + { + $lehrmittelID = $this->get('lehrmittel_id'); + + if(isset($lehrmittelID)) + { + $result = $this->LehrmittelModel->load($lehrmittelID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postLehrmittel() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['lehrmittel_id'])) + { + $result = $this->LehrmittelModel->update($this->post()['lehrmittel_id'], $this->post()); + } + else + { + $result = $this->LehrmittelModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($lehrmittel = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Mitarbeiter.php b/application/controllers/api/v1/ressource/Mitarbeiter.php new file mode 100644 index 000000000..17ad4e8ef --- /dev/null +++ b/application/controllers/api/v1/ressource/Mitarbeiter.php @@ -0,0 +1,78 @@ +load->model('ressource/mitarbeiter_model', 'MitarbeiterModel'); + // Load set the uid of the model to let to check the permissions + $this->MitarbeiterModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getMitarbeiter() + { + $mitarbeiterID = $this->get('mitarbeiter_id'); + + if(isset($mitarbeiterID)) + { + $result = $this->MitarbeiterModel->load($mitarbeiterID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postMitarbeiter() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['mitarbeiter_id'])) + { + $result = $this->MitarbeiterModel->update($this->post()['mitarbeiter_id'], $this->post()); + } + else + { + $result = $this->MitarbeiterModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($mitarbeiter = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Ort.php b/application/controllers/api/v1/ressource/Ort.php new file mode 100644 index 000000000..e49d7fea7 --- /dev/null +++ b/application/controllers/api/v1/ressource/Ort.php @@ -0,0 +1,78 @@ +load->model('ressource/ort_model', 'OrtModel'); + // Load set the uid of the model to let to check the permissions + $this->OrtModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getOrt() + { + $ortID = $this->get('ort_id'); + + if(isset($ortID)) + { + $result = $this->OrtModel->load($ortID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postOrt() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['ort_id'])) + { + $result = $this->OrtModel->update($this->post()['ort_id'], $this->post()); + } + else + { + $result = $this->OrtModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($ort = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Ortraumtyp.php b/application/controllers/api/v1/ressource/Ortraumtyp.php new file mode 100644 index 000000000..817249ea1 --- /dev/null +++ b/application/controllers/api/v1/ressource/Ortraumtyp.php @@ -0,0 +1,78 @@ +load->model('ressource/ortraumtyp_model', 'OrtraumtypModel'); + // Load set the uid of the model to let to check the permissions + $this->OrtraumtypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getOrtraumtyp() + { + $ortraumtypID = $this->get('ortraumtyp_id'); + + if(isset($ortraumtypID)) + { + $result = $this->OrtraumtypModel->load($ortraumtypID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postOrtraumtyp() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['ortraumtyp_id'])) + { + $result = $this->OrtraumtypModel->update($this->post()['ortraumtyp_id'], $this->post()); + } + else + { + $result = $this->OrtraumtypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($ortraumtyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Personfunktionstandort.php b/application/controllers/api/v1/ressource/Personfunktionstandort.php new file mode 100644 index 000000000..c1af35f92 --- /dev/null +++ b/application/controllers/api/v1/ressource/Personfunktionstandort.php @@ -0,0 +1,78 @@ +load->model('ressource/personfunktionstandort_model', 'PersonfunktionstandortModel'); + // Load set the uid of the model to let to check the permissions + $this->PersonfunktionstandortModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getPersonfunktionstandort() + { + $personfunktionstandortID = $this->get('personfunktionstandort_id'); + + if(isset($personfunktionstandortID)) + { + $result = $this->PersonfunktionstandortModel->load($personfunktionstandortID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postPersonfunktionstandort() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['personfunktionstandort_id'])) + { + $result = $this->PersonfunktionstandortModel->update($this->post()['personfunktionstandort_id'], $this->post()); + } + else + { + $result = $this->PersonfunktionstandortModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($personfunktionstandort = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Raumtyp.php b/application/controllers/api/v1/ressource/Raumtyp.php new file mode 100644 index 000000000..dd242d74c --- /dev/null +++ b/application/controllers/api/v1/ressource/Raumtyp.php @@ -0,0 +1,78 @@ +load->model('ressource/raumtyp_model', 'RaumtypModel'); + // Load set the uid of the model to let to check the permissions + $this->RaumtypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getRaumtyp() + { + $raumtypID = $this->get('raumtyp_id'); + + if(isset($raumtypID)) + { + $result = $this->RaumtypModel->load($raumtypID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postRaumtyp() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['raumtyp_id'])) + { + $result = $this->RaumtypModel->update($this->post()['raumtyp_id'], $this->post()); + } + else + { + $result = $this->RaumtypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($raumtyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Reservierung.php b/application/controllers/api/v1/ressource/Reservierung.php new file mode 100644 index 000000000..61d88d8e4 --- /dev/null +++ b/application/controllers/api/v1/ressource/Reservierung.php @@ -0,0 +1,78 @@ +load->model('ressource/reservierung_model', 'ReservierungModel'); + // Load set the uid of the model to let to check the permissions + $this->ReservierungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getReservierung() + { + $reservierungID = $this->get('reservierung_id'); + + if(isset($reservierungID)) + { + $result = $this->ReservierungModel->load($reservierungID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postReservierung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['reservierung_id'])) + { + $result = $this->ReservierungModel->update($this->post()['reservierung_id'], $this->post()); + } + else + { + $result = $this->ReservierungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($reservierung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Resturlaub.php b/application/controllers/api/v1/ressource/Resturlaub.php new file mode 100644 index 000000000..9e43ee92f --- /dev/null +++ b/application/controllers/api/v1/ressource/Resturlaub.php @@ -0,0 +1,78 @@ +load->model('ressource/resturlaub_model', 'ResturlaubModel'); + // Load set the uid of the model to let to check the permissions + $this->ResturlaubModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getResturlaub() + { + $resturlaubID = $this->get('resturlaub_id'); + + if(isset($resturlaubID)) + { + $result = $this->ResturlaubModel->load($resturlaubID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postResturlaub() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['resturlaub_id'])) + { + $result = $this->ResturlaubModel->update($this->post()['resturlaub_id'], $this->post()); + } + else + { + $result = $this->ResturlaubModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($resturlaub = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Stunde.php b/application/controllers/api/v1/ressource/Stunde.php new file mode 100644 index 000000000..18b503fe9 --- /dev/null +++ b/application/controllers/api/v1/ressource/Stunde.php @@ -0,0 +1,78 @@ +load->model('ressource/stunde_model', 'StundeModel'); + // Load set the uid of the model to let to check the permissions + $this->StundeModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStunde() + { + $stundeID = $this->get('stunde_id'); + + if(isset($stundeID)) + { + $result = $this->StundeModel->load($stundeID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStunde() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['stunde_id'])) + { + $result = $this->StundeModel->update($this->post()['stunde_id'], $this->post()); + } + else + { + $result = $this->StundeModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($stunde = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Stundenplan.php b/application/controllers/api/v1/ressource/Stundenplan.php new file mode 100644 index 000000000..5e780be00 --- /dev/null +++ b/application/controllers/api/v1/ressource/Stundenplan.php @@ -0,0 +1,78 @@ +load->model('ressource/stundenplan_model', 'StundenplanModel'); + // Load set the uid of the model to let to check the permissions + $this->StundenplanModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStundenplan() + { + $stundenplanID = $this->get('stundenplan_id'); + + if(isset($stundenplanID)) + { + $result = $this->StundenplanModel->load($stundenplanID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStundenplan() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['stundenplan_id'])) + { + $result = $this->StundenplanModel->update($this->post()['stundenplan_id'], $this->post()); + } + else + { + $result = $this->StundenplanModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($stundenplan = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Stundenplandev.php b/application/controllers/api/v1/ressource/Stundenplandev.php new file mode 100644 index 000000000..146369fdc --- /dev/null +++ b/application/controllers/api/v1/ressource/Stundenplandev.php @@ -0,0 +1,78 @@ +load->model('ressource/stundenplandev_model', 'StundenplandevModel'); + // Load set the uid of the model to let to check the permissions + $this->StundenplandevModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStundenplandev() + { + $stundenplandevID = $this->get('stundenplandev_id'); + + if(isset($stundenplandevID)) + { + $result = $this->StundenplandevModel->load($stundenplandevID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStundenplandev() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['stundenplandev_id'])) + { + $result = $this->StundenplandevModel->update($this->post()['stundenplandev_id'], $this->post()); + } + else + { + $result = $this->StundenplandevModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($stundenplandev = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Zeitaufzeichnung.php b/application/controllers/api/v1/ressource/Zeitaufzeichnung.php new file mode 100644 index 000000000..fd74027da --- /dev/null +++ b/application/controllers/api/v1/ressource/Zeitaufzeichnung.php @@ -0,0 +1,78 @@ +load->model('ressource/zeitaufzeichnung_model', 'ZeitaufzeichnungModel'); + // Load set the uid of the model to let to check the permissions + $this->ZeitaufzeichnungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getZeitaufzeichnung() + { + $zeitaufzeichnungID = $this->get('zeitaufzeichnung_id'); + + if(isset($zeitaufzeichnungID)) + { + $result = $this->ZeitaufzeichnungModel->load($zeitaufzeichnungID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postZeitaufzeichnung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['zeitaufzeichnung_id'])) + { + $result = $this->ZeitaufzeichnungModel->update($this->post()['zeitaufzeichnung_id'], $this->post()); + } + else + { + $result = $this->ZeitaufzeichnungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($zeitaufzeichnung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Zeitfenster.php b/application/controllers/api/v1/ressource/Zeitfenster.php new file mode 100644 index 000000000..60933098d --- /dev/null +++ b/application/controllers/api/v1/ressource/Zeitfenster.php @@ -0,0 +1,78 @@ +load->model('ressource/zeitfenster_model', 'ZeitfensterModel'); + // Load set the uid of the model to let to check the permissions + $this->ZeitfensterModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getZeitfenster() + { + $zeitfensterID = $this->get('zeitfenster_id'); + + if(isset($zeitfensterID)) + { + $result = $this->ZeitfensterModel->load($zeitfensterID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postZeitfenster() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['zeitfenster_id'])) + { + $result = $this->ZeitfensterModel->update($this->post()['zeitfenster_id'], $this->post()); + } + else + { + $result = $this->ZeitfensterModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($zeitfenster = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Zeitsperre.php b/application/controllers/api/v1/ressource/Zeitsperre.php new file mode 100644 index 000000000..3310fd394 --- /dev/null +++ b/application/controllers/api/v1/ressource/Zeitsperre.php @@ -0,0 +1,78 @@ +load->model('ressource/zeitsperre_model', 'ZeitsperreModel'); + // Load set the uid of the model to let to check the permissions + $this->ZeitsperreModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getZeitsperre() + { + $zeitsperreID = $this->get('zeitsperre_id'); + + if(isset($zeitsperreID)) + { + $result = $this->ZeitsperreModel->load($zeitsperreID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postZeitsperre() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['zeitsperre_id'])) + { + $result = $this->ZeitsperreModel->update($this->post()['zeitsperre_id'], $this->post()); + } + else + { + $result = $this->ZeitsperreModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($zeitsperre = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Zeitsperretyp.php b/application/controllers/api/v1/ressource/Zeitsperretyp.php new file mode 100644 index 000000000..1476c6286 --- /dev/null +++ b/application/controllers/api/v1/ressource/Zeitsperretyp.php @@ -0,0 +1,78 @@ +load->model('ressource/zeitsperretyp_model', 'ZeitsperretypModel'); + // Load set the uid of the model to let to check the permissions + $this->ZeitsperretypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getZeitsperretyp() + { + $zeitsperretypID = $this->get('zeitsperretyp_id'); + + if(isset($zeitsperretypID)) + { + $result = $this->ZeitsperretypModel->load($zeitsperretypID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postZeitsperretyp() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['zeitsperretyp_id'])) + { + $result = $this->ZeitsperretypModel->update($this->post()['zeitsperretyp_id'], $this->post()); + } + else + { + $result = $this->ZeitsperretypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($zeitsperretyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Zeitwunsch.php b/application/controllers/api/v1/ressource/Zeitwunsch.php new file mode 100644 index 000000000..be1e03894 --- /dev/null +++ b/application/controllers/api/v1/ressource/Zeitwunsch.php @@ -0,0 +1,78 @@ +load->model('ressource/zeitwunsch_model', 'ZeitwunschModel'); + // Load set the uid of the model to let to check the permissions + $this->ZeitwunschModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getZeitwunsch() + { + $zeitwunschID = $this->get('zeitwunsch_id'); + + if(isset($zeitwunschID)) + { + $result = $this->ZeitwunschModel->load($zeitwunschID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postZeitwunsch() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['zeitwunsch_id'])) + { + $result = $this->ZeitwunschModel->update($this->post()['zeitwunsch_id'], $this->post()); + } + else + { + $result = $this->ZeitwunschModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($zeitwunsch = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Appdaten.php b/application/controllers/api/v1/system/Appdaten.php new file mode 100644 index 000000000..2d5adb28f --- /dev/null +++ b/application/controllers/api/v1/system/Appdaten.php @@ -0,0 +1,78 @@ +load->model('system/appdaten_model', 'AppdatenModel'); + // Load set the uid of the model to let to check the permissions + $this->AppdatenModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAppdaten() + { + $appdatenID = $this->get('appdaten_id'); + + if(isset($appdatenID)) + { + $result = $this->AppdatenModel->load($appdatenID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAppdaten() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['appdaten_id'])) + { + $result = $this->AppdatenModel->update($this->post()['appdaten_id'], $this->post()); + } + else + { + $result = $this->AppdatenModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($appdaten = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Benutzerrolle.php b/application/controllers/api/v1/system/Benutzerrolle.php new file mode 100644 index 000000000..74f754c39 --- /dev/null +++ b/application/controllers/api/v1/system/Benutzerrolle.php @@ -0,0 +1,78 @@ +load->model('system/benutzerrolle_model', 'BenutzerrolleModel'); + // Load set the uid of the model to let to check the permissions + $this->BenutzerrolleModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBenutzerrolle() + { + $benutzerrolleID = $this->get('benutzerrolle_id'); + + if(isset($benutzerrolleID)) + { + $result = $this->BenutzerrolleModel->load($benutzerrolleID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBenutzerrolle() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['benutzerrolle_id'])) + { + $result = $this->BenutzerrolleModel->update($this->post()['benutzerrolle_id'], $this->post()); + } + else + { + $result = $this->BenutzerrolleModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($benutzerrolle = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Berechtigung.php b/application/controllers/api/v1/system/Berechtigung.php new file mode 100644 index 000000000..00839ba76 --- /dev/null +++ b/application/controllers/api/v1/system/Berechtigung.php @@ -0,0 +1,78 @@ +load->model('system/berechtigung_model', 'BerechtigungModel'); + // Load set the uid of the model to let to check the permissions + $this->BerechtigungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBerechtigung() + { + $berechtigungID = $this->get('berechtigung_id'); + + if(isset($berechtigungID)) + { + $result = $this->BerechtigungModel->load($berechtigungID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBerechtigung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['berechtigung_id'])) + { + $result = $this->BerechtigungModel->update($this->post()['berechtigung_id'], $this->post()); + } + else + { + $result = $this->BerechtigungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($berechtigung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Cronjob.php b/application/controllers/api/v1/system/Cronjob.php new file mode 100644 index 000000000..ef2b36374 --- /dev/null +++ b/application/controllers/api/v1/system/Cronjob.php @@ -0,0 +1,78 @@ +load->model('system/cronjob_model', 'CronjobModel'); + // Load set the uid of the model to let to check the permissions + $this->CronjobModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getCronjob() + { + $cronjobID = $this->get('cronjob_id'); + + if(isset($cronjobID)) + { + $result = $this->CronjobModel->load($cronjobID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postCronjob() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['cronjob_id'])) + { + $result = $this->CronjobModel->update($this->post()['cronjob_id'], $this->post()); + } + else + { + $result = $this->CronjobModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($cronjob = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Filter.php b/application/controllers/api/v1/system/Filter.php new file mode 100644 index 000000000..742287c34 --- /dev/null +++ b/application/controllers/api/v1/system/Filter.php @@ -0,0 +1,78 @@ +load->model('system/filter_model', 'FilterModel'); + // Load set the uid of the model to let to check the permissions + $this->FilterModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getFilter() + { + $filterID = $this->get('filter_id'); + + if(isset($filterID)) + { + $result = $this->FilterModel->load($filterID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postFilter() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['filter_id'])) + { + $result = $this->FilterModel->update($this->post()['filter_id'], $this->post()); + } + else + { + $result = $this->FilterModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($filter = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Log.php b/application/controllers/api/v1/system/Log.php new file mode 100644 index 000000000..ccdaaba88 --- /dev/null +++ b/application/controllers/api/v1/system/Log.php @@ -0,0 +1,78 @@ +load->model('system/log_model', 'LogModel'); + // Load set the uid of the model to let to check the permissions + $this->LogModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getLog() + { + $logID = $this->get('log_id'); + + if(isset($logID)) + { + $result = $this->LogModel->load($logID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postLog() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['log_id'])) + { + $result = $this->LogModel->update($this->post()['log_id'], $this->post()); + } + else + { + $result = $this->LogModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($log = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Message.php b/application/controllers/api/v1/system/Message.php new file mode 100644 index 000000000..2639d65fd --- /dev/null +++ b/application/controllers/api/v1/system/Message.php @@ -0,0 +1,78 @@ +load->model('system/message_model', 'MessageModel'); + // Load set the uid of the model to let to check the permissions + $this->MessageModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getMessage() + { + $messageID = $this->get('message_id'); + + if(isset($messageID)) + { + $result = $this->MessageModel->load($messageID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postMessage() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['message_id'])) + { + $result = $this->MessageModel->update($this->post()['message_id'], $this->post()); + } + else + { + $result = $this->MessageModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($message = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Rolle.php b/application/controllers/api/v1/system/Rolle.php new file mode 100644 index 000000000..6bc0f8214 --- /dev/null +++ b/application/controllers/api/v1/system/Rolle.php @@ -0,0 +1,78 @@ +load->model('system/rolle_model', 'RolleModel'); + // Load set the uid of the model to let to check the permissions + $this->RolleModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getRolle() + { + $rolleID = $this->get('rolle_id'); + + if(isset($rolleID)) + { + $result = $this->RolleModel->load($rolleID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postRolle() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['rolle_id'])) + { + $result = $this->RolleModel->update($this->post()['rolle_id'], $this->post()); + } + else + { + $result = $this->RolleModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($rolle = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Rolleberechtigung.php b/application/controllers/api/v1/system/Rolleberechtigung.php new file mode 100644 index 000000000..1fe55d507 --- /dev/null +++ b/application/controllers/api/v1/system/Rolleberechtigung.php @@ -0,0 +1,78 @@ +load->model('system/rolleberechtigung_model', 'RolleberechtigungModel'); + // Load set the uid of the model to let to check the permissions + $this->RolleberechtigungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getRolleberechtigung() + { + $rolleberechtigungID = $this->get('rolleberechtigung_id'); + + if(isset($rolleberechtigungID)) + { + $result = $this->RolleberechtigungModel->load($rolleberechtigungID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postRolleberechtigung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['rolleberechtigung_id'])) + { + $result = $this->RolleberechtigungModel->update($this->post()['rolleberechtigung_id'], $this->post()); + } + else + { + $result = $this->RolleberechtigungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($rolleberechtigung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Server.php b/application/controllers/api/v1/system/Server.php new file mode 100644 index 000000000..8d6733088 --- /dev/null +++ b/application/controllers/api/v1/system/Server.php @@ -0,0 +1,78 @@ +load->model('system/server_model', 'ServerModel'); + // Load set the uid of the model to let to check the permissions + $this->ServerModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getServer() + { + $serverID = $this->get('server_id'); + + if(isset($serverID)) + { + $result = $this->ServerModel->load($serverID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postServer() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['server_id'])) + { + $result = $this->ServerModel->update($this->post()['server_id'], $this->post()); + } + else + { + $result = $this->ServerModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($server = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Sprache.php b/application/controllers/api/v1/system/Sprache.php new file mode 100644 index 000000000..8f4f5814a --- /dev/null +++ b/application/controllers/api/v1/system/Sprache.php @@ -0,0 +1,78 @@ +load->model('system/sprache_model', 'SpracheModel'); + // Load set the uid of the model to let to check the permissions + $this->SpracheModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getSprache() + { + $spracheID = $this->get('sprache_id'); + + if(isset($spracheID)) + { + $result = $this->SpracheModel->load($spracheID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postSprache() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['sprache_id'])) + { + $result = $this->SpracheModel->update($this->post()['sprache_id'], $this->post()); + } + else + { + $result = $this->SpracheModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($sprache = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Tag.php b/application/controllers/api/v1/system/Tag.php new file mode 100644 index 000000000..c82e35bc7 --- /dev/null +++ b/application/controllers/api/v1/system/Tag.php @@ -0,0 +1,78 @@ +load->model('system/tag_model', 'TagModel'); + // Load set the uid of the model to let to check the permissions + $this->TagModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getTag() + { + $tagID = $this->get('tag_id'); + + if(isset($tagID)) + { + $result = $this->TagModel->load($tagID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postTag() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['tag_id'])) + { + $result = $this->TagModel->update($this->post()['tag_id'], $this->post()); + } + else + { + $result = $this->TagModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($tag = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Thread.php b/application/controllers/api/v1/system/Thread.php new file mode 100644 index 000000000..69d2de94e --- /dev/null +++ b/application/controllers/api/v1/system/Thread.php @@ -0,0 +1,78 @@ +load->model('system/thread_model', 'ThreadModel'); + // Load set the uid of the model to let to check the permissions + $this->ThreadModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getThread() + { + $threadID = $this->get('thread_id'); + + if(isset($threadID)) + { + $result = $this->ThreadModel->load($threadID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postThread() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['thread_id'])) + { + $result = $this->ThreadModel->update($this->post()['thread_id'], $this->post()); + } + else + { + $result = $this->ThreadModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($thread = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Variable.php b/application/controllers/api/v1/system/Variable.php new file mode 100644 index 000000000..9968d1557 --- /dev/null +++ b/application/controllers/api/v1/system/Variable.php @@ -0,0 +1,78 @@ +load->model('system/variable_model', 'VariableModel'); + // Load set the uid of the model to let to check the permissions + $this->VariableModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getVariable() + { + $variableID = $this->get('variable_id'); + + if(isset($variableID)) + { + $result = $this->VariableModel->load($variableID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postVariable() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['variable_id'])) + { + $result = $this->VariableModel->update($this->post()['variable_id'], $this->post()); + } + else + { + $result = $this->VariableModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($variable = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Vorlage.php b/application/controllers/api/v1/system/Vorlage.php new file mode 100644 index 000000000..016d112b0 --- /dev/null +++ b/application/controllers/api/v1/system/Vorlage.php @@ -0,0 +1,78 @@ +load->model('system/vorlage_model', 'VorlageModel'); + // Load set the uid of the model to let to check the permissions + $this->VorlageModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getVorlage() + { + $vorlageID = $this->get('vorlage_id'); + + if(isset($vorlageID)) + { + $result = $this->VorlageModel->load($vorlageID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postVorlage() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['vorlage_id'])) + { + $result = $this->VorlageModel->update($this->post()['vorlage_id'], $this->post()); + } + else + { + $result = $this->VorlageModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($vorlage = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Vorlagestudiengang.php b/application/controllers/api/v1/system/Vorlagestudiengang.php new file mode 100644 index 000000000..f40e560d7 --- /dev/null +++ b/application/controllers/api/v1/system/Vorlagestudiengang.php @@ -0,0 +1,78 @@ +load->model('system/vorlagestudiengang_model', 'VorlagestudiengangModel'); + // Load set the uid of the model to let to check the permissions + $this->VorlagestudiengangModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getVorlagestudiengang() + { + $vorlagestudiengangID = $this->get('vorlagestudiengang_id'); + + if(isset($vorlagestudiengangID)) + { + $result = $this->VorlagestudiengangModel->load($vorlagestudiengangID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postVorlagestudiengang() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['vorlagestudiengang_id'])) + { + $result = $this->VorlagestudiengangModel->update($this->post()['vorlagestudiengang_id'], $this->post()); + } + else + { + $result = $this->VorlagestudiengangModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($vorlagestudiengang = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Webservicelog.php b/application/controllers/api/v1/system/Webservicelog.php new file mode 100644 index 000000000..510b76f60 --- /dev/null +++ b/application/controllers/api/v1/system/Webservicelog.php @@ -0,0 +1,78 @@ +load->model('system/webservicelog_model', 'WebservicelogModel'); + // Load set the uid of the model to let to check the permissions + $this->WebservicelogModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getWebservicelog() + { + $webservicelogID = $this->get('webservicelog_id'); + + if(isset($webservicelogID)) + { + $result = $this->WebservicelogModel->load($webservicelogID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postWebservicelog() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['webservicelog_id'])) + { + $result = $this->WebservicelogModel->update($this->post()['webservicelog_id'], $this->post()); + } + else + { + $result = $this->WebservicelogModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($webservicelog = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Webservicerecht.php b/application/controllers/api/v1/system/Webservicerecht.php new file mode 100644 index 000000000..fadda83ea --- /dev/null +++ b/application/controllers/api/v1/system/Webservicerecht.php @@ -0,0 +1,78 @@ +load->model('system/webservicerecht_model', 'WebservicerechtModel'); + // Load set the uid of the model to let to check the permissions + $this->WebservicerechtModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getWebservicerecht() + { + $webservicerechtID = $this->get('webservicerecht_id'); + + if(isset($webservicerechtID)) + { + $result = $this->WebservicerechtModel->load($webservicerechtID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postWebservicerecht() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['webservicerecht_id'])) + { + $result = $this->WebservicerechtModel->update($this->post()['webservicerecht_id'], $this->post()); + } + else + { + $result = $this->WebservicerechtModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($webservicerecht = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Webservicetyp.php b/application/controllers/api/v1/system/Webservicetyp.php new file mode 100644 index 000000000..05e169504 --- /dev/null +++ b/application/controllers/api/v1/system/Webservicetyp.php @@ -0,0 +1,78 @@ +load->model('system/webservicetyp_model', 'WebservicetypModel'); + // Load set the uid of the model to let to check the permissions + $this->WebservicetypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getWebservicetyp() + { + $webservicetypID = $this->get('webservicetyp_id'); + + if(isset($webservicetypID)) + { + $result = $this->WebservicetypModel->load($webservicetypID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postWebservicetyp() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['webservicetyp_id'])) + { + $result = $this->WebservicetypModel->update($this->post()['webservicetyp_id'], $this->post()); + } + else + { + $result = $this->WebservicetypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($webservicetyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/message_old.php b/application/controllers/api/v1/system/message_old.php new file mode 100644 index 000000000..2a9c25dd5 --- /dev/null +++ b/application/controllers/api/v1/system/message_old.php @@ -0,0 +1,78 @@ +load->model('system/message_old_model', 'message_oldModel'); + // Load set the uid of the model to let to check the permissions + $this->message_oldModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getmessage_old() + { + $message_oldID = $this->get('message_old_id'); + + if(isset($message_oldID)) + { + $result = $this->message_oldModel->load($message_oldID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postmessage_old() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['message_old_id'])) + { + $result = $this->message_oldModel->update($this->post()['message_old_id'], $this->post()); + } + else + { + $result = $this->message_oldModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($message_old = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/testtool/Ablauf.php b/application/controllers/api/v1/testtool/Ablauf.php new file mode 100644 index 000000000..9394e8bd5 --- /dev/null +++ b/application/controllers/api/v1/testtool/Ablauf.php @@ -0,0 +1,78 @@ +load->model('testtool/ablauf_model', 'AblaufModel'); + // Load set the uid of the model to let to check the permissions + $this->AblaufModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAblauf() + { + $ablaufID = $this->get('ablauf_id'); + + if(isset($ablaufID)) + { + $result = $this->AblaufModel->load($ablaufID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAblauf() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['ablauf_id'])) + { + $result = $this->AblaufModel->update($this->post()['ablauf_id'], $this->post()); + } + else + { + $result = $this->AblaufModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($ablauf = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/testtool/Antwort.php b/application/controllers/api/v1/testtool/Antwort.php new file mode 100644 index 000000000..cf8b30e25 --- /dev/null +++ b/application/controllers/api/v1/testtool/Antwort.php @@ -0,0 +1,78 @@ +load->model('testtool/antwort_model', 'AntwortModel'); + // Load set the uid of the model to let to check the permissions + $this->AntwortModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAntwort() + { + $antwortID = $this->get('antwort_id'); + + if(isset($antwortID)) + { + $result = $this->AntwortModel->load($antwortID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAntwort() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['antwort_id'])) + { + $result = $this->AntwortModel->update($this->post()['antwort_id'], $this->post()); + } + else + { + $result = $this->AntwortModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($antwort = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/testtool/Frage.php b/application/controllers/api/v1/testtool/Frage.php new file mode 100644 index 000000000..dcfe353fd --- /dev/null +++ b/application/controllers/api/v1/testtool/Frage.php @@ -0,0 +1,78 @@ +load->model('testtool/frage_model', 'FrageModel'); + // Load set the uid of the model to let to check the permissions + $this->FrageModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getFrage() + { + $frageID = $this->get('frage_id'); + + if(isset($frageID)) + { + $result = $this->FrageModel->load($frageID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postFrage() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['frage_id'])) + { + $result = $this->FrageModel->update($this->post()['frage_id'], $this->post()); + } + else + { + $result = $this->FrageModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($frage = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/testtool/Gebiet.php b/application/controllers/api/v1/testtool/Gebiet.php new file mode 100644 index 000000000..9f8f2b8dd --- /dev/null +++ b/application/controllers/api/v1/testtool/Gebiet.php @@ -0,0 +1,78 @@ +load->model('testtool/gebiet_model', 'GebietModel'); + // Load set the uid of the model to let to check the permissions + $this->GebietModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getGebiet() + { + $gebietID = $this->get('gebiet_id'); + + if(isset($gebietID)) + { + $result = $this->GebietModel->load($gebietID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postGebiet() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['gebiet_id'])) + { + $result = $this->GebietModel->update($this->post()['gebiet_id'], $this->post()); + } + else + { + $result = $this->GebietModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($gebiet = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/testtool/Kategorie.php b/application/controllers/api/v1/testtool/Kategorie.php new file mode 100644 index 000000000..afabe9937 --- /dev/null +++ b/application/controllers/api/v1/testtool/Kategorie.php @@ -0,0 +1,78 @@ +load->model('testtool/kategorie_model', 'KategorieModel'); + // Load set the uid of the model to let to check the permissions + $this->KategorieModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getKategorie() + { + $kategorieID = $this->get('kategorie_id'); + + if(isset($kategorieID)) + { + $result = $this->KategorieModel->load($kategorieID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postKategorie() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['kategorie_id'])) + { + $result = $this->KategorieModel->update($this->post()['kategorie_id'], $this->post()); + } + else + { + $result = $this->KategorieModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($kategorie = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/testtool/Kriterien.php b/application/controllers/api/v1/testtool/Kriterien.php new file mode 100644 index 000000000..357bcec1c --- /dev/null +++ b/application/controllers/api/v1/testtool/Kriterien.php @@ -0,0 +1,78 @@ +load->model('testtool/kriterien_model', 'KriterienModel'); + // Load set the uid of the model to let to check the permissions + $this->KriterienModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getKriterien() + { + $kriterienID = $this->get('kriterien_id'); + + if(isset($kriterienID)) + { + $result = $this->KriterienModel->load($kriterienID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postKriterien() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['kriterien_id'])) + { + $result = $this->KriterienModel->update($this->post()['kriterien_id'], $this->post()); + } + else + { + $result = $this->KriterienModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($kriterien = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/testtool/Pruefling.php b/application/controllers/api/v1/testtool/Pruefling.php new file mode 100644 index 000000000..edf4a3c41 --- /dev/null +++ b/application/controllers/api/v1/testtool/Pruefling.php @@ -0,0 +1,78 @@ +load->model('testtool/pruefling_model', 'PrueflingModel'); + // Load set the uid of the model to let to check the permissions + $this->PrueflingModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getPruefling() + { + $prueflingID = $this->get('pruefling_id'); + + if(isset($prueflingID)) + { + $result = $this->PrueflingModel->load($prueflingID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postPruefling() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['pruefling_id'])) + { + $result = $this->PrueflingModel->update($this->post()['pruefling_id'], $this->post()); + } + else + { + $result = $this->PrueflingModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($pruefling = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/testtool/Vorschlag.php b/application/controllers/api/v1/testtool/Vorschlag.php new file mode 100644 index 000000000..aa2b219fb --- /dev/null +++ b/application/controllers/api/v1/testtool/Vorschlag.php @@ -0,0 +1,78 @@ +load->model('testtool/vorschlag_model', 'VorschlagModel'); + // Load set the uid of the model to let to check the permissions + $this->VorschlagModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getVorschlag() + { + $vorschlagID = $this->get('vorschlag_id'); + + if(isset($vorschlagID)) + { + $result = $this->VorschlagModel->load($vorschlagID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postVorschlag() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['vorschlag_id'])) + { + $result = $this->VorschlagModel->update($this->post()['vorschlag_id'], $this->post()); + } + else + { + $result = $this->VorschlagModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($vorschlag = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/include/dms.class.php b/include/dms.class.php index 5a49f323d..f8fb930e6 100644 --- a/include/dms.class.php +++ b/include/dms.class.php @@ -24,7 +24,13 @@ */ require_once(dirname(__FILE__).'/basis_db.class.php'); -class dms extends basis_db +require_once(dirname(__FILE__).'/datum.class.php'); + +// CI +require_once(dirname(__FILE__).'/../ci_hack.php'); +require_once(dirname(__FILE__).'/../application/models/content/Dms_model.php'); + +class dms extends Dms_model { public $new; public $result=array(); From 5d7d79b086413f7234b6f243772a1625ee75c20f Mon Sep 17 00:00:00 2001 From: paolo Date: Wed, 18 May 2016 11:24:10 +0200 Subject: [PATCH 14/31] - Renamed every controller that has conflicts with class name - Added routes to renamed controllers - Fixed controllers parameters in get method --- application/config/routes.php | 7 ++++++- .../controllers/api/v1/accounting/Bestelldetailtag.php | 7 ++++--- .../controllers/api/v1/accounting/Bestellungtag.php | 7 ++++--- application/controllers/api/v1/accounting/Budget.php | 7 ++++--- application/controllers/api/v1/codex/Bisfunktion.php | 7 ++++--- .../controllers/api/v1/codex/Entwicklungsteam.php | 7 ++++--- application/controllers/api/v1/codex/Zgvgruppe.php | 6 +++--- application/controllers/api/v1/content/Contentgruppe.php | 7 ++++--- .../controllers/api/v1/crm/Dokumentprestudent.php | 7 ++++--- .../controllers/api/v1/crm/Dokumentstudiengang.php | 7 ++++--- .../controllers/api/v1/crm/Preinteressentstudiengang.php | 7 ++++--- application/controllers/api/v1/crm/Prestudentstatus.php | 9 ++++++--- .../organisation/{Fachbereich.php => Fachbereich2.php} | 8 ++++---- application/controllers/api/v1/organisation/Ferien.php | 7 ++++--- .../{Geschaeftsjahr.php => Geschaeftsjahr2.php} | 8 ++++---- .../controllers/api/v1/organisation/Lehrverband.php | 9 ++++++--- ...rganisationseinheit.php => Organisationseinheit2.php} | 8 ++++---- .../controllers/api/v1/organisation/Semesterwochen.php | 7 ++++--- application/controllers/api/v1/person/Benutzergruppe.php | 7 ++++--- ...etriebsmittelperson.php => Betriebsmittelperson2.php} | 2 +- application/controllers/api/v1/ressource/Firmatag.php | 7 ++++--- application/controllers/api/v1/ressource/Ortraumtyp.php | 7 ++++--- application/controllers/api/v1/ressource/Zeitfenster.php | 9 ++++++--- application/controllers/api/v1/ressource/Zeitwunsch.php | 8 +++++--- .../controllers/api/v1/system/Rolleberechtigung.php | 7 ++++--- application/controllers/api/v1/system/Server.php | 6 +++--- .../api/v1/system/{Sprache.php => Sprache2.php} | 8 ++++---- application/controllers/api/v1/system/Variable.php | 7 ++++--- application/models/codex/Zgvgruppe_model.php | 2 +- application/models/system/Server_model.php | 4 ++-- 30 files changed, 119 insertions(+), 87 deletions(-) rename application/controllers/api/v1/organisation/{Fachbereich.php => Fachbereich2.php} (87%) rename application/controllers/api/v1/organisation/{Geschaeftsjahr.php => Geschaeftsjahr2.php} (86%) rename application/controllers/api/v1/organisation/{Organisationseinheit.php => Organisationseinheit2.php} (86%) rename application/controllers/api/v1/ressource/{Betriebsmittelperson.php => Betriebsmittelperson2.php} (96%) rename application/controllers/api/v1/system/{Sprache.php => Sprache2.php} (89%) diff --git a/application/config/routes.php b/application/config/routes.php index 0bdb099c2..6fe4b5076 100755 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -54,4 +54,9 @@ $route['404_override'] = ''; $route['translate_uri_dashes'] = FALSE; // Class name conflicts -$route['api/v1/organisation/studiengang/(:any)'] = 'api/v1/organisation/studiengang2/$1'; \ No newline at end of file +$route['api/v1/organisation/studiengang/(:any)'] = 'api/v1/organisation/studiengang2/$1'; +$route['api/v1/ressource/betriebsmittelperson/(:any)'] = 'api/v1/ressource/betriebsmittelperson2/$1'; +$route['api/v1/organisation/fachbereich/(:any)'] = 'api/v1/organisation/fachbereich2/$1'; +$route['api/v1/organisation/geschaeftsjahr/(:any)'] = 'api/v1/organisation/geschaeftsjahr2/$1'; +$route['api/v1/organisation/organisationseinheit/(:any)'] = 'api/v1/organisation/organisationseinheit2/$1'; +$route['api/v1/system/sprache/(:any)'] = 'api/v1/system/sprache2/$1'; \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Bestelldetailtag.php b/application/controllers/api/v1/accounting/Bestelldetailtag.php index ff268324d..84209c58c 100644 --- a/application/controllers/api/v1/accounting/Bestelldetailtag.php +++ b/application/controllers/api/v1/accounting/Bestelldetailtag.php @@ -33,11 +33,12 @@ class Bestelldetailtag extends APIv1_Controller */ public function getBestelldetailtag() { - $bestelldetailtagID = $this->get('bestelldetailtag_id'); + $bestelldetail_id = $this->get('bestelldetail_id'); + $tag = $this->get('tag'); - if(isset($bestelldetailtagID)) + if(isset($bestelldetail_id) && isset($tag)) { - $result = $this->BestelldetailtagModel->load($bestelldetailtagID); + $result = $this->BestelldetailtagModel->load(array($bestelldetail_id, $tag)); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/controllers/api/v1/accounting/Bestellungtag.php b/application/controllers/api/v1/accounting/Bestellungtag.php index d803e538c..69aae5b69 100644 --- a/application/controllers/api/v1/accounting/Bestellungtag.php +++ b/application/controllers/api/v1/accounting/Bestellungtag.php @@ -33,11 +33,12 @@ class Bestellungtag extends APIv1_Controller */ public function getBestellungtag() { - $bestellungtagID = $this->get('bestellungtag_id'); + $bestellung_id = $this->get('bestellung_id'); + $tag = $this->get('tag'); - if(isset($bestellungtagID)) + if(isset($bestellung_id) && isset($tag)) { - $result = $this->BestellungtagModel->load($bestellungtagID); + $result = $this->BestellungtagModel->load(array($bestellung_id, $tag)); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/controllers/api/v1/accounting/Budget.php b/application/controllers/api/v1/accounting/Budget.php index 3b89afbff..4cbd9bf1e 100644 --- a/application/controllers/api/v1/accounting/Budget.php +++ b/application/controllers/api/v1/accounting/Budget.php @@ -33,11 +33,12 @@ class Budget extends APIv1_Controller */ public function getBudget() { - $budgetID = $this->get('budget_id'); + $kostenstelle_id = $this->get('kostenstelle_id'); + $geschaeftsjahr_kurzbz = $this->get('geschaeftsjahr_kurzbz'); - if(isset($budgetID)) + if(isset($kostenstelle_id) && isset($geschaeftsjahr_kurzbz)) { - $result = $this->BudgetModel->load($budgetID); + $result = $this->BudgetModel->load(array($kostenstelle_id, $geschaeftsjahr_kurzbz)); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/controllers/api/v1/codex/Bisfunktion.php b/application/controllers/api/v1/codex/Bisfunktion.php index b0d90eb7e..a87015063 100644 --- a/application/controllers/api/v1/codex/Bisfunktion.php +++ b/application/controllers/api/v1/codex/Bisfunktion.php @@ -33,11 +33,12 @@ class Bisfunktion extends APIv1_Controller */ public function getBisfunktion() { - $bisfunktionID = $this->get('bisfunktion_id'); + $studiengang_kz = $this->get('studiengang_kz'); + $bisverwendung_id = $this->get('bisverwendung_id'); - if(isset($bisfunktionID)) + if(isset($studiengang_kz) && isset($bisverwendung_id)) { - $result = $this->BisfunktionModel->load($bisfunktionID); + $result = $this->BisfunktionModel->load(array($studiengang_kz, $bisverwendung_id)); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/controllers/api/v1/codex/Entwicklungsteam.php b/application/controllers/api/v1/codex/Entwicklungsteam.php index 8f9912ec4..2f4f1e054 100644 --- a/application/controllers/api/v1/codex/Entwicklungsteam.php +++ b/application/controllers/api/v1/codex/Entwicklungsteam.php @@ -33,11 +33,12 @@ class Entwicklungsteam extends APIv1_Controller */ public function getEntwicklungsteam() { - $entwicklungsteamID = $this->get('entwicklungsteam_id'); + $studiengang_kz = $this->get('studiengang_kz'); + $mitarbeiter_uid = $this->get('mitarbeiter_uid'); - if(isset($entwicklungsteamID)) + if(isset($studiengang_kz) && isset($mitarbeiter_uid)) { - $result = $this->EntwicklungsteamModel->load($entwicklungsteamID); + $result = $this->EntwicklungsteamModel->load(array($studiengang_kz, $mitarbeiter_uid)); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/controllers/api/v1/codex/Zgvgruppe.php b/application/controllers/api/v1/codex/Zgvgruppe.php index ac07691c1..21314cf82 100644 --- a/application/controllers/api/v1/codex/Zgvgruppe.php +++ b/application/controllers/api/v1/codex/Zgvgruppe.php @@ -33,11 +33,11 @@ class Zgvgruppe extends APIv1_Controller */ public function getZgvgruppe() { - $zgvgruppeID = $this->get('zgvgruppe_id'); + $gruppe_kurzbz = $this->get('gruppe_kurzbz'); - if(isset($zgvgruppeID)) + if(isset($gruppe_kurzbz)) { - $result = $this->ZgvgruppeModel->load($zgvgruppeID); + $result = $this->ZgvgruppeModel->load($gruppe_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/controllers/api/v1/content/Contentgruppe.php b/application/controllers/api/v1/content/Contentgruppe.php index 2421d7144..a2ab09d7f 100644 --- a/application/controllers/api/v1/content/Contentgruppe.php +++ b/application/controllers/api/v1/content/Contentgruppe.php @@ -33,11 +33,12 @@ class Contentgruppe extends APIv1_Controller */ public function getContentgruppe() { - $contentgruppeID = $this->get('contentgruppe_id'); + $gruppe_kurzbz = $this->get('gruppe_kurzbz'); + $content_id = $this->get('content_id'); - if(isset($contentgruppeID)) + if(isset($gruppe_kurzbz) && isset($content_id)) { - $result = $this->ContentgruppeModel->load($contentgruppeID); + $result = $this->ContentgruppeModel->load(array($gruppe_kurzbz, $content_id)); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/controllers/api/v1/crm/Dokumentprestudent.php b/application/controllers/api/v1/crm/Dokumentprestudent.php index ff7a1f228..4335d148a 100644 --- a/application/controllers/api/v1/crm/Dokumentprestudent.php +++ b/application/controllers/api/v1/crm/Dokumentprestudent.php @@ -33,11 +33,12 @@ class Dokumentprestudent extends APIv1_Controller */ public function getDokumentprestudent() { - $dokumentprestudentID = $this->get('dokumentprestudent_id'); + $prestudent_id = $this->get('prestudent_id'); + $dokument_kurzbz = $this->get('dokument_kurzbz'); - if(isset($dokumentprestudentID)) + if(isset($prestudent_id) && isset($dokument_kurzbz)) { - $result = $this->DokumentprestudentModel->load($dokumentprestudentID); + $result = $this->DokumentprestudentModel->load(array($prestudent_id, $dokument_kurzbz)); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/controllers/api/v1/crm/Dokumentstudiengang.php b/application/controllers/api/v1/crm/Dokumentstudiengang.php index 2006198b9..1b79793a9 100644 --- a/application/controllers/api/v1/crm/Dokumentstudiengang.php +++ b/application/controllers/api/v1/crm/Dokumentstudiengang.php @@ -33,11 +33,12 @@ class Dokumentstudiengang extends APIv1_Controller */ public function getDokumentstudiengang() { - $dokumentstudiengangID = $this->get('dokumentstudiengang_id'); + $studiengang_kz = $this->get('studiengang_kz'); + $dokument_kurzbz = $this->get('dokument_kurzbz'); - if(isset($dokumentstudiengangID)) + if(isset($studiengang_kz) && isset($dokument_kurzbz)) { - $result = $this->DokumentstudiengangModel->load($dokumentstudiengangID); + $result = $this->DokumentstudiengangModel->load(array($studiengang_kz, $dokument_kurzbz)); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/controllers/api/v1/crm/Preinteressentstudiengang.php b/application/controllers/api/v1/crm/Preinteressentstudiengang.php index f89dad7d4..851d9fc24 100644 --- a/application/controllers/api/v1/crm/Preinteressentstudiengang.php +++ b/application/controllers/api/v1/crm/Preinteressentstudiengang.php @@ -33,11 +33,12 @@ class Preinteressentstudiengang extends APIv1_Controller */ public function getPreinteressentstudiengang() { - $preinteressentstudiengangID = $this->get('preinteressentstudiengang_id'); + $preinteressent_id = $this->get('preinteressent_id'); + $studiengang_kz = $this->get('studiengang_kz'); - if(isset($preinteressentstudiengangID)) + if(isset($preinteressent_id) && isset($studiengang_kz)) { - $result = $this->PreinteressentstudiengangModel->load($preinteressentstudiengangID); + $result = $this->PreinteressentstudiengangModel->load(array($preinteressent_id, $studiengang_kz)); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/controllers/api/v1/crm/Prestudentstatus.php b/application/controllers/api/v1/crm/Prestudentstatus.php index d1032d36e..e4e0930c3 100644 --- a/application/controllers/api/v1/crm/Prestudentstatus.php +++ b/application/controllers/api/v1/crm/Prestudentstatus.php @@ -33,11 +33,14 @@ class Prestudentstatus extends APIv1_Controller */ public function getPrestudentstatus() { - $prestudentstatusID = $this->get('prestudentstatus_id'); + $ausbildungssemester = $this->get('ausbildungssemester'); + $studiensemester_kurzbz = $this->get('studiensemester_kurzbz'); + $status_kurzbz = $this->get('status_kurzbz'); + $prestudent_id = $this->get('prestudent_id'); - if(isset($prestudentstatusID)) + if(isset($ausbildungssemester) && isset($studiensemester_kurzbz) && isset($status_kurzbz) && isset($prestudent_id)) { - $result = $this->PrestudentstatusModel->load($prestudentstatusID); + $result = $this->PrestudentstatusModel->load(array($ausbildungssemester, $studiensemester_kurzbz, $status_kurzbz, $prestudent_id)); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/controllers/api/v1/organisation/Fachbereich.php b/application/controllers/api/v1/organisation/Fachbereich2.php similarity index 87% rename from application/controllers/api/v1/organisation/Fachbereich.php rename to application/controllers/api/v1/organisation/Fachbereich2.php index 7a6008b31..a39d3dc93 100644 --- a/application/controllers/api/v1/organisation/Fachbereich.php +++ b/application/controllers/api/v1/organisation/Fachbereich2.php @@ -14,7 +14,7 @@ if(!defined('BASEPATH')) exit('No direct script access allowed'); -class Fachbereich extends APIv1_Controller +class Fachbereich2 extends APIv1_Controller { /** * Fachbereich API constructor. @@ -33,11 +33,11 @@ class Fachbereich extends APIv1_Controller */ public function getFachbereich() { - $fachbereichID = $this->get('fachbereich_id'); + $fachbereich_kurzbz = $this->get('fachbereich_kurzbz'); - if(isset($fachbereichID)) + if(isset($fachbereich_kurzbz)) { - $result = $this->FachbereichModel->load($fachbereichID); + $result = $this->FachbereichModel->load($fachbereich_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/controllers/api/v1/organisation/Ferien.php b/application/controllers/api/v1/organisation/Ferien.php index 55ba26f66..a5e02a4ee 100644 --- a/application/controllers/api/v1/organisation/Ferien.php +++ b/application/controllers/api/v1/organisation/Ferien.php @@ -33,11 +33,12 @@ class Ferien extends APIv1_Controller */ public function getFerien() { - $ferienID = $this->get('ferien_id'); + $studiengang_kz = $this->get('studiengang_kz'); + $bezeichnung = $this->get('bezeichnung'); - if(isset($ferienID)) + if(isset($studiengang_kz) && isset($bezeichnung)) { - $result = $this->FerienModel->load($ferienID); + $result = $this->FerienModel->load(array($studiengang_kz, $bezeichnung)); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/controllers/api/v1/organisation/Geschaeftsjahr.php b/application/controllers/api/v1/organisation/Geschaeftsjahr2.php similarity index 86% rename from application/controllers/api/v1/organisation/Geschaeftsjahr.php rename to application/controllers/api/v1/organisation/Geschaeftsjahr2.php index 2b12cb87b..64e9b76bb 100644 --- a/application/controllers/api/v1/organisation/Geschaeftsjahr.php +++ b/application/controllers/api/v1/organisation/Geschaeftsjahr2.php @@ -14,7 +14,7 @@ if(!defined('BASEPATH')) exit('No direct script access allowed'); -class Geschaeftsjahr extends APIv1_Controller +class Geschaeftsjahr2 extends APIv1_Controller { /** * Geschaeftsjahr API constructor. @@ -33,11 +33,11 @@ class Geschaeftsjahr extends APIv1_Controller */ public function getGeschaeftsjahr() { - $geschaeftsjahrID = $this->get('geschaeftsjahr_id'); + $geschaeftsjahr_kurzbz = $this->get('geschaeftsjahr_kurzbz'); - if(isset($geschaeftsjahrID)) + if(isset($geschaeftsjahr_kurzbz)) { - $result = $this->GeschaeftsjahrModel->load($geschaeftsjahrID); + $result = $this->GeschaeftsjahrModel->load($geschaeftsjahr_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/controllers/api/v1/organisation/Lehrverband.php b/application/controllers/api/v1/organisation/Lehrverband.php index 2a249ac1e..8e2143934 100644 --- a/application/controllers/api/v1/organisation/Lehrverband.php +++ b/application/controllers/api/v1/organisation/Lehrverband.php @@ -33,11 +33,14 @@ class Lehrverband extends APIv1_Controller */ public function getLehrverband() { - $lehrverbandID = $this->get('lehrverband_id'); + $gruppe = $this->get('gruppe'); + $verband = $this->get('verband'); + $semester = $this->get('semester'); + $studiengang_kz = $this->get('studiengang_kz'); - if(isset($lehrverbandID)) + if(isset($gruppe) && isset($verband) && isset($semester) && isset($studiengang_kz)) { - $result = $this->LehrverbandModel->load($lehrverbandID); + $result = $this->LehrverbandModel->load(array($gruppe, $verband, $semester, $studiengang_kz)); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/controllers/api/v1/organisation/Organisationseinheit.php b/application/controllers/api/v1/organisation/Organisationseinheit2.php similarity index 86% rename from application/controllers/api/v1/organisation/Organisationseinheit.php rename to application/controllers/api/v1/organisation/Organisationseinheit2.php index 217ce7990..3cbe5ff51 100644 --- a/application/controllers/api/v1/organisation/Organisationseinheit.php +++ b/application/controllers/api/v1/organisation/Organisationseinheit2.php @@ -14,7 +14,7 @@ if(!defined('BASEPATH')) exit('No direct script access allowed'); -class Organisationseinheit extends APIv1_Controller +class Organisationseinheit2 extends APIv1_Controller { /** * Organisationseinheit API constructor. @@ -33,11 +33,11 @@ class Organisationseinheit extends APIv1_Controller */ public function getOrganisationseinheit() { - $organisationseinheitID = $this->get('organisationseinheit_id'); + $oe_kurzbz = $this->get('oe_kurzbz'); - if(isset($organisationseinheitID)) + if(isset($oe_kurzbz)) { - $result = $this->OrganisationseinheitModel->load($organisationseinheitID); + $result = $this->OrganisationseinheitModel->load($oe_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/controllers/api/v1/organisation/Semesterwochen.php b/application/controllers/api/v1/organisation/Semesterwochen.php index c1530ac7c..6980510bd 100644 --- a/application/controllers/api/v1/organisation/Semesterwochen.php +++ b/application/controllers/api/v1/organisation/Semesterwochen.php @@ -33,11 +33,12 @@ class Semesterwochen extends APIv1_Controller */ public function getSemesterwochen() { - $semesterwochenID = $this->get('semesterwochen_id'); + $studiengang_kz = $this->get('studiengang_kz'); + $semester = $this->get('semester'); - if(isset($semesterwochenID)) + if(isset($studiengang_kz) && isset($semester)) { - $result = $this->SemesterwochenModel->load($semesterwochenID); + $result = $this->SemesterwochenModel->load(array($studiengang_kz, $semester)); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/controllers/api/v1/person/Benutzergruppe.php b/application/controllers/api/v1/person/Benutzergruppe.php index b2817766e..bc32d5648 100644 --- a/application/controllers/api/v1/person/Benutzergruppe.php +++ b/application/controllers/api/v1/person/Benutzergruppe.php @@ -33,11 +33,12 @@ class Benutzergruppe extends APIv1_Controller */ public function getBenutzergruppe() { - $benutzergruppeID = $this->get('benutzergruppe_id'); + $gruppe_kurzbz = $this->get('gruppe_kurzbz'); + $uid = $this->get('uid'); - if(isset($benutzergruppeID)) + if(isset($gruppe_kurzbz) && isset($uid)) { - $result = $this->BenutzergruppeModel->load($benutzergruppeID); + $result = $this->BenutzergruppeModel->load(array($gruppe_kurzbz, $uid)); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/controllers/api/v1/ressource/Betriebsmittelperson.php b/application/controllers/api/v1/ressource/Betriebsmittelperson2.php similarity index 96% rename from application/controllers/api/v1/ressource/Betriebsmittelperson.php rename to application/controllers/api/v1/ressource/Betriebsmittelperson2.php index a097e0247..25c1c75a9 100644 --- a/application/controllers/api/v1/ressource/Betriebsmittelperson.php +++ b/application/controllers/api/v1/ressource/Betriebsmittelperson2.php @@ -14,7 +14,7 @@ if(!defined('BASEPATH')) exit('No direct script access allowed'); -class Betriebsmittelperson extends APIv1_Controller +class Betriebsmittelperson2 extends APIv1_Controller { /** * Betriebsmittelperson API constructor. diff --git a/application/controllers/api/v1/ressource/Firmatag.php b/application/controllers/api/v1/ressource/Firmatag.php index 5115ba465..01bf864b9 100644 --- a/application/controllers/api/v1/ressource/Firmatag.php +++ b/application/controllers/api/v1/ressource/Firmatag.php @@ -33,11 +33,12 @@ class Firmatag extends APIv1_Controller */ public function getFirmatag() { - $firmatagID = $this->get('firmatag_id'); + $tag = $this->get('tag'); + $firma_id = $this->get('firma_id'); - if(isset($firmatagID)) + if(isset($tag) && isset($firma_id)) { - $result = $this->FirmatagModel->load($firmatagID); + $result = $this->FirmatagModel->load(array($tag, $firma_id)); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/controllers/api/v1/ressource/Ortraumtyp.php b/application/controllers/api/v1/ressource/Ortraumtyp.php index 817249ea1..20f4ccc93 100644 --- a/application/controllers/api/v1/ressource/Ortraumtyp.php +++ b/application/controllers/api/v1/ressource/Ortraumtyp.php @@ -33,11 +33,12 @@ class Ortraumtyp extends APIv1_Controller */ public function getOrtraumtyp() { - $ortraumtypID = $this->get('ortraumtyp_id'); + $hierarchie = $this->get('hierarchie'); + $ort_kurzbz = $this->get('ort_kurzbz'); - if(isset($ortraumtypID)) + if(isset($hierarchie) && isset($ort_kurzbz)) { - $result = $this->OrtraumtypModel->load($ortraumtypID); + $result = $this->OrtraumtypModel->load(array($hierarchie, $ort_kurzbz)); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/controllers/api/v1/ressource/Zeitfenster.php b/application/controllers/api/v1/ressource/Zeitfenster.php index 60933098d..d57ba5083 100644 --- a/application/controllers/api/v1/ressource/Zeitfenster.php +++ b/application/controllers/api/v1/ressource/Zeitfenster.php @@ -33,11 +33,14 @@ class Zeitfenster extends APIv1_Controller */ public function getZeitfenster() { - $zeitfensterID = $this->get('zeitfenster_id'); + $wochentag = $this->get('wochentag'); + $studiengang_kz = $this->get('studiengang_kz'); + $ort_kurzbz = $this->get('ort_kurzbz'); + $stunde = $this->get('stunde'); - if(isset($zeitfensterID)) + if(isset($wochentag) && isset($studiengang_kz) && isset($ort_kurzbz) && isset($stunde)) { - $result = $this->ZeitfensterModel->load($zeitfensterID); + $result = $this->ZeitfensterModel->load(array($wochentag, $studiengang_kz, $ort_kurzbz, $stunde)); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/controllers/api/v1/ressource/Zeitwunsch.php b/application/controllers/api/v1/ressource/Zeitwunsch.php index be1e03894..71aa1f95d 100644 --- a/application/controllers/api/v1/ressource/Zeitwunsch.php +++ b/application/controllers/api/v1/ressource/Zeitwunsch.php @@ -33,11 +33,13 @@ class Zeitwunsch extends APIv1_Controller */ public function getZeitwunsch() { - $zeitwunschID = $this->get('zeitwunsch_id'); + $tag = $this->get('tag'); + $mitarbeiter_uid = $this->get('mitarbeiter_uid'); + $stunde = $this->get('stunde'); - if(isset($zeitwunschID)) + if(isset($tag) && isset($mitarbeiter_uid) && isset($stunde)) { - $result = $this->ZeitwunschModel->load($zeitwunschID); + $result = $this->ZeitwunschModel->load(array($tag, $mitarbeiter_uid, $stunde)); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/controllers/api/v1/system/Rolleberechtigung.php b/application/controllers/api/v1/system/Rolleberechtigung.php index 1fe55d507..6148ce460 100644 --- a/application/controllers/api/v1/system/Rolleberechtigung.php +++ b/application/controllers/api/v1/system/Rolleberechtigung.php @@ -33,11 +33,12 @@ class Rolleberechtigung extends APIv1_Controller */ public function getRolleberechtigung() { - $rolleberechtigungID = $this->get('rolleberechtigung_id'); + $rolle_kurzbz = $this->get('rolle_kurzbz'); + $berechtigung_kurzbz = $this->get('berechtigung_kurzbz'); - if(isset($rolleberechtigungID)) + if(isset($rolle_kurzbz) && isset($berechtigung_kurzbz)) { - $result = $this->RolleberechtigungModel->load($rolleberechtigungID); + $result = $this->RolleberechtigungModel->load(array($rolle_kurzbz, $berechtigung_kurzbz)); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/controllers/api/v1/system/Server.php b/application/controllers/api/v1/system/Server.php index 8d6733088..bd621245c 100644 --- a/application/controllers/api/v1/system/Server.php +++ b/application/controllers/api/v1/system/Server.php @@ -33,11 +33,11 @@ class Server extends APIv1_Controller */ public function getServer() { - $serverID = $this->get('server_id'); + $server_kurzbz = $this->get('server_kurzbz'); - if(isset($serverID)) + if(isset($server_kurzbz)) { - $result = $this->ServerModel->load($serverID); + $result = $this->ServerModel->load($server_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/controllers/api/v1/system/Sprache.php b/application/controllers/api/v1/system/Sprache2.php similarity index 89% rename from application/controllers/api/v1/system/Sprache.php rename to application/controllers/api/v1/system/Sprache2.php index 8f4f5814a..e7c5de1ce 100644 --- a/application/controllers/api/v1/system/Sprache.php +++ b/application/controllers/api/v1/system/Sprache2.php @@ -14,7 +14,7 @@ if(!defined('BASEPATH')) exit('No direct script access allowed'); -class Sprache extends APIv1_Controller +class Sprache2 extends APIv1_Controller { /** * Sprache API constructor. @@ -33,11 +33,11 @@ class Sprache extends APIv1_Controller */ public function getSprache() { - $spracheID = $this->get('sprache_id'); + $sprache = $this->get('sprache'); - if(isset($spracheID)) + if(isset($sprache)) { - $result = $this->SpracheModel->load($spracheID); + $result = $this->SpracheModel->load($sprache); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/controllers/api/v1/system/Variable.php b/application/controllers/api/v1/system/Variable.php index 9968d1557..58d74488d 100644 --- a/application/controllers/api/v1/system/Variable.php +++ b/application/controllers/api/v1/system/Variable.php @@ -33,11 +33,12 @@ class Variable extends APIv1_Controller */ public function getVariable() { - $variableID = $this->get('variable_id'); + $uid = $this->get('uid'); + $name = $this->get('name'); - if(isset($variableID)) + if(isset($uid) && isset($name)) { - $result = $this->VariableModel->load($variableID); + $result = $this->VariableModel->load(array($uid, $name)); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/models/codex/Zgvgruppe_model.php b/application/models/codex/Zgvgruppe_model.php index 1b8cb2a69..69da70271 100644 --- a/application/models/codex/Zgvgruppe_model.php +++ b/application/models/codex/Zgvgruppe_model.php @@ -8,6 +8,6 @@ class Zgvgruppe_model extends DB_Model { parent::__construct(); $this->dbTable = 'bis.tbl_zgvgruppe'; - $this->pk = ''; + $this->pk = 'gruppe_kurzbz'; } } \ No newline at end of file diff --git a/application/models/system/Server_model.php b/application/models/system/Server_model.php index 69fc16095..4521e1fd4 100644 --- a/application/models/system/Server_model.php +++ b/application/models/system/Server_model.php @@ -9,6 +9,6 @@ class Server_model extends DB_Model { parent::__construct(); $this->dbTable = 'system.tbl_server'; - $this->pk = ''; + $this->pk = 'server_kurzbz'; } -} +} \ No newline at end of file From a95d1f634b517a881a0358045bd1bdc861b30cc8 Mon Sep 17 00:00:00 2001 From: paolo Date: Wed, 18 May 2016 12:03:07 +0200 Subject: [PATCH 15/31] Fixed permission for lehre.vw_studienplan --- application/config/fhcomplete.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/application/config/fhcomplete.php b/application/config/fhcomplete.php index b26fb4769..47867d517 100644 --- a/application/config/fhcomplete.php +++ b/application/config/fhcomplete.php @@ -224,6 +224,8 @@ $config['fhc_acl'] = array 'wawi.tbl_rechnungstyp' => 'basis/rechnungstyp', 'wawi.tbl_zahlungstyp' => 'basis/zahlungstyp', + 'lehre.vw_studienplan' => 'basis/studienplan', + 'public.tbl_sprache' => 'admin', 'public.tbl_msg_thread' => 'admin', 'public.tbl_msg_message' => 'admin' From e88da56dd7f83c651a49d46104dba7afcc783cc6 Mon Sep 17 00:00:00 2001 From: paolo Date: Wed, 18 May 2016 15:26:37 +0200 Subject: [PATCH 16/31] Added method PreinteressentByPersonID to Preinteressent controller --- .../controllers/api/v1/crm/Preinteressent.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/application/controllers/api/v1/crm/Preinteressent.php b/application/controllers/api/v1/crm/Preinteressent.php index fbfa6bb94..aaac2b3e2 100644 --- a/application/controllers/api/v1/crm/Preinteressent.php +++ b/application/controllers/api/v1/crm/Preinteressent.php @@ -46,6 +46,25 @@ class Preinteressent extends APIv1_Controller $this->response(); } } + + /** + * @return void + */ + public function getPreinteressentByPersonID() + { + $person_id = $this->get('person_id'); + + if(isset($person_id)) + { + $result = $this->PreinteressentModel->load(array('person_id' => $person_id)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } /** * @return void From 674e8323920c525e68ae8576be10b8a001423260 Mon Sep 17 00:00:00 2001 From: paolo Date: Wed, 18 May 2016 16:09:47 +0200 Subject: [PATCH 17/31] disContinuous disIntegration --- tests/codeception/_data/dump.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/codeception/_data/dump.sql b/tests/codeception/_data/dump.sql index 62deaa687..5ce901a00 100644 --- a/tests/codeception/_data/dump.sql +++ b/tests/codeception/_data/dump.sql @@ -1,5 +1,5 @@ -- UPDATE tbl_studiengang -UPDATE public.tbl_studiengang SET onlinebewerbung = TRUE; +UPDATE tbl_studiengang SET onlinebewerbung = TRUE; -- EMPTY lehre.tbl_studienplan DELETE FROM lehre.tbl_studienplan; From 32acc8a414e833f5cdee6a4d37ffda4527ba153b Mon Sep 17 00:00:00 2001 From: paolo Date: Thu, 19 May 2016 15:51:15 +0200 Subject: [PATCH 18/31] Fixed controllers parameters names and number --- .../api/v1/accounting/Bestellstatus.php | 10 +++---- .../api/v1/accounting/Buchungstyp.php | 10 +++---- .../controllers/api/v1/accounting/Budget.php | 4 +-- .../api/v1/accounting/Rechnungstyp.php | 10 +++---- .../api/v1/accounting/Vertragsstatus.php | 10 +++---- .../api/v1/accounting/Vertragstyp.php | 10 +++---- .../api/v1/accounting/Zahlungstyp.php | 10 +++---- .../api/v1/codex/Aufmerksamdurch.php | 10 +++---- .../controllers/api/v1/codex/Ausbildung.php | 10 +++---- .../api/v1/codex/Berufstaetigkeit.php | 10 +++---- .../api/v1/codex/Beschaeftigungsausmass.php | 10 +++---- .../controllers/api/v1/codex/Besqual.php | 10 +++---- .../controllers/api/v1/codex/Bisfunktion.php | 4 +-- .../controllers/api/v1/codex/Bisorgform.php | 10 +++---- .../api/v1/codex/Entwicklungsteam.php | 4 +-- .../controllers/api/v1/codex/Hauptberuf.php | 10 +++---- .../controllers/api/v1/codex/Lehrform.php | 10 +++---- .../controllers/api/v1/codex/Lgartcode.php | 10 +++---- .../api/v1/codex/Mobilitaetsprogramm.php | 10 +++---- application/controllers/api/v1/codex/Note.php | 10 +++---- .../controllers/api/v1/codex/Orgform.php | 10 +++---- .../controllers/api/v1/codex/Verwendung.php | 10 +++---- application/controllers/api/v1/codex/Zgv.php | 10 +++---- .../controllers/api/v1/codex/Zgvdoktor.php | 10 +++---- .../controllers/api/v1/codex/Zgvmaster.php | 10 +++---- .../controllers/api/v1/codex/Zweck.php | 10 +++---- .../api/v1/content/Contentgruppe.php | 4 +-- .../controllers/api/v1/content/Dms.php | 29 +++++++++++++++++++ .../controllers/api/v1/content/Template.php | 10 +++---- .../v1/content/Veranstaltungskategorie.php | 10 +++---- .../api/v1/crm/Aufnahmeschluessel.php | 10 +++---- .../api/v1/crm/Aufnahmetermintyp.php | 10 +++---- .../controllers/api/v1/crm/Buchungstyp.php | 10 +++---- .../controllers/api/v1/crm/Dokument.php | 10 +++---- .../api/v1/crm/Dokumentprestudent.php | 4 +-- .../api/v1/crm/Dokumentstudiengang.php | 4 +-- application/controllers/api/v1/crm/Konto.php | 10 +++---- .../api/v1/crm/Preinteressentstudiengang.php | 4 +-- .../api/v1/crm/Prestudentstatus.php | 11 +++++-- application/controllers/api/v1/crm/Status.php | 10 +++---- .../api/v1/organisation/Erhalter.php | 10 +++---- .../api/v1/organisation/Ferien.php | 4 +-- .../api/v1/organisation/Gruppe.php | 10 +++---- .../api/v1/organisation/Lehrverband.php | 11 +++++-- .../organisation/Organisationseinheittyp.php | 10 +++---- .../api/v1/organisation/Semesterwochen.php | 4 +-- .../api/v1/organisation/Statistik.php | 10 +++---- .../api/v1/organisation/Studiengangstyp.php | 10 +++---- .../api/v1/organisation/Studienjahr.php | 10 +++---- .../v1/organisation/Studienordnungstatus.php | 10 +++---- .../api/v1/organisation/Studiensemester.php | 10 +++---- .../controllers/api/v1/person/Benutzer.php | 10 +++---- .../controllers/api/v1/person/Fotostatus.php | 10 +++---- .../controllers/api/v1/person/Freebusytyp.php | 10 +++---- .../api/v1/person/Kontaktmedium.php | 10 +++---- .../controllers/api/v1/person/Kontakttyp.php | 10 +++---- .../controllers/api/v1/project/Aktivitaet.php | 10 +++---- .../api/v1/project/Aufwandstyp.php | 10 +++---- .../controllers/api/v1/project/Projekt.php | 10 +++---- .../controllers/api/v1/project/Scrumteam.php | 10 +++---- .../api/v1/ressource/Betriebsmittelstatus.php | 10 +++---- .../api/v1/ressource/Betriebsmitteltyp.php | 10 +++---- .../api/v1/ressource/Erreichbarkeit.php | 10 +++---- .../controllers/api/v1/ressource/Firmatag.php | 4 +-- .../api/v1/ressource/Firmentyp.php | 10 +++---- .../controllers/api/v1/ressource/Funktion.php | 10 +++---- .../api/v1/ressource/Lehrmittel.php | 10 +++---- .../api/v1/ressource/Mitarbeiter.php | 10 +++---- .../controllers/api/v1/ressource/Ort.php | 10 +++---- .../api/v1/ressource/Ortraumtyp.php | 4 +-- .../controllers/api/v1/ressource/Raumtyp.php | 10 +++---- .../controllers/api/v1/ressource/Stunde.php | 10 +++---- .../api/v1/ressource/Zeitfenster.php | 11 +++++-- .../api/v1/ressource/Zeitsperretyp.php | 10 +++---- .../api/v1/ressource/Zeitwunsch.php | 9 ++++-- .../api/v1/system/Berechtigung.php | 10 +++---- .../controllers/api/v1/system/Rolle.php | 10 +++---- .../api/v1/system/Rolleberechtigung.php | 4 +-- application/controllers/api/v1/system/Tag.php | 10 +++---- .../controllers/api/v1/system/Variable.php | 4 +-- .../controllers/api/v1/system/Vorlage.php | 10 +++---- .../api/v1/system/Webservicetyp.php | 10 +++---- .../controllers/api/v1/testtool/Kategorie.php | 10 +++---- tests/codeception/_data/dump.sql | 2 +- 84 files changed, 415 insertions(+), 360 deletions(-) diff --git a/application/controllers/api/v1/accounting/Bestellstatus.php b/application/controllers/api/v1/accounting/Bestellstatus.php index b9646ed2b..e5daa2bcc 100644 --- a/application/controllers/api/v1/accounting/Bestellstatus.php +++ b/application/controllers/api/v1/accounting/Bestellstatus.php @@ -33,11 +33,11 @@ class Bestellstatus extends APIv1_Controller */ public function getBestellstatus() { - $bestellstatusID = $this->get('bestellstatus_id'); + $bestellstatus_kurzbz = $this->get('bestellstatus_kurzbz'); - if(isset($bestellstatusID)) + if(isset($bestellstatus_kurzbz)) { - $result = $this->BestellstatusModel->load($bestellstatusID); + $result = $this->BestellstatusModel->load($bestellstatus_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Bestellstatus extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['bestellstatus_id'])) + if(isset($this->post()['bestellstatus_kurzbz'])) { - $result = $this->BestellstatusModel->update($this->post()['bestellstatus_id'], $this->post()); + $result = $this->BestellstatusModel->update($this->post()['bestellstatus_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/accounting/Buchungstyp.php b/application/controllers/api/v1/accounting/Buchungstyp.php index eee0ccfa0..470e14658 100644 --- a/application/controllers/api/v1/accounting/Buchungstyp.php +++ b/application/controllers/api/v1/accounting/Buchungstyp.php @@ -33,11 +33,11 @@ class Buchungstyp extends APIv1_Controller */ public function getBuchungstyp() { - $buchungstypID = $this->get('buchungstyp_id'); + $buchungstyp_kurzbz = $this->get('buchungstyp_kurzbz'); - if(isset($buchungstypID)) + if(isset($buchungstyp_kurzbz)) { - $result = $this->BuchungstypModel->load($buchungstypID); + $result = $this->BuchungstypModel->load($buchungstyp_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Buchungstyp extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['buchungstyp_id'])) + if(isset($this->post()['buchungstyp_kurzbz'])) { - $result = $this->BuchungstypModel->update($this->post()['buchungstyp_id'], $this->post()); + $result = $this->BuchungstypModel->update($this->post()['buchungstyp_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/accounting/Budget.php b/application/controllers/api/v1/accounting/Budget.php index 4cbd9bf1e..23074fd6e 100644 --- a/application/controllers/api/v1/accounting/Budget.php +++ b/application/controllers/api/v1/accounting/Budget.php @@ -55,9 +55,9 @@ class Budget extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['budget_id'])) + if(isset($this->post()['budget_id']) && isset($this->post()['geschaeftsjahr_kurzbz'])) { - $result = $this->BudgetModel->update($this->post()['budget_id'], $this->post()); + $result = $this->BudgetModel->update(array($this->post()['budget_id'], $this->post()['geschaeftsjahr_kurzbz']), $this->post()); } else { diff --git a/application/controllers/api/v1/accounting/Rechnungstyp.php b/application/controllers/api/v1/accounting/Rechnungstyp.php index deefa6243..e6bd28e2c 100644 --- a/application/controllers/api/v1/accounting/Rechnungstyp.php +++ b/application/controllers/api/v1/accounting/Rechnungstyp.php @@ -33,11 +33,11 @@ class Rechnungstyp extends APIv1_Controller */ public function getRechnungstyp() { - $rechnungstypID = $this->get('rechnungstyp_id'); + $rechnungstyp_kurzbz = $this->get('rechnungstyp_kurzbz'); - if(isset($rechnungstypID)) + if(isset($rechnungstyp_kurzbz)) { - $result = $this->RechnungstypModel->load($rechnungstypID); + $result = $this->RechnungstypModel->load($rechnungstyp_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Rechnungstyp extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['rechnungstyp_id'])) + if(isset($this->post()['rechnungstyp_kurzbz'])) { - $result = $this->RechnungstypModel->update($this->post()['rechnungstyp_id'], $this->post()); + $result = $this->RechnungstypModel->update($this->post()['rechnungstyp_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/accounting/Vertragsstatus.php b/application/controllers/api/v1/accounting/Vertragsstatus.php index d40a26a09..e288fadbb 100644 --- a/application/controllers/api/v1/accounting/Vertragsstatus.php +++ b/application/controllers/api/v1/accounting/Vertragsstatus.php @@ -33,11 +33,11 @@ class Vertragsstatus extends APIv1_Controller */ public function getVertragsstatus() { - $vertragsstatusID = $this->get('vertragsstatus_id'); + $vertragsstatus_kurzbz = $this->get('vertragsstatus_kurzbz'); - if(isset($vertragsstatusID)) + if(isset($vertragsstatus_kurzbz)) { - $result = $this->VertragsstatusModel->load($vertragsstatusID); + $result = $this->VertragsstatusModel->load($vertragsstatus_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Vertragsstatus extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['vertragsstatus_id'])) + if(isset($this->post()['vertragsstatus_kurzbz'])) { - $result = $this->VertragsstatusModel->update($this->post()['vertragsstatus_id'], $this->post()); + $result = $this->VertragsstatusModel->update($this->post()['vertragsstatus_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/accounting/Vertragstyp.php b/application/controllers/api/v1/accounting/Vertragstyp.php index 0052292bc..dfc3366c5 100644 --- a/application/controllers/api/v1/accounting/Vertragstyp.php +++ b/application/controllers/api/v1/accounting/Vertragstyp.php @@ -33,11 +33,11 @@ class Vertragstyp extends APIv1_Controller */ public function getVertragstyp() { - $vertragstypID = $this->get('vertragstyp_id'); + $vertragstyp_kurzbz = $this->get('vertragstyp_kurzbz'); - if(isset($vertragstypID)) + if(isset($vertragstyp_kurzbz)) { - $result = $this->VertragstypModel->load($vertragstypID); + $result = $this->VertragstypModel->load($vertragstyp_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Vertragstyp extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['vertragstyp_id'])) + if(isset($this->post()['vertragstyp_kurzbz'])) { - $result = $this->VertragstypModel->update($this->post()['vertragstyp_id'], $this->post()); + $result = $this->VertragstypModel->update($this->post()['vertragstyp_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/accounting/Zahlungstyp.php b/application/controllers/api/v1/accounting/Zahlungstyp.php index 86aa911df..bec1f7694 100644 --- a/application/controllers/api/v1/accounting/Zahlungstyp.php +++ b/application/controllers/api/v1/accounting/Zahlungstyp.php @@ -33,11 +33,11 @@ class Zahlungstyp extends APIv1_Controller */ public function getZahlungstyp() { - $zahlungstypID = $this->get('zahlungstyp_id'); + $zahlungstyp_kurzbz = $this->get('zahlungstyp_kurzbz'); - if(isset($zahlungstypID)) + if(isset($zahlungstyp_kurzbz)) { - $result = $this->ZahlungstypModel->load($zahlungstypID); + $result = $this->ZahlungstypModel->load($zahlungstyp_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Zahlungstyp extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['zahlungstyp_id'])) + if(isset($this->post()['zahlungstyp_kurzbz'])) { - $result = $this->ZahlungstypModel->update($this->post()['zahlungstyp_id'], $this->post()); + $result = $this->ZahlungstypModel->update($this->post()['zahlungstyp_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/codex/Aufmerksamdurch.php b/application/controllers/api/v1/codex/Aufmerksamdurch.php index 55c6b0b19..73aa1e4c3 100644 --- a/application/controllers/api/v1/codex/Aufmerksamdurch.php +++ b/application/controllers/api/v1/codex/Aufmerksamdurch.php @@ -33,11 +33,11 @@ class Aufmerksamdurch extends APIv1_Controller */ public function getAufmerksamdurch() { - $aufmerksamdurchID = $this->get('aufmerksamdurch_id'); + $aufmerksamdurch_kurzbz = $this->get('aufmerksamdurch_kurzbz'); - if(isset($aufmerksamdurchID)) + if(isset($aufmerksamdurch_kurzbz)) { - $result = $this->AufmerksamdurchModel->load($aufmerksamdurchID); + $result = $this->AufmerksamdurchModel->load($aufmerksamdurch_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Aufmerksamdurch extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['aufmerksamdurch_id'])) + if(isset($this->post()['aufmerksamdurch_kurzbz'])) { - $result = $this->AufmerksamdurchModel->update($this->post()['aufmerksamdurch_id'], $this->post()); + $result = $this->AufmerksamdurchModel->update($this->post()['aufmerksamdurch_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/codex/Ausbildung.php b/application/controllers/api/v1/codex/Ausbildung.php index a99468033..cf2387e9b 100644 --- a/application/controllers/api/v1/codex/Ausbildung.php +++ b/application/controllers/api/v1/codex/Ausbildung.php @@ -33,11 +33,11 @@ class Ausbildung extends APIv1_Controller */ public function getAusbildung() { - $ausbildungID = $this->get('ausbildung_id'); + $ausbildungcode = $this->get('ausbildungcode'); - if(isset($ausbildungID)) + if(isset($ausbildungcode)) { - $result = $this->AusbildungModel->load($ausbildungID); + $result = $this->AusbildungModel->load($ausbildungcode); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Ausbildung extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['ausbildung_id'])) + if(isset($this->post()['ausbildungcode'])) { - $result = $this->AusbildungModel->update($this->post()['ausbildung_id'], $this->post()); + $result = $this->AusbildungModel->update($this->post()['ausbildungcode'], $this->post()); } else { diff --git a/application/controllers/api/v1/codex/Berufstaetigkeit.php b/application/controllers/api/v1/codex/Berufstaetigkeit.php index 82355d130..20b357eda 100644 --- a/application/controllers/api/v1/codex/Berufstaetigkeit.php +++ b/application/controllers/api/v1/codex/Berufstaetigkeit.php @@ -33,11 +33,11 @@ class Berufstaetigkeit extends APIv1_Controller */ public function getBerufstaetigkeit() { - $berufstaetigkeitID = $this->get('berufstaetigkeit_id'); + $berufstaetigkeit_code = $this->get('berufstaetigkeit_code'); - if(isset($berufstaetigkeitID)) + if(isset($berufstaetigkeit_code)) { - $result = $this->BerufstaetigkeitModel->load($berufstaetigkeitID); + $result = $this->BerufstaetigkeitModel->load($berufstaetigkeit_code); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Berufstaetigkeit extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['berufstaetigkeit_id'])) + if(isset($this->post()['berufstaetigkeit_code'])) { - $result = $this->BerufstaetigkeitModel->update($this->post()['berufstaetigkeit_id'], $this->post()); + $result = $this->BerufstaetigkeitModel->update($this->post()['berufstaetigkeit_code'], $this->post()); } else { diff --git a/application/controllers/api/v1/codex/Beschaeftigungsausmass.php b/application/controllers/api/v1/codex/Beschaeftigungsausmass.php index 58c439eae..579ead6a5 100644 --- a/application/controllers/api/v1/codex/Beschaeftigungsausmass.php +++ b/application/controllers/api/v1/codex/Beschaeftigungsausmass.php @@ -33,11 +33,11 @@ class Beschaeftigungsausmass extends APIv1_Controller */ public function getBeschaeftigungsausmass() { - $beschaeftigungsausmassID = $this->get('beschaeftigungsausmass_id'); + $beschausmasscode = $this->get('beschausmasscode'); - if(isset($beschaeftigungsausmassID)) + if(isset($beschausmasscode)) { - $result = $this->BeschaeftigungsausmassModel->load($beschaeftigungsausmassID); + $result = $this->BeschaeftigungsausmassModel->load($beschausmasscode); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Beschaeftigungsausmass extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['beschaeftigungsausmass_id'])) + if(isset($this->post()['beschausmasscode'])) { - $result = $this->BeschaeftigungsausmassModel->update($this->post()['beschaeftigungsausmass_id'], $this->post()); + $result = $this->BeschaeftigungsausmassModel->update($this->post()['beschausmasscode'], $this->post()); } else { diff --git a/application/controllers/api/v1/codex/Besqual.php b/application/controllers/api/v1/codex/Besqual.php index 3c304ba7e..f5d4236fb 100644 --- a/application/controllers/api/v1/codex/Besqual.php +++ b/application/controllers/api/v1/codex/Besqual.php @@ -33,11 +33,11 @@ class Besqual extends APIv1_Controller */ public function getBesqual() { - $besqualID = $this->get('besqual_id'); + $besqualcode = $this->get('besqualcode'); - if(isset($besqualID)) + if(isset($besqualcode)) { - $result = $this->BesqualModel->load($besqualID); + $result = $this->BesqualModel->load($besqualcode); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Besqual extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['besqual_id'])) + if(isset($this->post()['besqualcode'])) { - $result = $this->BesqualModel->update($this->post()['besqual_id'], $this->post()); + $result = $this->BesqualModel->update($this->post()['besqualcode'], $this->post()); } else { diff --git a/application/controllers/api/v1/codex/Bisfunktion.php b/application/controllers/api/v1/codex/Bisfunktion.php index a87015063..37590547c 100644 --- a/application/controllers/api/v1/codex/Bisfunktion.php +++ b/application/controllers/api/v1/codex/Bisfunktion.php @@ -55,9 +55,9 @@ class Bisfunktion extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['bisfunktion_id'])) + if(isset($this->post()['studiengang_kz']) && isset($this->post()['bisverwendung_id'])) { - $result = $this->BisfunktionModel->update($this->post()['bisfunktion_id'], $this->post()); + $result = $this->BisfunktionModel->update(array($this->post()['studiengang_kz'], $this->post()['bisverwendung_id']), $this->post()); } else { diff --git a/application/controllers/api/v1/codex/Bisorgform.php b/application/controllers/api/v1/codex/Bisorgform.php index 07ee00c76..2fb9bab19 100644 --- a/application/controllers/api/v1/codex/Bisorgform.php +++ b/application/controllers/api/v1/codex/Bisorgform.php @@ -33,11 +33,11 @@ class Bisorgform extends APIv1_Controller */ public function getBisorgform() { - $bisorgformID = $this->get('bisorgform_id'); + $bisorgform_kurzbz = $this->get('bisorgform_kurzbz'); - if(isset($bisorgformID)) + if(isset($bisorgform_kurzbz)) { - $result = $this->BisorgformModel->load($bisorgformID); + $result = $this->BisorgformModel->load($bisorgform_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Bisorgform extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['bisorgform_id'])) + if(isset($this->post()['bisorgform_kurzbz'])) { - $result = $this->BisorgformModel->update($this->post()['bisorgform_id'], $this->post()); + $result = $this->BisorgformModel->update($this->post()['bisorgform_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/codex/Entwicklungsteam.php b/application/controllers/api/v1/codex/Entwicklungsteam.php index 2f4f1e054..31abdf3bc 100644 --- a/application/controllers/api/v1/codex/Entwicklungsteam.php +++ b/application/controllers/api/v1/codex/Entwicklungsteam.php @@ -55,9 +55,9 @@ class Entwicklungsteam extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['entwicklungsteam_id'])) + if(isset($this->post()['studiengang_kz']) && isset($this->post()['mitarbeiter_uid'])) { - $result = $this->EntwicklungsteamModel->update($this->post()['entwicklungsteam_id'], $this->post()); + $result = $this->EntwicklungsteamModel->update(array($this->post()['entwicklungsteam_id'], $this->post()['mitarbeiter_uid']), $this->post()); } else { diff --git a/application/controllers/api/v1/codex/Hauptberuf.php b/application/controllers/api/v1/codex/Hauptberuf.php index c7ace1644..313703604 100644 --- a/application/controllers/api/v1/codex/Hauptberuf.php +++ b/application/controllers/api/v1/codex/Hauptberuf.php @@ -33,11 +33,11 @@ class Hauptberuf extends APIv1_Controller */ public function getHauptberuf() { - $hauptberufID = $this->get('hauptberuf_id'); + $hauptberufcode = $this->get('hauptberufcode'); - if(isset($hauptberufID)) + if(isset($hauptberufcode)) { - $result = $this->HauptberufModel->load($hauptberufID); + $result = $this->HauptberufModel->load($hauptberufcode); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Hauptberuf extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['hauptberuf_id'])) + if(isset($this->post()['hauptberufcode'])) { - $result = $this->HauptberufModel->update($this->post()['hauptberuf_id'], $this->post()); + $result = $this->HauptberufModel->update($this->post()['hauptberufcode'], $this->post()); } else { diff --git a/application/controllers/api/v1/codex/Lehrform.php b/application/controllers/api/v1/codex/Lehrform.php index 4ea4c1aa7..71494c661 100644 --- a/application/controllers/api/v1/codex/Lehrform.php +++ b/application/controllers/api/v1/codex/Lehrform.php @@ -33,11 +33,11 @@ class Lehrform extends APIv1_Controller */ public function getLehrform() { - $lehrformID = $this->get('lehrform_id'); + $lehrform_kurzbz = $this->get('lehrform_kurzbz'); - if(isset($lehrformID)) + if(isset($lehrform_kurzbz)) { - $result = $this->LehrformModel->load($lehrformID); + $result = $this->LehrformModel->load($lehrform_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Lehrform extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['lehrform_id'])) + if(isset($this->post()['lehrform_kurzbz'])) { - $result = $this->LehrformModel->update($this->post()['lehrform_id'], $this->post()); + $result = $this->LehrformModel->update($this->post()['lehrform_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/codex/Lgartcode.php b/application/controllers/api/v1/codex/Lgartcode.php index 73f19743f..e7789dc65 100644 --- a/application/controllers/api/v1/codex/Lgartcode.php +++ b/application/controllers/api/v1/codex/Lgartcode.php @@ -33,11 +33,11 @@ class Lgartcode extends APIv1_Controller */ public function getLgartcode() { - $lgartcodeID = $this->get('lgartcode_id'); + $lgartcode = $this->get('lgartcode'); - if(isset($lgartcodeID)) + if(isset($lgartcode)) { - $result = $this->LgartcodeModel->load($lgartcodeID); + $result = $this->LgartcodeModel->load($lgartcode); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Lgartcode extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['lgartcode_id'])) + if(isset($this->post()['lgartcode'])) { - $result = $this->LgartcodeModel->update($this->post()['lgartcode_id'], $this->post()); + $result = $this->LgartcodeModel->update($this->post()['lgartcode'], $this->post()); } else { diff --git a/application/controllers/api/v1/codex/Mobilitaetsprogramm.php b/application/controllers/api/v1/codex/Mobilitaetsprogramm.php index 289f679de..a68062391 100644 --- a/application/controllers/api/v1/codex/Mobilitaetsprogramm.php +++ b/application/controllers/api/v1/codex/Mobilitaetsprogramm.php @@ -33,11 +33,11 @@ class Mobilitaetsprogramm extends APIv1_Controller */ public function getMobilitaetsprogramm() { - $mobilitaetsprogrammID = $this->get('mobilitaetsprogramm_id'); + $mobilitaetsprogramm_code = $this->get('mobilitaetsprogramm_code'); - if(isset($mobilitaetsprogrammID)) + if(isset($mobilitaetsprogramm_code)) { - $result = $this->MobilitaetsprogrammModel->load($mobilitaetsprogrammID); + $result = $this->MobilitaetsprogrammModel->load($mobilitaetsprogramm_code); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Mobilitaetsprogramm extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['mobilitaetsprogramm_id'])) + if(isset($this->post()['mobilitaetsprogramm_code'])) { - $result = $this->MobilitaetsprogrammModel->update($this->post()['mobilitaetsprogramm_id'], $this->post()); + $result = $this->MobilitaetsprogrammModel->update($this->post()['mobilitaetsprogramm_code'], $this->post()); } else { diff --git a/application/controllers/api/v1/codex/Note.php b/application/controllers/api/v1/codex/Note.php index 5a4ff9540..c44d695c9 100644 --- a/application/controllers/api/v1/codex/Note.php +++ b/application/controllers/api/v1/codex/Note.php @@ -33,11 +33,11 @@ class Note extends APIv1_Controller */ public function getNote() { - $noteID = $this->get('note_id'); + $note = $this->get('note'); - if(isset($noteID)) + if(isset($note)) { - $result = $this->NoteModel->load($noteID); + $result = $this->NoteModel->load($note); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Note extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['note_id'])) + if(isset($this->post()['note'])) { - $result = $this->NoteModel->update($this->post()['note_id'], $this->post()); + $result = $this->NoteModel->update($this->post()['note'], $this->post()); } else { diff --git a/application/controllers/api/v1/codex/Orgform.php b/application/controllers/api/v1/codex/Orgform.php index fc2041538..6834561c3 100644 --- a/application/controllers/api/v1/codex/Orgform.php +++ b/application/controllers/api/v1/codex/Orgform.php @@ -33,11 +33,11 @@ class Orgform extends APIv1_Controller */ public function getOrgform() { - $orgformID = $this->get('orgform_id'); + $orgform_kurzbz = $this->get('orgform_kurzbz'); - if(isset($orgformID)) + if(isset($orgform_kurzbz)) { - $result = $this->OrgformModel->load($orgformID); + $result = $this->OrgformModel->load($orgform_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Orgform extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['orgform_id'])) + if(isset($this->post()['orgform_kurzbz'])) { - $result = $this->OrgformModel->update($this->post()['orgform_id'], $this->post()); + $result = $this->OrgformModel->update($this->post()['orgform_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/codex/Verwendung.php b/application/controllers/api/v1/codex/Verwendung.php index 5f6f371b3..e697a5ecf 100644 --- a/application/controllers/api/v1/codex/Verwendung.php +++ b/application/controllers/api/v1/codex/Verwendung.php @@ -33,11 +33,11 @@ class Verwendung extends APIv1_Controller */ public function getVerwendung() { - $verwendungID = $this->get('verwendung_id'); + $verwendung_code = $this->get('verwendung_code'); - if(isset($verwendungID)) + if(isset($verwendung_code)) { - $result = $this->VerwendungModel->load($verwendungID); + $result = $this->VerwendungModel->load($verwendung_code); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Verwendung extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['verwendung_id'])) + if(isset($this->post()['verwendung_code'])) { - $result = $this->VerwendungModel->update($this->post()['verwendung_id'], $this->post()); + $result = $this->VerwendungModel->update($this->post()['verwendung_code'], $this->post()); } else { diff --git a/application/controllers/api/v1/codex/Zgv.php b/application/controllers/api/v1/codex/Zgv.php index c23508b06..2013e90cb 100644 --- a/application/controllers/api/v1/codex/Zgv.php +++ b/application/controllers/api/v1/codex/Zgv.php @@ -33,11 +33,11 @@ class Zgv extends APIv1_Controller */ public function getZgv() { - $zgvID = $this->get('zgv_id'); + $zgv_code = $this->get('zgv_code'); - if(isset($zgvID)) + if(isset($zgv_code)) { - $result = $this->ZgvModel->load($zgvID); + $result = $this->ZgvModel->load($zgv_code); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Zgv extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['zgv_id'])) + if(isset($this->post()['zgv_code'])) { - $result = $this->ZgvModel->update($this->post()['zgv_id'], $this->post()); + $result = $this->ZgvModel->update($this->post()['zgv_code'], $this->post()); } else { diff --git a/application/controllers/api/v1/codex/Zgvdoktor.php b/application/controllers/api/v1/codex/Zgvdoktor.php index 2e51460d5..3ac5ab3e3 100644 --- a/application/controllers/api/v1/codex/Zgvdoktor.php +++ b/application/controllers/api/v1/codex/Zgvdoktor.php @@ -33,11 +33,11 @@ class Zgvdoktor extends APIv1_Controller */ public function getZgvdoktor() { - $zgvdoktorID = $this->get('zgvdoktor_id'); + $zgvdoktor_code = $this->get('zgvdoktor_code'); - if(isset($zgvdoktorID)) + if(isset($zgvdoktor_code)) { - $result = $this->ZgvdoktorModel->load($zgvdoktorID); + $result = $this->ZgvdoktorModel->load($zgvdoktor_code); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Zgvdoktor extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['zgvdoktor_id'])) + if(isset($this->post()['zgvdoktor_code'])) { - $result = $this->ZgvdoktorModel->update($this->post()['zgvdoktor_id'], $this->post()); + $result = $this->ZgvdoktorModel->update($this->post()['zgvdoktor_code'], $this->post()); } else { diff --git a/application/controllers/api/v1/codex/Zgvmaster.php b/application/controllers/api/v1/codex/Zgvmaster.php index 49d56396b..5e431c3a1 100644 --- a/application/controllers/api/v1/codex/Zgvmaster.php +++ b/application/controllers/api/v1/codex/Zgvmaster.php @@ -33,11 +33,11 @@ class Zgvmaster extends APIv1_Controller */ public function getZgvmaster() { - $zgvmasterID = $this->get('zgvmaster_id'); + $zgvmas_code = $this->get('zgvmas_code'); - if(isset($zgvmasterID)) + if(isset($zgvmas_code)) { - $result = $this->ZgvmasterModel->load($zgvmasterID); + $result = $this->ZgvmasterModel->load($zgvmas_code); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Zgvmaster extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['zgvmaster_id'])) + if(isset($this->post()['zgvmas_code'])) { - $result = $this->ZgvmasterModel->update($this->post()['zgvmaster_id'], $this->post()); + $result = $this->ZgvmasterModel->update($this->post()['zgvmas_code'], $this->post()); } else { diff --git a/application/controllers/api/v1/codex/Zweck.php b/application/controllers/api/v1/codex/Zweck.php index d6163c400..d352540e4 100644 --- a/application/controllers/api/v1/codex/Zweck.php +++ b/application/controllers/api/v1/codex/Zweck.php @@ -33,11 +33,11 @@ class Zweck extends APIv1_Controller */ public function getZweck() { - $zweckID = $this->get('zweck_id'); + $zweck_code = $this->get('zweck_code'); - if(isset($zweckID)) + if(isset($zweck_code)) { - $result = $this->ZweckModel->load($zweckID); + $result = $this->ZweckModel->load($zweck_code); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Zweck extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['zweck_id'])) + if(isset($this->post()['zweck_code'])) { - $result = $this->ZweckModel->update($this->post()['zweck_id'], $this->post()); + $result = $this->ZweckModel->update($this->post()['zweck_code'], $this->post()); } else { diff --git a/application/controllers/api/v1/content/Contentgruppe.php b/application/controllers/api/v1/content/Contentgruppe.php index a2ab09d7f..c171c5f88 100644 --- a/application/controllers/api/v1/content/Contentgruppe.php +++ b/application/controllers/api/v1/content/Contentgruppe.php @@ -55,9 +55,9 @@ class Contentgruppe extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['contentgruppe_id'])) + if(isset($this->post()['gruppe_kurzbz']) && isset($this->post()['content_id'])) { - $result = $this->ContentgruppeModel->update($this->post()['contentgruppe_id'], $this->post()); + $result = $this->ContentgruppeModel->update(array($this->post()['gruppe_kurzbz'], $this->post()['content_id']), $this->post()); } else { diff --git a/application/controllers/api/v1/content/Dms.php b/application/controllers/api/v1/content/Dms.php index 36e48f892..87858b712 100644 --- a/application/controllers/api/v1/content/Dms.php +++ b/application/controllers/api/v1/content/Dms.php @@ -66,4 +66,33 @@ class Dms extends APIv1_Controller $this->response(); } } + + /** + * + */ + public function postDms() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['contentsprache_id'])) + { + $result = $this->ContentspracheModel->update($this->post()['contentsprache_id'], $this->post()); + } + else + { + $result = $this->ContentspracheModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($dms = NULL) + { + return true; + } } \ No newline at end of file diff --git a/application/controllers/api/v1/content/Template.php b/application/controllers/api/v1/content/Template.php index 73a6f4173..4d635db63 100644 --- a/application/controllers/api/v1/content/Template.php +++ b/application/controllers/api/v1/content/Template.php @@ -33,11 +33,11 @@ class Template extends APIv1_Controller */ public function getTemplate() { - $templateID = $this->get('template_id'); + $template_kurzbz = $this->get('template_kurzbz'); - if(isset($templateID)) + if(isset($template_kurzbz)) { - $result = $this->TemplateModel->load($templateID); + $result = $this->TemplateModel->load($template_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Template extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['template_id'])) + if(isset($this->post()['template_kurzbz'])) { - $result = $this->TemplateModel->update($this->post()['template_id'], $this->post()); + $result = $this->TemplateModel->update($this->post()['template_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/content/Veranstaltungskategorie.php b/application/controllers/api/v1/content/Veranstaltungskategorie.php index 999c60bb8..2832c6eba 100644 --- a/application/controllers/api/v1/content/Veranstaltungskategorie.php +++ b/application/controllers/api/v1/content/Veranstaltungskategorie.php @@ -33,11 +33,11 @@ class Veranstaltungskategorie extends APIv1_Controller */ public function getVeranstaltungskategorie() { - $veranstaltungskategorieID = $this->get('veranstaltungskategorie_id'); + $veranstaltungskategorie_kurzbz = $this->get('veranstaltungskategorie_kurzbz'); - if(isset($veranstaltungskategorieID)) + if(isset($veranstaltungskategorie_kurzbz)) { - $result = $this->VeranstaltungskategorieModel->load($veranstaltungskategorieID); + $result = $this->VeranstaltungskategorieModel->load($veranstaltungskategorie_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Veranstaltungskategorie extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['veranstaltungskategorie_id'])) + if(isset($this->post()['veranstaltungskategorie_kurzbz'])) { - $result = $this->VeranstaltungskategorieModel->update($this->post()['veranstaltungskategorie_id'], $this->post()); + $result = $this->VeranstaltungskategorieModel->update($this->post()['veranstaltungskategorie_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/crm/Aufnahmeschluessel.php b/application/controllers/api/v1/crm/Aufnahmeschluessel.php index d232428f1..db84bf481 100644 --- a/application/controllers/api/v1/crm/Aufnahmeschluessel.php +++ b/application/controllers/api/v1/crm/Aufnahmeschluessel.php @@ -33,11 +33,11 @@ class Aufnahmeschluessel extends APIv1_Controller */ public function getAufnahmeschluessel() { - $aufnahmeschluesselID = $this->get('aufnahmeschluessel_id'); + $aufnahmeschluessel = $this->get('aufnahmeschluessel'); - if(isset($aufnahmeschluesselID)) + if(isset($aufnahmeschluessel)) { - $result = $this->AufnahmeschluesselModel->load($aufnahmeschluesselID); + $result = $this->AufnahmeschluesselModel->load($aufnahmeschluessel); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Aufnahmeschluessel extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['aufnahmeschluessel_id'])) + if(isset($this->post()['aufnahmeschluessel'])) { - $result = $this->AufnahmeschluesselModel->update($this->post()['aufnahmeschluessel_id'], $this->post()); + $result = $this->AufnahmeschluesselModel->update($this->post()['aufnahmeschluessel'], $this->post()); } else { diff --git a/application/controllers/api/v1/crm/Aufnahmetermintyp.php b/application/controllers/api/v1/crm/Aufnahmetermintyp.php index d3cf29e25..1a63914cf 100644 --- a/application/controllers/api/v1/crm/Aufnahmetermintyp.php +++ b/application/controllers/api/v1/crm/Aufnahmetermintyp.php @@ -33,11 +33,11 @@ class Aufnahmetermintyp extends APIv1_Controller */ public function getAufnahmetermintyp() { - $aufnahmetermintypID = $this->get('aufnahmetermintyp_id'); + $aufnahmetermintyp_kurzbz = $this->get('aufnahmetermintyp_kurzbz'); - if(isset($aufnahmetermintypID)) + if(isset($aufnahmetermintyp_kurzbz)) { - $result = $this->AufnahmetermintypModel->load($aufnahmetermintypID); + $result = $this->AufnahmetermintypModel->load($aufnahmetermintyp_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Aufnahmetermintyp extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['aufnahmetermintyp_id'])) + if(isset($this->post()['aufnahmetermintyp_kurzbz'])) { - $result = $this->AufnahmetermintypModel->update($this->post()['aufnahmetermintyp_id'], $this->post()); + $result = $this->AufnahmetermintypModel->update($this->post()['aufnahmetermintyp_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/crm/Buchungstyp.php b/application/controllers/api/v1/crm/Buchungstyp.php index 280d2ab69..eff19f7ee 100644 --- a/application/controllers/api/v1/crm/Buchungstyp.php +++ b/application/controllers/api/v1/crm/Buchungstyp.php @@ -33,11 +33,11 @@ class Buchungstyp extends APIv1_Controller */ public function getBuchungstyp() { - $buchungstypID = $this->get('buchungstyp_id'); + $buchungstyp_kurzbz = $this->get('buchungstyp_kurzbz'); - if(isset($buchungstypID)) + if(isset($buchungstyp_kurzbz)) { - $result = $this->BuchungstypModel->load($buchungstypID); + $result = $this->BuchungstypModel->load($buchungstyp_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Buchungstyp extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['buchungstyp_id'])) + if(isset($this->post()['buchungstyp_kurzbz'])) { - $result = $this->BuchungstypModel->update($this->post()['buchungstyp_id'], $this->post()); + $result = $this->BuchungstypModel->update($this->post()['buchungstyp_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/crm/Dokument.php b/application/controllers/api/v1/crm/Dokument.php index 579b09320..49086576c 100644 --- a/application/controllers/api/v1/crm/Dokument.php +++ b/application/controllers/api/v1/crm/Dokument.php @@ -33,11 +33,11 @@ class Dokument extends APIv1_Controller */ public function getDokument() { - $dokumentID = $this->get('dokument_id'); + $dokument_kurzbz = $this->get('dokument_kurzbz'); - if(isset($dokumentID)) + if(isset($dokument_kurzbz)) { - $result = $this->DokumentModel->load($dokumentID); + $result = $this->DokumentModel->load($dokument_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Dokument extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['dokument_id'])) + if(isset($this->post()['dokument_kurzbz'])) { - $result = $this->DokumentModel->update($this->post()['dokument_id'], $this->post()); + $result = $this->DokumentModel->update($this->post()['dokument_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/crm/Dokumentprestudent.php b/application/controllers/api/v1/crm/Dokumentprestudent.php index 4335d148a..7e2631870 100644 --- a/application/controllers/api/v1/crm/Dokumentprestudent.php +++ b/application/controllers/api/v1/crm/Dokumentprestudent.php @@ -55,9 +55,9 @@ class Dokumentprestudent extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['dokumentprestudent_id'])) + if(isset($this->post()['prestudent_id']) && isset($this->post()['dokument_kurzbz'])) { - $result = $this->DokumentprestudentModel->update($this->post()['dokumentprestudent_id'], $this->post()); + $result = $this->DokumentprestudentModel->update(array($this->post()['prestudent_id'], $this->post()['dokument_kurzbz']), $this->post()); } else { diff --git a/application/controllers/api/v1/crm/Dokumentstudiengang.php b/application/controllers/api/v1/crm/Dokumentstudiengang.php index 1b79793a9..ce85c0ef4 100644 --- a/application/controllers/api/v1/crm/Dokumentstudiengang.php +++ b/application/controllers/api/v1/crm/Dokumentstudiengang.php @@ -55,9 +55,9 @@ class Dokumentstudiengang extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['dokumentstudiengang_id'])) + if(isset($this->post()['studiengang_kz']) && isset($this->post()['dokument_kurzbz'])) { - $result = $this->DokumentstudiengangModel->update($this->post()['dokumentstudiengang_id'], $this->post()); + $result = $this->DokumentstudiengangModel->update(array($this->post()['studiengang_kz'], $this->post()['dokument_kurzbz']), $this->post()); } else { diff --git a/application/controllers/api/v1/crm/Konto.php b/application/controllers/api/v1/crm/Konto.php index 30035e871..adb161e1e 100644 --- a/application/controllers/api/v1/crm/Konto.php +++ b/application/controllers/api/v1/crm/Konto.php @@ -33,11 +33,11 @@ class Konto extends APIv1_Controller */ public function getKonto() { - $kontoID = $this->get('konto_id'); + $buchungsnr = $this->get('buchungsnr'); - if(isset($kontoID)) + if(isset($buchungsnr)) { - $result = $this->KontoModel->load($kontoID); + $result = $this->KontoModel->load($buchungsnr); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Konto extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['konto_id'])) + if(isset($this->post()['buchungsnr'])) { - $result = $this->KontoModel->update($this->post()['konto_id'], $this->post()); + $result = $this->KontoModel->update($this->post()['buchungsnr'], $this->post()); } else { diff --git a/application/controllers/api/v1/crm/Preinteressentstudiengang.php b/application/controllers/api/v1/crm/Preinteressentstudiengang.php index 851d9fc24..fa68a2a87 100644 --- a/application/controllers/api/v1/crm/Preinteressentstudiengang.php +++ b/application/controllers/api/v1/crm/Preinteressentstudiengang.php @@ -55,9 +55,9 @@ class Preinteressentstudiengang extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['preinteressentstudiengang_id'])) + if(isset($this->post()['preinteressent_id']) && isset($this->post()['studiengang_kz'])) { - $result = $this->PreinteressentstudiengangModel->update($this->post()['preinteressentstudiengang_id'], $this->post()); + $result = $this->PreinteressentstudiengangModel->update(array($this->post()['preinteressent_id'], $this->post()['studiengang_kz']), $this->post()); } else { diff --git a/application/controllers/api/v1/crm/Prestudentstatus.php b/application/controllers/api/v1/crm/Prestudentstatus.php index e4e0930c3..4da61e8f4 100644 --- a/application/controllers/api/v1/crm/Prestudentstatus.php +++ b/application/controllers/api/v1/crm/Prestudentstatus.php @@ -57,9 +57,16 @@ class Prestudentstatus extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['prestudentstatus_id'])) + if(isset($this->post()['ausbildungssemester']) && isset($this->post()['studiensemester_kurzbz']) && + isset($this->post()['status_kurzbz']) && isset($this->post()['prestudent_id'])) { - $result = $this->PrestudentstatusModel->update($this->post()['prestudentstatus_id'], $this->post()); + $pksArray = array($this->post()['ausbildungssemester'], + $this->post()['studiensemester_kurzbz'], + $this->post()['status_kurzbz'], + $this->post()['prestudent_id'] + ); + + $result = $this->PrestudentstatusModel->update($pksArray, $this->post()); } else { diff --git a/application/controllers/api/v1/crm/Status.php b/application/controllers/api/v1/crm/Status.php index 2973b602b..2c94d5153 100644 --- a/application/controllers/api/v1/crm/Status.php +++ b/application/controllers/api/v1/crm/Status.php @@ -33,11 +33,11 @@ class Status extends APIv1_Controller */ public function getStatus() { - $statusID = $this->get('status_id'); + $status_kurzbz = $this->get('status_kurzbz'); - if(isset($statusID)) + if(isset($status_kurzbz)) { - $result = $this->StatusModel->load($statusID); + $result = $this->StatusModel->load($status_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Status extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['status_id'])) + if(isset($this->post()['status_kurzbz'])) { - $result = $this->StatusModel->update($this->post()['status_id'], $this->post()); + $result = $this->StatusModel->update($this->post()['status_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/organisation/Erhalter.php b/application/controllers/api/v1/organisation/Erhalter.php index c52b953ed..a67e00cd7 100644 --- a/application/controllers/api/v1/organisation/Erhalter.php +++ b/application/controllers/api/v1/organisation/Erhalter.php @@ -33,11 +33,11 @@ class Erhalter extends APIv1_Controller */ public function getErhalter() { - $erhalterID = $this->get('erhalter_id'); + $erhalter_kz = $this->get('erhalter_kz'); - if(isset($erhalterID)) + if(isset($erhalter_kz)) { - $result = $this->ErhalterModel->load($erhalterID); + $result = $this->ErhalterModel->load($erhalter_kz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Erhalter extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['erhalter_id'])) + if(isset($this->post()['erhalter_kz'])) { - $result = $this->ErhalterModel->update($this->post()['erhalter_id'], $this->post()); + $result = $this->ErhalterModel->update($this->post()['erhalter_kz'], $this->post()); } else { diff --git a/application/controllers/api/v1/organisation/Ferien.php b/application/controllers/api/v1/organisation/Ferien.php index a5e02a4ee..5e4b15d6e 100644 --- a/application/controllers/api/v1/organisation/Ferien.php +++ b/application/controllers/api/v1/organisation/Ferien.php @@ -55,9 +55,9 @@ class Ferien extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['ferien_id'])) + if(isset($this->post()['studiengang_kz']) && isset($this->post()['bezeichnung'])) { - $result = $this->FerienModel->update($this->post()['ferien_id'], $this->post()); + $result = $this->FerienModel->update(array($this->post()['ferien_id'], $this->post()['bezeichnung']), $this->post()); } else { diff --git a/application/controllers/api/v1/organisation/Gruppe.php b/application/controllers/api/v1/organisation/Gruppe.php index 3e6d70f92..1a290740f 100644 --- a/application/controllers/api/v1/organisation/Gruppe.php +++ b/application/controllers/api/v1/organisation/Gruppe.php @@ -33,11 +33,11 @@ class Gruppe extends APIv1_Controller */ public function getGruppe() { - $gruppeID = $this->get('gruppe_id'); + $gruppe_kurzbz = $this->get('gruppe_kurzbz'); - if(isset($gruppeID)) + if(isset($gruppe_kurzbz)) { - $result = $this->GruppeModel->load($gruppeID); + $result = $this->GruppeModel->load($gruppe_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Gruppe extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['gruppe_id'])) + if(isset($this->post()['gruppe_kurzbz'])) { - $result = $this->GruppeModel->update($this->post()['gruppe_id'], $this->post()); + $result = $this->GruppeModel->update($this->post()['gruppe_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/organisation/Lehrverband.php b/application/controllers/api/v1/organisation/Lehrverband.php index 8e2143934..74089fc2d 100644 --- a/application/controllers/api/v1/organisation/Lehrverband.php +++ b/application/controllers/api/v1/organisation/Lehrverband.php @@ -57,9 +57,16 @@ class Lehrverband extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['lehrverband_id'])) + if(isset($this->post()['gruppe']) && isset($this->post()['verband']) && + isset($this->post()['semester']) && isset($this->post()['studiengang_kz'])) { - $result = $this->LehrverbandModel->update($this->post()['lehrverband_id'], $this->post()); + $pksArray = array($this->post()['gruppe'], + $this->post()['verband'], + $this->post()['semester'], + $this->post()['studiengang_kz'] + ); + + $result = $this->LehrverbandModel->update($pksArray, $this->post()); } else { diff --git a/application/controllers/api/v1/organisation/Organisationseinheittyp.php b/application/controllers/api/v1/organisation/Organisationseinheittyp.php index 56bd1ac23..4064f5849 100644 --- a/application/controllers/api/v1/organisation/Organisationseinheittyp.php +++ b/application/controllers/api/v1/organisation/Organisationseinheittyp.php @@ -33,11 +33,11 @@ class Organisationseinheittyp extends APIv1_Controller */ public function getOrganisationseinheittyp() { - $organisationseinheittypID = $this->get('organisationseinheittyp_id'); + $organisationseinheittyp_kurzbz = $this->get('organisationseinheittyp_kurzbz'); - if(isset($organisationseinheittypID)) + if(isset($organisationseinheittyp_kurzbz)) { - $result = $this->OrganisationseinheittypModel->load($organisationseinheittypID); + $result = $this->OrganisationseinheittypModel->load($organisationseinheittyp_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Organisationseinheittyp extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['organisationseinheittyp_id'])) + if(isset($this->post()['organisationseinheittyp_kurzbz'])) { - $result = $this->OrganisationseinheittypModel->update($this->post()['organisationseinheittyp_id'], $this->post()); + $result = $this->OrganisationseinheittypModel->update($this->post()['organisationseinheittyp_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/organisation/Semesterwochen.php b/application/controllers/api/v1/organisation/Semesterwochen.php index 6980510bd..38c2a4438 100644 --- a/application/controllers/api/v1/organisation/Semesterwochen.php +++ b/application/controllers/api/v1/organisation/Semesterwochen.php @@ -55,9 +55,9 @@ class Semesterwochen extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['semesterwochen_id'])) + if(isset($this->post()['studiengang_kz']) && isset($this->post()['semester'])) { - $result = $this->SemesterwochenModel->update($this->post()['semesterwochen_id'], $this->post()); + $result = $this->SemesterwochenModel->update(array($this->post()['studiengang_kz'], $this->post()['semester']), $this->post()); } else { diff --git a/application/controllers/api/v1/organisation/Statistik.php b/application/controllers/api/v1/organisation/Statistik.php index 8d372a1ac..1af29ddad 100644 --- a/application/controllers/api/v1/organisation/Statistik.php +++ b/application/controllers/api/v1/organisation/Statistik.php @@ -33,11 +33,11 @@ class Statistik extends APIv1_Controller */ public function getStatistik() { - $statistikID = $this->get('statistik_id'); + $statistik_kurzbz = $this->get('statistik_kurzbz'); - if(isset($statistikID)) + if(isset($statistik_kurzbz)) { - $result = $this->StatistikModel->load($statistikID); + $result = $this->StatistikModel->load($statistik_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Statistik extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['statistik_id'])) + if(isset($this->post()['statistik_kurzbz'])) { - $result = $this->StatistikModel->update($this->post()['statistik_id'], $this->post()); + $result = $this->StatistikModel->update($this->post()['statistik_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/organisation/Studiengangstyp.php b/application/controllers/api/v1/organisation/Studiengangstyp.php index 94e6072f8..af9bb5762 100644 --- a/application/controllers/api/v1/organisation/Studiengangstyp.php +++ b/application/controllers/api/v1/organisation/Studiengangstyp.php @@ -33,11 +33,11 @@ class Studiengangstyp extends APIv1_Controller */ public function getStudiengangstyp() { - $studiengangstypID = $this->get('studiengangstyp_id'); + $typ = $this->get('typ'); - if(isset($studiengangstypID)) + if(isset($typ)) { - $result = $this->StudiengangstypModel->load($studiengangstypID); + $result = $this->StudiengangstypModel->load($typ); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Studiengangstyp extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['studiengangstyp_id'])) + if(isset($this->post()['typ'])) { - $result = $this->StudiengangstypModel->update($this->post()['studiengangstyp_id'], $this->post()); + $result = $this->StudiengangstypModel->update($this->post()['typ'], $this->post()); } else { diff --git a/application/controllers/api/v1/organisation/Studienjahr.php b/application/controllers/api/v1/organisation/Studienjahr.php index 1c90497e2..719dc8579 100644 --- a/application/controllers/api/v1/organisation/Studienjahr.php +++ b/application/controllers/api/v1/organisation/Studienjahr.php @@ -33,11 +33,11 @@ class Studienjahr extends APIv1_Controller */ public function getStudienjahr() { - $studienjahrID = $this->get('studienjahr_id'); + $studienjahr_kurzbz = $this->get('studienjahr_kurzbz'); - if(isset($studienjahrID)) + if(isset($studienjahr_kurzbz)) { - $result = $this->StudienjahrModel->load($studienjahrID); + $result = $this->StudienjahrModel->load($studienjahr_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Studienjahr extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['studienjahr_id'])) + if(isset($this->post()['studienjahr_kurzbz'])) { - $result = $this->StudienjahrModel->update($this->post()['studienjahr_id'], $this->post()); + $result = $this->StudienjahrModel->update($this->post()['studienjahr_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/organisation/Studienordnungstatus.php b/application/controllers/api/v1/organisation/Studienordnungstatus.php index af6f4bf73..293abbd12 100644 --- a/application/controllers/api/v1/organisation/Studienordnungstatus.php +++ b/application/controllers/api/v1/organisation/Studienordnungstatus.php @@ -33,11 +33,11 @@ class Studienordnungstatus extends APIv1_Controller */ public function getStudienordnungstatus() { - $studienordnungstatusID = $this->get('studienordnungstatus_id'); + $status_kurzbz = $this->get('status_kurzbz'); - if(isset($studienordnungstatusID)) + if(isset($status_kurzbz)) { - $result = $this->StudienordnungstatusModel->load($studienordnungstatusID); + $result = $this->StudienordnungstatusModel->load($status_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Studienordnungstatus extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['studienordnungstatus_id'])) + if(isset($this->post()['status_kurzbz'])) { - $result = $this->StudienordnungstatusModel->update($this->post()['studienordnungstatus_id'], $this->post()); + $result = $this->StudienordnungstatusModel->update($this->post()['status_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/organisation/Studiensemester.php b/application/controllers/api/v1/organisation/Studiensemester.php index aad98aa5d..e61512825 100644 --- a/application/controllers/api/v1/organisation/Studiensemester.php +++ b/application/controllers/api/v1/organisation/Studiensemester.php @@ -33,11 +33,11 @@ class Studiensemester extends APIv1_Controller */ public function getStudiensemester() { - $studiensemesterID = $this->get('studiensemester_id'); + $studiensemester_kurzbz = $this->get('studiensemester_kurzbz'); - if(isset($studiensemesterID)) + if(isset($studiensemester_kurzbz)) { - $result = $this->StudiensemesterModel->load($studiensemesterID); + $result = $this->StudiensemesterModel->load($studiensemester_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Studiensemester extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['studiensemester_id'])) + if(isset($this->post()['studiensemester_kurzbz'])) { - $result = $this->StudiensemesterModel->update($this->post()['studiensemester_id'], $this->post()); + $result = $this->StudiensemesterModel->update($this->post()['studiensemester_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/person/Benutzer.php b/application/controllers/api/v1/person/Benutzer.php index 84cd8f0ac..f79c65708 100644 --- a/application/controllers/api/v1/person/Benutzer.php +++ b/application/controllers/api/v1/person/Benutzer.php @@ -33,11 +33,11 @@ class Benutzer extends APIv1_Controller */ public function getBenutzer() { - $benutzerID = $this->get('benutzer_id'); + $uid = $this->get('uid'); - if(isset($benutzerID)) + if(isset($uid)) { - $result = $this->BenutzerModel->load($benutzerID); + $result = $this->BenutzerModel->load($uid); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Benutzer extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['benutzer_id'])) + if(isset($this->post()['uid'])) { - $result = $this->BenutzerModel->update($this->post()['benutzer_id'], $this->post()); + $result = $this->BenutzerModel->update($this->post()['uid'], $this->post()); } else { diff --git a/application/controllers/api/v1/person/Fotostatus.php b/application/controllers/api/v1/person/Fotostatus.php index f72aca84a..3564d188a 100644 --- a/application/controllers/api/v1/person/Fotostatus.php +++ b/application/controllers/api/v1/person/Fotostatus.php @@ -33,11 +33,11 @@ class Fotostatus extends APIv1_Controller */ public function getFotostatus() { - $fotostatusID = $this->get('fotostatus_id'); + $fotostatus_kurzbz = $this->get('fotostatus_kurzbz'); - if(isset($fotostatusID)) + if(isset($fotostatus_kurzbz)) { - $result = $this->FotostatusModel->load($fotostatusID); + $result = $this->FotostatusModel->load($fotostatus_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Fotostatus extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['fotostatus_id'])) + if(isset($this->post()['fotostatus_kurzbz'])) { - $result = $this->FotostatusModel->update($this->post()['fotostatus_id'], $this->post()); + $result = $this->FotostatusModel->update($this->post()['fotostatus_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/person/Freebusytyp.php b/application/controllers/api/v1/person/Freebusytyp.php index 400c82477..891422d0c 100644 --- a/application/controllers/api/v1/person/Freebusytyp.php +++ b/application/controllers/api/v1/person/Freebusytyp.php @@ -33,11 +33,11 @@ class Freebusytyp extends APIv1_Controller */ public function getFreebusytyp() { - $freebusytypID = $this->get('freebusytyp_id'); + $freebusytyp_kurzbz = $this->get('freebusytyp_kurzbz'); - if(isset($freebusytypID)) + if(isset($freebusytyp_kurzbz)) { - $result = $this->FreebusytypModel->load($freebusytypID); + $result = $this->FreebusytypModel->load($freebusytyp_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Freebusytyp extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['freebusytyp_id'])) + if(isset($this->post()['freebusytyp_kurzbz'])) { - $result = $this->FreebusytypModel->update($this->post()['freebusytyp_id'], $this->post()); + $result = $this->FreebusytypModel->update($this->post()['freebusytyp_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/person/Kontaktmedium.php b/application/controllers/api/v1/person/Kontaktmedium.php index 898988278..f12db34c5 100644 --- a/application/controllers/api/v1/person/Kontaktmedium.php +++ b/application/controllers/api/v1/person/Kontaktmedium.php @@ -33,11 +33,11 @@ class Kontaktmedium extends APIv1_Controller */ public function getKontaktmedium() { - $kontaktmediumID = $this->get('kontaktmedium_id'); + $kontaktmedium_kurzbz = $this->get('kontaktmedium_kurzbz'); - if(isset($kontaktmediumID)) + if(isset($kontaktmedium_kurzbz)) { - $result = $this->KontaktmediumModel->load($kontaktmediumID); + $result = $this->KontaktmediumModel->load($kontaktmedium_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Kontaktmedium extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['kontaktmedium_id'])) + if(isset($this->post()['kontaktmedium_kurzbz'])) { - $result = $this->KontaktmediumModel->update($this->post()['kontaktmedium_id'], $this->post()); + $result = $this->KontaktmediumModel->update($this->post()['kontaktmedium_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/person/Kontakttyp.php b/application/controllers/api/v1/person/Kontakttyp.php index ea179dd2a..a663d03cc 100644 --- a/application/controllers/api/v1/person/Kontakttyp.php +++ b/application/controllers/api/v1/person/Kontakttyp.php @@ -33,11 +33,11 @@ class Kontakttyp extends APIv1_Controller */ public function getKontakttyp() { - $kontakttypID = $this->get('kontakttyp_id'); + $kontakttyp = $this->get('kontakttyp'); - if(isset($kontakttypID)) + if(isset($kontakttyp)) { - $result = $this->KontakttypModel->load($kontakttypID); + $result = $this->KontakttypModel->load($kontakttyp); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Kontakttyp extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['kontakttyp_id'])) + if(isset($this->post()['kontakttyp'])) { - $result = $this->KontakttypModel->update($this->post()['kontakttyp_id'], $this->post()); + $result = $this->KontakttypModel->update($this->post()['kontakttyp'], $this->post()); } else { diff --git a/application/controllers/api/v1/project/Aktivitaet.php b/application/controllers/api/v1/project/Aktivitaet.php index 434a6a458..42b979927 100644 --- a/application/controllers/api/v1/project/Aktivitaet.php +++ b/application/controllers/api/v1/project/Aktivitaet.php @@ -33,11 +33,11 @@ class Aktivitaet extends APIv1_Controller */ public function getAktivitaet() { - $aktivitaetID = $this->get('aktivitaet_id'); + $aktivitaet_kurzbz = $this->get('aktivitaet_kurzbz'); - if(isset($aktivitaetID)) + if(isset($aktivitaet_kurzbz)) { - $result = $this->AktivitaetModel->load($aktivitaetID); + $result = $this->AktivitaetModel->load($aktivitaet_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Aktivitaet extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['aktivitaet_id'])) + if(isset($this->post()['aktivitaet_kurzbz'])) { - $result = $this->AktivitaetModel->update($this->post()['aktivitaet_id'], $this->post()); + $result = $this->AktivitaetModel->update($this->post()['aktivitaet_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/project/Aufwandstyp.php b/application/controllers/api/v1/project/Aufwandstyp.php index 754cbcf1c..45d69d022 100644 --- a/application/controllers/api/v1/project/Aufwandstyp.php +++ b/application/controllers/api/v1/project/Aufwandstyp.php @@ -33,11 +33,11 @@ class Aufwandstyp extends APIv1_Controller */ public function getAufwandstyp() { - $aufwandstypID = $this->get('aufwandstyp_id'); + $aufwandstyp_kurzbz = $this->get('aufwandstyp_kurzbz'); - if(isset($aufwandstypID)) + if(isset($aufwandstyp_kurzbz)) { - $result = $this->AufwandstypModel->load($aufwandstypID); + $result = $this->AufwandstypModel->load($aufwandstyp_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Aufwandstyp extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['aufwandstyp_id'])) + if(isset($this->post()['aufwandstyp_kurzbz'])) { - $result = $this->AufwandstypModel->update($this->post()['aufwandstyp_id'], $this->post()); + $result = $this->AufwandstypModel->update($this->post()['aufwandstyp_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/project/Projekt.php b/application/controllers/api/v1/project/Projekt.php index eab850c88..c37456b3e 100644 --- a/application/controllers/api/v1/project/Projekt.php +++ b/application/controllers/api/v1/project/Projekt.php @@ -33,11 +33,11 @@ class Projekt extends APIv1_Controller */ public function getProjekt() { - $projektID = $this->get('projekt_id'); + $projekt_kurzbz = $this->get('projekt_kurzbz'); - if(isset($projektID)) + if(isset($projekt_kurzbz)) { - $result = $this->ProjektModel->load($projektID); + $result = $this->ProjektModel->load($projekt_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Projekt extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['projekt_id'])) + if(isset($this->post()['projekt_kurzbz'])) { - $result = $this->ProjektModel->update($this->post()['projekt_id'], $this->post()); + $result = $this->ProjektModel->update($this->post()['projekt_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/project/Scrumteam.php b/application/controllers/api/v1/project/Scrumteam.php index dd5f3e29a..aab41842b 100644 --- a/application/controllers/api/v1/project/Scrumteam.php +++ b/application/controllers/api/v1/project/Scrumteam.php @@ -33,11 +33,11 @@ class Scrumteam extends APIv1_Controller */ public function getScrumteam() { - $scrumteamID = $this->get('scrumteam_id'); + $scrumteam_kurzbz = $this->get('scrumteam_kurzbz'); - if(isset($scrumteamID)) + if(isset($scrumteam_kurzbz)) { - $result = $this->ScrumteamModel->load($scrumteamID); + $result = $this->ScrumteamModel->load($scrumteam_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Scrumteam extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['scrumteam_id'])) + if(isset($this->post()['scrumteam_kurzbz'])) { - $result = $this->ScrumteamModel->update($this->post()['scrumteam_id'], $this->post()); + $result = $this->ScrumteamModel->update($this->post()['scrumteam_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/ressource/Betriebsmittelstatus.php b/application/controllers/api/v1/ressource/Betriebsmittelstatus.php index 9f9b126c1..37dcb5abe 100644 --- a/application/controllers/api/v1/ressource/Betriebsmittelstatus.php +++ b/application/controllers/api/v1/ressource/Betriebsmittelstatus.php @@ -33,11 +33,11 @@ class Betriebsmittelstatus extends APIv1_Controller */ public function getBetriebsmittelstatus() { - $betriebsmittelstatusID = $this->get('betriebsmittelstatus_id'); + $betriebsmittelstatus_kurzbz = $this->get('betriebsmittelstatus_kurzbz'); - if(isset($betriebsmittelstatusID)) + if(isset($betriebsmittelstatus_kurzbz)) { - $result = $this->BetriebsmittelstatusModel->load($betriebsmittelstatusID); + $result = $this->BetriebsmittelstatusModel->load($betriebsmittelstatus_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Betriebsmittelstatus extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['betriebsmittelstatus_id'])) + if(isset($this->post()['betriebsmittelstatus_kurzbz'])) { - $result = $this->BetriebsmittelstatusModel->update($this->post()['betriebsmittelstatus_id'], $this->post()); + $result = $this->BetriebsmittelstatusModel->update($this->post()['betriebsmittelstatus_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/ressource/Betriebsmitteltyp.php b/application/controllers/api/v1/ressource/Betriebsmitteltyp.php index 10c966ead..298fe41e4 100644 --- a/application/controllers/api/v1/ressource/Betriebsmitteltyp.php +++ b/application/controllers/api/v1/ressource/Betriebsmitteltyp.php @@ -33,11 +33,11 @@ class Betriebsmitteltyp extends APIv1_Controller */ public function getBetriebsmitteltyp() { - $betriebsmitteltypID = $this->get('betriebsmitteltyp_id'); + $betriebsmitteltyp = $this->get('betriebsmitteltyp'); - if(isset($betriebsmitteltypID)) + if(isset($betriebsmitteltyp)) { - $result = $this->BetriebsmitteltypModel->load($betriebsmitteltypID); + $result = $this->BetriebsmitteltypModel->load($betriebsmitteltyp); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Betriebsmitteltyp extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['betriebsmitteltyp_id'])) + if(isset($this->post()['betriebsmitteltyp'])) { - $result = $this->BetriebsmitteltypModel->update($this->post()['betriebsmitteltyp_id'], $this->post()); + $result = $this->BetriebsmitteltypModel->update($this->post()['betriebsmitteltyp'], $this->post()); } else { diff --git a/application/controllers/api/v1/ressource/Erreichbarkeit.php b/application/controllers/api/v1/ressource/Erreichbarkeit.php index 68719e459..418151974 100644 --- a/application/controllers/api/v1/ressource/Erreichbarkeit.php +++ b/application/controllers/api/v1/ressource/Erreichbarkeit.php @@ -33,11 +33,11 @@ class Erreichbarkeit extends APIv1_Controller */ public function getErreichbarkeit() { - $erreichbarkeitID = $this->get('erreichbarkeit_id'); + $erreichbarkeit_kurzbz = $this->get('erreichbarkeit_kurzbz'); - if(isset($erreichbarkeitID)) + if(isset($erreichbarkeit_kurzbz)) { - $result = $this->ErreichbarkeitModel->load($erreichbarkeitID); + $result = $this->ErreichbarkeitModel->load($erreichbarkeit_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Erreichbarkeit extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['erreichbarkeit_id'])) + if(isset($this->post()['erreichbarkeit_kurzbz'])) { - $result = $this->ErreichbarkeitModel->update($this->post()['erreichbarkeit_id'], $this->post()); + $result = $this->ErreichbarkeitModel->update($this->post()['erreichbarkeit_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/ressource/Firmatag.php b/application/controllers/api/v1/ressource/Firmatag.php index 01bf864b9..27758fd16 100644 --- a/application/controllers/api/v1/ressource/Firmatag.php +++ b/application/controllers/api/v1/ressource/Firmatag.php @@ -55,9 +55,9 @@ class Firmatag extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['firmatag_id'])) + if(isset($this->post()['tag']) && isset($this->post()['firma_id'])) { - $result = $this->FirmatagModel->update($this->post()['firmatag_id'], $this->post()); + $result = $this->FirmatagModel->update(array($this->post()['tag'], $this->post()['firma_id']), $this->post()); } else { diff --git a/application/controllers/api/v1/ressource/Firmentyp.php b/application/controllers/api/v1/ressource/Firmentyp.php index ba58242ba..abd58e704 100644 --- a/application/controllers/api/v1/ressource/Firmentyp.php +++ b/application/controllers/api/v1/ressource/Firmentyp.php @@ -33,11 +33,11 @@ class Firmentyp extends APIv1_Controller */ public function getFirmentyp() { - $firmentypID = $this->get('firmentyp_id'); + $firmentyp_kurzbz = $this->get('firmentyp_kurzbz'); - if(isset($firmentypID)) + if(isset($firmentyp_kurzbz)) { - $result = $this->FirmentypModel->load($firmentypID); + $result = $this->FirmentypModel->load($firmentyp_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Firmentyp extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['firmentyp_id'])) + if(isset($this->post()['firmentyp_kurzbz'])) { - $result = $this->FirmentypModel->update($this->post()['firmentyp_id'], $this->post()); + $result = $this->FirmentypModel->update($this->post()['firmentyp_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/ressource/Funktion.php b/application/controllers/api/v1/ressource/Funktion.php index 1894983a7..57caf10bd 100644 --- a/application/controllers/api/v1/ressource/Funktion.php +++ b/application/controllers/api/v1/ressource/Funktion.php @@ -33,11 +33,11 @@ class Funktion extends APIv1_Controller */ public function getFunktion() { - $funktionID = $this->get('funktion_id'); + $funktion_kurzbz = $this->get('funktion_kurzbz'); - if(isset($funktionID)) + if(isset($funktion_kurzbz)) { - $result = $this->FunktionModel->load($funktionID); + $result = $this->FunktionModel->load($funktion_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Funktion extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['funktion_id'])) + if(isset($this->post()['funktion_kurzbz'])) { - $result = $this->FunktionModel->update($this->post()['funktion_id'], $this->post()); + $result = $this->FunktionModel->update($this->post()['funktion_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/ressource/Lehrmittel.php b/application/controllers/api/v1/ressource/Lehrmittel.php index c1b1a0b9d..faa92346a 100644 --- a/application/controllers/api/v1/ressource/Lehrmittel.php +++ b/application/controllers/api/v1/ressource/Lehrmittel.php @@ -33,11 +33,11 @@ class Lehrmittel extends APIv1_Controller */ public function getLehrmittel() { - $lehrmittelID = $this->get('lehrmittel_id'); + $lehrmittel_kurzbz = $this->get('lehrmittel_kurzbz'); - if(isset($lehrmittelID)) + if(isset($lehrmittel_kurzbz)) { - $result = $this->LehrmittelModel->load($lehrmittelID); + $result = $this->LehrmittelModel->load($lehrmittel_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Lehrmittel extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['lehrmittel_id'])) + if(isset($this->post()['lehrmittel_kurzbz'])) { - $result = $this->LehrmittelModel->update($this->post()['lehrmittel_id'], $this->post()); + $result = $this->LehrmittelModel->update($this->post()['lehrmittel_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/ressource/Mitarbeiter.php b/application/controllers/api/v1/ressource/Mitarbeiter.php index 17ad4e8ef..afce5fe00 100644 --- a/application/controllers/api/v1/ressource/Mitarbeiter.php +++ b/application/controllers/api/v1/ressource/Mitarbeiter.php @@ -33,11 +33,11 @@ class Mitarbeiter extends APIv1_Controller */ public function getMitarbeiter() { - $mitarbeiterID = $this->get('mitarbeiter_id'); + $mitarbeiter_uid = $this->get('mitarbeiter_uid'); - if(isset($mitarbeiterID)) + if(isset($mitarbeiter_uid)) { - $result = $this->MitarbeiterModel->load($mitarbeiterID); + $result = $this->MitarbeiterModel->load($mitarbeiter_uid); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Mitarbeiter extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['mitarbeiter_id'])) + if(isset($this->post()['mitarbeiter_uid'])) { - $result = $this->MitarbeiterModel->update($this->post()['mitarbeiter_id'], $this->post()); + $result = $this->MitarbeiterModel->update($this->post()['mitarbeiter_uid'], $this->post()); } else { diff --git a/application/controllers/api/v1/ressource/Ort.php b/application/controllers/api/v1/ressource/Ort.php index e49d7fea7..d52191721 100644 --- a/application/controllers/api/v1/ressource/Ort.php +++ b/application/controllers/api/v1/ressource/Ort.php @@ -33,11 +33,11 @@ class Ort extends APIv1_Controller */ public function getOrt() { - $ortID = $this->get('ort_id'); + $ort_kurzbz = $this->get('ort_kurzbz'); - if(isset($ortID)) + if(isset($ort_kurzbz)) { - $result = $this->OrtModel->load($ortID); + $result = $this->OrtModel->load($ort_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Ort extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['ort_id'])) + if(isset($this->post()['ort_kurzbz'])) { - $result = $this->OrtModel->update($this->post()['ort_id'], $this->post()); + $result = $this->OrtModel->update($this->post()['ort_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/ressource/Ortraumtyp.php b/application/controllers/api/v1/ressource/Ortraumtyp.php index 20f4ccc93..460841e1d 100644 --- a/application/controllers/api/v1/ressource/Ortraumtyp.php +++ b/application/controllers/api/v1/ressource/Ortraumtyp.php @@ -55,9 +55,9 @@ class Ortraumtyp extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['ortraumtyp_id'])) + if(isset($this->post()['hierarchie']) && isset($this->post()['ort_kurzbz'])) { - $result = $this->OrtraumtypModel->update($this->post()['ortraumtyp_id'], $this->post()); + $result = $this->OrtraumtypModel->update(array($this->post()['hierarchie'], $this->post()['ort_kurzbz']), $this->post()); } else { diff --git a/application/controllers/api/v1/ressource/Raumtyp.php b/application/controllers/api/v1/ressource/Raumtyp.php index dd242d74c..5aa506797 100644 --- a/application/controllers/api/v1/ressource/Raumtyp.php +++ b/application/controllers/api/v1/ressource/Raumtyp.php @@ -33,11 +33,11 @@ class Raumtyp extends APIv1_Controller */ public function getRaumtyp() { - $raumtypID = $this->get('raumtyp_id'); + $raumtyp_kurzbz = $this->get('raumtyp_kurzbz'); - if(isset($raumtypID)) + if(isset($raumtyp_kurzbz)) { - $result = $this->RaumtypModel->load($raumtypID); + $result = $this->RaumtypModel->load($raumtyp_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Raumtyp extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['raumtyp_id'])) + if(isset($this->post()['raumtyp_kurzbz'])) { - $result = $this->RaumtypModel->update($this->post()['raumtyp_id'], $this->post()); + $result = $this->RaumtypModel->update($this->post()['raumtyp_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/ressource/Stunde.php b/application/controllers/api/v1/ressource/Stunde.php index 18b503fe9..f7437efc4 100644 --- a/application/controllers/api/v1/ressource/Stunde.php +++ b/application/controllers/api/v1/ressource/Stunde.php @@ -33,11 +33,11 @@ class Stunde extends APIv1_Controller */ public function getStunde() { - $stundeID = $this->get('stunde_id'); + $stunde = $this->get('stunde'); - if(isset($stundeID)) + if(isset($stunde)) { - $result = $this->StundeModel->load($stundeID); + $result = $this->StundeModel->load($stunde); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Stunde extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['stunde_id'])) + if(isset($this->post()['stunde'])) { - $result = $this->StundeModel->update($this->post()['stunde_id'], $this->post()); + $result = $this->StundeModel->update($this->post()['stunde'], $this->post()); } else { diff --git a/application/controllers/api/v1/ressource/Zeitfenster.php b/application/controllers/api/v1/ressource/Zeitfenster.php index d57ba5083..1ffc5f2f1 100644 --- a/application/controllers/api/v1/ressource/Zeitfenster.php +++ b/application/controllers/api/v1/ressource/Zeitfenster.php @@ -57,9 +57,16 @@ class Zeitfenster extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['zeitfenster_id'])) + if(isset($this->post()['wochentag']) && isset($this->post()['studiengang_kz']) && + isset($this->post()['ort_kurzbz']) && isset($this->post()['stunde'])) { - $result = $this->ZeitfensterModel->update($this->post()['zeitfenster_id'], $this->post()); + $pksArray = array($this->post()['wochentag'], + $this->post()['studiengang_kz'], + $this->post()['ort_kurzbz'], + $this->post()['stunde'] + ); + + $result = $this->ZeitfensterModel->update($pksArray, $this->post()); } else { diff --git a/application/controllers/api/v1/ressource/Zeitsperretyp.php b/application/controllers/api/v1/ressource/Zeitsperretyp.php index 1476c6286..8fca4cd09 100644 --- a/application/controllers/api/v1/ressource/Zeitsperretyp.php +++ b/application/controllers/api/v1/ressource/Zeitsperretyp.php @@ -33,11 +33,11 @@ class Zeitsperretyp extends APIv1_Controller */ public function getZeitsperretyp() { - $zeitsperretypID = $this->get('zeitsperretyp_id'); + $zeitsperretyp_kurzbz = $this->get('zeitsperretyp_kurzbz'); - if(isset($zeitsperretypID)) + if(isset($zeitsperretyp_kurzbz)) { - $result = $this->ZeitsperretypModel->load($zeitsperretypID); + $result = $this->ZeitsperretypModel->load($zeitsperretyp_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Zeitsperretyp extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['zeitsperretyp_id'])) + if(isset($this->post()['zeitsperretyp_kurzbz'])) { - $result = $this->ZeitsperretypModel->update($this->post()['zeitsperretyp_id'], $this->post()); + $result = $this->ZeitsperretypModel->update($this->post()['zeitsperretyp_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/ressource/Zeitwunsch.php b/application/controllers/api/v1/ressource/Zeitwunsch.php index 71aa1f95d..79ce86925 100644 --- a/application/controllers/api/v1/ressource/Zeitwunsch.php +++ b/application/controllers/api/v1/ressource/Zeitwunsch.php @@ -56,9 +56,14 @@ class Zeitwunsch extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['zeitwunsch_id'])) + if(isset($this->post()['tag']) && isset($this->post()['mitarbeiter_uid']) && isset($this->post()['stunde'])) { - $result = $this->ZeitwunschModel->update($this->post()['zeitwunsch_id'], $this->post()); + $pksArray = array($this->post()['tag'], + $this->post()['mitarbeiter_uid'], + $this->post()['stunde'] + ); + + $result = $this->ZeitwunschModel->update($pksArray, $this->post()); } else { diff --git a/application/controllers/api/v1/system/Berechtigung.php b/application/controllers/api/v1/system/Berechtigung.php index 00839ba76..af6aa8fb9 100644 --- a/application/controllers/api/v1/system/Berechtigung.php +++ b/application/controllers/api/v1/system/Berechtigung.php @@ -33,11 +33,11 @@ class Berechtigung extends APIv1_Controller */ public function getBerechtigung() { - $berechtigungID = $this->get('berechtigung_id'); + $berechtigung_kurzbz = $this->get('berechtigung_kurzbz'); - if(isset($berechtigungID)) + if(isset($berechtigung_kurzbz)) { - $result = $this->BerechtigungModel->load($berechtigungID); + $result = $this->BerechtigungModel->load($berechtigung_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Berechtigung extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['berechtigung_id'])) + if(isset($this->post()['berechtigung_kurzbz'])) { - $result = $this->BerechtigungModel->update($this->post()['berechtigung_id'], $this->post()); + $result = $this->BerechtigungModel->update($this->post()['berechtigung_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/system/Rolle.php b/application/controllers/api/v1/system/Rolle.php index 6bc0f8214..099e99006 100644 --- a/application/controllers/api/v1/system/Rolle.php +++ b/application/controllers/api/v1/system/Rolle.php @@ -33,11 +33,11 @@ class Rolle extends APIv1_Controller */ public function getRolle() { - $rolleID = $this->get('rolle_id'); + $rolle_kurzbz = $this->get('rolle_kurzbz'); - if(isset($rolleID)) + if(isset($rolle_kurzbz)) { - $result = $this->RolleModel->load($rolleID); + $result = $this->RolleModel->load($rolle_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Rolle extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['rolle_id'])) + if(isset($this->post()['rolle_kurzbz'])) { - $result = $this->RolleModel->update($this->post()['rolle_id'], $this->post()); + $result = $this->RolleModel->update($this->post()['rolle_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/system/Rolleberechtigung.php b/application/controllers/api/v1/system/Rolleberechtigung.php index 6148ce460..a314190dd 100644 --- a/application/controllers/api/v1/system/Rolleberechtigung.php +++ b/application/controllers/api/v1/system/Rolleberechtigung.php @@ -55,9 +55,9 @@ class Rolleberechtigung extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['rolleberechtigung_id'])) + if(isset($this->post()['rolle_kurzbz']) && isset($this->post()['berechtigung_kurzbz'])) { - $result = $this->RolleberechtigungModel->update($this->post()['rolleberechtigung_id'], $this->post()); + $result = $this->RolleberechtigungModel->update(array($this->post()['rolle_kurzbz'], $this->post()['berechtigung_kurzbz']), $this->post()); } else { diff --git a/application/controllers/api/v1/system/Tag.php b/application/controllers/api/v1/system/Tag.php index c82e35bc7..f320cedd6 100644 --- a/application/controllers/api/v1/system/Tag.php +++ b/application/controllers/api/v1/system/Tag.php @@ -33,11 +33,11 @@ class Tag extends APIv1_Controller */ public function getTag() { - $tagID = $this->get('tag_id'); + $tag = $this->get('tag'); - if(isset($tagID)) + if(isset($tag)) { - $result = $this->TagModel->load($tagID); + $result = $this->TagModel->load($tag); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Tag extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['tag_id'])) + if(isset($this->post()['tag'])) { - $result = $this->TagModel->update($this->post()['tag_id'], $this->post()); + $result = $this->TagModel->update($this->post()['tag'], $this->post()); } else { diff --git a/application/controllers/api/v1/system/Variable.php b/application/controllers/api/v1/system/Variable.php index 58d74488d..0eea84bc7 100644 --- a/application/controllers/api/v1/system/Variable.php +++ b/application/controllers/api/v1/system/Variable.php @@ -55,9 +55,9 @@ class Variable extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['variable_id'])) + if(isset($this->post()['uid']) && isset($this->post()['name'])) { - $result = $this->VariableModel->update($this->post()['variable_id'], $this->post()); + $result = $this->VariableModel->update(array($this->post()['uid'], $this->post()['name']), $this->post()); } else { diff --git a/application/controllers/api/v1/system/Vorlage.php b/application/controllers/api/v1/system/Vorlage.php index 016d112b0..58fc36cf1 100644 --- a/application/controllers/api/v1/system/Vorlage.php +++ b/application/controllers/api/v1/system/Vorlage.php @@ -33,11 +33,11 @@ class Vorlage extends APIv1_Controller */ public function getVorlage() { - $vorlageID = $this->get('vorlage_id'); + $vorlage_kurzbz = $this->get('vorlage_kurzbz'); - if(isset($vorlageID)) + if(isset($vorlage_kurzbz)) { - $result = $this->VorlageModel->load($vorlageID); + $result = $this->VorlageModel->load($vorlage_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Vorlage extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['vorlage_id'])) + if(isset($this->post()['vorlage_kurzbz'])) { - $result = $this->VorlageModel->update($this->post()['vorlage_id'], $this->post()); + $result = $this->VorlageModel->update($this->post()['vorlage_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/system/Webservicetyp.php b/application/controllers/api/v1/system/Webservicetyp.php index 05e169504..03fe42340 100644 --- a/application/controllers/api/v1/system/Webservicetyp.php +++ b/application/controllers/api/v1/system/Webservicetyp.php @@ -33,11 +33,11 @@ class Webservicetyp extends APIv1_Controller */ public function getWebservicetyp() { - $webservicetypID = $this->get('webservicetyp_id'); + $webservicetyp_kurzbz = $this->get('webservicetyp_kurzbz'); - if(isset($webservicetypID)) + if(isset($webservicetyp_kurzbz)) { - $result = $this->WebservicetypModel->load($webservicetypID); + $result = $this->WebservicetypModel->load($webservicetyp_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Webservicetyp extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['webservicetyp_id'])) + if(isset($this->post()['webservicetyp_kurzbz'])) { - $result = $this->WebservicetypModel->update($this->post()['webservicetyp_id'], $this->post()); + $result = $this->WebservicetypModel->update($this->post()['webservicetyp_kurzbz'], $this->post()); } else { diff --git a/application/controllers/api/v1/testtool/Kategorie.php b/application/controllers/api/v1/testtool/Kategorie.php index afabe9937..e28bc7193 100644 --- a/application/controllers/api/v1/testtool/Kategorie.php +++ b/application/controllers/api/v1/testtool/Kategorie.php @@ -33,11 +33,11 @@ class Kategorie extends APIv1_Controller */ public function getKategorie() { - $kategorieID = $this->get('kategorie_id'); + $kategorie_kurzbz = $this->get('kategorie_kurzbz'); - if(isset($kategorieID)) + if(isset($kategorie_kurzbz)) { - $result = $this->KategorieModel->load($kategorieID); + $result = $this->KategorieModel->load($kategorie_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } @@ -54,9 +54,9 @@ class Kategorie extends APIv1_Controller { if($this->_validate($this->post())) { - if(isset($this->post()['kategorie_id'])) + if(isset($this->post()['kategorie_kurzbz'])) { - $result = $this->KategorieModel->update($this->post()['kategorie_id'], $this->post()); + $result = $this->KategorieModel->update($this->post()['kategorie_kurzbz'], $this->post()); } else { diff --git a/tests/codeception/_data/dump.sql b/tests/codeception/_data/dump.sql index 5ce901a00..62deaa687 100644 --- a/tests/codeception/_data/dump.sql +++ b/tests/codeception/_data/dump.sql @@ -1,5 +1,5 @@ -- UPDATE tbl_studiengang -UPDATE tbl_studiengang SET onlinebewerbung = TRUE; +UPDATE public.tbl_studiengang SET onlinebewerbung = TRUE; -- EMPTY lehre.tbl_studienplan DELETE FROM lehre.tbl_studienplan; From 39cbed0ca8edce2f991d50a3f44f0b34fc02140f Mon Sep 17 00:00:00 2001 From: paolo Date: Thu, 19 May 2016 19:04:45 +0200 Subject: [PATCH 19/31] Added directory education and its relative controllers --- .../controllers/api/v1/education/Abgabe.php | 78 +++++++++++++++++ .../api/v1/education/Abschlussbeurteilung.php | 78 +++++++++++++++++ .../api/v1/education/Abschlusspruefung.php | 78 +++++++++++++++++ .../api/v1/education/Anrechnung.php | 78 +++++++++++++++++ .../api/v1/education/Anwesenheit.php | 78 +++++++++++++++++ .../controllers/api/v1/education/Beispiel.php | 78 +++++++++++++++++ .../api/v1/education/Betreuerart.php | 78 +++++++++++++++++ .../controllers/api/v1/education/Feedback.php | 78 +++++++++++++++++ .../api/v1/education/LeNotenschluessel.php | 79 +++++++++++++++++ .../api/v1/education/LePruefung.php | 78 +++++++++++++++++ .../api/v1/education/Legesamtnote.php | 79 +++++++++++++++++ .../api/v1/education/Lehreinheit.php | 78 +++++++++++++++++ .../api/v1/education/Lehreinheitgruppe.php | 78 +++++++++++++++++ .../v1/education/Lehreinheitmitarbeiter.php | 79 +++++++++++++++++ .../controllers/api/v1/education/Lehrfach.php | 78 +++++++++++++++++ .../api/v1/education/Lehrfunktion.php | 78 +++++++++++++++++ .../controllers/api/v1/education/Lehrtyp.php | 78 +++++++++++++++++ .../api/v1/education/Lehrveranstaltung.php | 78 +++++++++++++++++ .../api/v1/education/Lvangebot.php | 78 +++++++++++++++++ .../api/v1/education/Lvgesamtnote.php | 85 +++++++++++++++++++ .../controllers/api/v1/education/Lvinfo.php | 79 +++++++++++++++++ .../controllers/api/v1/education/Lvregel.php | 78 +++++++++++++++++ .../api/v1/education/Lvregeltyp.php | 78 +++++++++++++++++ .../controllers/api/v1/education/Moodle.php | 78 +++++++++++++++++ .../api/v1/education/Notenschluessel.php | 78 +++++++++++++++++ .../education/Notenschluesselaufteilung.php | 78 +++++++++++++++++ .../v1/education/Notenschluesseluebung.php | 79 +++++++++++++++++ .../v1/education/Notenschluesselzuordnung.php | 78 +++++++++++++++++ .../controllers/api/v1/education/Paabgabe.php | 78 +++++++++++++++++ .../api/v1/education/Paabgabetyp.php | 78 +++++++++++++++++ .../api/v1/education/Projektarbeit.php | 78 +++++++++++++++++ .../api/v1/education/Projektbetreuer.php | 85 +++++++++++++++++++ .../api/v1/education/Projekttyp.php | 78 +++++++++++++++++ .../controllers/api/v1/education/Pruefung.php | 78 +++++++++++++++++ .../api/v1/education/Pruefungsanmeldung.php | 78 +++++++++++++++++ .../api/v1/education/Pruefungsfenster.php | 78 +++++++++++++++++ .../api/v1/education/Pruefungsstatus.php | 78 +++++++++++++++++ .../api/v1/education/Pruefungstermin.php | 78 +++++++++++++++++ .../api/v1/education/Pruefungstyp.php | 78 +++++++++++++++++ .../api/v1/education/Studentbeispiel.php | 79 +++++++++++++++++ .../api/v1/education/Studentlehrverband.php | 79 +++++++++++++++++ .../api/v1/education/Studentuebung.php | 79 +++++++++++++++++ .../controllers/api/v1/education/Uebung.php | 78 +++++++++++++++++ .../controllers/api/v1/education/Zeugnis.php | 78 +++++++++++++++++ .../api/v1/education/Zeugnisnote.php | 85 +++++++++++++++++++ 45 files changed, 3539 insertions(+) create mode 100644 application/controllers/api/v1/education/Abgabe.php create mode 100644 application/controllers/api/v1/education/Abschlussbeurteilung.php create mode 100644 application/controllers/api/v1/education/Abschlusspruefung.php create mode 100644 application/controllers/api/v1/education/Anrechnung.php create mode 100644 application/controllers/api/v1/education/Anwesenheit.php create mode 100644 application/controllers/api/v1/education/Beispiel.php create mode 100644 application/controllers/api/v1/education/Betreuerart.php create mode 100644 application/controllers/api/v1/education/Feedback.php create mode 100644 application/controllers/api/v1/education/LeNotenschluessel.php create mode 100644 application/controllers/api/v1/education/LePruefung.php create mode 100644 application/controllers/api/v1/education/Legesamtnote.php create mode 100644 application/controllers/api/v1/education/Lehreinheit.php create mode 100644 application/controllers/api/v1/education/Lehreinheitgruppe.php create mode 100644 application/controllers/api/v1/education/Lehreinheitmitarbeiter.php create mode 100644 application/controllers/api/v1/education/Lehrfach.php create mode 100644 application/controllers/api/v1/education/Lehrfunktion.php create mode 100644 application/controllers/api/v1/education/Lehrtyp.php create mode 100644 application/controllers/api/v1/education/Lehrveranstaltung.php create mode 100644 application/controllers/api/v1/education/Lvangebot.php create mode 100644 application/controllers/api/v1/education/Lvgesamtnote.php create mode 100644 application/controllers/api/v1/education/Lvinfo.php create mode 100644 application/controllers/api/v1/education/Lvregel.php create mode 100644 application/controllers/api/v1/education/Lvregeltyp.php create mode 100644 application/controllers/api/v1/education/Moodle.php create mode 100644 application/controllers/api/v1/education/Notenschluessel.php create mode 100644 application/controllers/api/v1/education/Notenschluesselaufteilung.php create mode 100644 application/controllers/api/v1/education/Notenschluesseluebung.php create mode 100644 application/controllers/api/v1/education/Notenschluesselzuordnung.php create mode 100644 application/controllers/api/v1/education/Paabgabe.php create mode 100644 application/controllers/api/v1/education/Paabgabetyp.php create mode 100644 application/controllers/api/v1/education/Projektarbeit.php create mode 100644 application/controllers/api/v1/education/Projektbetreuer.php create mode 100644 application/controllers/api/v1/education/Projekttyp.php create mode 100644 application/controllers/api/v1/education/Pruefung.php create mode 100644 application/controllers/api/v1/education/Pruefungsanmeldung.php create mode 100644 application/controllers/api/v1/education/Pruefungsfenster.php create mode 100644 application/controllers/api/v1/education/Pruefungsstatus.php create mode 100644 application/controllers/api/v1/education/Pruefungstermin.php create mode 100644 application/controllers/api/v1/education/Pruefungstyp.php create mode 100644 application/controllers/api/v1/education/Studentbeispiel.php create mode 100644 application/controllers/api/v1/education/Studentlehrverband.php create mode 100644 application/controllers/api/v1/education/Studentuebung.php create mode 100644 application/controllers/api/v1/education/Uebung.php create mode 100644 application/controllers/api/v1/education/Zeugnis.php create mode 100644 application/controllers/api/v1/education/Zeugnisnote.php diff --git a/application/controllers/api/v1/education/Abgabe.php b/application/controllers/api/v1/education/Abgabe.php new file mode 100644 index 000000000..f9ad2ee8c --- /dev/null +++ b/application/controllers/api/v1/education/Abgabe.php @@ -0,0 +1,78 @@ +load->model('education/abgabe', 'AbgabeModel'); + // Load set the uid of the model to let to check the permissions + $this->AbgabeModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAbgabe() + { + $abgabe_id = $this->get('abgabe_id'); + + if(isset($abgabe_id)) + { + $result = $this->AbgabeModel->load($abgabe_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAbgabe() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['abgabe_id'])) + { + $result = $this->AbgabeModel->update($this->post()['abgabe_id'], $this->post()); + } + else + { + $result = $this->AbgabeModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($abgabe = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Abschlussbeurteilung.php b/application/controllers/api/v1/education/Abschlussbeurteilung.php new file mode 100644 index 000000000..a90e16b4f --- /dev/null +++ b/application/controllers/api/v1/education/Abschlussbeurteilung.php @@ -0,0 +1,78 @@ +load->model('education/abschlussbeurteilung', 'AbschlussbeurteilungModel'); + // Load set the uid of the model to let to check the permissions + $this->AbschlussbeurteilungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAbschlussbeurteilung() + { + $abschlussbeurteilung_kurzbz = $this->get('abschlussbeurteilung_kurzbz'); + + if(isset($abschlussbeurteilung_kurzbz)) + { + $result = $this->AbschlussbeurteilungModel->load($abschlussbeurteilung_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAbschlussbeurteilung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['$abschlussbeurteilung_kurzbz'])) + { + $result = $this->AbschlussbeurteilungModel->update($this->post()['$abschlussbeurteilung_kurzbz'], $this->post()); + } + else + { + $result = $this->AbschlussbeurteilungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($abschlussbeurteilung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Abschlusspruefung.php b/application/controllers/api/v1/education/Abschlusspruefung.php new file mode 100644 index 000000000..9ee39aba7 --- /dev/null +++ b/application/controllers/api/v1/education/Abschlusspruefung.php @@ -0,0 +1,78 @@ +load->model('education/abschlusspruefung', 'AbschlusspruefungModel'); + // Load set the uid of the model to let to check the permissions + $this->AbschlusspruefungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAbschlusspruefung() + { + $abschlusspruefung_id = $this->get('abschlusspruefung_id'); + + if(isset($abschlusspruefung_id)) + { + $result = $this->AbschlusspruefungModel->load($abschlusspruefung_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAbschlusspruefung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['abschlusspruefung_id'])) + { + $result = $this->AbschlusspruefungModel->update($this->post()['abschlusspruefung_id'], $this->post()); + } + else + { + $result = $this->AbschlusspruefungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($abschlusspruefung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Anrechnung.php b/application/controllers/api/v1/education/Anrechnung.php new file mode 100644 index 000000000..94b622e35 --- /dev/null +++ b/application/controllers/api/v1/education/Anrechnung.php @@ -0,0 +1,78 @@ +load->model('education/anrechnung', 'AnrechnungModel'); + // Load set the uid of the model to let to check the permissions + $this->AnrechnungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAnrechnung() + { + $anrechnung_id = $this->get('anrechnung_id'); + + if(isset($anrechnung_id)) + { + $result = $this->AnrechnungModel->load($anrechnung_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAnrechnung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['anrechnung_id'])) + { + $result = $this->AnrechnungModel->update($this->post()['anrechnung_id'], $this->post()); + } + else + { + $result = $this->AnrechnungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($anrechnung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Anwesenheit.php b/application/controllers/api/v1/education/Anwesenheit.php new file mode 100644 index 000000000..a717be2ae --- /dev/null +++ b/application/controllers/api/v1/education/Anwesenheit.php @@ -0,0 +1,78 @@ +load->model('education/anwesenheit', 'AnwesenheitModel'); + // Load set the uid of the model to let to check the permissions + $this->AnwesenheitModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAnwesenheit() + { + $anwesenheit_id = $this->get('anwesenheit_id'); + + if(isset($anwesenheit_id)) + { + $result = $this->AnwesenheitModel->load($anwesenheit_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAnwesenheit() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['anwesenheit_id'])) + { + $result = $this->AnwesenheitModel->update($this->post()['anwesenheit_id'], $this->post()); + } + else + { + $result = $this->AnwesenheitModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($anwesenheit = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Beispiel.php b/application/controllers/api/v1/education/Beispiel.php new file mode 100644 index 000000000..f2b899c66 --- /dev/null +++ b/application/controllers/api/v1/education/Beispiel.php @@ -0,0 +1,78 @@ +load->model('education/beispiel', 'BeispielModel'); + // Load set the uid of the model to let to check the permissions + $this->BeispielModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBeispiel() + { + $beispiel_id = $this->get('beispiel_id'); + + if(isset($beispiel_id)) + { + $result = $this->BeispielModel->load($beispiel_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBeispiel() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['beispiel_id'])) + { + $result = $this->BeispielModel->update($this->post()['beispiel_id'], $this->post()); + } + else + { + $result = $this->BeispielModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($beispiel = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Betreuerart.php b/application/controllers/api/v1/education/Betreuerart.php new file mode 100644 index 000000000..a4dc768af --- /dev/null +++ b/application/controllers/api/v1/education/Betreuerart.php @@ -0,0 +1,78 @@ +load->model('education/betreuerart', 'BetreuerartModel'); + // Load set the uid of the model to let to check the permissions + $this->BetreuerartModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBetreuerart() + { + $betreuerart_id = $this->get('betreuerart_kurzbz'); + + if(isset($betreuerart_id)) + { + $result = $this->BetreuerartModel->load($betreuerart_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBetreuerart() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['betreuerart_kurzbz'])) + { + $result = $this->BetreuerartModel->update($this->post()['betreuerart_kurzbz'], $this->post()); + } + else + { + $result = $this->BetreuerartModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($betreuerart = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Feedback.php b/application/controllers/api/v1/education/Feedback.php new file mode 100644 index 000000000..49761faf7 --- /dev/null +++ b/application/controllers/api/v1/education/Feedback.php @@ -0,0 +1,78 @@ +load->model('education/feedback', 'FeedbackModel'); + // Load set the uid of the model to let to check the permissions + $this->FeedbackModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getFeedback() + { + $feedback_id = $this->get('feedback_id'); + + if(isset($feedback_id)) + { + $result = $this->FeedbackModel->load($feedback_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postFeedback() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['feedback_id'])) + { + $result = $this->FeedbackModel->update($this->post()['feedback_id'], $this->post()); + } + else + { + $result = $this->FeedbackModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($feedback = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/LeNotenschluessel.php b/application/controllers/api/v1/education/LeNotenschluessel.php new file mode 100644 index 000000000..50816726b --- /dev/null +++ b/application/controllers/api/v1/education/LeNotenschluessel.php @@ -0,0 +1,79 @@ +load->model('education/lenotenschluessel', 'LeNotenschluesselModel'); + // Load set the uid of the model to let to check the permissions + $this->LeNotenschluesselModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getLeNotenschluessel() + { + $note = $this->get('note'); + $lehreinheit_id = $this->get('lehreinheit_id'); + + if(isset($note) && isset($lehreinheit_id)) + { + $result = $this->LeNotenschluesselModel->load(array($note, $lehreinheit_id)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postLeNotenschluessel() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['note']) && isset($this->post()['lehreinheit_id'])) + { + $result = $this->LeNotenschluesselModel->update(array($this->post()['note'], $this->post()['lehreinheit_id']), $this->post()); + } + else + { + $result = $this->LeNotenschluesselModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($lenotenschluessel = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/LePruefung.php b/application/controllers/api/v1/education/LePruefung.php new file mode 100644 index 000000000..e5db63040 --- /dev/null +++ b/application/controllers/api/v1/education/LePruefung.php @@ -0,0 +1,78 @@ +load->model('education/lepruefung', 'LePruefungModel'); + // Load set the uid of the model to let to check the permissions + $this->LePruefungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getLePruefung() + { + $lepruefung_id = $this->get('lepruefung_id'); + + if(isset($lepruefung_id)) + { + $result = $this->LePruefungModel->load($lepruefung_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postLePruefung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['lepruefung_id'])) + { + $result = $this->LePruefungModel->update($this->post()['lepruefung_id'], $this->post()); + } + else + { + $result = $this->LePruefungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($lepruefung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Legesamtnote.php b/application/controllers/api/v1/education/Legesamtnote.php new file mode 100644 index 000000000..ae2e1832b --- /dev/null +++ b/application/controllers/api/v1/education/Legesamtnote.php @@ -0,0 +1,79 @@ +load->model('education/legesamtnote', 'LegesamtnoteModel'); + // Load set the uid of the model to let to check the permissions + $this->LegesamtnoteModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getLegesamtnote() + { + $lehreinheit_id = $this->get('lehreinheit_id'); + $student_uid = $this->get('student_uid'); + + if(isset($lehreinheit_id) && isset($student_uid)) + { + $result = $this->LegesamtnoteModel->load(array($lehreinheit_id, $student_uid)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postLegesamtnote() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['lehreinheit_id']) && isset($this->post()['student_uid'])) + { + $result = $this->LegesamtnoteModel->update(array($this->post()['lehreinheit_id'], $this->post()['student_uid']), $this->post()); + } + else + { + $result = $this->LegesamtnoteModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($legesamtnote = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Lehreinheit.php b/application/controllers/api/v1/education/Lehreinheit.php new file mode 100644 index 000000000..fffbe4fdd --- /dev/null +++ b/application/controllers/api/v1/education/Lehreinheit.php @@ -0,0 +1,78 @@ +load->model('education/lehreinheit', 'LehreinheitModel'); + // Load set the uid of the model to let to check the permissions + $this->LehreinheitModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getLehreinheit() + { + $lehreinheit_id = $this->get('lehreinheit_id'); + + if(isset($lehreinheit_id)) + { + $result = $this->LehreinheitModel->load($lehreinheit_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postLehreinheit() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['lehreinheit_id'])) + { + $result = $this->LehreinheitModel->update($this->post()['lehreinheit_id'], $this->post()); + } + else + { + $result = $this->LehreinheitModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($lehreinheit = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Lehreinheitgruppe.php b/application/controllers/api/v1/education/Lehreinheitgruppe.php new file mode 100644 index 000000000..7c24fbe9b --- /dev/null +++ b/application/controllers/api/v1/education/Lehreinheitgruppe.php @@ -0,0 +1,78 @@ +load->model('education/lehreinheitgruppe', 'LehreinheitgruppeModel'); + // Load set the uid of the model to let to check the permissions + $this->LehreinheitgruppeModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getLehreinheitgruppe() + { + $lehreinheitgruppe_id = $this->get('lehreinheitgruppe_id'); + + if(isset($lehreinheitgruppe_id)) + { + $result = $this->LehreinheitgruppeModel->load($lehreinheitgruppe_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postLehreinheitgruppe() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['lehreinheitgruppe_id'])) + { + $result = $this->LehreinheitgruppeModel->update($this->post()['lehreinheitgruppe_id'], $this->post()); + } + else + { + $result = $this->LehreinheitgruppeModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($lehreinheitgruppe = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Lehreinheitmitarbeiter.php b/application/controllers/api/v1/education/Lehreinheitmitarbeiter.php new file mode 100644 index 000000000..fb4909b42 --- /dev/null +++ b/application/controllers/api/v1/education/Lehreinheitmitarbeiter.php @@ -0,0 +1,79 @@ +load->model('education/lehreinheitmitarbeiter', 'LehreinheitmitarbeiterModel'); + // Load set the uid of the model to let to check the permissions + $this->LehreinheitmitarbeiterModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getLehreinheitmitarbeiter() + { + $mitarbeiter_uid = $this->get('mitarbeiter_uid'); + $lehreinheit_id = $this->get('lehreinheit_id'); + + if(isset($mitarbeiter_uid) && isset($lehreinheit_id)) + { + $result = $this->LehreinheitmitarbeiterModel->load(array($mitarbeiter_uid, $lehreinheit_id)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postLehreinheitmitarbeiter() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['mitarbeiter_uid']) && isset($this->post()['lehreinheit_id'])) + { + $result = $this->LehreinheitmitarbeiterModel->update(array($this->post()['mitarbeiter_uid'], $this->post()['lehreinheit_id']), $this->post()); + } + else + { + $result = $this->LehreinheitmitarbeiterModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($lehreinheitmitarbeiter = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Lehrfach.php b/application/controllers/api/v1/education/Lehrfach.php new file mode 100644 index 000000000..458e860cd --- /dev/null +++ b/application/controllers/api/v1/education/Lehrfach.php @@ -0,0 +1,78 @@ +load->model('education/lehrfach', 'LehrfachModel'); + // Load set the uid of the model to let to check the permissions + $this->LehrfachModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getLehrfach() + { + $lehrfach_id = $this->get('lehrfach_id'); + + if(isset($lehrfach_id)) + { + $result = $this->LehrfachModel->load($lehrfach_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postLehrfach() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['lehrfach_id'])) + { + $result = $this->LehrfachModel->update($this->post()['lehrfach_id'], $this->post()); + } + else + { + $result = $this->LehrfachModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($lehrfach = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Lehrfunktion.php b/application/controllers/api/v1/education/Lehrfunktion.php new file mode 100644 index 000000000..1072d23fb --- /dev/null +++ b/application/controllers/api/v1/education/Lehrfunktion.php @@ -0,0 +1,78 @@ +load->model('education/lehrfunktion', 'LehrfunktionModel'); + // Load set the uid of the model to let to check the permissions + $this->LehrfunktionModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getLehrfunktion() + { + $lehrfunktion_kurzbz = $this->get('lehrfunktion_kurzbz'); + + if(isset($lehrfunktion_kurzbz)) + { + $result = $this->LehrfunktionModel->load($lehrfunktion_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postLehrfunktion() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['lehrfunktion_kurzbz'])) + { + $result = $this->LehrfunktionModel->update($this->post()['lehrfunktion_kurzbz'], $this->post()); + } + else + { + $result = $this->LehrfunktionModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($lehrfunktion = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Lehrtyp.php b/application/controllers/api/v1/education/Lehrtyp.php new file mode 100644 index 000000000..a1494b9fa --- /dev/null +++ b/application/controllers/api/v1/education/Lehrtyp.php @@ -0,0 +1,78 @@ +load->model('education/lehrtyp', 'LehrtypModel'); + // Load set the uid of the model to let to check the permissions + $this->LehrtypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getLehrtyp() + { + $lehrtyp_kurzbz = $this->get('lehrtyp_kurzbz'); + + if(isset($lehrtyp_kurzbz)) + { + $result = $this->LehrtypModel->load($lehrtyp_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postLehrtyp() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['lehrtyp_kurzbz'])) + { + $result = $this->LehrtypModel->update($this->post()['lehrtyp_kurzbz'], $this->post()); + } + else + { + $result = $this->LehrtypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($lehrtyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Lehrveranstaltung.php b/application/controllers/api/v1/education/Lehrveranstaltung.php new file mode 100644 index 000000000..bbc4676c3 --- /dev/null +++ b/application/controllers/api/v1/education/Lehrveranstaltung.php @@ -0,0 +1,78 @@ +load->model('education/lehrveranstaltung', 'LehrveranstaltungModel'); + // Load set the uid of the model to let to check the permissions + $this->LehrveranstaltungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getLehrveranstaltung() + { + $lehrveranstaltung_id = $this->get('lehrveranstaltung_id'); + + if(isset($lehrveranstaltung_id)) + { + $result = $this->LehrveranstaltungModel->load($lehrveranstaltung_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postLehrveranstaltung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['lehrveranstaltung_id'])) + { + $result = $this->LehrveranstaltungModel->update($this->post()['lehrveranstaltung_id'], $this->post()); + } + else + { + $result = $this->LehrveranstaltungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($lehrveranstaltung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Lvangebot.php b/application/controllers/api/v1/education/Lvangebot.php new file mode 100644 index 000000000..c8d905060 --- /dev/null +++ b/application/controllers/api/v1/education/Lvangebot.php @@ -0,0 +1,78 @@ +load->model('education/lvangebot', 'LvangebotModel'); + // Load set the uid of the model to let to check the permissions + $this->LvangebotModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getLvangebot() + { + $lvangebot_id = $this->get('lvangebot_id'); + + if(isset($lvangebot_id)) + { + $result = $this->LvangebotModel->load($lvangebot_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postLvangebot() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['lvangebot_id'])) + { + $result = $this->LvangebotModel->update($this->post()['lvangebot_id'], $this->post()); + } + else + { + $result = $this->LvangebotModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($lvangebot = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Lvgesamtnote.php b/application/controllers/api/v1/education/Lvgesamtnote.php new file mode 100644 index 000000000..1eff64f77 --- /dev/null +++ b/application/controllers/api/v1/education/Lvgesamtnote.php @@ -0,0 +1,85 @@ +load->model('education/lvgesamtnote', 'LvgesamtnoteModel'); + // Load set the uid of the model to let to check the permissions + $this->LvgesamtnoteModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getLvgesamtnote() + { + $student_uid = $this->get('student_uid'); + $studiensemester_kurzbz = $this->get('studiensemester_kurzbz'); + $lehrveranstaltung_id = $this->get('lehrveranstaltung_id'); + + if(isset($student_uid) && isset($studiensemester_kurzbz) && isset($lehrveranstaltung_id)) + { + $result = $this->LvgesamtnoteModel->load(array($student_uid, $studiensemester_kurzbz, $lehrveranstaltung_id)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postLvgesamtnote() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['student_uid']) && isset($this->post()['studiensemester_kurzbz']) && isset($this->post()['lehrveranstaltung_id'])) + { + $pksArray = array($this->post()['student_uid'], + $this->post()['studiensemester_kurzbz'], + $this->post()['lehrveranstaltung_id'] + ); + + $result = $this->LvgesamtnoteModel->update($pksArray, $this->post()); + } + else + { + $result = $this->LvgesamtnoteModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($lvgesamtnote = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Lvinfo.php b/application/controllers/api/v1/education/Lvinfo.php new file mode 100644 index 000000000..58cbbe523 --- /dev/null +++ b/application/controllers/api/v1/education/Lvinfo.php @@ -0,0 +1,79 @@ +load->model('education/lvinfo', 'LvinfoModel'); + // Load set the uid of the model to let to check the permissions + $this->LvinfoModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getLvinfo() + { + $sprache = $this->get('sprache'); + $lehrveranstaltung_id = $this->get('lehrveranstaltung_id'); + + if(isset($sprache) && isset($lehrveranstaltung_id)) + { + $result = $this->LvinfoModel->load(array($sprache, $lehrveranstaltung_id)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postLvinfo() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['sprache']) && isset($this->post()['lehrveranstaltung_id'])) + { + $result = $this->LvinfoModel->update(array($this->post()['sprache'], $this->post()['lehrveranstaltung_id']), $this->post()); + } + else + { + $result = $this->LvinfoModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($lvinfo = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Lvregel.php b/application/controllers/api/v1/education/Lvregel.php new file mode 100644 index 000000000..35af01822 --- /dev/null +++ b/application/controllers/api/v1/education/Lvregel.php @@ -0,0 +1,78 @@ +load->model('education/lvregel', 'LvregelModel'); + // Load set the uid of the model to let to check the permissions + $this->LvregelModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getLvregel() + { + $lvregel_id = $this->get('lvregel_id'); + + if(isset($lvregel_id)) + { + $result = $this->LvregelModel->load($lvregel_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postLvregel() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['lvregel_id'])) + { + $result = $this->LvregelModel->update($this->post()['lvregel_id'], $this->post()); + } + else + { + $result = $this->LvregelModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($lvregel = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Lvregeltyp.php b/application/controllers/api/v1/education/Lvregeltyp.php new file mode 100644 index 000000000..82b37fab1 --- /dev/null +++ b/application/controllers/api/v1/education/Lvregeltyp.php @@ -0,0 +1,78 @@ +load->model('education/lvregeltyp', 'LvregeltypModel'); + // Load set the uid of the model to let to check the permissions + $this->LvregeltypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getLvregeltyp() + { + $lvregeltyp_kurzbz = $this->get('lvregeltyp_kurzbz'); + + if(isset($lvregeltyp_kurzbz)) + { + $result = $this->LvregeltypModel->load($lvregeltyp_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postLvregeltyp() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['lvregeltyp_kurzbz'])) + { + $result = $this->LvregeltypModel->update($this->post()['lvregeltyp_kurzbz'], $this->post()); + } + else + { + $result = $this->LvregeltypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($lvregeltyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Moodle.php b/application/controllers/api/v1/education/Moodle.php new file mode 100644 index 000000000..7be95be3c --- /dev/null +++ b/application/controllers/api/v1/education/Moodle.php @@ -0,0 +1,78 @@ +load->model('education/moodle', 'MoodleModel'); + // Load set the uid of the model to let to check the permissions + $this->MoodleModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getMoodle() + { + $moodle_id = $this->get('moodle_id'); + + if(isset($moodle_id)) + { + $result = $this->MoodleModel->load($moodle_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postMoodle() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['moodle_id'])) + { + $result = $this->MoodleModel->update($this->post()['moodle_id'], $this->post()); + } + else + { + $result = $this->MoodleModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($moodle = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Notenschluessel.php b/application/controllers/api/v1/education/Notenschluessel.php new file mode 100644 index 000000000..93cc0f06c --- /dev/null +++ b/application/controllers/api/v1/education/Notenschluessel.php @@ -0,0 +1,78 @@ +load->model('education/notenschluessel', 'NotenschluesselModel'); + // Load set the uid of the model to let to check the permissions + $this->NotenschluesselModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getNotenschluessel() + { + $notenschluessel_kurzbz = $this->get('notenschluessel_kurzbz'); + + if(isset($notenschluessel_kurzbz)) + { + $result = $this->NotenschluesselModel->load($notenschluessel_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postNotenschluessel() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['notenschluessel_kurzbz'])) + { + $result = $this->NotenschluesselModel->update($this->post()['notenschluessel_kurzbz'], $this->post()); + } + else + { + $result = $this->NotenschluesselModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($notenschluessel = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Notenschluesselaufteilung.php b/application/controllers/api/v1/education/Notenschluesselaufteilung.php new file mode 100644 index 000000000..05096f41a --- /dev/null +++ b/application/controllers/api/v1/education/Notenschluesselaufteilung.php @@ -0,0 +1,78 @@ +load->model('education/notenschluesselaufteilung', 'NotenschluesselaufteilungModel'); + // Load set the uid of the model to let to check the permissions + $this->NotenschluesselaufteilungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getNotenschluesselaufteilung() + { + $notenschluesselaufteilung_id = $this->get('notenschluesselaufteilung_id'); + + if(isset($notenschluesselaufteilung_id)) + { + $result = $this->NotenschluesselaufteilungModel->load($notenschluesselaufteilung_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postNotenschluesselaufteilung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['notenschluesselaufteilung_id'])) + { + $result = $this->NotenschluesselaufteilungModel->update($this->post()['notenschluesselaufteilung_id'], $this->post()); + } + else + { + $result = $this->NotenschluesselaufteilungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($notenschluesselaufteilung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Notenschluesseluebung.php b/application/controllers/api/v1/education/Notenschluesseluebung.php new file mode 100644 index 000000000..02efcbc80 --- /dev/null +++ b/application/controllers/api/v1/education/Notenschluesseluebung.php @@ -0,0 +1,79 @@ +load->model('education/notenschluesseluebung', 'NotenschluesseluebungModel'); + // Load set the uid of the model to let to check the permissions + $this->NotenschluesseluebungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getNotenschluesseluebung() + { + $note = $this->get('note'); + $uebung_id = $this->get('uebung_id'); + + if(isset($note) && isset($uebung_id)) + { + $result = $this->NotenschluesseluebungModel->load(array($note, $uebung_id)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postNotenschluesseluebung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['note']) && isset($this->post()['uebung_id'])) + { + $result = $this->NotenschluesseluebungModel->update(array($this->post()['note'], $this->post()['uebung_id']), $this->post()); + } + else + { + $result = $this->NotenschluesseluebungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($notenschluesseluebung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Notenschluesselzuordnung.php b/application/controllers/api/v1/education/Notenschluesselzuordnung.php new file mode 100644 index 000000000..b87713dee --- /dev/null +++ b/application/controllers/api/v1/education/Notenschluesselzuordnung.php @@ -0,0 +1,78 @@ +load->model('education/notenschluesselzuordnung', 'NotenschluesselzuordnungModel'); + // Load set the uid of the model to let to check the permissions + $this->NotenschluesselzuordnungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getNotenschluesselzuordnung() + { + $notenschluesselzuordnung_id = $this->get('notenschluesselzuordnung_id'); + + if(isset($notenschluesselzuordnung_id)) + { + $result = $this->NotenschluesselzuordnungModel->load($notenschluesselzuordnung_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postNotenschluesselzuordnung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['notenschluesselzuordnung_id'])) + { + $result = $this->NotenschluesselzuordnungModel->update($this->post()['notenschluesselzuordnung_id'], $this->post()); + } + else + { + $result = $this->NotenschluesselzuordnungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($notenschluesselzuordnung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Paabgabe.php b/application/controllers/api/v1/education/Paabgabe.php new file mode 100644 index 000000000..09e9b0e69 --- /dev/null +++ b/application/controllers/api/v1/education/Paabgabe.php @@ -0,0 +1,78 @@ +load->model('education/paabgabe', 'PaabgabeModel'); + // Load set the uid of the model to let to check the permissions + $this->PaabgabeModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getPaabgabe() + { + $paabgabe_id = $this->get('paabgabe_id'); + + if(isset($paabgabe_id)) + { + $result = $this->PaabgabeModel->load($paabgabe_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postPaabgabe() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['paabgabe_id'])) + { + $result = $this->PaabgabeModel->update($this->post()['paabgabe_id'], $this->post()); + } + else + { + $result = $this->PaabgabeModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($paabgabe = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Paabgabetyp.php b/application/controllers/api/v1/education/Paabgabetyp.php new file mode 100644 index 000000000..e3aba1059 --- /dev/null +++ b/application/controllers/api/v1/education/Paabgabetyp.php @@ -0,0 +1,78 @@ +load->model('education/paabgabetyp', 'PaabgabetypModel'); + // Load set the uid of the model to let to check the permissions + $this->PaabgabetypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getPaabgabetyp() + { + $paabgabetyp_kurzbz = $this->get('paabgabetyp_kurzbz'); + + if(isset($paabgabetyp_kurzbz)) + { + $result = $this->PaabgabetypModel->load($paabgabetyp_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postPaabgabetyp() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['paabgabetyp_kurzbz'])) + { + $result = $this->PaabgabetypModel->update($this->post()['paabgabetyp_kurzbz'], $this->post()); + } + else + { + $result = $this->PaabgabetypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($paabgabetyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Projektarbeit.php b/application/controllers/api/v1/education/Projektarbeit.php new file mode 100644 index 000000000..316dd0cd4 --- /dev/null +++ b/application/controllers/api/v1/education/Projektarbeit.php @@ -0,0 +1,78 @@ +load->model('education/projektarbeit', 'ProjektarbeitModel'); + // Load set the uid of the model to let to check the permissions + $this->ProjektarbeitModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getProjektarbeit() + { + $projektarbeit_id = $this->get('projektarbeit_id'); + + if(isset($projektarbeit_id)) + { + $result = $this->ProjektarbeitModel->load($projektarbeit_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postProjektarbeit() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['projektarbeit_id'])) + { + $result = $this->ProjektarbeitModel->update($this->post()['projektarbeit_id'], $this->post()); + } + else + { + $result = $this->ProjektarbeitModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($projektarbeit = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Projektbetreuer.php b/application/controllers/api/v1/education/Projektbetreuer.php new file mode 100644 index 000000000..87ec25a7d --- /dev/null +++ b/application/controllers/api/v1/education/Projektbetreuer.php @@ -0,0 +1,85 @@ +load->model('education/projektbetreuer', 'ProjektbetreuerModel'); + // Load set the uid of the model to let to check the permissions + $this->ProjektbetreuerModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getProjektbetreuer() + { + $betreuerart_kurzbz = $this->get('betreuerart_kurzbz'); + $projektarbeit_id = $this->get('projektarbeit_id'); + $person_id = $this->get('person_id'); + + if(isset($betreuerart_kurzbz) && isset($projektarbeit_id) && isset($person_id)) + { + $result = $this->ProjektbetreuerModel->load(array($betreuerart_kurzbz, $projektarbeit_id, $person_id)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postProjektbetreuer() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['betreuerart_kurzbz']) && isset($this->post()['projektarbeit_id']) && isset($this->post()['person_id'])) + { + $pksArray = array($this->post()['betreuerart_kurzbz'], + $this->post()['projektarbeit_id'], + $this->post()['person_id'] + ); + + $result = $this->ProjektbetreuerModel->update($pksArray, $this->post()); + } + else + { + $result = $this->ProjektbetreuerModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($projektbetreuer = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Projekttyp.php b/application/controllers/api/v1/education/Projekttyp.php new file mode 100644 index 000000000..1881520b9 --- /dev/null +++ b/application/controllers/api/v1/education/Projekttyp.php @@ -0,0 +1,78 @@ +load->model('education/projekttyp', 'ProjekttypModel'); + // Load set the uid of the model to let to check the permissions + $this->ProjekttypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getProjekttyp() + { + $projekttyp_kurzbz = $this->get('projekttyp_kurzbz'); + + if(isset($projekttyp_kurzbz)) + { + $result = $this->ProjekttypModel->load($projekttyp_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postProjekttyp() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['projekttyp_kurzbz'])) + { + $result = $this->ProjekttypModel->update($this->post()['projekttyp_kurzbz'], $this->post()); + } + else + { + $result = $this->ProjekttypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($projekttyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Pruefung.php b/application/controllers/api/v1/education/Pruefung.php new file mode 100644 index 000000000..03d2c6246 --- /dev/null +++ b/application/controllers/api/v1/education/Pruefung.php @@ -0,0 +1,78 @@ +load->model('education/pruefung', 'PruefungModel'); + // Load set the uid of the model to let to check the permissions + $this->PruefungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getPruefung() + { + $pruefung_id = $this->get('pruefung_id'); + + if(isset($pruefung_id)) + { + $result = $this->PruefungModel->load($pruefung_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postPruefung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['pruefung_id'])) + { + $result = $this->PruefungModel->update($this->post()['pruefung_id'], $this->post()); + } + else + { + $result = $this->PruefungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($pruefung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Pruefungsanmeldung.php b/application/controllers/api/v1/education/Pruefungsanmeldung.php new file mode 100644 index 000000000..afb00dcb7 --- /dev/null +++ b/application/controllers/api/v1/education/Pruefungsanmeldung.php @@ -0,0 +1,78 @@ +load->model('education/pruefungsanmeldung', 'PruefungsanmeldungModel'); + // Load set the uid of the model to let to check the permissions + $this->PruefungsanmeldungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getPruefungsanmeldung() + { + $pruefungsanmeldung_id = $this->get('pruefungsanmeldung_id'); + + if(isset($pruefungsanmeldung_id)) + { + $result = $this->PruefungsanmeldungModel->load($pruefungsanmeldung_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postPruefungsanmeldung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['pruefungsanmeldung_id'])) + { + $result = $this->PruefungsanmeldungModel->update($this->post()['pruefungsanmeldung_id'], $this->post()); + } + else + { + $result = $this->PruefungsanmeldungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($pruefungsanmeldung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Pruefungsfenster.php b/application/controllers/api/v1/education/Pruefungsfenster.php new file mode 100644 index 000000000..e2f247600 --- /dev/null +++ b/application/controllers/api/v1/education/Pruefungsfenster.php @@ -0,0 +1,78 @@ +load->model('education/pruefungsfenster', 'PruefungsfensterModel'); + // Load set the uid of the model to let to check the permissions + $this->PruefungsfensterModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getPruefungsfenster() + { + $pruefungsfenster_id = $this->get('pruefungsfenster_id'); + + if(isset($pruefungsfenster_id)) + { + $result = $this->PruefungsfensterModel->load($pruefungsfenster_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postPruefungsfenster() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['pruefungsfenster_id'])) + { + $result = $this->PruefungsfensterModel->update($this->post()['pruefungsfenster_id'], $this->post()); + } + else + { + $result = $this->PruefungsfensterModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($pruefungsfenster = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Pruefungsstatus.php b/application/controllers/api/v1/education/Pruefungsstatus.php new file mode 100644 index 000000000..106bf018c --- /dev/null +++ b/application/controllers/api/v1/education/Pruefungsstatus.php @@ -0,0 +1,78 @@ +load->model('education/pruefungsstatus', 'PruefungsstatusModel'); + // Load set the uid of the model to let to check the permissions + $this->PruefungsstatusModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getPruefungsstatus() + { + $status_kurzbz = $this->get('status_kurzbz'); + + if(isset($status_kurzbz)) + { + $result = $this->PruefungsstatusModel->load($status_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postPruefungsstatus() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['status_kurzbz'])) + { + $result = $this->PruefungsstatusModel->update($this->post()['status_kurzbz'], $this->post()); + } + else + { + $result = $this->PruefungsstatusModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($pruefungsstatus = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Pruefungstermin.php b/application/controllers/api/v1/education/Pruefungstermin.php new file mode 100644 index 000000000..89d16b87a --- /dev/null +++ b/application/controllers/api/v1/education/Pruefungstermin.php @@ -0,0 +1,78 @@ +load->model('education/pruefungstermin', 'PruefungsterminModel'); + // Load set the uid of the model to let to check the permissions + $this->PruefungsterminModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getPruefungstermin() + { + $pruefungstermin_id = $this->get('pruefungstermin_id'); + + if(isset($pruefungstermin_id)) + { + $result = $this->PruefungsterminModel->load($pruefungstermin_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postPruefungstermin() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['pruefungstermin_id'])) + { + $result = $this->PruefungsterminModel->update($this->post()['pruefungstermin_id'], $this->post()); + } + else + { + $result = $this->PruefungsterminModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($pruefungstermin = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Pruefungstyp.php b/application/controllers/api/v1/education/Pruefungstyp.php new file mode 100644 index 000000000..6fc1e465b --- /dev/null +++ b/application/controllers/api/v1/education/Pruefungstyp.php @@ -0,0 +1,78 @@ +load->model('education/pruefungstyp', 'PruefungstypModel'); + // Load set the uid of the model to let to check the permissions + $this->PruefungstypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getPruefungstyp() + { + $pruefungstyp_kurzbz = $this->get('pruefungstyp_kurzbz'); + + if(isset($pruefungstyp_kurzbz)) + { + $result = $this->PruefungstypModel->load($pruefungstyp_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postPruefungstyp() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['pruefungstyp_kurzbz'])) + { + $result = $this->PruefungstypModel->update($this->post()['pruefungstyp_kurzbz'], $this->post()); + } + else + { + $result = $this->PruefungstypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($pruefungstyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Studentbeispiel.php b/application/controllers/api/v1/education/Studentbeispiel.php new file mode 100644 index 000000000..3e20d0803 --- /dev/null +++ b/application/controllers/api/v1/education/Studentbeispiel.php @@ -0,0 +1,79 @@ +load->model('education/studentbeispiel', 'StudentbeispielModel'); + // Load set the uid of the model to let to check the permissions + $this->StudentbeispielModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStudentbeispiel() + { + $beispiel_id = $this->get('beispiel_id'); + $student_uid = $this->get('student_uid'); + + if(isset($beispiel_id) && isset($student_uid)) + { + $result = $this->StudentbeispielModel->load(array($beispiel_id, $student_uid)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStudentbeispiel() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['beispiel_id']) && isset($this->post()['student_uid'])) + { + $result = $this->StudentbeispielModel->update(array($this->post()['beispiel_id'], $this->post()['student_uid']), $this->post()); + } + else + { + $result = $this->StudentbeispielModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($studentbeispiel = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Studentlehrverband.php b/application/controllers/api/v1/education/Studentlehrverband.php new file mode 100644 index 000000000..fed034881 --- /dev/null +++ b/application/controllers/api/v1/education/Studentlehrverband.php @@ -0,0 +1,79 @@ +load->model('education/studentlehrverband', 'StudentlehrverbandModel'); + // Load set the uid of the model to let to check the permissions + $this->StudentlehrverbandModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStudentlehrverband() + { + $studiensemester_kurzbz = $this->get('studiensemester_kurzbz'); + $student_uid = $this->get('student_uid'); + + if(isset($studiensemester_kurzbz) && isset($student_uid)) + { + $result = $this->StudentlehrverbandModel->load(array($studiensemester_kurzbz, $student_uid)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStudentlehrverband() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['studiensemester_kurzbz']) && isset($this->post()['student_uid'])) + { + $result = $this->StudentlehrverbandModel->update(array($this->post()['studiensemester_kurzbz'], $this->post()['student_uid']), $this->post()); + } + else + { + $result = $this->StudentlehrverbandModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($studentlehrverband = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Studentuebung.php b/application/controllers/api/v1/education/Studentuebung.php new file mode 100644 index 000000000..b869f0637 --- /dev/null +++ b/application/controllers/api/v1/education/Studentuebung.php @@ -0,0 +1,79 @@ +load->model('education/studentuebung', 'StudentuebungModel'); + // Load set the uid of the model to let to check the permissions + $this->StudentuebungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStudentuebung() + { + $uebung_id = $this->get('uebung_id'); + $student_uid = $this->get('student_uid'); + + if(isset($uebung_id) && isset($student_uid)) + { + $result = $this->StudentuebungModel->load(array($uebung_id, $student_uid)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStudentuebung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['uebung_id']) && isset($this->post()['student_uid'])) + { + $result = $this->StudentuebungModel->update(array($this->post()['uebung_id'], $this->post()['student_uid']), $this->post()); + } + else + { + $result = $this->StudentuebungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($studentuebung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Uebung.php b/application/controllers/api/v1/education/Uebung.php new file mode 100644 index 000000000..e8146e2e9 --- /dev/null +++ b/application/controllers/api/v1/education/Uebung.php @@ -0,0 +1,78 @@ +load->model('education/uebung', 'UebungModel'); + // Load set the uid of the model to let to check the permissions + $this->UebungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getUebung() + { + $uebung_id = $this->get('uebung_id'); + + if(isset($uebung_id)) + { + $result = $this->UebungModel->load($uebung_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postUebung() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['uebung_id'])) + { + $result = $this->UebungModel->update($this->post()['uebung_id'], $this->post()); + } + else + { + $result = $this->UebungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($uebung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Zeugnis.php b/application/controllers/api/v1/education/Zeugnis.php new file mode 100644 index 000000000..1a57fdfdd --- /dev/null +++ b/application/controllers/api/v1/education/Zeugnis.php @@ -0,0 +1,78 @@ +load->model('education/zeugnis', 'ZeugnisModel'); + // Load set the uid of the model to let to check the permissions + $this->ZeugnisModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getZeugnis() + { + $zeugnis_id = $this->get('zeugnis_id'); + + if(isset($zeugnis_id)) + { + $result = $this->ZeugnisModel->load($zeugnis_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postZeugnis() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['zeugnis_id'])) + { + $result = $this->ZeugnisModel->update($this->post()['zeugnis_id'], $this->post()); + } + else + { + $result = $this->ZeugnisModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($zeugnis = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Zeugnisnote.php b/application/controllers/api/v1/education/Zeugnisnote.php new file mode 100644 index 000000000..e093eb964 --- /dev/null +++ b/application/controllers/api/v1/education/Zeugnisnote.php @@ -0,0 +1,85 @@ +load->model('education/zeugnisnote', 'ZeugnisnoteModel'); + // Load set the uid of the model to let to check the permissions + $this->ZeugnisnoteModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getZeugnisnote() + { + $studiensemester_kurzbz = $this->get('studiensemester_kurzbz'); + $student_uid = $this->get('student_uid'); + $lehrveranstaltung_id = $this->get('lehrveranstaltung_id'); + + if(isset($studiensemester_kurzbz) && isset($student_uid) && isset($lehrveranstaltung_id)) + { + $result = $this->ZeugnisnoteModel->load(array($studiensemester_kurzbz, $student_uid, $lehrveranstaltung_id)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postZeugnisnote() + { + if($this->_validate($this->post())) + { + if(isset($this->post()['studiensemester_kurzbz']) && isset($this->post()['student_uid']) && isset($this->post()['lehrveranstaltung_id'])) + { + $pksArray = array($this->post()['studiensemester_kurzbz'], + $this->post()['student_uid'], + $this->post()['lehrveranstaltung_id'] + ); + + $result = $this->ZeugnisnoteModel->update($pksArray, $this->post()); + } + else + { + $result = $this->ZeugnisnoteModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($zeugnisnote = NULL) + { + return true; + } +} \ No newline at end of file From 42e911b4fed8496e3c27920ac9af46206506596c Mon Sep 17 00:00:00 2001 From: Paminger Date: Fri, 20 May 2016 07:44:08 +0200 Subject: [PATCH 20/31] CodeSniffer --- include/person.class.php | 17 +- .../ControlSignatureSniff.php | 8 +- .../CamelCapsMethodNameSniff.php | 2 +- .../ValidVariableNameSniff.php | 171 ------------------ tests/codesniffer/FHComplete/ruleset.xml | 7 + 5 files changed, 21 insertions(+), 184 deletions(-) delete mode 100644 tests/codesniffer/FHComplete/Sniffs/NamingConventions/ValidVariableNameSniff.php diff --git a/include/person.class.php b/include/person.class.php index 58b718de0..cc83fa701 100644 --- a/include/person.class.php +++ b/include/person.class.php @@ -90,19 +90,19 @@ class person extends Person_model public function load($personId) { //person_id auf gueltigkeit pruefen - if(is_numeric($personId) && $personId != '') + if (is_numeric($personId) && $personId != '') { $result = $this->getPerson($personId); - if(!is_object($result)) + if (!is_object($result)) { $this->errormsg = "Fehler beim Lesen der Personendaten\n"; - return FALSE; + return false; } $row = $result->row(); - if(isset($row)) + if (isset($row)) { $this->person_id = $row->person_id; $this->sprache = $row->sprache; @@ -177,7 +177,7 @@ class person extends Person_model * auf Gueltigkeit. * @return true wenn ok, false im Fehlerfall **/ - protected function validate() + public function validate() { $this->nachname = trim($this->nachname); $this->vorname = trim($this->vorname); @@ -271,8 +271,10 @@ class person extends Person_model $gewichtung = array(3, 7, 9, 0, 5, 8, 4, 2, 1, 6); $erg = 0; //Quersumme bilden - for($i = 0; $i < 10; $i++) + for ($i = 0; $i < 10; $i++) + { $erg += $gewichtung[$i] * $this->svnr{$i}; + } if ($this->svnr{3} != ($erg % 11)) //Vergleichen der Pruefziffer mit Quersumme Modulo 11 { @@ -280,7 +282,7 @@ class person extends Person_model return false; } } - + if ($this->svnr != '') { //Pruefen ob bereits ein Eintrag mit dieser SVNR vorhanden ist @@ -501,7 +503,6 @@ class person extends Person_model } } return true; - } else { diff --git a/tests/codesniffer/FHComplete/Sniffs/ControlStructures/ControlSignatureSniff.php b/tests/codesniffer/FHComplete/Sniffs/ControlStructures/ControlSignatureSniff.php index b78202cec..6b2f483d0 100644 --- a/tests/codesniffer/FHComplete/Sniffs/ControlStructures/ControlSignatureSniff.php +++ b/tests/codesniffer/FHComplete/Sniffs/ControlStructures/ControlSignatureSniff.php @@ -40,16 +40,16 @@ class FHComplete_Sniffs_ControlStructures_ControlSignatureSniff extends PHP_Code protected function getPatterns() { return array( - 'try {EOL...}\s+catch (...)EOL...{EOL...EOL...}', - 'do+EOL...{EOL...EOL...} while (...);EOL', + 'tryEOL...{EOL...}EOL...catch (...)EOL...{EOL...}EOL', + 'doEOL...{EOL...EOL...}EOL...while (...);EOL', 'while (...)EOL...{EOL', - 'for (...) {EOL', + 'for (...)EOL...{EOL', 'if (...)EOL...{EOL', 'foreach (...)EOL...{EOL', '}EOL...\s+else if (...)EOL...{EOL', '}EOL...\s+elseif (...)EOL...{EOL', '}EOL...\s+else+EOL...{EOL', - 'do+EOL...{EOL', + 'doEOL...{EOL', ); }//end getPatterns() diff --git a/tests/codesniffer/FHComplete/Sniffs/NamingConventions/CamelCapsMethodNameSniff.php b/tests/codesniffer/FHComplete/Sniffs/NamingConventions/CamelCapsMethodNameSniff.php index b5ea68b47..e99f05e04 100644 --- a/tests/codesniffer/FHComplete/Sniffs/NamingConventions/CamelCapsMethodNameSniff.php +++ b/tests/codesniffer/FHComplete/Sniffs/NamingConventions/CamelCapsMethodNameSniff.php @@ -71,7 +71,7 @@ class FHComplete_Sniffs_NamingConventions_CamelCapsMethodNameSniff extends Gener $error = 'Method name "%s" is not in camel caps format'; $className = $phpcsFile->getDeclarationName($currScope); $errorData = array($className.'::'.$methodName); - $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $errorData); + $phpcsFile->addWarning($error, $stackPtr, 'NotCamelCaps', $errorData); $phpcsFile->recordMetric($stackPtr, 'CamelCase method name', 'no'); } else { $phpcsFile->recordMetric($stackPtr, 'CamelCase method name', 'yes'); diff --git a/tests/codesniffer/FHComplete/Sniffs/NamingConventions/ValidVariableNameSniff.php b/tests/codesniffer/FHComplete/Sniffs/NamingConventions/ValidVariableNameSniff.php deleted file mode 100644 index bce627331..000000000 --- a/tests/codesniffer/FHComplete/Sniffs/NamingConventions/ValidVariableNameSniff.php +++ /dev/null @@ -1,171 +0,0 @@ -getTokens(); - $varName = ltrim($tokens[$stackPtr]['content'], '$'); - - $phpReservedVars = array( - '_SERVER', - '_GET', - '_POST', - '_REQUEST', - '_SESSION', - '_ENV', - '_COOKIE', - '_FILES', - 'GLOBALS', - ); - - // If it's a php reserved var, then its ok. - if (in_array($varName, $phpReservedVars) === true) { - return; - } - - // There is no way for us to know if the var is public or private, - // so we have to ignore a leading underscore if there is one and just - // check the main part of the variable name. - $originalVarName = $varName; - if (substr($varName, 0, 1) === '_') { - $objOperator = $phpcsFile->findPrevious(array(T_WHITESPACE), ($stackPtr - 1), null, true); - if ($tokens[$objOperator]['code'] === T_DOUBLE_COLON) { - // The variable lives within a class, and is referenced like - // this: MyClass::$_variable, so we don't know its scope. - $inClass = true; - } else { - $inClass = $phpcsFile->hasCondition($stackPtr, array(T_TRAIT, T_CLASS, T_INTERFACE)); - } - - if ($inClass === true) { - $varName = ltrim($varName, '_'); - } - } - - // $title_for_layout is allowed on controllers - $fileName = basename($phpcsFile->getFilename(), '.php'); - if ((substr($fileName, -10) === 'Controller') && ($varName == 'title_for_layout')) { - return; - } - - if ($this->_isValidVar($varName) === false) { - $error = 'Variable "%s" is not in valid camel caps format'; - $data = array($originalVarName); - $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $data); - } - } - -/** - * Processes class member variables. - * - * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param integer $stackPtr The position of the current token in the - * stack passed in $tokens. - * @return void - */ - protected function processMemberVar(PHP_CodeSniffer_File $phpcsFile, $stackPtr) { - } - -/** - * Processes the variable found within a double quoted string. - * - * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param integer $stackPtr The position of the double quoted string. - * @return void - */ - protected function processVariableInString(PHP_CodeSniffer_File $phpcsFile, $stackPtr) { - $tokens = $phpcsFile->getTokens(); - - $phpReservedVars = array( - '_SERVER', - '_GET', - '_POST', - '_REQUEST', - '_SESSION', - '_ENV', - '_COOKIE', - '_FILES', - 'GLOBALS', - ); - - if (preg_match_all('|[^\\\]\$([a-zA-Z0-9_]+)|', $tokens[$stackPtr]['content'], $matches) !== 0) { - foreach ($matches[1] as $varName) { - // If it's a php reserved var, then its ok. - if (in_array($varName, $phpReservedVars) === true) { - continue; - } - - // There is no way for us to know if the var is public or private, - // so we have to ignore a leading underscore if there is one and just - // check the main part of the variable name. - $originalVarName = $varName; - if (substr($varName, 0, 1) === '_') { - if ($phpcsFile->hasCondition($stackPtr, array(T_CLASS, T_INTERFACE)) === true) { - $varName = substr($varName, 1); - } - } - - if ($this->_isValidVar($varName) === false) { - $error = 'Variable "%s" is not in valid camel caps format'; - $data = array($originalVarName); - $phpcsFile->addError($error, $stackPtr, 'StringVarNotCamelCaps', $data); - } - } - } - } - -/** - * Check that a variable is a valid shape. - * - * Variables in FHComplete can either be $fooBar, $FooBar, $_fooBar, or $_FooBar. - * - * @param string $string The variable to check. - * @param boolea $public Whether or not the variable is public. - * @return boolean - */ - protected function _isValidVar($string, $public = true) { - $firstChar = '[a-zA-Z]'; - if (!$public) { - $firstChar = '[_]{1,2}' . $firstChar; - } - if (preg_match("|^$firstChar|", $string) === 0) { - return false; - } - $firstStringCount = 1; - if (preg_match("|^__|", $string)) { - $firstStringCount = 2; - } - // Check that the name only contains legal characters. - $legalChars = 'a-zA-Z0-9'; - if (preg_match("|[^$legalChars]|", substr($string, $firstStringCount)) > 0) { - return false; - } - return true; - } - -} diff --git a/tests/codesniffer/FHComplete/ruleset.xml b/tests/codesniffer/FHComplete/ruleset.xml index 6673d18fe..25055a89a 100644 --- a/tests/codesniffer/FHComplete/ruleset.xml +++ b/tests/codesniffer/FHComplete/ruleset.xml @@ -12,6 +12,7 @@ + @@ -22,7 +23,13 @@ + + +