diff --git a/.gitignore b/.gitignore index 51b973de7..7fdf62e73 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ documents/ .settings .project .buildpath +application/config/development/ tests/codeception/codeception.yml tests/codeception/tests/api.suite.yml tests/codeception/tests/functional.suite.yml @@ -19,4 +20,4 @@ tests/codeception/_output/* /submodules/d3 composer.lock bin -/tests/codeception/api.suite.yml \ No newline at end of file +/tests/codeception/api.suite.yml diff --git a/application/config/autoload.php b/application/config/autoload.php index dd66c13b6..6bbcbf33b 100755 --- a/application/config/autoload.php +++ b/application/config/autoload.php @@ -1,5 +1,5 @@ '', diff --git a/application/config/fhcomplete.php b/application/config/fhcomplete.php index 37bb2a457..47867d517 100644 --- a/application/config/fhcomplete.php +++ b/application/config/fhcomplete.php @@ -6,17 +6,227 @@ $config['fhc_version'] = '3.2'; $config['fhc_acl'] = array ( - 'bis.tbl_nation' => 'basis/nation', + 'bis.tbl_archiv' => 'basis/archiv', + 'bis.tbl_ausbildung' => 'basis/ausbildung', + 'bis.tbl_berufstaetigkeit' => 'basis/berufstaetigkeit', + 'bis.tbl_beschaeftigungsausmass' => 'basis/beschaeftigungsausmass', + 'bis.tbl_besqual' => 'basis/besqual', + 'bis.tbl_bisfunktion' => 'basis/bisfunktion', + 'bis.tbl_bisio' => 'basis/bisio', + 'bis.tbl_bisorgform' => 'basis/bisorgform', + 'bis.tbl_bisverwendung' => 'basis/bisverwendung', + 'bis.tbl_bundesland' => 'basis/bundesland', + 'bis.tbl_entwicklungsteam' => 'basis/entwicklungsteam', + 'bis.tbl_gemeinde' => 'basis/gemeinde', + 'bis.tbl_hauptberuf' => 'basis/hauptberuf', 'bis.tbl_lgartcode' => 'basis/lgartcode', - - 'lehre.tbl_studienplan' => 'basis/studienplan', + 'bis.tbl_mobilitaetsprogramm' => 'basis/mobilitaetsprogramm', + 'bis.tbl_nation' => 'basis/nation', + 'bis.tbl_orgform' => 'basis/orgform', + 'bis.tbl_verwendung' => 'basis/verwendung', + 'bis.tbl_zgv' => 'basis/zgv', + 'bis.tbl_zgvdoktor' => 'basis/zgvdoktor', + 'bis.tbl_zgvgruppe' => 'basis/zgvgruppe', + 'bis.tbl_zgvmaster' => 'basis/zgvmaster', + 'bis.tbl_zweck' => 'basis/zweck', + 'campus.tbl_abgabe' => 'basis/abgabe', + 'campus.tbl_anwesenheit' => 'basis/anwesenheit', + 'campus.tbl_beispiel' => 'basis/beispiel', + 'campus.tbl_content' => 'basis/content', + 'campus.tbl_contentchild' => 'basis/contentchild', + 'campus.tbl_contentgruppe' => 'basis/contentgruppe', + 'campus.tbl_contentlog' => 'basis/contentlog', + 'campus.tbl_contentsprache' => 'basis/contentsprache', + 'campus.tbl_coodle' => 'basis/coodle', + 'campus.tbl_dms' => 'basis/dms', + 'campus.tbl_erreichbarkeit' => 'basis/erreichbarkeit', + 'campus.tbl_feedback' => 'basis/feedback', + 'campus.tbl_freebusy' => 'basis/freebusy', + 'campus.tbl_freebusytyp' => 'basis/freebusytyp', + 'campus.tbl_infoscreen' => 'basis/infoscreen', + 'campus.tbl_legesamtnote' => 'basis/legesamtnote', + 'campus.tbl_lvgesamtnote' => 'basis/lvgesamtnote', + 'campus.tbl_lvinfo' => 'basis/lvinfo', + 'campus.tbl_news' => 'basis/news', + 'campus.tbl_notenschluessel' => 'basis/notenschluessel', + 'campus.tbl_notenschluesseluebung' => 'basis/notenschluesseluebung', + 'campus.tbl_paabgabe' => 'basis/paabgabe', + 'campus.tbl_paabgabetyp' => 'basis/paabgabetyp', + 'campus.tbl_pruefung' => 'basis/pruefung', + 'campus.tbl_pruefungsanmeldung' => 'basis/pruefungsanmeldung', + 'campus.tbl_pruefungsfenster' => 'basis/pruefungsfenster', + 'campus.tbl_pruefungsstatus' => 'basis/pruefungsstatus', + 'campus.tbl_pruefungstermin' => 'basis/pruefungstermin', + 'campus.tbl_reservierung' => 'basis/reservierung', + 'campus.tbl_resturlaub' => 'basis/resturlaub', + 'campus.tbl_studentbeispiel' => 'basis/studentbeispiel', + 'campus.tbl_studentuebung' => 'basis/studentuebung', + 'campus.tbl_template' => 'basis/template', + 'campus.tbl_uebung' => 'basis/uebung', + 'campus.tbl_veranstaltung' => 'basis/veranstaltung', + 'campus.tbl_veranstaltungskategorie' => 'basis/veranstaltungskategorie', + 'campus.tbl_zeitaufzeichnung' => 'basis/zeitaufzeichnung', + 'campus.tbl_zeitsperre' => 'basis/zeitsperre', + 'campus.tbl_zeitsperretyp' => 'basis/zeitsperretyp', + 'campus.tbl_zeitwunsch' => 'basis/zeitwunsch', + 'fue.tbl_aktivitaet' => 'basis/aktivitaet', + 'fue.tbl_aufwandstyp' => 'basis/aufwandstyp', + 'fue.tbl_projekt' => 'basis/projekt', + 'fue.tbl_projekt_ressource' => 'basis/projekt_ressource', + 'fue.tbl_projektphase' => 'basis/projektphase', + 'fue.tbl_projekttask' => 'basis/projekttask', + 'fue.tbl_ressource' => 'basis/ressource', + 'fue.tbl_scrumsprint' => 'basis/scrumsprint', + 'fue.tbl_scrumteam' => 'basis/scrumteam', + 'lehre.tbl_abschlussbeurteilung' => 'basis/abschlussbeurteilung', + 'lehre.tbl_abschlusspruefung' => 'basis/abschlusspruefung', + 'lehre.tbl_akadgrad' => 'basis/akadgrad', + 'lehre.tbl_anrechnung' => 'basis/anrechnung', + 'lehre.tbl_betreuerart' => 'basis/betreuerart', + 'lehre.tbl_ferien' => 'basis/ferien', + 'lehre.tbl_lehreinheit' => 'basis/lehreinheit', + 'lehre.tbl_lehreinheitgruppe' => 'basis/lehreinheitgruppe', + 'lehre.tbl_lehreinheitmitarbeiter' => 'basis/lehreinheitmitarbeiter', + 'lehre.tbl_lehrfach' => 'basis/lehrfach', + 'lehre.tbl_lehrform' => 'basis/lehrform', + 'lehre.tbl_lehrfunktion' => 'basis/lehrfunktion', + 'lehre.tbl_lehrmittel' => 'basis/lehrmittel', + 'lehre.tbl_lehrtyp' => 'basis/lehrtyp', + 'lehre.tbl_lehrveranstaltung' => 'basis/lehrveranstaltung', + 'lehre.tbl_lvangebot' => 'basis/lvangebot', + 'lehre.tbl_lvregel' => 'basis/lvregel', + 'lehre.tbl_lvregeltyp' => 'basis/lvregeltyp', + 'lehre.tbl_moodle' => 'basis/moodle', + 'lehre.tbl_note' => 'basis/note', + 'lehre.tbl_notenschluessel' => 'basis/notenschluessel', + 'lehre.tbl_notenschluesselaufteilung' => 'basis/notenschluesselaufteilung', + 'lehre.tbl_notenschluesselzuordnung' => 'basis/notenschluesselzuordnung', + 'lehre.tbl_projektarbeit' => 'basis/projektarbeit', + 'lehre.tbl_projektbetreuer' => 'basis/projektbetreuer', + 'lehre.tbl_projekttyp' => 'basis/projekttyp', + 'lehre.tbl_pruefung' => 'basis/pruefung', + 'lehre.tbl_pruefungstyp' => 'basis/pruefungstyp', 'lehre.tbl_studienordnung' => 'basis/studienordnung', - 'lehre.vw_studienplan' => 'basis/vw_studienplan', - - 'public.tbl_person' => 'basis/person', + 'lehre.tbl_studienordnungstatus' => 'basis/studienordnungstatus', + 'lehre.tbl_studienplan' => 'basis/studienplan', + 'lehre.tbl_studienplatz' => 'basis/studienplatz', + 'lehre.tbl_stunde' => 'basis/stunde', + 'lehre.tbl_stundenplan' => 'basis/stundenplan', + 'lehre.tbl_stundenplandev' => 'basis/stundenplandev', + 'lehre.tbl_vertrag' => 'basis/vertrag', + 'lehre.tbl_vertragsstatus' => 'basis/vertragsstatus', + 'lehre.tbl_vertragstyp' => 'basis/vertragstyp', + 'lehre.tbl_zeitfenster' => 'basis/zeitfenster', + 'lehre.tbl_zeugnis' => 'basis/zeugnis', + 'lehre.tbl_zeugnisnote' => 'basis/zeugnisnote', + 'public.tbl_adresse' => 'basis/adresse', + 'public.tbl_akte' => 'basis/akte', + 'public.tbl_ampel' => 'basis/ampel', + 'public.tbl_aufmerksamdurch' => 'basis/aufmerksamdurch', + 'public.tbl_aufnahmeschluessel' => 'basis/aufnahmeschluessel', + 'public.tbl_aufnahmetermin' => 'basis/aufnahmetermin', + 'public.tbl_aufnahmetermintyp' => 'basis/aufnahmetermintyp', + 'public.tbl_bankverbindung' => 'basis/bankverbindung', + 'public.tbl_benutzer' => 'basis/benutzer', + 'public.tbl_benutzerfunktion' => 'basis/benutzerfunktion', + 'public.tbl_benutzergruppe' => 'basis/benutzergruppe', + 'public.tbl_bewerbungstermine' => 'basis/bewerbungstermine', + 'public.tbl_buchungstyp' => 'basis/buchungstyp', + 'public.tbl_dokument' => 'basis/dokument', + 'public.tbl_dokumentprestudent' => 'basis/dokumentprestudent', + 'public.tbl_dokumentstudiengang' => 'basis/dokumentstudiengang', + 'public.tbl_erhalter' => 'basis/erhalter', + 'public.tbl_fachbereich' => 'basis/fachbereich', + 'public.tbl_filter' => 'basis/filter', + 'public.tbl_firma' => 'basis/firma', + 'public.tbl_firmatag' => 'basis/firmatag', + 'public.tbl_firmentyp' => 'basis/firmentyp', + 'public.tbl_fotostatus' => 'basis/fotostatus', + 'public.tbl_funktion' => 'basis/funktion', + 'public.tbl_geschaeftsjahr' => 'basis/geschaeftsjahr', + 'public.tbl_gruppe' => 'basis/gruppe', 'public.tbl_kontakt' => 'basis/kontakt', - 'public.tbl_prestudent' => 'basis/person', - 'public.tbl_prestudentstatus' => 'basis/person', + 'public.tbl_kontaktmedium' => 'basis/kontaktmedium', + 'public.tbl_kontakttyp' => 'basis/kontakttyp', + 'public.tbl_konto' => 'basis/konto', + 'public.tbl_lehrverband' => 'basis/lehrverband', + 'public.tbl_log' => 'basis/log', + 'public.tbl_mitarbeiter' => 'basis/mitarbeiter', + 'public.tbl_msg_message' => 'basis/msg_message', + 'public.tbl_msg_thread' => 'basis/msg_thread', + 'public.tbl_notiz' => 'basis/notiz', + 'public.tbl_notizzuordnung' => 'basis/notizzuordnung', 'public.tbl_organisationseinheit' => 'basis/organisationseinheit', - 'public.tbl_sprache' => 'admin' + 'public.tbl_organisationseinheittyp' => 'basis/organisationseinheittyp', + 'public.tbl_ort' => 'basis/ort', + 'public.tbl_ortraumtyp' => 'basis/ortraumtyp', + 'public.tbl_person' => 'basis/person', + 'public.tbl_personfunktionstandort' => 'basis/personfunktionstandort', + 'public.tbl_preincoming' => 'basis/preincoming', + 'public.tbl_preinteressent' => 'basis/preinteressent', + 'public.tbl_preinteressentstudiengang' => 'basis/preinteressentstudiengang', + 'public.tbl_preoutgoing' => 'basis/preoutgoing', + 'public.tbl_prestudent' => 'basis/prestudent', + 'public.tbl_prestudentstatus' => 'basis/prestudentstatus', + 'public.tbl_raumtyp' => 'basis/raumtyp', + 'public.tbl_reihungstest' => 'basis/reihungstest', + 'public.tbl_semesterwochen' => 'basis/semesterwochen', + 'public.tbl_service' => 'basis/service', + 'public.tbl_sprache' => 'basis/sprache', + 'public.tbl_standort' => 'basis/standort', + 'public.tbl_statistik' => 'basis/statistik', + 'public.tbl_status' => 'basis/status', + 'public.tbl_student' => 'basis/student', + 'public.tbl_studentlehrverband' => 'basis/studentlehrverband', + 'public.tbl_studiengang' => 'basis/studiengang', + 'public.tbl_studiengangstyp' => 'basis/studiengangstyp', + 'public.tbl_studienjahr' => 'basis/studienjahr', + 'public.tbl_studiensemester' => 'basis/studiensemester', + 'public.tbl_tag' => 'basis/tag', + 'public.tbl_variable' => 'basis/variable', + 'public.tbl_vorlage' => 'basis/vorlage', + 'public.tbl_vorlagestudiengang' => 'basis/vorlagestudiengang', + 'system.tbl_appdaten' => 'basis/appdaten', + 'system.tbl_benutzerrolle' => 'basis/benutzerrolle', + 'system.tbl_berechtigung' => 'basis/berechtigung', + 'system.tbl_cronjob' => 'basis/cronjob', + 'system.tbl_rolle' => 'basis/rolle', + 'system.tbl_rolleberechtigung' => 'basis/rolleberechtigung', + 'system.tbl_server' => 'basis/server', + 'system.tbl_webservicelog' => 'basis/webservicelog', + 'system.tbl_webservicerecht' => 'basis/webservicerecht', + 'system.tbl_webservicetyp' => 'basis/webservicetyp', + 'testtool.tbl_ablauf' => 'basis/ablauf', + 'testtool.tbl_antwort' => 'basis/antwort', + 'testtool.tbl_frage' => 'basis/frage', + 'testtool.tbl_gebiet' => 'basis/gebiet', + 'testtool.tbl_kategorie' => 'basis/kategorie', + 'testtool.tbl_kriterien' => 'basis/kriterien', + 'testtool.tbl_pruefling' => 'basis/pruefling', + 'testtool.tbl_vorschlag' => 'basis/vorschlag', + 'wawi.tbl_aufteilung' => 'basis/aufteilung', + 'wawi.tbl_bestelldetail' => 'basis/bestelldetail', + 'wawi.tbl_bestelldetailtag' => 'basis/bestelldetailtag', + 'wawi.tbl_bestellstatus' => 'basis/bestellstatus', + 'wawi.tbl_bestellung' => 'basis/bestellung', + 'wawi.tbl_bestellungtag' => 'basis/bestellungtag', + 'wawi.tbl_betriebsmittel' => 'basis/betriebsmittel', + 'wawi.tbl_betriebsmittelperson' => 'basis/betriebsmittelperson', + 'wawi.tbl_betriebsmittelstatus' => 'basis/betriebsmittelstatus', + 'wawi.tbl_betriebsmitteltyp' => 'basis/betriebsmitteltyp', + 'wawi.tbl_buchung' => 'basis/buchung', + 'wawi.tbl_buchungstyp' => 'basis/buchungstyp', + 'wawi.tbl_budget' => 'basis/budget', + 'wawi.tbl_konto' => 'basis/konto', + 'wawi.tbl_kostenstelle' => 'basis/kostenstelle', + 'wawi.tbl_rechnung' => 'basis/rechnung', + 'wawi.tbl_rechnungsbetrag' => 'basis/rechnungsbetrag', + 'wawi.tbl_rechnungstyp' => 'basis/rechnungstyp', + 'wawi.tbl_zahlungstyp' => 'basis/zahlungstyp', + + 'lehre.vw_studienplan' => 'basis/studienplan', + + 'public.tbl_sprache' => 'admin', + 'public.tbl_msg_thread' => 'admin', + 'public.tbl_msg_message' => 'admin' ); \ No newline at end of file diff --git a/application/config/foreign_chars.php b/application/config/foreign_chars.php index ac406e3d4..a656dd048 100755 --- a/application/config/foreign_chars.php +++ b/application/config/foreign_chars.php @@ -1,5 +1,5 @@ my_controller/index | my-controller/my-method -> my_controller/my_method */ -$route['person/(:any)'] = 'person/view/$1'; -$route['person'] = 'person'; $route['default_controller'] = 'Vilesci'; $route['404_override'] = ''; $route['translate_uri_dashes'] = FALSE; + +// Class name conflicts +$route['api/v1/organisation/studiengang/(:any)'] = 'api/v1/organisation/studiengang2/$1'; +$route['api/v1/ressource/betriebsmittelperson/(:any)'] = 'api/v1/ressource/betriebsmittelperson2/$1'; +$route['api/v1/organisation/fachbereich/(:any)'] = 'api/v1/organisation/fachbereich2/$1'; +$route['api/v1/organisation/geschaeftsjahr/(:any)'] = 'api/v1/organisation/geschaeftsjahr2/$1'; +$route['api/v1/organisation/organisationseinheit/(:any)'] = 'api/v1/organisation/organisationseinheit2/$1'; +$route['api/v1/system/sprache/(:any)'] = 'api/v1/system/sprache2/$1'; \ No newline at end of file diff --git a/application/config/smileys.php b/application/config/smileys.php index 1eeba4776..272be2fcd 100755 --- a/application/config/smileys.php +++ b/application/config/smileys.php @@ -1,5 +1,5 @@ load->database('system'); //Use the system-Connection for DB-Manipulation + $this->config->load('migration'); $this->load->library('migration'); // If not set, set it @@ -301,7 +302,7 @@ class DBTools extends FHC_Controller */ private function __getVersion() { - $row = $this->db->get('ci_migrations')->row(); + $row = $this->db->get($this->config->item('migration_table'))->row(); return $row ? $row->version : 0; } } diff --git a/application/controllers/Examples.php b/application/controllers/Examples.php index f40a37aa4..89177263f 100644 --- a/application/controllers/Examples.php +++ b/application/controllers/Examples.php @@ -189,7 +189,7 @@ class Examples extends CI_Controller $output = $crud->render(); - if($crud->getState() != 'list') { + if ($crud->getState() != 'list') { $this->_example_output($output); } else { return $output; @@ -214,7 +214,7 @@ class Examples extends CI_Controller $output = $crud->render(); - if($crud->getState() != 'list') { + if ($crud->getState() != 'list') { $this->_example_output($output); } else { return $output; @@ -237,7 +237,7 @@ class Examples extends CI_Controller $output = $crud->render(); - if($crud->getState() != 'list') { + if ($crud->getState() != 'list') { $this->_example_output($output); } else { return $output; diff --git a/application/controllers/ModelTest.php b/application/controllers/ModelTest.php index 430021d26..3e51082d7 100755 --- a/application/controllers/ModelTest.php +++ b/application/controllers/ModelTest.php @@ -1,5 +1,5 @@ Person_model->getPerson(null, 'asdf\' OR person_id=1; SELECT 1; --'); var_dump($res->result_object()); - $this->load->model('person/Prestudent_model'); + $this->load->model('crm/Prestudent_model'); $id=null; // Insert PreStudent @@ -79,7 +79,7 @@ class ModelTest extends FHC_Controller var_dump($res->retval); // Insert PreStudentStatus - $this->load->model('person/Prestudentstatus_model'); + $this->load->model('crm/Prestudentstatus_model'); $data = array ( 'prestudent_id' => $id, @@ -155,7 +155,7 @@ class ModelTest extends FHC_Controller else var_dump($res->retval); - $this->load->model('core/Sprache_model'); + $this->load->model('system/Sprache_model'); // Insert Sprache $data = array ( diff --git a/application/controllers/Rest_server.php b/application/controllers/Rest_server.php index b00fbef9b..a9a755c76 100644 --- a/application/controllers/Rest_server.php +++ b/application/controllers/Rest_server.php @@ -21,7 +21,7 @@ * @return some value on success. */ -defined('BASEPATH') || exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); /** * @class Rest_server diff --git a/application/controllers/Vilesci.php b/application/controllers/Vilesci.php index 3cbf06974..fed0f077b 100755 --- a/application/controllers/Vilesci.php +++ b/application/controllers/Vilesci.php @@ -1,5 +1,5 @@ load->model('file_model', 'FileModel'); - // Load set the uid of the model to let to check the permissions - $this->FileModel->setUID($this->_getUID()); - } - - /** - * @return void - */ - public function postFile() - { - $result = $this->FileModel->saveFile($this->post()); - - if($result === TRUE) - { - $httpstatus = REST_Controller::HTTP_OK; - $payload = [ - 'success' => true, - 'message' => 'File saved.' - ]; - $payload['data'] = $result; - } - else - { - $payload = [ - 'success' => false, - 'message' => 'Could not save file.' - ]; - $httpstatus = REST_Controller::HTTP_OK; - } - $this->response($payload, $httpstatus); - } -} \ No newline at end of file diff --git a/application/controllers/api/v1/Kontakt.php b/application/controllers/api/v1/Kontakt.php deleted file mode 100644 index 7f9c05112..000000000 --- a/application/controllers/api/v1/Kontakt.php +++ /dev/null @@ -1,80 +0,0 @@ -load->model('kontakt/Kontakt_model'); - } - - public function kontaktPerson_get() - { - $result = $this->Kontakt_model->getKontaktPerson($this->get("person_id")); - if($result != FALSE) - { - $httpstatus = REST_Controller::HTTP_OK; - $payload = [ - 'success' => true, - 'message' => 'Kontakt found.' - ]; - $payload['data'] = $result; - } - else - { - $payload = [ - 'success' => false, - 'message' => 'Could not find Kontakt.' - ]; - $httpstatus = REST_Controller::HTTP_OK; - } - - $this->response($payload, $httpstatus); - } - - public function kontakt_post() - { - $result = $this->Kontakt_model->saveKontakt($this->post()); - if($result != FALSE) - { - $httpstatus = REST_Controller::HTTP_OK; - $payload = [ - 'success' => true, - 'message' => 'Kontakt saved.' - ]; - $payload['data'] = $result; - } - else - { - $payload = [ - 'success' => false, - 'message' => 'Could not save Kontakt.' - ]; - $httpstatus = REST_Controller::HTTP_OK; - } - - $this->response($payload, $httpstatus); - } - -} diff --git a/application/controllers/api/v1/Ping.php b/application/controllers/api/v1/Ping.php index bde091170..a4ca0d4a1 100644 --- a/application/controllers/api/v1/Ping.php +++ b/application/controllers/api/v1/Ping.php @@ -14,7 +14,7 @@ // ------------------------------------------------------------------------ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); // This can be removed if you use __autoload() in config.php OR use Modular Extensions require APPPATH . '/libraries/REST_Controller.php'; diff --git a/application/controllers/api/v1/Test.php b/application/controllers/api/v1/Test.php index d575db173..c036973f5 100644 --- a/application/controllers/api/v1/Test.php +++ b/application/controllers/api/v1/Test.php @@ -1,6 +1,6 @@ load->model('accounting/aufteilung_model', 'AufteilungModel'); + // Load set the uid of the model to let to check the permissions + $this->AufteilungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAufteilung() + { + $aufteilungID = $this->get('aufteilung_id'); + + if (isset($aufteilungID)) + { + $result = $this->AufteilungModel->load($aufteilungID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAufteilung() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['aufteilung_id'])) + { + $result = $this->AufteilungModel->update($this->post()['aufteilung_id'], $this->post()); + } + else + { + $result = $this->AufteilungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($aufteilung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Bestelldetail.php b/application/controllers/api/v1/accounting/Bestelldetail.php new file mode 100644 index 000000000..cde6eb766 --- /dev/null +++ b/application/controllers/api/v1/accounting/Bestelldetail.php @@ -0,0 +1,78 @@ +load->model('accounting/bestelldetail_model', 'BestelldetailModel'); + // Load set the uid of the model to let to check the permissions + $this->BestelldetailModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBestelldetail() + { + $bestelldetailID = $this->get('bestelldetail_id'); + + if (isset($bestelldetailID)) + { + $result = $this->BestelldetailModel->load($bestelldetailID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBestelldetail() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['bestelldetail_id'])) + { + $result = $this->BestelldetailModel->update($this->post()['bestelldetail_id'], $this->post()); + } + else + { + $result = $this->BestelldetailModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($bestelldetail = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Bestelldetailtag.php b/application/controllers/api/v1/accounting/Bestelldetailtag.php new file mode 100644 index 000000000..1263bd04e --- /dev/null +++ b/application/controllers/api/v1/accounting/Bestelldetailtag.php @@ -0,0 +1,79 @@ +load->model('accounting/bestelldetailtag_model', 'BestelldetailtagModel'); + // Load set the uid of the model to let to check the permissions + $this->BestelldetailtagModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBestelldetailtag() + { + $bestelldetail_id = $this->get('bestelldetail_id'); + $tag = $this->get('tag'); + + if (isset($bestelldetail_id) && isset($tag)) + { + $result = $this->BestelldetailtagModel->load(array($bestelldetail_id, $tag)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBestelldetailtag() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['bestelldetailtag_id'])) + { + $result = $this->BestelldetailtagModel->update($this->post()['bestelldetailtag_id'], $this->post()); + } + else + { + $result = $this->BestelldetailtagModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($bestelldetailtag = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Bestellstatus.php b/application/controllers/api/v1/accounting/Bestellstatus.php new file mode 100644 index 000000000..2feb43ced --- /dev/null +++ b/application/controllers/api/v1/accounting/Bestellstatus.php @@ -0,0 +1,78 @@ +load->model('accounting/bestellstatus_model', 'BestellstatusModel'); + // Load set the uid of the model to let to check the permissions + $this->BestellstatusModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBestellstatus() + { + $bestellstatus_kurzbz = $this->get('bestellstatus_kurzbz'); + + if (isset($bestellstatus_kurzbz)) + { + $result = $this->BestellstatusModel->load($bestellstatus_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBestellstatus() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['bestellstatus_kurzbz'])) + { + $result = $this->BestellstatusModel->update($this->post()['bestellstatus_kurzbz'], $this->post()); + } + else + { + $result = $this->BestellstatusModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($bestellstatus = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Bestellung.php b/application/controllers/api/v1/accounting/Bestellung.php new file mode 100644 index 000000000..cce6a4298 --- /dev/null +++ b/application/controllers/api/v1/accounting/Bestellung.php @@ -0,0 +1,78 @@ +load->model('accounting/bestellung_model', 'BestellungModel'); + // Load set the uid of the model to let to check the permissions + $this->BestellungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBestellung() + { + $bestellungID = $this->get('bestellung_id'); + + if (isset($bestellungID)) + { + $result = $this->BestellungModel->load($bestellungID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBestellung() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['bestellung_id'])) + { + $result = $this->BestellungModel->update($this->post()['bestellung_id'], $this->post()); + } + else + { + $result = $this->BestellungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($bestellung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Bestellungtag.php b/application/controllers/api/v1/accounting/Bestellungtag.php new file mode 100644 index 000000000..13361d66f --- /dev/null +++ b/application/controllers/api/v1/accounting/Bestellungtag.php @@ -0,0 +1,79 @@ +load->model('accounting/bestellungtag_model', 'BestellungtagModel'); + // Load set the uid of the model to let to check the permissions + $this->BestellungtagModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBestellungtag() + { + $bestellung_id = $this->get('bestellung_id'); + $tag = $this->get('tag'); + + if (isset($bestellung_id) && isset($tag)) + { + $result = $this->BestellungtagModel->load(array($bestellung_id, $tag)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBestellungtag() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['bestellungtag_id'])) + { + $result = $this->BestellungtagModel->update($this->post()['bestellungtag_id'], $this->post()); + } + else + { + $result = $this->BestellungtagModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($bestellungtag = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Buchung.php b/application/controllers/api/v1/accounting/Buchung.php new file mode 100644 index 000000000..7175063a2 --- /dev/null +++ b/application/controllers/api/v1/accounting/Buchung.php @@ -0,0 +1,78 @@ +load->model('accounting/buchung_model', 'BuchungModel'); + // Load set the uid of the model to let to check the permissions + $this->BuchungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBuchung() + { + $buchungID = $this->get('buchung_id'); + + if (isset($buchungID)) + { + $result = $this->BuchungModel->load($buchungID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBuchung() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['buchung_id'])) + { + $result = $this->BuchungModel->update($this->post()['buchung_id'], $this->post()); + } + else + { + $result = $this->BuchungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($buchung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Buchungstyp.php b/application/controllers/api/v1/accounting/Buchungstyp.php new file mode 100644 index 000000000..854cc954b --- /dev/null +++ b/application/controllers/api/v1/accounting/Buchungstyp.php @@ -0,0 +1,78 @@ +load->model('accounting/buchungstyp_model', 'BuchungstypModel'); + // Load set the uid of the model to let to check the permissions + $this->BuchungstypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBuchungstyp() + { + $buchungstyp_kurzbz = $this->get('buchungstyp_kurzbz'); + + if (isset($buchungstyp_kurzbz)) + { + $result = $this->BuchungstypModel->load($buchungstyp_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBuchungstyp() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['buchungstyp_kurzbz'])) + { + $result = $this->BuchungstypModel->update($this->post()['buchungstyp_kurzbz'], $this->post()); + } + else + { + $result = $this->BuchungstypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($buchungstyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Budget.php b/application/controllers/api/v1/accounting/Budget.php new file mode 100644 index 000000000..7de0dee3f --- /dev/null +++ b/application/controllers/api/v1/accounting/Budget.php @@ -0,0 +1,79 @@ +load->model('accounting/budget_model', 'BudgetModel'); + // Load set the uid of the model to let to check the permissions + $this->BudgetModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBudget() + { + $kostenstelle_id = $this->get('kostenstelle_id'); + $geschaeftsjahr_kurzbz = $this->get('geschaeftsjahr_kurzbz'); + + if (isset($kostenstelle_id) && isset($geschaeftsjahr_kurzbz)) + { + $result = $this->BudgetModel->load(array($kostenstelle_id, $geschaeftsjahr_kurzbz)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBudget() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['budget_id']) && isset($this->post()['geschaeftsjahr_kurzbz'])) + { + $result = $this->BudgetModel->update(array($this->post()['budget_id'], $this->post()['geschaeftsjahr_kurzbz']), $this->post()); + } + else + { + $result = $this->BudgetModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($budget = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Konto.php b/application/controllers/api/v1/accounting/Konto.php new file mode 100644 index 000000000..2c05a6735 --- /dev/null +++ b/application/controllers/api/v1/accounting/Konto.php @@ -0,0 +1,78 @@ +load->model('accounting/konto_model', 'KontoModel'); + // Load set the uid of the model to let to check the permissions + $this->KontoModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getKonto() + { + $kontoID = $this->get('konto_id'); + + if (isset($kontoID)) + { + $result = $this->KontoModel->load($kontoID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postKonto() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['konto_id'])) + { + $result = $this->KontoModel->update($this->post()['konto_id'], $this->post()); + } + else + { + $result = $this->KontoModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($konto = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Kostenstelle.php b/application/controllers/api/v1/accounting/Kostenstelle.php new file mode 100644 index 000000000..ef4074134 --- /dev/null +++ b/application/controllers/api/v1/accounting/Kostenstelle.php @@ -0,0 +1,78 @@ +load->model('accounting/kostenstelle_model', 'KostenstelleModel'); + // Load set the uid of the model to let to check the permissions + $this->KostenstelleModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getKostenstelle() + { + $kostenstelleID = $this->get('kostenstelle_id'); + + if (isset($kostenstelleID)) + { + $result = $this->KostenstelleModel->load($kostenstelleID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postKostenstelle() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['kostenstelle_id'])) + { + $result = $this->KostenstelleModel->update($this->post()['kostenstelle_id'], $this->post()); + } + else + { + $result = $this->KostenstelleModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($kostenstelle = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Rechnung.php b/application/controllers/api/v1/accounting/Rechnung.php new file mode 100644 index 000000000..4bc69abf6 --- /dev/null +++ b/application/controllers/api/v1/accounting/Rechnung.php @@ -0,0 +1,78 @@ +load->model('accounting/rechnung_model', 'RechnungModel'); + // Load set the uid of the model to let to check the permissions + $this->RechnungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getRechnung() + { + $rechnungID = $this->get('rechnung_id'); + + if (isset($rechnungID)) + { + $result = $this->RechnungModel->load($rechnungID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postRechnung() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['rechnung_id'])) + { + $result = $this->RechnungModel->update($this->post()['rechnung_id'], $this->post()); + } + else + { + $result = $this->RechnungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($rechnung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Rechnungsbetrag.php b/application/controllers/api/v1/accounting/Rechnungsbetrag.php new file mode 100644 index 000000000..3031857e0 --- /dev/null +++ b/application/controllers/api/v1/accounting/Rechnungsbetrag.php @@ -0,0 +1,78 @@ +load->model('accounting/rechnungsbetrag_model', 'RechnungsbetragModel'); + // Load set the uid of the model to let to check the permissions + $this->RechnungsbetragModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getRechnungsbetrag() + { + $rechnungsbetragID = $this->get('rechnungsbetrag_id'); + + if (isset($rechnungsbetragID)) + { + $result = $this->RechnungsbetragModel->load($rechnungsbetragID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postRechnungsbetrag() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['rechnungsbetrag_id'])) + { + $result = $this->RechnungsbetragModel->update($this->post()['rechnungsbetrag_id'], $this->post()); + } + else + { + $result = $this->RechnungsbetragModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($rechnungsbetrag = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Rechnungstyp.php b/application/controllers/api/v1/accounting/Rechnungstyp.php new file mode 100644 index 000000000..56deb307f --- /dev/null +++ b/application/controllers/api/v1/accounting/Rechnungstyp.php @@ -0,0 +1,78 @@ +load->model('accounting/rechnungstyp_model', 'RechnungstypModel'); + // Load set the uid of the model to let to check the permissions + $this->RechnungstypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getRechnungstyp() + { + $rechnungstyp_kurzbz = $this->get('rechnungstyp_kurzbz'); + + if (isset($rechnungstyp_kurzbz)) + { + $result = $this->RechnungstypModel->load($rechnungstyp_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postRechnungstyp() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['rechnungstyp_kurzbz'])) + { + $result = $this->RechnungstypModel->update($this->post()['rechnungstyp_kurzbz'], $this->post()); + } + else + { + $result = $this->RechnungstypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($rechnungstyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Vertrag.php b/application/controllers/api/v1/accounting/Vertrag.php new file mode 100644 index 000000000..8993838d9 --- /dev/null +++ b/application/controllers/api/v1/accounting/Vertrag.php @@ -0,0 +1,78 @@ +load->model('accounting/vertrag_model', 'VertragModel'); + // Load set the uid of the model to let to check the permissions + $this->VertragModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getVertrag() + { + $vertragID = $this->get('vertrag_id'); + + if (isset($vertragID)) + { + $result = $this->VertragModel->load($vertragID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postVertrag() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['vertrag_id'])) + { + $result = $this->VertragModel->update($this->post()['vertrag_id'], $this->post()); + } + else + { + $result = $this->VertragModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($vertrag = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Vertragsstatus.php b/application/controllers/api/v1/accounting/Vertragsstatus.php new file mode 100644 index 000000000..bc7567cf9 --- /dev/null +++ b/application/controllers/api/v1/accounting/Vertragsstatus.php @@ -0,0 +1,78 @@ +load->model('accounting/vertragsstatus_model', 'VertragsstatusModel'); + // Load set the uid of the model to let to check the permissions + $this->VertragsstatusModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getVertragsstatus() + { + $vertragsstatus_kurzbz = $this->get('vertragsstatus_kurzbz'); + + if (isset($vertragsstatus_kurzbz)) + { + $result = $this->VertragsstatusModel->load($vertragsstatus_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postVertragsstatus() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['vertragsstatus_kurzbz'])) + { + $result = $this->VertragsstatusModel->update($this->post()['vertragsstatus_kurzbz'], $this->post()); + } + else + { + $result = $this->VertragsstatusModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($vertragsstatus = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Vertragstyp.php b/application/controllers/api/v1/accounting/Vertragstyp.php new file mode 100644 index 000000000..44f0a6c76 --- /dev/null +++ b/application/controllers/api/v1/accounting/Vertragstyp.php @@ -0,0 +1,78 @@ +load->model('accounting/vertragstyp_model', 'VertragstypModel'); + // Load set the uid of the model to let to check the permissions + $this->VertragstypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getVertragstyp() + { + $vertragstyp_kurzbz = $this->get('vertragstyp_kurzbz'); + + if (isset($vertragstyp_kurzbz)) + { + $result = $this->VertragstypModel->load($vertragstyp_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postVertragstyp() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['vertragstyp_kurzbz'])) + { + $result = $this->VertragstypModel->update($this->post()['vertragstyp_kurzbz'], $this->post()); + } + else + { + $result = $this->VertragstypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($vertragstyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/accounting/Zahlungstyp.php b/application/controllers/api/v1/accounting/Zahlungstyp.php new file mode 100644 index 000000000..bcd529472 --- /dev/null +++ b/application/controllers/api/v1/accounting/Zahlungstyp.php @@ -0,0 +1,78 @@ +load->model('accounting/zahlungstyp_model', 'ZahlungstypModel'); + // Load set the uid of the model to let to check the permissions + $this->ZahlungstypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getZahlungstyp() + { + $zahlungstyp_kurzbz = $this->get('zahlungstyp_kurzbz'); + + if (isset($zahlungstyp_kurzbz)) + { + $result = $this->ZahlungstypModel->load($zahlungstyp_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postZahlungstyp() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['zahlungstyp_kurzbz'])) + { + $result = $this->ZahlungstypModel->update($this->post()['zahlungstyp_kurzbz'], $this->post()); + } + else + { + $result = $this->ZahlungstypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($zahlungstyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Akadgrad.php b/application/controllers/api/v1/codex/Akadgrad.php new file mode 100644 index 000000000..659a3292b --- /dev/null +++ b/application/controllers/api/v1/codex/Akadgrad.php @@ -0,0 +1,78 @@ +load->model('codex/akadgrad_model', 'AkadgradModel'); + // Load set the uid of the model to let to check the permissions + $this->AkadgradModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAkadgrad() + { + $akadgradID = $this->get('akadgrad_id'); + + if (isset($akadgradID)) + { + $result = $this->AkadgradModel->load($akadgradID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAkadgrad() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['akadgrad_id'])) + { + $result = $this->AkadgradModel->update($this->post()['akadgrad_id'], $this->post()); + } + else + { + $result = $this->AkadgradModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($akadgrad = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Archiv.php b/application/controllers/api/v1/codex/Archiv.php new file mode 100644 index 000000000..be4c5dd76 --- /dev/null +++ b/application/controllers/api/v1/codex/Archiv.php @@ -0,0 +1,78 @@ +load->model('codex/archiv_model', 'ArchivModel'); + // Load set the uid of the model to let to check the permissions + $this->ArchivModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getArchiv() + { + $archivID = $this->get('archiv_id'); + + if (isset($archivID)) + { + $result = $this->ArchivModel->load($archivID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postArchiv() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['archiv_id'])) + { + $result = $this->ArchivModel->update($this->post()['archiv_id'], $this->post()); + } + else + { + $result = $this->ArchivModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($archiv = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Aufmerksamdurch.php b/application/controllers/api/v1/codex/Aufmerksamdurch.php new file mode 100644 index 000000000..4b13a77c5 --- /dev/null +++ b/application/controllers/api/v1/codex/Aufmerksamdurch.php @@ -0,0 +1,78 @@ +load->model('codex/aufmerksamdurch_model', 'AufmerksamdurchModel'); + // Load set the uid of the model to let to check the permissions + $this->AufmerksamdurchModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAufmerksamdurch() + { + $aufmerksamdurch_kurzbz = $this->get('aufmerksamdurch_kurzbz'); + + if (isset($aufmerksamdurch_kurzbz)) + { + $result = $this->AufmerksamdurchModel->load($aufmerksamdurch_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAufmerksamdurch() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['aufmerksamdurch_kurzbz'])) + { + $result = $this->AufmerksamdurchModel->update($this->post()['aufmerksamdurch_kurzbz'], $this->post()); + } + else + { + $result = $this->AufmerksamdurchModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($aufmerksamdurch = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Ausbildung.php b/application/controllers/api/v1/codex/Ausbildung.php new file mode 100644 index 000000000..187026071 --- /dev/null +++ b/application/controllers/api/v1/codex/Ausbildung.php @@ -0,0 +1,78 @@ +load->model('codex/ausbildung_model', 'AusbildungModel'); + // Load set the uid of the model to let to check the permissions + $this->AusbildungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAusbildung() + { + $ausbildungcode = $this->get('ausbildungcode'); + + if (isset($ausbildungcode)) + { + $result = $this->AusbildungModel->load($ausbildungcode); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAusbildung() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['ausbildungcode'])) + { + $result = $this->AusbildungModel->update($this->post()['ausbildungcode'], $this->post()); + } + else + { + $result = $this->AusbildungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($ausbildung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Berufstaetigkeit.php b/application/controllers/api/v1/codex/Berufstaetigkeit.php new file mode 100644 index 000000000..238b63b74 --- /dev/null +++ b/application/controllers/api/v1/codex/Berufstaetigkeit.php @@ -0,0 +1,78 @@ +load->model('codex/berufstaetigkeit_model', 'BerufstaetigkeitModel'); + // Load set the uid of the model to let to check the permissions + $this->BerufstaetigkeitModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBerufstaetigkeit() + { + $berufstaetigkeit_code = $this->get('berufstaetigkeit_code'); + + if (isset($berufstaetigkeit_code)) + { + $result = $this->BerufstaetigkeitModel->load($berufstaetigkeit_code); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBerufstaetigkeit() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['berufstaetigkeit_code'])) + { + $result = $this->BerufstaetigkeitModel->update($this->post()['berufstaetigkeit_code'], $this->post()); + } + else + { + $result = $this->BerufstaetigkeitModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($berufstaetigkeit = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Beschaeftigungsausmass.php b/application/controllers/api/v1/codex/Beschaeftigungsausmass.php new file mode 100644 index 000000000..ec5b75b7c --- /dev/null +++ b/application/controllers/api/v1/codex/Beschaeftigungsausmass.php @@ -0,0 +1,78 @@ +load->model('codex/beschaeftigungsausmass_model', 'BeschaeftigungsausmassModel'); + // Load set the uid of the model to let to check the permissions + $this->BeschaeftigungsausmassModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBeschaeftigungsausmass() + { + $beschausmasscode = $this->get('beschausmasscode'); + + if (isset($beschausmasscode)) + { + $result = $this->BeschaeftigungsausmassModel->load($beschausmasscode); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBeschaeftigungsausmass() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['beschausmasscode'])) + { + $result = $this->BeschaeftigungsausmassModel->update($this->post()['beschausmasscode'], $this->post()); + } + else + { + $result = $this->BeschaeftigungsausmassModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($beschaeftigungsausmass = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Besqual.php b/application/controllers/api/v1/codex/Besqual.php new file mode 100644 index 000000000..e48a4307f --- /dev/null +++ b/application/controllers/api/v1/codex/Besqual.php @@ -0,0 +1,78 @@ +load->model('codex/besqual_model', 'BesqualModel'); + // Load set the uid of the model to let to check the permissions + $this->BesqualModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBesqual() + { + $besqualcode = $this->get('besqualcode'); + + if (isset($besqualcode)) + { + $result = $this->BesqualModel->load($besqualcode); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBesqual() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['besqualcode'])) + { + $result = $this->BesqualModel->update($this->post()['besqualcode'], $this->post()); + } + else + { + $result = $this->BesqualModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($besqual = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Bisfunktion.php b/application/controllers/api/v1/codex/Bisfunktion.php new file mode 100644 index 000000000..ab75641d3 --- /dev/null +++ b/application/controllers/api/v1/codex/Bisfunktion.php @@ -0,0 +1,79 @@ +load->model('codex/bisfunktion_model', 'BisfunktionModel'); + // Load set the uid of the model to let to check the permissions + $this->BisfunktionModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBisfunktion() + { + $studiengang_kz = $this->get('studiengang_kz'); + $bisverwendung_id = $this->get('bisverwendung_id'); + + if (isset($studiengang_kz) && isset($bisverwendung_id)) + { + $result = $this->BisfunktionModel->load(array($studiengang_kz, $bisverwendung_id)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBisfunktion() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['studiengang_kz']) && isset($this->post()['bisverwendung_id'])) + { + $result = $this->BisfunktionModel->update(array($this->post()['studiengang_kz'], $this->post()['bisverwendung_id']), $this->post()); + } + else + { + $result = $this->BisfunktionModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($bisfunktion = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Bisio.php b/application/controllers/api/v1/codex/Bisio.php new file mode 100644 index 000000000..6e519e8cb --- /dev/null +++ b/application/controllers/api/v1/codex/Bisio.php @@ -0,0 +1,78 @@ +load->model('codex/bisio_model', 'BisioModel'); + // Load set the uid of the model to let to check the permissions + $this->BisioModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBisio() + { + $bisioID = $this->get('bisio_id'); + + if (isset($bisioID)) + { + $result = $this->BisioModel->load($bisioID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBisio() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['bisio_id'])) + { + $result = $this->BisioModel->update($this->post()['bisio_id'], $this->post()); + } + else + { + $result = $this->BisioModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($bisio = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Bisorgform.php b/application/controllers/api/v1/codex/Bisorgform.php new file mode 100644 index 000000000..503d50fae --- /dev/null +++ b/application/controllers/api/v1/codex/Bisorgform.php @@ -0,0 +1,78 @@ +load->model('codex/bisorgform_model', 'BisorgformModel'); + // Load set the uid of the model to let to check the permissions + $this->BisorgformModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBisorgform() + { + $bisorgform_kurzbz = $this->get('bisorgform_kurzbz'); + + if (isset($bisorgform_kurzbz)) + { + $result = $this->BisorgformModel->load($bisorgform_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBisorgform() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['bisorgform_kurzbz'])) + { + $result = $this->BisorgformModel->update($this->post()['bisorgform_kurzbz'], $this->post()); + } + else + { + $result = $this->BisorgformModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($bisorgform = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Bisverwendung.php b/application/controllers/api/v1/codex/Bisverwendung.php new file mode 100644 index 000000000..a01a775b6 --- /dev/null +++ b/application/controllers/api/v1/codex/Bisverwendung.php @@ -0,0 +1,78 @@ +load->model('codex/bisverwendung_model', 'BisverwendungModel'); + // Load set the uid of the model to let to check the permissions + $this->BisverwendungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBisverwendung() + { + $bisverwendungID = $this->get('bisverwendung_id'); + + if (isset($bisverwendungID)) + { + $result = $this->BisverwendungModel->load($bisverwendungID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBisverwendung() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['bisverwendung_id'])) + { + $result = $this->BisverwendungModel->update($this->post()['bisverwendung_id'], $this->post()); + } + else + { + $result = $this->BisverwendungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($bisverwendung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Studiengang.php b/application/controllers/api/v1/codex/Bundesland.php similarity index 62% rename from application/controllers/api/v1/organisation/Studiengang.php rename to application/controllers/api/v1/codex/Bundesland.php index 0659140af..023871501 100644 --- a/application/controllers/api/v1/organisation/Studiengang.php +++ b/application/controllers/api/v1/codex/Bundesland.php @@ -11,9 +11,10 @@ * @filesource */ // ------------------------------------------------------------------------ -if(!defined('BASEPATH')) exit('No direct script access allowed'); -class Studiengang extends APIv1_Controller +if (!defined('BASEPATH')) exit('No direct script access allowed'); + +class Bundesland extends APIv1_Controller { /** * Course API constructor. @@ -22,14 +23,14 @@ class Studiengang extends APIv1_Controller { parent::__construct(); // Load model PersonModel - $this->load->model('organisation/studiengang_model', 'StudiengangModel'); + $this->load->model('codex/bundesland_model', 'BundeslandModel'); // Load set the uid of the model to let to check the permissions - $this->StudiengangModel->setUID($this->_getUID()); + $this->BundeslandModel->setUID($this->_getUID()); } - public function getAllForBewerbung() + public function getAll() { - $result = $this->StudiengangModel->getAllForBewerbung(); + $result = $this->BundeslandModel->loadWhole(); $this->response($result, REST_Controller::HTTP_OK); } diff --git a/application/controllers/api/v1/codex/Entwicklungsteam.php b/application/controllers/api/v1/codex/Entwicklungsteam.php new file mode 100644 index 000000000..b0364143d --- /dev/null +++ b/application/controllers/api/v1/codex/Entwicklungsteam.php @@ -0,0 +1,79 @@ +load->model('codex/entwicklungsteam_model', 'EntwicklungsteamModel'); + // Load set the uid of the model to let to check the permissions + $this->EntwicklungsteamModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getEntwicklungsteam() + { + $studiengang_kz = $this->get('studiengang_kz'); + $mitarbeiter_uid = $this->get('mitarbeiter_uid'); + + if (isset($studiengang_kz) && isset($mitarbeiter_uid)) + { + $result = $this->EntwicklungsteamModel->load(array($studiengang_kz, $mitarbeiter_uid)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postEntwicklungsteam() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['studiengang_kz']) && isset($this->post()['mitarbeiter_uid'])) + { + $result = $this->EntwicklungsteamModel->update(array($this->post()['entwicklungsteam_id'], $this->post()['mitarbeiter_uid']), $this->post()); + } + else + { + $result = $this->EntwicklungsteamModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($entwicklungsteam = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Gemeinde.php b/application/controllers/api/v1/codex/Gemeinde.php new file mode 100644 index 000000000..72a21be3c --- /dev/null +++ b/application/controllers/api/v1/codex/Gemeinde.php @@ -0,0 +1,78 @@ +load->model('codex/gemeinde_model', 'GemeindeModel'); + // Load set the uid of the model to let to check the permissions + $this->GemeindeModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getGemeinde() + { + $gemeindeID = $this->get('gemeinde_id'); + + if (isset($gemeindeID)) + { + $result = $this->GemeindeModel->load($gemeindeID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postGemeinde() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['gemeinde_id'])) + { + $result = $this->GemeindeModel->update($this->post()['gemeinde_id'], $this->post()); + } + else + { + $result = $this->GemeindeModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($gemeinde = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Hauptberuf.php b/application/controllers/api/v1/codex/Hauptberuf.php new file mode 100644 index 000000000..5adce00c0 --- /dev/null +++ b/application/controllers/api/v1/codex/Hauptberuf.php @@ -0,0 +1,78 @@ +load->model('codex/hauptberuf_model', 'HauptberufModel'); + // Load set the uid of the model to let to check the permissions + $this->HauptberufModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getHauptberuf() + { + $hauptberufcode = $this->get('hauptberufcode'); + + if (isset($hauptberufcode)) + { + $result = $this->HauptberufModel->load($hauptberufcode); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postHauptberuf() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['hauptberufcode'])) + { + $result = $this->HauptberufModel->update($this->post()['hauptberufcode'], $this->post()); + } + else + { + $result = $this->HauptberufModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($hauptberuf = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Lehrform.php b/application/controllers/api/v1/codex/Lehrform.php new file mode 100644 index 000000000..99bec18b8 --- /dev/null +++ b/application/controllers/api/v1/codex/Lehrform.php @@ -0,0 +1,78 @@ +load->model('codex/lehrform_model', 'LehrformModel'); + // Load set the uid of the model to let to check the permissions + $this->LehrformModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getLehrform() + { + $lehrform_kurzbz = $this->get('lehrform_kurzbz'); + + if (isset($lehrform_kurzbz)) + { + $result = $this->LehrformModel->load($lehrform_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postLehrform() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['lehrform_kurzbz'])) + { + $result = $this->LehrformModel->update($this->post()['lehrform_kurzbz'], $this->post()); + } + else + { + $result = $this->LehrformModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($lehrform = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Lgartcode.php b/application/controllers/api/v1/codex/Lgartcode.php new file mode 100644 index 000000000..2c3dccb05 --- /dev/null +++ b/application/controllers/api/v1/codex/Lgartcode.php @@ -0,0 +1,78 @@ +load->model('codex/lgartcode_model', 'LgartcodeModel'); + // Load set the uid of the model to let to check the permissions + $this->LgartcodeModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getLgartcode() + { + $lgartcode = $this->get('lgartcode'); + + if (isset($lgartcode)) + { + $result = $this->LgartcodeModel->load($lgartcode); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postLgartcode() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['lgartcode'])) + { + $result = $this->LgartcodeModel->update($this->post()['lgartcode'], $this->post()); + } + else + { + $result = $this->LgartcodeModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($lgartcode = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Mobilitaetsprogramm.php b/application/controllers/api/v1/codex/Mobilitaetsprogramm.php new file mode 100644 index 000000000..440ee1b96 --- /dev/null +++ b/application/controllers/api/v1/codex/Mobilitaetsprogramm.php @@ -0,0 +1,78 @@ +load->model('codex/mobilitaetsprogramm_model', 'MobilitaetsprogrammModel'); + // Load set the uid of the model to let to check the permissions + $this->MobilitaetsprogrammModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getMobilitaetsprogramm() + { + $mobilitaetsprogramm_code = $this->get('mobilitaetsprogramm_code'); + + if (isset($mobilitaetsprogramm_code)) + { + $result = $this->MobilitaetsprogrammModel->load($mobilitaetsprogramm_code); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postMobilitaetsprogramm() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['mobilitaetsprogramm_code'])) + { + $result = $this->MobilitaetsprogrammModel->update($this->post()['mobilitaetsprogramm_code'], $this->post()); + } + else + { + $result = $this->MobilitaetsprogrammModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($mobilitaetsprogramm = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Nation.php b/application/controllers/api/v1/codex/Nation.php index 517a95c6d..2597b696e 100644 --- a/application/controllers/api/v1/codex/Nation.php +++ b/application/controllers/api/v1/codex/Nation.php @@ -12,7 +12,7 @@ */ // ------------------------------------------------------------------------ -if(!defined('BASEPATH')) exit('No direct script access allowed'); +if (!defined('BASEPATH')) exit('No direct script access allowed'); class Nation extends APIv1_Controller { @@ -30,7 +30,7 @@ class Nation extends APIv1_Controller public function getAll() { - if(!$this->get('orderEnglish')) + if (!$this->get('orderEnglish')) { $result = $this->NationModel->addOrder('kurztext'); } @@ -39,9 +39,9 @@ class Nation extends APIv1_Controller $result = $this->NationModel->addOrder('engltext'); } - if($result->error == EXIT_SUCCESS) + if ($result->error == EXIT_SUCCESS) { - if($this->get('ohnesperre')) + if ($this->get('ohnesperre')) { $result = $this->NationModel->loadWhere('sperre IS NULL'); } diff --git a/application/controllers/api/v1/codex/Note.php b/application/controllers/api/v1/codex/Note.php new file mode 100644 index 000000000..a1e3543dd --- /dev/null +++ b/application/controllers/api/v1/codex/Note.php @@ -0,0 +1,78 @@ +load->model('codex/note_model', 'NoteModel'); + // Load set the uid of the model to let to check the permissions + $this->NoteModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getNote() + { + $note = $this->get('note'); + + if (isset($note)) + { + $result = $this->NoteModel->load($note); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postNote() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['note'])) + { + $result = $this->NoteModel->update($this->post()['note'], $this->post()); + } + else + { + $result = $this->NoteModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($note = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Orgform.php b/application/controllers/api/v1/codex/Orgform.php new file mode 100644 index 000000000..82736830e --- /dev/null +++ b/application/controllers/api/v1/codex/Orgform.php @@ -0,0 +1,78 @@ +load->model('codex/orgform_model', 'OrgformModel'); + // Load set the uid of the model to let to check the permissions + $this->OrgformModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getOrgform() + { + $orgform_kurzbz = $this->get('orgform_kurzbz'); + + if (isset($orgform_kurzbz)) + { + $result = $this->OrgformModel->load($orgform_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postOrgform() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['orgform_kurzbz'])) + { + $result = $this->OrgformModel->update($this->post()['orgform_kurzbz'], $this->post()); + } + else + { + $result = $this->OrgformModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($orgform = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Verwendung.php b/application/controllers/api/v1/codex/Verwendung.php new file mode 100644 index 000000000..16ed77dcd --- /dev/null +++ b/application/controllers/api/v1/codex/Verwendung.php @@ -0,0 +1,78 @@ +load->model('codex/verwendung_model', 'VerwendungModel'); + // Load set the uid of the model to let to check the permissions + $this->VerwendungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getVerwendung() + { + $verwendung_code = $this->get('verwendung_code'); + + if (isset($verwendung_code)) + { + $result = $this->VerwendungModel->load($verwendung_code); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postVerwendung() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['verwendung_code'])) + { + $result = $this->VerwendungModel->update($this->post()['verwendung_code'], $this->post()); + } + else + { + $result = $this->VerwendungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($verwendung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Zgv.php b/application/controllers/api/v1/codex/Zgv.php new file mode 100644 index 000000000..39a51581f --- /dev/null +++ b/application/controllers/api/v1/codex/Zgv.php @@ -0,0 +1,78 @@ +load->model('codex/zgv_model', 'ZgvModel'); + // Load set the uid of the model to let to check the permissions + $this->ZgvModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getZgv() + { + $zgv_code = $this->get('zgv_code'); + + if (isset($zgv_code)) + { + $result = $this->ZgvModel->load($zgv_code); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postZgv() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['zgv_code'])) + { + $result = $this->ZgvModel->update($this->post()['zgv_code'], $this->post()); + } + else + { + $result = $this->ZgvModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($zgv = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Zgvdoktor.php b/application/controllers/api/v1/codex/Zgvdoktor.php new file mode 100644 index 000000000..44d6cc87b --- /dev/null +++ b/application/controllers/api/v1/codex/Zgvdoktor.php @@ -0,0 +1,78 @@ +load->model('codex/zgvdoktor_model', 'ZgvdoktorModel'); + // Load set the uid of the model to let to check the permissions + $this->ZgvdoktorModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getZgvdoktor() + { + $zgvdoktor_code = $this->get('zgvdoktor_code'); + + if (isset($zgvdoktor_code)) + { + $result = $this->ZgvdoktorModel->load($zgvdoktor_code); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postZgvdoktor() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['zgvdoktor_code'])) + { + $result = $this->ZgvdoktorModel->update($this->post()['zgvdoktor_code'], $this->post()); + } + else + { + $result = $this->ZgvdoktorModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($zgvdoktor = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Zgvgruppe.php b/application/controllers/api/v1/codex/Zgvgruppe.php new file mode 100644 index 000000000..4050387d2 --- /dev/null +++ b/application/controllers/api/v1/codex/Zgvgruppe.php @@ -0,0 +1,78 @@ +load->model('codex/zgvgruppe_model', 'ZgvgruppeModel'); + // Load set the uid of the model to let to check the permissions + $this->ZgvgruppeModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getZgvgruppe() + { + $gruppe_kurzbz = $this->get('gruppe_kurzbz'); + + if (isset($gruppe_kurzbz)) + { + $result = $this->ZgvgruppeModel->load($gruppe_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postZgvgruppe() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['zgvgruppe_id'])) + { + $result = $this->ZgvgruppeModel->update($this->post()['zgvgruppe_id'], $this->post()); + } + else + { + $result = $this->ZgvgruppeModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($zgvgruppe = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Zgvmaster.php b/application/controllers/api/v1/codex/Zgvmaster.php new file mode 100644 index 000000000..14b23824b --- /dev/null +++ b/application/controllers/api/v1/codex/Zgvmaster.php @@ -0,0 +1,78 @@ +load->model('codex/zgvmaster_model', 'ZgvmasterModel'); + // Load set the uid of the model to let to check the permissions + $this->ZgvmasterModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getZgvmaster() + { + $zgvmas_code = $this->get('zgvmas_code'); + + if (isset($zgvmas_code)) + { + $result = $this->ZgvmasterModel->load($zgvmas_code); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postZgvmaster() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['zgvmas_code'])) + { + $result = $this->ZgvmasterModel->update($this->post()['zgvmas_code'], $this->post()); + } + else + { + $result = $this->ZgvmasterModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($zgvmaster = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/codex/Zweck.php b/application/controllers/api/v1/codex/Zweck.php new file mode 100644 index 000000000..c7cc60353 --- /dev/null +++ b/application/controllers/api/v1/codex/Zweck.php @@ -0,0 +1,78 @@ +load->model('codex/zweck_model', 'ZweckModel'); + // Load set the uid of the model to let to check the permissions + $this->ZweckModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getZweck() + { + $zweck_code = $this->get('zweck_code'); + + if (isset($zweck_code)) + { + $result = $this->ZweckModel->load($zweck_code); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postZweck() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['zweck_code'])) + { + $result = $this->ZweckModel->update($this->post()['zweck_code'], $this->post()); + } + else + { + $result = $this->ZweckModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($zweck = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/content/Ampel.php b/application/controllers/api/v1/content/Ampel.php new file mode 100644 index 000000000..bec9c84de --- /dev/null +++ b/application/controllers/api/v1/content/Ampel.php @@ -0,0 +1,78 @@ +load->model('content/ampel_model', 'AmpelModel'); + // Load set the uid of the model to let to check the permissions + $this->AmpelModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAmpel() + { + $ampelID = $this->get('ampel_id'); + + if (isset($ampelID)) + { + $result = $this->AmpelModel->load($ampelID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAmpel() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['ampel_id'])) + { + $result = $this->AmpelModel->update($this->post()['ampel_id'], $this->post()); + } + else + { + $result = $this->AmpelModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($ampel = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/content/Content.php b/application/controllers/api/v1/content/Content.php new file mode 100644 index 000000000..b67914b70 --- /dev/null +++ b/application/controllers/api/v1/content/Content.php @@ -0,0 +1,78 @@ +load->model('content/content_model', 'ContentModel'); + // Load set the uid of the model to let to check the permissions + $this->ContentModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getContent() + { + $contentID = $this->get('content_id'); + + if (isset($contentID)) + { + $result = $this->ContentModel->load($contentID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postContent() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['content_id'])) + { + $result = $this->ContentModel->update($this->post()['content_id'], $this->post()); + } + else + { + $result = $this->ContentModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($content = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/content/Contentchild.php b/application/controllers/api/v1/content/Contentchild.php new file mode 100644 index 000000000..802f65d0a --- /dev/null +++ b/application/controllers/api/v1/content/Contentchild.php @@ -0,0 +1,78 @@ +load->model('content/contentchild_model', 'ContentchildModel'); + // Load set the uid of the model to let to check the permissions + $this->ContentchildModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getContentchild() + { + $contentchildID = $this->get('contentchild_id'); + + if (isset($contentchildID)) + { + $result = $this->ContentchildModel->load($contentchildID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postContentchild() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['contentchild_id'])) + { + $result = $this->ContentchildModel->update($this->post()['contentchild_id'], $this->post()); + } + else + { + $result = $this->ContentchildModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($contentchild = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/content/Contentgruppe.php b/application/controllers/api/v1/content/Contentgruppe.php new file mode 100644 index 000000000..f9b78b74f --- /dev/null +++ b/application/controllers/api/v1/content/Contentgruppe.php @@ -0,0 +1,79 @@ +load->model('content/contentgruppe_model', 'ContentgruppeModel'); + // Load set the uid of the model to let to check the permissions + $this->ContentgruppeModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getContentgruppe() + { + $gruppe_kurzbz = $this->get('gruppe_kurzbz'); + $content_id = $this->get('content_id'); + + if (isset($gruppe_kurzbz) && isset($content_id)) + { + $result = $this->ContentgruppeModel->load(array($gruppe_kurzbz, $content_id)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postContentgruppe() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['gruppe_kurzbz']) && isset($this->post()['content_id'])) + { + $result = $this->ContentgruppeModel->update(array($this->post()['gruppe_kurzbz'], $this->post()['content_id']), $this->post()); + } + else + { + $result = $this->ContentgruppeModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($contentgruppe = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/content/Contentlog.php b/application/controllers/api/v1/content/Contentlog.php new file mode 100644 index 000000000..9faf3ad85 --- /dev/null +++ b/application/controllers/api/v1/content/Contentlog.php @@ -0,0 +1,78 @@ +load->model('content/contentlog_model', 'ContentlogModel'); + // Load set the uid of the model to let to check the permissions + $this->ContentlogModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getContentlog() + { + $contentlogID = $this->get('contentlog_id'); + + if (isset($contentlogID)) + { + $result = $this->ContentlogModel->load($contentlogID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postContentlog() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['contentlog_id'])) + { + $result = $this->ContentlogModel->update($this->post()['contentlog_id'], $this->post()); + } + else + { + $result = $this->ContentlogModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($contentlog = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/content/Contentsprache.php b/application/controllers/api/v1/content/Contentsprache.php new file mode 100644 index 000000000..aa02c5807 --- /dev/null +++ b/application/controllers/api/v1/content/Contentsprache.php @@ -0,0 +1,78 @@ +load->model('content/contentsprache_model', 'ContentspracheModel'); + // Load set the uid of the model to let to check the permissions + $this->ContentspracheModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getContentsprache() + { + $contentspracheID = $this->get('contentsprache_id'); + + if (isset($contentspracheID)) + { + $result = $this->ContentspracheModel->load($contentspracheID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postContentsprache() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['contentsprache_id'])) + { + $result = $this->ContentspracheModel->update($this->post()['contentsprache_id'], $this->post()); + } + else + { + $result = $this->ContentspracheModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($contentsprache = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/content/Dms.php b/application/controllers/api/v1/content/Dms.php new file mode 100644 index 000000000..e1891a6b9 --- /dev/null +++ b/application/controllers/api/v1/content/Dms.php @@ -0,0 +1,98 @@ +load->model('content/dms_model', 'DmsModel'); + // Load set the uid of the model to let to check the permissions + $this->DmsModel->setUID($this->_getUID()); + } + + /** + * + */ + public function getDms() + { + $dms_id = $this->get('dms_id'); + $version = $this->get('version'); + + if (isset($dms_id)) + { + $result = $this->DmsModel->addJoin('campus.tbl_dms_version', 'dms_id'); + if ($result->error == EXIT_SUCCESS) + { + $result = $this->DmsModel->addOrder('version', 'DESC'); + if ($result->error == EXIT_SUCCESS) + { + $result = $this->DmsModel->addLimit(1); + if ($result->error == EXIT_SUCCESS) + { + if (!isset($version)) + { + $result = $this->DmsModel->loadWhere(array('dms_id' => $dms_id)); + } + else + { + $result = $this->DmsModel->loadWhere(array('dms_id' => $dms_id, 'version' => $version)); + } + } + } + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * + */ + 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/Infoscreen.php b/application/controllers/api/v1/content/Infoscreen.php new file mode 100644 index 000000000..6e859ca5a --- /dev/null +++ b/application/controllers/api/v1/content/Infoscreen.php @@ -0,0 +1,78 @@ +load->model('content/infoscreen_model', 'InfoscreenModel'); + // Load set the uid of the model to let to check the permissions + $this->InfoscreenModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getInfoscreen() + { + $infoscreenID = $this->get('infoscreen_id'); + + if (isset($infoscreenID)) + { + $result = $this->InfoscreenModel->load($infoscreenID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postInfoscreen() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['infoscreen_id'])) + { + $result = $this->InfoscreenModel->update($this->post()['infoscreen_id'], $this->post()); + } + else + { + $result = $this->InfoscreenModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($infoscreen = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/content/News.php b/application/controllers/api/v1/content/News.php new file mode 100644 index 000000000..346faca11 --- /dev/null +++ b/application/controllers/api/v1/content/News.php @@ -0,0 +1,78 @@ +load->model('content/news_model', 'NewsModel'); + // Load set the uid of the model to let to check the permissions + $this->NewsModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getNews() + { + $newsID = $this->get('news_id'); + + if (isset($newsID)) + { + $result = $this->NewsModel->load($newsID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postNews() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['news_id'])) + { + $result = $this->NewsModel->update($this->post()['news_id'], $this->post()); + } + else + { + $result = $this->NewsModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($news = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/content/Template.php b/application/controllers/api/v1/content/Template.php new file mode 100644 index 000000000..5f67af4d0 --- /dev/null +++ b/application/controllers/api/v1/content/Template.php @@ -0,0 +1,78 @@ +load->model('content/template_model', 'TemplateModel'); + // Load set the uid of the model to let to check the permissions + $this->TemplateModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getTemplate() + { + $template_kurzbz = $this->get('template_kurzbz'); + + if (isset($template_kurzbz)) + { + $result = $this->TemplateModel->load($template_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postTemplate() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['template_kurzbz'])) + { + $result = $this->TemplateModel->update($this->post()['template_kurzbz'], $this->post()); + } + else + { + $result = $this->TemplateModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($template = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/content/Veranstaltung.php b/application/controllers/api/v1/content/Veranstaltung.php new file mode 100644 index 000000000..ea5ccc19f --- /dev/null +++ b/application/controllers/api/v1/content/Veranstaltung.php @@ -0,0 +1,78 @@ +load->model('content/veranstaltung_model', 'VeranstaltungModel'); + // Load set the uid of the model to let to check the permissions + $this->VeranstaltungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getVeranstaltung() + { + $veranstaltungID = $this->get('veranstaltung_id'); + + if (isset($veranstaltungID)) + { + $result = $this->VeranstaltungModel->load($veranstaltungID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postVeranstaltung() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['veranstaltung_id'])) + { + $result = $this->VeranstaltungModel->update($this->post()['veranstaltung_id'], $this->post()); + } + else + { + $result = $this->VeranstaltungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($veranstaltung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/content/Veranstaltungskategorie.php b/application/controllers/api/v1/content/Veranstaltungskategorie.php new file mode 100644 index 000000000..ffc9a32bd --- /dev/null +++ b/application/controllers/api/v1/content/Veranstaltungskategorie.php @@ -0,0 +1,78 @@ +load->model('content/veranstaltungskategorie_model', 'VeranstaltungskategorieModel'); + // Load set the uid of the model to let to check the permissions + $this->VeranstaltungskategorieModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getVeranstaltungskategorie() + { + $veranstaltungskategorie_kurzbz = $this->get('veranstaltungskategorie_kurzbz'); + + if (isset($veranstaltungskategorie_kurzbz)) + { + $result = $this->VeranstaltungskategorieModel->load($veranstaltungskategorie_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postVeranstaltungskategorie() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['veranstaltungskategorie_kurzbz'])) + { + $result = $this->VeranstaltungskategorieModel->update($this->post()['veranstaltungskategorie_kurzbz'], $this->post()); + } + else + { + $result = $this->VeranstaltungskategorieModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($veranstaltungskategorie = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Akte.php b/application/controllers/api/v1/crm/Akte.php new file mode 100644 index 000000000..cd52b97f5 --- /dev/null +++ b/application/controllers/api/v1/crm/Akte.php @@ -0,0 +1,78 @@ +load->model('crm/akte_model', 'AkteModel'); + // Load set the uid of the model to let to check the permissions + $this->AkteModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAkte() + { + $akteID = $this->get('akte_id'); + + if (isset($akteID)) + { + $result = $this->AkteModel->load($akteID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAkte() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['akte_id'])) + { + $result = $this->AkteModel->update($this->post()['akte_id'], $this->post()); + } + else + { + $result = $this->AkteModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($akte = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Aufnahmeschluessel.php b/application/controllers/api/v1/crm/Aufnahmeschluessel.php new file mode 100644 index 000000000..935a89fb6 --- /dev/null +++ b/application/controllers/api/v1/crm/Aufnahmeschluessel.php @@ -0,0 +1,78 @@ +load->model('crm/aufnahmeschluessel_model', 'AufnahmeschluesselModel'); + // Load set the uid of the model to let to check the permissions + $this->AufnahmeschluesselModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAufnahmeschluessel() + { + $aufnahmeschluessel = $this->get('aufnahmeschluessel'); + + if (isset($aufnahmeschluessel)) + { + $result = $this->AufnahmeschluesselModel->load($aufnahmeschluessel); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAufnahmeschluessel() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['aufnahmeschluessel'])) + { + $result = $this->AufnahmeschluesselModel->update($this->post()['aufnahmeschluessel'], $this->post()); + } + else + { + $result = $this->AufnahmeschluesselModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($aufnahmeschluessel = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Aufnahmetermin.php b/application/controllers/api/v1/crm/Aufnahmetermin.php new file mode 100644 index 000000000..1d96aface --- /dev/null +++ b/application/controllers/api/v1/crm/Aufnahmetermin.php @@ -0,0 +1,78 @@ +load->model('crm/aufnahmetermin_model', 'AufnahmeterminModel'); + // Load set the uid of the model to let to check the permissions + $this->AufnahmeterminModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAufnahmetermin() + { + $aufnahmeterminID = $this->get('aufnahmetermin_id'); + + if (isset($aufnahmeterminID)) + { + $result = $this->AufnahmeterminModel->load($aufnahmeterminID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAufnahmetermin() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['aufnahmetermin_id'])) + { + $result = $this->AufnahmeterminModel->update($this->post()['aufnahmetermin_id'], $this->post()); + } + else + { + $result = $this->AufnahmeterminModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($aufnahmetermin = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Aufnahmetermintyp.php b/application/controllers/api/v1/crm/Aufnahmetermintyp.php new file mode 100644 index 000000000..f7ffd419d --- /dev/null +++ b/application/controllers/api/v1/crm/Aufnahmetermintyp.php @@ -0,0 +1,78 @@ +load->model('crm/aufnahmetermintyp_model', 'AufnahmetermintypModel'); + // Load set the uid of the model to let to check the permissions + $this->AufnahmetermintypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAufnahmetermintyp() + { + $aufnahmetermintyp_kurzbz = $this->get('aufnahmetermintyp_kurzbz'); + + if (isset($aufnahmetermintyp_kurzbz)) + { + $result = $this->AufnahmetermintypModel->load($aufnahmetermintyp_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAufnahmetermintyp() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['aufnahmetermintyp_kurzbz'])) + { + $result = $this->AufnahmetermintypModel->update($this->post()['aufnahmetermintyp_kurzbz'], $this->post()); + } + else + { + $result = $this->AufnahmetermintypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($aufnahmetermintyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Bewerbungstermine.php b/application/controllers/api/v1/crm/Bewerbungstermine.php new file mode 100644 index 000000000..28c07dc98 --- /dev/null +++ b/application/controllers/api/v1/crm/Bewerbungstermine.php @@ -0,0 +1,78 @@ +load->model('crm/bewerbungstermine_model', 'BewerbungstermineModel'); + // Load set the uid of the model to let to check the permissions + $this->BewerbungstermineModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBewerbungstermine() + { + $bewerbungstermineID = $this->get('bewerbungstermine_id'); + + if (isset($bewerbungstermineID)) + { + $result = $this->BewerbungstermineModel->load($bewerbungstermineID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBewerbungstermine() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['bewerbungstermine_id'])) + { + $result = $this->BewerbungstermineModel->update($this->post()['bewerbungstermine_id'], $this->post()); + } + else + { + $result = $this->BewerbungstermineModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($bewerbungstermine = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Buchungstyp.php b/application/controllers/api/v1/crm/Buchungstyp.php new file mode 100644 index 000000000..73be5f666 --- /dev/null +++ b/application/controllers/api/v1/crm/Buchungstyp.php @@ -0,0 +1,78 @@ +load->model('crm/buchungstyp_model', 'BuchungstypModel'); + // Load set the uid of the model to let to check the permissions + $this->BuchungstypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBuchungstyp() + { + $buchungstyp_kurzbz = $this->get('buchungstyp_kurzbz'); + + if (isset($buchungstyp_kurzbz)) + { + $result = $this->BuchungstypModel->load($buchungstyp_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBuchungstyp() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['buchungstyp_kurzbz'])) + { + $result = $this->BuchungstypModel->update($this->post()['buchungstyp_kurzbz'], $this->post()); + } + else + { + $result = $this->BuchungstypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($buchungstyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Dokument.php b/application/controllers/api/v1/crm/Dokument.php new file mode 100644 index 000000000..fd8c80b37 --- /dev/null +++ b/application/controllers/api/v1/crm/Dokument.php @@ -0,0 +1,78 @@ +load->model('crm/dokument_model', 'DokumentModel'); + // Load set the uid of the model to let to check the permissions + $this->DokumentModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getDokument() + { + $dokument_kurzbz = $this->get('dokument_kurzbz'); + + if (isset($dokument_kurzbz)) + { + $result = $this->DokumentModel->load($dokument_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postDokument() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['dokument_kurzbz'])) + { + $result = $this->DokumentModel->update($this->post()['dokument_kurzbz'], $this->post()); + } + else + { + $result = $this->DokumentModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($dokument = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Dokumentprestudent.php b/application/controllers/api/v1/crm/Dokumentprestudent.php new file mode 100644 index 000000000..7a9fe6c2c --- /dev/null +++ b/application/controllers/api/v1/crm/Dokumentprestudent.php @@ -0,0 +1,79 @@ +load->model('crm/dokumentprestudent_model', 'DokumentprestudentModel'); + // Load set the uid of the model to let to check the permissions + $this->DokumentprestudentModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getDokumentprestudent() + { + $prestudent_id = $this->get('prestudent_id'); + $dokument_kurzbz = $this->get('dokument_kurzbz'); + + if (isset($prestudent_id) && isset($dokument_kurzbz)) + { + $result = $this->DokumentprestudentModel->load(array($prestudent_id, $dokument_kurzbz)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postDokumentprestudent() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['prestudent_id']) && isset($this->post()['dokument_kurzbz'])) + { + $result = $this->DokumentprestudentModel->update(array($this->post()['prestudent_id'], $this->post()['dokument_kurzbz']), $this->post()); + } + else + { + $result = $this->DokumentprestudentModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($dokumentprestudent = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Dokumentstudiengang.php b/application/controllers/api/v1/crm/Dokumentstudiengang.php new file mode 100644 index 000000000..22fee1803 --- /dev/null +++ b/application/controllers/api/v1/crm/Dokumentstudiengang.php @@ -0,0 +1,79 @@ +load->model('crm/dokumentstudiengang_model', 'DokumentstudiengangModel'); + // Load set the uid of the model to let to check the permissions + $this->DokumentstudiengangModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getDokumentstudiengang() + { + $studiengang_kz = $this->get('studiengang_kz'); + $dokument_kurzbz = $this->get('dokument_kurzbz'); + + if (isset($studiengang_kz) && isset($dokument_kurzbz)) + { + $result = $this->DokumentstudiengangModel->load(array($studiengang_kz, $dokument_kurzbz)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postDokumentstudiengang() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['studiengang_kz']) && isset($this->post()['dokument_kurzbz'])) + { + $result = $this->DokumentstudiengangModel->update(array($this->post()['studiengang_kz'], $this->post()['dokument_kurzbz']), $this->post()); + } + else + { + $result = $this->DokumentstudiengangModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($dokumentstudiengang = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Konto.php b/application/controllers/api/v1/crm/Konto.php new file mode 100644 index 000000000..d63bee9b4 --- /dev/null +++ b/application/controllers/api/v1/crm/Konto.php @@ -0,0 +1,78 @@ +load->model('crm/konto_model', 'KontoModel'); + // Load set the uid of the model to let to check the permissions + $this->KontoModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getKonto() + { + $buchungsnr = $this->get('buchungsnr'); + + if (isset($buchungsnr)) + { + $result = $this->KontoModel->load($buchungsnr); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postKonto() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['buchungsnr'])) + { + $result = $this->KontoModel->update($this->post()['buchungsnr'], $this->post()); + } + else + { + $result = $this->KontoModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($konto = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Preincoming.php b/application/controllers/api/v1/crm/Preincoming.php new file mode 100644 index 000000000..f7df3c5f5 --- /dev/null +++ b/application/controllers/api/v1/crm/Preincoming.php @@ -0,0 +1,78 @@ +load->model('crm/preincoming_model', 'PreincomingModel'); + // Load set the uid of the model to let to check the permissions + $this->PreincomingModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getPreincoming() + { + $preincomingID = $this->get('preincoming_id'); + + if (isset($preincomingID)) + { + $result = $this->PreincomingModel->load($preincomingID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postPreincoming() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['preincoming_id'])) + { + $result = $this->PreincomingModel->update($this->post()['preincoming_id'], $this->post()); + } + else + { + $result = $this->PreincomingModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($preincoming = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Preinteressent.php b/application/controllers/api/v1/crm/Preinteressent.php new file mode 100644 index 000000000..f6e781e60 --- /dev/null +++ b/application/controllers/api/v1/crm/Preinteressent.php @@ -0,0 +1,109 @@ +load->model('crm/preinteressent_model', 'PreinteressentModel'); + // Load set the uid of the model to let to check the permissions + $this->PreinteressentModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getPreinteressent() + { + $preinteressent_id = $this->get('preinteressent_id'); + + if (isset($preinteressent_id)) + { + $result = $this->PreinteressentModel->load($preinteressent_id); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function getPreinteressentByPersonID() + { + $person_id = $this->get('person_id'); + + if (isset($person_id)) + { + $result = $this->PreinteressentModel->load(array('person_id' => $person_id)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postPreinteressent() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['preinteressent_id'])) + { + $result = $this->PreinteressentModel->update($this->post()['preinteressent_id'], $this->post()); + } + else + { + $result = $this->PreinteressentModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($preinteressent) + { + if ($preinteressent['person_id'] == '') + { + //$this->errormsg = 'Person_id muss angegeben werden'; + return false; + } + + if ($preinteressent['aufmerksamdurch_kurzbz'] == '') + { + //$this->errormsg = 'Aufmerksamdurch muss angegeben werden'; + return false; + } + + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Preinteressentstudiengang.php b/application/controllers/api/v1/crm/Preinteressentstudiengang.php new file mode 100644 index 000000000..dc82971ba --- /dev/null +++ b/application/controllers/api/v1/crm/Preinteressentstudiengang.php @@ -0,0 +1,79 @@ +load->model('crm/preinteressentstudiengang_model', 'PreinteressentstudiengangModel'); + // Load set the uid of the model to let to check the permissions + $this->PreinteressentstudiengangModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getPreinteressentstudiengang() + { + $preinteressent_id = $this->get('preinteressent_id'); + $studiengang_kz = $this->get('studiengang_kz'); + + if (isset($preinteressent_id) && isset($studiengang_kz)) + { + $result = $this->PreinteressentstudiengangModel->load(array($preinteressent_id, $studiengang_kz)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postPreinteressentstudiengang() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['preinteressent_id']) && isset($this->post()['studiengang_kz'])) + { + $result = $this->PreinteressentstudiengangModel->update(array($this->post()['preinteressent_id'], $this->post()['studiengang_kz']), $this->post()); + } + else + { + $result = $this->PreinteressentstudiengangModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($preinteressentstudiengang = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Preoutgoing.php b/application/controllers/api/v1/crm/Preoutgoing.php new file mode 100644 index 000000000..885b74c8d --- /dev/null +++ b/application/controllers/api/v1/crm/Preoutgoing.php @@ -0,0 +1,78 @@ +load->model('crm/preoutgoing_model', 'PreoutgoingModel'); + // Load set the uid of the model to let to check the permissions + $this->PreoutgoingModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getPreoutgoing() + { + $preoutgoingID = $this->get('preoutgoing_id'); + + if (isset($preoutgoingID)) + { + $result = $this->PreoutgoingModel->load($preoutgoingID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postPreoutgoing() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['preoutgoing_id'])) + { + $result = $this->PreoutgoingModel->update($this->post()['preoutgoing_id'], $this->post()); + } + else + { + $result = $this->PreoutgoingModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($preoutgoing = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Prestudent.php b/application/controllers/api/v1/crm/Prestudent.php new file mode 100644 index 000000000..d334cc709 --- /dev/null +++ b/application/controllers/api/v1/crm/Prestudent.php @@ -0,0 +1,97 @@ +load->model('crm/prestudent_model', 'PrestudentModel'); + // Load set the uid of the model to let to check the permissions + $this->PrestudentModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getPrestudent() + { + $prestudentID = $this->get('prestudent_id'); + + if (isset($prestudentID)) + { + $result = $this->PrestudentModel->load($prestudentID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function getPrestudentByPersonID() + { + $person_id = $this->get('person_id'); + + if (isset($person_id)) + { + $result = $this->PrestudentModel->load(array('person_id' => $person_id)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postPrestudent() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['prestudent_id'])) + { + $result = $this->PrestudentModel->update($this->post()['prestudent_id'], $this->post()); + } + else + { + $result = $this->PrestudentModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($prestudent = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Prestudentstatus.php b/application/controllers/api/v1/crm/Prestudentstatus.php new file mode 100644 index 000000000..f1bfda16a --- /dev/null +++ b/application/controllers/api/v1/crm/Prestudentstatus.php @@ -0,0 +1,92 @@ +load->model('crm/prestudentstatus_model', 'PrestudentstatusModel'); + // Load set the uid of the model to let to check the permissions + $this->PrestudentstatusModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getPrestudentstatus() + { + $ausbildungssemester = $this->get('ausbildungssemester'); + $studiensemester_kurzbz = $this->get('studiensemester_kurzbz'); + $status_kurzbz = $this->get('status_kurzbz'); + $prestudent_id = $this->get('prestudent_id'); + + if (isset($ausbildungssemester) && isset($studiensemester_kurzbz) && isset($status_kurzbz) && isset($prestudent_id)) + { + $result = $this->PrestudentstatusModel->load(array($ausbildungssemester, $studiensemester_kurzbz, $status_kurzbz, $prestudent_id)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postPrestudentstatus() + { + $prestudentstatus = $this->_parseData($this->post()); + + $this->response($prestudentstatus); + + if ($this->_validate($prestudentstatus)) + { + if (isset($prestudentstatus['ausbildungssemester']) && isset($prestudentstatus['studiensemester_kurzbz']) && + isset($prestudentstatus['status_kurzbz']) && isset($prestudentstatus['prestudent_id'])) + { + $pksArray = array($prestudentstatus['ausbildungssemester'], + $prestudentstatus['studiensemester_kurzbz'], + $prestudentstatus['status_kurzbz'], + $prestudentstatus['prestudent_id'] + ); + + $result = $this->PrestudentstatusModel->update($pksArray, $prestudentstatus); + } + else + { + $result = $this->PrestudentstatusModel->insert($prestudentstatus); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($prestudentstatus = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Reihungstest.php b/application/controllers/api/v1/crm/Reihungstest.php new file mode 100644 index 000000000..60c521256 --- /dev/null +++ b/application/controllers/api/v1/crm/Reihungstest.php @@ -0,0 +1,78 @@ +load->model('crm/reihungstest_model', 'ReihungstestModel'); + // Load set the uid of the model to let to check the permissions + $this->ReihungstestModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getReihungstest() + { + $reihungstestID = $this->get('reihungstest_id'); + + if (isset($reihungstestID)) + { + $result = $this->ReihungstestModel->load($reihungstestID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postReihungstest() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['reihungstest_id'])) + { + $result = $this->ReihungstestModel->update($this->post()['reihungstest_id'], $this->post()); + } + else + { + $result = $this->ReihungstestModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($reihungstest = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Status.php b/application/controllers/api/v1/crm/Status.php new file mode 100644 index 000000000..b7dda0cce --- /dev/null +++ b/application/controllers/api/v1/crm/Status.php @@ -0,0 +1,78 @@ +load->model('crm/status_model', 'StatusModel'); + // Load set the uid of the model to let to check the permissions + $this->StatusModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStatus() + { + $status_kurzbz = $this->get('status_kurzbz'); + + if (isset($status_kurzbz)) + { + $result = $this->StatusModel->load($status_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStatus() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['status_kurzbz'])) + { + $result = $this->StatusModel->update($this->post()['status_kurzbz'], $this->post()); + } + else + { + $result = $this->StatusModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($status = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/crm/Student.php b/application/controllers/api/v1/crm/Student.php new file mode 100644 index 000000000..d0bd7c5a1 --- /dev/null +++ b/application/controllers/api/v1/crm/Student.php @@ -0,0 +1,78 @@ +load->model('crm/student_model', 'StudentModel'); + // Load set the uid of the model to let to check the permissions + $this->StudentModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStudent() + { + $studentID = $this->get('student_id'); + + if (isset($studentID)) + { + $result = $this->StudentModel->load($studentID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStudent() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['student_id'])) + { + $result = $this->StudentModel->update($this->post()['student_id'], $this->post()); + } + else + { + $result = $this->StudentModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($student = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/education/Abgabe.php b/application/controllers/api/v1/education/Abgabe.php new file mode 100644 index 000000000..a7604a264 --- /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..6de5e6e46 --- /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..6c1f03caa --- /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..4d73de092 --- /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..ff1be2316 --- /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..a1fa0df43 --- /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..9ed23491d --- /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..3d62d7618 --- /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..8d340ccc2 --- /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..de7641a4c --- /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..6f100b43a --- /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..30f0adc0f --- /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..2a25f73f6 --- /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..fd20bb131 --- /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..f05b3c074 --- /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..3941327f2 --- /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..b084d65da --- /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..fe88f2749 --- /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..21ad945df --- /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..d9ea9ae06 --- /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..01d96ec92 --- /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..d0795813b --- /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..f75be3c56 --- /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..6596e5ad1 --- /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..d3372375e --- /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..d98a3c97b --- /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..2699dad58 --- /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..1ee0ccce8 --- /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..e67253fbb --- /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..5a93d9f08 --- /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..28f7922f5 --- /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..6cf01a208 --- /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..c254833a2 --- /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..6c0a44049 --- /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..a30d78680 --- /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..64e6fbbe7 --- /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..5158cac10 --- /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..e3e1631bc --- /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..b4af31f8e --- /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..02b626cfc --- /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..5e9e8cac9 --- /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..cd386732b --- /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..95d0fb52d --- /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..f9fbf74a5 --- /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..7b6e602ab --- /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 diff --git a/application/controllers/api/v1/organisation/Erhalter.php b/application/controllers/api/v1/organisation/Erhalter.php new file mode 100644 index 000000000..1e6c730b4 --- /dev/null +++ b/application/controllers/api/v1/organisation/Erhalter.php @@ -0,0 +1,78 @@ +load->model('organisation/erhalter_model', 'ErhalterModel'); + // Load set the uid of the model to let to check the permissions + $this->ErhalterModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getErhalter() + { + $erhalter_kz = $this->get('erhalter_kz'); + + if (isset($erhalter_kz)) + { + $result = $this->ErhalterModel->load($erhalter_kz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postErhalter() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['erhalter_kz'])) + { + $result = $this->ErhalterModel->update($this->post()['erhalter_kz'], $this->post()); + } + else + { + $result = $this->ErhalterModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($erhalter = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Fachbereich2.php b/application/controllers/api/v1/organisation/Fachbereich2.php new file mode 100644 index 000000000..662298940 --- /dev/null +++ b/application/controllers/api/v1/organisation/Fachbereich2.php @@ -0,0 +1,78 @@ +load->model('organisation/fachbereich_model', 'FachbereichModel'); + // Load set the uid of the model to let to check the permissions + $this->FachbereichModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getFachbereich() + { + $fachbereich_kurzbz = $this->get('fachbereich_kurzbz'); + + if (isset($fachbereich_kurzbz)) + { + $result = $this->FachbereichModel->load($fachbereich_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postFachbereich() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['fachbereich_id'])) + { + $result = $this->FachbereichModel->update($this->post()['fachbereich_id'], $this->post()); + } + else + { + $result = $this->FachbereichModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($fachbereich = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Ferien.php b/application/controllers/api/v1/organisation/Ferien.php new file mode 100644 index 000000000..5ecf54756 --- /dev/null +++ b/application/controllers/api/v1/organisation/Ferien.php @@ -0,0 +1,79 @@ +load->model('organisation/ferien_model', 'FerienModel'); + // Load set the uid of the model to let to check the permissions + $this->FerienModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getFerien() + { + $studiengang_kz = $this->get('studiengang_kz'); + $bezeichnung = $this->get('bezeichnung'); + + if (isset($studiengang_kz) && isset($bezeichnung)) + { + $result = $this->FerienModel->load(array($studiengang_kz, $bezeichnung)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postFerien() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['studiengang_kz']) && isset($this->post()['bezeichnung'])) + { + $result = $this->FerienModel->update(array($this->post()['ferien_id'], $this->post()['bezeichnung']), $this->post()); + } + else + { + $result = $this->FerienModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($ferien = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Geschaeftsjahr2.php b/application/controllers/api/v1/organisation/Geschaeftsjahr2.php new file mode 100644 index 000000000..61579e457 --- /dev/null +++ b/application/controllers/api/v1/organisation/Geschaeftsjahr2.php @@ -0,0 +1,78 @@ +load->model('organisation/geschaeftsjahr_model', 'GeschaeftsjahrModel'); + // Load set the uid of the model to let to check the permissions + $this->GeschaeftsjahrModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getGeschaeftsjahr() + { + $geschaeftsjahr_kurzbz = $this->get('geschaeftsjahr_kurzbz'); + + if (isset($geschaeftsjahr_kurzbz)) + { + $result = $this->GeschaeftsjahrModel->load($geschaeftsjahr_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postGeschaeftsjahr() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['geschaeftsjahr_id'])) + { + $result = $this->GeschaeftsjahrModel->update($this->post()['geschaeftsjahr_id'], $this->post()); + } + else + { + $result = $this->GeschaeftsjahrModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($geschaeftsjahr = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Gruppe.php b/application/controllers/api/v1/organisation/Gruppe.php new file mode 100644 index 000000000..7bf01666a --- /dev/null +++ b/application/controllers/api/v1/organisation/Gruppe.php @@ -0,0 +1,78 @@ +load->model('organisation/gruppe_model', 'GruppeModel'); + // Load set the uid of the model to let to check the permissions + $this->GruppeModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getGruppe() + { + $gruppe_kurzbz = $this->get('gruppe_kurzbz'); + + if (isset($gruppe_kurzbz)) + { + $result = $this->GruppeModel->load($gruppe_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postGruppe() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['gruppe_kurzbz'])) + { + $result = $this->GruppeModel->update($this->post()['gruppe_kurzbz'], $this->post()); + } + else + { + $result = $this->GruppeModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($gruppe = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Lehrverband.php b/application/controllers/api/v1/organisation/Lehrverband.php new file mode 100644 index 000000000..ce4e04893 --- /dev/null +++ b/application/controllers/api/v1/organisation/Lehrverband.php @@ -0,0 +1,88 @@ +load->model('organisation/lehrverband_model', 'LehrverbandModel'); + // Load set the uid of the model to let to check the permissions + $this->LehrverbandModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getLehrverband() + { + $gruppe = $this->get('gruppe'); + $verband = $this->get('verband'); + $semester = $this->get('semester'); + $studiengang_kz = $this->get('studiengang_kz'); + + if (isset($gruppe) && isset($verband) && isset($semester) && isset($studiengang_kz)) + { + $result = $this->LehrverbandModel->load(array($gruppe, $verband, $semester, $studiengang_kz)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postLehrverband() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['gruppe']) && isset($this->post()['verband']) && + isset($this->post()['semester']) && isset($this->post()['studiengang_kz'])) + { + $pksArray = array($this->post()['gruppe'], + $this->post()['verband'], + $this->post()['semester'], + $this->post()['studiengang_kz'] + ); + + $result = $this->LehrverbandModel->update($pksArray, $this->post()); + } + else + { + $result = $this->LehrverbandModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($lehrverband = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Organisationseinheit2.php b/application/controllers/api/v1/organisation/Organisationseinheit2.php new file mode 100644 index 000000000..87fa0b2a9 --- /dev/null +++ b/application/controllers/api/v1/organisation/Organisationseinheit2.php @@ -0,0 +1,78 @@ +load->model('organisation/organisationseinheit_model', 'OrganisationseinheitModel'); + // Load set the uid of the model to let to check the permissions + $this->OrganisationseinheitModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getOrganisationseinheit() + { + $oe_kurzbz = $this->get('oe_kurzbz'); + + if (isset($oe_kurzbz)) + { + $result = $this->OrganisationseinheitModel->load($oe_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postOrganisationseinheit() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['organisationseinheit_id'])) + { + $result = $this->OrganisationseinheitModel->update($this->post()['organisationseinheit_id'], $this->post()); + } + else + { + $result = $this->OrganisationseinheitModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($organisationseinheit = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Organisationseinheittyp.php b/application/controllers/api/v1/organisation/Organisationseinheittyp.php new file mode 100644 index 000000000..79765ed68 --- /dev/null +++ b/application/controllers/api/v1/organisation/Organisationseinheittyp.php @@ -0,0 +1,78 @@ +load->model('organisation/organisationseinheittyp_model', 'OrganisationseinheittypModel'); + // Load set the uid of the model to let to check the permissions + $this->OrganisationseinheittypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getOrganisationseinheittyp() + { + $organisationseinheittyp_kurzbz = $this->get('organisationseinheittyp_kurzbz'); + + if (isset($organisationseinheittyp_kurzbz)) + { + $result = $this->OrganisationseinheittypModel->load($organisationseinheittyp_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postOrganisationseinheittyp() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['organisationseinheittyp_kurzbz'])) + { + $result = $this->OrganisationseinheittypModel->update($this->post()['organisationseinheittyp_kurzbz'], $this->post()); + } + else + { + $result = $this->OrganisationseinheittypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($organisationseinheittyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Semesterwochen.php b/application/controllers/api/v1/organisation/Semesterwochen.php new file mode 100644 index 000000000..8ea889d25 --- /dev/null +++ b/application/controllers/api/v1/organisation/Semesterwochen.php @@ -0,0 +1,79 @@ +load->model('organisation/semesterwochen_model', 'SemesterwochenModel'); + // Load set the uid of the model to let to check the permissions + $this->SemesterwochenModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getSemesterwochen() + { + $studiengang_kz = $this->get('studiengang_kz'); + $semester = $this->get('semester'); + + if (isset($studiengang_kz) && isset($semester)) + { + $result = $this->SemesterwochenModel->load(array($studiengang_kz, $semester)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postSemesterwochen() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['studiengang_kz']) && isset($this->post()['semester'])) + { + $result = $this->SemesterwochenModel->update(array($this->post()['studiengang_kz'], $this->post()['semester']), $this->post()); + } + else + { + $result = $this->SemesterwochenModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($semesterwochen = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Service.php b/application/controllers/api/v1/organisation/Service.php new file mode 100644 index 000000000..0d04e4cb7 --- /dev/null +++ b/application/controllers/api/v1/organisation/Service.php @@ -0,0 +1,78 @@ +load->model('organisation/service_model', 'ServiceModel'); + // Load set the uid of the model to let to check the permissions + $this->ServiceModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getService() + { + $serviceID = $this->get('service_id'); + + if (isset($serviceID)) + { + $result = $this->ServiceModel->load($serviceID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postService() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['service_id'])) + { + $result = $this->ServiceModel->update($this->post()['service_id'], $this->post()); + } + else + { + $result = $this->ServiceModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($service = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Standort.php b/application/controllers/api/v1/organisation/Standort.php new file mode 100644 index 000000000..a377684b9 --- /dev/null +++ b/application/controllers/api/v1/organisation/Standort.php @@ -0,0 +1,78 @@ +load->model('organisation/standort_model', 'StandortModel'); + // Load set the uid of the model to let to check the permissions + $this->StandortModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStandort() + { + $standortID = $this->get('standort_id'); + + if (isset($standortID)) + { + $result = $this->StandortModel->load($standortID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStandort() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['standort_id'])) + { + $result = $this->StandortModel->update($this->post()['standort_id'], $this->post()); + } + else + { + $result = $this->StandortModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($standort = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Statistik.php b/application/controllers/api/v1/organisation/Statistik.php new file mode 100644 index 000000000..8d72fbadf --- /dev/null +++ b/application/controllers/api/v1/organisation/Statistik.php @@ -0,0 +1,78 @@ +load->model('organisation/statistik_model', 'StatistikModel'); + // Load set the uid of the model to let to check the permissions + $this->StatistikModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStatistik() + { + $statistik_kurzbz = $this->get('statistik_kurzbz'); + + if (isset($statistik_kurzbz)) + { + $result = $this->StatistikModel->load($statistik_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStatistik() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['statistik_kurzbz'])) + { + $result = $this->StatistikModel->update($this->post()['statistik_kurzbz'], $this->post()); + } + else + { + $result = $this->StatistikModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($statistik = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Studiengang2.php b/application/controllers/api/v1/organisation/Studiengang2.php new file mode 100644 index 000000000..4a19e3e96 --- /dev/null +++ b/application/controllers/api/v1/organisation/Studiengang2.php @@ -0,0 +1,50 @@ +load->model('organisation/studiengang_model', 'StudiengangModel'); + // Load set the uid of the model to let to check the permissions + $this->StudiengangModel->setUID($this->_getUID()); + } + + public function getStudiengang() + { + $studiengang_kz = $this->get('studiengang_kz'); + + if (isset($studiengang_kz)) + { + $result = $this->StudiengangModel->load($studiengang_kz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + public function getAllForBewerbung() + { + $this->response($this->StudiengangModel->getAllForBewerbung(), REST_Controller::HTTP_OK); + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Studiengangstyp.php b/application/controllers/api/v1/organisation/Studiengangstyp.php new file mode 100644 index 000000000..45459c366 --- /dev/null +++ b/application/controllers/api/v1/organisation/Studiengangstyp.php @@ -0,0 +1,78 @@ +load->model('organisation/studiengangstyp_model', 'StudiengangstypModel'); + // Load set the uid of the model to let to check the permissions + $this->StudiengangstypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStudiengangstyp() + { + $typ = $this->get('typ'); + + if (isset($typ)) + { + $result = $this->StudiengangstypModel->load($typ); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStudiengangstyp() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['typ'])) + { + $result = $this->StudiengangstypModel->update($this->post()['typ'], $this->post()); + } + else + { + $result = $this->StudiengangstypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($studiengangstyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Studienjahr.php b/application/controllers/api/v1/organisation/Studienjahr.php new file mode 100644 index 000000000..d66e26a05 --- /dev/null +++ b/application/controllers/api/v1/organisation/Studienjahr.php @@ -0,0 +1,78 @@ +load->model('organisation/studienjahr_model', 'StudienjahrModel'); + // Load set the uid of the model to let to check the permissions + $this->StudienjahrModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStudienjahr() + { + $studienjahr_kurzbz = $this->get('studienjahr_kurzbz'); + + if (isset($studienjahr_kurzbz)) + { + $result = $this->StudienjahrModel->load($studienjahr_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStudienjahr() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['studienjahr_kurzbz'])) + { + $result = $this->StudienjahrModel->update($this->post()['studienjahr_kurzbz'], $this->post()); + } + else + { + $result = $this->StudienjahrModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($studienjahr = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Studienordnung.php b/application/controllers/api/v1/organisation/Studienordnung.php new file mode 100644 index 000000000..10ea7248f --- /dev/null +++ b/application/controllers/api/v1/organisation/Studienordnung.php @@ -0,0 +1,78 @@ +load->model('organisation/studienordnung_model', 'StudienordnungModel'); + // Load set the uid of the model to let to check the permissions + $this->StudienordnungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStudienordnung() + { + $studienordnungID = $this->get('studienordnung_id'); + + if (isset($studienordnungID)) + { + $result = $this->StudienordnungModel->load($studienordnungID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStudienordnung() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['studienordnung_id'])) + { + $result = $this->StudienordnungModel->update($this->post()['studienordnung_id'], $this->post()); + } + else + { + $result = $this->StudienordnungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($studienordnung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Studienordnungstatus.php b/application/controllers/api/v1/organisation/Studienordnungstatus.php new file mode 100644 index 000000000..02ee9b8bb --- /dev/null +++ b/application/controllers/api/v1/organisation/Studienordnungstatus.php @@ -0,0 +1,78 @@ +load->model('organisation/studienordnungstatus_model', 'StudienordnungstatusModel'); + // Load set the uid of the model to let to check the permissions + $this->StudienordnungstatusModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStudienordnungstatus() + { + $status_kurzbz = $this->get('status_kurzbz'); + + if (isset($status_kurzbz)) + { + $result = $this->StudienordnungstatusModel->load($status_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStudienordnungstatus() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['status_kurzbz'])) + { + $result = $this->StudienordnungstatusModel->update($this->post()['status_kurzbz'], $this->post()); + } + else + { + $result = $this->StudienordnungstatusModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($studienordnungstatus = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Studienplan.php b/application/controllers/api/v1/organisation/Studienplan.php index b4b2ffd8a..9f7913bba 100644 --- a/application/controllers/api/v1/organisation/Studienplan.php +++ b/application/controllers/api/v1/organisation/Studienplan.php @@ -12,7 +12,7 @@ */ // ------------------------------------------------------------------------ -if(!defined('BASEPATH')) exit('No direct script access allowed'); +if (!defined('BASEPATH')) exit('No direct script access allowed'); class Studienplan extends APIv1_Controller { @@ -32,10 +32,10 @@ class Studienplan extends APIv1_Controller { $studiengang_kz = $this->get('studiengang_kz'); - if(isset($studiengang_kz)) + if (isset($studiengang_kz)) { $result = $this->StudienplanModel->addJoin('lehre.tbl_studienordnung', 'studienordnung_id'); - if($result->error == EXIT_SUCCESS) + if ($result->error == EXIT_SUCCESS) { $result = $this->StudienplanModel->loadWhere(array('studiengang_kz' => $this->get('studiengang_kz'))); } diff --git a/application/controllers/api/v1/organisation/Studienplatz.php b/application/controllers/api/v1/organisation/Studienplatz.php new file mode 100644 index 000000000..00e55a35b --- /dev/null +++ b/application/controllers/api/v1/organisation/Studienplatz.php @@ -0,0 +1,78 @@ +load->model('organisation/studienplatz_model', 'StudienplatzModel'); + // Load set the uid of the model to let to check the permissions + $this->StudienplatzModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStudienplatz() + { + $studienplatzID = $this->get('studienplatz_id'); + + if (isset($studienplatzID)) + { + $result = $this->StudienplatzModel->load($studienplatzID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStudienplatz() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['studienplatz_id'])) + { + $result = $this->StudienplatzModel->update($this->post()['studienplatz_id'], $this->post()); + } + else + { + $result = $this->StudienplatzModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($studienplatz = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/organisation/Studiensemester.php b/application/controllers/api/v1/organisation/Studiensemester.php new file mode 100644 index 000000000..5b3228b92 --- /dev/null +++ b/application/controllers/api/v1/organisation/Studiensemester.php @@ -0,0 +1,78 @@ +load->model('organisation/studiensemester_model', 'StudiensemesterModel'); + // Load set the uid of the model to let to check the permissions + $this->StudiensemesterModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStudiensemester() + { + $studiensemester_kurzbz = $this->get('studiensemester_kurzbz'); + + if (isset($studiensemester_kurzbz)) + { + $result = $this->StudiensemesterModel->load($studiensemester_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStudiensemester() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['studiensemester_kurzbz'])) + { + $result = $this->StudiensemesterModel->update($this->post()['studiensemester_kurzbz'], $this->post()); + } + else + { + $result = $this->StudiensemesterModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($studiensemester = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/person/Adresse.php b/application/controllers/api/v1/person/Adresse.php new file mode 100644 index 000000000..6a0038865 --- /dev/null +++ b/application/controllers/api/v1/person/Adresse.php @@ -0,0 +1,70 @@ +load->model('person/adresse_model', 'AdresseModel'); + // Load set the uid of the model to let to check the permissions + $this->AdresseModel->setUID($this->_getUID()); + } + + public function getAdresse() + { + $personID = $this->get("person_id"); + + if (isset($personID)) + { + $result = $this->AdresseModel->loadWhere(array('person_id' => $personID)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + public function postAdresse() + { + $post = $this->post(); + + if (is_array($post)) + { + if (isset($post['adresse_id'])) + { + $result = $this->AdresseModel->update($post['adresse_id'], $post); + } + else + { + $result = $this->AdresseModel->insert($post); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/person/Bankverbindung.php b/application/controllers/api/v1/person/Bankverbindung.php new file mode 100644 index 000000000..0355c3849 --- /dev/null +++ b/application/controllers/api/v1/person/Bankverbindung.php @@ -0,0 +1,78 @@ +load->model('person/bankverbindung_model', 'BankverbindungModel'); + // Load set the uid of the model to let to check the permissions + $this->BankverbindungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBankverbindung() + { + $bankverbindungID = $this->get('bankverbindung_id'); + + if (isset($bankverbindungID)) + { + $result = $this->BankverbindungModel->load($bankverbindungID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBankverbindung() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['bankverbindung_id'])) + { + $result = $this->BankverbindungModel->update($this->post()['bankverbindung_id'], $this->post()); + } + else + { + $result = $this->BankverbindungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($bankverbindung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/person/Benutzer.php b/application/controllers/api/v1/person/Benutzer.php new file mode 100644 index 000000000..35e31b66c --- /dev/null +++ b/application/controllers/api/v1/person/Benutzer.php @@ -0,0 +1,78 @@ +load->model('person/benutzer_model', 'BenutzerModel'); + // Load set the uid of the model to let to check the permissions + $this->BenutzerModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBenutzer() + { + $uid = $this->get('uid'); + + if (isset($uid)) + { + $result = $this->BenutzerModel->load($uid); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBenutzer() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['uid'])) + { + $result = $this->BenutzerModel->update($this->post()['uid'], $this->post()); + } + else + { + $result = $this->BenutzerModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($benutzer = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/person/Benutzerfunktion.php b/application/controllers/api/v1/person/Benutzerfunktion.php new file mode 100644 index 000000000..0bc764d56 --- /dev/null +++ b/application/controllers/api/v1/person/Benutzerfunktion.php @@ -0,0 +1,78 @@ +load->model('person/benutzerfunktion_model', 'BenutzerfunktionModel'); + // Load set the uid of the model to let to check the permissions + $this->BenutzerfunktionModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBenutzerfunktion() + { + $benutzerfunktionID = $this->get('benutzerfunktion_id'); + + if (isset($benutzerfunktionID)) + { + $result = $this->BenutzerfunktionModel->load($benutzerfunktionID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBenutzerfunktion() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['benutzerfunktion_id'])) + { + $result = $this->BenutzerfunktionModel->update($this->post()['benutzerfunktion_id'], $this->post()); + } + else + { + $result = $this->BenutzerfunktionModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($benutzerfunktion = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/person/Benutzergruppe.php b/application/controllers/api/v1/person/Benutzergruppe.php new file mode 100644 index 000000000..3b499283a --- /dev/null +++ b/application/controllers/api/v1/person/Benutzergruppe.php @@ -0,0 +1,79 @@ +load->model('person/benutzergruppe_model', 'BenutzergruppeModel'); + // Load set the uid of the model to let to check the permissions + $this->BenutzergruppeModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBenutzergruppe() + { + $gruppe_kurzbz = $this->get('gruppe_kurzbz'); + $uid = $this->get('uid'); + + if (isset($gruppe_kurzbz) && isset($uid)) + { + $result = $this->BenutzergruppeModel->load(array($gruppe_kurzbz, $uid)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBenutzergruppe() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['benutzergruppe_id'])) + { + $result = $this->BenutzergruppeModel->update($this->post()['benutzergruppe_id'], $this->post()); + } + else + { + $result = $this->BenutzergruppeModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($benutzergruppe = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/person/Fotostatus.php b/application/controllers/api/v1/person/Fotostatus.php new file mode 100644 index 000000000..fa3d9c8ae --- /dev/null +++ b/application/controllers/api/v1/person/Fotostatus.php @@ -0,0 +1,78 @@ +load->model('person/fotostatus_model', 'FotostatusModel'); + // Load set the uid of the model to let to check the permissions + $this->FotostatusModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getFotostatus() + { + $fotostatus_kurzbz = $this->get('fotostatus_kurzbz'); + + if (isset($fotostatus_kurzbz)) + { + $result = $this->FotostatusModel->load($fotostatus_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postFotostatus() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['fotostatus_kurzbz'])) + { + $result = $this->FotostatusModel->update($this->post()['fotostatus_kurzbz'], $this->post()); + } + else + { + $result = $this->FotostatusModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($fotostatus = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/person/Freebusy.php b/application/controllers/api/v1/person/Freebusy.php new file mode 100644 index 000000000..fb587e2dd --- /dev/null +++ b/application/controllers/api/v1/person/Freebusy.php @@ -0,0 +1,78 @@ +load->model('person/freebusy_model', 'FreebusyModel'); + // Load set the uid of the model to let to check the permissions + $this->FreebusyModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getFreebusy() + { + $freebusyID = $this->get('freebusy_id'); + + if (isset($freebusyID)) + { + $result = $this->FreebusyModel->load($freebusyID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postFreebusy() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['freebusy_id'])) + { + $result = $this->FreebusyModel->update($this->post()['freebusy_id'], $this->post()); + } + else + { + $result = $this->FreebusyModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($freebusy = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/person/Freebusytyp.php b/application/controllers/api/v1/person/Freebusytyp.php new file mode 100644 index 000000000..c9ceb47ce --- /dev/null +++ b/application/controllers/api/v1/person/Freebusytyp.php @@ -0,0 +1,78 @@ +load->model('person/freebusytyp_model', 'FreebusytypModel'); + // Load set the uid of the model to let to check the permissions + $this->FreebusytypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getFreebusytyp() + { + $freebusytyp_kurzbz = $this->get('freebusytyp_kurzbz'); + + if (isset($freebusytyp_kurzbz)) + { + $result = $this->FreebusytypModel->load($freebusytyp_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postFreebusytyp() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['freebusytyp_kurzbz'])) + { + $result = $this->FreebusytypModel->update($this->post()['freebusytyp_kurzbz'], $this->post()); + } + else + { + $result = $this->FreebusytypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($freebusytyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/person/Kontakt.php b/application/controllers/api/v1/person/Kontakt.php new file mode 100644 index 000000000..00015ff78 --- /dev/null +++ b/application/controllers/api/v1/person/Kontakt.php @@ -0,0 +1,70 @@ +load->model('person/kontakt_model', 'KontaktModel'); + // Load set the uid of the model to let to check the permissions + $this->KontaktModel->setUID($this->_getUID()); + } + + public function getKontakt() + { + $personID = $this->get("person_id"); + + if (isset($personID)) + { + $result = $this->KontaktModel->loadWhere(array('person_id' => $personID)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + public function postKontakt() + { + $post = $this->_parseData($this->post()); + + if (is_array($post)) + { + if (isset($post['kontakt_id'])) + { + $result = $this->KontaktModel->update($post['kontakt_id'], $post); + } + else + { + $result = $this->KontaktModel->insert($post); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/person/Kontaktmedium.php b/application/controllers/api/v1/person/Kontaktmedium.php new file mode 100644 index 000000000..483ad7e2d --- /dev/null +++ b/application/controllers/api/v1/person/Kontaktmedium.php @@ -0,0 +1,78 @@ +load->model('person/kontaktmedium_model', 'KontaktmediumModel'); + // Load set the uid of the model to let to check the permissions + $this->KontaktmediumModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getKontaktmedium() + { + $kontaktmedium_kurzbz = $this->get('kontaktmedium_kurzbz'); + + if (isset($kontaktmedium_kurzbz)) + { + $result = $this->KontaktmediumModel->load($kontaktmedium_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postKontaktmedium() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['kontaktmedium_kurzbz'])) + { + $result = $this->KontaktmediumModel->update($this->post()['kontaktmedium_kurzbz'], $this->post()); + } + else + { + $result = $this->KontaktmediumModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($kontaktmedium = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/person/Kontakttyp.php b/application/controllers/api/v1/person/Kontakttyp.php new file mode 100644 index 000000000..ef6edd8ea --- /dev/null +++ b/application/controllers/api/v1/person/Kontakttyp.php @@ -0,0 +1,78 @@ +load->model('person/kontakttyp_model', 'KontakttypModel'); + // Load set the uid of the model to let to check the permissions + $this->KontakttypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getKontakttyp() + { + $kontakttyp = $this->get('kontakttyp'); + + if (isset($kontakttyp)) + { + $result = $this->KontakttypModel->load($kontakttyp); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postKontakttyp() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['kontakttyp'])) + { + $result = $this->KontakttypModel->update($this->post()['kontakttyp'], $this->post()); + } + else + { + $result = $this->KontakttypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($kontakttyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/person/Notiz.php b/application/controllers/api/v1/person/Notiz.php new file mode 100644 index 000000000..537d13979 --- /dev/null +++ b/application/controllers/api/v1/person/Notiz.php @@ -0,0 +1,78 @@ +load->model('person/notiz_model', 'NotizModel'); + // Load set the uid of the model to let to check the permissions + $this->NotizModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getNotiz() + { + $notizID = $this->get('notiz_id'); + + if (isset($notizID)) + { + $result = $this->NotizModel->load($notizID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postNotiz() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['notiz_id'])) + { + $result = $this->NotizModel->update($this->post()['notiz_id'], $this->post()); + } + else + { + $result = $this->NotizModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($notiz = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/person/Notizzuordnung.php b/application/controllers/api/v1/person/Notizzuordnung.php new file mode 100644 index 000000000..05494b50e --- /dev/null +++ b/application/controllers/api/v1/person/Notizzuordnung.php @@ -0,0 +1,78 @@ +load->model('person/notizzuordnung_model', 'NotizzuordnungModel'); + // Load set the uid of the model to let to check the permissions + $this->NotizzuordnungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getNotizzuordnung() + { + $notizzuordnungID = $this->get('notizzuordnung_id'); + + if (isset($notizzuordnungID)) + { + $result = $this->NotizzuordnungModel->load($notizzuordnungID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postNotizzuordnung() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['notizzuordnung_id'])) + { + $result = $this->NotizzuordnungModel->update($this->post()['notizzuordnung_id'], $this->post()); + } + else + { + $result = $this->NotizzuordnungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($notizzuordnung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/person/Person.php b/application/controllers/api/v1/person/Person.php index ea708f8e5..71edf5ef3 100644 --- a/application/controllers/api/v1/person/Person.php +++ b/application/controllers/api/v1/person/Person.php @@ -1,353 +1,336 @@ -load->model('person/person_model', 'PersonModel'); - // Load set the uid of the model to let to check the permissions - $this->PersonModel->setUID($this->_getUID()); - } - - /** - * @return void - */ - public function getPerson() - { - $personID = $this->get('person_id'); - $code = $this->get('code'); - $email = $this->get('email'); - - if(isset($code) || isset($email) || isset($personID)) - { - if(isset($code) && isset($email)) - { - $result = $this->PersonModel->addJoin('public.tbl_kontakt', 'person_id'); - if($result->error == EXIT_SUCCESS) - { - $result = $this->PersonModel->loadWhere(array('zugangscode' => $code, 'kontakt' => $email)); - } - } - elseif(isset($code)) - { - $result = $this->PersonModel->loadWhere(array('zugangscode' => $code)); - } - else - { - $result = $this->PersonModel->load($personID); - } - - $this->response($result, REST_Controller::HTTP_OK); - } - else - { - $this->response(); - } - } - - /** - * @return void - */ - public function postPerson() - { - if($this->_validate($this->post())) - { - if(isset($this->post()['person_id'])) - { - $result = $this->PersonModel->update($this->post()['person_id'], $this->post()); - } - else - { - $result = $this->PersonModel->insert($this->post()); - } - - $this->response($result, REST_Controller::HTTP_OK); - } - else - { - $this->response(); - } - } - - /** - * @return void - */ - public function getCheckBewerbung() - { - $result = $this->PersonModel->checkBewerbung($this->get("email"), $this->get("studiensemester_kurzbz")); - $httpstatus = REST_Controller::HTTP_OK; - $payload = [ - 'success' => true, - 'message' => 'Bewerbung exists.' - ]; - $payload['data'] = $result; - $this->response($payload, $httpstatus); - } - - /** - * @return void - */ - public function getCheckZugangscodePerson() - { - $result = $this->PersonModel->checkZugangscodePerson($this->get("code")); - $httpstatus = REST_Controller::HTTP_OK; - if(!empty($result)) - { - $payload = [ - 'success' => true, - 'message' => 'Zugangscode exists.' - ]; - $payload['data'] = $result; - } - else - { - $payload = [ - 'success' => false, - 'message' => 'Zugangscode does not exist.' - ]; - $httpstatus = REST_Controller::HTTP_OK; - } - - $this->response($payload, $httpstatus); - } - - private function _validate($person = NULL) - { - if(!isset($person)) - { - return false; - } - - $person['nachname'] = trim($person['nachname']); - $person['vorname'] = trim($person['vorname']); - $person['vornamen'] = trim($person['vornamen']); - $person['anrede'] = trim($person['anrede']); - $person['titelpost'] = trim($person['titelpost']); - $person['titelpre'] = trim($person['titelpre']); - - if(mb_strlen($person['sprache']) > 16) - { - //$this->errormsg = 'Sprache darf nicht laenger als 16 Zeichen sein'; - return false; - } - if(mb_strlen($person['anrede']) > 16) - { - //$this->errormsg = 'Anrede darf nicht laenger als 16 Zeichen sein'; - return false; - } - if(mb_strlen($person['titelpost']) > 32) - { - //$this->errormsg = 'Titelpost darf nicht laenger als 32 Zeichen sein'; - return false; - } - if(mb_strlen($person['titelpre']) > 64) - { - //$this->errormsg = 'Titelpre darf nicht laenger als 64 Zeichen sein'; - return false; - } - if(mb_strlen($person['nachname']) > 64) - { - //$this->errormsg = 'Nachname darf nicht laenger als 64 Zeichen sein'; - return false; - } - if($person['nachname'] == '' || is_null($person['nachname'])) - { - //$this->errormsg = 'Nachname muss eingegeben werden'; - return false; - } - - if(mb_strlen($person['vorname']) > 32) - { - //$this->errormsg = 'Vorname darf nicht laenger als 32 Zeichen sein'; - return false; - } - if(mb_strlen($person['vornamen']) > 128) - { - //$this->errormsg = 'Vornamen darf nicht laenger als 128 Zeichen sein'; - return false; - } - //ToDo Gebdatum pruefen -> laut bis muss student aelter als 10 Jahre sein - /* if (strlen($person['gebdatum) == 0 || is_null($person['gebdatum)) - { - //$this->errormsg = "Geburtsdatum muss eingegeben werden\n"; - return false; - } */ - if(mb_strlen($person['gebort']) > 128) - { - //$this->errormsg = 'Geburtsort darf nicht laenger als 128 Zeichen sein'; - return false; - } - - if(mb_strlen($person['homepage']) > 256) - { - //$this->errormsg = 'Homepage darf nicht laenger als 256 Zeichen sein'; - return false; - } - if(mb_strlen($person['svnr']) > 16) - { - //$this->errormsg = 'SVNR darf nicht laenger als 16 Zeichen sein'; - return false; - } - - if(mb_strlen($person['matr_nr']) > 32) - { - //$this->errormsg = 'Matrikelnummer darf nicht laenger als 32 Zeichen sein'; - return false; - } - - if($person['svnr'] != '' && mb_strlen($person['svnr']) != 16 && mb_strlen($person['svnr']) != 10) - { - //$this->errormsg = 'SVNR muss 10 oder 16 Zeichen lang sein'; - return false; - } - - if($person['svnr'] != '' && mb_strlen($person['svnr']) == 10) - { - //SVNR mit Pruefziffer pruefen - //Die 4. Stelle in der SVNR ist die Pruefziffer - //(Summe von (gewichtung[i]*svnr[i])) modulo 11 ergibt diese Pruefziffer - //Falls nicht, ist die SVNR ungueltig - $gewichtung = array(3, 7, 9, 0, 5, 8, 4, 2, 1, 6); - $erg = 0; - //Quersumme bilden - for($i = 0; $i < 10; $i++) - { - $erg += $gewichtung[$i] * $person['svnr']{$i}; - } - - if($person['svnr']{3} != ($erg % 11)) //Vergleichen der Pruefziffer mit Quersumme Modulo 11 - { - //$this->errormsg = 'SVNR ist ungueltig'; - return false; - } - } - - if($person['svnr'] != '') - { - //Pruefen ob bereits ein Eintrag mit dieser SVNR vorhanden ist - $qry = "SELECT person_id FROM public.tbl_person WHERE svnr=" . $person['svnr']; - if(db_query($qry)) - { - if($row = db_fetch_object()) - { - if($row->person_id != $person['person_id']) - { - //$this->errormsg = 'Es existiert bereits eine Person mit dieser SVNR! Daten wurden NICHT gepeichert.'; - return false; - } - } - } - } - - if(mb_strlen($person['ersatzkennzeichen']) > 10) - { - //$this->errormsg = 'Ersatzkennzeichen darf nicht laenger als 10 Zeichen sein'; - return false; - } - if(mb_strlen($person['familienstand']) > 1) - { - //$this->errormsg = 'Familienstand ist ungueltig'; - return false; - } - if($person['anzahlkinder'] != '' && !is_numeric($person['anzahlkinder'])) - { - //$this->errormsg = 'Anzahl der Kinder ist ungueltig'; - return false; - } - if($person['aktiv'] != "t" && $person['aktiv'] != "f") - { - //$this->errormsg = 'Aktiv ist ungueltig'; - return false; - } - if(!isset($person['person_id']) && mb_strlen($person['insertvon']) > 32) - { - //$this->errormsg = 'Insertvon darf nicht laenger als 32 Zeichen sein'; - return false; - } - if(mb_strlen($person['updatevon']) > 32) - { - //$this->errormsg = 'Updatevon darf nicht laenger als 32 Zeichen sein'; - return false; - } - /*if($person['ext_id'] != '' && !is_numeric($person['ext_id'])) - { - //$this->errormsg = 'Ext_ID ist keine gueltige Zahl'; - return false; - }*/ - if(mb_strlen($person['geschlecht']) > 1) - { - //$this->errormsg = 'Geschlecht darf nicht laenger als 1 Zeichen sein'; - return false; - } - if(mb_strlen($person['geburtsnation']) > 3) - { - //$this->errormsg = 'Geburtsnation darf nicht laenger als 3 Zeichen sein'; - return false; - } - if(mb_strlen($person['staatsbuergerschaft']) > 3) - { - //$this->errormsg = 'Staatsbuergerschaft darf nicht laenger als 3 Zeichen sein'; - return false; - } - if($person['geschlecht'] != 'm' && $person['geschlecht'] != 'w' && $person['geschlecht'] != 'u') - { - //$this->errormsg = 'Geschlecht muss w, m oder u sein!'; - return false; - } - - //Pruefen ob das Geburtsdatum mit der SVNR uebereinstimmt. - if($person['svnr'] != '' && $person['gebdatum'] != '') - { - if(mb_ereg("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4})", $person['gebdatum'], $regs)) - { - //$day = sprintf('%02s',$regs[1]); - //$month = sprintf('%02s',$regs[2]); - //$year = mb_substr($regs[3],2,2); - } - elseif(mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})", $person['gebdatum'], $regs)) - { - //$day = sprintf('%02s',$regs[3]); - //$month = sprintf('%02s',$regs[2]); - //$year = mb_substr($regs[1],2,2); - } - else - { - //$this->errormsg = 'Format des Geburtsdatums ist ungueltig'; - return false; - } - - /* das muss nicht immer so sein - $day_svnr = mb_substr($person['svnr, 4, 2); - $month_svnr = mb_substr($person['svnr, 6, 2); - $year_svnr = mb_substr($person['svnr, 8, 2); - - if ($day_svnr!=$day || $month_svnr!=$month || $year_svnr!=$year) - { - //$this->errormsg = 'SVNR und Geburtsdatum passen nicht zusammen'; - return false; - } - */ - } - - return true; - } -} \ No newline at end of file +load->model('person/person_model', 'PersonModel'); + // Load set the uid of the model to let to check the permissions + $this->PersonModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getPerson() + { + $personID = $this->get('person_id'); + $code = $this->get('code'); + $email = $this->get('email'); + + if (isset($code) || isset($email) || isset($personID)) + { + if (isset($code) && isset($email)) + { + $result = $this->PersonModel->addJoin('public.tbl_kontakt', 'person_id'); + if ($result->error == EXIT_SUCCESS) + { + $result = $this->PersonModel->loadWhere(array('zugangscode' => $code, 'kontakt' => $email)); + } + } + elseif (isset($code)) + { + $result = $this->PersonModel->loadWhere(array('zugangscode' => $code)); + } + else + { + $result = $this->PersonModel->load($personID); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postPerson() + { + $person = $this->_parseData($this->post()); + + if($this->_validate($this->post())) + { + if(isset($person['person_id']) && !(is_null($person["person_id"])) && ($person["person_id"] != "")) + { + $result = $this->PersonModel->update($person['person_id'], $person); + } + else + { + $result = $this->PersonModel->insert($person); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function getCheckBewerbung() + { + $email = $this->get('email'); + $studiensemester_kurzbz = $this->get('studiensemester_kurzbz'); + + if (isset($email)) + { + $result = $this->PersonModel->checkBewerbung($email, $studiensemester_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($person = NULL) + { + if (!isset($person)) + { + return false; + } + + //TODO + return true; + + $person['nachname'] = trim($person['nachname']); + $person['vorname'] = trim($person['vorname']); + $person['vornamen'] = trim($person['vornamen']); + $person['anrede'] = trim($person['anrede']); + $person['titelpost'] = trim($person['titelpost']); + $person['titelpre'] = trim($person['titelpre']); + + if (mb_strlen($person['sprache']) > 16) + { + //$this->errormsg = 'Sprache darf nicht laenger als 16 Zeichen sein'; + return false; + } + if (mb_strlen($person['anrede']) > 16) + { + //$this->errormsg = 'Anrede darf nicht laenger als 16 Zeichen sein'; + return false; + } + if (mb_strlen($person['titelpost']) > 32) + { + //$this->errormsg = 'Titelpost darf nicht laenger als 32 Zeichen sein'; + return false; + } + if (mb_strlen($person['titelpre']) > 64) + { + //$this->errormsg = 'Titelpre darf nicht laenger als 64 Zeichen sein'; + return false; + } + if (mb_strlen($person['nachname']) > 64) + { + //$this->errormsg = 'Nachname darf nicht laenger als 64 Zeichen sein'; + return false; + } + if ($person['nachname'] == '' || is_null($person['nachname'])) + { + //$this->errormsg = 'Nachname muss eingegeben werden'; + return false; + } + + if (mb_strlen($person['vorname']) > 32) + { + //$this->errormsg = 'Vorname darf nicht laenger als 32 Zeichen sein'; + return false; + } + if (mb_strlen($person['vornamen']) > 128) + { + //$this->errormsg = 'Vornamen darf nicht laenger als 128 Zeichen sein'; + return false; + } + //ToDo Gebdatum pruefen -> laut bis muss student aelter als 10 Jahre sein + /* if (strlen($person['gebdatum) == 0 || is_null($person['gebdatum)) + { + //$this->errormsg = "Geburtsdatum muss eingegeben werden\n"; + return false; + } */ + if (mb_strlen($person['gebort']) > 128) + { + //$this->errormsg = 'Geburtsort darf nicht laenger als 128 Zeichen sein'; + return false; + } + + if (mb_strlen($person['homepage']) > 256) + { + //$this->errormsg = 'Homepage darf nicht laenger als 256 Zeichen sein'; + return false; + } + if (mb_strlen($person['svnr']) > 16) + { + //$this->errormsg = 'SVNR darf nicht laenger als 16 Zeichen sein'; + return false; + } + + if (mb_strlen($person['matr_nr']) > 32) + { + //$this->errormsg = 'Matrikelnummer darf nicht laenger als 32 Zeichen sein'; + return false; + } + + if ($person['svnr'] != '' && mb_strlen($person['svnr']) != 16 && mb_strlen($person['svnr']) != 10) + { + //$this->errormsg = 'SVNR muss 10 oder 16 Zeichen lang sein'; + return false; + } + + if ($person['svnr'] != '' && mb_strlen($person['svnr']) == 10) + { + //SVNR mit Pruefziffer pruefen + //Die 4. Stelle in der SVNR ist die Pruefziffer + //(Summe von (gewichtung[i]*svnr[i])) modulo 11 ergibt diese Pruefziffer + //Falls nicht, ist die SVNR ungueltig + $gewichtung = array(3, 7, 9, 0, 5, 8, 4, 2, 1, 6); + $erg = 0; + //Quersumme bilden + for ($i = 0; $i < 10; $i++) + { + $erg += $gewichtung[$i] * $person['svnr']{$i}; + } + + if ($person['svnr']{3} != ($erg % 11)) //Vergleichen der Pruefziffer mit Quersumme Modulo 11 + { + //$this->errormsg = 'SVNR ist ungueltig'; + return false; + } + } + + if ($person['svnr'] != '') + { + //Pruefen ob bereits ein Eintrag mit dieser SVNR vorhanden ist + $qry = "SELECT person_id FROM public.tbl_person WHERE svnr=" . $person['svnr']; + if (db_query($qry)) + { + if ($row = db_fetch_object()) + { + if ($row->person_id != $person['person_id']) + { + //$this->errormsg = 'Es existiert bereits eine Person mit dieser SVNR! Daten wurden NICHT gepeichert.'; + return false; + } + } + } + } + + if (mb_strlen($person['ersatzkennzeichen']) > 10) + { + //$this->errormsg = 'Ersatzkennzeichen darf nicht laenger als 10 Zeichen sein'; + return false; + } + if (mb_strlen($person['familienstand']) > 1) + { + //$this->errormsg = 'Familienstand ist ungueltig'; + return false; + } + if ($person['anzahlkinder'] != '' && !is_numeric($person['anzahlkinder'])) + { + //$this->errormsg = 'Anzahl der Kinder ist ungueltig'; + return false; + } + if ($person['aktiv'] != "t" && $person['aktiv'] != "f") + { + //$this->errormsg = 'Aktiv ist ungueltig'; + return false; + } + if (!isset($person['person_id']) && mb_strlen($person['insertvon']) > 32) + { + //$this->errormsg = 'Insertvon darf nicht laenger als 32 Zeichen sein'; + return false; + } + if (mb_strlen($person['updatevon']) > 32) + { + //$this->errormsg = 'Updatevon darf nicht laenger als 32 Zeichen sein'; + return false; + } + /*if ($person['ext_id'] != '' && !is_numeric($person['ext_id'])) + { + //$this->errormsg = 'Ext_ID ist keine gueltige Zahl'; + return false; + }*/ + if (mb_strlen($person['geschlecht']) > 1) + { + //$this->errormsg = 'Geschlecht darf nicht laenger als 1 Zeichen sein'; + return false; + } + if (mb_strlen($person['geburtsnation']) > 3) + { + //$this->errormsg = 'Geburtsnation darf nicht laenger als 3 Zeichen sein'; + return false; + } + if (mb_strlen($person['staatsbuergerschaft']) > 3) + { + //$this->errormsg = 'Staatsbuergerschaft darf nicht laenger als 3 Zeichen sein'; + return false; + } + if ($person['geschlecht'] != 'm' && $person['geschlecht'] != 'w' && $person['geschlecht'] != 'u') + { + //$this->errormsg = 'Geschlecht muss w, m oder u sein!'; + return false; + } + + //Pruefen ob das Geburtsdatum mit der SVNR uebereinstimmt. + if ($person['svnr'] != '' && $person['gebdatum'] != '') + { + if (mb_ereg("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4})", $person['gebdatum'], $regs)) + { + //$day = sprintf('%02s',$regs[1]); + //$month = sprintf('%02s',$regs[2]); + //$year = mb_substr($regs[3],2,2); + } + elseif (mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})", $person['gebdatum'], $regs)) + { + //$day = sprintf('%02s',$regs[3]); + //$month = sprintf('%02s',$regs[2]); + //$year = mb_substr($regs[1],2,2); + } + else + { + //$this->errormsg = 'Format des Geburtsdatums ist ungueltig'; + return false; + } + + /* das muss nicht immer so sein + $day_svnr = mb_substr($person['svnr, 4, 2); + $month_svnr = mb_substr($person['svnr, 6, 2); + $year_svnr = mb_substr($person['svnr, 8, 2); + + if ($day_svnr!=$day || $month_svnr!=$month || $year_svnr!=$year) + { + //$this->errormsg = 'SVNR und Geburtsdatum passen nicht zusammen'; + return false; + } + */ + } + + return true; + } +} diff --git a/application/controllers/api/v1/project/Aktivitaet.php b/application/controllers/api/v1/project/Aktivitaet.php new file mode 100644 index 000000000..685c2c212 --- /dev/null +++ b/application/controllers/api/v1/project/Aktivitaet.php @@ -0,0 +1,78 @@ +load->model('project/aktivitaet_model', 'AktivitaetModel'); + // Load set the uid of the model to let to check the permissions + $this->AktivitaetModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAktivitaet() + { + $aktivitaet_kurzbz = $this->get('aktivitaet_kurzbz'); + + if (isset($aktivitaet_kurzbz)) + { + $result = $this->AktivitaetModel->load($aktivitaet_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAktivitaet() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['aktivitaet_kurzbz'])) + { + $result = $this->AktivitaetModel->update($this->post()['aktivitaet_kurzbz'], $this->post()); + } + else + { + $result = $this->AktivitaetModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($aktivitaet = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/project/Aufwandstyp.php b/application/controllers/api/v1/project/Aufwandstyp.php new file mode 100644 index 000000000..02cb6d5ba --- /dev/null +++ b/application/controllers/api/v1/project/Aufwandstyp.php @@ -0,0 +1,78 @@ +load->model('project/aufwandstyp_model', 'AufwandstypModel'); + // Load set the uid of the model to let to check the permissions + $this->AufwandstypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAufwandstyp() + { + $aufwandstyp_kurzbz = $this->get('aufwandstyp_kurzbz'); + + if (isset($aufwandstyp_kurzbz)) + { + $result = $this->AufwandstypModel->load($aufwandstyp_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAufwandstyp() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['aufwandstyp_kurzbz'])) + { + $result = $this->AufwandstypModel->update($this->post()['aufwandstyp_kurzbz'], $this->post()); + } + else + { + $result = $this->AufwandstypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($aufwandstyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/project/Projekt.php b/application/controllers/api/v1/project/Projekt.php new file mode 100644 index 000000000..244b170d0 --- /dev/null +++ b/application/controllers/api/v1/project/Projekt.php @@ -0,0 +1,78 @@ +load->model('project/projekt_model', 'ProjektModel'); + // Load set the uid of the model to let to check the permissions + $this->ProjektModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getProjekt() + { + $projekt_kurzbz = $this->get('projekt_kurzbz'); + + if (isset($projekt_kurzbz)) + { + $result = $this->ProjektModel->load($projekt_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postProjekt() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['projekt_kurzbz'])) + { + $result = $this->ProjektModel->update($this->post()['projekt_kurzbz'], $this->post()); + } + else + { + $result = $this->ProjektModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($projekt = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/project/Projekt_ressource.php b/application/controllers/api/v1/project/Projekt_ressource.php new file mode 100644 index 000000000..688546dfe --- /dev/null +++ b/application/controllers/api/v1/project/Projekt_ressource.php @@ -0,0 +1,78 @@ +load->model('project/projekt_ressource_model', 'Projekt_ressourceModel'); + // Load set the uid of the model to let to check the permissions + $this->Projekt_ressourceModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getProjekt_ressource() + { + $projekt_ressourceID = $this->get('projekt_ressource_id'); + + if (isset($projekt_ressourceID)) + { + $result = $this->Projekt_ressourceModel->load($projekt_ressourceID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postProjekt_ressource() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['projekt_ressource_id'])) + { + $result = $this->Projekt_ressourceModel->update($this->post()['projekt_ressource_id'], $this->post()); + } + else + { + $result = $this->Projekt_ressourceModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($projekt_ressource = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/project/Projektphase.php b/application/controllers/api/v1/project/Projektphase.php new file mode 100644 index 000000000..04007e0d4 --- /dev/null +++ b/application/controllers/api/v1/project/Projektphase.php @@ -0,0 +1,78 @@ +load->model('project/projektphase_model', 'ProjektphaseModel'); + // Load set the uid of the model to let to check the permissions + $this->ProjektphaseModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getProjektphase() + { + $projektphaseID = $this->get('projektphase_id'); + + if (isset($projektphaseID)) + { + $result = $this->ProjektphaseModel->load($projektphaseID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postProjektphase() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['projektphase_id'])) + { + $result = $this->ProjektphaseModel->update($this->post()['projektphase_id'], $this->post()); + } + else + { + $result = $this->ProjektphaseModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($projektphase = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/project/Projekttask.php b/application/controllers/api/v1/project/Projekttask.php new file mode 100644 index 000000000..30e78da3e --- /dev/null +++ b/application/controllers/api/v1/project/Projekttask.php @@ -0,0 +1,78 @@ +load->model('project/projekttask_model', 'ProjekttaskModel'); + // Load set the uid of the model to let to check the permissions + $this->ProjekttaskModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getProjekttask() + { + $projekttaskID = $this->get('projekttask_id'); + + if (isset($projekttaskID)) + { + $result = $this->ProjekttaskModel->load($projekttaskID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postProjekttask() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['projekttask_id'])) + { + $result = $this->ProjekttaskModel->update($this->post()['projekttask_id'], $this->post()); + } + else + { + $result = $this->ProjekttaskModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($projekttask = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/project/Ressource.php b/application/controllers/api/v1/project/Ressource.php new file mode 100644 index 000000000..00e923435 --- /dev/null +++ b/application/controllers/api/v1/project/Ressource.php @@ -0,0 +1,78 @@ +load->model('project/ressource_model', 'RessourceModel'); + // Load set the uid of the model to let to check the permissions + $this->RessourceModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getRessource() + { + $ressourceID = $this->get('ressource_id'); + + if (isset($ressourceID)) + { + $result = $this->RessourceModel->load($ressourceID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postRessource() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['ressource_id'])) + { + $result = $this->RessourceModel->update($this->post()['ressource_id'], $this->post()); + } + else + { + $result = $this->RessourceModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($ressource = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/project/Scrumsprint.php b/application/controllers/api/v1/project/Scrumsprint.php new file mode 100644 index 000000000..4d64782fb --- /dev/null +++ b/application/controllers/api/v1/project/Scrumsprint.php @@ -0,0 +1,78 @@ +load->model('project/scrumsprint_model', 'ScrumsprintModel'); + // Load set the uid of the model to let to check the permissions + $this->ScrumsprintModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getScrumsprint() + { + $scrumsprintID = $this->get('scrumsprint_id'); + + if (isset($scrumsprintID)) + { + $result = $this->ScrumsprintModel->load($scrumsprintID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postScrumsprint() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['scrumsprint_id'])) + { + $result = $this->ScrumsprintModel->update($this->post()['scrumsprint_id'], $this->post()); + } + else + { + $result = $this->ScrumsprintModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($scrumsprint = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/project/Scrumteam.php b/application/controllers/api/v1/project/Scrumteam.php new file mode 100644 index 000000000..440e66165 --- /dev/null +++ b/application/controllers/api/v1/project/Scrumteam.php @@ -0,0 +1,78 @@ +load->model('project/scrumteam_model', 'ScrumteamModel'); + // Load set the uid of the model to let to check the permissions + $this->ScrumteamModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getScrumteam() + { + $scrumteam_kurzbz = $this->get('scrumteam_kurzbz'); + + if (isset($scrumteam_kurzbz)) + { + $result = $this->ScrumteamModel->load($scrumteam_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postScrumteam() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['scrumteam_kurzbz'])) + { + $result = $this->ScrumteamModel->update($this->post()['scrumteam_kurzbz'], $this->post()); + } + else + { + $result = $this->ScrumteamModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($scrumteam = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Betriebsmittel.php b/application/controllers/api/v1/ressource/Betriebsmittel.php new file mode 100644 index 000000000..a827a3265 --- /dev/null +++ b/application/controllers/api/v1/ressource/Betriebsmittel.php @@ -0,0 +1,78 @@ +load->model('ressource/betriebsmittel_model', 'BetriebsmittelModel'); + // Load set the uid of the model to let to check the permissions + $this->BetriebsmittelModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBetriebsmittel() + { + $betriebsmittelID = $this->get('betriebsmittel_id'); + + if (isset($betriebsmittelID)) + { + $result = $this->BetriebsmittelModel->load($betriebsmittelID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBetriebsmittel() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['betriebsmittel_id'])) + { + $result = $this->BetriebsmittelModel->update($this->post()['betriebsmittel_id'], $this->post()); + } + else + { + $result = $this->BetriebsmittelModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($betriebsmittel = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Betriebsmittelperson2.php b/application/controllers/api/v1/ressource/Betriebsmittelperson2.php new file mode 100644 index 000000000..14baca485 --- /dev/null +++ b/application/controllers/api/v1/ressource/Betriebsmittelperson2.php @@ -0,0 +1,78 @@ +load->model('ressource/betriebsmittelperson_model', 'BetriebsmittelpersonModel'); + // Load set the uid of the model to let to check the permissions + $this->BetriebsmittelpersonModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBetriebsmittelperson() + { + $betriebsmittelpersonID = $this->get('betriebsmittelperson_id'); + + if (isset($betriebsmittelpersonID)) + { + $result = $this->BetriebsmittelpersonModel->load($betriebsmittelpersonID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBetriebsmittelperson() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['betriebsmittelperson_id'])) + { + $result = $this->BetriebsmittelpersonModel->update($this->post()['betriebsmittelperson_id'], $this->post()); + } + else + { + $result = $this->BetriebsmittelpersonModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($betriebsmittelperson = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Betriebsmittelstatus.php b/application/controllers/api/v1/ressource/Betriebsmittelstatus.php new file mode 100644 index 000000000..46d00c82c --- /dev/null +++ b/application/controllers/api/v1/ressource/Betriebsmittelstatus.php @@ -0,0 +1,78 @@ +load->model('ressource/betriebsmittelstatus_model', 'BetriebsmittelstatusModel'); + // Load set the uid of the model to let to check the permissions + $this->BetriebsmittelstatusModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBetriebsmittelstatus() + { + $betriebsmittelstatus_kurzbz = $this->get('betriebsmittelstatus_kurzbz'); + + if (isset($betriebsmittelstatus_kurzbz)) + { + $result = $this->BetriebsmittelstatusModel->load($betriebsmittelstatus_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBetriebsmittelstatus() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['betriebsmittelstatus_kurzbz'])) + { + $result = $this->BetriebsmittelstatusModel->update($this->post()['betriebsmittelstatus_kurzbz'], $this->post()); + } + else + { + $result = $this->BetriebsmittelstatusModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($betriebsmittelstatus = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Betriebsmitteltyp.php b/application/controllers/api/v1/ressource/Betriebsmitteltyp.php new file mode 100644 index 000000000..e23ed16d5 --- /dev/null +++ b/application/controllers/api/v1/ressource/Betriebsmitteltyp.php @@ -0,0 +1,78 @@ +load->model('ressource/betriebsmitteltyp_model', 'BetriebsmitteltypModel'); + // Load set the uid of the model to let to check the permissions + $this->BetriebsmitteltypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBetriebsmitteltyp() + { + $betriebsmitteltyp = $this->get('betriebsmitteltyp'); + + if (isset($betriebsmitteltyp)) + { + $result = $this->BetriebsmitteltypModel->load($betriebsmitteltyp); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBetriebsmitteltyp() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['betriebsmitteltyp'])) + { + $result = $this->BetriebsmitteltypModel->update($this->post()['betriebsmitteltyp'], $this->post()); + } + else + { + $result = $this->BetriebsmitteltypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($betriebsmitteltyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Coodle.php b/application/controllers/api/v1/ressource/Coodle.php new file mode 100644 index 000000000..353828465 --- /dev/null +++ b/application/controllers/api/v1/ressource/Coodle.php @@ -0,0 +1,78 @@ +load->model('ressource/coodle_model', 'CoodleModel'); + // Load set the uid of the model to let to check the permissions + $this->CoodleModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getCoodle() + { + $coodleID = $this->get('coodle_id'); + + if (isset($coodleID)) + { + $result = $this->CoodleModel->load($coodleID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postCoodle() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['coodle_id'])) + { + $result = $this->CoodleModel->update($this->post()['coodle_id'], $this->post()); + } + else + { + $result = $this->CoodleModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($coodle = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Erreichbarkeit.php b/application/controllers/api/v1/ressource/Erreichbarkeit.php new file mode 100644 index 000000000..5a142757e --- /dev/null +++ b/application/controllers/api/v1/ressource/Erreichbarkeit.php @@ -0,0 +1,78 @@ +load->model('ressource/erreichbarkeit_model', 'ErreichbarkeitModel'); + // Load set the uid of the model to let to check the permissions + $this->ErreichbarkeitModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getErreichbarkeit() + { + $erreichbarkeit_kurzbz = $this->get('erreichbarkeit_kurzbz'); + + if (isset($erreichbarkeit_kurzbz)) + { + $result = $this->ErreichbarkeitModel->load($erreichbarkeit_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postErreichbarkeit() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['erreichbarkeit_kurzbz'])) + { + $result = $this->ErreichbarkeitModel->update($this->post()['erreichbarkeit_kurzbz'], $this->post()); + } + else + { + $result = $this->ErreichbarkeitModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($erreichbarkeit = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Firma.php b/application/controllers/api/v1/ressource/Firma.php new file mode 100644 index 000000000..64c33b344 --- /dev/null +++ b/application/controllers/api/v1/ressource/Firma.php @@ -0,0 +1,78 @@ +load->model('ressource/firma_model', 'FirmaModel'); + // Load set the uid of the model to let to check the permissions + $this->FirmaModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getFirma() + { + $firmaID = $this->get('firma_id'); + + if (isset($firmaID)) + { + $result = $this->FirmaModel->load($firmaID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postFirma() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['firma_id'])) + { + $result = $this->FirmaModel->update($this->post()['firma_id'], $this->post()); + } + else + { + $result = $this->FirmaModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($firma = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Firmatag.php b/application/controllers/api/v1/ressource/Firmatag.php new file mode 100644 index 000000000..3fd939652 --- /dev/null +++ b/application/controllers/api/v1/ressource/Firmatag.php @@ -0,0 +1,79 @@ +load->model('ressource/firmatag_model', 'FirmatagModel'); + // Load set the uid of the model to let to check the permissions + $this->FirmatagModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getFirmatag() + { + $tag = $this->get('tag'); + $firma_id = $this->get('firma_id'); + + if (isset($tag) && isset($firma_id)) + { + $result = $this->FirmatagModel->load(array($tag, $firma_id)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postFirmatag() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['tag']) && isset($this->post()['firma_id'])) + { + $result = $this->FirmatagModel->update(array($this->post()['tag'], $this->post()['firma_id']), $this->post()); + } + else + { + $result = $this->FirmatagModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($firmatag = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Firmentyp.php b/application/controllers/api/v1/ressource/Firmentyp.php new file mode 100644 index 000000000..3261ccb39 --- /dev/null +++ b/application/controllers/api/v1/ressource/Firmentyp.php @@ -0,0 +1,78 @@ +load->model('ressource/firmentyp_model', 'FirmentypModel'); + // Load set the uid of the model to let to check the permissions + $this->FirmentypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getFirmentyp() + { + $firmentyp_kurzbz = $this->get('firmentyp_kurzbz'); + + if (isset($firmentyp_kurzbz)) + { + $result = $this->FirmentypModel->load($firmentyp_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postFirmentyp() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['firmentyp_kurzbz'])) + { + $result = $this->FirmentypModel->update($this->post()['firmentyp_kurzbz'], $this->post()); + } + else + { + $result = $this->FirmentypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($firmentyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Funktion.php b/application/controllers/api/v1/ressource/Funktion.php new file mode 100644 index 000000000..3e33c3c20 --- /dev/null +++ b/application/controllers/api/v1/ressource/Funktion.php @@ -0,0 +1,78 @@ +load->model('ressource/funktion_model', 'FunktionModel'); + // Load set the uid of the model to let to check the permissions + $this->FunktionModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getFunktion() + { + $funktion_kurzbz = $this->get('funktion_kurzbz'); + + if (isset($funktion_kurzbz)) + { + $result = $this->FunktionModel->load($funktion_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postFunktion() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['funktion_kurzbz'])) + { + $result = $this->FunktionModel->update($this->post()['funktion_kurzbz'], $this->post()); + } + else + { + $result = $this->FunktionModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($funktion = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Lehrmittel.php b/application/controllers/api/v1/ressource/Lehrmittel.php new file mode 100644 index 000000000..d874d53e5 --- /dev/null +++ b/application/controllers/api/v1/ressource/Lehrmittel.php @@ -0,0 +1,78 @@ +load->model('ressource/lehrmittel_model', 'LehrmittelModel'); + // Load set the uid of the model to let to check the permissions + $this->LehrmittelModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getLehrmittel() + { + $lehrmittel_kurzbz = $this->get('lehrmittel_kurzbz'); + + if (isset($lehrmittel_kurzbz)) + { + $result = $this->LehrmittelModel->load($lehrmittel_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postLehrmittel() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['lehrmittel_kurzbz'])) + { + $result = $this->LehrmittelModel->update($this->post()['lehrmittel_kurzbz'], $this->post()); + } + else + { + $result = $this->LehrmittelModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($lehrmittel = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Mitarbeiter.php b/application/controllers/api/v1/ressource/Mitarbeiter.php new file mode 100644 index 000000000..8578ab12d --- /dev/null +++ b/application/controllers/api/v1/ressource/Mitarbeiter.php @@ -0,0 +1,78 @@ +load->model('ressource/mitarbeiter_model', 'MitarbeiterModel'); + // Load set the uid of the model to let to check the permissions + $this->MitarbeiterModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getMitarbeiter() + { + $mitarbeiter_uid = $this->get('mitarbeiter_uid'); + + if (isset($mitarbeiter_uid)) + { + $result = $this->MitarbeiterModel->load($mitarbeiter_uid); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postMitarbeiter() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['mitarbeiter_uid'])) + { + $result = $this->MitarbeiterModel->update($this->post()['mitarbeiter_uid'], $this->post()); + } + else + { + $result = $this->MitarbeiterModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($mitarbeiter = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Ort.php b/application/controllers/api/v1/ressource/Ort.php new file mode 100644 index 000000000..022db2281 --- /dev/null +++ b/application/controllers/api/v1/ressource/Ort.php @@ -0,0 +1,78 @@ +load->model('ressource/ort_model', 'OrtModel'); + // Load set the uid of the model to let to check the permissions + $this->OrtModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getOrt() + { + $ort_kurzbz = $this->get('ort_kurzbz'); + + if (isset($ort_kurzbz)) + { + $result = $this->OrtModel->load($ort_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postOrt() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['ort_kurzbz'])) + { + $result = $this->OrtModel->update($this->post()['ort_kurzbz'], $this->post()); + } + else + { + $result = $this->OrtModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($ort = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Ortraumtyp.php b/application/controllers/api/v1/ressource/Ortraumtyp.php new file mode 100644 index 000000000..9d4cbd2db --- /dev/null +++ b/application/controllers/api/v1/ressource/Ortraumtyp.php @@ -0,0 +1,79 @@ +load->model('ressource/ortraumtyp_model', 'OrtraumtypModel'); + // Load set the uid of the model to let to check the permissions + $this->OrtraumtypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getOrtraumtyp() + { + $hierarchie = $this->get('hierarchie'); + $ort_kurzbz = $this->get('ort_kurzbz'); + + if (isset($hierarchie) && isset($ort_kurzbz)) + { + $result = $this->OrtraumtypModel->load(array($hierarchie, $ort_kurzbz)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postOrtraumtyp() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['hierarchie']) && isset($this->post()['ort_kurzbz'])) + { + $result = $this->OrtraumtypModel->update(array($this->post()['hierarchie'], $this->post()['ort_kurzbz']), $this->post()); + } + else + { + $result = $this->OrtraumtypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($ortraumtyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Personfunktionstandort.php b/application/controllers/api/v1/ressource/Personfunktionstandort.php new file mode 100644 index 000000000..e4c204716 --- /dev/null +++ b/application/controllers/api/v1/ressource/Personfunktionstandort.php @@ -0,0 +1,78 @@ +load->model('ressource/personfunktionstandort_model', 'PersonfunktionstandortModel'); + // Load set the uid of the model to let to check the permissions + $this->PersonfunktionstandortModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getPersonfunktionstandort() + { + $personfunktionstandortID = $this->get('personfunktionstandort_id'); + + if (isset($personfunktionstandortID)) + { + $result = $this->PersonfunktionstandortModel->load($personfunktionstandortID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postPersonfunktionstandort() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['personfunktionstandort_id'])) + { + $result = $this->PersonfunktionstandortModel->update($this->post()['personfunktionstandort_id'], $this->post()); + } + else + { + $result = $this->PersonfunktionstandortModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($personfunktionstandort = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Raumtyp.php b/application/controllers/api/v1/ressource/Raumtyp.php new file mode 100644 index 000000000..39751089d --- /dev/null +++ b/application/controllers/api/v1/ressource/Raumtyp.php @@ -0,0 +1,78 @@ +load->model('ressource/raumtyp_model', 'RaumtypModel'); + // Load set the uid of the model to let to check the permissions + $this->RaumtypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getRaumtyp() + { + $raumtyp_kurzbz = $this->get('raumtyp_kurzbz'); + + if (isset($raumtyp_kurzbz)) + { + $result = $this->RaumtypModel->load($raumtyp_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postRaumtyp() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['raumtyp_kurzbz'])) + { + $result = $this->RaumtypModel->update($this->post()['raumtyp_kurzbz'], $this->post()); + } + else + { + $result = $this->RaumtypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($raumtyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Reservierung.php b/application/controllers/api/v1/ressource/Reservierung.php new file mode 100644 index 000000000..8073e7c04 --- /dev/null +++ b/application/controllers/api/v1/ressource/Reservierung.php @@ -0,0 +1,78 @@ +load->model('ressource/reservierung_model', 'ReservierungModel'); + // Load set the uid of the model to let to check the permissions + $this->ReservierungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getReservierung() + { + $reservierungID = $this->get('reservierung_id'); + + if (isset($reservierungID)) + { + $result = $this->ReservierungModel->load($reservierungID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postReservierung() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['reservierung_id'])) + { + $result = $this->ReservierungModel->update($this->post()['reservierung_id'], $this->post()); + } + else + { + $result = $this->ReservierungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($reservierung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Resturlaub.php b/application/controllers/api/v1/ressource/Resturlaub.php new file mode 100644 index 000000000..16e2b2753 --- /dev/null +++ b/application/controllers/api/v1/ressource/Resturlaub.php @@ -0,0 +1,78 @@ +load->model('ressource/resturlaub_model', 'ResturlaubModel'); + // Load set the uid of the model to let to check the permissions + $this->ResturlaubModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getResturlaub() + { + $resturlaubID = $this->get('resturlaub_id'); + + if (isset($resturlaubID)) + { + $result = $this->ResturlaubModel->load($resturlaubID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postResturlaub() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['resturlaub_id'])) + { + $result = $this->ResturlaubModel->update($this->post()['resturlaub_id'], $this->post()); + } + else + { + $result = $this->ResturlaubModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($resturlaub = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Stunde.php b/application/controllers/api/v1/ressource/Stunde.php new file mode 100644 index 000000000..5470b2fca --- /dev/null +++ b/application/controllers/api/v1/ressource/Stunde.php @@ -0,0 +1,78 @@ +load->model('ressource/stunde_model', 'StundeModel'); + // Load set the uid of the model to let to check the permissions + $this->StundeModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStunde() + { + $stunde = $this->get('stunde'); + + if (isset($stunde)) + { + $result = $this->StundeModel->load($stunde); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStunde() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['stunde'])) + { + $result = $this->StundeModel->update($this->post()['stunde'], $this->post()); + } + else + { + $result = $this->StundeModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($stunde = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Stundenplan.php b/application/controllers/api/v1/ressource/Stundenplan.php new file mode 100644 index 000000000..a22c90615 --- /dev/null +++ b/application/controllers/api/v1/ressource/Stundenplan.php @@ -0,0 +1,78 @@ +load->model('ressource/stundenplan_model', 'StundenplanModel'); + // Load set the uid of the model to let to check the permissions + $this->StundenplanModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStundenplan() + { + $stundenplanID = $this->get('stundenplan_id'); + + if (isset($stundenplanID)) + { + $result = $this->StundenplanModel->load($stundenplanID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStundenplan() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['stundenplan_id'])) + { + $result = $this->StundenplanModel->update($this->post()['stundenplan_id'], $this->post()); + } + else + { + $result = $this->StundenplanModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($stundenplan = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Stundenplandev.php b/application/controllers/api/v1/ressource/Stundenplandev.php new file mode 100644 index 000000000..aa6f7fce8 --- /dev/null +++ b/application/controllers/api/v1/ressource/Stundenplandev.php @@ -0,0 +1,78 @@ +load->model('ressource/stundenplandev_model', 'StundenplandevModel'); + // Load set the uid of the model to let to check the permissions + $this->StundenplandevModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getStundenplandev() + { + $stundenplandevID = $this->get('stundenplandev_id'); + + if (isset($stundenplandevID)) + { + $result = $this->StundenplandevModel->load($stundenplandevID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postStundenplandev() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['stundenplandev_id'])) + { + $result = $this->StundenplandevModel->update($this->post()['stundenplandev_id'], $this->post()); + } + else + { + $result = $this->StundenplandevModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($stundenplandev = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Zeitaufzeichnung.php b/application/controllers/api/v1/ressource/Zeitaufzeichnung.php new file mode 100644 index 000000000..275f5704a --- /dev/null +++ b/application/controllers/api/v1/ressource/Zeitaufzeichnung.php @@ -0,0 +1,78 @@ +load->model('ressource/zeitaufzeichnung_model', 'ZeitaufzeichnungModel'); + // Load set the uid of the model to let to check the permissions + $this->ZeitaufzeichnungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getZeitaufzeichnung() + { + $zeitaufzeichnungID = $this->get('zeitaufzeichnung_id'); + + if (isset($zeitaufzeichnungID)) + { + $result = $this->ZeitaufzeichnungModel->load($zeitaufzeichnungID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postZeitaufzeichnung() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['zeitaufzeichnung_id'])) + { + $result = $this->ZeitaufzeichnungModel->update($this->post()['zeitaufzeichnung_id'], $this->post()); + } + else + { + $result = $this->ZeitaufzeichnungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($zeitaufzeichnung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Zeitfenster.php b/application/controllers/api/v1/ressource/Zeitfenster.php new file mode 100644 index 000000000..c1b1ac09c --- /dev/null +++ b/application/controllers/api/v1/ressource/Zeitfenster.php @@ -0,0 +1,88 @@ +load->model('ressource/zeitfenster_model', 'ZeitfensterModel'); + // Load set the uid of the model to let to check the permissions + $this->ZeitfensterModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getZeitfenster() + { + $wochentag = $this->get('wochentag'); + $studiengang_kz = $this->get('studiengang_kz'); + $ort_kurzbz = $this->get('ort_kurzbz'); + $stunde = $this->get('stunde'); + + if (isset($wochentag) && isset($studiengang_kz) && isset($ort_kurzbz) && isset($stunde)) + { + $result = $this->ZeitfensterModel->load(array($wochentag, $studiengang_kz, $ort_kurzbz, $stunde)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postZeitfenster() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['wochentag']) && isset($this->post()['studiengang_kz']) && + isset($this->post()['ort_kurzbz']) && isset($this->post()['stunde'])) + { + $pksArray = array($this->post()['wochentag'], + $this->post()['studiengang_kz'], + $this->post()['ort_kurzbz'], + $this->post()['stunde'] + ); + + $result = $this->ZeitfensterModel->update($pksArray, $this->post()); + } + else + { + $result = $this->ZeitfensterModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($zeitfenster = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Zeitsperre.php b/application/controllers/api/v1/ressource/Zeitsperre.php new file mode 100644 index 000000000..42eaa9a32 --- /dev/null +++ b/application/controllers/api/v1/ressource/Zeitsperre.php @@ -0,0 +1,78 @@ +load->model('ressource/zeitsperre_model', 'ZeitsperreModel'); + // Load set the uid of the model to let to check the permissions + $this->ZeitsperreModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getZeitsperre() + { + $zeitsperreID = $this->get('zeitsperre_id'); + + if (isset($zeitsperreID)) + { + $result = $this->ZeitsperreModel->load($zeitsperreID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postZeitsperre() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['zeitsperre_id'])) + { + $result = $this->ZeitsperreModel->update($this->post()['zeitsperre_id'], $this->post()); + } + else + { + $result = $this->ZeitsperreModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($zeitsperre = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Zeitsperretyp.php b/application/controllers/api/v1/ressource/Zeitsperretyp.php new file mode 100644 index 000000000..dae492cbe --- /dev/null +++ b/application/controllers/api/v1/ressource/Zeitsperretyp.php @@ -0,0 +1,78 @@ +load->model('ressource/zeitsperretyp_model', 'ZeitsperretypModel'); + // Load set the uid of the model to let to check the permissions + $this->ZeitsperretypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getZeitsperretyp() + { + $zeitsperretyp_kurzbz = $this->get('zeitsperretyp_kurzbz'); + + if (isset($zeitsperretyp_kurzbz)) + { + $result = $this->ZeitsperretypModel->load($zeitsperretyp_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postZeitsperretyp() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['zeitsperretyp_kurzbz'])) + { + $result = $this->ZeitsperretypModel->update($this->post()['zeitsperretyp_kurzbz'], $this->post()); + } + else + { + $result = $this->ZeitsperretypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($zeitsperretyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/ressource/Zeitwunsch.php b/application/controllers/api/v1/ressource/Zeitwunsch.php new file mode 100644 index 000000000..45c541b54 --- /dev/null +++ b/application/controllers/api/v1/ressource/Zeitwunsch.php @@ -0,0 +1,85 @@ +load->model('ressource/zeitwunsch_model', 'ZeitwunschModel'); + // Load set the uid of the model to let to check the permissions + $this->ZeitwunschModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getZeitwunsch() + { + $tag = $this->get('tag'); + $mitarbeiter_uid = $this->get('mitarbeiter_uid'); + $stunde = $this->get('stunde'); + + if (isset($tag) && isset($mitarbeiter_uid) && isset($stunde)) + { + $result = $this->ZeitwunschModel->load(array($tag, $mitarbeiter_uid, $stunde)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postZeitwunsch() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['tag']) && isset($this->post()['mitarbeiter_uid']) && isset($this->post()['stunde'])) + { + $pksArray = array($this->post()['tag'], + $this->post()['mitarbeiter_uid'], + $this->post()['stunde'] + ); + + $result = $this->ZeitwunschModel->update($pksArray, $this->post()); + } + else + { + $result = $this->ZeitwunschModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($zeitwunsch = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Appdaten.php b/application/controllers/api/v1/system/Appdaten.php new file mode 100644 index 000000000..5d45d8512 --- /dev/null +++ b/application/controllers/api/v1/system/Appdaten.php @@ -0,0 +1,78 @@ +load->model('system/appdaten_model', 'AppdatenModel'); + // Load set the uid of the model to let to check the permissions + $this->AppdatenModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAppdaten() + { + $appdatenID = $this->get('appdaten_id'); + + if (isset($appdatenID)) + { + $result = $this->AppdatenModel->load($appdatenID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAppdaten() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['appdaten_id'])) + { + $result = $this->AppdatenModel->update($this->post()['appdaten_id'], $this->post()); + } + else + { + $result = $this->AppdatenModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($appdaten = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Benutzerrolle.php b/application/controllers/api/v1/system/Benutzerrolle.php new file mode 100644 index 000000000..e1aa8c9b7 --- /dev/null +++ b/application/controllers/api/v1/system/Benutzerrolle.php @@ -0,0 +1,78 @@ +load->model('system/benutzerrolle_model', 'BenutzerrolleModel'); + // Load set the uid of the model to let to check the permissions + $this->BenutzerrolleModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBenutzerrolle() + { + $benutzerrolleID = $this->get('benutzerrolle_id'); + + if (isset($benutzerrolleID)) + { + $result = $this->BenutzerrolleModel->load($benutzerrolleID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBenutzerrolle() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['benutzerrolle_id'])) + { + $result = $this->BenutzerrolleModel->update($this->post()['benutzerrolle_id'], $this->post()); + } + else + { + $result = $this->BenutzerrolleModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($benutzerrolle = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Berechtigung.php b/application/controllers/api/v1/system/Berechtigung.php new file mode 100644 index 000000000..54d639fa3 --- /dev/null +++ b/application/controllers/api/v1/system/Berechtigung.php @@ -0,0 +1,78 @@ +load->model('system/berechtigung_model', 'BerechtigungModel'); + // Load set the uid of the model to let to check the permissions + $this->BerechtigungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getBerechtigung() + { + $berechtigung_kurzbz = $this->get('berechtigung_kurzbz'); + + if (isset($berechtigung_kurzbz)) + { + $result = $this->BerechtigungModel->load($berechtigung_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postBerechtigung() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['berechtigung_kurzbz'])) + { + $result = $this->BerechtigungModel->update($this->post()['berechtigung_kurzbz'], $this->post()); + } + else + { + $result = $this->BerechtigungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($berechtigung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Cronjob.php b/application/controllers/api/v1/system/Cronjob.php new file mode 100644 index 000000000..82c63ed81 --- /dev/null +++ b/application/controllers/api/v1/system/Cronjob.php @@ -0,0 +1,78 @@ +load->model('system/cronjob_model', 'CronjobModel'); + // Load set the uid of the model to let to check the permissions + $this->CronjobModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getCronjob() + { + $cronjobID = $this->get('cronjob_id'); + + if (isset($cronjobID)) + { + $result = $this->CronjobModel->load($cronjobID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postCronjob() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['cronjob_id'])) + { + $result = $this->CronjobModel->update($this->post()['cronjob_id'], $this->post()); + } + else + { + $result = $this->CronjobModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($cronjob = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Filter.php b/application/controllers/api/v1/system/Filter.php new file mode 100644 index 000000000..49eac7d7e --- /dev/null +++ b/application/controllers/api/v1/system/Filter.php @@ -0,0 +1,78 @@ +load->model('system/filter_model', 'FilterModel'); + // Load set the uid of the model to let to check the permissions + $this->FilterModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getFilter() + { + $filterID = $this->get('filter_id'); + + if (isset($filterID)) + { + $result = $this->FilterModel->load($filterID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postFilter() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['filter_id'])) + { + $result = $this->FilterModel->update($this->post()['filter_id'], $this->post()); + } + else + { + $result = $this->FilterModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($filter = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Log.php b/application/controllers/api/v1/system/Log.php new file mode 100644 index 000000000..c18da58fb --- /dev/null +++ b/application/controllers/api/v1/system/Log.php @@ -0,0 +1,78 @@ +load->model('system/log_model', 'LogModel'); + // Load set the uid of the model to let to check the permissions + $this->LogModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getLog() + { + $logID = $this->get('log_id'); + + if (isset($logID)) + { + $result = $this->LogModel->load($logID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postLog() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['log_id'])) + { + $result = $this->LogModel->update($this->post()['log_id'], $this->post()); + } + else + { + $result = $this->LogModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($log = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Message.php b/application/controllers/api/v1/system/Message.php new file mode 100644 index 000000000..b7f70e187 --- /dev/null +++ b/application/controllers/api/v1/system/Message.php @@ -0,0 +1,78 @@ +load->model('system/message_model', 'MessageModel'); + // Load set the uid of the model to let to check the permissions + $this->MessageModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getMessage() + { + $messageID = $this->get('message_id'); + + if (isset($messageID)) + { + $result = $this->MessageModel->load($messageID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postMessage() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['message_id'])) + { + $result = $this->MessageModel->update($this->post()['message_id'], $this->post()); + } + else + { + $result = $this->MessageModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($message = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Rolle.php b/application/controllers/api/v1/system/Rolle.php new file mode 100644 index 000000000..0523d412f --- /dev/null +++ b/application/controllers/api/v1/system/Rolle.php @@ -0,0 +1,78 @@ +load->model('system/rolle_model', 'RolleModel'); + // Load set the uid of the model to let to check the permissions + $this->RolleModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getRolle() + { + $rolle_kurzbz = $this->get('rolle_kurzbz'); + + if (isset($rolle_kurzbz)) + { + $result = $this->RolleModel->load($rolle_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postRolle() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['rolle_kurzbz'])) + { + $result = $this->RolleModel->update($this->post()['rolle_kurzbz'], $this->post()); + } + else + { + $result = $this->RolleModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($rolle = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Rolleberechtigung.php b/application/controllers/api/v1/system/Rolleberechtigung.php new file mode 100644 index 000000000..13125c536 --- /dev/null +++ b/application/controllers/api/v1/system/Rolleberechtigung.php @@ -0,0 +1,79 @@ +load->model('system/rolleberechtigung_model', 'RolleberechtigungModel'); + // Load set the uid of the model to let to check the permissions + $this->RolleberechtigungModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getRolleberechtigung() + { + $rolle_kurzbz = $this->get('rolle_kurzbz'); + $berechtigung_kurzbz = $this->get('berechtigung_kurzbz'); + + if (isset($rolle_kurzbz) && isset($berechtigung_kurzbz)) + { + $result = $this->RolleberechtigungModel->load(array($rolle_kurzbz, $berechtigung_kurzbz)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postRolleberechtigung() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['rolle_kurzbz']) && isset($this->post()['berechtigung_kurzbz'])) + { + $result = $this->RolleberechtigungModel->update(array($this->post()['rolle_kurzbz'], $this->post()['berechtigung_kurzbz']), $this->post()); + } + else + { + $result = $this->RolleberechtigungModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($rolleberechtigung = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Server.php b/application/controllers/api/v1/system/Server.php new file mode 100644 index 000000000..361ce2fb0 --- /dev/null +++ b/application/controllers/api/v1/system/Server.php @@ -0,0 +1,78 @@ +load->model('system/server_model', 'ServerModel'); + // Load set the uid of the model to let to check the permissions + $this->ServerModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getServer() + { + $server_kurzbz = $this->get('server_kurzbz'); + + if (isset($server_kurzbz)) + { + $result = $this->ServerModel->load($server_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postServer() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['server_id'])) + { + $result = $this->ServerModel->update($this->post()['server_id'], $this->post()); + } + else + { + $result = $this->ServerModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($server = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Sprache2.php b/application/controllers/api/v1/system/Sprache2.php new file mode 100644 index 000000000..342c77d9c --- /dev/null +++ b/application/controllers/api/v1/system/Sprache2.php @@ -0,0 +1,78 @@ +load->model('system/sprache_model', 'SpracheModel'); + // Load set the uid of the model to let to check the permissions + $this->SpracheModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getSprache() + { + $sprache = $this->get('sprache'); + + if (isset($sprache)) + { + $result = $this->SpracheModel->load($sprache); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postSprache() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['sprache_id'])) + { + $result = $this->SpracheModel->update($this->post()['sprache_id'], $this->post()); + } + else + { + $result = $this->SpracheModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($sprache = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Tag.php b/application/controllers/api/v1/system/Tag.php new file mode 100644 index 000000000..f7b7bb7e0 --- /dev/null +++ b/application/controllers/api/v1/system/Tag.php @@ -0,0 +1,78 @@ +load->model('system/tag_model', 'TagModel'); + // Load set the uid of the model to let to check the permissions + $this->TagModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getTag() + { + $tag = $this->get('tag'); + + if (isset($tag)) + { + $result = $this->TagModel->load($tag); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postTag() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['tag'])) + { + $result = $this->TagModel->update($this->post()['tag'], $this->post()); + } + else + { + $result = $this->TagModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($tag = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Thread.php b/application/controllers/api/v1/system/Thread.php new file mode 100644 index 000000000..633e779e5 --- /dev/null +++ b/application/controllers/api/v1/system/Thread.php @@ -0,0 +1,78 @@ +load->model('system/thread_model', 'ThreadModel'); + // Load set the uid of the model to let to check the permissions + $this->ThreadModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getThread() + { + $threadID = $this->get('thread_id'); + + if (isset($threadID)) + { + $result = $this->ThreadModel->load($threadID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postThread() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['thread_id'])) + { + $result = $this->ThreadModel->update($this->post()['thread_id'], $this->post()); + } + else + { + $result = $this->ThreadModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($thread = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Variable.php b/application/controllers/api/v1/system/Variable.php new file mode 100644 index 000000000..7567eca20 --- /dev/null +++ b/application/controllers/api/v1/system/Variable.php @@ -0,0 +1,79 @@ +load->model('system/variable_model', 'VariableModel'); + // Load set the uid of the model to let to check the permissions + $this->VariableModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getVariable() + { + $uid = $this->get('uid'); + $name = $this->get('name'); + + if (isset($uid) && isset($name)) + { + $result = $this->VariableModel->load(array($uid, $name)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postVariable() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['uid']) && isset($this->post()['name'])) + { + $result = $this->VariableModel->update(array($this->post()['uid'], $this->post()['name']), $this->post()); + } + else + { + $result = $this->VariableModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($variable = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Vorlage.php b/application/controllers/api/v1/system/Vorlage.php new file mode 100644 index 000000000..0de44b90e --- /dev/null +++ b/application/controllers/api/v1/system/Vorlage.php @@ -0,0 +1,78 @@ +load->model('system/vorlage_model', 'VorlageModel'); + // Load set the uid of the model to let to check the permissions + $this->VorlageModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getVorlage() + { + $vorlage_kurzbz = $this->get('vorlage_kurzbz'); + + if (isset($vorlage_kurzbz)) + { + $result = $this->VorlageModel->load($vorlage_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postVorlage() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['vorlage_kurzbz'])) + { + $result = $this->VorlageModel->update($this->post()['vorlage_kurzbz'], $this->post()); + } + else + { + $result = $this->VorlageModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($vorlage = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Vorlagestudiengang.php b/application/controllers/api/v1/system/Vorlagestudiengang.php new file mode 100644 index 000000000..4070dd819 --- /dev/null +++ b/application/controllers/api/v1/system/Vorlagestudiengang.php @@ -0,0 +1,78 @@ +load->model('system/vorlagestudiengang_model', 'VorlagestudiengangModel'); + // Load set the uid of the model to let to check the permissions + $this->VorlagestudiengangModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getVorlagestudiengang() + { + $vorlagestudiengangID = $this->get('vorlagestudiengang_id'); + + if (isset($vorlagestudiengangID)) + { + $result = $this->VorlagestudiengangModel->load($vorlagestudiengangID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postVorlagestudiengang() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['vorlagestudiengang_id'])) + { + $result = $this->VorlagestudiengangModel->update($this->post()['vorlagestudiengang_id'], $this->post()); + } + else + { + $result = $this->VorlagestudiengangModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($vorlagestudiengang = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Webservicelog.php b/application/controllers/api/v1/system/Webservicelog.php new file mode 100644 index 000000000..3bdf38517 --- /dev/null +++ b/application/controllers/api/v1/system/Webservicelog.php @@ -0,0 +1,78 @@ +load->model('system/webservicelog_model', 'WebservicelogModel'); + // Load set the uid of the model to let to check the permissions + $this->WebservicelogModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getWebservicelog() + { + $webservicelogID = $this->get('webservicelog_id'); + + if (isset($webservicelogID)) + { + $result = $this->WebservicelogModel->load($webservicelogID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postWebservicelog() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['webservicelog_id'])) + { + $result = $this->WebservicelogModel->update($this->post()['webservicelog_id'], $this->post()); + } + else + { + $result = $this->WebservicelogModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($webservicelog = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Webservicerecht.php b/application/controllers/api/v1/system/Webservicerecht.php new file mode 100644 index 000000000..459f3d56a --- /dev/null +++ b/application/controllers/api/v1/system/Webservicerecht.php @@ -0,0 +1,78 @@ +load->model('system/webservicerecht_model', 'WebservicerechtModel'); + // Load set the uid of the model to let to check the permissions + $this->WebservicerechtModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getWebservicerecht() + { + $webservicerechtID = $this->get('webservicerecht_id'); + + if (isset($webservicerechtID)) + { + $result = $this->WebservicerechtModel->load($webservicerechtID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postWebservicerecht() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['webservicerecht_id'])) + { + $result = $this->WebservicerechtModel->update($this->post()['webservicerecht_id'], $this->post()); + } + else + { + $result = $this->WebservicerechtModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($webservicerecht = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/Webservicetyp.php b/application/controllers/api/v1/system/Webservicetyp.php new file mode 100644 index 000000000..e29a34d21 --- /dev/null +++ b/application/controllers/api/v1/system/Webservicetyp.php @@ -0,0 +1,78 @@ +load->model('system/webservicetyp_model', 'WebservicetypModel'); + // Load set the uid of the model to let to check the permissions + $this->WebservicetypModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getWebservicetyp() + { + $webservicetyp_kurzbz = $this->get('webservicetyp_kurzbz'); + + if (isset($webservicetyp_kurzbz)) + { + $result = $this->WebservicetypModel->load($webservicetyp_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postWebservicetyp() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['webservicetyp_kurzbz'])) + { + $result = $this->WebservicetypModel->update($this->post()['webservicetyp_kurzbz'], $this->post()); + } + else + { + $result = $this->WebservicetypModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($webservicetyp = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/system/message_old.php b/application/controllers/api/v1/system/message_old.php new file mode 100644 index 000000000..e10b6014c --- /dev/null +++ b/application/controllers/api/v1/system/message_old.php @@ -0,0 +1,78 @@ +load->model('system/message_old_model', 'message_oldModel'); + // Load set the uid of the model to let to check the permissions + $this->message_oldModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getmessage_old() + { + $message_oldID = $this->get('message_old_id'); + + if (isset($message_oldID)) + { + $result = $this->message_oldModel->load($message_oldID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postmessage_old() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['message_old_id'])) + { + $result = $this->message_oldModel->update($this->post()['message_old_id'], $this->post()); + } + else + { + $result = $this->message_oldModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($message_old = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/testtool/Ablauf.php b/application/controllers/api/v1/testtool/Ablauf.php new file mode 100644 index 000000000..d3b0c2d1b --- /dev/null +++ b/application/controllers/api/v1/testtool/Ablauf.php @@ -0,0 +1,78 @@ +load->model('testtool/ablauf_model', 'AblaufModel'); + // Load set the uid of the model to let to check the permissions + $this->AblaufModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAblauf() + { + $ablaufID = $this->get('ablauf_id'); + + if (isset($ablaufID)) + { + $result = $this->AblaufModel->load($ablaufID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAblauf() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['ablauf_id'])) + { + $result = $this->AblaufModel->update($this->post()['ablauf_id'], $this->post()); + } + else + { + $result = $this->AblaufModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($ablauf = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/testtool/Antwort.php b/application/controllers/api/v1/testtool/Antwort.php new file mode 100644 index 000000000..127725c96 --- /dev/null +++ b/application/controllers/api/v1/testtool/Antwort.php @@ -0,0 +1,78 @@ +load->model('testtool/antwort_model', 'AntwortModel'); + // Load set the uid of the model to let to check the permissions + $this->AntwortModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getAntwort() + { + $antwortID = $this->get('antwort_id'); + + if (isset($antwortID)) + { + $result = $this->AntwortModel->load($antwortID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postAntwort() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['antwort_id'])) + { + $result = $this->AntwortModel->update($this->post()['antwort_id'], $this->post()); + } + else + { + $result = $this->AntwortModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($antwort = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/testtool/Frage.php b/application/controllers/api/v1/testtool/Frage.php new file mode 100644 index 000000000..01d506fcc --- /dev/null +++ b/application/controllers/api/v1/testtool/Frage.php @@ -0,0 +1,78 @@ +load->model('testtool/frage_model', 'FrageModel'); + // Load set the uid of the model to let to check the permissions + $this->FrageModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getFrage() + { + $frageID = $this->get('frage_id'); + + if (isset($frageID)) + { + $result = $this->FrageModel->load($frageID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postFrage() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['frage_id'])) + { + $result = $this->FrageModel->update($this->post()['frage_id'], $this->post()); + } + else + { + $result = $this->FrageModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($frage = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/testtool/Gebiet.php b/application/controllers/api/v1/testtool/Gebiet.php new file mode 100644 index 000000000..51d671523 --- /dev/null +++ b/application/controllers/api/v1/testtool/Gebiet.php @@ -0,0 +1,78 @@ +load->model('testtool/gebiet_model', 'GebietModel'); + // Load set the uid of the model to let to check the permissions + $this->GebietModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getGebiet() + { + $gebietID = $this->get('gebiet_id'); + + if (isset($gebietID)) + { + $result = $this->GebietModel->load($gebietID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postGebiet() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['gebiet_id'])) + { + $result = $this->GebietModel->update($this->post()['gebiet_id'], $this->post()); + } + else + { + $result = $this->GebietModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($gebiet = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/testtool/Kategorie.php b/application/controllers/api/v1/testtool/Kategorie.php new file mode 100644 index 000000000..ba835df85 --- /dev/null +++ b/application/controllers/api/v1/testtool/Kategorie.php @@ -0,0 +1,78 @@ +load->model('testtool/kategorie_model', 'KategorieModel'); + // Load set the uid of the model to let to check the permissions + $this->KategorieModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getKategorie() + { + $kategorie_kurzbz = $this->get('kategorie_kurzbz'); + + if (isset($kategorie_kurzbz)) + { + $result = $this->KategorieModel->load($kategorie_kurzbz); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postKategorie() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['kategorie_kurzbz'])) + { + $result = $this->KategorieModel->update($this->post()['kategorie_kurzbz'], $this->post()); + } + else + { + $result = $this->KategorieModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($kategorie = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/testtool/Kriterien.php b/application/controllers/api/v1/testtool/Kriterien.php new file mode 100644 index 000000000..850b973a4 --- /dev/null +++ b/application/controllers/api/v1/testtool/Kriterien.php @@ -0,0 +1,78 @@ +load->model('testtool/kriterien_model', 'KriterienModel'); + // Load set the uid of the model to let to check the permissions + $this->KriterienModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getKriterien() + { + $kriterienID = $this->get('kriterien_id'); + + if (isset($kriterienID)) + { + $result = $this->KriterienModel->load($kriterienID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postKriterien() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['kriterien_id'])) + { + $result = $this->KriterienModel->update($this->post()['kriterien_id'], $this->post()); + } + else + { + $result = $this->KriterienModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($kriterien = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/testtool/Pruefling.php b/application/controllers/api/v1/testtool/Pruefling.php new file mode 100644 index 000000000..1d9144cdf --- /dev/null +++ b/application/controllers/api/v1/testtool/Pruefling.php @@ -0,0 +1,78 @@ +load->model('testtool/pruefling_model', 'PrueflingModel'); + // Load set the uid of the model to let to check the permissions + $this->PrueflingModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getPruefling() + { + $prueflingID = $this->get('pruefling_id'); + + if (isset($prueflingID)) + { + $result = $this->PrueflingModel->load($prueflingID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postPruefling() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['pruefling_id'])) + { + $result = $this->PrueflingModel->update($this->post()['pruefling_id'], $this->post()); + } + else + { + $result = $this->PrueflingModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($pruefling = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/api/v1/testtool/Vorschlag.php b/application/controllers/api/v1/testtool/Vorschlag.php new file mode 100644 index 000000000..cdd1fe439 --- /dev/null +++ b/application/controllers/api/v1/testtool/Vorschlag.php @@ -0,0 +1,78 @@ +load->model('testtool/vorschlag_model', 'VorschlagModel'); + // Load set the uid of the model to let to check the permissions + $this->VorschlagModel->setUID($this->_getUID()); + } + + /** + * @return void + */ + public function getVorschlag() + { + $vorschlagID = $this->get('vorschlag_id'); + + if (isset($vorschlagID)) + { + $result = $this->VorschlagModel->load($vorschlagID); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + /** + * @return void + */ + public function postVorschlag() + { + if ($this->_validate($this->post())) + { + if (isset($this->post()['vorschlag_id'])) + { + $result = $this->VorschlagModel->update($this->post()['vorschlag_id'], $this->post()); + } + else + { + $result = $this->VorschlagModel->insert($this->post()); + } + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } + + private function _validate($vorschlag = NULL) + { + return true; + } +} \ No newline at end of file diff --git a/application/controllers/message/Message.php b/application/controllers/system/Message.php similarity index 89% rename from application/controllers/message/Message.php rename to application/controllers/system/Message.php index 3f0f00721..8ed3331b6 100755 --- a/application/controllers/message/Message.php +++ b/application/controllers/system/Message.php @@ -1,5 +1,5 @@ load->library('session'); // -> autoload - //$this->load->library('database'); -> autoload + function __construct() + { + parent::__construct(); + //$this->load->library('session'); // -> autoload + //$this->load->library('database'); -> autoload + + } + + /** + * + * @param type $data + * @return typeparses empty string to NULL + */ + protected function _parseData($data) + { + if(is_array($data)) + { + foreach($data as $key=>$value) + { + if($value === "") + { + $data[$key] = NULL; + } + } + return $data; + } + elseif(is_object($data)) + { + //TODO + } + else + { + if($data == "") + { + return NULL; + } + } } } \ No newline at end of file diff --git a/application/core/DB_Model.php b/application/core/DB_Model.php index c7b387faa..a1f6df4b3 100644 --- a/application/core/DB_Model.php +++ b/application/core/DB_Model.php @@ -24,7 +24,7 @@ class DB_Model extends FHC_Model public function insert($data) { // Check Class-Attributes - if(is_null($this->dbTable)) + if (is_null($this->dbTable)) return $this->_error(lang('fhc_'.FHC_NODBTABLE), FHC_MODEL_ERROR); // Check rights @@ -47,7 +47,7 @@ class DB_Model extends FHC_Model public function replace($data) { // Check Class-Attributes - if(is_null($this->dbTable)) + if (is_null($this->dbTable)) return $this->_error(lang('fhc_'.FHC_NODBTABLE), FHC_MODEL_ERROR); // Check rights @@ -71,9 +71,9 @@ class DB_Model extends FHC_Model public function update($id, $data) { // Check Class-Attributes - if(is_null($this->dbTable)) + if (is_null($this->dbTable)) return $this->_error(lang('fhc_'.FHC_NODBTABLE), FHC_MODEL_ERROR); - if(is_null($this->pk)) + if (is_null($this->pk)) return $this->_error(lang('fhc_'.FHC_NOPK), FHC_MODEL_ERROR); // Check rights @@ -106,9 +106,9 @@ class DB_Model extends FHC_Model public function load($id) { // Check Class-Attributes - if(is_null($this->dbTable)) + if (is_null($this->dbTable)) return $this->_error(lang('fhc_'.FHC_NODBTABLE), FHC_MODEL_ERROR); - if(is_null($this->pk)) + if (is_null($this->pk)) return $this->_error(lang('fhc_'.FHC_NOPK), FHC_MODEL_ERROR); @@ -142,7 +142,7 @@ class DB_Model extends FHC_Model public function loadWhere($where = null) { // Check Class-Attributes - if(is_null($this->dbTable)) + if (is_null($this->dbTable)) return $this->_error(lang('fhc_'.FHC_NODBTABLE), FHC_MODEL_ERROR); // Check rights @@ -169,9 +169,9 @@ class DB_Model extends FHC_Model public function loadWhole() { // Check Class-Attributes - if(is_null($this->dbTable)) + if (is_null($this->dbTable)) return $this->_error(lang('fhc_'.FHC_NODBTABLE), FHC_MODEL_ERROR); - if(is_null($this->pk)) + if (is_null($this->pk)) return $this->_error(lang('fhc_'.FHC_NOPK), FHC_MODEL_ERROR); @@ -196,7 +196,7 @@ class DB_Model extends FHC_Model public function addJoin($joinTable = null, $cond = null, $type = '') { // Check parameters - if(is_null($joinTable) || is_null($cond) || !in_array($type, array('', 'LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'))) + if (is_null($joinTable) || is_null($cond) || !in_array($type, array('', 'LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'))) return $this->_error(lang('fhc_'.FHC_NODBTABLE), FHC_MODEL_ERROR); // Check rights for joined table @@ -216,13 +216,46 @@ class DB_Model extends FHC_Model public function addOrder($field = null, $type = 'ASC') { // Check Class-Attributes and parameters - if(is_null($field) || !in_array($type, array('ASC', 'DESC'))) + if (is_null($field) || !in_array($type, array('ASC', 'DESC'))) return $this->_error(lang('fhc_'.FHC_NODBTABLE), FHC_MODEL_ERROR); $this->db->order_by($field, $type); return $this->_success(TRUE); } + + /** --------------------------------------------------------------- + * Add distinct clause + * + * @return void + */ + public function addDistinct() + { + $this->db->distinct(); + } + + /** --------------------------------------------------------------- + * Add limit clause + * + * @return void + */ + public function addLimit($start = null, $end = null) + { + // Check Class-Attributes and parameters + if (!is_numeric($start) || (is_numeric($start) && $start <= 0)) + return $this->_error(lang('fhc_'.FHC_NODBTABLE), FHC_MODEL_ERROR); + + if (is_numeric($end) && $end > $start) + { + $this->db->limit($start, $end); + } + else + { + $this->db->limit($start); + } + + return $this->_success(TRUE); + } /** --------------------------------------------------------------- * Delete data from DB-Table @@ -233,9 +266,9 @@ class DB_Model extends FHC_Model public function delete($id) { // Check Class-Attributes - if(is_null($this->dbTable)) + if (is_null($this->dbTable)) return $this->_error(lang('fhc_'.FHC_NODBTABLE), FHC_MODEL_ERROR); - if(is_null($this->pk)) + if (is_null($this->pk)) return $this->_error(lang('fhc_'.FHC_NOPK), FHC_MODEL_ERROR); // Check rights @@ -302,7 +335,7 @@ class DB_Model extends FHC_Model $quote=''; $len = strlen($s); $v = ''; - for($i=$start+1; $i<$len;$i++) + for ($i=$start+1; $i<$len;$i++) { $ch = $s[$i]; if (!$string && $ch=='}') diff --git a/application/core/FHC_Controller.php b/application/core/FHC_Controller.php index b08696193..7c45a2fc3 100644 --- a/application/core/FHC_Controller.php +++ b/application/core/FHC_Controller.php @@ -1,5 +1,5 @@ load->helper('language'); $this->lang->load('fhc_model'); $this->lang->load('fhcomplete'); - $this->load->library('FHC_DB_ACL'); - //$this->load->library('session'); + + $uid = NULL; + if (is_null($uid) && isset($this->session->uid)) + { + $uid = $this->session->uid; + } + $this->load->library('FHC_DB_ACL', array('uid' => $uid)); } /** --------------------------------------------------------------- @@ -54,4 +60,4 @@ class FHC_Model extends CI_Model $return->retval = $retval; return $return; } -} \ No newline at end of file +} diff --git a/application/helpers/fhcauth_helper.php b/application/helpers/fhcauth_helper.php index 645952841..1a904ee55 100644 --- a/application/helpers/fhcauth_helper.php +++ b/application/helpers/fhcauth_helper.php @@ -10,7 +10,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); require_once 'include/authentication.class.php'; /** diff --git a/application/helpers/fhcdb_helper.php b/application/helpers/fhcdb_helper.php index c5eee6800..fd170c462 100644 --- a/application/helpers/fhcdb_helper.php +++ b/application/helpers/fhcdb_helper.php @@ -10,7 +10,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); //require_once 'include/basis.class.php'; /** @@ -44,12 +44,12 @@ class basis_db //Connection Herstellen if (DB_CONNECT_PERSISTENT) { - if(!basis_db::$db_conn = pg_pconnect($conn_str)) + if (!basis_db::$db_conn = pg_pconnect($conn_str)) die('Fehler beim Oeffnen der Datenbankverbindung'); } else { - if(!basis_db::$db_conn = pg_connect($conn_str)) + if (!basis_db::$db_conn = pg_connect($conn_str)) die('Fehler beim Oeffnen der Datenbankverbindung'); } } @@ -67,7 +67,7 @@ class basis_db public function db_num_rows($result=null) { - if(is_null($result)) + if (is_null($result)) return pg_num_rows($this->db_result); else return pg_num_rows($result); @@ -75,16 +75,16 @@ class basis_db public function db_fetch_object($result = null, $i=null) { - if(is_null($result)) + if (is_null($result)) { - if(is_null($i)) + if (is_null($i)) return pg_fetch_object($this->db_result); else return pg_fetch_object($this->db_result, $i); } else { - if(is_null($i)) + if (is_null($i)) return pg_fetch_object($result); else return pg_fetch_object($result, $i); @@ -93,16 +93,16 @@ class basis_db public function db_fetch_row($result = null, $i=null) { - if(is_null($result)) + if (is_null($result)) { - if(is_null($i)) + if (is_null($i)) return pg_fetch_row($this->db_result); else return pg_fetch_row($this->db_result, $i); } else { - if(is_null($i)) + if (is_null($i)) return pg_fetch_row($result); else return pg_fetch_row($result, $i); @@ -111,16 +111,16 @@ class basis_db public function db_fetch_assoc($result = null, $i=null) { - if(is_null($result)) + if (is_null($result)) { - if(is_null($i)) + if (is_null($i)) return pg_fetch_assoc($this->db_result); else return pg_fetch_assoc($this->db_result, $i); } else { - if(is_null($i)) + if (is_null($i)) return pg_fetch_row($result); else return pg_fetch_row($result, $i); @@ -129,7 +129,7 @@ class basis_db public function db_result($result = null, $i,$item) { - if(is_null($result)) + if (is_null($result)) { return pg_result($this->db_result, $i,$item); } @@ -142,9 +142,9 @@ class basis_db public function db_getResultJSON($result = null) { $rows=array(); - if(is_null($result)) + if (is_null($result)) { - while($r = pg_fetch_assoc($this->db_result)) + while ($r = pg_fetch_assoc($this->db_result)) $rows[] = $r; //print json_encode($rows); @@ -153,7 +153,7 @@ class basis_db { pg_result_seek($result, 0); //var_dump($result); - while($r = pg_fetch_assoc($result)) + while ($r = pg_fetch_assoc($result)) { $rows[] = $r; } @@ -170,7 +170,7 @@ class basis_db public function db_affected_rows($result=null) { - if(is_null($result)) + if (is_null($result)) return pg_affected_rows($this->db_result); else return pg_affected_rows($result); @@ -178,7 +178,7 @@ class basis_db public function db_result_seek($result=null, $offset) { - if(is_null($result)) + if (is_null($result)) return pg_result_seek($this->db_result, $offset); else return pg_result_seek($result, $offset); @@ -186,7 +186,7 @@ class basis_db public function db_fetch_array($result=null) { - if(is_null($result)) + if (is_null($result)) return pg_fetch_array($this->db_result); else return pg_fetch_array($result); @@ -194,7 +194,7 @@ class basis_db public function db_num_fields($result=null) { - if(is_null($result)) + if (is_null($result)) return pg_num_fields($this->db_result); else return pg_num_fields($result); @@ -205,7 +205,7 @@ class basis_db */ public function db_field_name($result=null, $i) { - if(is_null($result)) + if (is_null($result)) return pg_field_name($this->db_result, $i); else return pg_field_name($result, $i); @@ -217,7 +217,7 @@ class basis_db */ public function db_free_result($result = null) { - if(is_null($result)) + if (is_null($result)) { return pg_free_result($this->db_result); } @@ -256,7 +256,7 @@ class basis_db */ public function db_null_value($var, $qoute=true) { - if($qoute) + if ($qoute) return ($var!==''?$this->db_qoute($var):'null'); else return ($var!==''?$var:'null'); @@ -288,9 +288,9 @@ class basis_db */ public function db_add_param($var, $type=FHC_STRING, $nullable=true) { - if(($var==='' || is_null($var)) && $type!=FHC_BOOLEAN) + if (($var==='' || is_null($var)) && $type!=FHC_BOOLEAN) { - if($nullable) + if ($nullable) return 'null'; else return "''"; @@ -300,7 +300,7 @@ class basis_db { case FHC_INTEGER: $var = $this->db_escape($var); - if(!is_numeric($var) && $var!=='') + if (!is_numeric($var) && $var!=='') die('Invalid Integer Parameter detected:'.$var); $var = $this->db_null_value($var, false); break; @@ -315,7 +315,7 @@ class basis_db foreach($languages as $sk => $sp) { - if(!$sp || !isset($buf[$sp])) + if (!$sp || !isset($buf[$sp])) $var[$sk] = ""; else $var[$sk] = $this->db_escape($buf[$sp]); @@ -327,11 +327,11 @@ class basis_db break; case FHC_BOOLEAN: - if($var===true) + if ($var===true) $var='true'; - elseif($var===false) + elseif ($var===false) $var='false'; - elseif($var=='' && $nullable) + elseif ($var=='' && $nullable) $var = 'null'; else die('Invalid Boolean Parameter detected'); @@ -351,11 +351,11 @@ class basis_db */ public function db_parse_bool($var) { - if($var=='t') + if ($var=='t') return true; - elseif($var=='f') + elseif ($var=='f') return false; - elseif($var=='') + elseif ($var=='') return ''; else die('Invalid DB Boolean. Wrong DB-Engine?'); @@ -370,7 +370,7 @@ class basis_db $string = ''; foreach($array as $row) { - if($string!='') + if ($string!='') $string.=','; $string.=$this->db_add_param($row); } @@ -439,7 +439,7 @@ function dbImplode4SQL($array) foreach($array as $row) { - if($string != '') + if ($string != '') { $string.=','; } diff --git a/application/language/de-AT/calendar_lang.php b/application/language/de-AT/calendar_lang.php index 8af5e8056..222f4f65b 100644 --- a/application/language/de-AT/calendar_lang.php +++ b/application/language/de-AT/calendar_lang.php @@ -35,7 +35,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['cal_su'] = 'Su'; $lang['cal_mo'] = 'Mo'; diff --git a/application/language/de-AT/date_lang.php b/application/language/de-AT/date_lang.php index 39af5a239..7ff441e0e 100644 --- a/application/language/de-AT/date_lang.php +++ b/application/language/de-AT/date_lang.php @@ -35,7 +35,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['date_year'] = 'Year'; $lang['date_years'] = 'Years'; diff --git a/application/language/de-AT/db_lang.php b/application/language/de-AT/db_lang.php index ed93452b4..91e2f41d3 100644 --- a/application/language/de-AT/db_lang.php +++ b/application/language/de-AT/db_lang.php @@ -35,7 +35,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['db_invalid_connection_str'] = 'Unable to determine the database settings based on the connection string you submitted.'; $lang['db_unable_to_connect'] = 'Unable to connect to your database server using the provided settings.'; diff --git a/application/language/de-AT/email_lang.php b/application/language/de-AT/email_lang.php index 84fb09109..1238962f8 100644 --- a/application/language/de-AT/email_lang.php +++ b/application/language/de-AT/email_lang.php @@ -35,7 +35,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['email_must_be_array'] = 'The email validation method must be passed an array.'; $lang['email_invalid_address'] = 'Invalid email address: %s'; diff --git a/application/language/de-AT/form_validation_lang.php b/application/language/de-AT/form_validation_lang.php index 92d6d5ebb..ff8ff4ec2 100644 --- a/application/language/de-AT/form_validation_lang.php +++ b/application/language/de-AT/form_validation_lang.php @@ -35,7 +35,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['form_validation_required'] = 'The {field} field is required.'; $lang['form_validation_isset'] = 'The {field} field must have a value.'; diff --git a/application/language/de-AT/ftp_lang.php b/application/language/de-AT/ftp_lang.php index 9e72bce42..a620e77d0 100644 --- a/application/language/de-AT/ftp_lang.php +++ b/application/language/de-AT/ftp_lang.php @@ -35,7 +35,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['ftp_no_connection'] = 'Unable to locate a valid connection ID. Please make sure you are connected before performing any file routines.'; $lang['ftp_unable_to_connect'] = 'Unable to connect to your FTP server using the supplied hostname.'; diff --git a/application/language/de-AT/imglib_lang.php b/application/language/de-AT/imglib_lang.php index 7f23233b4..a034efc0d 100644 --- a/application/language/de-AT/imglib_lang.php +++ b/application/language/de-AT/imglib_lang.php @@ -35,7 +35,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['imglib_source_image_required'] = 'You must specify a source image in your preferences.'; $lang['imglib_gd_required'] = 'The GD image library is required for this feature.'; diff --git a/application/language/de-AT/number_lang.php b/application/language/de-AT/number_lang.php index 0aaf51e72..197da7c2b 100644 --- a/application/language/de-AT/number_lang.php +++ b/application/language/de-AT/number_lang.php @@ -35,7 +35,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['terabyte_abbr'] = 'TB'; $lang['gigabyte_abbr'] = 'GB'; diff --git a/application/language/de-AT/pagination_lang.php b/application/language/de-AT/pagination_lang.php index 4d36bdee8..4953c219b 100644 --- a/application/language/de-AT/pagination_lang.php +++ b/application/language/de-AT/pagination_lang.php @@ -35,7 +35,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['pagination_first_link'] = '‹ First'; $lang['pagination_next_link'] = '>'; diff --git a/application/language/de-AT/profiler_lang.php b/application/language/de-AT/profiler_lang.php index 2d8fa51f4..b9cf41bed 100644 --- a/application/language/de-AT/profiler_lang.php +++ b/application/language/de-AT/profiler_lang.php @@ -35,7 +35,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['profiler_database'] = 'DATABASE'; $lang['profiler_controller_info'] = 'CLASS/METHOD'; diff --git a/application/language/de-AT/seed_lang.php b/application/language/de-AT/seed_lang.php index 0dd2e014c..42735e0e1 100644 --- a/application/language/de-AT/seed_lang.php +++ b/application/language/de-AT/seed_lang.php @@ -3,7 +3,7 @@ * FH-Complete * */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['seed_none_found'] = 'No seeds were found.'; $lang['seed_not_found'] = 'No seed could be found with the version number: %s.'; diff --git a/application/language/de-AT/unit_test_lang.php b/application/language/de-AT/unit_test_lang.php index 29a4137a5..bad094cbc 100644 --- a/application/language/de-AT/unit_test_lang.php +++ b/application/language/de-AT/unit_test_lang.php @@ -35,7 +35,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['ut_test_name'] = 'Test Name'; $lang['ut_test_datatype'] = 'Test Datatype'; diff --git a/application/language/de-AT/upload_lang.php b/application/language/de-AT/upload_lang.php index 058dca993..c2f7bffc2 100644 --- a/application/language/de-AT/upload_lang.php +++ b/application/language/de-AT/upload_lang.php @@ -35,7 +35,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['upload_userfile_not_set'] = 'Unable to find a post variable called userfile.'; $lang['upload_file_exceeds_limit'] = 'The uploaded file exceeds the maximum allowed size in your PHP configuration file.'; diff --git a/application/language/en-US/calendar_lang.php b/application/language/en-US/calendar_lang.php index 8af5e8056..222f4f65b 100644 --- a/application/language/en-US/calendar_lang.php +++ b/application/language/en-US/calendar_lang.php @@ -35,7 +35,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['cal_su'] = 'Su'; $lang['cal_mo'] = 'Mo'; diff --git a/application/language/en-US/date_lang.php b/application/language/en-US/date_lang.php index 39af5a239..7ff441e0e 100644 --- a/application/language/en-US/date_lang.php +++ b/application/language/en-US/date_lang.php @@ -35,7 +35,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['date_year'] = 'Year'; $lang['date_years'] = 'Years'; diff --git a/application/language/en-US/db_lang.php b/application/language/en-US/db_lang.php index ed93452b4..91e2f41d3 100644 --- a/application/language/en-US/db_lang.php +++ b/application/language/en-US/db_lang.php @@ -35,7 +35,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['db_invalid_connection_str'] = 'Unable to determine the database settings based on the connection string you submitted.'; $lang['db_unable_to_connect'] = 'Unable to connect to your database server using the provided settings.'; diff --git a/application/language/en-US/email_lang.php b/application/language/en-US/email_lang.php index 84fb09109..1238962f8 100644 --- a/application/language/en-US/email_lang.php +++ b/application/language/en-US/email_lang.php @@ -35,7 +35,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['email_must_be_array'] = 'The email validation method must be passed an array.'; $lang['email_invalid_address'] = 'Invalid email address: %s'; diff --git a/application/language/en-US/form_validation_lang.php b/application/language/en-US/form_validation_lang.php index 92d6d5ebb..ff8ff4ec2 100644 --- a/application/language/en-US/form_validation_lang.php +++ b/application/language/en-US/form_validation_lang.php @@ -35,7 +35,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['form_validation_required'] = 'The {field} field is required.'; $lang['form_validation_isset'] = 'The {field} field must have a value.'; diff --git a/application/language/en-US/ftp_lang.php b/application/language/en-US/ftp_lang.php index 9e72bce42..a620e77d0 100644 --- a/application/language/en-US/ftp_lang.php +++ b/application/language/en-US/ftp_lang.php @@ -35,7 +35,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['ftp_no_connection'] = 'Unable to locate a valid connection ID. Please make sure you are connected before performing any file routines.'; $lang['ftp_unable_to_connect'] = 'Unable to connect to your FTP server using the supplied hostname.'; diff --git a/application/language/en-US/imglib_lang.php b/application/language/en-US/imglib_lang.php index 7f23233b4..a034efc0d 100644 --- a/application/language/en-US/imglib_lang.php +++ b/application/language/en-US/imglib_lang.php @@ -35,7 +35,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['imglib_source_image_required'] = 'You must specify a source image in your preferences.'; $lang['imglib_gd_required'] = 'The GD image library is required for this feature.'; diff --git a/application/language/en-US/migration_lang.php b/application/language/en-US/migration_lang.php index bce9210d3..b067af819 100644 --- a/application/language/en-US/migration_lang.php +++ b/application/language/en-US/migration_lang.php @@ -35,7 +35,7 @@ * @since Version 3.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['migration_none_found'] = 'No migrations were found.'; $lang['migration_not_found'] = 'No migration could be found with the version number: %s.'; diff --git a/application/language/en-US/number_lang.php b/application/language/en-US/number_lang.php index 0aaf51e72..197da7c2b 100644 --- a/application/language/en-US/number_lang.php +++ b/application/language/en-US/number_lang.php @@ -35,7 +35,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['terabyte_abbr'] = 'TB'; $lang['gigabyte_abbr'] = 'GB'; diff --git a/application/language/en-US/pagination_lang.php b/application/language/en-US/pagination_lang.php index 4d36bdee8..4953c219b 100644 --- a/application/language/en-US/pagination_lang.php +++ b/application/language/en-US/pagination_lang.php @@ -35,7 +35,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['pagination_first_link'] = '‹ First'; $lang['pagination_next_link'] = '>'; diff --git a/application/language/en-US/profiler_lang.php b/application/language/en-US/profiler_lang.php index 2d8fa51f4..b9cf41bed 100644 --- a/application/language/en-US/profiler_lang.php +++ b/application/language/en-US/profiler_lang.php @@ -35,7 +35,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['profiler_database'] = 'DATABASE'; $lang['profiler_controller_info'] = 'CLASS/METHOD'; diff --git a/application/language/en-US/seed_lang.php b/application/language/en-US/seed_lang.php index 0dd2e014c..42735e0e1 100644 --- a/application/language/en-US/seed_lang.php +++ b/application/language/en-US/seed_lang.php @@ -3,7 +3,7 @@ * FH-Complete * */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['seed_none_found'] = 'No seeds were found.'; $lang['seed_not_found'] = 'No seed could be found with the version number: %s.'; diff --git a/application/language/en-US/unit_test_lang.php b/application/language/en-US/unit_test_lang.php index 29a4137a5..bad094cbc 100644 --- a/application/language/en-US/unit_test_lang.php +++ b/application/language/en-US/unit_test_lang.php @@ -35,7 +35,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['ut_test_name'] = 'Test Name'; $lang['ut_test_datatype'] = 'Test Datatype'; diff --git a/application/language/en-US/upload_lang.php b/application/language/en-US/upload_lang.php index 058dca993..c2f7bffc2 100644 --- a/application/language/en-US/upload_lang.php +++ b/application/language/en-US/upload_lang.php @@ -35,7 +35,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); $lang['upload_userfile_not_set'] = 'Unable to find a post variable called userfile.'; $lang['upload_file_exceeds_limit'] = 'The uploaded file exceeds the maximum allowed size in your PHP configuration file.'; diff --git a/application/libraries/FHC_Auth.php b/application/libraries/FHC_Auth.php index 83b76e755..255ff6b1d 100644 --- a/application/libraries/FHC_Auth.php +++ b/application/libraries/FHC_Auth.php @@ -10,7 +10,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); require_once FCPATH.'include/authentication.class.php'; require_once FCPATH.'include/AddonAuthentication.php'; @@ -38,7 +38,7 @@ class FHC_Auth public function basicAuthentication($username, $password) { $auth = new authentication(); - if($auth->checkpassword($username, $password)) + if ($auth->checkpassword($username, $password)) { return true; } diff --git a/application/libraries/FHC_DB_ACL.php b/application/libraries/FHC_DB_ACL.php index 803d09683..702b193e7 100644 --- a/application/libraries/FHC_DB_ACL.php +++ b/application/libraries/FHC_DB_ACL.php @@ -10,7 +10,9 @@ * @since Version 1.0.0 * @filesource */ -defined('FCPATH') OR exit('No direct script access allowed'); +if (! defined('FCPATH')) + exit('No direct script access allowed'); + require_once(FCPATH.'include/basis_db.class.php'); require_once(FCPATH.'include/organisationseinheit.class.php'); require_once(FCPATH.'include/studiengang.class.php'); @@ -43,9 +45,11 @@ class FHC_DB_ACL * @param string $password * @return bool */ - function __construct() + function __construct($param = null) { $this->bb = new benutzerberechtigung(); + if (is_array($param) && isset($param['uid'])) + $this->_uid = $param['uid']; } function isBerechtigt($berechtigung_kurzbz, $art=null, $oe_kurzbz=null, $kostenstelle_id=null) @@ -64,4 +68,4 @@ class FHC_DB_ACL { return $this->_uid = $uid; } -} \ No newline at end of file +} diff --git a/application/libraries/FHC_Seed.php b/application/libraries/FHC_Seed.php index a7944bb74..065a19259 100644 --- a/application/libraries/FHC_Seed.php +++ b/application/libraries/FHC_Seed.php @@ -10,7 +10,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +if (! defined('BASEPATH')) exit('No direct script access allowed'); /** * FHC-Seed Library diff --git a/application/libraries/Format.php b/application/libraries/Format.php index 0d3bf7732..0f7ea4a87 100644 --- a/application/libraries/Format.php +++ b/application/libraries/Format.php @@ -1,6 +1,6 @@ display_as[$field_info->name] : ucfirst(str_replace("_"," ",$field_info->name)); - if($this->change_field_type !== null && isset($this->change_field_type[$field_info->name])) + if ($this->change_field_type !== null && isset($this->change_field_type[$field_info->name])) { $field_type = $this->change_field_type[$field_info->name]; @@ -70,12 +70,12 @@ class grocery_CRUD_Field_Types $real_type = $field_info->crud_type; } - elseif(isset($this->relation[$field_info->name])) + elseif (isset($this->relation[$field_info->name])) { $real_type = 'relation'; $field_info->crud_type = 'relation'; } - elseif(isset($this->upload_fields[$field_info->name])) + elseif (isset($this->upload_fields[$field_info->name])) { $real_type = 'upload_file'; $field_info->crud_type = 'upload_file'; @@ -88,7 +88,7 @@ class grocery_CRUD_Field_Types switch ($real_type) { case 'text': - if(!empty($this->unset_texteditor) && in_array($field_info->name,$this->unset_texteditor)) + if (!empty($this->unset_texteditor) && in_array($field_info->name,$this->unset_texteditor)) $field_info->extras = false; else $field_info->extras = 'text_editor'; @@ -105,7 +105,7 @@ class grocery_CRUD_Field_Types break; default: - if(empty($field_info->extras)) + if (empty($field_info->extras)) $field_info->extras = false; break; } @@ -113,7 +113,7 @@ class grocery_CRUD_Field_Types $types[$field_info->name] = $field_info; } - if(!empty($this->relation_n_n)) + if (!empty($this->relation_n_n)) { foreach($this->relation_n_n as $field_name => $field_extras) { @@ -135,15 +135,15 @@ class grocery_CRUD_Field_Types } } - if(!empty($this->add_fields)) + if (!empty($this->add_fields)) foreach($this->add_fields as $field_object) { $field_name = isset($field_object->field_name) ? $field_object->field_name : $field_object; - if(!isset($types[$field_name]))//Doesn't exist in the database? Create it for the CRUD + if (!isset($types[$field_name]))//Doesn't exist in the database? Create it for the CRUD { $extras = false; - if($this->change_field_type !== null && isset($this->change_field_type[$field_name])) + if ($this->change_field_type !== null && isset($this->change_field_type[$field_name])) { $field_type = $this->change_field_type[$field_name]; $extras = $field_type->extras; @@ -165,15 +165,15 @@ class grocery_CRUD_Field_Types } } - if(!empty($this->edit_fields)) + if (!empty($this->edit_fields)) foreach($this->edit_fields as $field_object) { $field_name = isset($field_object->field_name) ? $field_object->field_name : $field_object; - if(!isset($types[$field_name]))//Doesn't exist in the database? Create it for the CRUD + if (!isset($types[$field_name]))//Doesn't exist in the database? Create it for the CRUD { $extras = false; - if($this->change_field_type !== null && isset($this->change_field_type[$field_name])) + if ($this->change_field_type !== null && isset($this->change_field_type[$field_name])) { $field_type = $this->change_field_type[$field_name]; $extras = $field_type->extras; @@ -264,9 +264,9 @@ class grocery_CRUD_Field_Types break; case 'true_false': - if(is_array($field_info->extras) && array_key_exists($value,$field_info->extras)) { + if (is_array($field_info->extras) && array_key_exists($value,$field_info->extras)) { $value = $field_info->extras[$value]; - } else if(isset($this->default_true_false_text[$value])) { + } else if (isset($this->default_true_false_text[$value])) { $value = $this->default_true_false_text[$value]; } break; @@ -277,7 +277,7 @@ class grocery_CRUD_Field_Types $value = $this->character_limiter(strip_tags($value),$this->character_limiter,"..."); break; case 'date': - if(!empty($value) && $value != '0000-00-00' && $value != '1970-01-01') + if (!empty($value) && $value != '0000-00-00' && $value != '1970-01-01') { list($year,$month,$day) = explode("-",$value); @@ -289,7 +289,7 @@ class grocery_CRUD_Field_Types } break; case 'datetime': - if(!empty($value) && $value != '0000-00-00 00:00:00' && $value != '1970-01-01 00:00:00') + if (!empty($value) && $value != '0000-00-00 00:00:00' && $value != '1970-01-01 00:00:00') { list($year,$month,$day) = explode("-",$value); list($hours,$minutes) = explode(":",substr($value,11)); @@ -327,7 +327,7 @@ class grocery_CRUD_Field_Types break; case 'upload_file': - if(empty($value)) + if (empty($value)) { $value = ""; } @@ -344,7 +344,7 @@ class grocery_CRUD_Field_Types $file_url = base_url().$field_info->extras->upload_path."/$value"; $file_url_anchor = ''; } @@ -409,7 +409,7 @@ class grocery_CRUD_Field_Types protected function get_type($db_type) { $type = false; - if(!empty($db_type->type)) + if (!empty($db_type->type)) { switch ($db_type->type) { case '1': @@ -418,7 +418,7 @@ class grocery_CRUD_Field_Types case 'tinyint': case 'mediumint': case 'longint': - if( $db_type->db_type == 'tinyint' && $db_type->db_max_length == 1) + if ( $db_type->db_type == 'tinyint' && $db_type->db_max_length == 1) $type = 'true_false'; else $type = 'integer'; @@ -426,13 +426,13 @@ class grocery_CRUD_Field_Types case '254': case 'string': case 'enum': - if($db_type->db_type != 'enum') + if ($db_type->db_type != 'enum') $type = 'string'; else $type = 'enum'; break; case 'set': - if($db_type->db_type != 'set') + if ($db_type->db_type != 'set') $type = 'string'; else $type = 'set'; @@ -488,41 +488,41 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types protected function get_total_results() { - if(!empty($this->where)) + if (!empty($this->where)) foreach($this->where as $where) $this->basic_model->where($where[0],$where[1],$where[2]); - if(!empty($this->or_where)) + if (!empty($this->or_where)) foreach($this->or_where as $or_where) $this->basic_model->or_where($or_where[0],$or_where[1],$or_where[2]); - if(!empty($this->like)) + if (!empty($this->like)) foreach($this->like as $like) $this->basic_model->like($like[0],$like[1],$like[2]); - if(!empty($this->or_like)) + if (!empty($this->or_like)) foreach($this->or_like as $or_like) $this->basic_model->or_like($or_like[0],$or_like[1],$or_like[2]); - if(!empty($this->having)) + if (!empty($this->having)) foreach($this->having as $having) $this->basic_model->having($having[0],$having[1],$having[2]); - if(!empty($this->or_having)) + if (!empty($this->or_having)) foreach($this->or_having as $or_having) $this->basic_model->or_having($or_having[0],$or_having[1],$or_having[2]); - if(!empty($this->relation)) + if (!empty($this->relation)) foreach($this->relation as $relation) $this->basic_model->join_relation($relation[0],$relation[1],$relation[2]); - if(!empty($this->relation_n_n)) + if (!empty($this->relation_n_n)) { $columns = $this->get_columns(); foreach($columns as $column) { //Use the relation_n_n ONLY if the column is called . The set_relation_n_n are slow and it will make the table slower without any reason as we don't need those queries. - if(isset($this->relation_n_n[$column->field_name])) + if (isset($this->relation_n_n[$column->field_name])) { $this->basic_model->set_relation_n_n_field($this->relation_n_n[$column->field_name]); } @@ -553,9 +553,9 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types protected function set_ajax_list_queries($state_info = null) { - if(!empty($state_info->per_page)) + if (!empty($state_info->per_page)) { - if(empty($state_info->page) || !is_numeric($state_info->page) ) + if (empty($state_info->page) || !is_numeric($state_info->page) ) $this->limit($state_info->per_page); else { @@ -564,12 +564,12 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types } } - if(!empty($state_info->order_by)) + if (!empty($state_info->order_by)) { $this->order_by($state_info->order_by[0],$state_info->order_by[1]); } - if(!empty($state_info->search)) + if (!empty($state_info->search)) { if (!empty($this->relation)) { foreach ($this->relation as $relation_name => $relation_values) { @@ -589,7 +589,7 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types } else { $this->like($temp_relation[$search_field] , $search_text); } - } elseif(isset($this->relation_n_n[$search_field])) { + } elseif (isset($this->relation_n_n[$search_field])) { $escaped_text = $this->basic_model->escape_str($search_text); $this->having($search_field." LIKE '%".$escaped_text."%'"); } else { @@ -608,7 +608,7 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types } else { $this->like($temp_relation[$state_info->search->field] , $state_info->search->text); } - } elseif(isset($this->relation_n_n[$state_info->search->field])) { + } elseif (isset($this->relation_n_n[$state_info->search->field])) { $escaped_text = $this->basic_model->escape_str($state_info->search->text); $this->having($state_info->search->field." LIKE '%".$escaped_text."%'"); } else { @@ -621,15 +621,15 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types $search_text = $state_info->search->text; - if(!empty($this->where)) + if (!empty($this->where)) foreach($this->where as $where) $this->basic_model->having($where[0],$where[1],$where[2]); foreach($columns as $column) { - if(isset($temp_relation[$column->field_name])) + if (isset($temp_relation[$column->field_name])) { - if(is_array($temp_relation[$column->field_name])) + if (is_array($temp_relation[$column->field_name])) { foreach($temp_relation[$column->field_name] as $search_field) { @@ -641,7 +641,7 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types $this->or_like($temp_relation[$column->field_name], $search_text); } } - elseif(isset($this->relation_n_n[$column->field_name])) + elseif (isset($this->relation_n_n[$column->field_name])) { //@todo have a where for the relation_n_n statement } @@ -656,7 +656,7 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types protected function table_exists($table_name = null) { - if($this->basic_model->db_table_exists($table_name)) + if ($this->basic_model->db_table_exists($table_name)) return true; return false; } @@ -665,7 +665,7 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types { list($field_name , $related_table , $related_field_title, $where_clause, $order_by) = $relation_info; - if($primary_key_value !== null) + if ($primary_key_value !== null) { $primary_key = $this->basic_model->get_primary_key($related_table); @@ -696,12 +696,12 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types $unique_fields = $this->_unique_fields; $add_fields = $this->get_add_fields(); - if(!empty($required_fields)) + if (!empty($required_fields)) { foreach($add_fields as $add_field) { $field_name = $add_field->field_name; - if(!isset($this->validation_rules[$field_name]) && in_array( $field_name, $required_fields) ) + if (!isset($this->validation_rules[$field_name]) && in_array( $field_name, $required_fields) ) { $this->set_rules( $field_name, $field_types[$field_name]->display_as, 'required'); } @@ -710,14 +710,14 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types /** Checking for unique fields. If the field value is not unique then * return a validation error straight away, if not continue... */ - if(!empty($unique_fields)) + if (!empty($unique_fields)) { $form_validation = $this->form_validation(); foreach($add_fields as $add_field) { $field_name = $add_field->field_name; - if(in_array( $field_name, $unique_fields) ) + if (in_array( $field_name, $unique_fields) ) { $form_validation->set_rules( $field_name, $field_types[$field_name]->display_as, @@ -725,7 +725,7 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types } } - if(!$form_validation->run()) + if (!$form_validation->run()) { $validation_result->error_message = $form_validation->error_string(); $validation_result->error_fields = $form_validation->_error_array; @@ -734,7 +734,7 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types } } - if(!empty($this->validation_rules)) + if (!empty($this->validation_rules)) { $form_validation = $this->form_validation(); @@ -743,14 +743,14 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types foreach($add_fields as $add_field) { $field_name = $add_field->field_name; - if(isset($this->validation_rules[$field_name])) + if (isset($this->validation_rules[$field_name])) { $rule = $this->validation_rules[$field_name]; $form_validation->set_rules($rule['field'],$rule['label'],$rule['rules']); } } - if($form_validation->run()) + if ($form_validation->run()) { $validation_result->success = true; } @@ -770,7 +770,7 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types protected function form_validation() { - if($this->form_validation === null) + if ($this->form_validation === null) { $this->form_validation = new grocery_CRUD_Form_validation(); $ci = &get_instance(); @@ -789,12 +789,12 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types $unique_fields = $this->_unique_fields; $edit_fields = $this->get_edit_fields(); - if(!empty($required_fields)) + if (!empty($required_fields)) { foreach($edit_fields as $edit_field) { $field_name = $edit_field->field_name; - if(!isset($this->validation_rules[$field_name]) && in_array( $field_name, $required_fields) ) + if (!isset($this->validation_rules[$field_name]) && in_array( $field_name, $required_fields) ) { $this->set_rules( $field_name, $field_types[$field_name]->display_as, 'required'); } @@ -804,7 +804,7 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types /** Checking for unique fields. If the field value is not unique then * return a validation error straight away, if not continue... */ - if(!empty($unique_fields)) + if (!empty($unique_fields)) { $form_validation = $this->form_validation(); @@ -813,7 +813,7 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types foreach($edit_fields as $edit_field) { $field_name = $edit_field->field_name; - if(in_array( $field_name, $unique_fields) ) + if (in_array( $field_name, $unique_fields) ) { $state_info = $this->getStateInfo(); $primary_key = $this->get_primary_key(); @@ -822,7 +822,7 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types $this->basic_model->where($primary_key,$state_info->primary_key); $row = $this->basic_model->get_row(); - if(!isset($row->$field_name)) { + if (!isset($row->$field_name)) { throw new Exception("The field name doesn't exist in the database. ". "Please use the unique fields only for fields ". "that exist in the database"); @@ -830,7 +830,7 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types $previous_field_name_value = $row->$field_name; - if(!empty($previous_field_name_value) && $previous_field_name_value != $field_name_value) { + if (!empty($previous_field_name_value) && $previous_field_name_value != $field_name_value) { $form_validation->set_rules( $field_name, $field_types[$field_name]->display_as, 'is_unique['.$this->basic_db_table.'.'.$field_name.']'); @@ -840,7 +840,7 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types } } - if($form_validation_check && !$form_validation->run()) + if ($form_validation_check && !$form_validation->run()) { $validation_result->error_message = $form_validation->error_string(); $validation_result->error_fields = $form_validation->_error_array; @@ -849,7 +849,7 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types } } - if(!empty($this->validation_rules)) + if (!empty($this->validation_rules)) { $form_validation = $this->form_validation(); @@ -858,14 +858,14 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types foreach($edit_fields as $edit_field) { $field_name = $edit_field->field_name; - if(isset($this->validation_rules[$field_name])) + if (isset($this->validation_rules[$field_name])) { $rule = $this->validation_rules[$field_name]; $form_validation->set_rules($rule['field'],$rule['label'],$rule['rules']); } } - if($form_validation->run()) + if ($form_validation->run()) { $validation_result->success = true; } @@ -887,21 +887,21 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types { $validation_result = $this->db_insert_validation(); - if($validation_result->success) + if ($validation_result->success) { $post_data = $state_info->unwrapped_data; $add_fields = $this->get_add_fields(); - if($this->callback_insert === null) + if ($this->callback_insert === null) { - if($this->callback_before_insert !== null) + if ($this->callback_before_insert !== null) { $callback_return = call_user_func($this->callback_before_insert, $post_data); - if(!empty($callback_return) && is_array($callback_return)) + if (!empty($callback_return) && is_array($callback_return)) $post_data = $callback_return; - elseif($callback_return === false) + elseif ($callback_return === false) return false; } @@ -910,34 +910,34 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types foreach($add_fields as $num_row => $field) { /* If the multiselect or the set is empty then the browser doesn't send an empty array. Instead it sends nothing */ - if(isset($types[$field->field_name]->crud_type) && ($types[$field->field_name]->crud_type == 'set' || $types[$field->field_name]->crud_type == 'multiselect') && !isset($post_data[$field->field_name])) + if (isset($types[$field->field_name]->crud_type) && ($types[$field->field_name]->crud_type == 'set' || $types[$field->field_name]->crud_type == 'multiselect') && !isset($post_data[$field->field_name])) { $post_data[$field->field_name] = array(); } - if(isset($post_data[$field->field_name]) && !isset($this->relation_n_n[$field->field_name])) + if (isset($post_data[$field->field_name]) && !isset($this->relation_n_n[$field->field_name])) { - if(isset($types[$field->field_name]->db_null) && $types[$field->field_name]->db_null && is_array($post_data[$field->field_name]) && empty($post_data[$field->field_name])) + if (isset($types[$field->field_name]->db_null) && $types[$field->field_name]->db_null && is_array($post_data[$field->field_name]) && empty($post_data[$field->field_name])) { $insert_data[$field->field_name] = null; } - elseif(isset($types[$field->field_name]->db_null) && $types[$field->field_name]->db_null && $post_data[$field->field_name] === '') + elseif (isset($types[$field->field_name]->db_null) && $types[$field->field_name]->db_null && $post_data[$field->field_name] === '') { $insert_data[$field->field_name] = null; } - elseif(isset($types[$field->field_name]->crud_type) && $types[$field->field_name]->crud_type == 'date') + elseif (isset($types[$field->field_name]->crud_type) && $types[$field->field_name]->crud_type == 'date') { $insert_data[$field->field_name] = $this->_convert_date_to_sql_date($post_data[$field->field_name]); } - elseif(isset($types[$field->field_name]->crud_type) && $types[$field->field_name]->crud_type == 'readonly') + elseif (isset($types[$field->field_name]->crud_type) && $types[$field->field_name]->crud_type == 'readonly') { //This empty if statement is to make sure that a readonly field will never inserted/updated } - elseif(isset($types[$field->field_name]->crud_type) && ($types[$field->field_name]->crud_type == 'set' || $types[$field->field_name]->crud_type == 'multiselect')) + elseif (isset($types[$field->field_name]->crud_type) && ($types[$field->field_name]->crud_type == 'set' || $types[$field->field_name]->crud_type == 'multiselect')) { $insert_data[$field->field_name] = !empty($post_data[$field->field_name]) ? implode(',',$post_data[$field->field_name]) : ''; } - elseif(isset($types[$field->field_name]->crud_type) && $types[$field->field_name]->crud_type == 'datetime'){ + elseif (isset($types[$field->field_name]->crud_type) && $types[$field->field_name]->crud_type == 'datetime'){ $insert_data[$field->field_name] = $this->_convert_date_to_sql_date(substr($post_data[$field->field_name],0,10)). substr($post_data[$field->field_name],10); } @@ -950,7 +950,7 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types $insert_result = $this->basic_model->db_insert($insert_data); - if($insert_result !== false) + if ($insert_result !== false) { $insert_primary_key = $insert_result; } @@ -959,7 +959,7 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types return false; } - if(!empty($this->relation_n_n)) + if (!empty($this->relation_n_n)) { foreach($this->relation_n_n as $field_name => $field_info) { @@ -968,11 +968,11 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types } } - if($this->callback_after_insert !== null) + if ($this->callback_after_insert !== null) { $callback_return = call_user_func($this->callback_after_insert, $post_data, $insert_primary_key); - if($callback_return === false) + if ($callback_return === false) { return false; } @@ -982,13 +982,13 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types { $callback_return = call_user_func($this->callback_insert, $post_data); - if($callback_return === false) + if ($callback_return === false) { return false; } } - if(isset($insert_primary_key)) + if (isset($insert_primary_key)) return $insert_primary_key; else return true; @@ -1004,22 +1004,22 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types $edit_fields = $this->get_edit_fields(); - if($validation_result->success) + if ($validation_result->success) { $post_data = $state_info->unwrapped_data; $primary_key = $state_info->primary_key; - if($this->callback_update === null) + if ($this->callback_update === null) { - if($this->callback_before_update !== null) + if ($this->callback_before_update !== null) { $callback_return = call_user_func($this->callback_before_update, $post_data, $primary_key); - if(!empty($callback_return) && is_array($callback_return)) + if (!empty($callback_return) && is_array($callback_return)) { $post_data = $callback_return; } - elseif($callback_return === false) + elseif ($callback_return === false) { return false; } @@ -1031,34 +1031,34 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types foreach($edit_fields as $num_row => $field) { /* If the multiselect or the set is empty then the browser doesn't send an empty array. Instead it sends nothing */ - if(isset($types[$field->field_name]->crud_type) && ($types[$field->field_name]->crud_type == 'set' || $types[$field->field_name]->crud_type == 'multiselect') && !isset($post_data[$field->field_name])) + if (isset($types[$field->field_name]->crud_type) && ($types[$field->field_name]->crud_type == 'set' || $types[$field->field_name]->crud_type == 'multiselect') && !isset($post_data[$field->field_name])) { $post_data[$field->field_name] = array(); } - if(isset($post_data[$field->field_name]) && !isset($this->relation_n_n[$field->field_name])) + if (isset($post_data[$field->field_name]) && !isset($this->relation_n_n[$field->field_name])) { - if(isset($types[$field->field_name]->db_null) && $types[$field->field_name]->db_null && is_array($post_data[$field->field_name]) && empty($post_data[$field->field_name])) + if (isset($types[$field->field_name]->db_null) && $types[$field->field_name]->db_null && is_array($post_data[$field->field_name]) && empty($post_data[$field->field_name])) { $update_data[$field->field_name] = null; } - elseif(isset($types[$field->field_name]->db_null) && $types[$field->field_name]->db_null && $post_data[$field->field_name] === '') + elseif (isset($types[$field->field_name]->db_null) && $types[$field->field_name]->db_null && $post_data[$field->field_name] === '') { $update_data[$field->field_name] = null; } - elseif(isset($types[$field->field_name]->crud_type) && $types[$field->field_name]->crud_type == 'date') + elseif (isset($types[$field->field_name]->crud_type) && $types[$field->field_name]->crud_type == 'date') { $update_data[$field->field_name] = $this->_convert_date_to_sql_date($post_data[$field->field_name]); } - elseif(isset($types[$field->field_name]->crud_type) && $types[$field->field_name]->crud_type == 'readonly') + elseif (isset($types[$field->field_name]->crud_type) && $types[$field->field_name]->crud_type == 'readonly') { //This empty if statement is to make sure that a readonly field will never inserted/updated } - elseif(isset($types[$field->field_name]->crud_type) && ($types[$field->field_name]->crud_type == 'set' || $types[$field->field_name]->crud_type == 'multiselect')) + elseif (isset($types[$field->field_name]->crud_type) && ($types[$field->field_name]->crud_type == 'set' || $types[$field->field_name]->crud_type == 'multiselect')) { $update_data[$field->field_name] = !empty($post_data[$field->field_name]) ? implode(',',$post_data[$field->field_name]) : ''; } - elseif(isset($types[$field->field_name]->crud_type) && $types[$field->field_name]->crud_type == 'datetime'){ + elseif (isset($types[$field->field_name]->crud_type) && $types[$field->field_name]->crud_type == 'datetime'){ $update_data[$field->field_name] = $this->_convert_date_to_sql_date(substr($post_data[$field->field_name],0,10)). substr($post_data[$field->field_name],10); } @@ -1069,12 +1069,12 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types } } - if($this->basic_model->db_update($update_data, $primary_key) === false) + if ($this->basic_model->db_update($update_data, $primary_key) === false) { return false; } - if(!empty($this->relation_n_n)) + if (!empty($this->relation_n_n)) { foreach($this->relation_n_n as $field_name => $field_info) { @@ -1090,11 +1090,11 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types } } - if($this->callback_after_update !== null) + if ($this->callback_after_update !== null) { $callback_return = call_user_func($this->callback_after_update, $post_data, $primary_key); - if($callback_return === false) + if ($callback_return === false) { return false; } @@ -1105,7 +1105,7 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types { $callback_return = call_user_func($this->callback_update, $post_data, $primary_key); - if($callback_return === false) + if ($callback_return === false) { return false; } @@ -1122,21 +1122,21 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types protected function _convert_date_to_sql_date($date) { $date = substr($date,0,10); - if(preg_match('/\d{4}-\d{2}-\d{2}/',$date)) + if (preg_match('/\d{4}-\d{2}-\d{2}/',$date)) { //If it's already a sql-date don't convert it! return $date; - }elseif(empty($date)) + }elseif (empty($date)) { return ''; } $date_array = preg_split( '/[-\.\/ ]/', $date); - if($this->php_date_format == 'd/m/Y') + if ($this->php_date_format == 'd/m/Y') { $sql_date = date('Y-m-d',mktime(0,0,0,$date_array[1],$date_array[0],$date_array[2])); } - elseif($this->php_date_format == 'm/d/Y') + elseif ($this->php_date_format == 'm/d/Y') { $sql_date = date('Y-m-d',mktime(0,0,0,$date_array[0],$date_array[1],$date_array[2])); } @@ -1150,7 +1150,7 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types protected function _get_field_names_to_search(array $relation_values) { - if(!strstr($relation_values[2],'{')) + if (!strstr($relation_values[2],'{')) return $this->_unique_join_name($relation_values[0]).'.'.$relation_values[2]; else { @@ -1192,20 +1192,20 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types { $primary_key_value = $state_info->primary_key; - if($this->callback_delete === null) + if ($this->callback_delete === null) { - if($this->callback_before_delete !== null) + if ($this->callback_before_delete !== null) { $callback_return = call_user_func($this->callback_before_delete, $primary_key_value); - if($callback_return === false) + if ($callback_return === false) { return false; } } - if(!empty($this->relation_n_n)) + if (!empty($this->relation_n_n)) { foreach($this->relation_n_n as $field_name => $field_info) { @@ -1215,16 +1215,16 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types $delete_result = $this->basic_model->db_delete($primary_key_value); - if($delete_result === false) + if ($delete_result === false) { return false; } - if($this->callback_after_delete !== null) + if ($this->callback_after_delete !== null) { $callback_return = call_user_func($this->callback_after_delete, $primary_key_value); - if($callback_return === false) + if ($callback_return === false) { return false; } @@ -1235,7 +1235,7 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types { $callback_return = call_user_func($this->callback_delete, $primary_key_value); - if($callback_return === false) + if ($callback_return === false) { return false; } @@ -1256,44 +1256,44 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types protected function get_list() { - if(!empty($this->order_by)) + if (!empty($this->order_by)) $this->basic_model->order_by($this->order_by[0],$this->order_by[1]); - if(!empty($this->where)) + if (!empty($this->where)) foreach($this->where as $where) $this->basic_model->where($where[0],$where[1],$where[2]); - if(!empty($this->or_where)) + if (!empty($this->or_where)) foreach($this->or_where as $or_where) $this->basic_model->or_where($or_where[0],$or_where[1],$or_where[2]); - if(!empty($this->like)) + if (!empty($this->like)) foreach($this->like as $like) $this->basic_model->like($like[0],$like[1],$like[2]); - if(!empty($this->or_like)) + if (!empty($this->or_like)) foreach($this->or_like as $or_like) $this->basic_model->or_like($or_like[0],$or_like[1],$or_like[2]); - if(!empty($this->having)) + if (!empty($this->having)) foreach($this->having as $having) $this->basic_model->having($having[0],$having[1],$having[2]); - if(!empty($this->or_having)) + if (!empty($this->or_having)) foreach($this->or_having as $or_having) $this->basic_model->or_having($or_having[0],$or_having[1],$or_having[2]); - if(!empty($this->relation)) + if (!empty($this->relation)) foreach($this->relation as $relation) $this->basic_model->join_relation($relation[0],$relation[1],$relation[2]); - if(!empty($this->relation_n_n)) + if (!empty($this->relation_n_n)) { $columns = $this->get_columns(); foreach($columns as $column) { //Use the relation_n_n ONLY if the column is called . The set_relation_n_n are slow and it will make the table slower without any reason as we don't need those queries. - if(isset($this->relation_n_n[$column->field_name])) + if (isset($this->relation_n_n[$column->field_name])) { $this->basic_model->set_relation_n_n_field($this->relation_n_n[$column->field_name]); } @@ -1301,12 +1301,12 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types } - if($this->theme_config['crud_paging'] === true) + if ($this->theme_config['crud_paging'] === true) { - if($this->limit === null) + if ($this->limit === null) { $default_per_page = $this->config->default_per_page; - if(is_numeric($default_per_page) && $default_per_page >1) + if (is_numeric($default_per_page) && $default_per_page >1) { $this->basic_model->limit($default_per_page); } @@ -1330,7 +1330,7 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types { $values = $this->basic_model->get_edit_values($primary_key_value); - if(!empty($this->relation_n_n)) + if (!empty($this->relation_n_n)) { foreach($this->relation_n_n as $field_name => $field_info) { @@ -1358,17 +1358,17 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types protected function upload_file($state_info) { - if(isset($this->upload_fields[$state_info->field_name]) ) + if (isset($this->upload_fields[$state_info->field_name]) ) { - if($this->callback_upload === null) + if ($this->callback_upload === null) { - if($this->callback_before_upload !== null) + if ($this->callback_before_upload !== null) { $callback_before_upload_response = call_user_func($this->callback_before_upload, $_FILES, $this->upload_fields[$state_info->field_name]); - if($callback_before_upload_response === false) + if ($callback_before_upload_response === false) return false; - elseif(is_string($callback_before_upload_response)) + elseif (is_string($callback_before_upload_response)) return $callback_before_upload_response; } @@ -1385,7 +1385,7 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types $allowed_files = $this->config->file_upload_allow_file_types; $reg_exp = ''; - if(!empty($upload_info->allowed_file_types)){ + if (!empty($upload_info->allowed_file_types)){ $reg_exp = '/(\\.|\\/)('.$upload_info->allowed_file_types.')$/i'; }else{ $reg_exp = '/(\\.|\\/)('.$allowed_files.')$/i'; @@ -1405,7 +1405,7 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types $upload_handler->default_config_path = $this->default_config_path; $uploader_response = $upload_handler->post(); - if(is_array($uploader_response)) + if (is_array($uploader_response)) { foreach($uploader_response as &$response) { @@ -1414,15 +1414,15 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types } } - if($this->callback_after_upload !== null) + if ($this->callback_after_upload !== null) { $callback_after_upload_response = call_user_func($this->callback_after_upload, $uploader_response , $this->upload_fields[$state_info->field_name] , $_FILES ); - if($callback_after_upload_response === false) + if ($callback_after_upload_response === false) return false; - elseif(is_string($callback_after_upload_response)) + elseif (is_string($callback_after_upload_response)) return $callback_after_upload_response; - elseif(is_array($callback_after_upload_response)) + elseif (is_array($callback_after_upload_response)) $uploader_response = $callback_after_upload_response; } @@ -1432,7 +1432,7 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types { $upload_response = call_user_func($this->callback_upload, $_FILES, $this->upload_fields[$state_info->field_name] ); - if($upload_response === false) + if ($upload_response === false) { return false; } @@ -1451,13 +1451,13 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types protected function delete_file($state_info) { - if(isset($state_info->field_name) && isset($this->upload_fields[$state_info->field_name])) + if (isset($state_info->field_name) && isset($this->upload_fields[$state_info->field_name])) { $upload_info = $this->upload_fields[$state_info->field_name]; - if(file_exists("{$upload_info->upload_path}/{$state_info->file_name}")) + if (file_exists("{$upload_info->upload_path}/{$state_info->file_name}")) { - if( unlink("{$upload_info->upload_path}/{$state_info->file_name}") ) + if ( unlink("{$upload_info->upload_path}/{$state_info->file_name}") ) { $this->basic_model->db_file_delete($state_info->field_name, $state_info->file_name); @@ -1482,7 +1482,7 @@ class grocery_CRUD_Model_Driver extends grocery_CRUD_Field_Types protected function ajax_relation($state_info) { - if(!isset($this->relation[$state_info->field_name])) + if (!isset($this->relation[$state_info->field_name])) return false; list($field_name, $related_table, $related_field_title, $where_clause, $order_by) = $this->relation[$state_info->field_name]; @@ -1536,7 +1536,7 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver { //var_dump($this->theme_path); //var_dump($this->theme); - if(!file_exists($this->theme_path.$this->theme.'/views/list_template.php')) + if (!file_exists($this->theme_path.$this->theme.'/views/list_template.php')) { throw new Exception('The template does not exist. Please check your files and try again.', 12); die(); @@ -1586,7 +1586,7 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver $data->paging_options = $this->config->paging_options; $data->default_per_page = is_numeric($default_per_page) && $default_per_page >1 && in_array($default_per_page,$data->paging_options)? $default_per_page : 25; - if($data->list === false) + if ($data->list === false) { throw new Exception('It is impossible to get data. Please check your model and try again.', 13); $data->list = array(); @@ -1600,7 +1600,7 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver $data->list[$num_row]->read_url = $data->read_url.'/'.$row->{$data->primary_key}; } - if(!$ajax) + if (!$ajax) { $this->_add_js_vars(array('dialog_forms' => $this->config->dialog_forms)); @@ -1728,7 +1728,7 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver $value = str_replace(array(" ","&",">","<"),array(" ","&",">","<"),$value); //If the value has only spaces and nothing more then add the whitespace html character - if(str_replace(" ","",$value) == "") + if (str_replace(" ","",$value) == "") $value = " "; return strip_tags($value); @@ -1756,7 +1756,7 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver protected function change_list_add_actions($list) { - if(empty($this->actions)) + if (empty($this->actions)) return $list; $primary_key = $this->get_primary_key(); @@ -1766,7 +1766,7 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver $actions_urls = array(); foreach($this->actions as $unique_id => $action) { - if(!empty($action->url_callback)) + if (!empty($action->url_callback)) { $actions_urls[$unique_id] = call_user_func($action->url_callback, $row->$primary_key, $row); } @@ -1795,9 +1795,9 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver { $field_name = $column->field_name; $field_value = isset( $row->{$column->field_name} ) ? $row->{$column->field_name} : null; - if( $has_callbacks && isset($this->callback_column[$field_name]) ) + if ( $has_callbacks && isset($this->callback_column[$field_name]) ) $list[$num_row]->$field_name = call_user_func($this->callback_column[$field_name], $field_value, $row); - elseif(isset($types[$field_name])) + elseif (isset($types[$field_name])) $list[$num_row]->$field_name = $this->change_list_value($types[$field_name] , $field_value); else $list[$num_row]->$field_name = $field_value; @@ -1896,7 +1896,7 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver protected function delete_layout($delete_result = true) { @ob_end_clean(); - if($delete_result === false) + if ($delete_result === false) { $error_message = '

'.$this->l('delete_error_message').'

'; @@ -1913,9 +1913,9 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver protected function get_success_message_at_list($field_info = null) { - if($field_info !== null && isset($field_info->success_message) && $field_info->success_message) + if ($field_info !== null && isset($field_info->success_message) && $field_info->success_message) { - if(!empty($field_info->primary_key) && !$this->unset_edit) + if (!empty($field_info->primary_key) && !$this->unset_edit) { return $this->l('insert_success_message')."
".$this->l('form_edit')." {$this->subject} "; } @@ -1933,7 +1933,7 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver protected function insert_layout($insert_result = false) { @ob_end_clean(); - if($insert_result === false) + if ($insert_result === false) { echo json_encode(array('success' => false)); } @@ -1941,7 +1941,7 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver { $success_message = '

'.$this->l('insert_success_message'); - if(!$this->unset_back_to_list && !empty($insert_result) && !$this->unset_edit) + if (!$this->unset_back_to_list && !empty($insert_result) && !$this->unset_edit) { $success_message .= " ".$this->l('form_edit')." {$this->subject} "; @@ -1950,7 +1950,7 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver } } - if(!$this->unset_back_to_list && !$this->_is_ajax()) + if (!$this->unset_back_to_list && !$this->_is_ajax()) { $success_message .= " ".$this->l('form_go_back_to_list').""; } @@ -1977,7 +1977,7 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver protected function upload_layout($upload_result, $field_name) { @ob_end_clean(); - if($upload_result !== false && !is_string($upload_result) && empty($upload_result[0]->error)) + if ($upload_result !== false && !is_string($upload_result) && empty($upload_result[0]->error)) { echo json_encode( (object)array( @@ -1988,9 +1988,9 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver else { $result = (object)array('success' => false); - if(is_string($upload_result)) + if (is_string($upload_result)) $result->message = $upload_result; - if(!empty($upload_result[0]->error)) + if (!empty($upload_result[0]->error)) $result->message = $upload_result[0]->error; echo json_encode($result); @@ -2002,7 +2002,7 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver protected function delete_file_layout($upload_result) { @ob_end_clean(); - if($upload_result !== false) + if ($upload_result !== false) { echo json_encode( (object)array( 'success' => true ) ); } @@ -2127,7 +2127,7 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver unset($css_files[sha1($this->default_theme_path.'/bootstrap/css/bootstrap/bootstrap.min.css')]); } - if($this->echo_and_die === false) + if ($this->echo_and_die === false) { /** Initialize JavaScript variables */ $js_vars = array( @@ -2147,7 +2147,7 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver 'output' => $this->views_as_string, ); } - elseif($this->echo_and_die === true) + elseif ($this->echo_and_die === true) { echo $this->views_as_string; die(); @@ -2157,14 +2157,14 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver protected function update_layout($update_result = false, $state_info = null) { @ob_end_clean(); - if($update_result === false) + if ($update_result === false) { echo json_encode(array('success' => $update_result)); } else { $success_message = '

'.$this->l('update_success_message'); - if(!$this->unset_back_to_list && !$this->_is_ajax()) + if (!$this->unset_back_to_list && !$this->_is_ajax()) { $success_message .= " ".$this->l('form_go_back_to_list').""; } @@ -2185,7 +2185,7 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery.numeric.min.js'); $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.numeric.config.js'); $extra_attributes = ''; - if(!empty($field_info->db_max_length)) + if (!empty($field_info->db_max_length)) $extra_attributes .= "maxlength='{$field_info->db_max_length}'"; $input = ""; return $input; @@ -2237,7 +2237,7 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver protected function get_text_input($field_info,$value) { - if($field_info->extras == 'text_editor') + if ($field_info->extras == 'text_editor') { $editor = $this->config->default_text_editor; switch ($editor) { @@ -2280,19 +2280,19 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/ui/'.grocery_CRUD::JQUERY_UI_JS); $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery-ui-timepicker-addon.js'); - if($this->language !== 'english') + if ($this->language !== 'english') { include($this->default_config_path.'/language_alias.php'); - if(array_key_exists($this->language, $language_alias)) + if (array_key_exists($this->language, $language_alias)) { $i18n_date_js_file = $this->default_javascript_path.'/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-'.$language_alias[$this->language].'.js'; - if(file_exists($i18n_date_js_file)) + if (file_exists($i18n_date_js_file)) { $this->set_js_lib($i18n_date_js_file); } $i18n_datetime_js_file = $this->default_javascript_path.'/jquery_plugins/ui/i18n/timepicker/jquery-ui-timepicker-'.$language_alias[$this->language].'.js'; - if(file_exists($i18n_datetime_js_file)) + if (file_exists($i18n_datetime_js_file)) { $this->set_js_lib($i18n_datetime_js_file); } @@ -2301,7 +2301,7 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery-ui-timepicker-addon.config.js'); - if(!empty($value) && $value != '0000-00-00 00:00:00' && $value != '1970-01-01 00:00:00'){ + if (!empty($value) && $value != '0000-00-00 00:00:00' && $value != '1970-01-01 00:00:00'){ list($year,$month,$day) = explode('-',substr($value,0,10)); $date = date($this->php_date_format, mktime(0,0,0,$month,$day,$year)); $datetime = $date.substr($value,10); @@ -2318,7 +2318,7 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver protected function get_hidden_input($field_info,$value) { - if($field_info->extras !== null && $field_info->extras != false) + if ($field_info->extras !== null && $field_info->extras != false) $value = $field_info->extras; $input = ""; return $input; @@ -2329,7 +2329,7 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver $value = !is_string($value) ? '' : $value; $extra_attributes = ''; - if(!empty($field_info->db_max_length)) + if (!empty($field_info->db_max_length)) $extra_attributes .= "maxlength='{$field_info->db_max_length}'"; $input = ""; return $input; @@ -2340,13 +2340,13 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver $this->set_css($this->default_css_path.'/ui/simple/'.grocery_CRUD::JQUERY_UI_CSS); $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/ui/'.grocery_CRUD::JQUERY_UI_JS); - if($this->language !== 'english') + if ($this->language !== 'english') { include($this->default_config_path.'/language_alias.php'); - if(array_key_exists($this->language, $language_alias)) + if (array_key_exists($this->language, $language_alias)) { $i18n_date_js_file = $this->default_javascript_path.'/jquery_plugins/ui/i18n/datepicker/jquery.ui.datepicker-'.$language_alias[$this->language].'.js'; - if(file_exists($i18n_date_js_file)) + if (file_exists($i18n_date_js_file)) { $this->set_js_lib($i18n_date_js_file); } @@ -2355,7 +2355,7 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver $this->set_js_config($this->default_javascript_path.'/jquery_plugins/config/jquery.datepicker.config.js'); - if(!empty($value) && $value != '0000-00-00' && $value != '1970-01-01') + if (!empty($value) && $value != '0000-00-00' && $value != '1970-01-01') { list($year,$month,$day) = explode('-',substr($value,0,10)); $date = date($this->php_date_format, mktime(0,0,0,$month,$day,$year)); @@ -2492,7 +2492,7 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver $input = ""; - if(!empty($unselected_values)) + if (!empty($unselected_values)) foreach($unselected_values as $id => $name) { $input .= ""; } - if(!empty($selected_values)) + if (!empty($selected_values)) foreach($selected_values as $id => $name) { $input .= ""; @@ -2603,11 +2603,11 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver protected function _convert_bytes_ui_to_bytes($bytes_ui) { $bytes_ui = str_replace(' ','',$bytes_ui); - if(strstr($bytes_ui,'MB')) + if (strstr($bytes_ui,'MB')) $bytes = (int)(str_replace('MB','',$bytes_ui))*1024*1024; - elseif(strstr($bytes_ui,'KB')) + elseif (strstr($bytes_ui,'KB')) $bytes = (int)(str_replace('KB','',$bytes_ui))*1024; - elseif(strstr($bytes_ui,'B')) + elseif (strstr($bytes_ui,'B')) $bytes = (int)(str_replace('B','',$bytes_ui)); else $bytes = (int)($bytes_ui); @@ -2714,7 +2714,7 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver $field_value = !empty($field_values) && isset($field_values->{$field->field_name}) ? $field_values->{$field->field_name} : null; - if(!isset($this->callback_add_field[$field->field_name])) + if (!isset($this->callback_add_field[$field->field_name])) { $field_input = $this->get_field_input($field_info, $field_value); } @@ -2756,7 +2756,7 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver $field_info = $types[$field->field_name]; $field_value = !empty($field_values) && isset($field_values->{$field->field_name}) ? $field_values->{$field->field_name} : null; - if(!isset($this->callback_edit_field[$field->field_name])) + if (!isset($this->callback_edit_field[$field->field_name])) { $field_input = $this->get_field_input($field_info, $field_value); } @@ -2814,7 +2814,7 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver $field_info = $types[$field->field_name]; $field_value = !empty($field_values) && isset($field_values->{$field->field_name}) ? $field_values->{$field->field_name} : null; - if(!isset($this->callback_read_field[$field->field_name])) + if (!isset($this->callback_read_field[$field->field_name])) { $field_input = $this->get_field_input($field_info, $field_value); } @@ -2848,7 +2848,7 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver protected function setThemeBasics() { $this->theme_path = $this->default_theme_path; - if(substr($this->theme_path,-1) != '/') + if (substr($this->theme_path,-1) != '/') $this->theme_path = $this->theme_path.'/'; include($this->theme_path.$this->theme.'/config.php'); @@ -2946,7 +2946,7 @@ class grocery_CRUD_Layout extends grocery_CRUD_Model_Driver protected function get_views_as_string() { - if(!empty($this->views_as_string)) + if (!empty($this->views_as_string)) return $this->views_as_string; else return null; @@ -3061,7 +3061,7 @@ class grocery_CRUD_States extends grocery_CRUD_Layout break; case self::STATE_INSERT: - if(!empty($_POST)) + if (!empty($_POST)) { $state_info = (object)array('unwrapped_data' => $_POST); } @@ -3073,11 +3073,11 @@ class grocery_CRUD_States extends grocery_CRUD_Layout break; case 6: - if(!empty($_POST) && $first_parameter !== null) + if (!empty($_POST) && $first_parameter !== null) { $state_info = (object)array('primary_key' => $first_parameter,'unwrapped_data' => $_POST); } - elseif(empty($_POST)) + elseif (empty($_POST)) { throw new Exception('On the state "update" you must have post data',9); die(); @@ -3094,27 +3094,27 @@ class grocery_CRUD_States extends grocery_CRUD_Layout case 16: //export to excel case 17: //print $state_info = (object)array(); - if(!empty($_POST['per_page'])) + if (!empty($_POST['per_page'])) { $state_info->per_page = is_numeric($_POST['per_page']) ? $_POST['per_page'] : null; } - if(!empty($_POST['page'])) + if (!empty($_POST['page'])) { $state_info->page = is_numeric($_POST['page']) ? $_POST['page'] : null; } //If we request an export or a print we don't care about what page we are - if($state_code === 16 || $state_code === 17) + if ($state_code === 16 || $state_code === 17) { $state_info->page = 1; $state_info->per_page = 1000000; //a very big number! } - if(!empty($_POST['order_by'][0])) + if (!empty($_POST['order_by'][0])) { $state_info->order_by = $_POST['order_by']; } - if(!empty($_POST['search_text'])) + if (!empty($_POST['search_text'])) { - if(empty($_POST['search_field'])) + if (empty($_POST['search_field'])) { $search_text = strip_tags($_POST['search_field']); $state_info->search = (object)array('field' => null , 'text' => $_POST['search_text']); @@ -3141,7 +3141,7 @@ class grocery_CRUD_States extends grocery_CRUD_Layout break; case 10: - if($first_parameter !== null) + if ($first_parameter !== null) { $state_info = (object)array('primary_key' => $first_parameter); } @@ -3181,7 +3181,7 @@ class grocery_CRUD_States extends grocery_CRUD_Layout { $state_string = $this->get_state_info_from_url()->operation; - if( $state_string != 'unknown' && in_array( $state_string, $this->states ) ) + if ( $state_string != 'unknown' && in_array( $state_string, $this->states ) ) $state_code = array_search($state_string, $this->states); else $state_code = 0; @@ -3207,15 +3207,15 @@ class grocery_CRUD_States extends grocery_CRUD_Layout $state_url_array = array(); - if( sizeof($ci->uri->segments) > 0 ) { + if ( sizeof($ci->uri->segments) > 0 ) { foreach($ci->uri->segments as $num => $value) { $state_url_array[$num] = $value; - if($num == ($segment_position - 1)) + if ($num == ($segment_position - 1)) break; } - if( $method_name == 'index' && !in_array( 'index', $state_url_array ) ) //there is a scenario that you don't have the index to your url + if ( $method_name == 'index' && !in_array( 'index', $state_url_array ) ) //there is a scenario that you don't have the index to your url $state_url_array[$num+1] = 'index'; } @@ -3235,7 +3235,7 @@ class grocery_CRUD_States extends grocery_CRUD_Layout $segements = $ci->uri->segments; foreach($segements as $num => $value) { - if($value != 'unknown' && in_array($value, $this->states)) + if ($value != 'unknown' && in_array($value, $this->states)) { $segment_position = (int)$num; $operation = $value; //I don't have a "break" here because I want to ensure that is the LAST segment with name that is in the array. @@ -3244,7 +3244,7 @@ class grocery_CRUD_States extends grocery_CRUD_Layout $function_name = $this->get_method_name(); - if($function_name == 'index' && !in_array('index',$ci->uri->segments)) + if ($function_name == 'index' && !in_array('index',$ci->uri->segments)) $segment_position++; $first_parameter = isset($segements[$segment_position+1]) ? $segements[$segment_position+1] : null; @@ -3324,7 +3324,7 @@ class grocery_CRUD_States extends grocery_CRUD_Layout protected function getValidationUpdateUrl($primary_key = null) { - if($primary_key === null) + if ($primary_key === null) return $this->state_url('update_validation'); else return $this->state_url('update_validation/'.$primary_key); @@ -3332,7 +3332,7 @@ class grocery_CRUD_States extends grocery_CRUD_Layout protected function getEditUrl($primary_key = null) { - if($primary_key === null) + if ($primary_key === null) return $this->state_url('edit'); else return $this->state_url('edit/'.$primary_key); @@ -3340,7 +3340,7 @@ class grocery_CRUD_States extends grocery_CRUD_Layout protected function getReadUrl($primary_key = null) { - if($primary_key === null) + if ($primary_key === null) return $this->state_url('read'); else return $this->state_url('read/'.$primary_key); @@ -3367,7 +3367,7 @@ class grocery_CRUD_States extends grocery_CRUD_Layout protected function getListSuccessUrl($primary_key = null) { - if(empty($primary_key)) + if (empty($primary_key)) return $this->state_url('success',true); else return $this->state_url('success/'.$primary_key,true); @@ -3553,7 +3553,7 @@ class Grocery_CRUD extends grocery_CRUD_States { $args = func_get_args(); - if(isset($args[0]) && is_array($args[0])) + if (isset($args[0]) && is_array($args[0])) { $args = $args[0]; } @@ -3576,10 +3576,10 @@ class Grocery_CRUD extends grocery_CRUD_States */ function set_rules($field, $label = '', $rules = '') { - if(is_string($field)) + if (is_string($field)) { $this->validation_rules[$field] = array('field' => $field, 'label' => $label, 'rules' => $rules); - }elseif(is_array($field)) + }elseif (is_array($field)) { foreach($field as $num_field => $field_array) { @@ -3645,7 +3645,7 @@ class Grocery_CRUD extends grocery_CRUD_States { $args = func_get_args(); - if(isset($args[0]) && is_array($args[0])) + if (isset($args[0]) && is_array($args[0])) { $args = $args[0]; } @@ -3806,7 +3806,7 @@ class Grocery_CRUD extends grocery_CRUD_States { $args = func_get_args(); - if(isset($args[0]) && is_array($args[0])) + if (isset($args[0]) && is_array($args[0])) { $args = $args[0]; } @@ -3827,7 +3827,7 @@ class Grocery_CRUD extends grocery_CRUD_States { $args = func_get_args(); - if(isset($args[0]) && is_array($args[0])) + if (isset($args[0]) && is_array($args[0])) { $args = $args[0]; } @@ -3843,7 +3843,7 @@ class Grocery_CRUD extends grocery_CRUD_States { $args = func_get_args(); - if(isset($args[0]) && is_array($args[0])) + if (isset($args[0]) && is_array($args[0])) { $args = $args[0]; } @@ -3857,7 +3857,7 @@ class Grocery_CRUD extends grocery_CRUD_States { $args = func_get_args(); - if(isset($args[0]) && is_array($args[0])) + if (isset($args[0]) && is_array($args[0])) { $args = $args[0]; } @@ -3871,7 +3871,7 @@ class Grocery_CRUD extends grocery_CRUD_States { $args = func_get_args(); - if(isset($args[0]) && is_array($args[0])) + if (isset($args[0]) && is_array($args[0])) { $args = $args[0]; } @@ -3907,7 +3907,7 @@ class Grocery_CRUD extends grocery_CRUD_States { $args = func_get_args(); - if(isset($args[0]) && is_array($args[0])) + if (isset($args[0]) && is_array($args[0])) { $args = $args[0]; } @@ -3926,7 +3926,7 @@ class Grocery_CRUD extends grocery_CRUD_States { $args = func_get_args(); - if(isset($args[0]) && is_array($args[0])) + if (isset($args[0]) && is_array($args[0])) { $args = $args[0]; } @@ -3944,7 +3944,7 @@ class Grocery_CRUD extends grocery_CRUD_States { $args = func_get_args(); - if(isset($args[0]) && is_array($args[0])) + if (isset($args[0]) && is_array($args[0])) { $args = $args[0]; } @@ -3958,7 +3958,7 @@ class Grocery_CRUD extends grocery_CRUD_States { $args = func_get_args(); - if(isset($args[0]) && is_array($args[0])) { + if (isset($args[0]) && is_array($args[0])) { $args = $args[0]; } @@ -3976,14 +3976,14 @@ class Grocery_CRUD extends grocery_CRUD_States */ public function display_as($field_name, $display_as = null) { - if(is_array($field_name)) + if (is_array($field_name)) { foreach($field_name as $field => $display_as) { $this->display_as[$field] = $display_as; } } - elseif($display_as !== null) + elseif ($display_as !== null) { $this->display_as[$field_name] = $display_as; } @@ -3996,14 +3996,14 @@ class Grocery_CRUD extends grocery_CRUD_States */ protected function _load_language() { - if($this->language === null) + if ($this->language === null) { $this->language = strtolower($this->config->default_language); } include($this->default_language_path.'/'.$this->language.'.php'); foreach($lang as $handle => $lang_string) - if(!isset($this->lang_strings[$handle])) + if (!isset($this->lang_strings[$handle])) $this->lang_strings[$handle] = $lang_string; $this->default_true_false_text = array( $this->l('form_inactive') , $this->l('form_active')); @@ -4091,15 +4091,15 @@ class Grocery_CRUD extends grocery_CRUD_States */ protected function get_columns() { - if($this->columns_checked === false) + if ($this->columns_checked === false) { $field_types = $this->get_field_types(); - if(empty($this->columns)) + if (empty($this->columns)) { $this->columns = array(); foreach($field_types as $field) { - if( !isset($field->db_extra) || $field->db_extra != 'auto_increment' ) + if ( !isset($field->db_extra) || $field->db_extra != 'auto_increment' ) $this->columns[] = $field->name; } } @@ -4107,13 +4107,13 @@ class Grocery_CRUD extends grocery_CRUD_States foreach($this->columns as $col_num => $column) { - if(isset($this->relation[$column])) + if (isset($this->relation[$column])) { $new_column = $this->_unique_field_name($this->relation[$column][0]); $this->columns[$col_num] = $new_column; - if(isset($this->display_as[$column])) + if (isset($this->display_as[$column])) { $display_as = $this->display_as[$column]; unset($this->display_as[$column]); @@ -4129,15 +4129,15 @@ class Grocery_CRUD extends grocery_CRUD_States } else { - if(!empty($this->relation)) + if (!empty($this->relation)) { $table_name = $this->get_table(); foreach($this->relation as $relation) { - if( $relation[2] == $column ) + if ( $relation[2] == $column ) { $new_column = $table_name.'.'.$column; - if(isset($this->display_as[$column])) + if (isset($this->display_as[$column])) { $display_as = $this->display_as[$column]; unset($this->display_as[$column]); @@ -4156,15 +4156,15 @@ class Grocery_CRUD extends grocery_CRUD_States } - if(isset($this->display_as[$column])) + if (isset($this->display_as[$column])) $this->columns[$col_num] = (object)array('field_name' => $column, 'display_as' => $this->display_as[$column]); - elseif(isset($field_types[$column])) + elseif (isset($field_types[$column])) $this->columns[$col_num] = (object)array('field_name' => $column, 'display_as' => $field_types[$column]->display_as); else $this->columns[$col_num] = (object)array('field_name' => $column, 'display_as' => ucfirst(str_replace('_',' ',$column))); - if(!empty($this->unset_columns) && in_array($column,$this->unset_columns)) + if (!empty($this->unset_columns) && in_array($column,$this->unset_columns)) { unset($this->columns[$col_num]); } @@ -4183,16 +4183,16 @@ class Grocery_CRUD extends grocery_CRUD_States */ protected function get_add_fields() { - if($this->add_fields_checked === false) + if ($this->add_fields_checked === false) { $field_types = $this->get_field_types(); - if(!empty($this->add_fields)) + if (!empty($this->add_fields)) { foreach($this->add_fields as $field_num => $field) { - if(isset($this->display_as[$field])) + if (isset($this->display_as[$field])) $this->add_fields[$field_num] = (object)array('field_name' => $field, 'display_as' => $this->display_as[$field]); - elseif(isset($field_types[$field]->display_as)) + elseif (isset($field_types[$field]->display_as)) $this->add_fields[$field_num] = (object)array('field_name' => $field, 'display_as' => $field_types[$field]->display_as); else $this->add_fields[$field_num] = (object)array('field_name' => $field, 'display_as' => ucfirst(str_replace('_',' ',$field))); @@ -4204,12 +4204,12 @@ class Grocery_CRUD extends grocery_CRUD_States foreach($field_types as $field) { //Check if an unset_add_field is initialize for this field name - if($this->unset_add_fields !== null && is_array($this->unset_add_fields) && in_array($field->name,$this->unset_add_fields)) + if ($this->unset_add_fields !== null && is_array($this->unset_add_fields) && in_array($field->name,$this->unset_add_fields)) continue; - if( (!isset($field->db_extra) || $field->db_extra != 'auto_increment') ) + if ( (!isset($field->db_extra) || $field->db_extra != 'auto_increment') ) { - if(isset($this->display_as[$field->name])) + if (isset($this->display_as[$field->name])) $this->add_fields[] = (object)array('field_name' => $field->name, 'display_as' => $this->display_as[$field->name]); else $this->add_fields[] = (object)array('field_name' => $field->name, 'display_as' => $field->display_as); @@ -4228,14 +4228,14 @@ class Grocery_CRUD extends grocery_CRUD_States */ protected function get_edit_fields() { - if($this->edit_fields_checked === false) + if ($this->edit_fields_checked === false) { $field_types = $this->get_field_types(); - if(!empty($this->edit_fields)) + if (!empty($this->edit_fields)) { foreach($this->edit_fields as $field_num => $field) { - if(isset($this->display_as[$field])) + if (isset($this->display_as[$field])) $this->edit_fields[$field_num] = (object)array('field_name' => $field, 'display_as' => $this->display_as[$field]); else $this->edit_fields[$field_num] = (object)array('field_name' => $field, 'display_as' => $field_types[$field]->display_as); @@ -4247,12 +4247,12 @@ class Grocery_CRUD extends grocery_CRUD_States foreach($field_types as $field) { //Check if an unset_edit_field is initialize for this field name - if($this->unset_edit_fields !== null && is_array($this->unset_edit_fields) && in_array($field->name,$this->unset_edit_fields)) + if ($this->unset_edit_fields !== null && is_array($this->unset_edit_fields) && in_array($field->name,$this->unset_edit_fields)) continue; - if(!isset($field->db_extra) || $field->db_extra != 'auto_increment') + if (!isset($field->db_extra) || $field->db_extra != 'auto_increment') { - if(isset($this->display_as[$field->name])) + if (isset($this->display_as[$field->name])) $this->edit_fields[] = (object)array('field_name' => $field->name, 'display_as' => $this->display_as[$field->name]); else $this->edit_fields[] = (object)array('field_name' => $field->name, 'display_as' => $field->display_as); @@ -4271,14 +4271,14 @@ class Grocery_CRUD extends grocery_CRUD_States */ protected function get_read_fields() { - if($this->read_fields_checked === false) + if ($this->read_fields_checked === false) { $field_types = $this->get_field_types(); - if(!empty($this->read_fields)) + if (!empty($this->read_fields)) { foreach($this->read_fields as $field_num => $field) { - if(isset($this->display_as[$field])) + if (isset($this->display_as[$field])) $this->read_fields[$field_num] = (object)array('field_name' => $field, 'display_as' => $this->display_as[$field]); else $this->read_fields[$field_num] = (object)array('field_name' => $field, 'display_as' => $field_types[$field]->display_as); @@ -4290,12 +4290,12 @@ class Grocery_CRUD extends grocery_CRUD_States foreach($field_types as $field) { //Check if an unset_read_field is initialize for this field name - if($this->unset_read_fields !== null && is_array($this->unset_read_fields) && in_array($field->name,$this->unset_read_fields)) + if ($this->unset_read_fields !== null && is_array($this->unset_read_fields) && in_array($field->name,$this->unset_read_fields)) continue; - if(!isset($field->db_extra) || $field->db_extra != 'auto_increment') + if (!isset($field->db_extra) || $field->db_extra != 'auto_increment') { - if(isset($this->display_as[$field->name])) + if (isset($this->display_as[$field->name])) $this->read_fields[] = (object)array('field_name' => $field->name, 'display_as' => $this->display_as[$field->name]); else $this->read_fields[] = (object)array('field_name' => $field->name, 'display_as' => $field->display_as); @@ -4403,7 +4403,7 @@ class Grocery_CRUD extends grocery_CRUD_States if ($this->character_limiter === 0 || $this->character_limiter === '0') { $this->character_limiter = 1000000; //a very big number - } elseif($this->character_limiter === null || $this->character_limiter === false) { + } elseif ($this->character_limiter === null || $this->character_limiter === false) { $this->character_limiter = 30; //is better to have the number 30 rather than the 0 value } @@ -4414,7 +4414,7 @@ class Grocery_CRUD extends grocery_CRUD_States protected function _set_primary_keys_to_model() { - if(!empty($this->primary_keys)) + if (!empty($this->primary_keys)) { foreach($this->primary_keys as $primary_key) { @@ -4433,7 +4433,7 @@ class Grocery_CRUD extends grocery_CRUD_States $this->_load_language(); $this->state_code = $this->getStateCode(); - if($this->basic_model === null) + if ($this->basic_model === null) $this->set_default_Model(); $this->set_basic_db_table($this->get_table()); @@ -4454,7 +4454,7 @@ class Grocery_CRUD extends grocery_CRUD_States { $this->pre_render(); - if( $this->state_code != 0 ) + if ( $this->state_code != 0 ) { $this->state_info = $this->getStateInfo(); } @@ -4467,13 +4467,13 @@ class Grocery_CRUD extends grocery_CRUD_States switch ($this->state_code) { case 15://success case 1://list - if($this->unset_list) + if ($this->unset_list) { throw new Exception('You don\'t have permissions for this operation', 14); die(); } - if($this->theme === null) + if ($this->theme === null) $this->set_theme($this->default_theme); $this->setThemeBasics(); @@ -4486,13 +4486,13 @@ class Grocery_CRUD extends grocery_CRUD_States break; case 2://add - if($this->unset_add) + if ($this->unset_add) { throw new Exception('You don\'t have permissions for this operation', 14); die(); } - if($this->theme === null) + if ($this->theme === null) $this->set_theme($this->default_theme); $this->setThemeBasics(); @@ -4503,13 +4503,13 @@ class Grocery_CRUD extends grocery_CRUD_States break; case 3://edit - if($this->unset_edit) + if ($this->unset_edit) { throw new Exception('You don\'t have permissions for this operation', 14); die(); } - if($this->theme === null) + if ($this->theme === null) $this->set_theme($this->default_theme); $this->setThemeBasics(); @@ -4522,7 +4522,7 @@ class Grocery_CRUD extends grocery_CRUD_States break; case 4://delete - if($this->unset_delete) + if ($this->unset_delete) { throw new Exception('This user is not allowed to do this operation', 14); die(); @@ -4535,7 +4535,7 @@ class Grocery_CRUD extends grocery_CRUD_States break; case 5://insert - if($this->unset_add) + if ($this->unset_add) { throw new Exception('This user is not allowed to do this operation', 14); die(); @@ -4548,7 +4548,7 @@ class Grocery_CRUD extends grocery_CRUD_States break; case 6://update - if($this->unset_edit) + if ($this->unset_edit) { throw new Exception('This user is not allowed to do this operation', 14); die(); @@ -4562,13 +4562,13 @@ class Grocery_CRUD extends grocery_CRUD_States case 7://ajax_list - if($this->unset_list) + if ($this->unset_list) { throw new Exception('You don\'t have permissions for this operation', 14); die(); } - if($this->theme === null) + if ($this->theme === null) $this->set_theme($this->default_theme); $this->setThemeBasics(); @@ -4583,7 +4583,7 @@ class Grocery_CRUD extends grocery_CRUD_States case 8://ajax_list_info - if($this->theme === null) + if ($this->theme === null) $this->set_theme($this->default_theme); $this->setThemeBasics(); @@ -4646,13 +4646,13 @@ class Grocery_CRUD extends grocery_CRUD_States //a big number just to ensure that the table characters will not be cutted. $this->character_limiter = 1000000; - if($this->unset_export) + if ($this->unset_export) { throw new Exception('You don\'t have permissions for this operation', 15); die(); } - if($this->theme === null) + if ($this->theme === null) $this->set_theme($this->default_theme); $this->setThemeBasics(); @@ -4667,13 +4667,13 @@ class Grocery_CRUD extends grocery_CRUD_States //a big number just to ensure that the table characters will not be cutted. $this->character_limiter = 1000000; - if($this->unset_print) + if ($this->unset_print) { throw new Exception('You don\'t have permissions for this operation', 15); die(); } - if($this->theme === null) + if ($this->theme === null) $this->set_theme($this->default_theme); $this->setThemeBasics(); @@ -4685,13 +4685,13 @@ class Grocery_CRUD extends grocery_CRUD_States break; case grocery_CRUD_States::STATE_READ: - if($this->unset_read) + if ($this->unset_read) { throw new Exception('You don\'t have permissions for this operation', 14); die(); } - if($this->theme === null) + if ($this->theme === null) $this->set_theme($this->default_theme); $this->setThemeBasics(); @@ -4705,7 +4705,7 @@ class Grocery_CRUD extends grocery_CRUD_States case grocery_CRUD_States::STATE_DELETE_MULTIPLE: - if($this->unset_delete) + if ($this->unset_delete) { throw new Exception('This user is not allowed to do this operation'); die(); @@ -4936,13 +4936,13 @@ class Grocery_CRUD extends grocery_CRUD_States */ public function get_table() { - if($this->basic_db_table_checked) + if ($this->basic_db_table_checked) { return $this->basic_db_table; } - elseif( $this->basic_db_table !== null ) + elseif ( $this->basic_db_table !== null ) { - if(!$this->table_exists($this->basic_db_table)) + if (!$this->table_exists($this->basic_db_table)) { throw new Exception('The table name does not exist. Please check you database and try again.',11); die(); @@ -4954,7 +4954,7 @@ class Grocery_CRUD extends grocery_CRUD_States { //Last try , try to find the table from your view / function name!!! Not suggested but it works . $last_chance_table_name = $this->get_method_name(); - if($this->table_exists($last_chance_table_name)) + if ($this->table_exists($last_chance_table_name)) { $this->set_table($last_chance_table_name); } @@ -4974,7 +4974,7 @@ class Grocery_CRUD extends grocery_CRUD_States { $args = func_get_args(); - if(isset($args[0]) && is_array($args[0])) + if (isset($args[0]) && is_array($args[0])) { $args = $args[0]; } @@ -4993,7 +4993,7 @@ class Grocery_CRUD extends grocery_CRUD_States { $args = func_get_args(); - if(isset($args[0]) && is_array($args[0])) + if (isset($args[0]) && is_array($args[0])) { $args = $args[0]; } @@ -5011,11 +5011,11 @@ class Grocery_CRUD extends grocery_CRUD_States */ public function set_table($table_name) { - if(!empty($table_name) && $this->basic_db_table === null) + if (!empty($table_name) && $this->basic_db_table === null) { $this->basic_db_table = $table_name; } - elseif(!empty($table_name)) + elseif (!empty($table_name)) { throw new Exception('You have already insert a table name once...', 1); } @@ -5178,7 +5178,7 @@ class Grocery_CRUD extends grocery_CRUD_States } } -if(defined('CI_VERSION')) +if (defined('CI_VERSION')) { $ci = &get_instance(); $ci->load->library('Form_validation'); @@ -5322,7 +5322,7 @@ class UploadHandler break; case 'gif': @imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0)); - $src_img = @imagecreatefromgif($file_path); + $src_img = @imagecreatefromgif ($file_path); $write_image = 'imagegif'; break; case 'png': diff --git a/application/libraries/REST_Controller.php b/application/libraries/REST_Controller.php index 7ec0dc567..65014ce59 100644 --- a/application/libraries/REST_Controller.php +++ b/application/libraries/REST_Controller.php @@ -1,6 +1,6 @@ router->class]['*'][$this->request->method])) + if (!empty($auth_override_class_method_http[$this->router->class]['*'][$this->request->method])) { // None auth override found, prepare nothing but send back a TRUE override flag if ($auth_override_class_method_http[$this->router->class]['*'][$this->request->method] === 'none') @@ -1341,7 +1341,7 @@ abstract class REST_Controller extends CI_Controller { } // Check to see if there's an override value set for the current class/method/HTTP-method being called - if(!empty($auth_override_class_method_http[$this->router->class][$this->router->method][$this->request->method])) + if (!empty($auth_override_class_method_http[$this->router->class][$this->router->method][$this->request->method])) { // None auth override found, prepare nothing but send back a TRUE override flag if ($auth_override_class_method_http[$this->router->class][$this->router->method][$this->request->method] === 'none') @@ -1911,7 +1911,7 @@ abstract class REST_Controller extends CI_Controller { */ private function _setUID($username) { - if(!isset($this->_uid) && isset($username)) + if (!isset($this->_uid) && isset($username)) { $this->_uid = $username; } diff --git a/application/libraries/Template.php b/application/libraries/Template.php index 07bccd949..3f90cef91 100644 --- a/application/libraries/Template.php +++ b/application/libraries/Template.php @@ -194,7 +194,7 @@ class Template } // new widget - if(!class_exists($class)) { + if (!class_exists($class)) { // try both lowercase and capitalized versions foreach (array(ucfirst($class), strtolower($class)) as $class) { if (file_exists($path . $class . '.php')) { diff --git a/application/migrations/001_init.php b/application/migrations/001_init.php index ddd83bb25..2e74ee38d 100644 --- a/application/migrations/001_init.php +++ b/application/migrations/001_init.php @@ -1,6 +1,6 @@ db->table_exists('msg_messages')) + if (! $this->db->table_exists('public.tbl_msg_message')) { - $query= ' - CREATE TABLE msg_messages ( - id serial, + $query= " + CREATE TABLE public.tbl_msg_message ( + message_id serial, thread_id bigint NOT NULL, body text NOT NULL, priority smallint NOT NULL DEFAULT 0, - sender_id bigint NOT NULL, + person_id bigint NOT NULL, cdate timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (id) + PRIMARY KEY (message_id) ); - GRANT SELECT ON TABLE msg_messages TO web; - GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE msg_messages TO admin; - GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE msg_messages TO vilesci; - GRANT SELECT, UPDATE ON SEQUENCE msg_messages_id_seq TO web; - GRANT SELECT, UPDATE ON SEQUENCE msg_messages_id_seq TO admin; - GRANT SELECT, UPDATE ON SEQUENCE msg_messages_id_seq TO vilesci; + COMMENT ON COLUMN public.tbl_msg_message.person_id IS 'Sender'; + COMMENT ON COLUMN public.tbl_msg_message.priority IS 'Codex in config/message.php'; + GRANT SELECT ON TABLE public.tbl_msg_message TO web; + GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tbl_msg_message TO admin; + GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tbl_msg_message TO vilesci; + GRANT SELECT, UPDATE ON SEQUENCE public.tbl_msg_message_message_id_seq TO web; + GRANT SELECT, UPDATE ON SEQUENCE public.tbl_msg_message_message_id_seq TO admin; + GRANT SELECT, UPDATE ON SEQUENCE public.tbl_msg_message_message_id_seq TO vilesci; - CREATE TABLE msg_participants ( - user_id bigint NOT NULL, + CREATE TABLE public.tbl_msg_participant ( + person_id bigint NOT NULL, thread_id bigint NOT NULL, cdate timestamp NOT NULL DEFAULT now(), - PRIMARY KEY (user_id,thread_id) + PRIMARY KEY (person_id,thread_id) ); - GRANT SELECT ON TABLE msg_participants TO web; - GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE msg_participants TO admin; - GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE msg_participants TO vilesci; + GRANT SELECT ON TABLE public.tbl_msg_participant TO web; + GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tbl_msg_participant TO admin; + GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tbl_msg_participant TO vilesci; - CREATE TABLE msg_status ( + CREATE TABLE public.tbl_msg_status ( message_id bigint NOT NULL, - user_id bigint NOT NULL, + person_id bigint NOT NULL, status smallint NOT NULL, - PRIMARY KEY (message_id,user_id) + PRIMARY KEY (message_id,person_id) ); - GRANT SELECT ON TABLE msg_status TO web; - GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE msg_status TO admin; - GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE msg_status TO vilesci; + GRANT SELECT ON TABLE public.tbl_msg_status TO web; + GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tbl_msg_status TO admin; + GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tbl_msg_status TO vilesci; - CREATE TABLE msg_threads ( - id serial, + CREATE TABLE public.tbl_msg_thread ( + thread_id serial, subject text, - PRIMARY KEY (id) + PRIMARY KEY (thread_id) ); - GRANT SELECT ON TABLE msg_threads TO web; - GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE msg_threads TO admin; - GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE msg_threads TO vilesci; - GRANT SELECT, UPDATE ON SEQUENCE msg_threads_id_seq TO web; - GRANT SELECT, UPDATE ON SEQUENCE msg_threads_id_seq TO admin; - GRANT SELECT, UPDATE ON SEQUENCE msg_threads_id_seq TO vilesci; -'; + GRANT SELECT ON TABLE public.tbl_msg_thread TO web; + GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tbl_msg_thread TO admin; + GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tbl_msg_thread TO vilesci; + GRANT SELECT, UPDATE ON SEQUENCE public.tbl_msg_thread_thread_id_seq TO web; + GRANT SELECT, UPDATE ON SEQUENCE public.tbl_msg_thread_thread_id_seq TO admin; + GRANT SELECT, UPDATE ON SEQUENCE public.tbl_msg_thread_thread_id_seq TO vilesci; +"; if (!$this->db->simple_query($query)) { echo "Error creating Basis DB-Schema!"; @@ -66,10 +68,10 @@ class Migration_Message extends CI_Migration { public function down() { - $this->dbforge->drop_table('msg_messages'); - $this->dbforge->drop_table('msg_participants'); - $this->dbforge->drop_table('msg_status'); - $this->dbforge->drop_table('msg_threads'); + $this->dbforge->drop_table('public.tbl_msg_message'); + $this->dbforge->drop_table('public.tbl_msg_participant'); + $this->dbforge->drop_table('public.tbl_msg_status'); + $this->dbforge->drop_table('public.tbl_msg_thread'); } } diff --git a/application/models/File_model.php b/application/models/File_model.php deleted file mode 100644 index 7e2638fb4..000000000 --- a/application/models/File_model.php +++ /dev/null @@ -1,42 +0,0 @@ -getUID(), 'file')) - { - if($this->_validate($file)) - { - $result = $this->_write($file); - } - } - - return $result; - } - - private function _validate($file = NULL) - { - return TRUE; - } - - private function _write($file = NULL) - { - return TRUE; - } -} \ No newline at end of file diff --git a/application/models/Grocery_crud_model.php b/application/models/Grocery_crud_model.php index f40ad1faf..d2ec26b88 100755 --- a/application/models/Grocery_crud_model.php +++ b/application/models/Grocery_crud_model.php @@ -47,13 +47,13 @@ class Grocery_crud_model extends CI_Model { function get_list() { - if($this->table_name === null) + if ($this->table_name === null) return false; $select = "{$this->table_name}.*"; //set_relation special queries - if(!empty($this->relation)) + if (!empty($this->relation)) { foreach($this->relation as $relation) { @@ -61,7 +61,7 @@ class Grocery_crud_model extends CI_Model { $unique_join_name = $this->_unique_join_name($field_name); $unique_field_name = $this->_unique_field_name($field_name); - if(strstr($related_field_title,'{')) + if (strstr($related_field_title,'{')) { $related_field_title = str_replace(" "," ",$related_field_title); $select .= ", CONCAT('".str_replace(array('{','}'),array("',COALESCE({$unique_join_name}.",", ''),'"),str_replace("'","\\'",$related_field_title))."') as $unique_field_name"; @@ -71,13 +71,13 @@ class Grocery_crud_model extends CI_Model { $select .= ", $unique_join_name.$related_field_title AS $unique_field_name"; } - if($this->field_exists($related_field_title)) + if ($this->field_exists($related_field_title)) $select .= ", {$this->table_name}.$related_field_title AS {$this->table_name}.$related_field_title"; } } //set_relation_n_n special queries. We prefer sub queries from a simple join for the relation_n_n as it is faster and more stable on big tables. - if(!empty($this->relation_n_n)) + if (!empty($this->relation_n_n)) { $select = $this->relation_n_n_queries($select); } @@ -116,7 +116,7 @@ class Grocery_crud_model extends CI_Model { $field = ""; $use_template = strpos($title_field_selection_table,'{') !== false; $field_name_hash = $this->_unique_field_name($title_field_selection_table); - if($use_template) + if ($use_template) { $title_field_selection_table = str_replace(" ", " ", $title_field_selection_table); $field .= "CONCAT('".str_replace(array('{','}'),array("',COALESCE(",", ''),'"),str_replace("'","\\'",$title_field_selection_table))."')"; @@ -178,7 +178,7 @@ class Grocery_crud_model extends CI_Model { function get_total_results() { //set_relation_n_n special queries. We prefer sub queries from a simple join for the relation_n_n as it is faster and more stable on big tables. - if(!empty($this->relation_n_n)) + if (!empty($this->relation_n_n)) { $select = "{$this->table_name}.*"; $select = $this->relation_n_n_queries($select); @@ -191,7 +191,7 @@ class Grocery_crud_model extends CI_Model { function set_basic_table($table_name = null) { - if( !($this->db->table_exists($table_name)) ) + if ( !($this->db->table_exists($table_name)) ) return false; $this->table_name = $table_name; @@ -211,7 +211,7 @@ class Grocery_crud_model extends CI_Model { { $related_primary_key = $this->get_primary_key($related_table); - if($related_primary_key !== false) + if ($related_primary_key !== false) { $unique_name = $this->_unique_join_name($field_name); $this->db->join( $related_table.' as '.$unique_name , "$unique_name.$related_primary_key = {$this->table_name}.$field_name",'left'); @@ -248,7 +248,7 @@ class Grocery_crud_model extends CI_Model { $select = "$related_table.$related_primary_key, "; - if(strstr($related_field_title,'{')) + if (strstr($related_field_title,'{')) { $related_field_title = str_replace(" ", " ", $related_field_title); $select .= "CONCAT('".str_replace(array('{','}'),array("',COALESCE(",", ''),'"),str_replace("'","\\'",$related_field_title))."') as $field_name_hash"; @@ -259,16 +259,16 @@ class Grocery_crud_model extends CI_Model { } $this->db->select($select,false); - if($where_clause !== null) + if ($where_clause !== null) $this->db->where($where_clause); - if($where_clause !== null) + if ($where_clause !== null) $this->db->where($where_clause); - if($limit !== null) + if ($limit !== null) $this->db->limit($limit); - if($search_like !== null) + if ($search_like !== null) $this->db->having("$field_name_hash LIKE '%".$this->db->escape_like_str($search_like)."%'"); $order_by !== null @@ -292,7 +292,7 @@ class Grocery_crud_model extends CI_Model { function get_relation_total_rows($field_name , $related_table , $related_field_title, $where_clause) { - if($where_clause !== null) + if ($where_clause !== null) $this->db->where($where_clause); return $this->db->count_all_results($related_table); @@ -304,7 +304,7 @@ class Grocery_crud_model extends CI_Model { $related_field_title = $field_info->title_field_selection_table; $use_template = strpos($related_field_title,'{') !== false;; $field_name_hash = $this->_unique_field_name($related_field_title); - if($use_template) + if ($use_template) { $related_field_title = str_replace(" ", " ", $related_field_title); $select .= "CONCAT('".str_replace(array('{','}'),array("',COALESCE(",", ''),'"),str_replace("'","\\'",$related_field_title))."') as $field_name_hash"; @@ -317,9 +317,9 @@ class Grocery_crud_model extends CI_Model { $selection_primary_key = $this->get_primary_key($field_info->selection_table); - if(empty($field_info->priority_field_relation_table)) + if (empty($field_info->priority_field_relation_table)) { - if(!$use_template){ + if (!$use_template){ $this->db->order_by("{$field_info->selection_table}.{$field_info->title_field_selection_table}"); } } @@ -352,7 +352,7 @@ class Grocery_crud_model extends CI_Model { $use_template = strpos($related_field_title,'{') !== false; $field_name_hash = $this->_unique_field_name($related_field_title); - if($use_template) + if ($use_template) { $related_field_title = str_replace(" ", " ", $related_field_title); $select .= "CONCAT('".str_replace(array('{','}'),array("',COALESCE(",", ''),'"),str_replace("'","\\'",$related_field_title))."') as $field_name_hash"; @@ -363,19 +363,19 @@ class Grocery_crud_model extends CI_Model { } $this->db->select('*, '.$select,false); - if($use_where_clause){ + if ($use_where_clause){ $this->db->where($field_info->where_clause); } $selection_primary_key = $this->get_primary_key($field_info->selection_table); - if(!$use_template) + if (!$use_template) $this->db->order_by("{$field_info->selection_table}.{$field_info->title_field_selection_table}"); $results = $this->db->get($field_info->selection_table)->result(); $results_array = array(); foreach($results as $row) { - if(!isset($selected_values[$row->$selection_primary_key])) + if (!isset($selected_values[$row->$selection_primary_key])) $results_array[$row->$selection_primary_key] = $row->{$field_name_hash}; } @@ -385,12 +385,12 @@ class Grocery_crud_model extends CI_Model { function db_relation_n_n_update($field_info, $post_data ,$main_primary_key) { $this->db->where($field_info->primary_key_alias_to_this_table, $main_primary_key); - if(!empty($post_data)) + if (!empty($post_data)) $this->db->where_not_in($field_info->primary_key_alias_to_selection_table , $post_data); $this->db->delete($field_info->relation_table); $counter = 0; - if(!empty($post_data)) + if (!empty($post_data)) { foreach($post_data as $primary_key_value) { @@ -402,14 +402,14 @@ class Grocery_crud_model extends CI_Model { $this->db->where($where_array); $count = $this->db->from($field_info->relation_table)->count_all_results(); - if($count == 0) + if ($count == 0) { - if(!empty($field_info->priority_field_relation_table)) + if (!empty($field_info->priority_field_relation_table)) $where_array[$field_info->priority_field_relation_table] = $counter; $this->db->insert($field_info->relation_table, $where_array); - }elseif($count >= 1 && !empty($field_info->priority_field_relation_table)) + }elseif ($count >= 1 && !empty($field_info->priority_field_relation_table)) { $this->db->update( $field_info->relation_table, array($field_info->priority_field_relation_table => $counter) , $where_array); } @@ -441,9 +441,9 @@ WHERE table_name = '."'{$this->table_name}'")->result() as $db_field_type) $type = explode("(",$db_field_type->Type); $db_type = $type[0]; - if(isset($type[1])) + if (isset($type[1])) { - if(substr($type[1],-1) == ')') + if (substr($type[1],-1) == ')') { $length = substr($type[1],0,-1); } @@ -491,7 +491,7 @@ WHERE table_name = '."'{$this->table_name}'")->result() as $db_field_type) function db_insert($post_array) { $insert = $this->db->insert($this->table_name,$post_array); - if($insert) + if ($insert) { return $this->db->insert_id(); } @@ -502,12 +502,12 @@ WHERE table_name = '."'{$this->table_name}'")->result() as $db_field_type) { $primary_key_field = $this->get_primary_key(); - if($primary_key_field === false) + if ($primary_key_field === false) return false; $this->db->limit(1); $this->db->delete($this->table_name,array( $primary_key_field => $primary_key_value)); - if( $this->db->affected_rows() != 1) + if ( $this->db->affected_rows() != 1) return false; else return true; @@ -515,7 +515,7 @@ WHERE table_name = '."'{$this->table_name}'")->result() as $db_field_type) function db_file_delete($field_name, $filename) { - if( $this->db->update($this->table_name,array($field_name => ''),array($field_name => $filename)) ) + if ( $this->db->update($this->table_name,array($field_name => ''),array($field_name => $filename)) ) { return true; } @@ -527,7 +527,7 @@ WHERE table_name = '."'{$this->table_name}'")->result() as $db_field_type) function field_exists($field,$table_name = null) { - if(empty($table_name)) + if (empty($table_name)) { $table_name = $this->table_name; } @@ -536,20 +536,20 @@ WHERE table_name = '."'{$this->table_name}'")->result() as $db_field_type) function get_primary_key($table_name = null) { - if($table_name == null) + if ($table_name == null) { - if(isset($this->primary_keys[$this->table_name])) + if (isset($this->primary_keys[$this->table_name])) { return $this->primary_keys[$this->table_name]; } - if(empty($this->primary_key)) + if (empty($this->primary_key)) { $fields = $this->get_field_types_basic_table(); foreach($fields as $field) { - if($field->primary_key == 1) + if ($field->primary_key == 1) { return $field->name; } @@ -564,7 +564,7 @@ WHERE table_name = '."'{$this->table_name}'")->result() as $db_field_type) } else { - if(isset($this->primary_keys[$table_name])) + if (isset($this->primary_keys[$table_name])) { return $this->primary_keys[$table_name]; } @@ -573,7 +573,7 @@ WHERE table_name = '."'{$this->table_name}'")->result() as $db_field_type) foreach($fields as $field) { - /*if($field->primary_key == 1) + /*if ($field->primary_key == 1) { return $field->name; }*/ diff --git a/application/models/codex/Zgvgruppe_model.php b/application/models/codex/Zgvgruppe_model.php index 1b8cb2a69..69da70271 100644 --- a/application/models/codex/Zgvgruppe_model.php +++ b/application/models/codex/Zgvgruppe_model.php @@ -8,6 +8,6 @@ class Zgvgruppe_model extends DB_Model { parent::__construct(); $this->dbTable = 'bis.tbl_zgvgruppe'; - $this->pk = ''; + $this->pk = 'gruppe_kurzbz'; } } \ No newline at end of file diff --git a/application/models/organisation/Studiengang_model.php b/application/models/organisation/Studiengang_model.php index f2fc37ed5..661dabfd6 100644 --- a/application/models/organisation/Studiengang_model.php +++ b/application/models/organisation/Studiengang_model.php @@ -16,6 +16,13 @@ class Studiengang_model extends DB_Model */ public function getAllForBewerbung() { + // Checks if the operation is permitted by the API caller + if (! $this->fhc_db_acl->isBerechtigt($this->acl['lehre.vw_studienplan'], 's')) + return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl['lehre.vw_studienplan'], FHC_MODEL_ERROR); + + if (! $this->fhc_db_acl->isBerechtigt($this->acl['bis.tbl_lgartcode'], 's')) + return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl['bis.tbl_lgartcode'], FHC_MODEL_ERROR); + $allForBewerbungQuery = "SELECT DISTINCT studiengang_kz, typ, organisationseinheittyp_kurzbz, @@ -29,13 +36,8 @@ class Studiengang_model extends DB_Model AND aktiv IS TRUE ORDER BY typ, studiengangbezeichnung, tbl_lgartcode.bezeichnung ASC"; - // Checks if the operation is permitted by the API caller - if (! $this->fhc_db_acl->isBerechtigt($this->acl['lehre.vw_studienplan'], 's')) - return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl['lehre.vw_studienplan'], FHC_MODEL_ERROR); + $result = $this->db->query($allForBewerbungQuery); - if (! $this->fhc_db_acl->isBerechtigt($this->acl['bis.tbl_lgartcode'], 's')) - return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl['lehre.vw_studienplan'], FHC_MODEL_ERROR); - - return $this->db->query($allForBewerbungQuery); + return $this->_success($result->result()); } } \ No newline at end of file diff --git a/application/models/person/Kontakt_model.php b/application/models/person/Kontakt_model.php index 8bd905641..5c25f563e 100644 --- a/application/models/person/Kontakt_model.php +++ b/application/models/person/Kontakt_model.php @@ -1,7 +1,6 @@ dbTable = 'public.tbl_kontakt'; $this->pk = 'kontakt_id'; } - - public function saveKontakt($kontakt) - { - //TODO check berechtigung -// if ($this->fhc_db_acl->bb->isBerechtigt('person', 'sui')) -// { - $data = array( - "person_id"=>$kontakt["person_id"], - "kontakttyp"=>$kontakt["kontakttyp"], - "kontakt"=>$kontakt["kontakt"], - "insertvon"=>$kontakt["insertvon"], - "insertamum"=>date('Y-m-d H:i:s') - ); - if($this->db->insert("public.tbl_kontakt", $data)){ - return $this->db->insert_id(); - } - else - { - return false; - } -// } -// else -// { -// return "Nicht berechtigt"; -// } - } - - public function getKontaktPerson($person_id) - { - $this->db->select("*") - ->from("public.tbl_kontakt k") - ->where("k.person_id", $person_id); - - return $this->db->get()->result_array(); - } -} +} \ No newline at end of file diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php index 1a9192a88..f14de0bd8 100644 --- a/application/models/person/Person_model.php +++ b/application/models/person/Person_model.php @@ -15,41 +15,57 @@ class Person_model extends DB_Model /** * */ - /*public function checkBewerbung($email, $studiensemester_kurzbz = NULL) + public function checkBewerbung($email, $studiensemester_kurzbz = NULL) { - $this->db->distinct(); - + // Checks if the operation is permitted by the API caller + if (! $this->fhc_db_acl->isBerechtigt($this->acl['public.tbl_person'], 's')) + return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl['public.tbl_person'], FHC_MODEL_ERROR); + + if (! $this->fhc_db_acl->isBerechtigt($this->acl['public.tbl_kontakt'], 's')) + return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl['public.tbl_kontakt'], FHC_MODEL_ERROR); + + if (! $this->fhc_db_acl->isBerechtigt($this->acl['public.tbl_benutzer'], 's')) + return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl['public.tbl_benutzer'], FHC_MODEL_ERROR); + + if (! $this->fhc_db_acl->isBerechtigt($this->acl['public.tbl_prestudent'], 's')) + return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl['public.tbl_prestudent'], FHC_MODEL_ERROR); + + if (! $this->fhc_db_acl->isBerechtigt($this->acl['public.tbl_prestudentstatus'], 's')) + return $this->_error(lang('fhc_'.FHC_NORIGHT).' -> '.$this->acl['public.tbl_prestudentstatus'], FHC_MODEL_ERROR); + + $result = NULL; + if(is_null($studiensemester_kurzbz)) { - $this->db->select("p.person_id, p.zugangscode, p.insertamum") - ->from("public.tbl_person p") - ->join("public.tbl_kontakt k", "p.person_id=k.person_id") - ->join("public.tbl_benutzer b", "p.person_id=b.person_id", "left") - ->where("k.kontakttyp", 'email') - ->where("(kontakt='" . $email . "'" . - " OR alias ||'@technikum-wien.at'='" . $email . "'" . - " OR uid ||'@technikum-wien.at'='" . $email . "')") - ->order_by("p.insertamum", "DESC") - ->limit(1) - ; + $checkBewerbungQuery = "SELECT DISTINCT p.person_id, p.zugangscode, p.insertamum + FROM public.tbl_person p JOIN public.tbl_kontakt k ON p.person_id = k.person_id + LEFT JOIN public.tbl_benutzer b ON p.person_id = b.person_id + WHERE k.kontakttyp = 'email' + AND (kontakt = ? OR alias || '@technikum-wien.at' = ? OR uid || '@technikum-wien.at' = ?) + ORDER BY p.insertamum DESC + LIMIT 1"; + + $result = $this->db->query($checkBewerbungQuery, array($email, $email, $email)); } else { - $this->db->select("p.person_id,p.zugangscode,p.insertamum") - ->from("public.tbl_person p") - ->join("public.tbl_kontakt k", "p.person_id=k.person_id") - ->join("public.tbl_benutzer b", "p.person_id=b.person_id", "left") - ->join("public.tbl_prestudent ps", "p.person_id=ps.person_id") - ->join("public.tbl_prestudentstatus pst", "pst.prestudent_id=ps.prestudent_id") - ->where("k.kontakttyp", 'email') - ->where("(kontakt='" . $email . "'" . - " OR alias ||'@technikum-wien.at'='" . $email . "'" . - " OR uid ||'@technikum-wien.at'='" . $email . "')") - ->where("studiensemester_kurzbz='" . $studiensemester_kurzbz . "'") - ->order_by("p.insertamum", "DESC") - ->limit(1) - ; + $checkBewerbungQuery = "SELECT DISTINCT p.person_id, p.zugangscode, p.insertamum + FROM public.tbl_person p JOIN public.tbl_kontakt k ON p.person_id = k.person_id + LEFT JOIN public.tbl_benutzer b ON p.person_id = b.person_id + JOIN public.tbl_prestudent ps ON p.person_id = ps.person_id + JOIN public.tbl_prestudentstatus pst ON pst.prestudent_id = ps.prestudent_id + WHERE k.kontakttyp = 'email' + AND (kontakt = ? OR alias || '@technikum-wien.at' = ? OR uid || '@technikum-wien.at' = ?) + AND studiensemester_kurzbz = ? + ORDER BY p.insertamum DESC + LIMIT 1"; + + $result = $this->db->query($checkBewerbungQuery, array($email, $email, $email, $studiensemester_kurzbz)); } - return $this->db->get()->result_array(); - }*/ -} \ No newline at end of file + + if(is_object($result)) + return $this->_success($result->result()); + else + return $this->_error($this->db->error(), FHC_DB_ERROR); + } +} diff --git a/application/models/system/Message_model.php b/application/models/system/Message_model.php index 059ff2d45..d2f503eea 100644 --- a/application/models/system/Message_model.php +++ b/application/models/system/Message_model.php @@ -1,3582 +1,602 @@ + - - - - - - +class Message_model extends DB_Model +{ + /** + * Constructor + */ + public function __construct() + { + parent::__construct(); + require_once APPPATH.'config/message.php'; + $this->lang->load('message'); + $this->dbTable = 'public.tbl_msg_message'; + $this->pk = 'message_id'; + } + + /** ----------------------------------------------------------------- + * getMessage() - will return a single message, including the status for specified user. + * + * @param integer $msg_id EQUIRED + * @param integer $person_id REQUIRED + * @return array + */ + function getMessage($msg_id, $person_id) + { + // Validate + if (empty($msg_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_MSG_ID); + } + if (empty($person_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_USER_ID); + } + $sql = 'SELECT m.*, s.status, t.subject, ' . "CONCAT(vorname, ' ', nachname) as user_name" . + ' FROM ' . $this->db->dbprefix . 'tbl_msg_message m ' . + ' JOIN ' . $this->db->dbprefix . 'tbl_msg_thread t ON (m.thread_id = t.thread_id) ' . + ' JOIN ' . $this->db->dbprefix . 'public.tbl_person' . ' ON (' . 'tbl_person.person_id' . ' = m.sender_id) '. + ' JOIN ' . $this->db->dbprefix . 'tbl_msg_status s ON (s.message_id = m.message_id AND s.person_id = ? ) ' . + ' WHERE m.message_id = ? ' ; + $result = $this->db->query($sql, array($person_id, $msg_id)); + if ($result) + return $this->_success($result->result_array()); + else + return $this->_general_error(); + } + /** ----------------------------------------------------------------- + * Get a Full Thread + * get_full_thread() - will return a entire thread, including the status for specified user. + * + * @param integer $thread_id REQUIRED + * @param integer $person_id REQUIRED + * @param boolean $full_thread OPTIONAL - If true, user will also see messages from thread posted BEFORE user became participant + * @param string $order_by OPTIONAL + * @return array + */ + function get_full_thread($thread_id, $person_id, $full_thread = FALSE, $order_by = 'ASC') + { + // Validate + if (empty($thread_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_THREAD_ID); + } + if (empty($person_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_USER_ID); + } + $sql = 'SELECT m.*, s.status, t.subject, '."CONCAT(vorname, ' ', nachname) as user_name" . + ' FROM ' . $this->db->dbprefix . 'tbl_msg_participant p ' . + ' JOIN ' . $this->db->dbprefix . 'tbl_msg_thread t ON (t.thread_id = p.thread_id) ' . + ' JOIN ' . $this->db->dbprefix . 'tbl_msg_message m ON (m.thread_id = t.thread_id) ' . + ' JOIN ' . $this->db->dbprefix . 'public.tbl_person' . ' ON (' . 'tbl_person.person_id' . ' = m.sender_id) '. + ' JOIN ' . $this->db->dbprefix . 'tbl_msg_status s ON (s.message_id = m.message_id AND s.person_id = ? ) ' . + ' WHERE p.person_id = ? ' . + ' AND p.thread_id = ? '; + if ( ! $full_thread) + { + $sql .= ' AND m.cdate >= p.cdate'; + } + $sql .= ' ORDER BY m.cdate ' . $order_by; + $result = $this->db->query($sql, array($person_id, $person_id, $thread_id)); + if ($result) + return $this->_success($result->result_array()); + else + return $this->_general_error(); + } + /** ----------------------------------------------------------------- + * get_all_threads() - will return all threads for user, including the status for specified user. + * + * @param integer $person_id REQUIRED + * @param boolean $full_thread OPTIONAL - If true, user will also see messages from thread posted BEFORE user became participant + * @param string $order_by OPTIONAL + * @return array + */ + function get_all_threads($person_id, $full_thread = FALSE, $order_by = 'asc') + { + if (empty($person_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_USER_ID); + } + $sql = 'SELECT m.*, s.status, t.subject, '."CONCAT(vorname, ' ', nachname) as user_name" . + ' FROM ' . $this->db->dbprefix . 'tbl_msg_participant p ' . + ' JOIN ' . $this->db->dbprefix . 'tbl_msg_thread t ON (t.thread_id = p.thread_id) ' . + ' JOIN ' . $this->db->dbprefix . 'tbl_msg_message m ON (m.thread_id = t.thread_id) ' . + ' JOIN ' . $this->db->dbprefix . 'public.tbl_person' . ' ON (' . 'tbl_person.person_id' . ' = m.sender_id) '. + ' JOIN ' . $this->db->dbprefix . 'tbl_msg_status s ON (s.message_id = m.message_id AND s.person_id = ? ) ' . + ' WHERE p.person_id = ? ' ; + if (!$full_thread) + { + $sql .= ' AND m.cdate >= p.cdate'; + } + $sql .= ' ORDER BY t.thread_id ' . $order_by. ', m.cdate '. $order_by; + $result = $this->db->query($sql, array($person_id, $person_id)); + if ($result) + return $this->_success($result->result_array()); + else + return $this->_general_error(); + } + /** ----------------------------------------------------------------- + * Get all Threads Grouped + * get_all_threads_grouped() - will return all threads for user, including the status for specified user. + * - messages are grouped in threads. + * + * @param integer $person_id REQUIRED + * @param boolean $full_thread OPTIONAL - If true, user will also see messages from thread posted BEFORE user became participant + * @param string $order_by OPTIONAL + * @return array + */ + function get_all_threads_grouped($person_id, $full_thread = FALSE, $order_by = 'ASC') + { + if (empty($person_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_USER_ID); + } + $message = $this->get_all_threads($person_id, $full_thread, $order_by); + if (is_array($message)) + { + $threads = array(); + foreach ($message as $msg) + { + if ( ! isset($threads[$msg['thread_id']])) + { + $threads[$msg['thread_id']]['thread_id'] = $msg['thread_id']; + $threads[$msg['thread_id']]['messages'] = array($msg); + } + else + { + $threads[$msg['thread_id']]['messages'][] = $msg; + } + } + return $this->_success($threads); + } + // General Error Occurred + return $this->_general_error(); + } + /** ----------------------------------------------------------------- + * Change Message Status + * update_message_status() - will change status on message for particular user + * + * @param integer $msg_id REQUIRED + * @param integer $person_id REQUIRED + * @param integer $status_id REQUIRED - should come from config/message.php list of constants + * @return array + */ + function update_message_status($msg_id, $person_id, $status_id) + { + // Validate + if (empty($msg_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_MSG_ID); + } + if (empty($person_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_USER_ID); + } + if (empty($status_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_STATUS_ID); + } + $this->db->where(array('message_id' => $msg_id, 'person_id' => $person_id )); + $this->db->update('tbl_msg_status', array('status' => $status_id )); + $rows = $this->db->affected_rows(); + if ($rows == 1) + return $this->_success($rows, MSG_STATUS_UPDATE); + else + return $this->_general_error(); + } + /** ----------------------------------------------------------------- + * Add a Participant + * add_participant() - adds user to existing thread + * + * @param integer $thread_id REQUIRED + * @param integer $person_id REQUIRED + * @return array + */ + function addParticipant($thread_id, $person_id) + { + + if (empty($thread_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_THREAD_ID); + } + if (empty($person_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_USER_ID); + } + if ( ! $this->valid_new_participant($thread_id, $person_id)) + { + $this->_participant_error(MSG_ERR_PARTICIPANT_EXISTS); + } + if ( ! $this->application_user($person_id)) + { + $this->_participant_error(MSG_ERR_PARTICIPANT_NONSYSTEM); + } + $this->db->trans_start(); + $participants[] = array('thread_id' => $thread_id,'person_id' => $person_id); + $this->_insert_participants($participants); + // Get Messages by Thread + $messages = $this->_get_messages_by_thread_id($thread_id); + foreach ($messages as $message) + { + $statuses[] = array('message_id' => $message['message_id'], 'person_id' => $person_id, 'status' => MSG_STATUS_UNREAD); + } + $this->_insert_statuses($statuses); + $this->db->trans_complete(); + if ($this->db->trans_status() === FALSE) + { + $this->db->trans_rollback(); + return $this->_general_error(); + } + return $this->_success(NULL, MSG_PARTICIPANT_ADDED); + } + /** --------------------------------------------------------------- + * Remove a Participant + * remove_participant() - removes user from existing thread + * + * @param integer $thread_id REQUIRED + * @param integer $person_id REQUIRED + * @return array + */ + function remove_participant($thread_id, $person_id) + { + // Validate + if (empty($thread_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_THREAD_ID); + } + if (empty($person_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_USER_ID); + } + $this->db->trans_start(); + $this->_delete_participant($thread_id, $person_id); + $this->_delete_statuses($thread_id, $person_id); + $this->db->trans_complete(); + if ($this->db->trans_status() === FALSE) + { + $this->db->trans_rollback(); + return $this->_success(NULL, MSG_PARTICIPANT_REMOVED); + } + return $this->_general_error(); + } + /** ---------------------------------------------------------------- + * Send a New Message + * send_new_message() - sends new internal message. This function will create a new thread + * + * @param integer $sender_id REQUIRED + * @param mixed $recipients REQUIRED - a single integer or an array of integers, representing person_ids + * @param string $subject + * @param string $body + * @param integer $priority + * @return array + */ + function send_new_message($sender_id, $recipients, $subject, $body, $priority) + { + // Validate + if (empty($sender_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_SENDER_ID); + } + if (empty($recipients)) + { + return array( + 'err' => 1, + 'code' => MSG_ERR_INVALID_RECIPIENTS, + 'msg' => lang('mahana_'.MSG_ERR_INVALID_RECIPIENTS) + ); + } + $this->db->trans_start(); + $thread_id = $this->_insert_thread($subject); + $msg_id = $this->_insert_message($thread_id, $sender_id, $body, $priority); + // Create batch inserts + $participants[] = array('thread_id' => $thread_id,'person_id' => $sender_id); + $statuses[] = array('message_id' => $msg_id, 'person_id' => $sender_id,'status' => MSG_STATUS_READ); + if ( ! is_array($recipients) ) + { + if ($sender_id != $recipients) + { + $participants[] = array('thread_id' => $thread_id,'person_id' => $recipients); + $statuses[] = array('message_id' => $msg_id, 'person_id' => $recipients, 'status' => MSG_STATUS_UNREAD); + } + } + else + { + foreach ($recipients as $recipient) + { + if ($sender_id != $recipient) + { + $participants[] = array('thread_id' => $thread_id,'person_id' => $recipient); + $statuses[] = array('message_id' => $msg_id, 'person_id' => $recipient, 'status' => MSG_STATUS_UNREAD); + } + } + } + $participants=array_unique($participants, SORT_REGULAR); // Clean if sender and recipient is the same + $this->_insert_participants($participants); + $this->_insert_statuses($statuses); + $this->db->trans_complete(); + if ($this->db->trans_status() === FALSE) + { + $this->db->trans_rollback(); + return $this->_general_error(); + } + return $this->_success($thread_id, MSG_MESSAGE_SENT); + } + /** -------------------------------------------------------------- + * Reply to Message + * reply_to_message() - replies to internal message. This function will NOT create a new thread or participant list + * + * @param integer $msg_id REQUIRED + * @param integer $sender_id REQUIRED + * @param string $subject + * @param string $body + * @param integer $priority + * @return array + */ + function reply_to_message($reply_msg_id, $sender_id, $body, $priority) + { + // Validate + if (empty($sender_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_SENDER_ID); + } + if (empty($msg_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_MSG_ID); + } + $this->db->trans_start(); + // Get the thread id to keep messages together + if ( ! $thread_id = $this->_get_thread_id_from_message($reply_msg_id)) + { + return FALSE; + } + // Add this message + $msg_id = $this->_insert_message($thread_id, $sender_id, $body, $priority); + if ($recipients = $this->_get_thread_participants($thread_id, $sender_id)) + { + $statuses[] = array('message_id' => $msg_id, 'person_id' => $sender_id,'status' => MSG_STATUS_READ); + foreach ($recipients as $recipient) + { + $statuses[] = array('message_id' => $msg_id, 'person_id' => $recipient['person_id'], 'status' => MSG_STATUS_UNREAD); + } + $this->_insert_statuses($statuses); + } + $this->db->trans_complete(); + if ($this->db->trans_status() === FALSE) + { + $this->db->trans_rollback(); + return $this->_general_error(); + } + return $this->_success($msg_id, MSG_MESSAGE_SENT); + } + /** ---------------------------------------------------------------- + * Get Participant List + * get_participant_list() - returns list of participants on given thread. If sender_id set, sender_id will be left off list + * + * @param integer $thread_id REQUIRED + * @param integer $sender_id REQUIRED + * @return array + */ + function get_participant_list($thread_id, $sender_id = 0) + { + // Validate + if (empty($thread_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_THREAD_ID); + } + + if ($results = $this->_get_thread_participants($thread_id, $sender_id)) + return $this->_success($results); + else + return $this->_general_error(); + } + /** ---------------------------------------------------------------- + * Get Message Count + * get_msg_count() - returns integer with count of message for user, by status. defaults to new messages + * + * @param integer $person_id REQUIRED + * @param integer $status_id OPTIONAL - defaults to "Unread" + * @return array + */ + function get_msg_count($person_id, $status_id = MSG_STATUS_UNREAD) + { + if (empty($person_id)) + { + return $this->_invalid_id(MSG_ERR_INVALID_USER_ID); + } + $result = $this->db->select('COUNT(*) AS msg_count')->where(array('person_id' => $person_id, 'status' => $status_id ))->get('tbl_msg_status'); + $rows = $result->row()->msg_count; + + if (is_numeric($rows)) + return $this->_success($rows); + else + return $this->_general_error(); + } + // ------------------------------------------------------------------------ + /** + * Valid New Participant - because of CodeIgniter's DB Class return style, + * it is safer to check for uniqueness first + * + * @param integer $thread_id + * @param integer $person_id + * @return boolean + */ + function valid_new_participant($thread_id, $person_id) + { + $sql = 'SELECT COUNT(*) AS count ' . + ' FROM ' . $this->db->dbprefix . 'tbl_msg_participant p ' . + ' WHERE p.thread_id = ? ' . + ' AND p.person_id = ? '; + $query = $this->db->query($sql, array($thread_id, $person_id)); + if ($query->row()->count) + { + return FALSE; + } + return TRUE; + } - - - - - - - - - - - - - - FHC-Core/Message_model.php at ci · FH-Complete/FHC-Core - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- Skip to content - - - - - - - - - - - - - -
- -
-
- - -
-
-
- -
-
- - - -
    - -
  • -
    - -
    - - - - Unwatch - - - - -
    - -
    -
    -
    -
  • - -
  • - -
    - -
    - - -
    -
    - - -
    - -
  • - -
  • - - - Fork - - - - - -
  • -
- -

- - /FHC-Core - -

- -
- -
- -
-
- - - - - - - -
+ /** --------------------------------------------------------------- + * Application User + * + * @param integer $person_id` + * @return boolean + */ + function application_user($person_id) + { + $sql = 'SELECT COUNT(*) AS count ' . + ' FROM ' . $this->db->dbprefix . 'public.tbl_person' . + ' WHERE ' . 'tbl_person.person_id' . ' = ?' ; + $query = $this->db->query($sql, array($person_id)); + if ($query->row()->count) + { + return TRUE; + } + return FALSE; + } -
- - - -
- -
- - Find file - - -
- -
- - -
- - - 3b39752 - - - - - -
- - -
- - -
- -
-
-
- -
- Raw - Blame - History -
- - - - - -
- -
- -
- -
- 704 lines (589 sloc) - - 21.1 KB -
-
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Message_model extends DB_Model
{
public function __construct()
{
parent::__construct();
require_once APPPATH.'config/message.php';
//$this->load->helper('language');
$this->lang->load('message');
}
/** -----------------------------------------------------------------
* get_message() - will return a single message, including the status for specified user.
*
* @param integer $msg_id EQUIRED
* @param integer $user_id REQUIRED
* @return array
*/
function getMessage($msg_id, $user_id)
{
// Validate
if (empty($msg_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_MSG_ID);
}
if (empty($user_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_USER_ID);
}
$sql = 'SELECT m.*, s.status, t.subject, ' . USER_TABLE_USERNAME .
' FROM ' . $this->db->dbprefix . 'msg_messages m ' .
' JOIN ' . $this->db->dbprefix . 'msg_threads t ON (m.thread_id = t.id) ' .
' JOIN ' . $this->db->dbprefix . USER_TABLE_TABLENAME . ' ON (' . USER_TABLE_ID . ' = m.sender_id) '.
' JOIN ' . $this->db->dbprefix . 'msg_status s ON (s.message_id = m.id AND s.user_id = ? ) ' .
' WHERE m.id = ? ' ;
$result = $this->db->query($sql, array($user_id, $msg_id));
if ($result)
return $this->_success($result->result_array());
else
return $this->_general_error();
}
/** -----------------------------------------------------------------
* Get a Full Thread
* get_full_thread() - will return a entire thread, including the status for specified user.
*
* @param integer $thread_id REQUIRED
* @param integer $user_id REQUIRED
* @param boolean $full_thread OPTIONAL - If true, user will also see messages from thread posted BEFORE user became participant
* @param string $order_by OPTIONAL
* @return array
*/
function get_full_thread($thread_id, $user_id, $full_thread = FALSE, $order_by = 'ASC')
{
// Validate
if (empty($thread_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_THREAD_ID);
}
if (empty($user_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_USER_ID);
}
$sql = 'SELECT m.*, s.status, t.subject, '.USER_TABLE_USERNAME .
' FROM ' . $this->db->dbprefix . 'msg_participants p ' .
' JOIN ' . $this->db->dbprefix . 'msg_threads t ON (t.id = p.thread_id) ' .
' JOIN ' . $this->db->dbprefix . 'msg_messages m ON (m.thread_id = t.id) ' .
' JOIN ' . $this->db->dbprefix . USER_TABLE_TABLENAME . ' ON (' . USER_TABLE_ID . ' = m.sender_id) '.
' JOIN ' . $this->db->dbprefix . 'msg_status s ON (s.message_id = m.id AND s.user_id = ? ) ' .
' WHERE p.user_id = ? ' .
' AND p.thread_id = ? ';
if ( ! $full_thread)
{
$sql .= ' AND m.cdate >= p.cdate';
}
$sql .= ' ORDER BY m.cdate ' . $order_by;
$result = $this->db->query($sql, array($user_id, $user_id, $thread_id));
if ($result)
return $this->_success($result->result_array());
else
return $this->_general_error();
}
/** -----------------------------------------------------------------
* get_all_threads() - will return all threads for user, including the status for specified user.
*
* @param integer $user_id REQUIRED
* @param boolean $full_thread OPTIONAL - If true, user will also see messages from thread posted BEFORE user became participant
* @param string $order_by OPTIONAL
* @return array
*/
function get_all_threads($user_id, $full_thread = FALSE, $order_by = 'asc')
{
if (empty($user_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_USER_ID);
}
$sql = 'SELECT m.*, s.status, t.subject, '.USER_TABLE_USERNAME .
' FROM ' . $this->db->dbprefix . 'msg_participants p ' .
' JOIN ' . $this->db->dbprefix . 'msg_threads t ON (t.id = p.thread_id) ' .
' JOIN ' . $this->db->dbprefix . 'msg_messages m ON (m.thread_id = t.id) ' .
' JOIN ' . $this->db->dbprefix . USER_TABLE_TABLENAME . ' ON (' . USER_TABLE_ID . ' = m.sender_id) '.
' JOIN ' . $this->db->dbprefix . 'msg_status s ON (s.message_id = m.id AND s.user_id = ? ) ' .
' WHERE p.user_id = ? ' ;
if (!$full_thread)
{
$sql .= ' AND m.cdate >= p.cdate';
}
$sql .= ' ORDER BY t.id ' . $order_by. ', m.cdate '. $order_by;
$result = $this->db->query($sql, array($user_id, $user_id));
if ($result)
return $this->_success($result->result_array());
else
return $this->_general_error();
}
/** -----------------------------------------------------------------
* Get all Threads Grouped
* get_all_threads_grouped() - will return all threads for user, including the status for specified user.
* - messages are grouped in threads.
*
* @param integer $user_id REQUIRED
* @param boolean $full_thread OPTIONAL - If true, user will also see messages from thread posted BEFORE user became participant
* @param string $order_by OPTIONAL
* @return array
*/
function get_all_threads_grouped($user_id, $full_thread = FALSE, $order_by = 'ASC')
{
if (empty($user_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_USER_ID);
}
$message = $this->get_all_threads($user_id, $full_thread, $order_by);
if (is_array($message))
{
$threads = array();
foreach ($message as $msg)
{
if ( ! isset($threads[$msg['thread_id']]))
{
$threads[$msg['thread_id']]['thread_id'] = $msg['thread_id'];
$threads[$msg['thread_id']]['messages'] = array($msg);
}
else
{
$threads[$msg['thread_id']]['messages'][] = $msg;
}
}
return $this->_success($threads);
}
// General Error Occurred
return $this->_general_error();
}
/** -----------------------------------------------------------------
* Change Message Status
* update_message_status() - will change status on message for particular user
*
* @param integer $msg_id REQUIRED
* @param integer $user_id REQUIRED
* @param integer $status_id REQUIRED - should come from config/message.php list of constants
* @return array
*/
function update_message_status($msg_id, $user_id, $status_id)
{
// Validate
if (empty($msg_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_MSG_ID);
}
if (empty($user_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_USER_ID);
}
if (empty($status_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_STATUS_ID);
}
$this->db->where(array('message_id' => $msg_id, 'user_id' => $user_id ));
$this->db->update('msg_status', array('status' => $status_id ));
$rows = $this->db->affected_rows();
if ($rows == 1)
return $this->_success($rows, MSG_STATUS_UPDATE);
else
return $this->_general_error();
}
/** -----------------------------------------------------------------
* Add a Participant
* add_participant() - adds user to existing thread
*
* @param integer $thread_id REQUIRED
* @param integer $user_id REQUIRED
* @return array
*/
function add_participant($thread_id, $user_id)
{
if (empty($thread_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_THREAD_ID);
}
if (empty($user_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_USER_ID);
}
if ( ! $this->valid_new_participant($thread_id, $user_id))
{
$this->_participant_error(MSG_ERR_PARTICIPANT_EXISTS);
}
if ( ! $this->application_user($user_id))
{
$this->_participant_error(MSG_ERR_PARTICIPANT_NONSYSTEM);
}
$this->db->trans_start();
$participants[] = array('thread_id' => $thread_id,'user_id' => $user_id);
$this->_insert_participants($participants);
// Get Messages by Thread
$messages = $this->_get_messages_by_thread_id($thread_id);
foreach ($messages as $message)
{
$statuses[] = array('message_id' => $message['id'], 'user_id' => $user_id, 'status' => MSG_STATUS_UNREAD);
}
$this->_insert_statuses($statuses);
$this->db->trans_complete();
if ($this->db->trans_status() === FALSE)
{
$this->db->trans_rollback();
return $this->_general_error();
}
return $this->_success(NULL, MSG_PARTICIPANT_ADDED);
}
/** ---------------------------------------------------------------
* Remove a Participant
* remove_participant() - removes user from existing thread
*
* @param integer $thread_id REQUIRED
* @param integer $user_id REQUIRED
* @return array
*/
function remove_participant($thread_id, $user_id)
{
// Validate
if (empty($thread_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_THREAD_ID);
}
if (empty($user_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_USER_ID);
}
$this->db->trans_start();
$this->_delete_participant($thread_id, $user_id);
$this->_delete_statuses($thread_id, $user_id);
$this->db->trans_complete();
if ($this->db->trans_status() === FALSE)
{
$this->db->trans_rollback();
return $this->_success(NULL, MSG_PARTICIPANT_REMOVED);
}
return $this->_general_error();
}
/** ----------------------------------------------------------------
* Send a New Message
* send_new_message() - sends new internal message. This function will create a new thread
*
* @param integer $sender_id REQUIRED
* @param mixed $recipients REQUIRED - a single integer or an array of integers, representing user_ids
* @param string $subject
* @param string $body
* @param integer $priority
* @return array
*/
function send_new_message($sender_id, $recipients, $subject, $body, $priority)
{
// Validate
if (empty($sender_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_SENDER_ID);
}
if (empty($recipients))
{
return array(
'err' => 1,
'code' => MSG_ERR_INVALID_RECIPIENTS,
'msg' => lang('mahana_'.MSG_ERR_INVALID_RECIPIENTS)
);
}
$this->db->trans_start();
$thread_id = $this->_insert_thread($subject);
$msg_id = $this->_insert_message($thread_id, $sender_id, $body, $priority);
// Create batch inserts
$participants[] = array('thread_id' => $thread_id,'user_id' => $sender_id);
$statuses[] = array('message_id' => $msg_id, 'user_id' => $sender_id,'status' => MSG_STATUS_READ);
if ( ! is_array($recipients) )
{
if ($sender_id != $recipients)
{
$participants[] = array('thread_id' => $thread_id,'user_id' => $recipients);
$statuses[] = array('message_id' => $msg_id, 'user_id' => $recipients, 'status' => MSG_STATUS_UNREAD);
}
}
else
{
foreach ($recipients as $recipient)
{
if ($sender_id != $recipient)
{
$participants[] = array('thread_id' => $thread_id,'user_id' => $recipient);
$statuses[] = array('message_id' => $msg_id, 'user_id' => $recipient, 'status' => MSG_STATUS_UNREAD);
}
}
}
$participants=array_unique($participants, SORT_REGULAR); // Clean if sender and recipient is the same
$this->_insert_participants($participants);
$this->_insert_statuses($statuses);
$this->db->trans_complete();
if ($this->db->trans_status() === FALSE)
{
$this->db->trans_rollback();
return $this->_general_error();
}
return $this->_success($thread_id, MSG_MESSAGE_SENT);
}
/** --------------------------------------------------------------
* Reply to Message
* reply_to_message() - replies to internal message. This function will NOT create a new thread or participant list
*
* @param integer $msg_id REQUIRED
* @param integer $sender_id REQUIRED
* @param string $subject
* @param string $body
* @param integer $priority
* @return array
*/
function reply_to_message($reply_msg_id, $sender_id, $body, $priority)
{
// Validate
if (empty($sender_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_SENDER_ID);
}
if (empty($msg_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_MSG_ID);
}
$this->db->trans_start();
// Get the thread id to keep messages together
if ( ! $thread_id = $this->_get_thread_id_from_message($reply_msg_id))
{
return FALSE;
}
// Add this message
$msg_id = $this->_insert_message($thread_id, $sender_id, $body, $priority);
if ($recipients = $this->_get_thread_participants($thread_id, $sender_id))
{
$statuses[] = array('message_id' => $msg_id, 'user_id' => $sender_id,'status' => MSG_STATUS_READ);
foreach ($recipients as $recipient)
{
$statuses[] = array('message_id' => $msg_id, 'user_id' => $recipient['user_id'], 'status' => MSG_STATUS_UNREAD);
}
$this->_insert_statuses($statuses);
}
$this->db->trans_complete();
if ($this->db->trans_status() === FALSE)
{
$this->db->trans_rollback();
return $this->_general_error();
}
return $this->_success($msg_id, MSG_MESSAGE_SENT);
}
/** ----------------------------------------------------------------
* Get Participant List
* get_participant_list() - returns list of participants on given thread. If sender_id set, sender_id will be left off list
*
* @param integer $thread_id REQUIRED
* @param integer $sender_id REQUIRED
* @return array
*/
function get_participant_list($thread_id, $sender_id = 0)
{
// Validate
if (empty($thread_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_THREAD_ID);
}
if ($results = $this->_get_thread_participants($thread_id, $sender_id))
return $this->_success($results);
else
return $this->_general_error();
}
/** ----------------------------------------------------------------
* Get Message Count
* get_msg_count() - returns integer with count of message for user, by status. defaults to new messages
*
* @param integer $user_id REQUIRED
* @param integer $status_id OPTIONAL - defaults to "Unread"
* @return array
*/
function get_msg_count($user_id, $status_id = MSG_STATUS_UNREAD)
{
if (empty($user_id))
{
return $this->_invalid_id(MSG_ERR_INVALID_USER_ID);
}
$result = $this->db->select('COUNT(*) AS msg_count')->where(array('user_id' => $user_id, 'status' => $status_id ))->get('msg_status');
$rows = $result->row()->msg_count;
if (is_numeric($rows))
return $this->_success($rows);
else
return $this->_general_error();
}
// ------------------------------------------------------------------------
/**
* Valid New Participant - because of CodeIgniter's DB Class return style,
* it is safer to check for uniqueness first
*
* @param integer $thread_id
* @param integer $user_id
* @return boolean
*/
function valid_new_participant($thread_id, $user_id)
{
$sql = 'SELECT COUNT(*) AS count ' .
' FROM ' . $this->db->dbprefix . 'msg_participants p ' .
' WHERE p.thread_id = ? ' .
' AND p.user_id = ? ';
$query = $this->db->query($sql, array($thread_id, $user_id));
if ($query->row()->count)
{
return FALSE;
}
return TRUE;
}
/** ---------------------------------------------------------------
* Application User
*
* @param integer $user_id`
* @return boolean
*/
function application_user($user_id)
{
$sql = 'SELECT COUNT(*) AS count ' .
' FROM ' . $this->db->dbprefix . USER_TABLE_TABLENAME .
' WHERE ' . USER_TABLE_ID . ' = ?' ;
$query = $this->db->query($sql, array($user_id));
if ($query->row()->count)
{
return TRUE;
}
return FALSE;
}
// ------------------------------------------------------------------------
// Private Functions from here out!
// ------------------------------------------------------------------------
/**
* Insert Thread
*
* @param string $subject
* @return integer
*/
private function _insert_thread($subject)
{
$insert_id = $this->db->insert('msg_threads', array('subject' => $subject));
return $this->db->insert_id();
}
/**
* Insert Message
*
* @param integer $thread_id
* @param integer $sender_id
* @param string $body
* @param integer $priority
* @return integer
*/
private function _insert_message($thread_id, $sender_id, $body, $priority)
{
$insert['thread_id'] = $thread_id;
$insert['sender_id'] = $sender_id;
$insert['body'] = $body;
$insert['priority'] = $priority;
$insert_id = $this->db->insert('msg_messages', $insert);
return $this->db->insert_id();
}
/**
* Insert Participants
*
* @param array $participants
* @return bool
*/
private function _insert_participants($participants)
{
return $this->db->insert_batch('msg_participants', $participants);
}
/**
* Insert Statuses
*
* @param array $statuses
* @return bool
*/
private function _insert_statuses($statuses)
{
return $this->db->insert_batch('msg_status', $statuses);
}
/**
* Get Thread ID from Message
*
* @param integer $msg_id
* @return integer
*/
private function _get_thread_id_from_message($msg_id)
{
$query = $this->db->select('thread_id')->get_where('msg_messages', array('id' => $msg_id));
if ($query->num_rows())
{
return $query->row()->thread_id;
}
return 0;
}
/**
* Get Messages by Thread
*
* @param integer $thread_id
* @return array
*/
private function _get_messages_by_thread_id($thread_id)
{
$query = $this->db->get_where('msg_messages', array('thread_id' => $thread_id));
return $query->result_array();
}
/**
* Get Thread Particpiants
*
* @param integer $thread_id
* @param integer $sender_id
* @return array
*/
private function _get_thread_participants($thread_id, $sender_id = 0)
{
$array['thread_id'] = $thread_id;
if ($sender_id) // If $sender_id 0, no one to exclude
{
$array['msg_participants.user_id != '] = $sender_id;
}
$this->db->select('msg_participants.user_id, '.USER_TABLE_USERNAME, FALSE);
$this->db->join(USER_TABLE_TABLENAME, 'msg_participants.user_id = ' . USER_TABLE_ID);
$query = $this->db->get_where('msg_participants', $array);
return $query->result_array();
}
/**
* Delete Participant
*
* @param integer $thread_id
* @param integer $user_id
* @return boolean
*/
private function _delete_participant($thread_id, $user_id)
{
$this->db->delete('msg_participants', array('thread_id' => $thread_id, 'user_id' => $user_id));
if ($this->db->affected_rows() > 0)
{
return TRUE;
}
return FALSE;
}
/**
* Delete Statuses
*
* @param integer $thread_id
* @param integer $user_id
* @return boolean
*/
private function _delete_statuses($thread_id, $user_id)
{
$sql = 'DELETE s FROM msg_status s ' .
' JOIN ' . $this->db->dbprefix . 'msg_messages m ON (m.id = s.message_id) ' .
' WHERE m.thread_id = ? ' .
' AND s.user_id = ? ';
$query = $this->db->query($sql, array($thread_id, $user_id));
return TRUE;
}
/** ---------------------------------------------------------------
* Error Particpant Exists
*
* @return array
*/
private function _participant_error($error = '')
{
return array(
'err' => 1,
'code' => 1,
'msg' => lang('mahana_' . $error)
);
}
}
/* end of file message_model.php */
- -
- -
- - - - -
- -
- - -
-
- -
- - - - - - - - -
- - - Something went wrong with that request. Please try again. -
- - - - - - - - - - - - - - - - + // ------------------------------------------------------------------------ + // Private Functions from here out! + // ------------------------------------------------------------------------ + /** + * Insert Thread + * + * @param string $subject + * @return integer + */ + private function _insert_thread($subject) + { + $insert_id = $this->db->insert('tbl_msg_thread', array('subject' => $subject)); + return $this->db->insert_id(); + } + /** + * Insert Message + * + * @param integer $thread_id + * @param integer $sender_id + * @param string $body + * @param integer $priority + * @return integer + */ + private function _insert_message($thread_id, $sender_id, $body, $priority) + { + $insert['thread_id'] = $thread_id; + $insert['sender_id'] = $sender_id; + $insert['body'] = $body; + $insert['priority'] = $priority; + $insert_id = $this->db->insert('tbl_msg_message', $insert); + return $this->db->insert_id(); + } + /** + * Insert Participants + * + * @param array $participants + * @return bool + */ + private function _insert_participants($participants) + { + return $this->db->insert_batch('tbl_msg_participant', $participants); + } + /** + * Insert Statuses + * + * @param array $statuses + * @return bool + */ + private function _insert_statuses($statuses) + { + return $this->db->insert_batch('tbl_msg_status', $statuses); + } + /** + * Get Thread ID from Message + * + * @param integer $msg_id + * @return integer + */ + private function _get_thread_id_from_message($msg_id) + { + $query = $this->db->select('thread_id')->get_where('tbl_msg_message', array('id' => $msg_id)); + if ($query->num_rows()) + { + return $query->row()->thread_id; + } + return 0; + } + /** + * Get Messages by Thread + * + * @param integer $thread_id + * @return array + */ + private function _get_messages_by_thread_id($thread_id) + { + $query = $this->db->get_where('tbl_msg_message', array('thread_id' => $thread_id)); + return $query->result_array(); + } + /** + * Get Thread Particpiants + * + * @param integer $thread_id + * @param integer $sender_id + * @return array + */ + private function _get_thread_participants($thread_id, $sender_id = 0) + { + $array['thread_id'] = $thread_id; + if ($sender_id) // If $sender_id 0, no one to exclude + { + $array['tbl_msg_participant.person_id != '] = $sender_id; + } + $this->db->select('tbl_msg_participant.person_id, '."CONCAT(vorname, ' ', nachname) as user_name", FALSE); + $this->db->join('public.tbl_person', 'tbl_msg_participant.person_id = ' . 'tbl_person.person_id'); + $query = $this->db->get_where('tbl_msg_participant', $array); + return $query->result_array(); + } + /** + * Delete Participant + * + * @param integer $thread_id + * @param integer $person_id + * @return boolean + */ + private function _delete_participant($thread_id, $person_id) + { + $this->db->delete('tbl_msg_participant', array('thread_id' => $thread_id, 'person_id' => $person_id)); + if ($this->db->affected_rows() > 0) + { + return TRUE; + } + return FALSE; + } + /** + * Delete Statuses + * + * @param integer $thread_id + * @param integer $person_id + * @return boolean + */ + private function _delete_statuses($thread_id, $person_id) + { + $sql = 'DELETE s FROM tbl_msg_status s ' . + ' JOIN ' . $this->db->dbprefix . 'tbl_msg_message m ON (m.message_id = s.message_id) ' . + ' WHERE m.thread_id = ? ' . + ' AND s.person_id = ? '; + $query = $this->db->query($sql, array($thread_id, $person_id)); + return TRUE; + } + /** --------------------------------------------------------------- + * Error Particpant Exists + * + * @return array + */ + private function _participant_error($error = '') + { + return array( + 'err' => 1, + 'code' => 1, + 'msg' => lang('mahana_' . $error) + ); + } +} +/* end of file message_model.php */ diff --git a/application/models/system/Server_model.php b/application/models/system/Server_model.php index 69fc16095..4521e1fd4 100644 --- a/application/models/system/Server_model.php +++ b/application/models/system/Server_model.php @@ -9,6 +9,6 @@ class Server_model extends DB_Model { parent::__construct(); $this->dbTable = 'system.tbl_server'; - $this->pk = ''; + $this->pk = 'server_kurzbz'; } -} +} \ No newline at end of file diff --git a/application/models/system/Thread_model.php b/application/models/system/Thread_model.php new file mode 100644 index 000000000..f5f1ee3ca --- /dev/null +++ b/application/models/system/Thread_model.php @@ -0,0 +1,14 @@ +dbTable = 'public.tbl_msg_thread'; + $this->pk = 'thread_id'; + } +} diff --git a/application/seeds/001_person.php b/application/seeds/001_person.php index 0605a351a..3045defde 100644 --- a/application/seeds/001_person.php +++ b/application/seeds/001_person.php @@ -1,6 +1,6 @@ + An uncaught Exception was encountered diff --git a/application/views/errors/cli/error_general.php b/application/views/errors/cli/error_general.php index 6984b61e9..6a59005eb 100755 --- a/application/views/errors/cli/error_general.php +++ b/application/views/errors/cli/error_general.php @@ -1,5 +1,5 @@ + A PHP Error was encountered diff --git a/application/views/errors/html/error_404.php b/application/views/errors/html/error_404.php index 756ea9d62..1e1e1cd25 100755 --- a/application/views/errors/html/error_404.php +++ b/application/views/errors/html/error_404.php @@ -1,5 +1,5 @@ diff --git a/application/views/errors/html/error_db.php b/application/views/errors/html/error_db.php index f5a43f638..61d449a3c 100755 --- a/application/views/errors/html/error_db.php +++ b/application/views/errors/html/error_db.php @@ -1,5 +1,5 @@ diff --git a/application/views/errors/html/error_exception.php b/application/views/errors/html/error_exception.php index 87848866a..467ff607b 100755 --- a/application/views/errors/html/error_exception.php +++ b/application/views/errors/html/error_exception.php @@ -1,5 +1,5 @@
diff --git a/application/views/errors/html/error_general.php b/application/views/errors/html/error_general.php index fc3b2ebad..ee21ebe38 100755 --- a/application/views/errors/html/error_general.php +++ b/application/views/errors/html/error_general.php @@ -1,5 +1,5 @@ diff --git a/application/views/errors/html/error_php.php b/application/views/errors/html/error_php.php index b146f9c5b..bf1df6d54 100755 --- a/application/views/errors/html/error_php.php +++ b/application/views/errors/html/error_php.php @@ -1,5 +1,5 @@
diff --git a/application/views/rdf/foafinfo.php b/application/views/rdf/foafinfo.php index 6ecc554fb..54cceec9b 100644 --- a/application/views/rdf/foafinfo.php +++ b/application/views/rdf/foafinfo.php @@ -30,7 +30,7 @@ echo $this->load->view('rdf/html_tag_helpers'); - if(isset($_REQUEST['uri'])): ?> + if (isset($_REQUEST['uri'])): ?> @@ -92,7 +92,7 @@ - isBNode()): ?> + isBNode()): ?> diff --git a/application/views/rdf/foafmaker.php b/application/views/rdf/foafmaker.php index 941d3f5f5..c79f9f838 100644 --- a/application/views/rdf/foafmaker.php +++ b/application/views/rdf/foafmaker.php @@ -101,7 +101,7 @@ Enable Rapper?
$graph->addLiteral($_REQUEST['uri'], 'foaf:nick', $_REQUEST['nickname']); # Add friends - for($i=1; $i<=4; $i++) { + for ($i=1; $i<=4; $i++) { if ($_REQUEST["person_$i"]) { $person = $graph->resource($_REQUEST["person_$i"]); $graph->add($me, 'foaf:knows', $person); diff --git a/application/views/rdf/form.php b/application/views/rdf/form.php index 1f8e447fd..ad0c704b5 100644 --- a/application/views/rdf/form.php +++ b/application/views/rdf/form.php @@ -101,7 +101,7 @@ Enable Rapper?
$graph->addLiteral($_REQUEST['uri'], 'foaf:nick', $_REQUEST['nickname']); # Add friends - for($i=1; $i<=4; $i++) { + for ($i=1; $i<=4; $i++) { if ($_REQUEST["person_$i"]) { $person = $graph->resource($_REQUEST["person_$i"]); $graph->add($me, 'foaf:knows', $person); diff --git a/application/views/templates/header.php b/application/views/templates/header.php index 9ab8223f8..03f5cbd14 100644 --- a/application/views/templates/header.php +++ b/application/views/templates/header.php @@ -1,5 +1,5 @@ diff --git a/application/views/welcome_message.php b/application/views/welcome_message.php index f5115630b..065498e55 100755 --- a/application/views/welcome_message.php +++ b/application/views/welcome_message.php @@ -1,5 +1,5 @@ diff --git a/ci_hack.php b/ci_hack.php index 7de79d3cb..962c22d6a 100755 --- a/ci_hack.php +++ b/ci_hack.php @@ -370,4 +370,3 @@ $model=new CI_Model(); // Traits require_once(dirname(__FILE__).'/ci_db_extra.php'); - diff --git a/include/benutzer.class.php b/include/benutzer.class.php index f0e168657..68d0ed662 100644 --- a/include/benutzer.class.php +++ b/include/benutzer.class.php @@ -83,7 +83,7 @@ class benutzer extends person * auf Gueltigkeit. * @return true wenn ok, false im Fehlerfall */ - protected function validate() + public function validate() { if(mb_strlen($this->uid)>32) { diff --git a/include/dms.class.php b/include/dms.class.php index 5a49f323d..f8fb930e6 100644 --- a/include/dms.class.php +++ b/include/dms.class.php @@ -24,7 +24,13 @@ */ require_once(dirname(__FILE__).'/basis_db.class.php'); -class dms extends basis_db +require_once(dirname(__FILE__).'/datum.class.php'); + +// CI +require_once(dirname(__FILE__).'/../ci_hack.php'); +require_once(dirname(__FILE__).'/../application/models/content/Dms_model.php'); + +class dms extends Dms_model { public $new; public $result=array(); diff --git a/include/mitarbeiter.class.php b/include/mitarbeiter.class.php index d2096818d..421a61c08 100644 --- a/include/mitarbeiter.class.php +++ b/include/mitarbeiter.class.php @@ -112,7 +112,7 @@ class mitarbeiter extends benutzer * ueberprueft die Variablen auf Gueltigkeit * @return true wenn gueltig, false im Fehlerfall */ - protected function validate() + public function validate() { //if(mb_strlen($this->uid)>16) //{ 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/include/student.class.php b/include/student.class.php index 5ade5d1f2..6fcfa2014 100644 --- a/include/student.class.php +++ b/include/student.class.php @@ -106,7 +106,7 @@ class student extends benutzer * auf Gueltigkeit. * @return true wenn ok, false im Fehlerfall */ - protected function validate() + public function validate() { if(mb_strlen($this->uid)>32) { diff --git a/index.demo.html b/index.demo.html index f5bf1b5dd..4a5a6b001 100644 --- a/index.demo.html +++ b/index.demo.html @@ -34,6 +34,17 @@
  • Datenimport
  • Kompetenzen
  • +

    Demo Users

    + diff --git a/install.sh b/install.sh index 5d639aae8..8077d2467 100755 --- a/install.sh +++ b/install.sh @@ -53,6 +53,8 @@ echo "Database ..." #sudo -u postgres psql template1 -c 'DROP DATABASE IF EXISTS fhctest;' #echo "Database fhctest dropped!" sudo -u postgres createdb -O fhcomplete fhctest +sudo -u postgres psql fhctest -c 'CREATE SCHEMA IF NOT EXISTS system;' +sudo -u postgres psql fhctest -c 'ALTER SCHEMA system OWNER TO fhcomplete;' echo "Installing FH-Complete..." # cp index.ci.php index.php # Maybe somtimes diff --git a/phpci.yml b/phpci.yml index 4c4479c51..9d0a33606 100644 --- a/phpci.yml +++ b/phpci.yml @@ -22,8 +22,8 @@ setup: # - "pkill -f fhctest &" # - "sudo -u postgres psql fhctest -c 'DROP DATABASE IF EXISTS fhctest;'" - "cd %BUILD_PATH% && chmod u+x install.sh && ./install.sh fhctest" # Install Database - - "rm -f /var/www/html/build" # SymLink löschen falls vorhanden - - "ln -s %BUILD_PATH% /var/www/html/build" # SymLink to the actual build + - "rm -f /var/www/html/build/fhcomplete" # SymLink löschen falls vorhanden + - "ln -s %BUILD_PATH% /var/www/html/build/fhcomplete" # SymLink to the actual build # - "php index.ci.php DBTools migrate" # DB-Migration test: diff --git a/tests/codeception/_data/dump.sql b/tests/codeception/_data/dump.sql index d72b8d895..175b449d0 100644 --- a/tests/codeception/_data/dump.sql +++ b/tests/codeception/_data/dump.sql @@ -15,6 +15,8 @@ DELETE FROM public.tbl_ort; DELETE FROM public.tbl_kontakt WHERE person_id > 2; -- EMPTY public.tbl_benutzer DELETE FROM public.tbl_benutzer WHERE person_id > 2; +-- EMPTY public.tbl_preinteressent +DELETE FROM public.tbl_preinteressent WHERE person_id > 2; -- EMPTY public.tbl_person DELETE FROM public.tbl_person WHERE person_id > 2; @@ -173,4 +175,865 @@ INSERT INTO lehre.tbl_studienordnung_semester VALUES (1, 1, 'WS2016', 1); INSERT INTO lehre.tbl_studienplan VALUES (1, 1, 'VZ', 'A', '01234', 6, 'English', 't', 15, 't', NOW(), 'codeception', NOW(), NULL, NULL, NULL, NULL, NULL); INSERT INTO lehre.tbl_studienplan VALUES (2, 1, 'VZ', 'A', '01234', 6, 'English', 't', 15, 't', NOW(), 'codeception', NOW(), NULL, NULL, NULL, NULL, NULL); INSERT INTO lehre.tbl_studienplan VALUES (3, 1, 'VZ', 'A', '01234', 6, 'English', 't', 15, 't', NOW(), 'codeception', NOW(), NULL, NULL, NULL, NULL, NULL); -INSERT INTO lehre.tbl_studienplan VALUES (4, 1, 'VZ', 'A', '01234', 6, 'English', 't', 15, 't', NOW(), 'codeception', NOW(), NULL, NULL, NULL, NULL, NULL); \ No newline at end of file +INSERT INTO lehre.tbl_studienplan VALUES (4, 1, 'VZ', 'A', '01234', 6, 'English', 't', 15, 't', NOW(), 'codeception', NOW(), NULL, NULL, NULL, NULL, NULL); + +DELETE FROM system.tbl_rolleberechtigung WHERE berechtigung_kurzbz IN ( + 'basis/archiv', + 'basis/ausbildung', + 'basis/berufstaetigkeit', + 'basis/beschaeftigungsausmass', + 'basis/besqual', + 'basis/bisfunktion', + 'basis/bisio', + 'basis/bisorgform', + 'basis/bisverwendung', + 'basis/bundesland', + 'basis/entwicklungsteam', + 'basis/gemeinde', + 'basis/hauptberuf', + 'basis/lgartcode', + 'basis/mobilitaetsprogramm', + 'basis/nation', + 'basis/orgform', + 'basis/verwendung', + 'basis/zgv', + 'basis/zgvdoktor', + 'basis/zgvgruppe', + 'basis/zgvmaster', + 'basis/zweck', + 'basis/abgabe', + 'basis/anwesenheit', + 'basis/beispiel', + 'basis/content', + 'basis/contentchild', + 'basis/contentgruppe', + 'basis/contentlog', + 'basis/contentsprache', + 'basis/coodle', + 'basis/dms', + 'basis/erreichbarkeit', + 'basis/feedback', + 'basis/freebusy', + 'basis/freebusytyp', + 'basis/infoscreen', + 'basis/legesamtnote', + 'basis/lvgesamtnote', + 'basis/lvinfo', + 'basis/news', + 'basis/notenschluessel', + 'basis/notenschluesseluebung', + 'basis/paabgabe', + 'basis/paabgabetyp', + 'basis/pruefung', + 'basis/pruefungsanmeldung', + 'basis/pruefungsfenster', + 'basis/pruefungsstatus', + 'basis/pruefungstermin', + 'basis/reservierung', + 'basis/resturlaub', + 'basis/studentbeispiel', + 'basis/studentuebung', + 'basis/template', + 'basis/uebung', + 'basis/veranstaltung', + 'basis/veranstaltungskategorie', + 'basis/zeitaufzeichnung', + 'basis/zeitsperre', + 'basis/zeitsperretyp', + 'basis/zeitwunsch', + 'basis/aktivitaet', + 'basis/aufwandstyp', + 'basis/projekt', + 'basis/projekt_ressource', + 'basis/projektphase', + 'basis/projekttask', + 'basis/ressource', + 'basis/scrumsprint', + 'basis/scrumteam', + 'basis/abschlussbeurteilung', + 'basis/abschlusspruefung', + 'basis/akadgrad', + 'basis/anrechnung', + 'basis/betreuerart', + 'basis/ferien', + 'basis/lehreinheit', + 'basis/lehreinheitgruppe', + 'basis/lehreinheitmitarbeiter', + 'basis/lehrfach', + 'basis/lehrform', + 'basis/lehrfunktion', + 'basis/lehrmittel', + 'basis/lehrtyp', + 'basis/lehrveranstaltung', + 'basis/lvangebot', + 'basis/lvregel', + 'basis/lvregeltyp', + 'basis/moodle', + 'basis/note', + 'basis/notenschluesselaufteilung', + 'basis/notenschluesselzuordnung', + 'basis/projektarbeit', + 'basis/projektbetreuer', + 'basis/projekttyp', + 'basis/pruefungstyp', + 'basis/studienordnung', + 'basis/studienordnungstatus', + 'basis/studienplan', + 'basis/studienplatz', + 'basis/stunde', + 'basis/stundenplan', + 'basis/stundenplandev', + 'basis/vertrag', + 'basis/vertragsstatus', + 'basis/vertragstyp', + 'basis/zeitfenster', + 'basis/zeugnis', + 'basis/zeugnisnote', + 'basis/adresse', + 'basis/akte', + 'basis/ampel', + 'basis/aufmerksamdurch', + 'basis/aufnahmeschluessel', + 'basis/aufnahmetermin', + 'basis/aufnahmetermintyp', + 'basis/bankverbindung', + 'basis/benutzer', + 'basis/benutzerfunktion', + 'basis/benutzergruppe', + 'basis/bewerbungstermine', + 'basis/buchungstyp', + 'basis/dokument', + 'basis/dokumentprestudent', + 'basis/dokumentstudiengang', + 'basis/erhalter', + 'basis/fachbereich', + 'basis/filter', + 'basis/firma', + 'basis/firmatag', + 'basis/firmentyp', + 'basis/fotostatus', + 'basis/funktion', + 'basis/geschaeftsjahr', + 'basis/gruppe', + 'basis/kontakt', + 'basis/kontaktmedium', + 'basis/kontakttyp', + 'basis/konto', + 'basis/lehrverband', + 'basis/log', + 'basis/mitarbeiter', + 'basis/msg_message', + 'basis/msg_thread', + 'basis/notiz', + 'basis/notizzuordnung', + 'basis/organisationseinheit', + 'basis/organisationseinheittyp', + 'basis/ort', + 'basis/ortraumtyp', + 'basis/person', + 'basis/personfunktionstandort', + 'basis/preincoming', + 'basis/preinteressent', + 'basis/preinteressentstudiengang', + 'basis/preoutgoing', + 'basis/prestudent', + 'basis/prestudentstatus', + 'basis/raumtyp', + 'basis/reihungstest', + 'basis/semesterwochen', + 'basis/service', + 'basis/sprache', + 'basis/standort', + 'basis/statistik', + 'basis/status', + 'basis/student', + 'basis/studentlehrverband', + 'basis/studiengang', + 'basis/studiengangstyp', + 'basis/studienjahr', + 'basis/studiensemester', + 'basis/tag', + 'basis/variable', + 'basis/vorlage', + 'basis/vorlagestudiengang', + 'basis/appdaten', + 'basis/benutzerrolle', + 'basis/berechtigung', + 'basis/cronjob', + 'basis/rolle', + 'basis/rolleberechtigung', + 'basis/server', + 'basis/webservicelog', + 'basis/webservicerecht', + 'basis/webservicetyp', + 'basis/ablauf', + 'basis/antwort', + 'basis/frage', + 'basis/gebiet', + 'basis/kategorie', + 'basis/kriterien', + 'basis/pruefling', + 'basis/vorschlag', + 'basis/aufteilung', + 'basis/bestelldetail', + 'basis/bestelldetailtag', + 'basis/bestellstatus', + 'basis/bestellung', + 'basis/bestellungtag', + 'basis/betriebsmittel', + 'basis/betriebsmittelperson', + 'basis/betriebsmittelstatus', + 'basis/betriebsmitteltyp', + 'basis/buchung', + 'basis/budget', + 'basis/kostenstelle', + 'basis/rechnung', + 'basis/rechnungsbetrag', + 'basis/rechnungstyp', + 'basis/zahlungstyp' +); + +DELETE FROM system.tbl_berechtigung WHERE berechtigung_kurzbz IN ( + 'basis/archiv', + 'basis/ausbildung', + 'basis/berufstaetigkeit', + 'basis/beschaeftigungsausmass', + 'basis/besqual', + 'basis/bisfunktion', + 'basis/bisio', + 'basis/bisorgform', + 'basis/bisverwendung', + 'basis/bundesland', + 'basis/entwicklungsteam', + 'basis/gemeinde', + 'basis/hauptberuf', + 'basis/lgartcode', + 'basis/mobilitaetsprogramm', + 'basis/nation', + 'basis/orgform', + 'basis/verwendung', + 'basis/zgv', + 'basis/zgvdoktor', + 'basis/zgvgruppe', + 'basis/zgvmaster', + 'basis/zweck', + 'basis/abgabe', + 'basis/anwesenheit', + 'basis/beispiel', + 'basis/content', + 'basis/contentchild', + 'basis/contentgruppe', + 'basis/contentlog', + 'basis/contentsprache', + 'basis/coodle', + 'basis/dms', + 'basis/erreichbarkeit', + 'basis/feedback', + 'basis/freebusy', + 'basis/freebusytyp', + 'basis/infoscreen', + 'basis/legesamtnote', + 'basis/lvgesamtnote', + 'basis/lvinfo', + 'basis/news', + 'basis/notenschluessel', + 'basis/notenschluesseluebung', + 'basis/paabgabe', + 'basis/paabgabetyp', + 'basis/pruefung', + 'basis/pruefungsanmeldung', + 'basis/pruefungsfenster', + 'basis/pruefungsstatus', + 'basis/pruefungstermin', + 'basis/reservierung', + 'basis/resturlaub', + 'basis/studentbeispiel', + 'basis/studentuebung', + 'basis/template', + 'basis/uebung', + 'basis/veranstaltung', + 'basis/veranstaltungskategorie', + 'basis/zeitaufzeichnung', + 'basis/zeitsperre', + 'basis/zeitsperretyp', + 'basis/zeitwunsch', + 'basis/aktivitaet', + 'basis/aufwandstyp', + 'basis/projekt', + 'basis/projekt_ressource', + 'basis/projektphase', + 'basis/projekttask', + 'basis/ressource', + 'basis/scrumsprint', + 'basis/scrumteam', + 'basis/abschlussbeurteilung', + 'basis/abschlusspruefung', + 'basis/akadgrad', + 'basis/anrechnung', + 'basis/betreuerart', + 'basis/ferien', + 'basis/lehreinheit', + 'basis/lehreinheitgruppe', + 'basis/lehreinheitmitarbeiter', + 'basis/lehrfach', + 'basis/lehrform', + 'basis/lehrfunktion', + 'basis/lehrmittel', + 'basis/lehrtyp', + 'basis/lehrveranstaltung', + 'basis/lvangebot', + 'basis/lvregel', + 'basis/lvregeltyp', + 'basis/moodle', + 'basis/note', + 'basis/notenschluesselaufteilung', + 'basis/notenschluesselzuordnung', + 'basis/projektarbeit', + 'basis/projektbetreuer', + 'basis/projekttyp', + 'basis/pruefungstyp', + 'basis/studienordnung', + 'basis/studienordnungstatus', + 'basis/studienplan', + 'basis/studienplatz', + 'basis/stunde', + 'basis/stundenplan', + 'basis/stundenplandev', + 'basis/vertrag', + 'basis/vertragsstatus', + 'basis/vertragstyp', + 'basis/zeitfenster', + 'basis/zeugnis', + 'basis/zeugnisnote', + 'basis/adresse', + 'basis/akte', + 'basis/ampel', + 'basis/aufmerksamdurch', + 'basis/aufnahmeschluessel', + 'basis/aufnahmetermin', + 'basis/aufnahmetermintyp', + 'basis/bankverbindung', + 'basis/benutzer', + 'basis/benutzerfunktion', + 'basis/benutzergruppe', + 'basis/bewerbungstermine', + 'basis/buchungstyp', + 'basis/dokument', + 'basis/dokumentprestudent', + 'basis/dokumentstudiengang', + 'basis/erhalter', + 'basis/fachbereich', + 'basis/filter', + 'basis/firma', + 'basis/firmatag', + 'basis/firmentyp', + 'basis/fotostatus', + 'basis/funktion', + 'basis/geschaeftsjahr', + 'basis/gruppe', + 'basis/kontakt', + 'basis/kontaktmedium', + 'basis/kontakttyp', + 'basis/konto', + 'basis/lehrverband', + 'basis/log', + 'basis/mitarbeiter', + 'basis/msg_message', + 'basis/msg_thread', + 'basis/notiz', + 'basis/notizzuordnung', + 'basis/organisationseinheit', + 'basis/organisationseinheittyp', + 'basis/ort', + 'basis/ortraumtyp', + 'basis/person', + 'basis/personfunktionstandort', + 'basis/preincoming', + 'basis/preinteressent', + 'basis/preinteressentstudiengang', + 'basis/preoutgoing', + 'basis/prestudent', + 'basis/prestudentstatus', + 'basis/raumtyp', + 'basis/reihungstest', + 'basis/semesterwochen', + 'basis/service', + 'basis/sprache', + 'basis/standort', + 'basis/statistik', + 'basis/status', + 'basis/student', + 'basis/studentlehrverband', + 'basis/studiengang', + 'basis/studiengangstyp', + 'basis/studienjahr', + 'basis/studiensemester', + 'basis/tag', + 'basis/variable', + 'basis/vorlage', + 'basis/vorlagestudiengang', + 'basis/appdaten', + 'basis/benutzerrolle', + 'basis/berechtigung', + 'basis/cronjob', + 'basis/rolle', + 'basis/rolleberechtigung', + 'basis/server', + 'basis/webservicelog', + 'basis/webservicerecht', + 'basis/webservicetyp', + 'basis/ablauf', + 'basis/antwort', + 'basis/frage', + 'basis/gebiet', + 'basis/kategorie', + 'basis/kriterien', + 'basis/pruefling', + 'basis/vorschlag', + 'basis/aufteilung', + 'basis/bestelldetail', + 'basis/bestelldetailtag', + 'basis/bestellstatus', + 'basis/bestellung', + 'basis/bestellungtag', + 'basis/betriebsmittel', + 'basis/betriebsmittelperson', + 'basis/betriebsmittelstatus', + 'basis/betriebsmitteltyp', + 'basis/buchung', + 'basis/budget', + 'basis/kostenstelle', + 'basis/rechnung', + 'basis/rechnungsbetrag', + 'basis/rechnungstyp', + 'basis/zahlungstyp' +); + +-- Permissions +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/archiv', 'Tbl_archiv'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/ausbildung', 'Tbl_ausbildung'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/berufstaetigkeit', 'Tbl_berufstaetigkeit'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/beschaeftigungsausmass', 'Tbl_beschaeftigungsausmass'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/besqual', 'Tbl_besqual'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/bisfunktion', 'Tbl_bisfunktion'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/bisio', 'Tbl_bisio'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/bisorgform', 'Tbl_bisorgform'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/bisverwendung', 'Tbl_bisverwendung'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/bundesland', 'Tbl_bundesland'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/entwicklungsteam', 'Tbl_entwicklungsteam'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/gemeinde', 'Tbl_gemeinde'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/hauptberuf', 'Tbl_hauptberuf'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/lgartcode', 'Tbl_lgartcode'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/mobilitaetsprogramm', 'Tbl_mobilitaetsprogramm'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/nation', 'Tbl_nation'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/orgform', 'Tbl_orgform'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/verwendung', 'Tbl_verwendung'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/zgv', 'Tbl_zgv'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/zgvdoktor', 'Tbl_zgvdoktor'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/zgvgruppe', 'Tbl_zgvgruppe'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/zgvmaster', 'Tbl_zgvmaster'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/zweck', 'Tbl_zweck'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/abgabe', 'Tbl_abgabe'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/anwesenheit', 'Tbl_anwesenheit'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/beispiel', 'Tbl_beispiel'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/content', 'Tbl_content'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/contentchild', 'Tbl_contentchild'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/contentgruppe', 'Tbl_contentgruppe'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/contentlog', 'Tbl_contentlog'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/contentsprache', 'Tbl_contentsprache'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/coodle', 'Tbl_coodle'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/dms', 'Tbl_dms'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/erreichbarkeit', 'Tbl_erreichbarkeit'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/feedback', 'Tbl_feedback'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/freebusy', 'Tbl_freebusy'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/freebusytyp', 'Tbl_freebusytyp'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/infoscreen', 'Tbl_infoscreen'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/legesamtnote', 'Tbl_legesamtnote'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/lvgesamtnote', 'Tbl_lvgesamtnote'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/lvinfo', 'Tbl_lvinfo'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/news', 'Tbl_news'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/notenschluessel', 'Tbl_notenschluessel'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/notenschluesseluebung', 'Tbl_notenschluesseluebung'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/paabgabe', 'Tbl_paabgabe'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/paabgabetyp', 'Tbl_paabgabetyp'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/pruefung', 'Tbl_pruefung'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/pruefungsanmeldung', 'Tbl_pruefungsanmeldung'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/pruefungsfenster', 'Tbl_pruefungsfenster'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/pruefungsstatus', 'Tbl_pruefungsstatus'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/pruefungstermin', 'Tbl_pruefungstermin'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/reservierung', 'Tbl_reservierung'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/resturlaub', 'Tbl_resturlaub'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/studentbeispiel', 'Tbl_studentbeispiel'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/studentuebung', 'Tbl_studentuebung'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/template', 'Tbl_template'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/uebung', 'Tbl_uebung'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/veranstaltung', 'Tbl_veranstaltung'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/veranstaltungskategorie', 'Tbl_veranstaltungskategorie'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/zeitaufzeichnung', 'Tbl_zeitaufzeichnung'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/zeitsperre', 'Tbl_zeitsperre'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/zeitsperretyp', 'Tbl_zeitsperretyp'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/zeitwunsch', 'Tbl_zeitwunsch'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/aktivitaet', 'Tbl_aktivitaet'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/aufwandstyp', 'Tbl_aufwandstyp'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/projekt', 'Tbl_projekt'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/projekt_ressource', 'Tbl_projekt_ressource'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/projektphase', 'Tbl_projektphase'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/projekttask', 'Tbl_projekttask'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/ressource', 'Tbl_ressource'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/scrumsprint', 'Tbl_scrumsprint'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/scrumteam', 'Tbl_scrumteam'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/abschlussbeurteilung', 'Tbl_abschlussbeurteilung'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/abschlusspruefung', 'Tbl_abschlusspruefung'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/akadgrad', 'Tbl_akadgrad'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/anrechnung', 'Tbl_anrechnung'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/betreuerart', 'Tbl_betreuerart'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/ferien', 'Tbl_ferien'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/lehreinheit', 'Tbl_lehreinheit'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/lehreinheitgruppe', 'Tbl_lehreinheitgruppe'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/lehreinheitmitarbeiter', 'Tbl_lehreinheitmitarbeiter'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/lehrfach', 'Tbl_lehrfach'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/lehrform', 'Tbl_lehrform'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/lehrfunktion', 'Tbl_lehrfunktion'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/lehrmittel', 'Tbl_lehrmittel'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/lehrtyp', 'Tbl_lehrtyp'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/lehrveranstaltung', 'Tbl_lehrveranstaltung'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/lvangebot', 'Tbl_lvangebot'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/lvregel', 'Tbl_lvregel'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/lvregeltyp', 'Tbl_lvregeltyp'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/moodle', 'Tbl_moodle'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/note', 'Tbl_note'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/notenschluesselaufteilung', 'Tbl_notenschluesselaufteilung'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/notenschluesselzuordnung', 'Tbl_notenschluesselzuordnung'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/projektarbeit', 'Tbl_projektarbeit'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/projektbetreuer', 'Tbl_projektbetreuer'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/projekttyp', 'Tbl_projekttyp'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/pruefungstyp', 'Tbl_pruefungstyp'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/studienordnung', 'Tbl_studienordnung'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/studienordnungstatus', 'Tbl_studienordnungstatus'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/studienplan', 'Tbl_studienplan'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/studienplatz', 'Tbl_studienplatz'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/stunde', 'Tbl_stunde'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/stundenplan', 'Tbl_stundenplan'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/stundenplandev', 'Tbl_stundenplandev'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/vertrag', 'Tbl_vertrag'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/vertragsstatus', 'Tbl_vertragsstatus'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/vertragstyp', 'Tbl_vertragstyp'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/zeitfenster', 'Tbl_zeitfenster'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/zeugnis', 'Tbl_zeugnis'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/zeugnisnote', 'Tbl_zeugnisnote'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/adresse', 'Tbl_adresse'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/akte', 'Tbl_akte'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/ampel', 'Tbl_ampel'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/aufmerksamdurch', 'Tbl_aufmerksamdurch'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/aufnahmeschluessel', 'Tbl_aufnahmeschluessel'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/aufnahmetermin', 'Tbl_aufnahmetermin'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/aufnahmetermintyp', 'Tbl_aufnahmetermintyp'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/bankverbindung', 'Tbl_bankverbindung'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/benutzer', 'Tbl_benutzer'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/benutzerfunktion', 'Tbl_benutzerfunktion'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/benutzergruppe', 'Tbl_benutzergruppe'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/bewerbungstermine', 'Tbl_bewerbungstermine'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/buchungstyp', 'Tbl_buchungstyp'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/dokument', 'Tbl_dokument'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/dokumentprestudent', 'Tbl_dokumentprestudent'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/dokumentstudiengang', 'Tbl_dokumentstudiengang'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/erhalter', 'Tbl_erhalter'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/fachbereich', 'Tbl_fachbereich'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/filter', 'Tbl_filter'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/firma', 'Tbl_firma'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/firmatag', 'Tbl_firmatag'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/firmentyp', 'Tbl_firmentyp'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/fotostatus', 'Tbl_fotostatus'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/funktion', 'Tbl_funktion'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/geschaeftsjahr', 'Tbl_geschaeftsjahr'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/gruppe', 'Tbl_gruppe'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/kontakt', 'Tbl_kontakt'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/kontaktmedium', 'Tbl_kontaktmedium'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/kontakttyp', 'Tbl_kontakttyp'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/konto', 'Tbl_konto'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/lehrverband', 'Tbl_lehrverband'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/log', 'Tbl_log'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/mitarbeiter', 'Tbl_mitarbeiter'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/msg_message', 'Tbl_msg_message'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/msg_thread', 'Tbl_msg_thread'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/notiz', 'Tbl_notiz'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/notizzuordnung', 'Tbl_notizzuordnung'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/organisationseinheit', 'Tbl_organisationseinheit'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/organisationseinheittyp', 'Tbl_organisationseinheittyp'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/ort', 'Tbl_ort'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/ortraumtyp', 'Tbl_ortraumtyp'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/person', 'Tbl_person'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/personfunktionstandort', 'Tbl_personfunktionstandort'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/preincoming', 'Tbl_preincoming'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/preinteressent', 'Tbl_preinteressent'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/preinteressentstudiengang', 'Tbl_preinteressentstudiengang'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/preoutgoing', 'Tbl_preoutgoing'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/prestudent', 'Tbl_prestudent'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/prestudentstatus', 'Tbl_prestudentstatus'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/raumtyp', 'Tbl_raumtyp'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/reihungstest', 'Tbl_reihungstest'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/semesterwochen', 'Tbl_semesterwochen'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/service', 'Tbl_service'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/sprache', 'Tbl_sprache'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/standort', 'Tbl_standort'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/statistik', 'Tbl_statistik'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/status', 'Tbl_status'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/student', 'Tbl_student'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/studentlehrverband', 'Tbl_studentlehrverband'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/studiengang', 'Tbl_studiengang'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/studiengangstyp', 'Tbl_studiengangstyp'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/studienjahr', 'Tbl_studienjahr'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/studiensemester', 'Tbl_studiensemester'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/tag', 'Tbl_tag'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/variable', 'Tbl_variable'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/vorlage', 'Tbl_vorlage'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/vorlagestudiengang', 'Tbl_vorlagestudiengang'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/appdaten', 'Tbl_appdaten'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/benutzerrolle', 'Tbl_benutzerrolle'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/berechtigung', 'Tbl_berechtigung'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/cronjob', 'Tbl_cronjob'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/rolle', 'Tbl_rolle'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/rolleberechtigung', 'Tbl_rolleberechtigung'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/server', 'Tbl_server'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/webservicelog', 'Tbl_webservicelog'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/webservicerecht', 'Tbl_webservicerecht'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/webservicetyp', 'Tbl_webservicetyp'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/ablauf', 'Tbl_ablauf'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/antwort', 'Tbl_antwort'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/frage', 'Tbl_frage'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/gebiet', 'Tbl_gebiet'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/kategorie', 'Tbl_kategorie'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/kriterien', 'Tbl_kriterien'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/pruefling', 'Tbl_pruefling'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/vorschlag', 'Tbl_vorschlag'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/aufteilung', 'Tbl_aufteilung'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/bestelldetail', 'Tbl_bestelldetail'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/bestelldetailtag', 'Tbl_bestelldetailtag'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/bestellstatus', 'Tbl_bestellstatus'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/bestellung', 'Tbl_bestellung'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/bestellungtag', 'Tbl_bestellungtag'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/betriebsmittel', 'Tbl_betriebsmittel'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/betriebsmittelperson', 'Tbl_betriebsmittelperson'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/betriebsmittelstatus', 'Tbl_betriebsmittelstatus'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/betriebsmitteltyp', 'Tbl_betriebsmitteltyp'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/buchung', 'Tbl_buchung'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/budget', 'Tbl_budget'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/kostenstelle', 'Tbl_kostenstelle'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/rechnung', 'Tbl_rechnung'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/rechnungsbetrag', 'Tbl_rechnungsbetrag'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/rechnungstyp', 'Tbl_rechnungstyp'); +INSERT INTO system.tbl_berechtigung (berechtigung_kurzbz, beschreibung) VALUES('basis/zahlungstyp', 'Tbl_zahlungstyp'); + +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/archiv', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/ausbildung', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/berufstaetigkeit', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/beschaeftigungsausmass', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/besqual', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/bisfunktion', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/bisio', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/bisorgform', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/bisverwendung', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/bundesland', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/entwicklungsteam', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/gemeinde', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/hauptberuf', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/lgartcode', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/mobilitaetsprogramm', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/nation', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/orgform', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/verwendung', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/zgv', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/zgvdoktor', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/zgvgruppe', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/zgvmaster', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/zweck', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/abgabe', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/anwesenheit', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/beispiel', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/content', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/contentchild', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/contentgruppe', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/contentlog', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/contentsprache', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/coodle', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/dms', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/erreichbarkeit', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/feedback', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/freebusy', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/freebusytyp', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/infoscreen', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/legesamtnote', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/lvgesamtnote', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/lvinfo', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/news', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/notenschluessel', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/notenschluesseluebung', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/paabgabe', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/paabgabetyp', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/pruefung', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/pruefungsanmeldung', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/pruefungsfenster', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/pruefungsstatus', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/pruefungstermin', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/reservierung', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/resturlaub', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/studentbeispiel', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/studentuebung', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/template', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/uebung', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/veranstaltung', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/veranstaltungskategorie', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/zeitaufzeichnung', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/zeitsperre', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/zeitsperretyp', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/zeitwunsch', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/aktivitaet', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/aufwandstyp', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/projekt', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/projekt_ressource', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/projektphase', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/projekttask', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/ressource', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/scrumsprint', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/scrumteam', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/abschlussbeurteilung', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/abschlusspruefung', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/akadgrad', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/anrechnung', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/betreuerart', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/ferien', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/lehreinheit', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/lehreinheitgruppe', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/lehreinheitmitarbeiter', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/lehrfach', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/lehrform', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/lehrfunktion', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/lehrmittel', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/lehrtyp', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/lehrveranstaltung', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/lvangebot', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/lvregel', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/lvregeltyp', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/moodle', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/note', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/notenschluesselaufteilung', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/notenschluesselzuordnung', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/projektarbeit', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/projektbetreuer', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/projekttyp', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/pruefungstyp', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/studienordnung', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/studienordnungstatus', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/studienplan', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/studienplatz', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/stunde', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/stundenplan', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/stundenplandev', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/vertrag', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/vertragsstatus', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/vertragstyp', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/zeitfenster', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/zeugnis', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/zeugnisnote', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/adresse', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/akte', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/ampel', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/aufmerksamdurch', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/aufnahmeschluessel', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/aufnahmetermin', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/aufnahmetermintyp', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/bankverbindung', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/benutzer', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/benutzerfunktion', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/benutzergruppe', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/bewerbungstermine', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/buchungstyp', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/dokument', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/dokumentprestudent', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/dokumentstudiengang', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/erhalter', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/fachbereich', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/filter', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/firma', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/firmatag', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/firmentyp', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/fotostatus', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/funktion', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/geschaeftsjahr', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/gruppe', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/kontakt', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/kontaktmedium', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/kontakttyp', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/konto', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/lehrverband', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/log', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/mitarbeiter', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/msg_message', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/msg_thread', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/notiz', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/notizzuordnung', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/organisationseinheit', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/organisationseinheittyp', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/ort', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/ortraumtyp', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/person', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/personfunktionstandort', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/preincoming', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/preinteressent', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/preinteressentstudiengang', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/preoutgoing', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/prestudent', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/prestudentstatus', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/raumtyp', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/reihungstest', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/semesterwochen', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/service', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/sprache', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/standort', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/statistik', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/status', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/student', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/studentlehrverband', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/studiengang', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/studiengangstyp', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/studienjahr', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/studiensemester', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/tag', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/variable', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/vorlage', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/vorlagestudiengang', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/appdaten', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/benutzerrolle', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/berechtigung', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/cronjob', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/rolle', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/rolleberechtigung', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/server', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/webservicelog', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/webservicerecht', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/webservicetyp', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/ablauf', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/antwort', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/frage', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/gebiet', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/kategorie', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/kriterien', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/pruefling', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/vorschlag', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/aufteilung', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/bestelldetail', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/bestelldetailtag', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/bestellstatus', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/bestellung', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/bestellungtag', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/betriebsmittel', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/betriebsmittelperson', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/betriebsmittelstatus', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/betriebsmitteltyp', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/buchung', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/budget', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/kostenstelle', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/rechnung', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/rechnungsbetrag', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/rechnungstyp', 'admin', 'suid'); +INSERT INTO system.tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art) VALUES('basis/zahlungstyp', 'admin', 'suid'); \ No newline at end of file diff --git a/tests/codeception/tests/acceptance.suite.dist.yml b/tests/codeception/tests/acceptance.suite.dist.yml index 3ca32aed8..4199cc497 100644 --- a/tests/codeception/tests/acceptance.suite.dist.yml +++ b/tests/codeception/tests/acceptance.suite.dist.yml @@ -12,7 +12,7 @@ modules: - Db config: PhpBrowser: - url: 'http://admin:1q2w3@localhost/build/' + url: 'http://admin:1q2w3@localhost/build/fhcomplete/' Db: dsn: 'pgsql:host=localhost;port=5432;dbname=fhctest' user: 'fhcomplete' diff --git a/tests/codeception/tests/api.suite.dist.yml b/tests/codeception/tests/api.suite.dist.yml index b156918a2..a0b3cc3c9 100644 --- a/tests/codeception/tests/api.suite.dist.yml +++ b/tests/codeception/tests/api.suite.dist.yml @@ -5,7 +5,7 @@ modules: - Db - REST: # API URL - url: http://localhost/build/index.ci.php/api/ + url: http://localhost/build/fhcomplete/index.ci.php/api/ # Can also be a framework module name depends: PhpBrowser # Limits PhpBrowser to JSON or XML diff --git a/tests/codeception/tests/api/v1/CourseCept.php b/tests/codeception/tests/api/v1/CourseCept.php deleted file mode 100644 index 8f43b91af..000000000 --- a/tests/codeception/tests/api/v1/CourseCept.php +++ /dev/null @@ -1,12 +0,0 @@ -wantTo('Test API call v1/lehre/studiengang/AllForBewerbung'); -$I->amHttpAuthenticated("admin", "1q2w3"); -$I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org'); -$I->sendGET('v1/lehre/studiengang/AllForBewerbung'); -$I->seeResponseCodeIs(200); -$I->seeResponseIsJson(); -$I->seeResponseContainsJson([ - 'success' => TRUE, - 'message' => 'Courses found']); \ No newline at end of file diff --git a/tests/codeception/tests/api/v1/NationCept.php b/tests/codeception/tests/api/v1/NationCept.php index 081931b76..c441a4249 100644 --- a/tests/codeception/tests/api/v1/NationCept.php +++ b/tests/codeception/tests/api/v1/NationCept.php @@ -1,19 +1,10 @@ wantTo('Test API call v1/nation All and FederalState'); +$I->wantTo('Test API call v1/codex/nation All and FederalState'); $I->amHttpAuthenticated("admin", "1q2w3"); $I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org'); -$I->sendGET('v1/nation/All'); +$I->sendGET('v1/codex/nation/All'); $I->seeResponseCodeIs(200); $I->seeResponseIsJson(); -$I->seeResponseContainsJson([ - 'success' => TRUE, - 'message' => 'Nation found']); - -$I->sendGET('v1/nation/Bundesland'); -$I->seeResponseCodeIs(200); -$I->seeResponseIsJson(); -$I->seeResponseContainsJson([ - 'success' => TRUE, - 'message' => 'Bundesland found']); \ No newline at end of file +$I->seeResponseContainsJson(['error' => 0]); \ No newline at end of file diff --git a/tests/codeception/tests/api/v1/PersonCept.php b/tests/codeception/tests/api/v1/PersonCept.php index af4edd27c..ab292bba6 100644 --- a/tests/codeception/tests/api/v1/PersonCept.php +++ b/tests/codeception/tests/api/v1/PersonCept.php @@ -25,8 +25,8 @@ $I->sendGET('v1/person/person/Person', array('code' => '12345')); $I->seeResponseCodeIs(200); $I->seeResponseIsJson(); $I->seeResponseContainsJson([ - 'success' => false, - 'message' => 'Person not found']); + 'error' => 0, + 'retval' => array()]); $I->sendGET('v1/person/person/Person', array('code' => '01234567C', 'email' => 'harvey.joshuah@calva.dev')); $I->seeResponseCodeIs(200); diff --git a/tests/codeception/tests/api/v1/PlanCept.php b/tests/codeception/tests/api/v1/PlanCept.php deleted file mode 100644 index 90ed424e0..000000000 --- a/tests/codeception/tests/api/v1/PlanCept.php +++ /dev/null @@ -1,12 +0,0 @@ -wantTo('Test API call v1/lehre/studienplan/Studienplaene'); -$I->amHttpAuthenticated("admin", "1q2w3"); -$I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org'); -$I->sendGET('v1/lehre/studienplan/Studienplaene', array('studiengang_kz' => 1)); -$I->seeResponseCodeIs(200); -$I->seeResponseIsJson(); -$I->seeResponseContainsJson([ - 'success' => TRUE, - 'message' => 'Plan found']); \ No newline at end of file diff --git a/tests/codeception/tests/api/v1/StudiengangCept.php b/tests/codeception/tests/api/v1/StudiengangCept.php new file mode 100644 index 000000000..de1b37ae0 --- /dev/null +++ b/tests/codeception/tests/api/v1/StudiengangCept.php @@ -0,0 +1,10 @@ +wantTo('Test API call v1/organisation/studiengang/AllForBewerbung'); +$I->amHttpAuthenticated("admin", "1q2w3"); +$I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org'); +$I->sendGET('v1/organisation/studiengang/AllForBewerbung'); +$I->seeResponseCodeIs(200); +$I->seeResponseIsJson(); +$I->seeResponseContainsJson(['error' => 0]); \ No newline at end of file diff --git a/tests/codeception/tests/api/v1/StudienplanCept.php b/tests/codeception/tests/api/v1/StudienplanCept.php new file mode 100644 index 000000000..78a2ce600 --- /dev/null +++ b/tests/codeception/tests/api/v1/StudienplanCept.php @@ -0,0 +1,10 @@ +wantTo('Test API call v1/organisation/studienplan/Studienplaene'); +$I->amHttpAuthenticated("admin", "1q2w3"); +$I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org'); +$I->sendGET('v1/organisation/studienplan/Studienplaene', array('studiengang_kz' => 1)); +$I->seeResponseCodeIs(200); +$I->seeResponseIsJson(); +$I->seeResponseContainsJson(['error' => 0]); \ No newline at end of file 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 @@ + + +