From 674e8323920c525e68ae8576be10b8a001423260 Mon Sep 17 00:00:00 2001 From: paolo Date: Wed, 18 May 2016 16:09:47 +0200 Subject: [PATCH 1/4] 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 2/4] 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 3/4] 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 4/4] 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 @@ + + +