diff --git a/application/config/fhcomplete.php b/application/config/fhcomplete.php index 7d116f927..427270550 100644 --- a/application/config/fhcomplete.php +++ b/application/config/fhcomplete.php @@ -2,252 +2,8 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); -$config['fhc_version'] = '3.2'; +$config['fhc_version'] = '3.3'; -$config['fhc_acl'] = array -( - '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', - '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_dms_version' => 'basis/dms_version', - '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_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_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' => 'lehre/studienordnung', - 'lehre.tbl_studienordnungstatus' => 'lehre/studienordnungstatus', - 'lehre.tbl_studienplan' => 'lehre/studienplan', - 'lehre.tbl_studienplatz' => 'basis/studienplatz', - 'lehre.tbl_studienplan_semester' => 'lehre/studienplan_semester', - '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_zeugnis' => 'basis/zeugnis', - 'lehre.tbl_zeugnisnote' => 'basis/zeugnisnote', - 'lehre.vw_studienplan' => 'lehre/studienplan', - '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_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_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/message', - 'public.tbl_msg_recipient' => 'basis/message', - 'public.tbl_msg_status' => 'basis/message', - 'public.tbl_msg_attachment' => 'basis/message', - 'public.tbl_notiz' => 'basis/notiz', - 'public.tbl_notizzuordnung' => 'basis/notizzuordnung', - 'public.tbl_organisationseinheit' => 'basis/organisationseinheit', - 'public.tbl_organisationseinheittyp' => 'basis/organisationseinheittyp', - 'public.tbl_ort' => 'basis/ort', - 'public.tbl_ortraumtyp' => 'basis/ortraumtyp', - 'public.tbl_person' => 'basis/person', - 'public.tbl_personfunktionstandort' => 'basis/personfunktionstandort', - 'public.tbl_preincoming' => 'basis/preincoming', - 'public.tbl_preinteressent' => 'basis/preinteressent', - 'public.tbl_preinteressentstudiengang' => 'basis/preinteressentstudiengang', - 'public.tbl_preoutgoing' => 'basis/preoutgoing', - 'public.tbl_prestudent' => 'basis/prestudent', - 'public.tbl_prestudentstatus' => 'basis/prestudentstatus', - 'public.tbl_raumtyp' => 'basis/raumtyp', - 'public.tbl_reihungstest' => 'basis/reihungstest', - 'public.tbl_semesterwochen' => 'basis/semesterwochen', - 'public.tbl_service' => 'basis/service', - 'public.tbl_sprache' => 'basis/sprache', - 'public.tbl_standort' => 'basis/standort', - 'public.tbl_statistik' => 'basis/statistik', - 'public.tbl_status' => 'basis/status', - 'public.tbl_status_grund' => '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' => 'system/vorlage', - 'public.tbl_vorlagedokument' => 'system/vorlagestudiengang', - 'public.tbl_vorlagestudiengang' => 'system/vorlagestudiengang', - 'public.tbl_rt_person' => 'basis/person', - 'public.vw_studiensemester' => 'basis/studiensemester', - 'system.tbl_app' => 'system/app', - 'system.tbl_appdaten' => 'system/appdaten', - 'system.tbl_benutzerrolle' => 'basis/benutzerrolle', - 'system.tbl_berechtigung' => 'basis/berechtigung', - 'system.tbl_filters' => 'system/filters', - 'system.tbl_cronjob' => 'basis/cronjob', - 'system.tbl_phrase' => 'system/phrase', - 'system.tbl_phrasentext' => 'system/phrase', - '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', - 'system.tbl_udf' => 'system/udf', - 'system.tbl_extensions' => 'system/extensions', - 'system.tbl_log' => 'basis/log', - 'system.tbl_person_lock' => 'system/personlock', - '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', - - // Temporary - 'extension.tbl_budget_antrag' => 'basis/kostenstelle', - 'extension.tbl_budget_position' => 'basis/kostenstelle', - 'extension.tbl_budget_status' => 'basis/kostenstelle', - 'extension.tbl_budget_antrag_status' => 'basis/kostenstelle', - 'extension.tbl_dsms_anonymisierung' => 'dsms/export', - - DMS_PATH => 'fs/dms', - - 'PhrasesLib.getPhrase' => 'system/PhrasesLib' -); - -// $config['addons_aufnahme_url'] = array(); +$config['addons_aufnahme_url']['fallback'] = 'https://localhost/fhcomplete/index.ci.php/ViewMessage/writeReply/'; $config['addons_aufnahme_url']['OE_ROOT'] = 'https://SERVER-NAME/addons/aufnahme/OE_ROOT/cis/index.php'; diff --git a/application/config/message.php b/application/config/message.php index 1dc1c67ea..8689f94bd 100644 --- a/application/config/message.php +++ b/application/config/message.php @@ -7,9 +7,11 @@ $config['send_immediately'] = false; $config['msg_delivery'] = true; // Default true $config['system_person_id'] = 1; // Dummy sender, used for sending messages from the system -$config['redirect_view_message_url'] = site_url('Redirect/redirectByToken/'); // -$config['message_html_view_url'] = site_url('ViewMessage/toHTML/'); -$config['message_server'] = 'http://www.fhcomplete.org/'; +$config['redirect_view_message_url'] = '/Redirect/redirectByToken/'; +$config['message_html_view_url'] = '/ViewMessage/toHTML/'; + +// Change this to CIS Server (https://cis.example.com/index.ci.php) if you are sending Messages from Vilesci +$config['message_server'] = site_url(); $config['assistent_function'] = 'ass'; define('EMAIL_KONTAKT_TYPE', 'email'); // Email kontakt type diff --git a/application/config/navigation.php b/application/config/navigation.php index 485f8a3d9..7f1b29932 100644 --- a/application/config/navigation.php +++ b/application/config/navigation.php @@ -15,7 +15,8 @@ $config['navigation_header'] = array( 'link' => base_url('vilesci'), 'icon' => '', 'description' => 'Vilesci', - 'sort' => 2 + 'sort' => 2, + 'requiredPermissions' => 'basis/vilesci:r' ), 'cis' => array( 'link' => CIS_ROOT, @@ -57,7 +58,8 @@ $config['navigation_menu']['Vilesci/index'] = array( 'icon' => 'info', 'description' => 'Infocenter', 'expand' => true, - 'sort' => 2 + 'sort' => 2, + 'requiredPermissions' => 'infocenter:r' ), ) ), @@ -73,14 +75,16 @@ $config['navigation_menu']['Vilesci/index'] = array( 'icon' => '', 'description' => 'Vilesci', 'expand' => true, - 'sort' => 1 + 'sort' => 1, + 'requiredPermissions' => 'basis/vilesci:r' ), 'extensions' => array( 'link' => site_url('system/extensions/Manager'), 'icon' => 'cubes', 'description' => 'Extensions Manager', 'expand' => true, - 'sort' => 2 + 'sort' => 2, + 'requiredPermissions' => 'admin:r' ) ) ) diff --git a/application/controllers/DBTools.php b/application/controllers/DBTools.php index ee5d8e363..1330c7ac8 100644 --- a/application/controllers/DBTools.php +++ b/application/controllers/DBTools.php @@ -8,7 +8,7 @@ if (! defined('BASEPATH')) * */ -class DBTools extends FHC_Controller +class DBTools extends Auth_Controller { private $cli = false; /** @@ -32,7 +32,8 @@ class DBTools extends FHC_Controller */ public function __construct() { - parent::__construct(); + // An empty array as parameter will ensure that this controller is ONLY callable from command line + parent::__construct(array()); $this->seed_path = APPPATH.'seeds/'; diff --git a/application/controllers/MailJob.php b/application/controllers/MailJob.php index 3149176f0..2f8b5b92d 100644 --- a/application/controllers/MailJob.php +++ b/application/controllers/MailJob.php @@ -14,14 +14,15 @@ if (!defined("BASEPATH")) exit("No direct script access allowed"); -class MailJob extends FHC_Controller +class MailJob extends Auth_Controller { /** * API constructor */ public function __construct() { - parent::__construct(); + // An empty array as parameter will ensure that this controller is ONLY callable from command line + parent::__construct(array()); // Loads MessageLib $this->load->library('MessageLib'); diff --git a/application/controllers/Redirect.php b/application/controllers/Redirect.php index e372683a4..38b7c6dbe 100644 --- a/application/controllers/Redirect.php +++ b/application/controllers/Redirect.php @@ -23,9 +23,6 @@ class Redirect extends FHC_Controller { parent::__construct(); - // Loads config file fhcomplete - $this->config->load('fhcomplete'); - // Loads model MessageTokenModel $this->load->model('system/MessageToken_model', 'MessageTokenModel'); } @@ -62,6 +59,8 @@ class Redirect extends FHC_Controller } $addonAufnahmeUrls = $this->config->item('addons_aufnahme_url'); + if(!isset($addonAufnahmeUrls[$organisationRoot])) + $organisationRoot = 'fallback'; if (isset($token) && hasData($msg) @@ -72,5 +71,16 @@ class Redirect extends FHC_Controller redirect($addonAufnahmeUrls[$organisationRoot] . '?token=' . $token); } } + else + { + $addonAufnahmeUrls = $this->config->item('addons_aufnahme_url'); + if (isset($token) + && hasData($msg) + && is_array($addonAufnahmeUrls) + && isset($addonAufnahmeUrls['fallback'])) + { + redirect($addonAufnahmeUrls['fallback'] . '?token=' . $token); + } + } } } diff --git a/application/controllers/ViewMessage.php b/application/controllers/ViewMessage.php index 48c0a09f1..118e16186 100644 --- a/application/controllers/ViewMessage.php +++ b/application/controllers/ViewMessage.php @@ -15,10 +15,11 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); /** + * Handles sending messages with token * NOTE: in this controller is not possible to include/call everything * that automatically call the authentication system, like the most of models or libraries */ -class ViewMessage extends CI_Controller +class ViewMessage extends FHC_Controller { /** * API constructor @@ -68,7 +69,7 @@ class ViewMessage extends CI_Controller } if($this->config->item('redirect_view_message_url') != '') - $href = APP_ROOT . $this->config->item('redirect_view_message_url') . $token; + $href = $this->config->item('message_server').$this->config->item('redirect_view_message_url').$token; else $href = ''; @@ -83,4 +84,130 @@ class ViewMessage extends CI_Controller $this->load->view('system/messageHTML.php', $data); } } + + /** + * write the reply + */ + public function writeReply() + { + $token = $this->input->get('token'); + + if (isEmptyString($token)) + { + show_error('no token supplied'); + } + + $msg = null; + + // Get message data if possible + $msg = $this->MessageTokenModel->getMessageByToken($token); + + if (!hasData($msg)) + { + show_error('no message found'); + } + + $msg = $msg->retval[0]; + + // Get variables + $receiverData = $this->MessageTokenModel->getPersonData($msg->sender_id); + + if (!hasData($receiverData)) + { + show_error('no sender found'); + } + + $data = array ( + 'receivers' => $receiverData->retval, + 'message' => $msg, + 'token' => $token + ); + + $this->load->view('system/messageWriteReply', $data); + } + + /** + * send reply + */ + public function sendReply() + { + $this->load->model('system/Message_model', 'MessageModel'); + $this->load->library('MessageLib'); + + $error = false; + + $subject = $this->input->post('subject'); + $body = $this->input->post('body'); + $persons = $this->input->post('persons'); + $relationmessage_id = $this->input->post('relationmessage_id'); + $token = $this->input->post('token'); + + if (!isset($relationmessage_id) || $relationmessage_id == '' || !isset($token) || $token == '') + { + show_error('Error while sending reply'); + $error = true; + } + + $relationmsg = $this->MessageTokenModel->getMessageByToken($token); + + // check if correct message + if (!hasData($relationmsg) || $relationmessage_id !== $relationmsg->retval[0]->message_id) + { + show_error('Error while sending reply'); + $error = true; + } + + // get sender (receiver of previous msg) + $sender_id = $relationmsg->retval[0]->receiver_id; + + // get message data of persons + $data = $this->MessageTokenModel->getPersonData($persons); + + // send message(s) + if (hasData($data)) + { + for ($i = 0; $i < count($data->retval); $i++) + { + $dataArray = (array)$data->retval[$i]; + + $msg = $this->messagelib->sendMessage($sender_id, $dataArray['person_id'], $subject, $body, PRIORITY_NORMAL, $relationmessage_id, null); + if ($msg->error) + { + show_error($msg->retval); + $error = true; + break; + } + + // Loads the person log library + $this->load->library('PersonLogLib'); + + // Write log entry for sender + $logtype_kurzbz = 'Action'; + $logdata = array( + 'name' => 'Message sent', + 'message' => 'Message sent from person '.$sender_id.' to '.$dataArray['person_id'].', messageid '.$msg->retval, + 'success' => 'true' + ); + $taetigkeit_kurzbz = 'kommunikation'; + $app = 'core'; + $oe_kurzbz = null; + $insertvon = 'online'; + + $this->personloglib->log( + $sender_id, + $logtype_kurzbz, + $logdata, + $taetigkeit_kurzbz, + $app, + $oe_kurzbz, + $insertvon + ); + } + } + + if (!$error) + { + $this->load->view('system/messageSent'); + } + } } diff --git a/application/controllers/Vilesci.php b/application/controllers/Vilesci.php index abfad4dd1..59f1d7783 100644 --- a/application/controllers/Vilesci.php +++ b/application/controllers/Vilesci.php @@ -1,12 +1,16 @@ - 'basis/vilesci:r' + ) + ); $this->load->library('WidgetLib'); } diff --git a/application/controllers/api/v1/CheckUserAuth.php b/application/controllers/api/v1/CheckUserAuth.php index e7bc30ae9..181c68ca1 100644 --- a/application/controllers/api/v1/CheckUserAuth.php +++ b/application/controllers/api/v1/CheckUserAuth.php @@ -14,7 +14,9 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class CheckUserAuth extends APIv1_Controller +require_once APPPATH.'/libraries/REST_Controller.php'; + +class CheckUserAuth extends REST_Controller { /** * Course API constructor. diff --git a/application/controllers/api/v1/Test.php b/application/controllers/api/v1/Test.php index fd1896560..fa79f1c1e 100644 --- a/application/controllers/api/v1/Test.php +++ b/application/controllers/api/v1/Test.php @@ -2,14 +2,19 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); +require_once APPPATH.'/libraries/REST_Controller.php'; + /** * Testing class for REST calls and authentication */ -class Test extends APIv1_Controller +class Test extends REST_Controller { public function __construct() { parent::__construct(); + + // Loads helper message to manage returning messages + $this->load->helper('fhc_message'); } /** diff --git a/application/controllers/api/v1/accounting/Aufteilung.php b/application/controllers/api/v1/accounting/Aufteilung.php index 6c374ba17..cc9c2826f 100644 --- a/application/controllers/api/v1/accounting/Aufteilung.php +++ b/application/controllers/api/v1/accounting/Aufteilung.php @@ -21,7 +21,7 @@ class Aufteilung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Aufteilung' => 'basis/aufteilung:rw')); // Load model AufteilungModel $this->load->model('accounting/aufteilung_model', 'AufteilungModel'); } @@ -32,11 +32,11 @@ class Aufteilung extends APIv1_Controller public function getAufteilung() { $aufteilungID = $this->get('aufteilung_id'); - + if (isset($aufteilungID)) { $result = $this->AufteilungModel->load($aufteilungID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Aufteilung extends APIv1_Controller { $result = $this->AufteilungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Aufteilung extends APIv1_Controller $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 index 6cc7d8767..191ba95a0 100644 --- a/application/controllers/api/v1/accounting/Bestelldetail.php +++ b/application/controllers/api/v1/accounting/Bestelldetail.php @@ -21,7 +21,7 @@ class Bestelldetail extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Bestelldetail' => 'basis/bestelldetail:rw')); // Load model BestelldetailModel $this->load->model('accounting/bestelldetail_model', 'BestelldetailModel'); } @@ -32,11 +32,11 @@ class Bestelldetail extends APIv1_Controller public function getBestelldetail() { $bestelldetailID = $this->get('bestelldetail_id'); - + if (isset($bestelldetailID)) { $result = $this->BestelldetailModel->load($bestelldetailID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Bestelldetail extends APIv1_Controller { $result = $this->BestelldetailModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Bestelldetail extends APIv1_Controller $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 index 064594f39..36229d47c 100644 --- a/application/controllers/api/v1/accounting/Bestelldetailtag.php +++ b/application/controllers/api/v1/accounting/Bestelldetailtag.php @@ -21,7 +21,7 @@ class Bestelldetailtag extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Bestelldetailtag' => 'basis/bestelldetailtag:rw')); // Load model BestelldetailtagModel $this->load->model('accounting/bestelldetailtag_model', 'BestelldetailtagModel'); } @@ -33,11 +33,11 @@ class Bestelldetailtag extends APIv1_Controller { $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 @@ -61,7 +61,7 @@ class Bestelldetailtag extends APIv1_Controller { $result = $this->BestelldetailtagModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,9 +69,9 @@ class Bestelldetailtag extends APIv1_Controller $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 index 85408c820..dc3695ff2 100644 --- a/application/controllers/api/v1/accounting/Bestellstatus.php +++ b/application/controllers/api/v1/accounting/Bestellstatus.php @@ -21,7 +21,7 @@ class Bestellstatus extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Bestellstatus' => 'basis/bestellstatus:rw')); // Load model BestellstatusModel $this->load->model('accounting/bestellstatus_model', 'BestellstatusModel'); } @@ -32,11 +32,11 @@ class Bestellstatus extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Bestellstatus extends APIv1_Controller { $result = $this->BestellstatusModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Bestellstatus extends APIv1_Controller $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 index 984b5b89b..018b77180 100644 --- a/application/controllers/api/v1/accounting/Bestellung.php +++ b/application/controllers/api/v1/accounting/Bestellung.php @@ -21,7 +21,7 @@ class Bestellung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Bestellung' => 'basis/bestellung:rw')); // Load model BestellungModel $this->load->model('accounting/bestellung_model', 'BestellungModel'); } @@ -32,11 +32,11 @@ class Bestellung extends APIv1_Controller public function getBestellung() { $bestellungID = $this->get('bestellung_id'); - + if (isset($bestellungID)) { $result = $this->BestellungModel->load($bestellungID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Bestellung extends APIv1_Controller { $result = $this->BestellungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Bestellung extends APIv1_Controller $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 index c8d715a5b..7b404fa05 100644 --- a/application/controllers/api/v1/accounting/Bestellungtag.php +++ b/application/controllers/api/v1/accounting/Bestellungtag.php @@ -21,7 +21,7 @@ class Bestellungtag extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Bestellungtag' => 'basis/bestellungtag:rw')); // Load model BestellungtagModel $this->load->model('accounting/bestellungtag_model', 'BestellungtagModel'); } @@ -33,11 +33,11 @@ class Bestellungtag extends APIv1_Controller { $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 @@ -61,7 +61,7 @@ class Bestellungtag extends APIv1_Controller { $result = $this->BestellungtagModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,9 +69,9 @@ class Bestellungtag extends APIv1_Controller $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 index d40974a88..12fa02c33 100644 --- a/application/controllers/api/v1/accounting/Buchung.php +++ b/application/controllers/api/v1/accounting/Buchung.php @@ -21,7 +21,7 @@ class Buchung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Buchung' => 'basis/buchung:r')); // Load model BuchungModel $this->load->model('accounting/buchung_model', 'BuchungModel'); } @@ -32,11 +32,11 @@ class Buchung extends APIv1_Controller public function getBuchung() { $buchungID = $this->get('buchung_id'); - + if (isset($buchungID)) { $result = $this->BuchungModel->load($buchungID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Buchung extends APIv1_Controller { $result = $this->BuchungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Buchung extends APIv1_Controller $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 index 50efa179f..3e9718469 100644 --- a/application/controllers/api/v1/accounting/Buchungstyp.php +++ b/application/controllers/api/v1/accounting/Buchungstyp.php @@ -21,7 +21,7 @@ class Buchungstyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Buchungstyp' => 'basis/buchungstyp:rw')); // Load model BuchungstypModel $this->load->model('accounting/buchungstyp_model', 'BuchungstypModel'); } @@ -32,11 +32,11 @@ class Buchungstyp extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Buchungstyp extends APIv1_Controller { $result = $this->BuchungstypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Buchungstyp extends APIv1_Controller $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 index 2af229a5f..31ee3ef1c 100644 --- a/application/controllers/api/v1/accounting/Budget.php +++ b/application/controllers/api/v1/accounting/Budget.php @@ -21,7 +21,7 @@ class Budget extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Budget' => 'basis/budget:rw')); // Load model BudgetModel $this->load->model('accounting/budget_model', 'BudgetModel'); } @@ -33,11 +33,11 @@ class Budget extends APIv1_Controller { $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 @@ -61,7 +61,7 @@ class Budget extends APIv1_Controller { $result = $this->BudgetModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,9 +69,9 @@ class Budget extends APIv1_Controller $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 index e56a9b0d6..0b78ff98f 100644 --- a/application/controllers/api/v1/accounting/Konto.php +++ b/application/controllers/api/v1/accounting/Konto.php @@ -21,7 +21,7 @@ class Konto extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Konto' => 'basis/konto:rw')); // Load model KontoModel $this->load->model('accounting/konto_model', 'KontoModel'); } @@ -32,11 +32,11 @@ class Konto extends APIv1_Controller public function getKonto() { $kontoID = $this->get('konto_id'); - + if (isset($kontoID)) { $result = $this->KontoModel->load($kontoID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Konto extends APIv1_Controller { $result = $this->KontoModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Konto extends APIv1_Controller $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 index 813039245..2ebf554c0 100644 --- a/application/controllers/api/v1/accounting/Kostenstelle.php +++ b/application/controllers/api/v1/accounting/Kostenstelle.php @@ -21,7 +21,7 @@ class Kostenstelle extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Kostenstelle' => 'basis/kostenstelle:rw')); // Load model KostenstelleModel $this->load->model('accounting/kostenstelle_model', 'KostenstelleModel'); } @@ -32,11 +32,11 @@ class Kostenstelle extends APIv1_Controller public function getKostenstelle() { $kostenstelleID = $this->get('kostenstelle_id'); - + if (isset($kostenstelleID)) { $result = $this->KostenstelleModel->load($kostenstelleID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Kostenstelle extends APIv1_Controller { $result = $this->KostenstelleModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Kostenstelle extends APIv1_Controller $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 index 015c8ac57..5ac77b36b 100644 --- a/application/controllers/api/v1/accounting/Rechnung.php +++ b/application/controllers/api/v1/accounting/Rechnung.php @@ -21,7 +21,7 @@ class Rechnung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Rechnung' => 'basis/rechnung:rw')); // Load model RechnungModel $this->load->model('accounting/rechnung_model', 'RechnungModel'); } @@ -32,11 +32,11 @@ class Rechnung extends APIv1_Controller public function getRechnung() { $rechnungID = $this->get('rechnung_id'); - + if (isset($rechnungID)) { $result = $this->RechnungModel->load($rechnungID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Rechnung extends APIv1_Controller { $result = $this->RechnungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Rechnung extends APIv1_Controller $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 index 7ed6e46a5..2f02c794d 100644 --- a/application/controllers/api/v1/accounting/Rechnungsbetrag.php +++ b/application/controllers/api/v1/accounting/Rechnungsbetrag.php @@ -21,7 +21,7 @@ class Rechnungsbetrag extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Rechnungsbetrag' => 'basis/rechnungsbetrag:rw')); // Load model RechnungsbetragModel $this->load->model('accounting/rechnungsbetrag_model', 'RechnungsbetragModel'); } @@ -32,11 +32,11 @@ class Rechnungsbetrag extends APIv1_Controller public function getRechnungsbetrag() { $rechnungsbetragID = $this->get('rechnungsbetrag_id'); - + if (isset($rechnungsbetragID)) { $result = $this->RechnungsbetragModel->load($rechnungsbetragID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Rechnungsbetrag extends APIv1_Controller { $result = $this->RechnungsbetragModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Rechnungsbetrag extends APIv1_Controller $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 index 507d4c074..f85dae43e 100644 --- a/application/controllers/api/v1/accounting/Rechnungstyp.php +++ b/application/controllers/api/v1/accounting/Rechnungstyp.php @@ -21,7 +21,7 @@ class Rechnungstyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Rechnungstyp' => 'basis/rechnungstyp:rw')); // Load model RechnungstypModel $this->load->model('accounting/rechnungstyp_model', 'RechnungstypModel'); } @@ -32,11 +32,11 @@ class Rechnungstyp extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Rechnungstyp extends APIv1_Controller { $result = $this->RechnungstypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Rechnungstyp extends APIv1_Controller $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 index f627db74a..3b3d3fac2 100644 --- a/application/controllers/api/v1/accounting/Vertrag.php +++ b/application/controllers/api/v1/accounting/Vertrag.php @@ -21,7 +21,7 @@ class Vertrag extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Vertrag' => 'basis/vertrag:rw')); // Load model VertragModel $this->load->model('accounting/vertrag_model', 'VertragModel'); } @@ -32,11 +32,11 @@ class Vertrag extends APIv1_Controller public function getVertrag() { $vertragID = $this->get('vertrag_id'); - + if (isset($vertragID)) { $result = $this->VertragModel->load($vertragID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Vertrag extends APIv1_Controller { $result = $this->VertragModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Vertrag extends APIv1_Controller $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 index bfe3a5f3f..c6125e609 100644 --- a/application/controllers/api/v1/accounting/Vertragsstatus.php +++ b/application/controllers/api/v1/accounting/Vertragsstatus.php @@ -21,7 +21,7 @@ class Vertragsstatus extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Vertragsstatus' => 'basis/vertragsstatus:rw')); // Load model VertragsstatusModel $this->load->model('accounting/vertragsstatus_model', 'VertragsstatusModel'); } @@ -32,11 +32,11 @@ class Vertragsstatus extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Vertragsstatus extends APIv1_Controller { $result = $this->VertragsstatusModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Vertragsstatus extends APIv1_Controller $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 index 025d39c16..69b0907dd 100644 --- a/application/controllers/api/v1/accounting/Vertragstyp.php +++ b/application/controllers/api/v1/accounting/Vertragstyp.php @@ -21,7 +21,7 @@ class Vertragstyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Vertragstyp' => 'basis/vertragstyp:rw')); // Load model VertragstypModel $this->load->model('accounting/vertragstyp_model', 'VertragstypModel'); } @@ -32,11 +32,11 @@ class Vertragstyp extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Vertragstyp extends APIv1_Controller { $result = $this->VertragstypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Vertragstyp extends APIv1_Controller $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 index dad2c9edb..e7abf74df 100644 --- a/application/controllers/api/v1/accounting/Zahlungstyp.php +++ b/application/controllers/api/v1/accounting/Zahlungstyp.php @@ -21,7 +21,7 @@ class Zahlungstyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Zahlungstyp' => 'basis/zahlungstyp:rw')); // Load model ZahlungstypModel $this->load->model('accounting/zahlungstyp_model', 'ZahlungstypModel'); } @@ -32,11 +32,11 @@ class Zahlungstyp extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Zahlungstyp extends APIv1_Controller { $result = $this->ZahlungstypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Zahlungstyp extends APIv1_Controller $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 index 5ee160709..2aeb01e59 100644 --- a/application/controllers/api/v1/codex/Akadgrad.php +++ b/application/controllers/api/v1/codex/Akadgrad.php @@ -21,7 +21,7 @@ class Akadgrad extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Akadgrad' => 'basis/akadgrad:rw')); // Load model AkadgradModel $this->load->model('codex/akadgrad_model', 'AkadgradModel'); } @@ -32,11 +32,11 @@ class Akadgrad extends APIv1_Controller public function getAkadgrad() { $akadgradID = $this->get('akadgrad_id'); - + if (isset($akadgradID)) { $result = $this->AkadgradModel->load($akadgradID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Akadgrad extends APIv1_Controller { $result = $this->AkadgradModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Akadgrad extends APIv1_Controller $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 index 8acc38af9..b35ec840d 100644 --- a/application/controllers/api/v1/codex/Archiv.php +++ b/application/controllers/api/v1/codex/Archiv.php @@ -21,7 +21,7 @@ class Archiv extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Archiv' => 'basis/archiv:rw')); // Load model ArchivModel $this->load->model('codex/archiv_model', 'ArchivModel'); } @@ -32,11 +32,11 @@ class Archiv extends APIv1_Controller public function getArchiv() { $archivID = $this->get('archiv_id'); - + if (isset($archivID)) { $result = $this->ArchivModel->load($archivID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Archiv extends APIv1_Controller { $result = $this->ArchivModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Archiv extends APIv1_Controller $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 index 7ba8269cd..dc27d4dd8 100644 --- a/application/controllers/api/v1/codex/Aufmerksamdurch.php +++ b/application/controllers/api/v1/codex/Aufmerksamdurch.php @@ -21,7 +21,7 @@ class Aufmerksamdurch extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Aufmerksamdurch' => 'basis/aufmerksamdurch:rw')); // Load model AufmerksamdurchModel $this->load->model('codex/aufmerksamdurch_model', 'AufmerksamdurchModel'); } @@ -32,11 +32,11 @@ class Aufmerksamdurch extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Aufmerksamdurch extends APIv1_Controller { $result = $this->AufmerksamdurchModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Aufmerksamdurch extends APIv1_Controller $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 index 277f12e59..4fea8add4 100644 --- a/application/controllers/api/v1/codex/Ausbildung.php +++ b/application/controllers/api/v1/codex/Ausbildung.php @@ -21,7 +21,7 @@ class Ausbildung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Ausbildung' => 'basis/ausbildung:rw')); // Load model AusbildungModel $this->load->model('codex/ausbildung_model', 'AusbildungModel'); } @@ -32,11 +32,11 @@ class Ausbildung extends APIv1_Controller public function getAusbildung() { $ausbildungcode = $this->get('ausbildungcode'); - + if (isset($ausbildungcode)) { $result = $this->AusbildungModel->load($ausbildungcode); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Ausbildung extends APIv1_Controller { $result = $this->AusbildungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Ausbildung extends APIv1_Controller $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 index 7618932e4..0941eba9e 100644 --- a/application/controllers/api/v1/codex/Berufstaetigkeit.php +++ b/application/controllers/api/v1/codex/Berufstaetigkeit.php @@ -21,7 +21,7 @@ class Berufstaetigkeit extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Berufstaetigkeit' => 'basis/berufstaetigkeit:rw')); // Load model BerufstaetigkeitModel $this->load->model('codex/berufstaetigkeit_model', 'BerufstaetigkeitModel'); } @@ -32,11 +32,11 @@ class Berufstaetigkeit extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Berufstaetigkeit extends APIv1_Controller { $result = $this->BerufstaetigkeitModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Berufstaetigkeit extends APIv1_Controller $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 index 63eba5ce1..115aa37fd 100644 --- a/application/controllers/api/v1/codex/Beschaeftigungsausmass.php +++ b/application/controllers/api/v1/codex/Beschaeftigungsausmass.php @@ -21,7 +21,7 @@ class Beschaeftigungsausmass extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Beschaeftigungsausmass' => 'basis/beschaeftigungsausmass:rw')); // Load model BeschaeftigungsausmassModel $this->load->model('codex/beschaeftigungsausmass_model', 'BeschaeftigungsausmassModel'); } @@ -32,11 +32,11 @@ class Beschaeftigungsausmass extends APIv1_Controller public function getBeschaeftigungsausmass() { $beschausmasscode = $this->get('beschausmasscode'); - + if (isset($beschausmasscode)) { $result = $this->BeschaeftigungsausmassModel->load($beschausmasscode); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Beschaeftigungsausmass extends APIv1_Controller { $result = $this->BeschaeftigungsausmassModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Beschaeftigungsausmass extends APIv1_Controller $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 index 419fab89a..6bad18ff7 100644 --- a/application/controllers/api/v1/codex/Besqual.php +++ b/application/controllers/api/v1/codex/Besqual.php @@ -21,7 +21,7 @@ class Besqual extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Besqual' => 'basis/besqual:rw')); // Load model BesqualModel $this->load->model('codex/besqual_model', 'BesqualModel'); } @@ -32,11 +32,11 @@ class Besqual extends APIv1_Controller public function getBesqual() { $besqualcode = $this->get('besqualcode'); - + if (isset($besqualcode)) { $result = $this->BesqualModel->load($besqualcode); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Besqual extends APIv1_Controller { $result = $this->BesqualModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Besqual extends APIv1_Controller $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 index 80d3ffbf6..85a7fca7b 100644 --- a/application/controllers/api/v1/codex/Bisfunktion.php +++ b/application/controllers/api/v1/codex/Bisfunktion.php @@ -21,7 +21,7 @@ class Bisfunktion extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Bisfunktion' => 'basis/bisfunktion:rw')); // Load model BisfunktionModel $this->load->model('codex/bisfunktion_model', 'BisfunktionModel'); } @@ -33,11 +33,11 @@ class Bisfunktion extends APIv1_Controller { $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 @@ -61,7 +61,7 @@ class Bisfunktion extends APIv1_Controller { $result = $this->BisfunktionModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,9 +69,9 @@ class Bisfunktion extends APIv1_Controller $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 index 3fe5171b1..1b0999bb1 100644 --- a/application/controllers/api/v1/codex/Bisio.php +++ b/application/controllers/api/v1/codex/Bisio.php @@ -21,7 +21,7 @@ class Bisio extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Bisio' => 'basis/bisio:rw')); // Load model BisioModel $this->load->model('codex/bisio_model', 'BisioModel'); } @@ -32,11 +32,11 @@ class Bisio extends APIv1_Controller public function getBisio() { $bisioID = $this->get('bisio_id'); - + if (isset($bisioID)) { $result = $this->BisioModel->load($bisioID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Bisio extends APIv1_Controller { $result = $this->BisioModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Bisio extends APIv1_Controller $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 index 54bf7aa66..af72644c8 100644 --- a/application/controllers/api/v1/codex/Bisorgform.php +++ b/application/controllers/api/v1/codex/Bisorgform.php @@ -21,7 +21,7 @@ class Bisorgform extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Bisorgform' => 'basis/bisorgform:rw')); // Load model BisorgformModel $this->load->model('codex/bisorgform_model', 'BisorgformModel'); } @@ -32,11 +32,11 @@ class Bisorgform extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Bisorgform extends APIv1_Controller { $result = $this->BisorgformModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Bisorgform extends APIv1_Controller $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 index 2139ada3b..ee2b0d5ca 100644 --- a/application/controllers/api/v1/codex/Bisverwendung.php +++ b/application/controllers/api/v1/codex/Bisverwendung.php @@ -21,7 +21,7 @@ class Bisverwendung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Bisverwendung' => 'basis/bisverwendung:rw')); // Load model BisverwendungModel $this->load->model('codex/bisverwendung_model', 'BisverwendungModel'); } @@ -32,11 +32,11 @@ class Bisverwendung extends APIv1_Controller public function getBisverwendung() { $bisverwendungID = $this->get('bisverwendung_id'); - + if (isset($bisverwendungID)) { $result = $this->BisverwendungModel->load($bisverwendungID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Bisverwendung extends APIv1_Controller { $result = $this->BisverwendungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Bisverwendung extends APIv1_Controller $this->response(); } } - + private function _validate($bisverwendung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/codex/Bundesland.php b/application/controllers/api/v1/codex/Bundesland.php index 68d44f130..ccff4f047 100644 --- a/application/controllers/api/v1/codex/Bundesland.php +++ b/application/controllers/api/v1/codex/Bundesland.php @@ -21,7 +21,7 @@ class Bundesland extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('All' => 'basis/bundesland:r')); // Load model PersonModel $this->load->model('codex/bundesland_model', 'BundeslandModel'); } diff --git a/application/controllers/api/v1/codex/Entwicklungsteam.php b/application/controllers/api/v1/codex/Entwicklungsteam.php index 21b4dda91..bf376a842 100644 --- a/application/controllers/api/v1/codex/Entwicklungsteam.php +++ b/application/controllers/api/v1/codex/Entwicklungsteam.php @@ -21,7 +21,7 @@ class Entwicklungsteam extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Entwicklungsteam' => 'basis/entwicklungsteam:rw')); // Load model EntwicklungsteamModel $this->load->model('codex/entwicklungsteam_model', 'EntwicklungsteamModel'); } @@ -33,11 +33,11 @@ class Entwicklungsteam extends APIv1_Controller { $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 @@ -61,7 +61,7 @@ class Entwicklungsteam extends APIv1_Controller { $result = $this->EntwicklungsteamModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,9 +69,9 @@ class Entwicklungsteam extends APIv1_Controller $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 index 52b879598..340d1ed9b 100644 --- a/application/controllers/api/v1/codex/Gemeinde.php +++ b/application/controllers/api/v1/codex/Gemeinde.php @@ -21,9 +21,9 @@ class Gemeinde extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Gemeinde' => 'basis/gemeinde:rw', 'GemeindeByPlz' => 'basis/gemeinde:r')); // Load model GemeindeModel - $this->load->model("codex/gemeinde_model", "GemeindeModel"); + $this->load->model('codex/gemeinde_model', 'GemeindeModel'); } /** @@ -32,7 +32,7 @@ class Gemeinde extends APIv1_Controller public function getGemeinde() { $gemeindeID = $this->get("gemeinde_id"); - + $this->GemeindeModel->addOrder("plz"); if (isset($gemeindeID)) { @@ -42,21 +42,21 @@ class Gemeinde extends APIv1_Controller { $result = $this->GemeindeModel->load(); } - + $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ public function getGemeindeByPlz() { $plz = $this->get("plz"); - + if (is_numeric($plz)) { $result = $this->GemeindeModel->getGemeindeByPlz($plz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -80,7 +80,7 @@ class Gemeinde extends APIv1_Controller { $result = $this->GemeindeModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -88,9 +88,9 @@ class Gemeinde extends APIv1_Controller $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 index bdce2872d..05396c473 100644 --- a/application/controllers/api/v1/codex/Hauptberuf.php +++ b/application/controllers/api/v1/codex/Hauptberuf.php @@ -21,7 +21,7 @@ class Hauptberuf extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Hauptberuf' => 'basis/hauptberuf:rw')); // Load model HauptberufModel $this->load->model('codex/hauptberuf_model', 'HauptberufModel'); } @@ -32,11 +32,11 @@ class Hauptberuf extends APIv1_Controller public function getHauptberuf() { $hauptberufcode = $this->get('hauptberufcode'); - + if (isset($hauptberufcode)) { $result = $this->HauptberufModel->load($hauptberufcode); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Hauptberuf extends APIv1_Controller { $result = $this->HauptberufModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Hauptberuf extends APIv1_Controller $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 index 4cd48cecc..e789e76ec 100644 --- a/application/controllers/api/v1/codex/Lehrform.php +++ b/application/controllers/api/v1/codex/Lehrform.php @@ -21,7 +21,7 @@ class Lehrform extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lehrform' => 'basis/lehrform:rw')); // Load model LehrformModel $this->load->model('codex/lehrform_model', 'LehrformModel'); } @@ -32,11 +32,11 @@ class Lehrform extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Lehrform extends APIv1_Controller { $result = $this->LehrformModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Lehrform extends APIv1_Controller $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 index 14dadb1c1..5be7cab59 100644 --- a/application/controllers/api/v1/codex/Lgartcode.php +++ b/application/controllers/api/v1/codex/Lgartcode.php @@ -21,7 +21,7 @@ class Lgartcode extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lgartcode' => 'basis/lgartcode:rw')); // Load model LgartcodeModel $this->load->model('codex/lgartcode_model', 'LgartcodeModel'); } @@ -32,11 +32,11 @@ class Lgartcode extends APIv1_Controller public function getLgartcode() { $lgartcode = $this->get('lgartcode'); - + if (isset($lgartcode)) { $result = $this->LgartcodeModel->load($lgartcode); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Lgartcode extends APIv1_Controller { $result = $this->LgartcodeModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Lgartcode extends APIv1_Controller $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 index b182a6f00..70f0c3dc6 100644 --- a/application/controllers/api/v1/codex/Mobilitaetsprogramm.php +++ b/application/controllers/api/v1/codex/Mobilitaetsprogramm.php @@ -21,7 +21,7 @@ class Mobilitaetsprogramm extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Mobilitaetsprogramm' => 'basis/mobilitaetsprogramm:rw')); // Load model MobilitaetsprogrammModel $this->load->model('codex/mobilitaetsprogramm_model', 'MobilitaetsprogrammModel'); } @@ -32,11 +32,11 @@ class Mobilitaetsprogramm extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Mobilitaetsprogramm extends APIv1_Controller { $result = $this->MobilitaetsprogrammModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Mobilitaetsprogramm extends APIv1_Controller $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 2bf8f8dd5..a8074bd82 100644 --- a/application/controllers/api/v1/codex/Nation.php +++ b/application/controllers/api/v1/codex/Nation.php @@ -21,7 +21,7 @@ class Nation extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Nation' => 'basis/nation:r', 'All' => 'basis/nation:r')); // Load model NationModel $this->load->model('codex/nation_model', 'NationModel'); } diff --git a/application/controllers/api/v1/codex/Note.php b/application/controllers/api/v1/codex/Note.php index a6ddc6741..f42032fe5 100644 --- a/application/controllers/api/v1/codex/Note.php +++ b/application/controllers/api/v1/codex/Note.php @@ -21,7 +21,7 @@ class Note extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Note' => 'basis/note:rw')); // Load model NoteModel $this->load->model('codex/note_model', 'NoteModel'); } @@ -32,11 +32,11 @@ class Note extends APIv1_Controller public function getNote() { $note = $this->get('note'); - + if (isset($note)) { $result = $this->NoteModel->load($note); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Note extends APIv1_Controller { $result = $this->NoteModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Note extends APIv1_Controller $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 index d41214275..ad5d94185 100644 --- a/application/controllers/api/v1/codex/Orgform.php +++ b/application/controllers/api/v1/codex/Orgform.php @@ -21,7 +21,7 @@ class Orgform extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Orgform' => 'basis/orgform:rw', 'All' => 'basis/orgform:r', 'OrgformLV' => 'basis/orgform:r')); // Load model OrgformModel $this->load->model('codex/orgform_model', 'OrgformModel'); } @@ -32,11 +32,11 @@ class Orgform extends APIv1_Controller 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 @@ -44,24 +44,24 @@ class Orgform extends APIv1_Controller $this->response(); } } - + /** * @return void */ public function getAll() { $result = $this->OrgformModel->load(); - + $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ public function getOrgformLV() { $result = $this->OrgformModel->getOrgformLV(); - + $this->response($result, REST_Controller::HTTP_OK); } @@ -80,7 +80,7 @@ class Orgform extends APIv1_Controller { $result = $this->OrgformModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -88,9 +88,9 @@ class Orgform extends APIv1_Controller $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 index 21b2182db..9823d3915 100644 --- a/application/controllers/api/v1/codex/Verwendung.php +++ b/application/controllers/api/v1/codex/Verwendung.php @@ -21,7 +21,7 @@ class Verwendung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Verwendung' => 'basis/verwendung:rw')); // Load model VerwendungModel $this->load->model('codex/verwendung_model', 'VerwendungModel'); } @@ -32,11 +32,11 @@ class Verwendung extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Verwendung extends APIv1_Controller { $result = $this->VerwendungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Verwendung extends APIv1_Controller $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 index b7992aab4..d042b2b56 100644 --- a/application/controllers/api/v1/codex/Zgv.php +++ b/application/controllers/api/v1/codex/Zgv.php @@ -21,7 +21,7 @@ class Zgv extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Zgv' => 'basis/zgv:rw')); // Load model ZgvModel $this->load->model('codex/zgv_model', 'ZgvModel'); } @@ -32,11 +32,11 @@ class Zgv extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Zgv extends APIv1_Controller { $result = $this->ZgvModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Zgv extends APIv1_Controller $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 index 50ca5cacb..aeaf56463 100644 --- a/application/controllers/api/v1/codex/Zgvdoktor.php +++ b/application/controllers/api/v1/codex/Zgvdoktor.php @@ -21,7 +21,7 @@ class Zgvdoktor extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Zgvdoktor' => 'basis/zgvdoktor:rw')); // Load model ZgvdoktorModel $this->load->model('codex/zgvdoktor_model', 'ZgvdoktorModel'); } @@ -32,11 +32,11 @@ class Zgvdoktor extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Zgvdoktor extends APIv1_Controller { $result = $this->ZgvdoktorModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Zgvdoktor extends APIv1_Controller $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 index 805dbdb30..38b1fe520 100644 --- a/application/controllers/api/v1/codex/Zgvgruppe.php +++ b/application/controllers/api/v1/codex/Zgvgruppe.php @@ -21,7 +21,7 @@ class Zgvgruppe extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Zgvgruppe' => 'basis/zgvgruppe:rw')); // Load model ZgvgruppeModel $this->load->model('codex/zgvgruppe_model', 'ZgvgruppeModel'); } @@ -32,11 +32,11 @@ class Zgvgruppe extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Zgvgruppe extends APIv1_Controller { $result = $this->ZgvgruppeModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Zgvgruppe extends APIv1_Controller $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 index e813073c1..b8e7ee86d 100644 --- a/application/controllers/api/v1/codex/Zgvmaster.php +++ b/application/controllers/api/v1/codex/Zgvmaster.php @@ -21,7 +21,7 @@ class Zgvmaster extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Zgvmaster' => 'basis/zgvmaster:rw')); // Load model ZgvmasterModel $this->load->model('codex/zgvmaster_model', 'ZgvmasterModel'); } @@ -32,11 +32,11 @@ class Zgvmaster extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Zgvmaster extends APIv1_Controller { $result = $this->ZgvmasterModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Zgvmaster extends APIv1_Controller $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 index 7e0c3f70a..c5710c7a5 100644 --- a/application/controllers/api/v1/codex/Zweck.php +++ b/application/controllers/api/v1/codex/Zweck.php @@ -21,7 +21,7 @@ class Zweck extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Zweck' => 'basis/zweck:rw')); // Load model ZweckModel $this->load->model('codex/zweck_model', 'ZweckModel'); } @@ -32,11 +32,11 @@ class Zweck extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Zweck extends APIv1_Controller { $result = $this->ZweckModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Zweck extends APIv1_Controller $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 index 1bf6aae9c..f550eafdd 100644 --- a/application/controllers/api/v1/content/Ampel.php +++ b/application/controllers/api/v1/content/Ampel.php @@ -21,7 +21,7 @@ class Ampel extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Ampel' => 'basis/ampel:rw')); // Load model AmpelModel $this->load->model('content/ampel_model', 'AmpelModel'); } @@ -32,11 +32,11 @@ class Ampel extends APIv1_Controller public function getAmpel() { $ampelID = $this->get('ampel_id'); - + if (isset($ampelID)) { $result = $this->AmpelModel->load($ampelID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Ampel extends APIv1_Controller { $result = $this->AmpelModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Ampel extends APIv1_Controller $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 index 2fd638e24..5d0854c2e 100644 --- a/application/controllers/api/v1/content/Content.php +++ b/application/controllers/api/v1/content/Content.php @@ -21,7 +21,7 @@ class Content extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Content' => 'basis/content:rw')); // Load model ContentModel $this->load->model('content/content_model', 'ContentModel'); } @@ -32,11 +32,11 @@ class Content extends APIv1_Controller public function getContent() { $contentID = $this->get('content_id'); - + if (isset($contentID)) { $result = $this->ContentModel->load($contentID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Content extends APIv1_Controller { $result = $this->ContentModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Content extends APIv1_Controller $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 index 5f1a28917..95dbc4ab0 100644 --- a/application/controllers/api/v1/content/Contentchild.php +++ b/application/controllers/api/v1/content/Contentchild.php @@ -21,7 +21,7 @@ class Contentchild extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Contentchild' => 'basis/contentchild:rw')); // Load model ContentchildModel $this->load->model('content/contentchild_model', 'ContentchildModel'); } @@ -32,11 +32,11 @@ class Contentchild extends APIv1_Controller public function getContentchild() { $contentchildID = $this->get('contentchild_id'); - + if (isset($contentchildID)) { $result = $this->ContentchildModel->load($contentchildID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Contentchild extends APIv1_Controller { $result = $this->ContentchildModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Contentchild extends APIv1_Controller $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 index 420dd51f5..794400dc1 100644 --- a/application/controllers/api/v1/content/Contentgruppe.php +++ b/application/controllers/api/v1/content/Contentgruppe.php @@ -21,7 +21,7 @@ class Contentgruppe extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Contentgruppe' => 'basis/contentgruppe:rw')); // Load model ContentgruppeModel $this->load->model('content/contentgruppe_model', 'ContentgruppeModel'); } @@ -33,11 +33,11 @@ class Contentgruppe extends APIv1_Controller { $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 @@ -61,7 +61,7 @@ class Contentgruppe extends APIv1_Controller { $result = $this->ContentgruppeModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,9 +69,9 @@ class Contentgruppe extends APIv1_Controller $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 index b5b3aba68..ef4738828 100644 --- a/application/controllers/api/v1/content/Contentlog.php +++ b/application/controllers/api/v1/content/Contentlog.php @@ -21,7 +21,7 @@ class Contentlog extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Contentlog' => 'basis/contentlog:rw')); // Load model ContentlogModel $this->load->model('content/contentlog_model', 'ContentlogModel'); } @@ -32,11 +32,11 @@ class Contentlog extends APIv1_Controller public function getContentlog() { $contentlogID = $this->get('contentlog_id'); - + if (isset($contentlogID)) { $result = $this->ContentlogModel->load($contentlogID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Contentlog extends APIv1_Controller { $result = $this->ContentlogModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Contentlog extends APIv1_Controller $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 index 78c67c6c3..f3696d2ad 100644 --- a/application/controllers/api/v1/content/Contentsprache.php +++ b/application/controllers/api/v1/content/Contentsprache.php @@ -21,7 +21,7 @@ class Contentsprache extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Contentsprache' => 'basis/contentsprache:rw')); // Load model ContentspracheModel $this->load->model('content/contentsprache_model', 'ContentspracheModel'); } @@ -32,11 +32,11 @@ class Contentsprache extends APIv1_Controller public function getContentsprache() { $contentspracheID = $this->get('contentsprache_id'); - + if (isset($contentspracheID)) { $result = $this->ContentspracheModel->load($contentspracheID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Contentsprache extends APIv1_Controller { $result = $this->ContentspracheModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Contentsprache extends APIv1_Controller $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 index dd1156273..e73254888 100644 --- a/application/controllers/api/v1/content/Dms.php +++ b/application/controllers/api/v1/content/Dms.php @@ -17,27 +17,27 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); class Dms extends APIv1_Controller { /** - * + * */ public function __construct() { - parent::__construct(); + parent::__construct(array('Dms' => 'basis/dms:rw', 'AktenAcceptedDms' => 'basis/dms:r', 'DelDms' => 'basis/dms:w')); // Load library DmsLib $this->load->library('DmsLib'); } - + /** - * + * */ public function getDms() { $dms_id = $this->get('dms_id'); $version = $this->get('version'); - + if (isset($dms_id)) { $result = $this->dmslib->read($dms_id, $version); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -45,20 +45,20 @@ class Dms extends APIv1_Controller $this->response(); } } - + /** - * + * */ public function getAktenAcceptedDms() { $person_id = $this->get('person_id'); $dokument_kurzbz = $this->get('dokument_kurzbz'); $no_file = $this->get('no_file'); - + if (isset($person_id)) { $result = $this->dmslib->getAktenAcceptedDms($person_id, $dokument_kurzbz, $no_file); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -66,18 +66,18 @@ class Dms extends APIv1_Controller $this->response(); } } - + /** - * + * */ public function postDms() { $dms = $this->post(); - + if ($this->_validatePost($dms)) { $result = $this->dmslib->save($dms); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -85,18 +85,18 @@ class Dms extends APIv1_Controller $this->response(); } } - + /** - * + * */ public function postDelDms() { $dms = $this->post(); - + if ($this->_validateDelete($this->post())) { $result = $this->dmslib->delete($dms['person_id'], $dms['dms_id']); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -104,7 +104,7 @@ class Dms extends APIv1_Controller $this->response(); } } - + private function _validatePost($dms = null) { if (!isset($dms)) @@ -119,10 +119,10 @@ class Dms extends APIv1_Controller { return false; } - + return true; } - + private function _validateDelete($dms = null) { if (!isset($dms)) @@ -137,7 +137,7 @@ class Dms extends APIv1_Controller { return false; } - + return true; } } diff --git a/application/controllers/api/v1/content/Infoscreen.php b/application/controllers/api/v1/content/Infoscreen.php index e7dc12d81..3012af304 100644 --- a/application/controllers/api/v1/content/Infoscreen.php +++ b/application/controllers/api/v1/content/Infoscreen.php @@ -21,7 +21,7 @@ class Infoscreen extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Infoscreen' => 'basis/infoscreen:rw')); // Load model InfoscreenModel $this->load->model('content/infoscreen_model', 'InfoscreenModel'); } @@ -32,11 +32,11 @@ class Infoscreen extends APIv1_Controller public function getInfoscreen() { $infoscreenID = $this->get('infoscreen_id'); - + if (isset($infoscreenID)) { $result = $this->InfoscreenModel->load($infoscreenID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Infoscreen extends APIv1_Controller { $result = $this->InfoscreenModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Infoscreen extends APIv1_Controller $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 index f8dd80008..b085afb7d 100644 --- a/application/controllers/api/v1/content/News.php +++ b/application/controllers/api/v1/content/News.php @@ -21,7 +21,7 @@ class News extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('News' => 'basis/news:rw')); // Load model NewsModel $this->load->model('content/news_model', 'NewsModel'); } @@ -32,11 +32,11 @@ class News extends APIv1_Controller public function getNews() { $newsID = $this->get('news_id'); - + if (isset($newsID)) { $result = $this->NewsModel->load($newsID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class News extends APIv1_Controller { $result = $this->NewsModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class News extends APIv1_Controller $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 index 41a54af72..e15156b14 100644 --- a/application/controllers/api/v1/content/Template.php +++ b/application/controllers/api/v1/content/Template.php @@ -21,7 +21,7 @@ class Template extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Template' => 'basis/template:rw')); // Load model TemplateModel $this->load->model('content/template_model', 'TemplateModel'); } @@ -32,11 +32,11 @@ class Template extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Template extends APIv1_Controller { $result = $this->TemplateModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Template extends APIv1_Controller $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 index c21febf8d..5f922e65a 100644 --- a/application/controllers/api/v1/content/Veranstaltung.php +++ b/application/controllers/api/v1/content/Veranstaltung.php @@ -21,7 +21,7 @@ class Veranstaltung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Veranstaltung' => 'basis/veranstaltung:rw')); // Load model VeranstaltungModel $this->load->model('content/veranstaltung_model', 'VeranstaltungModel'); } @@ -32,11 +32,11 @@ class Veranstaltung extends APIv1_Controller public function getVeranstaltung() { $veranstaltungID = $this->get('veranstaltung_id'); - + if (isset($veranstaltungID)) { $result = $this->VeranstaltungModel->load($veranstaltungID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Veranstaltung extends APIv1_Controller { $result = $this->VeranstaltungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Veranstaltung extends APIv1_Controller $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 index dd867b4db..20af408c5 100644 --- a/application/controllers/api/v1/content/Veranstaltungskategorie.php +++ b/application/controllers/api/v1/content/Veranstaltungskategorie.php @@ -21,7 +21,7 @@ class Veranstaltungskategorie extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Veranstaltungskategorie' => 'basis/veranstaltungskategorie:rw')); // Load model VeranstaltungskategorieModel $this->load->model('content/veranstaltungskategorie_model', 'VeranstaltungskategorieModel'); } @@ -32,11 +32,11 @@ class Veranstaltungskategorie extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Veranstaltungskategorie extends APIv1_Controller { $result = $this->VeranstaltungskategorieModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Veranstaltungskategorie extends APIv1_Controller $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 index 20b5ac22f..e9c892da5 100644 --- a/application/controllers/api/v1/crm/Akte.php +++ b/application/controllers/api/v1/crm/Akte.php @@ -21,11 +21,11 @@ class Akte extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Akte' => 'basis/akte:rw', 'Akten' => 'basis/akte:r', 'AktenAccepted' => 'basis/akte:r')); // Load model AkteModel $this->load->model('crm/akte_model', 'AkteModel'); - - + + } /** @@ -34,11 +34,11 @@ class Akte extends APIv1_Controller public function getAkte() { $akteID = $this->get('akte_id'); - + if (isset($akteID)) { $result = $this->AkteModel->load($akteID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -46,7 +46,7 @@ class Akte extends APIv1_Controller $this->response(); } } - + /** * @return void */ @@ -56,11 +56,11 @@ class Akte extends APIv1_Controller $dokument_kurzbz = $this->get('dokument_kurzbz'); $stg_kz = $this->get('stg_kz'); $prestudent_id = $this->get('prestudent_id'); - + if (isset($person_id)) { $result = $this->AkteModel->getAkten($person_id, $dokument_kurzbz, $stg_kz, $prestudent_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,7 +68,7 @@ class Akte extends APIv1_Controller $this->response(); } } - + /** * @return void */ @@ -76,11 +76,11 @@ class Akte extends APIv1_Controller { $person_id = $this->get('person_id'); $dokument_kurzbz = $this->get('dokument_kurzbz'); - + if (isset($person_id)) { $result = $this->AkteModel->getAktenAccepted($person_id, $dokument_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -104,7 +104,7 @@ class Akte extends APIv1_Controller { $result = $this->AkteModel->insert($akte); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -112,11 +112,11 @@ class Akte extends APIv1_Controller $this->response(); } } - + private function _validate($akte = null) { unset($akte['accepted']); - + return $akte; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/crm/Aufnahmeschluessel.php b/application/controllers/api/v1/crm/Aufnahmeschluessel.php index a746e2bdf..f2724481c 100644 --- a/application/controllers/api/v1/crm/Aufnahmeschluessel.php +++ b/application/controllers/api/v1/crm/Aufnahmeschluessel.php @@ -21,11 +21,11 @@ class Aufnahmeschluessel extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Aufnahmeschluessel' => 'basis/aufnahmeschluessel:rw')); // Load model AufnahmeschluesselModel $this->load->model('crm/aufnahmeschluessel_model', 'AufnahmeschluesselModel'); - - + + } /** @@ -34,11 +34,11 @@ class Aufnahmeschluessel extends APIv1_Controller public function getAufnahmeschluessel() { $aufnahmeschluessel = $this->get('aufnahmeschluessel'); - + if (isset($aufnahmeschluessel)) { $result = $this->AufnahmeschluesselModel->load($aufnahmeschluessel); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Aufnahmeschluessel extends APIv1_Controller { $result = $this->AufnahmeschluesselModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Aufnahmeschluessel extends APIv1_Controller $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 index 798eac728..e199adbf8 100644 --- a/application/controllers/api/v1/crm/Aufnahmetermin.php +++ b/application/controllers/api/v1/crm/Aufnahmetermin.php @@ -21,11 +21,11 @@ class Aufnahmetermin extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Aufnahmetermin' => 'basis/aufnahmetermin:rw')); // Load model AufnahmeterminModel $this->load->model('crm/aufnahmetermin_model', 'AufnahmeterminModel'); - - + + } /** @@ -34,11 +34,11 @@ class Aufnahmetermin extends APIv1_Controller public function getAufnahmetermin() { $aufnahmeterminID = $this->get('aufnahmetermin_id'); - + if (isset($aufnahmeterminID)) { $result = $this->AufnahmeterminModel->load($aufnahmeterminID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Aufnahmetermin extends APIv1_Controller { $result = $this->AufnahmeterminModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Aufnahmetermin extends APIv1_Controller $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 index dab29d678..7219598bf 100644 --- a/application/controllers/api/v1/crm/Aufnahmetermintyp.php +++ b/application/controllers/api/v1/crm/Aufnahmetermintyp.php @@ -21,11 +21,11 @@ class Aufnahmetermintyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Aufnahmetermintyp' => 'basis/aufnahmetermintyp:rw')); // Load model AufnahmetermintypModel $this->load->model('crm/aufnahmetermintyp_model', 'AufnahmetermintypModel'); - - + + } /** @@ -34,11 +34,11 @@ class Aufnahmetermintyp extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Aufnahmetermintyp extends APIv1_Controller { $result = $this->AufnahmetermintypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Aufnahmetermintyp extends APIv1_Controller $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 index 7fecceae3..8d3c8b774 100644 --- a/application/controllers/api/v1/crm/Bewerbungstermine.php +++ b/application/controllers/api/v1/crm/Bewerbungstermine.php @@ -21,7 +21,14 @@ class Bewerbungstermine extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'Bewerbungstermine' => 'basis/bewerbungstermine:rw', + 'ByStudiengangStudiensemester' => 'basis/bewerbungstermine:r', + 'ByStudienplan' => 'basis/bewerbungstermine:r', + 'Current' => 'basis/bewerbungstermine:r' + ) + ); // Load model BewerbungstermineModel $this->load->model('crm/bewerbungstermine_model', 'BewerbungstermineModel'); @@ -132,4 +139,4 @@ class Bewerbungstermine extends APIv1_Controller { 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 index bb3fa3e6b..a5bf44dfc 100644 --- a/application/controllers/api/v1/crm/Buchungstyp.php +++ b/application/controllers/api/v1/crm/Buchungstyp.php @@ -21,11 +21,11 @@ class Buchungstyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Buchungstyp' => 'basis/buchungstyp:rw'); // Load model BuchungstypModel $this->load->model('crm/buchungstyp_model', 'BuchungstypModel'); - - + + } /** @@ -34,11 +34,11 @@ class Buchungstyp extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Buchungstyp extends APIv1_Controller { $result = $this->BuchungstypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Buchungstyp extends APIv1_Controller $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 index 21c364cb6..11a603496 100644 --- a/application/controllers/api/v1/crm/Dokument.php +++ b/application/controllers/api/v1/crm/Dokument.php @@ -21,7 +21,7 @@ class Dokument extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Dokument' => 'basis/dokument:rw')); // Load model DokumentModel $this->load->model('crm/dokument_model', 'DokumentModel'); } @@ -32,11 +32,11 @@ class Dokument extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Dokument extends APIv1_Controller { $result = $this->DokumentModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Dokument extends APIv1_Controller $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 index 9b7977ab0..020a876cd 100644 --- a/application/controllers/api/v1/crm/Dokumentprestudent.php +++ b/application/controllers/api/v1/crm/Dokumentprestudent.php @@ -21,7 +21,13 @@ class Dokumentprestudent extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'Dokumentprestudent' => 'basis/dokumentprestudent:rw', + 'SetAccepted' => 'basis/dokumentprestudent:w', + 'SetAcceptedDocuments' => 'basis/dokumentprestudent:w' + ) + ); // Load model DokumentprestudentModel $this->load->model('crm/dokumentprestudent_model', 'DokumentprestudentModel'); } @@ -33,11 +39,11 @@ class Dokumentprestudent extends APIv1_Controller { $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 @@ -61,7 +67,7 @@ class Dokumentprestudent extends APIv1_Controller { $result = $this->DokumentprestudentModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,7 +75,7 @@ class Dokumentprestudent extends APIv1_Controller $this->response(); } } - + /** * @return void */ @@ -78,7 +84,7 @@ class Dokumentprestudent extends APIv1_Controller if (isset($this->post()['prestudent_id']) && isset($this->post()['studiengang_kz'])) { $result = $this->DokumentprestudentModel->setAccepted($this->post()['prestudent_id'], $this->post()['studiengang_kz']); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -86,7 +92,7 @@ class Dokumentprestudent extends APIv1_Controller $this->response(); } } - + /** * @return void */ @@ -95,7 +101,7 @@ class Dokumentprestudent extends APIv1_Controller if (isset($this->post()['prestudent_id']) && is_array($this->post()['dokument_kurzbz'])) { $result = $this->DokumentprestudentModel->setAcceptedDocuments($this->post()['prestudent_id'], $this->post()['dokument_kurzbz']); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -103,9 +109,9 @@ class Dokumentprestudent extends APIv1_Controller $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 index 09989198b..3e908d455 100644 --- a/application/controllers/api/v1/crm/Dokumentstudiengang.php +++ b/application/controllers/api/v1/crm/Dokumentstudiengang.php @@ -21,7 +21,12 @@ class Dokumentstudiengang extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'Dokumentstudiengang' => 'basis/dokumentstudiengang:rw', + 'DokumentstudiengangByStudiengang_kz' => 'basis/dokumentstudiengang:r' + ) + ); // Load model DokumentstudiengangModel $this->load->model('crm/Dokumentstudiengang_model', 'DokumentstudiengangModel'); } @@ -33,11 +38,11 @@ class Dokumentstudiengang extends APIv1_Controller { $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 @@ -45,7 +50,7 @@ class Dokumentstudiengang extends APIv1_Controller $this->response(); } } - + /** * @return void */ @@ -55,7 +60,7 @@ class Dokumentstudiengang extends APIv1_Controller $onlinebewerbung = $this->get('onlinebewerbung'); $pflicht = $this->get('pflicht'); $nachreichbar = $this->get('nachreichbar'); - + if (isset($studiengang_kz)) { $result = $this->DokumentstudiengangModel->getDokumentstudiengangByStudiengang_kz( @@ -64,7 +69,7 @@ class Dokumentstudiengang extends APIv1_Controller $pflicht, $nachreichbar ); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -92,7 +97,7 @@ class Dokumentstudiengang extends APIv1_Controller { $result = $this->DokumentstudiengangModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -100,9 +105,9 @@ class Dokumentstudiengang extends APIv1_Controller $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 index cbff97753..5a2cdafe2 100644 --- a/application/controllers/api/v1/crm/Konto.php +++ b/application/controllers/api/v1/crm/Konto.php @@ -21,11 +21,11 @@ class Konto extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Konto' => 'basis/konto:rw')); // Load model KontoModel $this->load->model('crm/konto_model', 'KontoModel'); - - + + } /** @@ -34,11 +34,11 @@ class Konto extends APIv1_Controller public function getKonto() { $buchungsnr = $this->get('buchungsnr'); - + if (isset($buchungsnr)) { $result = $this->KontoModel->load($buchungsnr); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Konto extends APIv1_Controller { $result = $this->KontoModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Konto extends APIv1_Controller $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 index 42f305a57..14da2b9c3 100644 --- a/application/controllers/api/v1/crm/Preincoming.php +++ b/application/controllers/api/v1/crm/Preincoming.php @@ -21,11 +21,11 @@ class Preincoming extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Preincoming' => 'basis/preincoming:rw')); // Load model PreincomingModel $this->load->model('crm/preincoming_model', 'PreincomingModel'); - - + + } /** @@ -34,11 +34,11 @@ class Preincoming extends APIv1_Controller public function getPreincoming() { $preincomingID = $this->get('preincoming_id'); - + if (isset($preincomingID)) { $result = $this->PreincomingModel->load($preincomingID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Preincoming extends APIv1_Controller { $result = $this->PreincomingModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Preincoming extends APIv1_Controller $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 index 39f897df3..62c29dfda 100644 --- a/application/controllers/api/v1/crm/Preinteressent.php +++ b/application/controllers/api/v1/crm/Preinteressent.php @@ -21,11 +21,11 @@ class Preinteressent extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Preinteressent' => 'basis/preinteressent:rw', 'PreinteressentByPersonID' => 'basis/preinteressent:r')); // Load model PersonModel $this->load->model('crm/preinteressent_model', 'PreinteressentModel'); - - + + } /** @@ -34,11 +34,11 @@ class Preinteressent extends APIv1_Controller 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 @@ -46,18 +46,18 @@ class Preinteressent extends APIv1_Controller $this->response(); } } - + /** * @return void */ public function getPreinteressentByPersonID() { $person_id = $this->get('person_id'); - + if (isset($person_id)) { $result = $this->PreinteressentModel->load(array('person_id' => $person_id)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -81,7 +81,7 @@ class Preinteressent extends APIv1_Controller { $result = $this->PreinteressentModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -89,7 +89,7 @@ class Preinteressent extends APIv1_Controller $this->response(); } } - + private function _validate($preinteressent) { if ($preinteressent['person_id'] == '') @@ -97,13 +97,13 @@ class Preinteressent extends APIv1_Controller //$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 index b4de9b3ab..e4e834ef9 100644 --- a/application/controllers/api/v1/crm/Preinteressentstudiengang.php +++ b/application/controllers/api/v1/crm/Preinteressentstudiengang.php @@ -21,11 +21,11 @@ class Preinteressentstudiengang extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Preinteressentstudiengang' => 'basis/preinteressentstudiengang:rw')); // Load model PreinteressentstudiengangModel $this->load->model('crm/preinteressentstudiengang_model', 'PreinteressentstudiengangModel'); - - + + } /** @@ -35,11 +35,11 @@ class Preinteressentstudiengang extends APIv1_Controller { $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 @@ -63,7 +63,7 @@ class Preinteressentstudiengang extends APIv1_Controller { $result = $this->PreinteressentstudiengangModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -71,9 +71,9 @@ class Preinteressentstudiengang extends APIv1_Controller $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 index 821befb91..733bd2eb9 100644 --- a/application/controllers/api/v1/crm/Preoutgoing.php +++ b/application/controllers/api/v1/crm/Preoutgoing.php @@ -21,11 +21,11 @@ class Preoutgoing extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Preoutgoing' => 'basis/preoutgoing:rw')); // Load model PreoutgoingModel $this->load->model('crm/preoutgoing_model', 'PreoutgoingModel'); - - + + } /** @@ -34,11 +34,11 @@ class Preoutgoing extends APIv1_Controller public function getPreoutgoing() { $preoutgoingID = $this->get('preoutgoing_id'); - + if (isset($preoutgoingID)) { $result = $this->PreoutgoingModel->load($preoutgoingID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Preoutgoing extends APIv1_Controller { $result = $this->PreoutgoingModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Preoutgoing extends APIv1_Controller $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 index 5d5ff063b..072ba3eea 100644 --- a/application/controllers/api/v1/crm/Prestudent.php +++ b/application/controllers/api/v1/crm/Prestudent.php @@ -21,7 +21,18 @@ class Prestudent extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'Prestudent' => 'basis/prestudent:rw', + 'PrestudentByPersonID' => 'basis/prestudent:r', + 'Specialization' => 'basis/prestudent:rw', + 'LastStatuses' => 'basis/prestudent:r', + 'PrestudentsPerStatus' => 'basis/prestudent:r', + 'RmSpecialization' => 'basis/prestudent:w', + 'AddReihungstest' => 'basis/prestudent:w', + 'DelReihungstest' => 'basis/prestudent:w' + ) + ); // Load model PrestudentModel $this->load->model('crm/prestudent_model', 'PrestudentModel'); // Load library ReihungstestLib diff --git a/application/controllers/api/v1/crm/Prestudentstatus.php b/application/controllers/api/v1/crm/Prestudentstatus.php index 814bf0617..b72ac2fe9 100644 --- a/application/controllers/api/v1/crm/Prestudentstatus.php +++ b/application/controllers/api/v1/crm/Prestudentstatus.php @@ -21,7 +21,13 @@ class Prestudentstatus extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'Prestudentstatus' => 'basis/prestudentstatus:rw', + 'LastStatus' => 'basis/prestudentstatus:r', + 'StatusByFilter' => 'basis/prestudentstatus:r' + ) + ); // Load model PrestudentstatusModel $this->load->model('crm/prestudentstatus_model', 'PrestudentstatusModel'); } diff --git a/application/controllers/api/v1/crm/Reihungstest.php b/application/controllers/api/v1/crm/Reihungstest.php index 9062105e7..e9012d740 100644 --- a/application/controllers/api/v1/crm/Reihungstest.php +++ b/application/controllers/api/v1/crm/Reihungstest.php @@ -21,7 +21,14 @@ class Reihungstest extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'Reihungstest' => 'basis/reihungstest:rw', + 'ByStudiengangStudiensemester' => 'basis/reihungstest:r', + 'ReihungstestByPersonID' => 'basis/reihungstest:r', + 'AvailableReihungstestByPersonId' => 'basis/reihungstest:r' + ) + ); // Load model ReihungstestModel $this->load->model('crm/Reihungstest_model', 'ReihungstestModel'); // Load library ReihungstestLib @@ -34,11 +41,11 @@ class Reihungstest extends APIv1_Controller public function getReihungstest() { $reihungstestID = $this->get('reihungstest_id'); - + if (isset($reihungstestID)) { $result = $this->ReihungstestModel->load($reihungstestID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -46,7 +53,7 @@ class Reihungstest extends APIv1_Controller $this->response(); } } - + /** * @return void */ @@ -55,7 +62,7 @@ class Reihungstest extends APIv1_Controller $studiengang_kz = $this->get('studiengang_kz'); $studiensemester_kurzbz = $this->get('studiensemester_kurzbz'); $available = $this->get('available'); - + if (isset($studiengang_kz)) { $parametersArray = array('studiengang_kz' => $studiengang_kz); @@ -68,7 +75,7 @@ class Reihungstest extends APIv1_Controller $parametersArray['anmeldefrist >='] = 'NOW()'; } $result = $this->ReihungstestModel->loadWhere($parametersArray); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -76,7 +83,7 @@ class Reihungstest extends APIv1_Controller $this->response(); } } - + /** * @return void */ @@ -84,11 +91,11 @@ class Reihungstest extends APIv1_Controller { $person_id = $this->get('person_id'); $available = $this->get('available'); - + if (isset($person_id)) { $result = $this->reihungstestlib->getReihungstestByPersonID($person_id, $available); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -96,20 +103,20 @@ class Reihungstest extends APIv1_Controller $this->response(); } } - + /** * @return void */ public function getAvailableReihungstestByPersonId() { $person_id = $this->get('person_id'); - + if (isset($person_id)) { $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); - + $result = $this->StudiengangModel->getAvailableReihungstestByPersonId($person_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -133,7 +140,7 @@ class Reihungstest extends APIv1_Controller { $result = $this->ReihungstestModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -141,9 +148,9 @@ class Reihungstest extends APIv1_Controller $this->response(); } } - + private function _validate($reihungstest = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/crm/RtPerson.php b/application/controllers/api/v1/crm/RtPerson.php index a7478ae5f..f9610722a 100644 --- a/application/controllers/api/v1/crm/RtPerson.php +++ b/application/controllers/api/v1/crm/RtPerson.php @@ -21,9 +21,9 @@ class RtPerson extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('RtPerson' => 'basis/rtperson:rw')); // Load model StatusModel - $this->load->model("crm/RtPerson_model", "RtPersonModel"); + $this->load->model('crm/RtPerson_model', 'RtPersonModel'); } /** @@ -32,11 +32,11 @@ class RtPerson extends APIv1_Controller public function getRtPerson() { $rt_person_id = $this->get("rt_person_id"); - + if (isset($rt_person_id)) { $result = $this->RtPersonModel->load($rt_person_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class RtPerson extends APIv1_Controller { $result = $this->RtPersonModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class RtPerson extends APIv1_Controller $this->response(); } } - + private function _validate($rtPerson = 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 index 4eb1b1834..37a8fbd11 100644 --- a/application/controllers/api/v1/crm/Status.php +++ b/application/controllers/api/v1/crm/Status.php @@ -21,11 +21,11 @@ class Status extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Status' => 'basis/status:rw')); // Load model StatusModel $this->load->model('crm/status_model', 'StatusModel'); - - + + } /** @@ -34,11 +34,11 @@ class Status extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Status extends APIv1_Controller { $result = $this->StatusModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Status extends APIv1_Controller $this->response(); } } - + private function _validate($status = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/crm/Statusgrund.php b/application/controllers/api/v1/crm/Statusgrund.php index 55241ed16..3f19f2f82 100644 --- a/application/controllers/api/v1/crm/Statusgrund.php +++ b/application/controllers/api/v1/crm/Statusgrund.php @@ -21,7 +21,7 @@ class Statusgrund extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Statusgrund' => 'basis/statusgrund:rw')); // Load model StatusModel $this->load->model('crm/Statusgrund_model', 'StatusgrundModel'); } @@ -32,11 +32,11 @@ class Statusgrund extends APIv1_Controller public function getStatusgrund() { $statusgrund_kurzbz = $this->get('statusgrund_kurzbz'); - + if (isset($statusgrund_kurzbz)) { $result = $this->StatusgrundModel->load($statusgrund_kurzbz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Statusgrund extends APIv1_Controller { $result = $this->StatusgrundModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Statusgrund extends APIv1_Controller $this->response(); } } - + private function _validate($statusgrund = 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 index c95e4b16f..6227cb6e3 100644 --- a/application/controllers/api/v1/crm/Student.php +++ b/application/controllers/api/v1/crm/Student.php @@ -21,11 +21,11 @@ class Student extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Student' => 'basis/student:rw')); // Load model StudentModel $this->load->model('crm/student_model', 'StudentModel'); - - + + } /** @@ -34,11 +34,11 @@ class Student extends APIv1_Controller public function getStudent() { $studentID = $this->get('student_id'); - + if (isset($studentID)) { $result = $this->StudentModel->load($studentID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Student extends APIv1_Controller { $result = $this->StudentModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Student extends APIv1_Controller $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 index 6215b43ed..e3fd64530 100644 --- a/application/controllers/api/v1/education/Abgabe.php +++ b/application/controllers/api/v1/education/Abgabe.php @@ -21,7 +21,7 @@ class Abgabe extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Abgabe' => 'basis/abgabe:rw')); // Load model AbgabeModel $this->load->model('education/Abgabe_model', 'AbgabeModel'); } @@ -32,11 +32,11 @@ class Abgabe extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Abgabe extends APIv1_Controller { $result = $this->AbgabeModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Abgabe extends APIv1_Controller $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 index 1ca830e41..1987e276f 100644 --- a/application/controllers/api/v1/education/Abschlussbeurteilung.php +++ b/application/controllers/api/v1/education/Abschlussbeurteilung.php @@ -21,7 +21,7 @@ class Abschlussbeurteilung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Abschlussbeurteilung' => 'basis/abschlussbeurteilung:rw')); // Load model AbschlussbeurteilungModel $this->load->model('education/Abschlussbeurteilung_model', 'AbschlussbeurteilungModel'); } @@ -32,11 +32,11 @@ class Abschlussbeurteilung extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Abschlussbeurteilung extends APIv1_Controller { $result = $this->AbschlussbeurteilungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Abschlussbeurteilung extends APIv1_Controller $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 index e46ce14e7..cadea53ca 100644 --- a/application/controllers/api/v1/education/Abschlusspruefung.php +++ b/application/controllers/api/v1/education/Abschlusspruefung.php @@ -21,7 +21,7 @@ class Abschlusspruefung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Abschlusspruefung' => 'basis/abschlusspruefung:rw')); // Load model AbschlusspruefungModel $this->load->model('education/Abschlusspruefung_model', 'AbschlusspruefungModel'); } @@ -32,11 +32,11 @@ class Abschlusspruefung extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Abschlusspruefung extends APIv1_Controller { $result = $this->AbschlusspruefungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Abschlusspruefung extends APIv1_Controller $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 index abf469da8..5a99b08ab 100644 --- a/application/controllers/api/v1/education/Anrechnung.php +++ b/application/controllers/api/v1/education/Anrechnung.php @@ -21,7 +21,7 @@ class Anrechnung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Anrechnung' => 'basis/anrechnung:rw')); // Load model AnrechnungModel $this->load->model('education/Anrechnung_model', 'AnrechnungModel'); } @@ -32,11 +32,11 @@ class Anrechnung extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Anrechnung extends APIv1_Controller { $result = $this->AnrechnungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Anrechnung extends APIv1_Controller $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 index e74101ee0..2e915f071 100644 --- a/application/controllers/api/v1/education/Anwesenheit.php +++ b/application/controllers/api/v1/education/Anwesenheit.php @@ -21,7 +21,7 @@ class Anwesenheit extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Anwesenheit' => 'basis/anwesenheit:rw')); // Load model AnwesenheitModel $this->load->model('education/Anwesenheit_model', 'AnwesenheitModel'); } @@ -32,11 +32,11 @@ class Anwesenheit extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Anwesenheit extends APIv1_Controller { $result = $this->AnwesenheitModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Anwesenheit extends APIv1_Controller $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 index b0fecfea6..b2c06047b 100644 --- a/application/controllers/api/v1/education/Beispiel.php +++ b/application/controllers/api/v1/education/Beispiel.php @@ -21,7 +21,7 @@ class Beispiel extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Beispiel' => 'basis/beispiel:rw')); // Load model BeispielModel $this->load->model('education/Beispiel_model', 'BeispielModel'); } @@ -32,11 +32,11 @@ class Beispiel extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Beispiel extends APIv1_Controller { $result = $this->BeispielModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Beispiel extends APIv1_Controller $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 index a076bf5fd..43b4c51f6 100644 --- a/application/controllers/api/v1/education/Betreuerart.php +++ b/application/controllers/api/v1/education/Betreuerart.php @@ -21,7 +21,7 @@ class Betreuerart extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Betreuerart' => 'basis/betreuerart:rw')); // Load model BetreuerartModel $this->load->model('education/Betreuerart_model', 'BetreuerartModel'); } @@ -32,11 +32,11 @@ class Betreuerart extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Betreuerart extends APIv1_Controller { $result = $this->BetreuerartModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Betreuerart extends APIv1_Controller $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 index 0d205d3b0..abef22d77 100644 --- a/application/controllers/api/v1/education/Feedback.php +++ b/application/controllers/api/v1/education/Feedback.php @@ -21,7 +21,7 @@ class Feedback extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Feedback' => 'basis/feedback:rw')); // Load model FeedbackModel $this->load->model('education/Feedback_model', 'FeedbackModel'); } @@ -32,11 +32,11 @@ class Feedback extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Feedback extends APIv1_Controller { $result = $this->FeedbackModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Feedback extends APIv1_Controller $this->response(); } } - + private function _validate($feedback = 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 index adc4af365..96ff25c4f 100644 --- a/application/controllers/api/v1/education/Legesamtnote.php +++ b/application/controllers/api/v1/education/Legesamtnote.php @@ -21,7 +21,7 @@ class Legesamtnote extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Legesamtnote' => 'basis/legesamtnote:rw')); // Load model LegesamtnoteModel $this->load->model('education/Legesamtnote_model', 'LegesamtnoteModel'); } @@ -33,11 +33,11 @@ class Legesamtnote extends APIv1_Controller { $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 @@ -61,7 +61,7 @@ class Legesamtnote extends APIv1_Controller { $result = $this->LegesamtnoteModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,9 +69,9 @@ class Legesamtnote extends APIv1_Controller $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 index 7fe1a8e44..f229de846 100644 --- a/application/controllers/api/v1/education/Lehreinheit.php +++ b/application/controllers/api/v1/education/Lehreinheit.php @@ -21,7 +21,7 @@ class Lehreinheit extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lehreinheit' => 'basis/lehreinheit:rw')); // Load model LehreinheitModel $this->load->model('education/Lehreinheit_model', 'LehreinheitModel'); } @@ -32,11 +32,11 @@ class Lehreinheit extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Lehreinheit extends APIv1_Controller { $result = $this->LehreinheitModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Lehreinheit extends APIv1_Controller $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 index cc2a41242..6ef949d3e 100644 --- a/application/controllers/api/v1/education/Lehreinheitgruppe.php +++ b/application/controllers/api/v1/education/Lehreinheitgruppe.php @@ -21,7 +21,7 @@ class Lehreinheitgruppe extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lehreinheitgruppe' => 'basis/lehreinheitgruppe:rw')); // Load model LehreinheitgruppeModel $this->load->model('education/Lehreinheitgruppe_model', 'LehreinheitgruppeModel'); } @@ -32,11 +32,11 @@ class Lehreinheitgruppe extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Lehreinheitgruppe extends APIv1_Controller { $result = $this->LehreinheitgruppeModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Lehreinheitgruppe extends APIv1_Controller $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 index e3cd51018..5237ca849 100644 --- a/application/controllers/api/v1/education/Lehreinheitmitarbeiter.php +++ b/application/controllers/api/v1/education/Lehreinheitmitarbeiter.php @@ -21,7 +21,7 @@ class Lehreinheitmitarbeiter extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lehreinheitmitarbeiter' => 'basis/lehreinheitmitarbeiter:rw')); // Load model LehreinheitmitarbeiterModel $this->load->model('education/Lehreinheitmitarbeiter_model', 'LehreinheitmitarbeiterModel'); } @@ -33,11 +33,11 @@ class Lehreinheitmitarbeiter extends APIv1_Controller { $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 @@ -61,7 +61,7 @@ class Lehreinheitmitarbeiter extends APIv1_Controller { $result = $this->LehreinheitmitarbeiterModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,9 +69,9 @@ class Lehreinheitmitarbeiter extends APIv1_Controller $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 index 8fca6fc61..81ce519e1 100644 --- a/application/controllers/api/v1/education/Lehrfach.php +++ b/application/controllers/api/v1/education/Lehrfach.php @@ -21,7 +21,7 @@ class Lehrfach extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lehrfach' => 'basis/lehrfach:rw')); // Load model LehrfachModel $this->load->model('education/Lehrfach_model', 'LehrfachModel'); } @@ -32,11 +32,11 @@ class Lehrfach extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Lehrfach extends APIv1_Controller { $result = $this->LehrfachModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Lehrfach extends APIv1_Controller $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 index 227526d8a..e29f1227d 100644 --- a/application/controllers/api/v1/education/Lehrfunktion.php +++ b/application/controllers/api/v1/education/Lehrfunktion.php @@ -21,7 +21,7 @@ class Lehrfunktion extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lehrfunktion' => 'basis/lehrfunktion:rw')); // Load model LehrfunktionModel $this->load->model('education/Lehrfunktion_model', 'LehrfunktionModel'); } @@ -32,11 +32,11 @@ class Lehrfunktion extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Lehrfunktion extends APIv1_Controller { $result = $this->LehrfunktionModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Lehrfunktion extends APIv1_Controller $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 index 210f9ffc6..dfcfd3033 100644 --- a/application/controllers/api/v1/education/Lehrtyp.php +++ b/application/controllers/api/v1/education/Lehrtyp.php @@ -21,7 +21,7 @@ class Lehrtyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lehrtyp' => 'basis/lehrtyp:rw')); // Load model LehrtypModel $this->load->model('education/Lehrtyp_model', 'LehrtypModel'); } @@ -32,11 +32,11 @@ class Lehrtyp extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Lehrtyp extends APIv1_Controller { $result = $this->LehrtypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Lehrtyp extends APIv1_Controller $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 index 6604600df..2e2fffb66 100644 --- a/application/controllers/api/v1/education/Lehrveranstaltung.php +++ b/application/controllers/api/v1/education/Lehrveranstaltung.php @@ -21,7 +21,7 @@ class Lehrveranstaltung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lehrveranstaltung' => 'basis/lehrveranstaltung:rw')); // Load model LehrveranstaltungModel $this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel'); } @@ -32,11 +32,11 @@ class Lehrveranstaltung extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Lehrveranstaltung extends APIv1_Controller { $result = $this->LehrveranstaltungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Lehrveranstaltung extends APIv1_Controller $this->response(); } } - + private function _validate($lehrveranstaltung = 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 index 235328ed7..9477172a3 100644 --- a/application/controllers/api/v1/education/Lenotenschluessel.php +++ b/application/controllers/api/v1/education/Lenotenschluessel.php @@ -21,11 +21,11 @@ class Lenotenschluessel extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('LeNotenschluessel' => 'basis/lenotenschluessel:rw')); // Load model LeNotenschluesselModel $this->load->model('education/LeNotenschluessel_model', 'LeNotenschluesselModel'); - - + + } /** @@ -35,11 +35,11 @@ class Lenotenschluessel extends APIv1_Controller { $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 @@ -63,7 +63,7 @@ class Lenotenschluessel extends APIv1_Controller { $result = $this->LeNotenschluesselModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -71,9 +71,9 @@ class Lenotenschluessel extends APIv1_Controller $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 index 283987d49..52e1d81b6 100644 --- a/application/controllers/api/v1/education/Lepruefung.php +++ b/application/controllers/api/v1/education/Lepruefung.php @@ -21,7 +21,7 @@ class Lepruefung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('LePruefung' => 'basis/lepruefung:rw')); // Load model LePruefungModel $this->load->model('education/LePruefung_model', 'LePruefungModel'); } @@ -32,11 +32,11 @@ class Lepruefung extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Lepruefung extends APIv1_Controller { $result = $this->LePruefungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Lepruefung extends APIv1_Controller $this->response(); } } - + private function _validate($lepruefung = 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 index ec464abf3..ecd917233 100644 --- a/application/controllers/api/v1/education/Lvangebot.php +++ b/application/controllers/api/v1/education/Lvangebot.php @@ -21,7 +21,7 @@ class Lvangebot extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lvangebot' => 'basis/lvangebot:rw')); // Load model LvangebotModel $this->load->model('education/Lvangebot_model', 'LvangebotModel'); } @@ -32,11 +32,11 @@ class Lvangebot extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Lvangebot extends APIv1_Controller { $result = $this->LvangebotModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Lvangebot extends APIv1_Controller $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 index a0813add8..464ef99a9 100644 --- a/application/controllers/api/v1/education/Lvgesamtnote.php +++ b/application/controllers/api/v1/education/Lvgesamtnote.php @@ -21,7 +21,7 @@ class Lvgesamtnote extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lvgesamtnote' => 'basis/lvgesamtnote:rw')); // Load model LvgesamtnoteModel $this->load->model('education/Lvgesamtnote_model', 'LvgesamtnoteModel'); } @@ -34,11 +34,11 @@ class Lvgesamtnote extends APIv1_Controller $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 @@ -60,14 +60,14 @@ class Lvgesamtnote extends APIv1_Controller $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 @@ -75,9 +75,9 @@ class Lvgesamtnote extends APIv1_Controller $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 index 0b7a3c827..8631583b9 100644 --- a/application/controllers/api/v1/education/Lvinfo.php +++ b/application/controllers/api/v1/education/Lvinfo.php @@ -21,7 +21,7 @@ class Lvinfo extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lvinfo' => 'basis/lvinfo:rw')); // Load model LvinfoModel $this->load->model('education/Lvinfo_model', 'LvinfoModel'); } @@ -33,11 +33,11 @@ class Lvinfo extends APIv1_Controller { $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 @@ -61,7 +61,7 @@ class Lvinfo extends APIv1_Controller { $result = $this->LvinfoModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,9 +69,9 @@ class Lvinfo extends APIv1_Controller $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 index 8766add07..33410cb88 100644 --- a/application/controllers/api/v1/education/Lvregel.php +++ b/application/controllers/api/v1/education/Lvregel.php @@ -21,7 +21,7 @@ class Lvregel extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lvregel' => 'basis/lvregel:rw')); // Load model LvregelModel $this->load->model('education/Lvregel_model', 'LvregelModel'); } @@ -32,11 +32,11 @@ class Lvregel extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Lvregel extends APIv1_Controller { $result = $this->LvregelModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Lvregel extends APIv1_Controller $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 index 912cb3e11..22fe0a9ff 100644 --- a/application/controllers/api/v1/education/Lvregeltyp.php +++ b/application/controllers/api/v1/education/Lvregeltyp.php @@ -21,7 +21,7 @@ class Lvregeltyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lvregeltyp' => 'basis/lvregeltyp:rw')); // Load model LvregeltypModel $this->load->model('education/Lvregeltyp_model', 'LvregeltypModel'); } @@ -32,11 +32,11 @@ class Lvregeltyp extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Lvregeltyp extends APIv1_Controller { $result = $this->LvregeltypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Lvregeltyp extends APIv1_Controller $this->response(); } } - + private function _validate($lvregeltyp = 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 index 62ac99afb..91c7c513e 100644 --- a/application/controllers/api/v1/education/Notenschluessel.php +++ b/application/controllers/api/v1/education/Notenschluessel.php @@ -21,7 +21,7 @@ class Notenschluessel extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Notenschluessel' => 'basis/notenschluessel:rw')); // Load model NotenschluesselModel $this->load->model('education/Notenschluessel_model', 'NotenschluesselModel'); } @@ -32,11 +32,11 @@ class Notenschluessel extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Notenschluessel extends APIv1_Controller { $result = $this->NotenschluesselModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Notenschluessel extends APIv1_Controller $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 index eb9e1c848..1e4b168ef 100644 --- a/application/controllers/api/v1/education/Notenschluesselaufteilung.php +++ b/application/controllers/api/v1/education/Notenschluesselaufteilung.php @@ -21,7 +21,7 @@ class Notenschluesselaufteilung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Notenschluesselaufteilung' => 'basis/notenschluesselaufteilung:rw')); // Load model NotenschluesselaufteilungModel $this->load->model('education/Notenschluesselaufteilung_model', 'NotenschluesselaufteilungModel'); } @@ -32,11 +32,11 @@ class Notenschluesselaufteilung extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Notenschluesselaufteilung extends APIv1_Controller { $result = $this->NotenschluesselaufteilungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Notenschluesselaufteilung extends APIv1_Controller $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 index e50319c2b..bb907f4ff 100644 --- a/application/controllers/api/v1/education/Notenschluesseluebung.php +++ b/application/controllers/api/v1/education/Notenschluesseluebung.php @@ -21,7 +21,7 @@ class Notenschluesseluebung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Notenschluesseluebung' => 'basis/notenschluesseluebung:rw')); // Load model NotenschluesseluebungModel $this->load->model('education/Notenschluesseluebung_model', 'NotenschluesseluebungModel'); } @@ -33,11 +33,11 @@ class Notenschluesseluebung extends APIv1_Controller { $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 @@ -61,7 +61,7 @@ class Notenschluesseluebung extends APIv1_Controller { $result = $this->NotenschluesseluebungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,9 +69,9 @@ class Notenschluesseluebung extends APIv1_Controller $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 index 18efc95d7..a4e7d757a 100644 --- a/application/controllers/api/v1/education/Notenschluesselzuordnung.php +++ b/application/controllers/api/v1/education/Notenschluesselzuordnung.php @@ -21,7 +21,7 @@ class Notenschluesselzuordnung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Notenschluesselzuordnung' => 'basis/notenschluesselzuordnung:rw')); // Load model NotenschluesselzuordnungModel $this->load->model('education/Notenschluesselzuordnung_model', 'NotenschluesselzuordnungModel'); } @@ -32,11 +32,11 @@ class Notenschluesselzuordnung extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Notenschluesselzuordnung extends APIv1_Controller { $result = $this->NotenschluesselzuordnungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Notenschluesselzuordnung extends APIv1_Controller $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 index 4f81ca9d1..87e9c2ec7 100644 --- a/application/controllers/api/v1/education/Paabgabe.php +++ b/application/controllers/api/v1/education/Paabgabe.php @@ -21,7 +21,7 @@ class Paabgabe extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Paabgabe' => 'basis/paabgabe:rw')); // Load model PaabgabeModel $this->load->model('education/Paabgabe_model', 'PaabgabeModel'); } @@ -32,11 +32,11 @@ class Paabgabe extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Paabgabe extends APIv1_Controller { $result = $this->PaabgabeModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Paabgabe extends APIv1_Controller $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 index 248c609d9..999cbd57b 100644 --- a/application/controllers/api/v1/education/Paabgabetyp.php +++ b/application/controllers/api/v1/education/Paabgabetyp.php @@ -21,7 +21,7 @@ class Paabgabetyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Paabgabetyp' => 'basis/paabgabetyp:rw')); // Load model PaabgabetypModel $this->load->model('education/Paabgabetyp_model', 'PaabgabetypModel'); } @@ -32,11 +32,11 @@ class Paabgabetyp extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Paabgabetyp extends APIv1_Controller { $result = $this->PaabgabetypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Paabgabetyp extends APIv1_Controller $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 index 7a6b32123..1b09fa4e7 100644 --- a/application/controllers/api/v1/education/Projektarbeit.php +++ b/application/controllers/api/v1/education/Projektarbeit.php @@ -21,7 +21,7 @@ class Projektarbeit extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Projektarbeit' => 'basis/projektarbeit:rw')); // Load model ProjektarbeitModel $this->load->model('education/Projektarbeit_model', 'ProjektarbeitModel'); } @@ -32,11 +32,11 @@ class Projektarbeit extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Projektarbeit extends APIv1_Controller { $result = $this->ProjektarbeitModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Projektarbeit extends APIv1_Controller $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 index d4d211137..b395b7e5f 100644 --- a/application/controllers/api/v1/education/Projektbetreuer.php +++ b/application/controllers/api/v1/education/Projektbetreuer.php @@ -21,7 +21,7 @@ class Projektbetreuer extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Projektbetreuer' => 'basis/projektbetreuer:rw')); // Load model ProjektbetreuerModel $this->load->model('education/Projektbetreuer_model', 'ProjektbetreuerModel'); } @@ -34,11 +34,11 @@ class Projektbetreuer extends APIv1_Controller $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 @@ -60,14 +60,14 @@ class Projektbetreuer extends APIv1_Controller $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 @@ -75,9 +75,9 @@ class Projektbetreuer extends APIv1_Controller $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 index a0d70fec1..bf4c5d73a 100644 --- a/application/controllers/api/v1/education/Projekttyp.php +++ b/application/controllers/api/v1/education/Projekttyp.php @@ -21,7 +21,7 @@ class Projekttyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Projekttyp' => 'basis/projekttyp:rw')); // Load model ProjekttypModel $this->load->model('education/Projekttyp_model', 'ProjekttypModel'); } @@ -32,11 +32,11 @@ class Projekttyp extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Projekttyp extends APIv1_Controller { $result = $this->ProjekttypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Projekttyp extends APIv1_Controller $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 index f402f035e..23fc97c8d 100644 --- a/application/controllers/api/v1/education/Pruefung.php +++ b/application/controllers/api/v1/education/Pruefung.php @@ -21,7 +21,7 @@ class Pruefung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Pruefung' => 'basis/pruefung:rw')); // Load model PruefungModel $this->load->model('education/Pruefung_model', 'PruefungModel'); } @@ -32,11 +32,11 @@ class Pruefung extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Pruefung extends APIv1_Controller { $result = $this->PruefungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Pruefung extends APIv1_Controller $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 index 286a77c1e..d65ded0b4 100644 --- a/application/controllers/api/v1/education/Pruefungsanmeldung.php +++ b/application/controllers/api/v1/education/Pruefungsanmeldung.php @@ -21,7 +21,7 @@ class Pruefungsanmeldung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Pruefungsanmeldung' => 'basis/pruefungsanmeldung:rw')); // Load model PruefungsanmeldungModel $this->load->model('education/Pruefungsanmeldung_model', 'PruefungsanmeldungModel'); } @@ -32,11 +32,11 @@ class Pruefungsanmeldung extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Pruefungsanmeldung extends APIv1_Controller { $result = $this->PruefungsanmeldungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Pruefungsanmeldung extends APIv1_Controller $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 index ddaa03aa1..50d13cff5 100644 --- a/application/controllers/api/v1/education/Pruefungsfenster.php +++ b/application/controllers/api/v1/education/Pruefungsfenster.php @@ -21,7 +21,7 @@ class Pruefungsfenster extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Pruefungsfenster' => 'basis/pruefungsfenster:rw')); // Load model PruefungsfensterModel $this->load->model('education/Pruefungsfenster_model', 'PruefungsfensterModel'); } @@ -32,11 +32,11 @@ class Pruefungsfenster extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Pruefungsfenster extends APIv1_Controller { $result = $this->PruefungsfensterModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Pruefungsfenster extends APIv1_Controller $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 index da2c5adee..cbfbfb044 100644 --- a/application/controllers/api/v1/education/Pruefungsstatus.php +++ b/application/controllers/api/v1/education/Pruefungsstatus.php @@ -21,7 +21,7 @@ class Pruefungsstatus extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Pruefungsstatus' => 'basis/pruefungsstatus:rw')); // Load model PruefungsstatusModel $this->load->model('education/Pruefungsstatus_model', 'PruefungsstatusModel'); } @@ -32,11 +32,11 @@ class Pruefungsstatus extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Pruefungsstatus extends APIv1_Controller { $result = $this->PruefungsstatusModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Pruefungsstatus extends APIv1_Controller $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 index 59effc99e..fd16159dc 100644 --- a/application/controllers/api/v1/education/Pruefungstermin.php +++ b/application/controllers/api/v1/education/Pruefungstermin.php @@ -21,7 +21,7 @@ class Pruefungstermin extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Pruefungstermin' => 'basis/pruefungstermin:rw')); // Load model PruefungsterminModel $this->load->model('education/Pruefungstermin_model', 'PruefungsterminModel'); } @@ -32,11 +32,11 @@ class Pruefungstermin extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Pruefungstermin extends APIv1_Controller { $result = $this->PruefungsterminModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Pruefungstermin extends APIv1_Controller $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 index 91820a853..4c460d5cd 100644 --- a/application/controllers/api/v1/education/Pruefungstyp.php +++ b/application/controllers/api/v1/education/Pruefungstyp.php @@ -21,7 +21,7 @@ class Pruefungstyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Pruefungstyp' => 'basis/pruefungstyp:rw')); // Load model PruefungstypModel $this->load->model('education/Pruefungstyp_model', 'PruefungstypModel'); } @@ -32,11 +32,11 @@ class Pruefungstyp extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Pruefungstyp extends APIv1_Controller { $result = $this->PruefungstypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Pruefungstyp extends APIv1_Controller $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 index a1dfa9fa9..45012231a 100644 --- a/application/controllers/api/v1/education/Studentbeispiel.php +++ b/application/controllers/api/v1/education/Studentbeispiel.php @@ -21,7 +21,7 @@ class Studentbeispiel extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Studentbeispiel' => 'basis/studentbeispiel:rw')); // Load model StudentbeispielModel $this->load->model('education/Studentbeispiel_model', 'StudentbeispielModel'); } @@ -33,11 +33,11 @@ class Studentbeispiel extends APIv1_Controller { $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 @@ -61,7 +61,7 @@ class Studentbeispiel extends APIv1_Controller { $result = $this->StudentbeispielModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,9 +69,9 @@ class Studentbeispiel extends APIv1_Controller $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 index 3dccddae6..4793b0b1b 100644 --- a/application/controllers/api/v1/education/Studentlehrverband.php +++ b/application/controllers/api/v1/education/Studentlehrverband.php @@ -21,7 +21,7 @@ class Studentlehrverband extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Studentlehrverband' => 'basis/studentlehrverband:rw')); // Load model StudentlehrverbandModel $this->load->model('education/Studentlehrverband_model', 'StudentlehrverbandModel'); } @@ -33,11 +33,11 @@ class Studentlehrverband extends APIv1_Controller { $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 @@ -61,7 +61,7 @@ class Studentlehrverband extends APIv1_Controller { $result = $this->StudentlehrverbandModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,9 +69,9 @@ class Studentlehrverband extends APIv1_Controller $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 index e069661ec..2a086610c 100644 --- a/application/controllers/api/v1/education/Studentuebung.php +++ b/application/controllers/api/v1/education/Studentuebung.php @@ -21,7 +21,7 @@ class Studentuebung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Studentuebung' => 'basis/studentuebung:rw')); // Load model StudentuebungModel $this->load->model('education/Studentuebung_model', 'StudentuebungModel'); } @@ -33,11 +33,11 @@ class Studentuebung extends APIv1_Controller { $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 @@ -61,7 +61,7 @@ class Studentuebung extends APIv1_Controller { $result = $this->StudentuebungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -69,9 +69,9 @@ class Studentuebung extends APIv1_Controller $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 index 8cb394cf2..41d8f8448 100644 --- a/application/controllers/api/v1/education/Uebung.php +++ b/application/controllers/api/v1/education/Uebung.php @@ -21,7 +21,7 @@ class Uebung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Uebung' => 'basis/uebung:rw')); // Load model UebungModel $this->load->model('education/uebung_model', 'UebungModel'); } @@ -32,11 +32,11 @@ class Uebung extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Uebung extends APIv1_Controller { $result = $this->UebungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Uebung extends APIv1_Controller $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 index f94d56768..86af07284 100644 --- a/application/controllers/api/v1/education/Zeugnis.php +++ b/application/controllers/api/v1/education/Zeugnis.php @@ -21,7 +21,7 @@ class Zeugnis extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Zeugnis' => 'basis/zeugnis:rw')); // Load model ZeugnisModel $this->load->model('education/Zeugnis_model', 'ZeugnisModel'); } @@ -32,11 +32,11 @@ class Zeugnis extends APIv1_Controller 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 @@ -60,7 +60,7 @@ class Zeugnis extends APIv1_Controller { $result = $this->ZeugnisModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Zeugnis extends APIv1_Controller $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 index ffeb56486..10083865e 100644 --- a/application/controllers/api/v1/education/Zeugnisnote.php +++ b/application/controllers/api/v1/education/Zeugnisnote.php @@ -21,7 +21,7 @@ class Zeugnisnote extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Zeugnisnote' => 'basis/zeugnisnote:rw')); // Load model ZeugnisnoteModel $this->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel'); } @@ -34,11 +34,11 @@ class Zeugnisnote extends APIv1_Controller $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 @@ -60,14 +60,14 @@ class Zeugnisnote extends APIv1_Controller $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 @@ -75,9 +75,9 @@ class Zeugnisnote extends APIv1_Controller $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 index fdfb836a3..0098f7fcc 100644 --- a/application/controllers/api/v1/organisation/Erhalter.php +++ b/application/controllers/api/v1/organisation/Erhalter.php @@ -21,11 +21,11 @@ class Erhalter extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Erhalter' => 'basis/erhalter:rw')); // Load model ErhalterModel $this->load->model('organisation/erhalter_model', 'ErhalterModel'); - - + + } /** @@ -34,11 +34,11 @@ class Erhalter extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Erhalter extends APIv1_Controller { $result = $this->ErhalterModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Erhalter extends APIv1_Controller $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 index dfe9e18c8..a2d3d3838 100644 --- a/application/controllers/api/v1/organisation/Fachbereich2.php +++ b/application/controllers/api/v1/organisation/Fachbereich2.php @@ -21,11 +21,11 @@ class Fachbereich2 extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Fachbereich' => 'basis/fachbereich:rw')); // Load model FachbereichModel $this->load->model('organisation/fachbereich_model', 'FachbereichModel'); - - + + } /** @@ -34,11 +34,11 @@ class Fachbereich2 extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Fachbereich2 extends APIv1_Controller { $result = $this->FachbereichModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Fachbereich2 extends APIv1_Controller $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 index e4e027da8..e943a7e66 100644 --- a/application/controllers/api/v1/organisation/Ferien.php +++ b/application/controllers/api/v1/organisation/Ferien.php @@ -21,11 +21,11 @@ class Ferien extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Ferien' => 'basis/ferien:rw')); // Load model FerienModel $this->load->model('organisation/ferien_model', 'FerienModel'); - - + + } /** @@ -35,11 +35,11 @@ class Ferien extends APIv1_Controller { $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 @@ -63,7 +63,7 @@ class Ferien extends APIv1_Controller { $result = $this->FerienModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -71,9 +71,9 @@ class Ferien extends APIv1_Controller $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 index dc8fd1d0b..2dfa9f400 100644 --- a/application/controllers/api/v1/organisation/Geschaeftsjahr2.php +++ b/application/controllers/api/v1/organisation/Geschaeftsjahr2.php @@ -21,11 +21,11 @@ class Geschaeftsjahr2 extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Geschaeftsjahr' => 'basis/geschaeftsjahr:rw')); // Load model GeschaeftsjahrModel $this->load->model('organisation/geschaeftsjahr_model', 'GeschaeftsjahrModel'); - - + + } /** @@ -34,11 +34,11 @@ class Geschaeftsjahr2 extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Geschaeftsjahr2 extends APIv1_Controller { $result = $this->GeschaeftsjahrModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Geschaeftsjahr2 extends APIv1_Controller $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 index 21a9965b8..e3ef92fa4 100644 --- a/application/controllers/api/v1/organisation/Gruppe.php +++ b/application/controllers/api/v1/organisation/Gruppe.php @@ -21,11 +21,11 @@ class Gruppe extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Gruppe' => 'basis/gruppe:rw')); // Load model GruppeModel $this->load->model('organisation/gruppe_model', 'GruppeModel'); - - + + } /** @@ -34,11 +34,11 @@ class Gruppe extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Gruppe extends APIv1_Controller { $result = $this->GruppeModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Gruppe extends APIv1_Controller $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 index 3173f025b..9b12dcf90 100644 --- a/application/controllers/api/v1/organisation/Lehrverband.php +++ b/application/controllers/api/v1/organisation/Lehrverband.php @@ -21,11 +21,11 @@ class Lehrverband extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lehrverband' => 'basis/lehrverband:rw')); // Load model LehrverbandModel $this->load->model('organisation/lehrverband_model', 'LehrverbandModel'); - - + + } /** @@ -37,11 +37,11 @@ class Lehrverband extends APIv1_Controller $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 @@ -65,14 +65,14 @@ class Lehrverband extends APIv1_Controller $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 @@ -80,9 +80,9 @@ class Lehrverband extends APIv1_Controller $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 index 0d46839f0..3f62bbdf1 100644 --- a/application/controllers/api/v1/organisation/Organisationseinheit2.php +++ b/application/controllers/api/v1/organisation/Organisationseinheit2.php @@ -21,11 +21,11 @@ class Organisationseinheit2 extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Organisationseinheit' => 'basis/organisationseinheit:rw')); // Load model OrganisationseinheitModel $this->load->model('organisation/organisationseinheit_model', 'OrganisationseinheitModel'); - - + + } /** @@ -34,11 +34,11 @@ class Organisationseinheit2 extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Organisationseinheit2 extends APIv1_Controller { $result = $this->OrganisationseinheitModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Organisationseinheit2 extends APIv1_Controller $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 index 2998c652d..62a723b1e 100644 --- a/application/controllers/api/v1/organisation/Organisationseinheittyp.php +++ b/application/controllers/api/v1/organisation/Organisationseinheittyp.php @@ -21,11 +21,11 @@ class Organisationseinheittyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Organisationseinheittyp' => 'basis/organisationseinheittyp:rw')); // Load model OrganisationseinheittypModel $this->load->model('organisation/organisationseinheittyp_model', 'OrganisationseinheittypModel'); - - + + } /** @@ -34,11 +34,11 @@ class Organisationseinheittyp extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Organisationseinheittyp extends APIv1_Controller { $result = $this->OrganisationseinheittypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Organisationseinheittyp extends APIv1_Controller $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 index 8ba837a64..2dbd26ab0 100644 --- a/application/controllers/api/v1/organisation/Semesterwochen.php +++ b/application/controllers/api/v1/organisation/Semesterwochen.php @@ -21,11 +21,11 @@ class Semesterwochen extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Semesterwochen' => 'basis/semesterwochen:rw')); // Load model SemesterwochenModel $this->load->model('organisation/semesterwochen_model', 'SemesterwochenModel'); - - + + } /** @@ -35,11 +35,11 @@ class Semesterwochen extends APIv1_Controller { $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 @@ -63,7 +63,7 @@ class Semesterwochen extends APIv1_Controller { $result = $this->SemesterwochenModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -71,9 +71,9 @@ class Semesterwochen extends APIv1_Controller $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 index e49b92122..4d1988430 100644 --- a/application/controllers/api/v1/organisation/Service.php +++ b/application/controllers/api/v1/organisation/Service.php @@ -21,11 +21,11 @@ class Service extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Service' => 'basis/service:rw')); // Load model ServiceModel $this->load->model('organisation/service_model', 'ServiceModel'); - - + + } /** @@ -34,11 +34,11 @@ class Service extends APIv1_Controller public function getService() { $serviceID = $this->get('service_id'); - + if (isset($serviceID)) { $result = $this->ServiceModel->load($serviceID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Service extends APIv1_Controller { $result = $this->ServiceModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Service extends APIv1_Controller $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 index c2537c592..16c206401 100644 --- a/application/controllers/api/v1/organisation/Standort.php +++ b/application/controllers/api/v1/organisation/Standort.php @@ -21,11 +21,11 @@ class Standort extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Standort' => 'basis/standort:rw')); // Load model StandortModel $this->load->model('organisation/standort_model', 'StandortModel'); - - + + } /** @@ -34,11 +34,11 @@ class Standort extends APIv1_Controller public function getStandort() { $standortID = $this->get('standort_id'); - + if (isset($standortID)) { $result = $this->StandortModel->load($standortID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Standort extends APIv1_Controller { $result = $this->StandortModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Standort extends APIv1_Controller $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 index 5e69a53d5..b85c27f42 100644 --- a/application/controllers/api/v1/organisation/Statistik.php +++ b/application/controllers/api/v1/organisation/Statistik.php @@ -21,11 +21,17 @@ class Statistik extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'Statistik' => 'basis/statistik:rw', + 'All' => 'basis/statistik:r', + 'MenueArray' => 'basis/statistik:r' + ) + ); // Load model StatistikModel $this->load->model('organisation/statistik_model', 'StatistikModel'); - - + + } /** @@ -34,11 +40,11 @@ class Statistik extends APIv1_Controller 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 @@ -46,19 +52,19 @@ class Statistik extends APIv1_Controller $this->response(); } } - + /** * @return void */ public function getAll() { $this->StatistikModel->addOrder($this->get('order')); - + $result = $this->StatistikModel->load(); - + $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ @@ -67,9 +73,9 @@ class Statistik extends APIv1_Controller $this->StatistikModel->addOrder('gruppe'); $this->StatistikModel->addOrder('bezeichnung'); $this->StatistikModel->addOrder('statistik_kurzbz'); - + $result = $this->StatistikModel->load(); - + $this->response($result, REST_Controller::HTTP_OK); } @@ -88,7 +94,7 @@ class Statistik extends APIv1_Controller { $result = $this->StatistikModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -96,9 +102,9 @@ class Statistik extends APIv1_Controller $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 index bea2f218e..2e1b549ff 100644 --- a/application/controllers/api/v1/organisation/Studiengang2.php +++ b/application/controllers/api/v1/organisation/Studiengang2.php @@ -20,7 +20,17 @@ class Studiengang2 extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'Studiengang' => 'basis/studiengang:r', + 'AllForBewerbung' => 'basis/studiengang:r', + 'StudiengangStudienplan' => 'basis/studiengang:r', + 'StudiengangBewerbung' => 'basis/studiengang:r', + 'AppliedStudiengang' => 'basis/studiengang:r', + 'AppliedStudiengangFromNow' => 'basis/studiengang:r', + 'AppliedStudiengangFromNowOE' => 'basis/studiengang:r' + ) + ); // Load model PersonModel $this->load->model('organisation/studiengang_model', 'StudiengangModel'); diff --git a/application/controllers/api/v1/organisation/Studiengangstyp.php b/application/controllers/api/v1/organisation/Studiengangstyp.php index a0293c229..b10811636 100644 --- a/application/controllers/api/v1/organisation/Studiengangstyp.php +++ b/application/controllers/api/v1/organisation/Studiengangstyp.php @@ -21,11 +21,11 @@ class Studiengangstyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Studiengangstyp' => 'basis/studiengangstyp:rw')); // Load model StudiengangstypModel $this->load->model('organisation/studiengangstyp_model', 'StudiengangstypModel'); - - + + } /** @@ -34,11 +34,11 @@ class Studiengangstyp extends APIv1_Controller public function getStudiengangstyp() { $typ = $this->get('typ'); - + if (isset($typ)) { $result = $this->StudiengangstypModel->load($typ); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Studiengangstyp extends APIv1_Controller { $result = $this->StudiengangstypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Studiengangstyp extends APIv1_Controller $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 index 8860dbd39..eb7c38847 100644 --- a/application/controllers/api/v1/organisation/Studienjahr.php +++ b/application/controllers/api/v1/organisation/Studienjahr.php @@ -21,11 +21,11 @@ class Studienjahr extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Studienjahr' => 'basis/studienjahr:rw')); // Load model StudienjahrModel $this->load->model('organisation/studienjahr_model', 'StudienjahrModel'); - - + + } /** @@ -34,11 +34,11 @@ class Studienjahr extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Studienjahr extends APIv1_Controller { $result = $this->StudienjahrModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Studienjahr extends APIv1_Controller $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 index c791898c9..122c8f099 100644 --- a/application/controllers/api/v1/organisation/Studienordnung.php +++ b/application/controllers/api/v1/organisation/Studienordnung.php @@ -21,11 +21,11 @@ class Studienordnung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Studienordnung' => 'lehre/studienordnung:rw')); // Load model StudienordnungModel $this->load->model('organisation/studienordnung_model', 'StudienordnungModel'); - - + + } /** @@ -34,11 +34,11 @@ class Studienordnung extends APIv1_Controller public function getStudienordnung() { $studienordnungID = $this->get('studienordnung_id'); - + if (isset($studienordnungID)) { $result = $this->StudienordnungModel->load($studienordnungID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Studienordnung extends APIv1_Controller { $result = $this->StudienordnungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Studienordnung extends APIv1_Controller $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 index 52d292850..30d38c4ad 100644 --- a/application/controllers/api/v1/organisation/Studienordnungstatus.php +++ b/application/controllers/api/v1/organisation/Studienordnungstatus.php @@ -21,11 +21,11 @@ class Studienordnungstatus extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Studienordnungstatus' => 'lehre/studienordnungstatus:rw')); // Load model StudienordnungstatusModel $this->load->model('organisation/studienordnungstatus_model', 'StudienordnungstatusModel'); - - + + } /** @@ -34,11 +34,11 @@ class Studienordnungstatus extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Studienordnungstatus extends APIv1_Controller { $result = $this->StudienordnungstatusModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Studienordnungstatus extends APIv1_Controller $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 68a0a2095..05d8d7837 100644 --- a/application/controllers/api/v1/organisation/Studienplan.php +++ b/application/controllers/api/v1/organisation/Studienplan.php @@ -21,19 +21,25 @@ class Studienplan extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'Studienplan' => 'lehre/studienplan:r', + 'Studienplaene' => 'lehre/studienplan:r', + 'StudienplaeneFromSem' => 'lehre/studienplan:r' + ) + ); // Load model PersonModel - $this->load->model("organisation/studienplan_model", "StudienplanModel"); + $this->load->model('organisation/studienplan_model', 'StudienplanModel'); } - + public function getStudienplan() { $studienplan_id = $this->get("studienplan_id"); - + if (isset($studienplan_id)) { $result = $this->StudienplanModel->load($studienplan_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -41,15 +47,15 @@ class Studienplan extends APIv1_Controller $this->response(); } } - + public function getStudienplaene() { $studiengang_kz = $this->get("studiengang_kz"); - + if (isset($studiengang_kz)) { $result = $this->StudienplanModel->getStudienplaene($studiengang_kz); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -57,14 +63,14 @@ class Studienplan extends APIv1_Controller $this->response(); } } - + public function getStudienplaeneFromSem() { $studiengang_kz = $this->get("studiengang_kz"); $studiensemester_kurzbz = $this->get("studiensemester_kurzbz"); $ausbildungssemester = $this->get("ausbildungssemester"); $orgform_kurzbz = $this->get("orgform_kurzbz"); - + if (isset($studiengang_kz) && isset($studiensemester_kurzbz)) { $result = $this->StudienplanModel->getStudienplaeneBySemester( @@ -73,7 +79,7 @@ class Studienplan extends APIv1_Controller $ausbildungssemester, $orgform_kurzbz ); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -81,4 +87,4 @@ class Studienplan extends APIv1_Controller $this->response(); } } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/organisation/Studienplatz.php b/application/controllers/api/v1/organisation/Studienplatz.php index bb0dc5e12..88ce6a12d 100644 --- a/application/controllers/api/v1/organisation/Studienplatz.php +++ b/application/controllers/api/v1/organisation/Studienplatz.php @@ -21,11 +21,11 @@ class Studienplatz extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Studienplatz' => 'basis/studienplatz:rw')); // Load model StudienplatzModel $this->load->model('organisation/studienplatz_model', 'StudienplatzModel'); - - + + } /** @@ -34,11 +34,11 @@ class Studienplatz extends APIv1_Controller public function getStudienplatz() { $studienplatzID = $this->get('studienplatz_id'); - + if (isset($studienplatzID)) { $result = $this->StudienplatzModel->load($studienplatzID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Studienplatz extends APIv1_Controller { $result = $this->StudienplatzModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Studienplatz extends APIv1_Controller $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 index 398ccfa58..f714214d9 100644 --- a/application/controllers/api/v1/organisation/Studiensemester.php +++ b/application/controllers/api/v1/organisation/Studiensemester.php @@ -21,11 +21,25 @@ class Studiensemester extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'Studiensemester' => 'basis/studiensemester:rw', + 'NextStudiensemester' => 'basis/studiensemester:r', + 'All' => 'basis/studiensemester:r', + 'Akt' => 'basis/studiensemester:r', + 'AktNext' => 'basis/studiensemester:r', + 'LastOrAktSemester' => 'basis/studiensemester:r', + 'NextFrom' => 'basis/studiensemester:r', + 'Previous' => 'basis/studiensemester:r', + 'Nearest' => 'basis/studiensemester:r', + 'Finished' => 'basis/studiensemester:r', + 'Timestamp' => 'basis/studiensemester:r' + ) + ); // Load model StudiensemesterModel $this->load->model('organisation/studiensemester_model', 'StudiensemesterModel'); - - + + } /** @@ -34,11 +48,11 @@ class Studiensemester extends APIv1_Controller 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 @@ -46,17 +60,17 @@ class Studiensemester extends APIv1_Controller $this->response(); } } - + /** * @return void */ public function getNextStudiensemester() { $art = $this->get('art'); - + $this->StudiensemesterModel->addOrder('start'); $this->StudiensemesterModel->addLimit(1); - + if (isset($art)) { $result = $this->StudiensemesterModel->loadWhere( @@ -72,14 +86,14 @@ class Studiensemester extends APIv1_Controller $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ public function getAll() { $order = $this->get('order'); - + if (strcasecmp($order, 'DESC') == 0) { $this->StudiensemesterModel->addOrder('ende', 'DESC'); @@ -88,12 +102,12 @@ class Studiensemester extends APIv1_Controller { $this->StudiensemesterModel->addOrder('ende', 'ASC'); } - + $result = $this->StudiensemesterModel->load(); - + $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ @@ -103,28 +117,28 @@ class Studiensemester extends APIv1_Controller $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ public function getAktNext() { $semester = $this->get('semester'); - + $result = null; - + if (!is_numeric($semester)) { $result = $this->StudiensemesterModel->loadWhere(array('start <=' => 'NOW()', 'ende >=' => 'NOW()')); } - + if (!hasData($result)) { $this->StudiensemesterModel->addOrder('ende'); $this->StudiensemesterModel->addLimit(1); - + $whereArray = array('ende >=' => 'NOW()'); - + if (is_numeric($semester)) { if ($semester % 2 == 0) @@ -138,33 +152,33 @@ class Studiensemester extends APIv1_Controller $whereArray['SUBSTRING(studiensemester_kurzbz FROM 1 FOR 2) ='] = $ss; } - + $result = $this->StudiensemesterModel->loadWhere($whereArray); } - + $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ public function getLastOrAktSemester() { $result = $this->StudiensemesterModel->getLastOrAktSemester($this->get('days')); - + $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ public function getNextFrom() { $result = $this->StudiensemesterModel->getNextFrom($this->get('studiensemester_kurzbz')); - + $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ @@ -172,12 +186,12 @@ class Studiensemester extends APIv1_Controller { $this->StudiensemesterModel->addOrder('ende', 'DESC'); $this->StudiensemesterModel->addLimit(1); - + $result = $this->StudiensemesterModel->loadWhere(array('ende <' => 'NOW()')); - + $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ @@ -187,37 +201,37 @@ class Studiensemester extends APIv1_Controller $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ public function getFinished() { $limit = $this->get('limit'); - + $this->StudiensemesterModel->addOrder('ende', 'DESC'); $this->StudiensemesterModel->addLimit($limit); - + $result = $this->StudiensemesterModel->loadWhere(array('start <=' => 'NOW()')); - + $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ public function getTimestamp() { $studiensemester_kurzbz = $this->get('studiensemester_kurzbz'); - + if (isset($studiensemester_kurzbz)) { $result = $this->StudiensemesterModel->load($studiensemester_kurzbz); - + if (is_array($result->retval) && count($result->retval) > 0) { $studiensemester = $result->retval[0]; - + if (is_object($studiensemester)) { $start = ""; @@ -239,7 +253,7 @@ class Studiensemester extends APIv1_Controller mb_substr($studiensemester->ende, 0, 4) ); } - + $result->retval = array( 'studiensemester_kurzbz' => $studiensemester_kurzbz, 'start' => $start, @@ -247,7 +261,7 @@ class Studiensemester extends APIv1_Controller ); } } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -271,7 +285,7 @@ class Studiensemester extends APIv1_Controller { $result = $this->StudiensemesterModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -279,9 +293,9 @@ class Studiensemester extends APIv1_Controller $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 index 04c8de722..ddbbfe554 100644 --- a/application/controllers/api/v1/person/Adresse.php +++ b/application/controllers/api/v1/person/Adresse.php @@ -22,21 +22,21 @@ class Adresse extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Adresse' => 'basis/adresse:rw')); // Load model PersonModel $this->load->model('person/Adresse_model', 'AdresseModel'); - - + + } 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 @@ -44,11 +44,11 @@ class Adresse extends APIv1_Controller $this->response(); } } - + public function postAdresse() { $adresse = $this->post(); - + if (is_array($adresse)) { if (isset($adresse['adresse_id'])) @@ -59,7 +59,7 @@ class Adresse extends APIv1_Controller { $result = $this->AdresseModel->insert($adresse); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -67,4 +67,4 @@ class Adresse extends APIv1_Controller $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 index 42a1f5c15..06f6b040d 100644 --- a/application/controllers/api/v1/person/Bankverbindung.php +++ b/application/controllers/api/v1/person/Bankverbindung.php @@ -21,11 +21,11 @@ class Bankverbindung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Bankverbindung' => 'basis/bankverbindung:rw')); // Load model BankverbindungModel $this->load->model('person/bankverbindung_model', 'BankverbindungModel'); - - + + } /** @@ -34,11 +34,11 @@ class Bankverbindung extends APIv1_Controller public function getBankverbindung() { $bankverbindungID = $this->get('bankverbindung_id'); - + if (isset($bankverbindungID)) { $result = $this->BankverbindungModel->load($bankverbindungID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Bankverbindung extends APIv1_Controller { $result = $this->BankverbindungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Bankverbindung extends APIv1_Controller $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 index 33687f6f0..23fcdadac 100644 --- a/application/controllers/api/v1/person/Benutzer.php +++ b/application/controllers/api/v1/person/Benutzer.php @@ -21,11 +21,11 @@ class Benutzer extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Benutzer' => 'basis/benutzer:rw')); // Load model BenutzerModel $this->load->model('person/benutzer_model', 'BenutzerModel'); - - + + } /** @@ -34,11 +34,11 @@ class Benutzer extends APIv1_Controller public function getBenutzer() { $uid = $this->get('uid'); - + if (isset($uid)) { $result = $this->BenutzerModel->load($uid); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Benutzer extends APIv1_Controller { $result = $this->BenutzerModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Benutzer extends APIv1_Controller $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 index 93b793287..98fd8654a 100644 --- a/application/controllers/api/v1/person/Benutzerfunktion.php +++ b/application/controllers/api/v1/person/Benutzerfunktion.php @@ -21,11 +21,11 @@ class Benutzerfunktion extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Benutzerfunktion' => 'basis/benutzerfunktion:rw')); // Load model BenutzerfunktionModel $this->load->model('person/benutzerfunktion_model', 'BenutzerfunktionModel'); - - + + } /** @@ -34,11 +34,11 @@ class Benutzerfunktion extends APIv1_Controller public function getBenutzerfunktion() { $benutzerfunktionID = $this->get('benutzerfunktion_id'); - + if (isset($benutzerfunktionID)) { $result = $this->BenutzerfunktionModel->load($benutzerfunktionID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Benutzerfunktion extends APIv1_Controller { $result = $this->BenutzerfunktionModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Benutzerfunktion extends APIv1_Controller $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 index b70e08014..0adc8c73a 100644 --- a/application/controllers/api/v1/person/Benutzergruppe.php +++ b/application/controllers/api/v1/person/Benutzergruppe.php @@ -21,11 +21,11 @@ class Benutzergruppe extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Benutzergruppe' => 'basis/benutzergruppe:rw')); // Load model BenutzergruppeModel $this->load->model('person/benutzergruppe_model', 'BenutzergruppeModel'); - - + + } /** @@ -35,11 +35,11 @@ class Benutzergruppe extends APIv1_Controller { $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 @@ -63,7 +63,7 @@ class Benutzergruppe extends APIv1_Controller { $result = $this->BenutzergruppeModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -71,9 +71,9 @@ class Benutzergruppe extends APIv1_Controller $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 index ea74649da..acd1ef5b6 100644 --- a/application/controllers/api/v1/person/Fotostatus.php +++ b/application/controllers/api/v1/person/Fotostatus.php @@ -21,11 +21,11 @@ class Fotostatus extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Fotostatus' => 'basis/fotostatus:rw')); // Load model FotostatusModel $this->load->model('person/fotostatus_model', 'FotostatusModel'); - - + + } /** @@ -34,11 +34,11 @@ class Fotostatus extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Fotostatus extends APIv1_Controller { $result = $this->FotostatusModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Fotostatus extends APIv1_Controller $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 index c8ca32b36..eb1651c00 100644 --- a/application/controllers/api/v1/person/Freebusy.php +++ b/application/controllers/api/v1/person/Freebusy.php @@ -21,11 +21,11 @@ class Freebusy extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Freebusy' => 'basis/freebusy:rw')); // Load model FreebusyModel $this->load->model('person/freebusy_model', 'FreebusyModel'); - - + + } /** @@ -34,11 +34,11 @@ class Freebusy extends APIv1_Controller public function getFreebusy() { $freebusyID = $this->get('freebusy_id'); - + if (isset($freebusyID)) { $result = $this->FreebusyModel->load($freebusyID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Freebusy extends APIv1_Controller { $result = $this->FreebusyModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Freebusy extends APIv1_Controller $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 index f3dac4792..0187035d1 100644 --- a/application/controllers/api/v1/person/Freebusytyp.php +++ b/application/controllers/api/v1/person/Freebusytyp.php @@ -21,11 +21,11 @@ class Freebusytyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Freebusytyp' => 'basis/freebusytyp:rw')); // Load model FreebusytypModel $this->load->model('person/freebusytyp_model', 'FreebusytypModel'); - - + + } /** @@ -34,11 +34,11 @@ class Freebusytyp extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Freebusytyp extends APIv1_Controller { $result = $this->FreebusytypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Freebusytyp extends APIv1_Controller $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 index 00d5db5fd..fceeaaeaf 100644 --- a/application/controllers/api/v1/person/Kontakt.php +++ b/application/controllers/api/v1/person/Kontakt.php @@ -22,8 +22,16 @@ class Kontakt extends APIv1_Controller */ public function __construct() { - parent::__construct(); - + parent::__construct( + array( + 'Kontakt' => 'basis/kontakt:rw', + 'OnlyKontakt' => 'basis/kontakt:r', + 'KontaktByPersonID' => 'basis/kontakt:r', + 'OnlyKontaktByPersonID' => 'basis/kontakt:r', + 'KontaktByPersonIDKontaktTyp' => 'basis/kontakt:r' + ) + ); + // Load model PersonModel $this->load->model('person/kontakt_model', 'KontaktModel'); } @@ -31,11 +39,11 @@ class Kontakt extends APIv1_Controller public function getKontakt() { $kontakt_id = $this->get('kontakt_id'); - + if (isset($kontakt_id)) { $result = $this->KontaktModel->getWholeKontakt($kontakt_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -43,15 +51,15 @@ class Kontakt extends APIv1_Controller $this->response(); } } - + public function getOnlyKontakt() { $kontakt_id = $this->get('kontakt_id'); - + if (isset($kontakt_id)) { $result = $this->KontaktModel->load($kontakt_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -59,15 +67,15 @@ class Kontakt extends APIv1_Controller $this->response(); } } - + public function getKontaktByPersonID() { $person_id = $this->get('person_id'); - + if (isset($person_id)) { $result = $this->KontaktModel->getWholeKontakt(null, $person_id); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -75,15 +83,15 @@ class Kontakt extends APIv1_Controller $this->response(); } } - + public function getOnlyKontaktByPersonID() { $person_id = $this->get('person_id'); - + if (isset($person_id)) { $result = $this->KontaktModel->loadWhere(array('person_id' => $person_id)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -91,16 +99,16 @@ class Kontakt extends APIv1_Controller $this->response(); } } - + public function getKontaktByPersonIDKontaktTyp() { $person_id = $this->get('person_id'); $kontakttyp = $this->get('kontakttyp'); - + if (isset($person_id) && isset($kontakttyp)) { $result = $this->KontaktModel->getWholeKontakt(null, $person_id, $kontakttyp); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -108,11 +116,11 @@ class Kontakt extends APIv1_Controller $this->response(); } } - + public function postKontakt() { $kontakt = $this->post(); - + if (is_array($kontakt)) { if (isset($kontakt['kontakt_id'])) @@ -123,7 +131,7 @@ class Kontakt extends APIv1_Controller { $result = $this->KontaktModel->insert($kontakt); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -131,4 +139,4 @@ class Kontakt extends APIv1_Controller $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 index e435bc0de..b732d6eee 100644 --- a/application/controllers/api/v1/person/Kontaktmedium.php +++ b/application/controllers/api/v1/person/Kontaktmedium.php @@ -21,11 +21,11 @@ class Kontaktmedium extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Kontaktmedium' => 'basis/kontaktmedium:rw')); // Load model KontaktmediumModel $this->load->model('person/kontaktmedium_model', 'KontaktmediumModel'); - - + + } /** @@ -34,11 +34,11 @@ class Kontaktmedium extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Kontaktmedium extends APIv1_Controller { $result = $this->KontaktmediumModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Kontaktmedium extends APIv1_Controller $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 index bceab7b36..c3d2b6e94 100644 --- a/application/controllers/api/v1/person/Kontakttyp.php +++ b/application/controllers/api/v1/person/Kontakttyp.php @@ -21,11 +21,11 @@ class Kontakttyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Kontakttyp' => 'basis/kontakttyp:rw')); // Load model KontakttypModel $this->load->model('person/kontakttyp_model', 'KontakttypModel'); - - + + } /** @@ -34,11 +34,11 @@ class Kontakttyp extends APIv1_Controller public function getKontakttyp() { $kontakttyp = $this->get('kontakttyp'); - + if (isset($kontakttyp)) { $result = $this->KontakttypModel->load($kontakttyp); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Kontakttyp extends APIv1_Controller { $result = $this->KontakttypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Kontakttyp extends APIv1_Controller $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 index d4c88b4e2..29755d7d3 100644 --- a/application/controllers/api/v1/person/Notiz.php +++ b/application/controllers/api/v1/person/Notiz.php @@ -21,11 +21,11 @@ class Notiz extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Notiz' => 'basis/notiz:rw')); // Load model NotizModel $this->load->model('person/notiz_model', 'NotizModel'); - - + + } /** @@ -34,11 +34,11 @@ class Notiz extends APIv1_Controller public function getNotiz() { $notizID = $this->get('notiz_id'); - + if (isset($notizID)) { $result = $this->NotizModel->load($notizID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Notiz extends APIv1_Controller { $result = $this->NotizModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Notiz extends APIv1_Controller $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 index d83370037..c5dab8cbe 100644 --- a/application/controllers/api/v1/person/Notizzuordnung.php +++ b/application/controllers/api/v1/person/Notizzuordnung.php @@ -21,11 +21,11 @@ class Notizzuordnung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Notizzuordnung' => 'basis/notizzuordnung:rw')); // Load model NotizzuordnungModel $this->load->model('person/notizzuordnung_model', 'NotizzuordnungModel'); - - + + } /** @@ -34,11 +34,11 @@ class Notizzuordnung extends APIv1_Controller public function getNotizzuordnung() { $notizzuordnungID = $this->get('notizzuordnung_id'); - + if (isset($notizzuordnungID)) { $result = $this->NotizzuordnungModel->load($notizzuordnungID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Notizzuordnung extends APIv1_Controller { $result = $this->NotizzuordnungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Notizzuordnung extends APIv1_Controller $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 c5d78ccdd..c8c95ae06 100644 --- a/application/controllers/api/v1/person/Person.php +++ b/application/controllers/api/v1/person/Person.php @@ -21,7 +21,7 @@ class Person extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Person' => 'basis/person:rw', 'CheckBewerbung' => 'basis/person:r')); // Load model PersonModel $this->load->model('person/person_model', 'PersonModel'); } @@ -34,7 +34,7 @@ class Person extends APIv1_Controller $person_id = $this->get('person_id'); $code = $this->get('code'); $email = $this->get('email'); - + if (isset($code) || isset($email) || isset($person_id)) { if (isset($code) && isset($email)) @@ -44,7 +44,7 @@ class Person extends APIv1_Controller else { $parametersArray = array(); - + if (isset($code)) { $parametersArray['zugangscode'] = $code; @@ -53,10 +53,10 @@ class Person extends APIv1_Controller { $parametersArray['person_id'] = $person_id; } - + $result = $this->PersonModel->loadWhere($parametersArray); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -64,7 +64,7 @@ class Person extends APIv1_Controller $this->response(); } } - + /** * @return void */ @@ -72,11 +72,11 @@ class Person extends APIv1_Controller { $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 @@ -92,7 +92,7 @@ class Person extends APIv1_Controller { $person = $this->post(); $validation = $this->_validate($person); - + if (isSuccess($validation)) { if(isset($person['person_id']) && !(is_null($person['person_id'])) && ($person['person_id'] != '')) @@ -103,7 +103,7 @@ class Person extends APIv1_Controller { $result = $this->PersonModel->insert($person); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -111,7 +111,7 @@ class Person extends APIv1_Controller $this->response($validation, REST_Controller::HTTP_OK); } } - + private function _validate($person) { // If $person is consistent @@ -119,7 +119,7 @@ class Person extends APIv1_Controller { return error('Any parameters posted'); } - + // Trim all the values foreach($person as $key => $value) { @@ -128,7 +128,7 @@ class Person extends APIv1_Controller $person[$key] = trim($value); } } - + if (isset($person['sprache']) && mb_strlen($person['sprache']) > 16) { return error('Sprache darf nicht laenger als 16 Zeichen sein'); @@ -213,7 +213,7 @@ class Person extends APIv1_Controller { return error('Geschlecht muss w, m oder u sein!'); } - + if (isset($person['svnr'])) { if ($person['svnr'] != '' && mb_strlen($person['svnr']) != 16 @@ -240,7 +240,7 @@ class Person extends APIv1_Controller { return error('SVNR ist ungueltig'); } - + if (mb_strlen($person['svnr']) == 12) { $last = substr($person['svnr'], 10, 12); @@ -250,7 +250,7 @@ class Person extends APIv1_Controller } } } - + //Pruefen ob das Geburtsdatum mit der SVNR uebereinstimmt. if (isset($person['gebdatum']) && $person['svnr'] != '' && $person['gebdatum'] != '') { @@ -261,7 +261,7 @@ class Person extends APIv1_Controller } } } - + return success('Input data are valid'); } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/project/Aktivitaet.php b/application/controllers/api/v1/project/Aktivitaet.php index 878738804..7aa647058 100644 --- a/application/controllers/api/v1/project/Aktivitaet.php +++ b/application/controllers/api/v1/project/Aktivitaet.php @@ -21,11 +21,11 @@ class Aktivitaet extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Aktivitaet' => 'basis/aktivitaet:rw')); // Load model AktivitaetModel $this->load->model('project/aktivitaet_model', 'AktivitaetModel'); - - + + } /** @@ -34,11 +34,11 @@ class Aktivitaet extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Aktivitaet extends APIv1_Controller { $result = $this->AktivitaetModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Aktivitaet extends APIv1_Controller $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 index f9d9ce58c..96be6ab55 100644 --- a/application/controllers/api/v1/project/Aufwandstyp.php +++ b/application/controllers/api/v1/project/Aufwandstyp.php @@ -21,11 +21,11 @@ class Aufwandstyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Aufwandstyp' => 'basis/aufwandstyp:rw')); // Load model AufwandstypModel $this->load->model('project/aufwandstyp_model', 'AufwandstypModel'); - - + + } /** @@ -34,11 +34,11 @@ class Aufwandstyp extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Aufwandstyp extends APIv1_Controller { $result = $this->AufwandstypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Aufwandstyp extends APIv1_Controller $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 index 6340ca81b..64533f36f 100644 --- a/application/controllers/api/v1/project/Projekt.php +++ b/application/controllers/api/v1/project/Projekt.php @@ -21,11 +21,11 @@ class Projekt extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Projekt' => 'basis/projekt:rw')); // Load model ProjektModel $this->load->model('project/projekt_model', 'ProjektModel'); - - + + } /** @@ -34,11 +34,11 @@ class Projekt extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Projekt extends APIv1_Controller { $result = $this->ProjektModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Projekt extends APIv1_Controller $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 index 6ff0748f5..2869f935a 100644 --- a/application/controllers/api/v1/project/Projekt_ressource.php +++ b/application/controllers/api/v1/project/Projekt_ressource.php @@ -21,11 +21,11 @@ class Projekt_ressource extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Projekt_ressource' => 'basis/projekt_ressource:rw')); // Load model Projekt_ressourceModel $this->load->model('project/projekt_ressource_model', 'Projekt_ressourceModel'); - - + + } /** @@ -34,11 +34,11 @@ class Projekt_ressource extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Projekt_ressource extends APIv1_Controller { $result = $this->Projekt_ressourceModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Projekt_ressource extends APIv1_Controller $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 index b59a0aed3..c48893948 100644 --- a/application/controllers/api/v1/project/Projektphase.php +++ b/application/controllers/api/v1/project/Projektphase.php @@ -21,11 +21,11 @@ class Projektphase extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Projektphase' => 'basis/projektphase:rw')); // Load model ProjektphaseModel $this->load->model('project/projektphase_model', 'ProjektphaseModel'); - - + + } /** @@ -34,11 +34,11 @@ class Projektphase extends APIv1_Controller public function getProjektphase() { $projektphaseID = $this->get('projektphase_id'); - + if (isset($projektphaseID)) { $result = $this->ProjektphaseModel->load($projektphaseID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Projektphase extends APIv1_Controller { $result = $this->ProjektphaseModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Projektphase extends APIv1_Controller $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 index ae89c45b3..5793c85a1 100644 --- a/application/controllers/api/v1/project/Projekttask.php +++ b/application/controllers/api/v1/project/Projekttask.php @@ -21,11 +21,11 @@ class Projekttask extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Projekttask' => 'basis/projekttask:rw')); // Load model ProjekttaskModel $this->load->model('project/projekttask_model', 'ProjekttaskModel'); - - + + } /** @@ -34,11 +34,11 @@ class Projekttask extends APIv1_Controller public function getProjekttask() { $projekttaskID = $this->get('projekttask_id'); - + if (isset($projekttaskID)) { $result = $this->ProjekttaskModel->load($projekttaskID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Projekttask extends APIv1_Controller { $result = $this->ProjekttaskModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Projekttask extends APIv1_Controller $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 index 0e70c86ac..fddf77c57 100644 --- a/application/controllers/api/v1/project/Ressource.php +++ b/application/controllers/api/v1/project/Ressource.php @@ -21,11 +21,11 @@ class Ressource extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Ressource' => 'basis/ressource:rw')); // Load model RessourceModel $this->load->model('project/ressource_model', 'RessourceModel'); - - + + } /** @@ -34,11 +34,11 @@ class Ressource extends APIv1_Controller public function getRessource() { $ressourceID = $this->get('ressource_id'); - + if (isset($ressourceID)) { $result = $this->RessourceModel->load($ressourceID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Ressource extends APIv1_Controller { $result = $this->RessourceModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Ressource extends APIv1_Controller $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 index db81c319f..ff0e75b09 100644 --- a/application/controllers/api/v1/project/Scrumsprint.php +++ b/application/controllers/api/v1/project/Scrumsprint.php @@ -21,11 +21,11 @@ class Scrumsprint extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Scrumsprint' => 'basis/scrumsprint:rw')); // Load model ScrumsprintModel $this->load->model('project/scrumsprint_model', 'ScrumsprintModel'); - - + + } /** @@ -34,11 +34,11 @@ class Scrumsprint extends APIv1_Controller public function getScrumsprint() { $scrumsprintID = $this->get('scrumsprint_id'); - + if (isset($scrumsprintID)) { $result = $this->ScrumsprintModel->load($scrumsprintID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Scrumsprint extends APIv1_Controller { $result = $this->ScrumsprintModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Scrumsprint extends APIv1_Controller $this->response(); } } - + private function _validate($scrumsprint = 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 index 2d1da9d22..63e003cfd 100644 --- a/application/controllers/api/v1/ressource/Betriebsmittel.php +++ b/application/controllers/api/v1/ressource/Betriebsmittel.php @@ -21,11 +21,11 @@ class Betriebsmittel extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Betriebsmittel' => 'basis/betriebsmittel:rw')); // Load model BetriebsmittelModel $this->load->model('ressource/betriebsmittel_model', 'BetriebsmittelModel'); - - + + } /** @@ -34,11 +34,11 @@ class Betriebsmittel extends APIv1_Controller public function getBetriebsmittel() { $betriebsmittelID = $this->get('betriebsmittel_id'); - + if (isset($betriebsmittelID)) { $result = $this->BetriebsmittelModel->load($betriebsmittelID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Betriebsmittel extends APIv1_Controller { $result = $this->BetriebsmittelModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Betriebsmittel extends APIv1_Controller $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 index 8ed7a9a7d..71b5af77a 100644 --- a/application/controllers/api/v1/ressource/Betriebsmittelperson2.php +++ b/application/controllers/api/v1/ressource/Betriebsmittelperson2.php @@ -21,11 +21,11 @@ class Betriebsmittelperson2 extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Betriebsmittelperson' => 'basis/betriebsmittelperson:rw')); // Load model BetriebsmittelpersonModel $this->load->model('ressource/betriebsmittelperson_model', 'BetriebsmittelpersonModel'); - - + + } /** @@ -34,11 +34,11 @@ class Betriebsmittelperson2 extends APIv1_Controller public function getBetriebsmittelperson() { $betriebsmittelpersonID = $this->get('betriebsmittelperson_id'); - + if (isset($betriebsmittelpersonID)) { $result = $this->BetriebsmittelpersonModel->load($betriebsmittelpersonID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Betriebsmittelperson2 extends APIv1_Controller { $result = $this->BetriebsmittelpersonModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Betriebsmittelperson2 extends APIv1_Controller $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 index c25c6991e..8dcfad8c6 100644 --- a/application/controllers/api/v1/ressource/Betriebsmittelstatus.php +++ b/application/controllers/api/v1/ressource/Betriebsmittelstatus.php @@ -21,11 +21,11 @@ class Betriebsmittelstatus extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Betriebsmittelstatus' => 'basis/betriebsmittelstatus:rw')); // Load model BetriebsmittelstatusModel $this->load->model('ressource/betriebsmittelstatus_model', 'BetriebsmittelstatusModel'); - - + + } /** @@ -34,11 +34,11 @@ class Betriebsmittelstatus extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Betriebsmittelstatus extends APIv1_Controller { $result = $this->BetriebsmittelstatusModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Betriebsmittelstatus extends APIv1_Controller $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 index 1aef7153b..9902ec032 100644 --- a/application/controllers/api/v1/ressource/Betriebsmitteltyp.php +++ b/application/controllers/api/v1/ressource/Betriebsmitteltyp.php @@ -21,11 +21,11 @@ class Betriebsmitteltyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Betriebsmitteltyp' => 'basis/betriebsmitteltyp:rw')); // Load model BetriebsmitteltypModel $this->load->model('ressource/betriebsmitteltyp_model', 'BetriebsmitteltypModel'); - - + + } /** @@ -34,11 +34,11 @@ class Betriebsmitteltyp extends APIv1_Controller public function getBetriebsmitteltyp() { $betriebsmitteltyp = $this->get('betriebsmitteltyp'); - + if (isset($betriebsmitteltyp)) { $result = $this->BetriebsmitteltypModel->load($betriebsmitteltyp); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Betriebsmitteltyp extends APIv1_Controller { $result = $this->BetriebsmitteltypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Betriebsmitteltyp extends APIv1_Controller $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 index 3799aae26..bd7cfcf7f 100644 --- a/application/controllers/api/v1/ressource/Coodle.php +++ b/application/controllers/api/v1/ressource/Coodle.php @@ -21,11 +21,11 @@ class Coodle extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Coodle' => 'basis/coodle:rw')); // Load model CoodleModel $this->load->model('ressource/coodle_model', 'CoodleModel'); - - + + } /** @@ -34,11 +34,11 @@ class Coodle extends APIv1_Controller public function getCoodle() { $coodleID = $this->get('coodle_id'); - + if (isset($coodleID)) { $result = $this->CoodleModel->load($coodleID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Coodle extends APIv1_Controller { $result = $this->CoodleModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Coodle extends APIv1_Controller $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 index 545501a77..291451faf 100644 --- a/application/controllers/api/v1/ressource/Erreichbarkeit.php +++ b/application/controllers/api/v1/ressource/Erreichbarkeit.php @@ -21,11 +21,11 @@ class Erreichbarkeit extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Erreichbarkeit' => 'basis/erreichbarkeit:rw')); // Load model ErreichbarkeitModel $this->load->model('ressource/erreichbarkeit_model', 'ErreichbarkeitModel'); - - + + } /** @@ -34,11 +34,11 @@ class Erreichbarkeit extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Erreichbarkeit extends APIv1_Controller { $result = $this->ErreichbarkeitModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Erreichbarkeit extends APIv1_Controller $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 index 5bcfb1173..159d63642 100644 --- a/application/controllers/api/v1/ressource/Firma.php +++ b/application/controllers/api/v1/ressource/Firma.php @@ -21,11 +21,11 @@ class Firma extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Firma' => 'basis/firma:rw')); // Load model FirmaModel $this->load->model('ressource/firma_model', 'FirmaModel'); - - + + } /** @@ -34,11 +34,11 @@ class Firma extends APIv1_Controller public function getFirma() { $firmaID = $this->get('firma_id'); - + if (isset($firmaID)) { $result = $this->FirmaModel->load($firmaID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Firma extends APIv1_Controller { $result = $this->FirmaModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Firma extends APIv1_Controller $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 index c2c4f7533..b9df31896 100644 --- a/application/controllers/api/v1/ressource/Firmatag.php +++ b/application/controllers/api/v1/ressource/Firmatag.php @@ -21,11 +21,11 @@ class Firmatag extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Firmatag' => 'basis/firmatag:rw')); // Load model FirmatagModel $this->load->model('ressource/firmatag_model', 'FirmatagModel'); - - + + } /** @@ -35,11 +35,11 @@ class Firmatag extends APIv1_Controller { $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 @@ -63,7 +63,7 @@ class Firmatag extends APIv1_Controller { $result = $this->FirmatagModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -71,9 +71,9 @@ class Firmatag extends APIv1_Controller $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 index c5c2d6fed..2d13ae845 100644 --- a/application/controllers/api/v1/ressource/Firmentyp.php +++ b/application/controllers/api/v1/ressource/Firmentyp.php @@ -21,11 +21,11 @@ class Firmentyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Firmentyp' => 'basis/firmentyp:rw')); // Load model FirmentypModel $this->load->model('ressource/firmentyp_model', 'FirmentypModel'); - - + + } /** @@ -34,11 +34,11 @@ class Firmentyp extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Firmentyp extends APIv1_Controller { $result = $this->FirmentypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Firmentyp extends APIv1_Controller $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 index 191394da8..0ff059d2a 100644 --- a/application/controllers/api/v1/ressource/Funktion.php +++ b/application/controllers/api/v1/ressource/Funktion.php @@ -21,11 +21,11 @@ class Funktion extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Funktion' => 'basis/funktion:rw')); // Load model FunktionModel $this->load->model('ressource/funktion_model', 'FunktionModel'); - - + + } /** @@ -34,11 +34,11 @@ class Funktion extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Funktion extends APIv1_Controller { $result = $this->FunktionModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Funktion extends APIv1_Controller $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 index b28c7eb15..36d0d7a2f 100644 --- a/application/controllers/api/v1/ressource/Lehrmittel.php +++ b/application/controllers/api/v1/ressource/Lehrmittel.php @@ -21,11 +21,11 @@ class Lehrmittel extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Lehrmittel' => 'basis/lehrmittel:rw')); // Load model LehrmittelModel $this->load->model('ressource/lehrmittel_model', 'LehrmittelModel'); - - + + } /** @@ -34,11 +34,11 @@ class Lehrmittel extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Lehrmittel extends APIv1_Controller { $result = $this->LehrmittelModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Lehrmittel extends APIv1_Controller $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 index e550d005b..89ead5681 100644 --- a/application/controllers/api/v1/ressource/Mitarbeiter.php +++ b/application/controllers/api/v1/ressource/Mitarbeiter.php @@ -21,11 +21,11 @@ class Mitarbeiter extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Mitarbeiter' => 'basis/mitarbeiter:rw')); // Load model MitarbeiterModel $this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel'); - - + + } /** @@ -34,11 +34,11 @@ class Mitarbeiter extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Mitarbeiter extends APIv1_Controller { $result = $this->MitarbeiterModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Mitarbeiter extends APIv1_Controller $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 index bdc695ab0..a49bbe2fb 100644 --- a/application/controllers/api/v1/ressource/Ort.php +++ b/application/controllers/api/v1/ressource/Ort.php @@ -21,9 +21,9 @@ class Ort extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Ort' => 'basis/ort:rw', 'All' => 'basis/ort:r')); // Load model OrtModel - $this->load->model("ressource/ort_model", "OrtModel"); + $this->load->model('ressource/ort_model', 'OrtModel'); } /** @@ -32,11 +32,11 @@ class Ort extends APIv1_Controller public function getOrt() { $ort_kurzbz = $this->get("ort_kurzbz"); - + if (isset($ort_kurzbz)) { $result = $this->OrtModel->load(trim($ort_kurzbz)); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -44,7 +44,7 @@ class Ort extends APIv1_Controller $this->response(); } } - + /** * @return void */ @@ -60,7 +60,7 @@ class Ort extends APIv1_Controller { $result = $this->OrtModel->load(); } - + $this->response($result, REST_Controller::HTTP_OK); } @@ -79,7 +79,7 @@ class Ort extends APIv1_Controller { $result = $this->OrtModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -87,9 +87,9 @@ class Ort extends APIv1_Controller $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 index 7452805ee..cbf9c3d9b 100644 --- a/application/controllers/api/v1/ressource/Ortraumtyp.php +++ b/application/controllers/api/v1/ressource/Ortraumtyp.php @@ -21,11 +21,11 @@ class Ortraumtyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Ortraumtyp' => 'basis/ortraumtyp:rw')); // Load model OrtraumtypModel $this->load->model('ressource/ortraumtyp_model', 'OrtraumtypModel'); - - + + } /** @@ -35,11 +35,11 @@ class Ortraumtyp extends APIv1_Controller { $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 @@ -63,7 +63,7 @@ class Ortraumtyp extends APIv1_Controller { $result = $this->OrtraumtypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -71,9 +71,9 @@ class Ortraumtyp extends APIv1_Controller $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 index 7d75b80ce..1c7551984 100644 --- a/application/controllers/api/v1/ressource/Personfunktionstandort.php +++ b/application/controllers/api/v1/ressource/Personfunktionstandort.php @@ -21,11 +21,11 @@ class Personfunktionstandort extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Personfunktionstandort' => 'basis/personfunktionstandort:rw')); // Load model PersonfunktionstandortModel $this->load->model('ressource/personfunktionstandort_model', 'PersonfunktionstandortModel'); - - + + } /** @@ -34,11 +34,11 @@ class Personfunktionstandort extends APIv1_Controller public function getPersonfunktionstandort() { $personfunktionstandortID = $this->get('personfunktionstandort_id'); - + if (isset($personfunktionstandortID)) { $result = $this->PersonfunktionstandortModel->load($personfunktionstandortID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Personfunktionstandort extends APIv1_Controller { $result = $this->PersonfunktionstandortModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Personfunktionstandort extends APIv1_Controller $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 index 10d05e108..71b7bf5d8 100644 --- a/application/controllers/api/v1/ressource/Raumtyp.php +++ b/application/controllers/api/v1/ressource/Raumtyp.php @@ -21,11 +21,11 @@ class Raumtyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Raumtyp' => 'basis/raumtyp:rw')); // Load model RaumtypModel $this->load->model('ressource/raumtyp_model', 'RaumtypModel'); - - + + } /** @@ -34,11 +34,11 @@ class Raumtyp extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Raumtyp extends APIv1_Controller { $result = $this->RaumtypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Raumtyp extends APIv1_Controller $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 index 48370708d..633f61036 100644 --- a/application/controllers/api/v1/ressource/Reservierung.php +++ b/application/controllers/api/v1/ressource/Reservierung.php @@ -21,11 +21,11 @@ class Reservierung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Reservierung' => 'basis/reservierung:rw')); // Load model ReservierungModel $this->load->model('ressource/reservierung_model', 'ReservierungModel'); - - + + } /** @@ -34,11 +34,11 @@ class Reservierung extends APIv1_Controller public function getReservierung() { $reservierungID = $this->get('reservierung_id'); - + if (isset($reservierungID)) { $result = $this->ReservierungModel->load($reservierungID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Reservierung extends APIv1_Controller { $result = $this->ReservierungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Reservierung extends APIv1_Controller $this->response(); } } - + private function _validate($reservierung = 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 index 23711453a..5d2f37049 100644 --- a/application/controllers/api/v1/ressource/Stunde.php +++ b/application/controllers/api/v1/ressource/Stunde.php @@ -21,11 +21,11 @@ class Stunde extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Stunde' => 'basis/stunde:rw')); // Load model StundeModel $this->load->model('ressource/stunde_model', 'StundeModel'); - - + + } /** @@ -34,11 +34,11 @@ class Stunde extends APIv1_Controller public function getStunde() { $stunde = $this->get('stunde'); - + if (isset($stunde)) { $result = $this->StundeModel->load($stunde); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Stunde extends APIv1_Controller { $result = $this->StundeModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Stunde extends APIv1_Controller $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 index 37932cf1f..2d4b3c705 100644 --- a/application/controllers/api/v1/ressource/Stundenplan.php +++ b/application/controllers/api/v1/ressource/Stundenplan.php @@ -21,11 +21,11 @@ class Stundenplan extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Stundenplan' => 'basis/stundenplan:rw')); // Load model StundenplanModel $this->load->model('ressource/stundenplan_model', 'StundenplanModel'); - - + + } /** @@ -34,11 +34,11 @@ class Stundenplan extends APIv1_Controller public function getStundenplan() { $stundenplanID = $this->get('stundenplan_id'); - + if (isset($stundenplanID)) { $result = $this->StundenplanModel->load($stundenplanID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Stundenplan extends APIv1_Controller { $result = $this->StundenplanModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Stundenplan extends APIv1_Controller $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 index 429999321..385f2bf9e 100644 --- a/application/controllers/api/v1/ressource/Stundenplandev.php +++ b/application/controllers/api/v1/ressource/Stundenplandev.php @@ -21,11 +21,11 @@ class Stundenplandev extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Stundenplandev' => 'basis/stundenplandev:rw')); // Load model StundenplandevModel $this->load->model('ressource/stundenplandev_model', 'StundenplandevModel'); - - + + } /** @@ -34,11 +34,11 @@ class Stundenplandev extends APIv1_Controller public function getStundenplandev() { $stundenplandevID = $this->get('stundenplandev_id'); - + if (isset($stundenplandevID)) { $result = $this->StundenplandevModel->load($stundenplandevID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Stundenplandev extends APIv1_Controller { $result = $this->StundenplandevModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Stundenplandev extends APIv1_Controller $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 index 367d7e12e..8c30390e6 100644 --- a/application/controllers/api/v1/ressource/Zeitaufzeichnung.php +++ b/application/controllers/api/v1/ressource/Zeitaufzeichnung.php @@ -21,11 +21,11 @@ class Zeitaufzeichnung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Zeitaufzeichnung' => 'basis/zeitaufzeichnung:rw')); // Load model ZeitaufzeichnungModel $this->load->model('ressource/zeitaufzeichnung_model', 'ZeitaufzeichnungModel'); - - + + } /** @@ -34,11 +34,11 @@ class Zeitaufzeichnung extends APIv1_Controller public function getZeitaufzeichnung() { $zeitaufzeichnungID = $this->get('zeitaufzeichnung_id'); - + if (isset($zeitaufzeichnungID)) { $result = $this->ZeitaufzeichnungModel->load($zeitaufzeichnungID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Zeitaufzeichnung extends APIv1_Controller { $result = $this->ZeitaufzeichnungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Zeitaufzeichnung extends APIv1_Controller $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 index f65b3ad7c..e180d0d75 100644 --- a/application/controllers/api/v1/ressource/Zeitfenster.php +++ b/application/controllers/api/v1/ressource/Zeitfenster.php @@ -21,11 +21,11 @@ class Zeitfenster extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Zeitfenster' => 'basis/zeitfenster:rw')); // Load model ZeitfensterModel $this->load->model('ressource/zeitfenster_model', 'ZeitfensterModel'); - - + + } /** @@ -37,11 +37,11 @@ class Zeitfenster extends APIv1_Controller $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 @@ -65,14 +65,14 @@ class Zeitfenster extends APIv1_Controller $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 @@ -80,9 +80,9 @@ class Zeitfenster extends APIv1_Controller $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 index c0d9c0cbc..626a88d79 100644 --- a/application/controllers/api/v1/ressource/Zeitsperre.php +++ b/application/controllers/api/v1/ressource/Zeitsperre.php @@ -21,11 +21,11 @@ class Zeitsperre extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Zeitsperre' => 'basis/zeitsperre:rw')); // Load model ZeitsperreModel $this->load->model('ressource/zeitsperre_model', 'ZeitsperreModel'); - - + + } /** @@ -34,11 +34,11 @@ class Zeitsperre extends APIv1_Controller public function getZeitsperre() { $zeitsperreID = $this->get('zeitsperre_id'); - + if (isset($zeitsperreID)) { $result = $this->ZeitsperreModel->load($zeitsperreID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Zeitsperre extends APIv1_Controller { $result = $this->ZeitsperreModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Zeitsperre extends APIv1_Controller $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 index b131f81e7..c70a9b2f4 100644 --- a/application/controllers/api/v1/ressource/Zeitsperretyp.php +++ b/application/controllers/api/v1/ressource/Zeitsperretyp.php @@ -21,11 +21,11 @@ class Zeitsperretyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Zeitsperretyp' => 'basis/zeitsperretyp:rw')); // Load model ZeitsperretypModel $this->load->model('ressource/zeitsperretyp_model', 'ZeitsperretypModel'); - - + + } /** @@ -34,11 +34,11 @@ class Zeitsperretyp extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Zeitsperretyp extends APIv1_Controller { $result = $this->ZeitsperretypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Zeitsperretyp extends APIv1_Controller $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 index ed479ff86..8d9646edc 100644 --- a/application/controllers/api/v1/ressource/Zeitwunsch.php +++ b/application/controllers/api/v1/ressource/Zeitwunsch.php @@ -21,11 +21,11 @@ class Zeitwunsch extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Zeitwunsch' => 'basis/zeitwunsch:rw')); // Load model ZeitwunschModel $this->load->model('ressource/zeitwunsch_model', 'ZeitwunschModel'); - - + + } /** @@ -36,11 +36,11 @@ class Zeitwunsch extends APIv1_Controller $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 @@ -62,14 +62,14 @@ class Zeitwunsch extends APIv1_Controller $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 @@ -77,9 +77,9 @@ class Zeitwunsch extends APIv1_Controller $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 index 6c71a8825..3395ec9b6 100644 --- a/application/controllers/api/v1/system/Appdaten.php +++ b/application/controllers/api/v1/system/Appdaten.php @@ -21,7 +21,7 @@ class Appdaten extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Appdaten' => 'system/appdaten:rw')); // Load model AppdatenModel $this->load->model('system/Appdaten_model', 'AppdatenModel'); } @@ -32,11 +32,11 @@ class Appdaten extends APIv1_Controller public function getAppdaten() { $appdatenID = $this->get('appdaten_id'); - + if (isset($appdatenID)) { $result = $this->AppdatenModel->load($appdatenID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -60,7 +60,7 @@ class Appdaten extends APIv1_Controller { $result = $this->AppdatenModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -68,9 +68,9 @@ class Appdaten extends APIv1_Controller $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 index b34551746..99ec3d79e 100644 --- a/application/controllers/api/v1/system/Benutzerrolle.php +++ b/application/controllers/api/v1/system/Benutzerrolle.php @@ -21,11 +21,11 @@ class Benutzerrolle extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Benutzerrolle' => 'basis/benutzerrolle:rw')); // Load model BenutzerrolleModel $this->load->model('system/benutzerrolle_model', 'BenutzerrolleModel'); - - + + } /** @@ -34,11 +34,11 @@ class Benutzerrolle extends APIv1_Controller public function getBenutzerrolle() { $benutzerrolleID = $this->get('benutzerrolle_id'); - + if (isset($benutzerrolleID)) { $result = $this->BenutzerrolleModel->load($benutzerrolleID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Benutzerrolle extends APIv1_Controller { $result = $this->BenutzerrolleModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Benutzerrolle extends APIv1_Controller $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 index 52f9cde59..e94bf30f3 100644 --- a/application/controllers/api/v1/system/Berechtigung.php +++ b/application/controllers/api/v1/system/Berechtigung.php @@ -21,11 +21,11 @@ class Berechtigung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Berechtigung' => 'basis/berechtigung:rw')); // Load model BerechtigungModel $this->load->model('system/berechtigung_model', 'BerechtigungModel'); - - + + } /** @@ -34,11 +34,11 @@ class Berechtigung extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Berechtigung extends APIv1_Controller { $result = $this->BerechtigungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Berechtigung extends APIv1_Controller $this->response(); } } - + private function _validate($berechtigung = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/system/CallerLibrary.php b/application/controllers/api/v1/system/CallerLibrary.php index 42f2e785e..594786384 100644 --- a/application/controllers/api/v1/system/CallerLibrary.php +++ b/application/controllers/api/v1/system/CallerLibrary.php @@ -21,8 +21,8 @@ class CallerLibrary extends APIv1_Controller */ public function __construct() { - parent::__construct(); - + parent::__construct(array('Call' => 'admin:rw')); + // Loads the CallerLib $this->load->library('CallerLib'); } @@ -33,7 +33,7 @@ class CallerLibrary extends APIv1_Controller public function getCall() { // Start me up! - $result = $this->callerlib->callLibrary($this->get(), PermissionLib::SELECT_RIGHT); + $result = $this->callerlib->callLibrary($this->get()); // Print the result $this->response($result, REST_Controller::HTTP_OK); @@ -45,33 +45,33 @@ class CallerLibrary extends APIv1_Controller public function postCall() { // Start me up! - $result = $this->callerlib->callLibrary($this->post(), PermissionLib::UPDATE_RIGHT); + $result = $this->callerlib->callLibrary($this->post()); // Print the result $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ public function putCall() { // Start me up! - $result = $this->callerlib->callLibrary($this->put(), PermissionLib::INSERT_RIGHT); + $result = $this->callerlib->callLibrary($this->put()); // Print the result $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ public function deleteCall() { // Start me up! - $result = $this->callerlib->callLibrary($this->delete(), PermissionLib::DELETE_RIGHT); + $result = $this->callerlib->callLibrary($this->delete()); // Print the result $this->response($result, REST_Controller::HTTP_OK); } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/system/CallerModel.php b/application/controllers/api/v1/system/CallerModel.php index 9c3ee8815..68296aff8 100644 --- a/application/controllers/api/v1/system/CallerModel.php +++ b/application/controllers/api/v1/system/CallerModel.php @@ -21,8 +21,8 @@ class CallerModel extends APIv1_Controller */ public function __construct() { - parent::__construct(); - + parent::__construct(array('Call' => 'admin:rw')); + // Loads the CallerLib $this->load->library('CallerLib'); } @@ -33,7 +33,7 @@ class CallerModel extends APIv1_Controller public function getCall() { // Start me up! - $result = $this->callerlib->callModel($this->get(), PermissionLib::SELECT_RIGHT); + $result = $this->callerlib->callModel($this->get()); // Print the result $this->response($result, REST_Controller::HTTP_OK); @@ -45,33 +45,33 @@ class CallerModel extends APIv1_Controller public function postCall() { // Start me up! - $result = $this->callerlib->callModel($this->post(), PermissionLib::UPDATE_RIGHT); + $result = $this->callerlib->callModel($this->post()); // Print the result $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ public function putCall() { // Start me up! - $result = $this->callerlib->callModel($this->put(), PermissionLib::INSERT_RIGHT); + $result = $this->callerlib->callModel($this->put()); // Print the result $this->response($result, REST_Controller::HTTP_OK); } - + /** * @return void */ public function deleteCall() { // Start me up! - $result = $this->callerlib->callModel($this->delete(), PermissionLib::DELETE_RIGHT); + $result = $this->callerlib->callModel($this->delete()); // Print the result $this->response($result, REST_Controller::HTTP_OK); } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/system/Cronjob.php b/application/controllers/api/v1/system/Cronjob.php index 3f625389a..4b3bcba82 100644 --- a/application/controllers/api/v1/system/Cronjob.php +++ b/application/controllers/api/v1/system/Cronjob.php @@ -21,11 +21,11 @@ class Cronjob extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Cronjob' => 'basis/cronjob:rw')); // Load model CronjobModel $this->load->model('system/cronjob_model', 'CronjobModel'); - - + + } /** @@ -34,11 +34,11 @@ class Cronjob extends APIv1_Controller public function getCronjob() { $cronjobID = $this->get('cronjob_id'); - + if (isset($cronjobID)) { $result = $this->CronjobModel->load($cronjobID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Cronjob extends APIv1_Controller { $result = $this->CronjobModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Cronjob extends APIv1_Controller $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 index b6e3027bd..bc217d385 100644 --- a/application/controllers/api/v1/system/Filter.php +++ b/application/controllers/api/v1/system/Filter.php @@ -21,11 +21,11 @@ class Filter extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Filter' => 'basis/filter:rw')); // Load model FilterModel $this->load->model('system/filter_model', 'FilterModel'); - - + + } /** @@ -34,11 +34,11 @@ class Filter extends APIv1_Controller public function getFilter() { $filterID = $this->get('filter_id'); - + if (isset($filterID)) { $result = $this->FilterModel->load($filterID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Filter extends APIv1_Controller { $result = $this->FilterModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Filter extends APIv1_Controller $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 index 653731f02..c270922c5 100644 --- a/application/controllers/api/v1/system/Log.php +++ b/application/controllers/api/v1/system/Log.php @@ -21,11 +21,11 @@ class Log extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Log' => 'basis/log:rw')); // Load model LogModel $this->load->model('system/log_model', 'LogModel'); - - + + } /** @@ -34,11 +34,11 @@ class Log extends APIv1_Controller public function getLog() { $logID = $this->get('log_id'); - + if (isset($logID)) { $result = $this->LogModel->load($logID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Log extends APIv1_Controller { $result = $this->LogModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Log extends APIv1_Controller $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 index 0f3f79855..be87526ed 100644 --- a/application/controllers/api/v1/system/Message.php +++ b/application/controllers/api/v1/system/Message.php @@ -21,7 +21,18 @@ class Message extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'MessagesByPersonID' => 'basis/message:r', + 'MessagesByUID' => 'basis/message:r', + 'MessagesByToken' => 'basis/message:r', + 'SentMessagesByPerson' => 'basis/message:r', + 'CountUnreadMessages' => 'basis/message:r', + 'Message' => 'basis/message:w', + 'MessageVorlage' => 'basis/message:w', + 'ChangeStatus' => 'basis/message:w' + ) + ); // Load library MessageLib $this->load->library('MessageLib'); } diff --git a/application/controllers/api/v1/system/Phrase.php b/application/controllers/api/v1/system/Phrase.php index 457f75521..1a7846cb5 100644 --- a/application/controllers/api/v1/system/Phrase.php +++ b/application/controllers/api/v1/system/Phrase.php @@ -21,9 +21,8 @@ class Phrase extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Phrase' => 'system/phrase:rw', 'Phrases' => 'system/phrase:r')); - // Loads the phrases library $this->load->library('PhrasesLib'); } diff --git a/application/controllers/api/v1/system/Rolle.php b/application/controllers/api/v1/system/Rolle.php index 9bf3a229e..ba257145f 100644 --- a/application/controllers/api/v1/system/Rolle.php +++ b/application/controllers/api/v1/system/Rolle.php @@ -21,11 +21,11 @@ class Rolle extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Rolle' => 'basis/rolle:rw')); // Load model RolleModel $this->load->model('system/rolle_model', 'RolleModel'); - - + + } /** @@ -34,11 +34,11 @@ class Rolle extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Rolle extends APIv1_Controller { $result = $this->RolleModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Rolle extends APIv1_Controller $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 index f4c0b11a5..3838dc6de 100644 --- a/application/controllers/api/v1/system/Rolleberechtigung.php +++ b/application/controllers/api/v1/system/Rolleberechtigung.php @@ -21,11 +21,11 @@ class Rolleberechtigung extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Rolleberechtigung' => 'basis/rolleberechtigung:rw')); // Load model RolleberechtigungModel $this->load->model('system/rolleberechtigung_model', 'RolleberechtigungModel'); - - + + } /** @@ -35,11 +35,11 @@ class Rolleberechtigung extends APIv1_Controller { $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 @@ -63,7 +63,7 @@ class Rolleberechtigung extends APIv1_Controller { $result = $this->RolleberechtigungModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -71,9 +71,9 @@ class Rolleberechtigung extends APIv1_Controller $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 index 8bd2bffa1..0f3c76655 100644 --- a/application/controllers/api/v1/system/Server.php +++ b/application/controllers/api/v1/system/Server.php @@ -21,11 +21,11 @@ class Server extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Server' => 'basis/server:rw')); // Load model ServerModel $this->load->model('system/server_model', 'ServerModel'); - - + + } /** @@ -34,11 +34,11 @@ class Server extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Server extends APIv1_Controller { $result = $this->ServerModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Server extends APIv1_Controller $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 index 86304fc70..3a3b7e6de 100644 --- a/application/controllers/api/v1/system/Sprache2.php +++ b/application/controllers/api/v1/system/Sprache2.php @@ -21,11 +21,11 @@ class Sprache2 extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Sprache' => 'basis/sprache:rw')); // Load model SpracheModel $this->load->model('system/sprache_model', 'SpracheModel'); - - + + } /** @@ -34,9 +34,9 @@ class Sprache2 extends APIv1_Controller public function getSprache() { $sprache = $this->get('sprache'); - + $result = $this->SpracheModel->load($sprache); - + $this->response($result, REST_Controller::HTTP_OK); } @@ -55,7 +55,7 @@ class Sprache2 extends APIv1_Controller { $result = $this->SpracheModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -63,7 +63,7 @@ class Sprache2 extends APIv1_Controller $this->response(); } } - + private function _validate($sprache = NULL) { return true; diff --git a/application/controllers/api/v1/system/Tag.php b/application/controllers/api/v1/system/Tag.php index 12ce7b3ac..2bcb2dec2 100644 --- a/application/controllers/api/v1/system/Tag.php +++ b/application/controllers/api/v1/system/Tag.php @@ -21,11 +21,11 @@ class Tag extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Tag' => 'basis/tag:rw')); // Load model TagModel $this->load->model('system/tag_model', 'TagModel'); - - + + } /** @@ -34,11 +34,11 @@ class Tag extends APIv1_Controller public function getTag() { $tag = $this->get('tag'); - + if (isset($tag)) { $result = $this->TagModel->load($tag); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Tag extends APIv1_Controller { $result = $this->TagModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Tag extends APIv1_Controller $this->response(); } } - + private function _validate($tag = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/system/UDF.php b/application/controllers/api/v1/system/UDF.php index 252332cce..57d22600c 100644 --- a/application/controllers/api/v1/system/UDF.php +++ b/application/controllers/api/v1/system/UDF.php @@ -21,8 +21,8 @@ class UDF extends APIv1_Controller */ public function __construct() { - parent::__construct(); - + parent::__construct(array('UDF' => 'system/udf:rw')); + // Load model UDF_model $this->load->model('system/UDF_model', 'UDFModel'); } @@ -35,9 +35,9 @@ class UDF extends APIv1_Controller $decode = $this->get('decode'); $schema = $this->get('schema'); $table = $this->get('table'); - + $result = error(); - + if (isset($schema) || isset($table)) { $result = $this->UDFModel->loadWhere( @@ -51,23 +51,23 @@ class UDF extends APIv1_Controller { $result = $this->UDFModel->load(); } - + if ($decode) { $this->_jsonDecodeResult($result); } - + $this->response($result, REST_Controller::HTTP_OK); } - + /** - * + * */ public function postUDF() { $udfs = $this->post(); $validation = $this->_validate($udfs); - + if (isSuccess($validation)) { $caller = null; @@ -76,9 +76,9 @@ class UDF extends APIv1_Controller $caller = $udfs['caller']; unset($udfs['caller']); } - + $result = $this->UDFModel->saveUDFs($udfs); - + if ($caller != null) { $res = 'ERR'; @@ -86,7 +86,7 @@ class UDF extends APIv1_Controller { $res = 'OK'; } - + redirect($caller.'&res='.$res); } else @@ -99,23 +99,23 @@ class UDF extends APIv1_Controller $this->response($validation, REST_Controller::HTTP_OK); } } - + /** - * + * */ private function _validate($udfs) { $validation = error('person_id or prestudent_id is missing'); - + if((isset($udfs['person_id']) && !(is_null($udfs['person_id'])) && ($udfs['person_id'] != '')) || (isset($udfs['prestudent_id']) && !(is_null($udfs['prestudent_id'])) && ($udfs['prestudent_id'] != ''))) { $validation = success(true); } - + return $validation; } - + /** * Decode to json the column jsons for every result set */ @@ -130,4 +130,4 @@ class UDF extends APIv1_Controller } } } -} \ No newline at end of file +} diff --git a/application/controllers/api/v1/system/Variable.php b/application/controllers/api/v1/system/Variable.php index d97fefdf7..8a4e196dc 100644 --- a/application/controllers/api/v1/system/Variable.php +++ b/application/controllers/api/v1/system/Variable.php @@ -21,11 +21,11 @@ class Variable extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Variable' => 'basis/variable:rw')); // Load model VariableModel $this->load->model('system/variable_model', 'VariableModel'); - - + + } /** @@ -35,11 +35,11 @@ class Variable extends APIv1_Controller { $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 @@ -63,7 +63,7 @@ class Variable extends APIv1_Controller { $result = $this->VariableModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -71,9 +71,9 @@ class Variable extends APIv1_Controller $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 index 304471971..48a73ac4f 100644 --- a/application/controllers/api/v1/system/Vorlage.php +++ b/application/controllers/api/v1/system/Vorlage.php @@ -21,11 +21,11 @@ class Vorlage extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Vorlage' => 'system/vorlage:rw')); // Load model VorlageModel $this->load->model('system/vorlage_model', 'VorlageModel'); - - + + } /** @@ -34,11 +34,11 @@ class Vorlage extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Vorlage extends APIv1_Controller { $result = $this->VorlageModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Vorlage extends APIv1_Controller $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 index efa8963d1..dbbe23e1e 100644 --- a/application/controllers/api/v1/system/Vorlagestudiengang.php +++ b/application/controllers/api/v1/system/Vorlagestudiengang.php @@ -21,11 +21,11 @@ class Vorlagestudiengang extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Vorlagestudiengang' => 'system/vorlagestudiengang:rw')); // Load model VorlagestudiengangModel $this->load->model('system/vorlagestudiengang_model', 'VorlagestudiengangModel'); - - + + } /** @@ -34,11 +34,11 @@ class Vorlagestudiengang extends APIv1_Controller public function getVorlagestudiengang() { $vorlagestudiengangID = $this->get('vorlagestudiengang_id'); - + if (isset($vorlagestudiengangID)) { $result = $this->VorlagestudiengangModel->load($vorlagestudiengangID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Vorlagestudiengang extends APIv1_Controller { $result = $this->VorlagestudiengangModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Vorlagestudiengang extends APIv1_Controller $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 index d9e2597c4..ece2e2ff6 100644 --- a/application/controllers/api/v1/system/Webservicelog.php +++ b/application/controllers/api/v1/system/Webservicelog.php @@ -21,11 +21,11 @@ class Webservicelog extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Webservicelog' => 'basis/webservicelog:rw')); // Load model WebservicelogModel $this->load->model('system/webservicelog_model', 'WebservicelogModel'); - - + + } /** @@ -34,11 +34,11 @@ class Webservicelog extends APIv1_Controller public function getWebservicelog() { $webservicelogID = $this->get('webservicelog_id'); - + if (isset($webservicelogID)) { $result = $this->WebservicelogModel->load($webservicelogID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Webservicelog extends APIv1_Controller { $result = $this->WebservicelogModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Webservicelog extends APIv1_Controller $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 index 7e1adcc58..4f281edaa 100644 --- a/application/controllers/api/v1/system/Webservicerecht.php +++ b/application/controllers/api/v1/system/Webservicerecht.php @@ -21,11 +21,11 @@ class Webservicerecht extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Webservicerecht' => 'basis/webservicerecht:rw')); // Load model WebservicerechtModel $this->load->model('system/webservicerecht_model', 'WebservicerechtModel'); - - + + } /** @@ -34,11 +34,11 @@ class Webservicerecht extends APIv1_Controller public function getWebservicerecht() { $webservicerechtID = $this->get('webservicerecht_id'); - + if (isset($webservicerechtID)) { $result = $this->WebservicerechtModel->load($webservicerechtID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Webservicerecht extends APIv1_Controller { $result = $this->WebservicerechtModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Webservicerecht extends APIv1_Controller $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 index 60c2d5b7c..09303c87c 100644 --- a/application/controllers/api/v1/system/Webservicetyp.php +++ b/application/controllers/api/v1/system/Webservicetyp.php @@ -21,11 +21,11 @@ class Webservicetyp extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Webservicetyp' => 'basis/webservicetyp:rw')); // Load model WebservicetypModel $this->load->model('system/webservicetyp_model', 'WebservicetypModel'); - - + + } /** @@ -34,11 +34,11 @@ class Webservicetyp extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Webservicetyp extends APIv1_Controller { $result = $this->WebservicetypModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Webservicetyp extends APIv1_Controller $this->response(); } } - + private function _validate($webservicetyp = 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 index 1ce2d8fef..f2e7d9d63 100644 --- a/application/controllers/api/v1/testtool/Ablauf.php +++ b/application/controllers/api/v1/testtool/Ablauf.php @@ -21,11 +21,11 @@ class Ablauf extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Ablauf' => 'basis/ablauf:rw')); // Load model AblaufModel $this->load->model('testtool/ablauf_model', 'AblaufModel'); - - + + } /** @@ -34,11 +34,11 @@ class Ablauf extends APIv1_Controller public function getAblauf() { $ablaufID = $this->get('ablauf_id'); - + if (isset($ablaufID)) { $result = $this->AblaufModel->load($ablaufID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Ablauf extends APIv1_Controller { $result = $this->AblaufModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Ablauf extends APIv1_Controller $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 index 7ae8e5293..7730dd3e9 100644 --- a/application/controllers/api/v1/testtool/Antwort.php +++ b/application/controllers/api/v1/testtool/Antwort.php @@ -21,11 +21,11 @@ class Antwort extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Antwort' => 'basis/antwort:rw')); // Load model AntwortModel $this->load->model('testtool/antwort_model', 'AntwortModel'); - - + + } /** @@ -34,11 +34,11 @@ class Antwort extends APIv1_Controller public function getAntwort() { $antwortID = $this->get('antwort_id'); - + if (isset($antwortID)) { $result = $this->AntwortModel->load($antwortID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Antwort extends APIv1_Controller { $result = $this->AntwortModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Antwort extends APIv1_Controller $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 index ec27b2435..83989956a 100644 --- a/application/controllers/api/v1/testtool/Frage.php +++ b/application/controllers/api/v1/testtool/Frage.php @@ -21,11 +21,11 @@ class Frage extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Frage' => 'basis/frage:rw')); // Load model FrageModel $this->load->model('testtool/frage_model', 'FrageModel'); - - + + } /** @@ -34,11 +34,11 @@ class Frage extends APIv1_Controller public function getFrage() { $frageID = $this->get('frage_id'); - + if (isset($frageID)) { $result = $this->FrageModel->load($frageID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Frage extends APIv1_Controller { $result = $this->FrageModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Frage extends APIv1_Controller $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 index 2814f14a2..12cba24ab 100644 --- a/application/controllers/api/v1/testtool/Gebiet.php +++ b/application/controllers/api/v1/testtool/Gebiet.php @@ -21,11 +21,11 @@ class Gebiet extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Gebiet' => 'basis/gebiet:rw')); // Load model GebietModel $this->load->model('testtool/gebiet_model', 'GebietModel'); - - + + } /** @@ -34,11 +34,11 @@ class Gebiet extends APIv1_Controller public function getGebiet() { $gebietID = $this->get('gebiet_id'); - + if (isset($gebietID)) { $result = $this->GebietModel->load($gebietID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Gebiet extends APIv1_Controller { $result = $this->GebietModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Gebiet extends APIv1_Controller $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 index 0cd5075e5..5058ac76d 100644 --- a/application/controllers/api/v1/testtool/Kategorie.php +++ b/application/controllers/api/v1/testtool/Kategorie.php @@ -21,11 +21,11 @@ class Kategorie extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Kategorie' => 'basis/kategorie:rw')); // Load model KategorieModel $this->load->model('testtool/kategorie_model', 'KategorieModel'); - - + + } /** @@ -34,11 +34,11 @@ class Kategorie extends APIv1_Controller 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 @@ -62,7 +62,7 @@ class Kategorie extends APIv1_Controller { $result = $this->KategorieModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Kategorie extends APIv1_Controller $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 index acb546790..2420dcb62 100644 --- a/application/controllers/api/v1/testtool/Kriterien.php +++ b/application/controllers/api/v1/testtool/Kriterien.php @@ -21,11 +21,11 @@ class Kriterien extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Kriterien' => 'basis/kriterien:rw')); // Load model KriterienModel $this->load->model('testtool/kriterien_model', 'KriterienModel'); - - + + } /** @@ -34,11 +34,11 @@ class Kriterien extends APIv1_Controller public function getKriterien() { $kriterienID = $this->get('kriterien_id'); - + if (isset($kriterienID)) { $result = $this->KriterienModel->load($kriterienID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Kriterien extends APIv1_Controller { $result = $this->KriterienModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Kriterien extends APIv1_Controller $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 index 65671120f..3a471035e 100644 --- a/application/controllers/api/v1/testtool/Pruefling.php +++ b/application/controllers/api/v1/testtool/Pruefling.php @@ -21,11 +21,11 @@ class Pruefling extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Pruefling' => 'basis/pruefling:rw')); // Load model PrueflingModel $this->load->model('testtool/pruefling_model', 'PrueflingModel'); - - + + } /** @@ -34,11 +34,11 @@ class Pruefling extends APIv1_Controller public function getPruefling() { $prueflingID = $this->get('pruefling_id'); - + if (isset($prueflingID)) { $result = $this->PrueflingModel->load($prueflingID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Pruefling extends APIv1_Controller { $result = $this->PrueflingModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Pruefling extends APIv1_Controller $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 index 0f7f0b76c..0874b384a 100644 --- a/application/controllers/api/v1/testtool/Vorschlag.php +++ b/application/controllers/api/v1/testtool/Vorschlag.php @@ -21,11 +21,11 @@ class Vorschlag extends APIv1_Controller */ public function __construct() { - parent::__construct(); + parent::__construct(array('Vorschlag' => 'basis/vorschlag:rw')); // Load model VorschlagModel $this->load->model('testtool/vorschlag_model', 'VorschlagModel'); - - + + } /** @@ -34,11 +34,11 @@ class Vorschlag extends APIv1_Controller public function getVorschlag() { $vorschlagID = $this->get('vorschlag_id'); - + if (isset($vorschlagID)) { $result = $this->VorschlagModel->load($vorschlagID); - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -62,7 +62,7 @@ class Vorschlag extends APIv1_Controller { $result = $this->VorschlagModel->insert($this->post()); } - + $this->response($result, REST_Controller::HTTP_OK); } else @@ -70,9 +70,9 @@ class Vorschlag extends APIv1_Controller $this->response(); } } - + private function _validate($vorschlag = NULL) { return true; } -} \ No newline at end of file +} diff --git a/application/controllers/crm/Statusgrund.php b/application/controllers/crm/Statusgrund.php index c751d24d4..472270ef3 100644 --- a/application/controllers/crm/Statusgrund.php +++ b/application/controllers/crm/Statusgrund.php @@ -2,14 +2,27 @@ if (! defined("BASEPATH")) exit("No direct script access allowed"); -class Statusgrund extends VileSci_Controller +class Statusgrund extends Auth_Controller { public function __construct() { - parent::__construct(); - $this->load->model("crm/Status_model", "StatusModel"); - $this->load->model("crm/Statusgrund_model", "StatusgrundModel"); - $this->load->model("system/Sprache_model", "SpracheModel"); + parent::__construct( + array( + 'index' => 'basis/status:r', + 'listStatus' => 'basis/status:r', + 'listGrund' => 'basis/status:r', + 'editGrund' => 'basis/status:rw', + 'editStatus' => 'basis/status:rw', + 'newGrund' => 'basis/status:rw', + 'saveGrund' => 'basis/status:rw', + 'insGrund' => 'basis/status:rw', + 'saveStatus' => 'basis/status:rw' + ) + ); + + $this->load->model('crm/Status_model', 'StatusModel'); + $this->load->model('crm/Statusgrund_model', 'StatusgrundModel'); + $this->load->model('system/Sprache_model', 'SpracheModel'); } public function index() diff --git a/application/controllers/jobs/AmpelMail.php b/application/controllers/jobs/AmpelMail.php index 66938d822..b88c5536b 100644 --- a/application/controllers/jobs/AmpelMail.php +++ b/application/controllers/jobs/AmpelMail.php @@ -44,7 +44,7 @@ class AmpelMail extends FHC_Controller $this->load->model('person/Person_model', 'PersonModel'); // Load helpers - $this->load->helper('sancho'); + $this->load->helper('fhc_sancho'); } /** @@ -84,6 +84,8 @@ class AmpelMail extends FHC_Controller // Loop through ampeln foreach ($ampel_arr as $ampel) { + echo "Checking Ampel: ".$ampel->kurzbz; + $ampel_id = $ampel->ampel_id; $now = date_create(date('Y-m-d')); $deadline = date_create($ampel->deadline); @@ -105,7 +107,8 @@ class AmpelMail extends FHC_Controller $uid = $ampel_user->uid; // break if ampel was almost confirmed by the user - if($this->AmpelModel->isConfirmed($ampel_id, $uid)) break; + if($this->AmpelModel->isConfirmed($ampel_id, $uid)) + continue; // check if ampel is new (inserted within last week, as cronjob will run every week) if ($now->diff($insert_date)->days <= 7) $new = true; @@ -156,7 +159,8 @@ class AmpelMail extends FHC_Controller // Send mails for new ampeln merged by user foreach ($new_ampel_data_arr as $new_ampel_data) { - sendMail( + echo "\nSend New Ampel Mail to ".$new_ampel_data['uid']; + sendSanchoMail( 'Sancho_Content_AmpelNeu', $new_ampel_data, $new_ampel_data['uid']. '@'. DOMAIN, @@ -167,7 +171,8 @@ class AmpelMail extends FHC_Controller // Send mails for overdue ampeln merged by user foreach ($overdue_ampel_data_arr as $overdue_ampel_data) { - sendMail( + echo "\nSend Ampel Ueberfaellig Mail to ".$overdue_ampel_data['uid']; + sendSanchoMail( 'Sancho_Content_AmpelUeberfaellig', $overdue_ampel_data, $overdue_ampel_data['uid']. '@'. DOMAIN, diff --git a/application/controllers/jobs/Prestudentstatus.php b/application/controllers/jobs/Prestudentstatus.php index 1cd659e79..dc5c08512 100644 --- a/application/controllers/jobs/Prestudentstatus.php +++ b/application/controllers/jobs/Prestudentstatus.php @@ -8,7 +8,7 @@ if (! defined('BASEPATH')) * */ -class Prestudentstatus extends FHC_Controller +class Prestudentstatus extends Auth_Controller { /** * Initialize Prestudentstatus Class @@ -17,7 +17,8 @@ class Prestudentstatus extends FHC_Controller */ public function __construct() { - parent::__construct(); + // An empty array as parameter will ensure that this controller is ONLY callable from command line + parent::__construct(array()); if ($this->input->is_cli_request()) { diff --git a/application/controllers/organisation/Studiengang2.php b/application/controllers/organisation/Studiengang2.php deleted file mode 100644 index 600a1d17b..000000000 --- a/application/controllers/organisation/Studiengang2.php +++ /dev/null @@ -1,167 +0,0 @@ -load->model('organisation/studiengang_model'); - $this->load->library('form_validation'); - } - - public function index() - { - $keyword = ''; - $this->load->library('pagination'); - - $config['base_url'] = base_url() . 'studiengang/index/'; - $config['total_rows'] = $this->studiengang_model->total_rows(); - $config['per_page'] = 10; - $config['uri_segment'] = 3; - $config['suffix'] = '.html'; - $config['first_url'] = base_url() . 'studiengang.html'; - $this->pagination->initialize($config); - - $start = $this->uri->segment(3, 0); - $studiengang = $this->studiengang_model->index_limit($config['per_page'], $start); - - $data = array( - 'studiengang_data' => $studiengang, - 'keyword' => $keyword, - 'pagination' => $this->pagination->create_links(), - 'total_rows' => $config['total_rows'], - 'start' => $start, - ); - - $this->load->view('tbl_studiengang_list', $data); - } - - public function search() - { - $keyword = $this->uri->segment(3, $this->input->post('keyword', TRUE)); - $this->load->library('pagination'); - - if ($this->uri->segment(2)=='search') { - $config['base_url'] = base_url() . 'studiengang/search/' . $keyword; - } else { - $config['base_url'] = base_url() . 'studiengang/index/'; - } - - $config['total_rows'] = $this->studiengang_model->search_total_rows($keyword); - $config['per_page'] = 10; - $config['uri_segment'] = 4; - $config['suffix'] = '.html'; - $config['first_url'] = base_url() . 'studiengang/search/'.$keyword.'.html'; - $this->pagination->initialize($config); - - $start = $this->uri->segment(4, 0); - $studiengang = $this->studiengang_model->search_index_limit($config['per_page'], $start, $keyword); - - $data = array( - 'studiengang_data' => $studiengang, - 'keyword' => $keyword, - 'pagination' => $this->pagination->create_links(), - 'total_rows' => $config['total_rows'], - 'start' => $start, - ); - $this->load->view('tbl_studiengang_list', $data); - } - - public function read($id) - { - $row = $this->studiengang_model->get_by_id($id); - if ($row) { - $data = array( - ); - $this->load->view('tbl_studiengang_read', $data); - } else { - $this->session->set_flashdata('message', 'Record Not Found'); - redirect(site_url('studiengang')); - } - } - - public function create() - { - $data = array( - 'button' => 'Create', - 'action' => site_url('studiengang/create_action'), - ); - $this->load->view('tbl_studiengang_form', $data); - } - - public function create_action() - { - $this->_rules(); - - if ($this->form_validation->run() == FALSE) { - $this->create(); - } else { - $data = array( - ); - - $this->studiengang_model->insert($data); - $this->session->set_flashdata('message', 'Create Record Success'); - redirect(site_url('studiengang')); - } - } - - public function update($id) - { - $row = $this->studiengang_model->get_by_id($id); - - if ($row) { - $data = array( - 'button' => 'Update', - 'action' => site_url('studiengang/update_action'), - ); - $this->load->view('tbl_studiengang_form', $data); - } else { - $this->session->set_flashdata('message', 'Record Not Found'); - redirect(site_url('studiengang')); - } - } - - public function update_action() - { - $this->_rules(); - - if ($this->form_validation->run() == FALSE) { - $this->update($this->input->post('', TRUE)); - } else { - $data = array( - ); - - $this->studiengang_model->update($this->input->post('', TRUE), $data); - $this->session->set_flashdata('message', 'Update Record Success'); - redirect(site_url('studiengang')); - } - } - - public function delete($id) - { - $row = $this->studiengang_model->get_by_id($id); - - if ($row) { - $this->studiengang_model->delete($id); - $this->session->set_flashdata('message', 'Delete Record Success'); - redirect(site_url('studiengang')); - } else { - $this->session->set_flashdata('message', 'Record Not Found'); - redirect(site_url('studiengang')); - } - } - - public function _rules() - { - - $this->form_validation->set_rules('', '', 'trim'); - $this->form_validation->set_error_delimiters('', ''); - } - -}; - -/* End of file Studiengang.php */ -/* Location: ./application/controllers/Studiengang.php */ diff --git a/application/controllers/organisation/Studienjahr.php b/application/controllers/organisation/Studienjahr.php index 8c98a4c8b..c3c841df9 100644 --- a/application/controllers/organisation/Studienjahr.php +++ b/application/controllers/organisation/Studienjahr.php @@ -5,7 +5,7 @@ if (!defined("BASEPATH")) exit("No direct script access allowed"); /** * Studienjahr controller for listing, editing and removing a Studienjahr */ -class Studienjahr extends VileSci_Controller +class Studienjahr extends Auth_Controller { /** @@ -14,8 +14,18 @@ class Studienjahr extends VileSci_Controller */ public function __construct() { - parent::__construct(); - $this->load->model("organisation/Studienjahr_model", "StudienjahrModel"); + parent::__construct( + array( + 'listStudienjahr' => 'basis/studiensemester:r', + 'editStudienjahr' => 'basis/studiensemester:rw', + 'newStudienjahr' => 'basis/studiensemester:rw', + 'insStudienjahr' => 'basis/studiensemester:rw', + 'saveStudienjahr' => 'basis/studiensemester:rw', + 'deleteStudienjahr' => 'basis/studiensemester:rw' + ) + ); + + $this->load->model('organisation/Studienjahr_model', 'StudienjahrModel'); } /** @@ -200,4 +210,4 @@ class Studienjahr extends VileSci_Controller } -} \ No newline at end of file +} diff --git a/application/controllers/organisation/Studiensemester.php b/application/controllers/organisation/Studiensemester.php index 5707bba4a..cdca4997d 100644 --- a/application/controllers/organisation/Studiensemester.php +++ b/application/controllers/organisation/Studiensemester.php @@ -5,7 +5,7 @@ if (!defined("BASEPATH")) exit("No direct script access allowed"); /** * Studiensemester controller for listing, editing and removing a Studiensemester */ -class Studiensemester extends VileSci_Controller +class Studiensemester extends Auth_Controller { /** @@ -14,9 +14,19 @@ class Studiensemester extends VileSci_Controller */ public function __construct() { - parent::__construct(); - $this->load->model("organisation/Studiensemester_model", "StudiensemesterModel"); - $this->load->model("organisation/Studienjahr_model", "StudienjahrModel"); + parent::__construct( + array( + 'listStudiensemester' => 'basis/studiensemester:r', + 'editStudiensemester' => 'basis/studiensemester:rw', + 'newStudiensemester' => 'basis/studiensemester:rw', + 'insStudiensemester' => 'basis/studiensemester:rw', + 'saveStudiensemester' => 'basis/studiensemester:rw', + 'deleteStudiensemester' => 'basis/studiensemester:rw' + ) + ); + + $this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel'); + $this->load->model('organisation/Studienjahr_model', 'StudienjahrModel'); } /** diff --git a/application/controllers/system/Filters.php b/application/controllers/system/Filters.php index ff1d47b0a..64626f8db 100644 --- a/application/controllers/system/Filters.php +++ b/application/controllers/system/Filters.php @@ -7,6 +7,8 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); * Provides data to the ajax get calls about the filter * Accepts ajax post calls to change the filter data * This controller works with JSON calls on the HTTP GET or POST and the output is always JSON + * NOTE: extends the FHC_Controller instead of the Auth_Controller because the FilterWidget has its + * own permissions check */ class Filters extends FHC_Controller { @@ -19,7 +21,11 @@ class Filters extends FHC_Controller { parent::__construct(); - $this->_loadFiltersLib(); // Loads the FiltersLib with parameters + // Loads the FiltersLib with HTTP GET/POST parameters + $this->_loadFiltersLib(); + + // Checks if the caller is allow to read this data + $this->_isAllowed(); } //------------------------------------------------------------------------------------------------------------------ @@ -198,6 +204,17 @@ class Filters extends FHC_Controller //------------------------------------------------------------------------------------------------------------------ // Private methods + /** + * Checks if the user is allowed to use this filter + */ + private function _isAllowed() + { + if (!$this->filterslib->isAllowed()) + { + $this->terminateWithJsonError('You are not allowed to access to this content'); + } + } + /** * Loads the FiltersLib with the FILTER_PAGE_PARAM parameter * If the parameter FILTER_PAGE_PARAM is not given then the execution of the controller is terminated and @@ -223,9 +240,7 @@ class Filters extends FHC_Controller } else // Otherwise an error will be written in the output { - // NOTE: Used echo to speed up the output before the exit otherwise it's not shown - echo 'Parameter "'.self::FILTER_PAGE_PARAM.'" not provided!'; - exit; + $this->terminateWithJsonError('Parameter "'.self::FILTER_PAGE_PARAM.'" not provided!'); } } } diff --git a/application/controllers/system/Login.php b/application/controllers/system/Login.php deleted file mode 100644 index c6da0de0b..000000000 --- a/application/controllers/system/Login.php +++ /dev/null @@ -1,16 +0,0 @@ -load->view('test.php'); - } -} diff --git a/application/controllers/system/Messages.php b/application/controllers/system/Messages.php index 9d66dac4d..4dac2663f 100644 --- a/application/controllers/system/Messages.php +++ b/application/controllers/system/Messages.php @@ -2,7 +2,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); -class Messages extends VileSci_Controller +class Messages extends Auth_Controller { private $uid; // contains the UID of the logged user @@ -11,7 +11,15 @@ class Messages extends VileSci_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'write' => array('basis/message:rw', 'infocenter:rw'), + 'send' => array('basis/message:rw', 'infocenter:rw'), + 'getVorlage' => array('basis/message:r', 'infocenter:r'), + 'parseMessageText' => array('basis/message:r', 'infocenter:r'), + 'getMessageFromIds' => array('basis/message:r', 'infocenter:r') + ) + ); // Loads the message library $this->load->library('MessageLib'); @@ -20,13 +28,16 @@ class Messages extends VileSci_Controller $this->load->library('WidgetLib'); $this->load->model('person/Person_model', 'PersonModel'); - - $this->loadPhrases(array( - 'global', - 'person', - 'lehre', - 'ui', - 'infocenter')); + + $this->loadPhrases( + array( + 'global', + 'person', + 'lehre', + 'ui', + 'infocenter' + ) + ); $this->_setAuthUID(); // sets property uid } @@ -184,9 +195,9 @@ class Messages extends VileSci_Controller { $user_person = $this->PersonModel->getByUid($this->uid); - if (isError($user_person)) + if (!hasData($user_person)) { - show_error($user_person->retval); + show_error('no sender'); } $sender_id = $user_person->retval[0]->person_id; } diff --git a/application/controllers/system/Navigation.php b/application/controllers/system/Navigation.php index d463017e7..3471165a8 100644 --- a/application/controllers/system/Navigation.php +++ b/application/controllers/system/Navigation.php @@ -7,7 +7,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); * Provides data to the ajax get calls about the filter * This controller works with JSON calls on the HTTP GET or POST and the output is always JSON */ -class Navigation extends FHC_Controller +class Navigation extends Auth_Controller { const NAVIGATION_PAGE_PARAM = 'navigation_page'; // Navigation page parameter name @@ -15,8 +15,13 @@ class Navigation extends FHC_Controller * Loads the NavigationLib where the used logic lies */ public function __construct() - { - parent::__construct(); // parents constructor + { + parent::__construct( + array( + 'menu' => 'basis/vilesci:r', + 'header' => 'basis/vilesci:r' + ) + ); $this->_loadNavigationLib(); // Loads the NavigationLib with parameters } diff --git a/application/controllers/system/Phrases.php b/application/controllers/system/Phrases.php index 0b98715de..67c5d24f9 100644 --- a/application/controllers/system/Phrases.php +++ b/application/controllers/system/Phrases.php @@ -2,14 +2,27 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); -class Phrases extends FHC_Controller +class Phrases extends Auth_Controller { /** * */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'index' => 'system/phrase:r', + 'table' => 'system/phrase:r', + 'view' => 'system/phrase:r', + 'deltext' => 'system/phrase:rw', + 'edit' => 'system/phrase:rw', + 'write' => 'system/phrase:rw', + 'save' => 'system/phrase:rw', + 'newText' => 'system/phrase:rw', + 'editText' => 'system/phrase:rw', + 'saveText' => 'system/phrase:rw' + ) + ); // Loads the phrases library $this->load->library('PhrasesLib'); diff --git a/application/controllers/system/UDF.php b/application/controllers/system/UDF.php index 745ffd30c..dafa3f8f7 100644 --- a/application/controllers/system/UDF.php +++ b/application/controllers/system/UDF.php @@ -2,13 +2,17 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); -class UDF extends VileSci_Controller +class UDF extends Auth_Controller { public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'index' => 'basis/person:r', + 'saveUDF' => 'basis/person:rw' + ) + ); - // $this->load->model('person/Person_model', 'PersonModel'); $this->load->model('crm/Prestudent_model', 'PrestudentModel'); } diff --git a/application/controllers/system/Vorlage.php b/application/controllers/system/Vorlage.php index 1af0ac052..4712d0e68 100644 --- a/application/controllers/system/Vorlage.php +++ b/application/controllers/system/Vorlage.php @@ -2,16 +2,33 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); -class Vorlage extends VileSci_Controller +class Vorlage extends Auth_Controller { public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'index' => 'system/vorlage:r', + 'table' => 'system/vorlage:r', + 'view' => 'system/vorlage:r', + 'edit' => 'system/vorlage:rw', + 'write' => 'system/vorlage:rw', + 'save' => 'system/vorlage:rw', + 'newText' => 'system/vorlage:rw', + 'editText' => 'system/vorlage:rw', + 'newText' => 'system/vorlage:rw', + 'linkDocuments' => 'system/vorlage:r', + 'saveDocuments' => 'system/vorlage:rw', + 'deleteDocumentLink' => 'system/vorlage:rw', + 'saveText' => 'system/vorlage:rw', + 'preview' => 'system/vorlage:r' + ) + ); - // Loads the vorlage library - $this->load->library('VorlageLib'); + // Loads the vorlage library + $this->load->library('VorlageLib'); - // Loads the widget library + // Loads the widget library $this->load->library('WidgetLib'); } diff --git a/application/controllers/system/aufnahme/PrestudentMultiAssign.php b/application/controllers/system/aufnahme/PrestudentMultiAssign.php index ecde88891..30df81281 100644 --- a/application/controllers/system/aufnahme/PrestudentMultiAssign.php +++ b/application/controllers/system/aufnahme/PrestudentMultiAssign.php @@ -2,11 +2,17 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); -class PrestudentMultiAssign extends VileSci_Controller +class PrestudentMultiAssign extends Auth_Controller { public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'index' => 'basis/student:r', + 'linkToStufe' => 'basis/student:rw', + 'linkToAufnahmegruppe' => 'basis/student:rw' + ) + ); // Loads the widget library $this->load->library('WidgetLib'); diff --git a/application/controllers/system/extensions/Manager.php b/application/controllers/system/extensions/Manager.php index f2ffcb59e..0a8867c1f 100644 --- a/application/controllers/system/extensions/Manager.php +++ b/application/controllers/system/extensions/Manager.php @@ -5,24 +5,27 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); /** * */ -class Manager extends VileSci_Controller +class Manager extends Auth_Controller { /** * */ public function __construct() - { - parent::__construct(); + { + parent::__construct( + array( + 'index' => 'system/extensions:r', + 'toggleExtension' => 'system/extensions:rw', + 'delExtension' => 'system/extensions:rw', + 'uploadExtension' => 'system/extensions:rw' + ) + ); // Load helpers to upload files $this->load->helper('form'); // Loads the extensions library $this->load->library('ExtensionsLib'); - - $this->load->library('PermissionLib'); - if(!$this->permissionlib->isBerechtigt('system/extensions')) - show_error('You have no Permission! You need Extensions Permission'); } /** diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 25561c795..4662fbc40 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -6,7 +6,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); * Shows infocenter-related data for a person and its prestudents, enables document and zgv checks, * displays and saves Notizen for a person, logs infocenter-related actions for a person */ -class InfoCenter extends FHC_Controller +class InfoCenter extends Auth_Controller { // App and Verarbeitungstaetigkeit name for logging const APP = 'infocenter'; @@ -65,7 +65,30 @@ class InfoCenter extends FHC_Controller */ public function __construct() { - parent::__construct(); + parent::__construct( + array( + 'index' => 'infocenter:r', + 'freigegeben' => 'infocenter:r', + 'showDetails' => 'infocenter:r', + 'unlockPerson' => 'infocenter:rw', + 'saveFormalGeprueft' => 'infocenter:rw', + 'getLastPrestudentWithZgvJson' => 'infocenter:r', + 'getZgvInfoForPrestudent' => 'infocenter:r', + 'saveZgvPruefung' => 'infocenter:rw', + 'saveAbsage' => 'infocenter:rw', + 'saveFreigabe' => 'infocenter:rw', + 'saveNotiz' => 'infocenter:rw', + 'updateNotiz' => 'infocenter:rw', + 'reloadNotizen' => 'infocenter:r', + 'reloadLogs' => 'infocenter:r', + 'outputAkteContent' => 'infocenter:r', + 'getParkedDate' => 'infocenter:r', + 'park' => 'infocenter:rw', + 'unpark' => 'infocenter:rw', + 'getStudienjahrEnd' => 'infocenter:r', + 'setNavigationMenuArrayJson' => 'infocenter:r' + ) + ); // Loads models $this->load->model('crm/akte_model', 'AkteModel'); @@ -95,10 +118,6 @@ class InfoCenter extends FHC_Controller $this->_setAuthUID(); // sets property uid - $this->load->library('PermissionLib'); - if(!$this->permissionlib->isBerechtigt('basis/person')) - show_error('You have no Permission! You need Infocenter Role'); - $this->setControllerId(); // sets the controller id } @@ -652,7 +671,7 @@ class InfoCenter extends FHC_Controller $listFiltersNotSent = array(); $listCustomFilters = array(); - $filtersSent = $this->FiltersModel->getFilterList('infocenter', 'PersonActions', '%InfoCenterSentApplication%'); + $filtersSent = $this->FiltersModel->getFilterList('infocenter', 'overview', '%InfoCenterSentApplication%'); if (hasData($filtersSent)) { for ($filtersCounter = 0; $filtersCounter < count($filtersSent->retval); $filtersCounter++) @@ -663,7 +682,7 @@ class InfoCenter extends FHC_Controller } } - $filtersNotSent = $this->FiltersModel->getFilterList('infocenter', 'PersonActions', '%InfoCenterNotSentApplication%'); + $filtersNotSent = $this->FiltersModel->getFilterList('infocenter', 'overview', '%InfoCenterNotSentApplication%'); if (hasData($filtersNotSent)) { for ($filtersCounter = 0; $filtersCounter < count($filtersNotSent->retval); $filtersCounter++) @@ -674,7 +693,7 @@ class InfoCenter extends FHC_Controller } } - $customFilters = $this->FiltersModel->getCustomFiltersList('infocenter', 'PersonActions', $this->_uid); + $customFilters = $this->FiltersModel->getCustomFiltersList('infocenter', 'overview', $this->_uid); if (hasData($customFilters)) { for ($filtersCounter = 0; $filtersCounter < count($customFilters->retval); $filtersCounter++) @@ -795,7 +814,7 @@ class InfoCenter extends FHC_Controller $listFilters = array(); $listCustomFilters = array(); - $filters = $this->FiltersModel->getFilterList('infocenter', 'PersonActions', '%InfoCenterFreigegeben%'); + $filters = $this->FiltersModel->getFilterList('infocenter', 'freigegeben', '%InfoCenterFreigegeben%'); if (hasData($filters)) { for ($filtersCounter = 0; $filtersCounter < count($filters->retval); $filtersCounter++) @@ -806,7 +825,7 @@ class InfoCenter extends FHC_Controller } } - $customFilters = $this->FiltersModel->getCustomFiltersList('infocenter', 'PersonActions', $this->_uid); + $customFilters = $this->FiltersModel->getCustomFiltersList('infocenter', 'freigegeben', $this->_uid); if (hasData($customFilters)) { for ($filtersCounter = 0; $filtersCounter < count($customFilters->retval); $filtersCounter++) @@ -845,7 +864,7 @@ class InfoCenter extends FHC_Controller 'filters' => $this->navigationlib->oneLevel( 'Filter', // description '#', // link - $filtersArray['children'], // children + (isset($filtersArray['children'])?$filtersArray['children']:''), // children '', // icon true, // expand null, // subscriptDescription diff --git a/application/core/APIv1_Controller.php b/application/core/APIv1_Controller.php index a8b0a1f06..11ed9fc98 100644 --- a/application/core/APIv1_Controller.php +++ b/application/core/APIv1_Controller.php @@ -7,16 +7,34 @@ class APIv1_Controller extends REST_Controller /** * Standard constructor for all the RESTful resources */ - public function __construct() + public function __construct($requiredPermissions) { parent::__construct(); - // Loads helper fhcauth to manage the authentication - $this->load->helper('fhcauth'); + // Loads helper message to manage returning messages + $this->load->helper('fhc_message'); - // Loads return messages - $this->load->helper('message'); + // Loads helper with generic utility function + $this->load->helper('fhc_common'); + + // Loads permission lib + $this->load->library('PermissionLib'); log_message('debug', 'Called API: '.$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']); + + $this->_isAllowed($requiredPermissions); } + + /** + * Checks if the caller is allowed to access to this content with the given permissions + * If it is not allowed will set the HTTP header with code 401 + * Wrapper for permissionlib->isEntitled + */ + private function _isAllowed($requiredPermissions) + { + if (!$this->permissionlib->isEntitled($requiredPermissions, $this->router->method)) + { + $this->response(error('You are not allowed to access to this content'), REST_Controller::HTTP_UNAUTHORIZED); + } + } } diff --git a/application/core/Auth_Controller.php b/application/core/Auth_Controller.php new file mode 100644 index 000000000..3cdde3e0e --- /dev/null +++ b/application/core/Auth_Controller.php @@ -0,0 +1,79 @@ +load->helper('fhc_authentication'); + + // Checks if the caller is allowed to access to this content + $this->_isAllowed($requiredPermissions); + } + + /** + * Checks if the caller is allowed to access to this content with the given permissions + * If it is not allowed will set the HTTP header with code 401 + * Wrapper for permissionlib->isEntitled + */ + private function _isAllowed($requiredPermissions) + { + // Loads permission lib + $this->load->library('PermissionLib'); + + // Checks if this user is entitled to access to this content + if (!$this->permissionlib->isEntitled($requiredPermissions, $this->router->method)) + { + header('HTTP/1.0 401 Unauthorized'); // set the HTTP header as unauthorized + + $this->load->library('EPrintfLib'); // loads the EPrintfLib to format the output + + // Prints the main error message + $this->eprintflib->printError('You are not allowed to access to this content'); + // Prints the called controller name + $this->eprintflib->printInfo('Controller name: '.$this->router->class); + // Prints the called controller method name + $this->eprintflib->printInfo('Method name: '.$this->router->method); + // Prints the required permissions needed to access to this method + $this->eprintflib->printInfo('Required permissions: '.$this->_rpsToString($requiredPermissions, $this->router->method)); + + exit; // immediately terminate the execution + } + } + + /** + * Converts an array of permissions to a string that contains them as a comma separated list + * Ex: ", , " + */ + private function _rpsToString($requiredPermissions, $method) + { + $strRequiredPermissions = ''; // string that contains all the required permissions needed to access to this method + + if (isset($requiredPermissions[$method])) // if the called method is present in the permissions array + { + // If it is NOT then convert it into an array + $rpsMethod = $requiredPermissions[$method]; + if (!is_array($rpsMethod)) + { + $rpsMethod = array($rpsMethod); + } + + // Copy all the permissions into $strRequiredPermissions separated by a comma + for ($i = 0; $i < count($rpsMethod); $i++) + { + $strRequiredPermissions .= $rpsMethod[$i].', '; + } + + $strRequiredPermissions = rtrim($strRequiredPermissions, ', '); + } + + return $strRequiredPermissions; + } +} diff --git a/application/core/DB_Model.php b/application/core/DB_Model.php index 739567992..6273cb962 100644 --- a/application/core/DB_Model.php +++ b/application/core/DB_Model.php @@ -58,9 +58,6 @@ class DB_Model extends FHC_Model // Check class properties if (is_null($this->dbTable)) return error(FHC_MODEL_ERROR, FHC_NODBTABLE); - // Checks rights - if (isError($ent = $this->_isEntitled(PermissionLib::INSERT_RIGHT))) return $ent; - // If this table has UDF and the validation of them is ok if (isError($validate = $this->_manageUDFs($data, $this->dbTable))) return $validate; @@ -108,9 +105,6 @@ class DB_Model extends FHC_Model if (is_null($this->pk)) return error(FHC_MODEL_ERROR, FHC_NOPK); if (is_null($this->dbTable)) return error(FHC_MODEL_ERROR, FHC_NODBTABLE); - // Checks rights - if (isError($ent = $this->_isEntitled(PermissionLib::UPDATE_RIGHT))) return $ent; - // If this table has UDF and the validation of them is ok if (isError($validate = $this->_manageUDFs($data, $this->dbTable, $id))) return $validate; @@ -154,9 +148,6 @@ class DB_Model extends FHC_Model if (is_null($this->dbTable)) return error(FHC_MODEL_ERROR, FHC_NODBTABLE); if (is_null($this->pk)) return error(FHC_MODEL_ERROR, FHC_NOPK); - // Checks rights - if (isError($ent = $this->_isEntitled(PermissionLib::DELETE_RIGHT))) return $ent; - $tmpId = $id; // Check for composite Primary Key @@ -195,9 +186,6 @@ class DB_Model extends FHC_Model if (is_null($this->pk)) return error(FHC_MODEL_ERROR, FHC_NOPK); if (is_null($this->dbTable)) return error(FHC_MODEL_ERROR, FHC_NODBTABLE); - // Checks rights - if (isError($ent = $this->_isEntitled(PermissionLib::SELECT_RIGHT))) return $ent; - $tmpId = $id; // Check for composite Primary Key @@ -234,9 +222,6 @@ class DB_Model extends FHC_Model // Check class properties if (is_null($this->dbTable)) return error(FHC_MODEL_ERROR, FHC_NODBTABLE); - // Checks rights - if (isError($ent = $this->_isEntitled(PermissionLib::SELECT_RIGHT))) return $ent; - // Execute query if ($result = $this->db->get_where($this->dbTable, $where)) { @@ -265,9 +250,6 @@ class DB_Model extends FHC_Model // Check class properties if (is_null($this->dbTable)) return error(FHC_MODEL_ERROR, FHC_NODBTABLE); - // Checks rights - if (isError($ent = $this->_isEntitled(PermissionLib::SELECT_RIGHT))) return $ent; - // List of tables on which it will work $tables = array_merge(array($mainTable), $sideTables); // Array that will contain the number of columns of each table @@ -811,25 +793,6 @@ class DB_Model extends FHC_Model return array_combine($idexes, $values); } - /** - * Checks if the caller is entitled to perform this operation with this right - */ - private function _isEntitled($permission) - { - $ent = success(true); - - $ent = $this->isEntitled($this->dbTable, $permission, FHC_NORIGHT, FHC_MODEL_ERROR); - // If true is not returned, then an error has occurred - if (isError($ent)) - { - // Before returning the object containing the error, reset the build query - // This is for preventing that other parts of the query will be built before of the next execution - $this->resetQuery(); - } - - return $ent; - } - /** * Wrapper method for UDFLib->manageUDFs */ diff --git a/application/core/FHC_Controller.php b/application/core/FHC_Controller.php index e3bf558e1..14acc1ca0 100644 --- a/application/core/FHC_Controller.php +++ b/application/core/FHC_Controller.php @@ -14,23 +14,26 @@ class FHC_Controller extends CI_Controller * - loads the authentication system * - loads all the helpers that later are always needed */ - public function __construct() + public function __construct() { - parent::__construct(); + parent::__construct(); $this->_controllerId = null; // set _controllerId as null by default - // Loads helper fhcauth to manage the authentication - $this->load->helper('fhcauth'); - // Loads helper message to manage returning messages - $this->load->helper('message'); + $this->load->helper('fhc_message'); // Loads helper with generic utility function - $this->load->helper('fhc'); + $this->load->helper('fhc_common'); // Loads helper session to manage the php session - $this->load->helper('session'); + $this->load->helper('fhc_session'); + + // Loads language helper + $this->load->helper('fhc_language'); + + // Loads header helper + $this->load->helper('fhc_header'); } //------------------------------------------------------------------------------------------------------------------ @@ -61,7 +64,7 @@ class FHC_Controller extends CI_Controller { $this->_controllerId = $this->input->get(self::FHC_CONTROLLER_ID); - if (!isset($this->_controllerId) || isEmptyString($this->_controllerId)) + if (isEmptyString($this->_controllerId)) { $this->_controllerId = uniqid(); // generate a unique id // Redirect to the same URL, but giving FHC_CONTROLLER_ID as HTTP GET parameter @@ -105,6 +108,17 @@ class FHC_Controller extends CI_Controller $this->_outputJson(error($mixed)); } + /** + * Terminate the execution of the page after have printed a message encoded to JSON. + * Used directly header and echo to speed up the output before the exit command stops the execution. + */ + protected function terminateWithJsonError($message) + { + header('Content-Type: application/json'); + echo json_encode(error($message)); + exit; + } + //------------------------------------------------------------------------------------------------------------------ // Private methods diff --git a/application/core/FHC_Model.php b/application/core/FHC_Model.php index 39e1f6245..e31ff332d 100644 --- a/application/core/FHC_Model.php +++ b/application/core/FHC_Model.php @@ -6,8 +6,6 @@ class FHC_Model extends CI_Model { /** * Standard constructor for all the models - * It loads the helper message to manage the values returned by methods - * It loads the permission library */ public function __construct() { @@ -16,40 +14,5 @@ class FHC_Model extends CI_Model // Load languages files $this->lang->load('fhc_model'); $this->lang->load('fhcomplete'); - - // Loads the permission library - $this->load->library('PermissionLib'); - } - - /** - * Check if the user is entitled to get access to a source with the given access type - * This is a wrapper for the same method present in the PermissionLib - */ - public function isEntitled($sourceName, $accessType, $languageMessageCode, $msgErrorCode) - { - $isEntitled = success(true); - - // If script is not called from Commandline - // or the caller is _not_ a model _and_ tries to read data, then avoids to check permissions - // Otherwise checks always the permissions - if (!is_cli() || - ($accessType == PermissionLib::SELECT_RIGHT - && substr(get_called_class(), -6) == DB_Model::MODEL_POSTFIX) - || $accessType != PermissionLib::SELECT_RIGHT) - { - if ($this->permissionlib->isEntitled($sourceName, $accessType) === false) - { - $retval = sprintf( - '%s -> %s:%s', - lang('fhc_'.$languageMessageCode), - $this->permissionlib->getBerechtigungKurzbz($sourceName), - $accessType - ); - - $isEntitled = error($retval, $msgErrorCode); - } - } - - return $isEntitled; } } diff --git a/application/core/FS_Model.php b/application/core/FS_Model.php index 3e28e2a82..7e2b2d7e2 100644 --- a/application/core/FS_Model.php +++ b/application/core/FS_Model.php @@ -30,9 +30,6 @@ class FS_Model extends FHC_Model // Check method parameters if (is_null($filename)) return error(FHC_MODEL_ERROR, FHC_ERROR); - // Check rights - if (isError($ent = $this->isEntitled($this->filepath, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - if (!is_null($data = $this->filesystemlib->read($this->filepath, $filename))) { return success(base64_encode($data)); @@ -58,9 +55,6 @@ class FS_Model extends FHC_Model if (is_null($filename)) return error(FHC_MODEL_ERROR, FHC_ERROR); if (is_null($content)) return error(FHC_MODEL_ERROR, FHC_ERROR); - // Check rights - if (isError(($ent = $this->isEntitled($this->filepath, PermissionLib::INSERT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))) return $ent; - if ($this->filesystemlib->write($this->filepath, $filename, base64_decode($content)) === true) { return success(FHC_SUCCESS); @@ -86,9 +80,6 @@ class FS_Model extends FHC_Model if (is_null($content)) return error(FHC_MODEL_ERROR, FHC_ERROR); if (is_null($filename)) return error(FHC_MODEL_ERROR, FHC_ERROR); - // Check rights - if (isError($ent = $this->isEntitled($this->filepath, PermissionLib::INSERT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - if ($this->filesystemlib->append($this->filepath, $filename, base64_decode($content)) === true) { return success(FHC_SUCCESS); @@ -113,9 +104,6 @@ class FS_Model extends FHC_Model // Check method parameters if (is_null($filename)) return error(FHC_MODEL_ERROR, FHC_ERROR); - // Check rights - if (isError($ent = $this->isEntitled($this->filepath, PermissionLib::DELETE_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - if ($this->filesystemlib->remove($this->filepath, $filename) === true) { return success(FHC_SUCCESS); @@ -141,9 +129,6 @@ class FS_Model extends FHC_Model if (is_null($filename)) return error(FHC_MODEL_ERROR, FHC_ERROR); if (is_null($newFilename)) return error(FHC_MODEL_ERROR, FHC_ERROR); - // Check rights - if (isError($ent = $this->isEntitled($this->filepath, PermissionLib::UPDATE_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - if ($this->filesystemlib->rename($this->filepath, $filename, $this->filepath, $newFilename) === true) { return success(FHC_SUCCESS); diff --git a/application/core/VileSci_Controller.php b/application/core/VileSci_Controller.php deleted file mode 100644 index cc2979d39..000000000 --- a/application/core/VileSci_Controller.php +++ /dev/null @@ -1,14 +0,0 @@ -'; + + if (isset($CSSs)) + { + $tmpCSSs = is_array($CSSs) ? $CSSs : array($CSSs); + + for ($tmpCSSsCounter = 0; $tmpCSSsCounter < count($tmpCSSs); $tmpCSSsCounter++) + { + $toPrint = sprintf($cssLink, base_url($tmpCSSs[$tmpCSSsCounter])).PHP_EOL; + + if ($tmpCSSsCounter > 0) $toPrint = "\t\t".$toPrint; + + echo $toPrint; + } + } +} + +/** + * Generates global JS-Object to pass parms to other javascripts + */ +function generateJSDataStorageObject($indexPage, $calledPath, $calledMethod) +{ + $toPrint = "\n"; + $toPrint .= ''; + $toPrint .= "\n\n"; + + echo $toPrint; +} + +/** + * Generates global JS-Object to pass phrases to other javascripts + */ +function generateJSPhrasesStorageObject($phrases) +{ + $ci =& get_instance(); + $ci->load->library('PhrasesLib', array($phrases), 'pj'); + + $toPrint = "\n"; + $toPrint .= ''; + $toPrint .= "\n\n"; + + echo $toPrint; +} + +/** + * Generates tags for the javascripts you want to include, the parameter could by a string or an array of strings + */ +function generateJSsInclude($JSs) +{ + $jsInclude = ''; + + if (isset($JSs)) + { + $tmpJSs = is_array($JSs) ? $JSs : array($JSs); + + for ($tmpJSsCounter = 0; $tmpJSsCounter < count($tmpJSs); $tmpJSsCounter++) + { + $toPrint = sprintf($jsInclude, base_url($tmpJSs[$tmpJSsCounter])).PHP_EOL; + + if ($tmpJSsCounter > 0) $toPrint = "\t\t".$toPrint; + + echo $toPrint; + } + } +} + +/** + * Generates all the includes needed by the Addons + */ +function generateAddonsJSsInclude($calledFrom) +{ + $aktive_addons = array_filter(explode(";", ACTIVE_ADDONS)); + + foreach ($aktive_addons as $addon) + { + $hookfile = DOC_ROOT.'addons/'.$addon.'/hooks.config.inc.php'; + if (file_exists($hookfile)) + { + include($hookfile); + if (key_exists($calledFrom, $js_hooks)) + { + foreach ($js_hooks[$calledFrom] as $js_file) + generateJSsInclude('addons/'.$addon.'/'.$js_file); + } + } + } +} + +/** + * This function merely print some useful HTML to help some vacuous browsers to handle modern JS features + */ +function generateBackwardCompatibleJSMsIe($js) +{ + echo "\n"; +} diff --git a/application/helpers/fhc_language_helper.php b/application/helpers/fhc_language_helper.php new file mode 100644 index 000000000..ce01c5f0d --- /dev/null +++ b/application/helpers/fhc_language_helper.php @@ -0,0 +1,46 @@ +load->model('person/Person_model', 'PersonModelLanguage'); + + $language = $ci->PersonModelLanguage->getLanguage(getAuthUID()); + } + + return $language; +} diff --git a/application/helpers/message_helper.php b/application/helpers/fhc_message_helper.php similarity index 100% rename from application/helpers/message_helper.php rename to application/helpers/fhc_message_helper.php diff --git a/application/helpers/sancho_helper.php b/application/helpers/fhc_sancho_helper.php similarity index 90% rename from application/helpers/sancho_helper.php rename to application/helpers/fhc_sancho_helper.php index a8e9f05c9..c788f1bbf 100644 --- a/application/helpers/sancho_helper.php +++ b/application/helpers/fhc_sancho_helper.php @@ -1,4 +1,5 @@ load->library('email'); diff --git a/application/helpers/session_helper.php b/application/helpers/fhc_session_helper.php similarity index 96% rename from application/helpers/session_helper.php rename to application/helpers/fhc_session_helper.php index e74468896..a0a8a60b9 100644 --- a/application/helpers/session_helper.php +++ b/application/helpers/fhc_session_helper.php @@ -10,13 +10,6 @@ * @since Version 1.0.0 */ -/** - * Message Helper - * - * @subpackage Helpers - * @category Helpers - */ - if (! defined('BASEPATH')) exit('No direct script access allowed'); // ------------------------------------------------------------------------------------------------------- diff --git a/application/libraries/CallerLib.php b/application/libraries/CallerLib.php index 33f0def52..0b46cf0c6 100644 --- a/application/libraries/CallerLib.php +++ b/application/libraries/CallerLib.php @@ -25,38 +25,36 @@ class CallerLib 'PersonLogLib' ); + private $_ci; // CI instance + /** - * Object initialization + * Library initialization */ public function __construct() { - // Gets CI instance - $this->ci =& get_instance(); - - // Loads permission library - $this->ci->load->library('PermissionLib'); + $this->_ci =& get_instance(); // Gets CI instance } /** * Wrapper method for _call */ - public function callLibrary($callParameters, $permissionType) + public function callLibrary($callParameters) { - return $this->_call($callParameters, $permissionType); + return $this->_call($callParameters); } /** * Wrapper method for _call */ - public function callModel($callParameters, $permissionType) + public function callModel($callParameters) { - return $this->_call($callParameters, $permissionType); + return $this->_call($callParameters); } /** * Everything starts here... */ - private function _call($callParameters, $permissionType) + private function _call($callParameters) { $result = null; $parameters = $this->_getParameters($callParameters); @@ -80,30 +78,15 @@ class CallerLib elseif (strpos($parameters->resourceName, CallerLib::LIB_PREFIX) !== false) { // Check if the resource is already loaded, it works only with libraries and drivers - $isLoaded = $this->ci->load->is_loaded($parameters->resourceName); + $isLoaded = $this->_ci->load->is_loaded($parameters->resourceName); // If not loaded then load it if ($isLoaded === false) { - // Checks if the operation is permitted by the API caller - // Only for libraries, permissions are automatically handled by models - $result = $this->checkLibraryPermission( - $parameters->resourcePath, - $parameters->resourceName, - $parameters->function, - $permissionType - ); - if (isError($result)) + // Try to load the library + $result = $this->_loadLibrary($parameters->resourcePath, $parameters->resourceName); + if (isSuccess($result)) { - $loaded = null; - } - else - { - // Try to load the library - $result = $this->_loadLibrary($parameters->resourcePath, $parameters->resourceName); - if (isSuccess($result)) - { - $loaded = $result->retval; - } + $loaded = $result->retval; } } // If it is already loaded $isLoaded contains the instance of the library @@ -225,7 +208,7 @@ class CallerLib try { - $loaded = $this->ci->load->model($resourcePath.$resourceName); + $loaded = $this->_ci->load->model($resourcePath.$resourceName); } catch (Exception $e) { @@ -241,34 +224,6 @@ class CallerLib return $result; } - /** - * Search for a valid permission for this library that should be present with this format: - * '..' => '' - */ - private function checkLibraryPermission($resourcePath, $resourceName, $function, $permissionType) - { - $result = null; - $permissionPath = ''; - - if ($resourcePath != '') - { - $permissionPath = $resourcePath; - } - - $permissionPath .= $resourceName.'.'.$function; - - if ($this->ci->permissionlib->isEntitled($permissionPath, $permissionType) === false) - { - $result = error(FHC_NORIGHT, FHC_NORIGHT); - } - else - { - $result = success('Has permission'); - } - - return $result; - } - /** * Loads a library using the given path and name * @@ -288,7 +243,7 @@ class CallerLib try { // Gets all the configured resources paths - $packagePaths = $this->ci->load->get_package_paths(); + $packagePaths = $this->_ci->load->get_package_paths(); // Looking for a file in every paths with the same name of the resource $found = null; for ($i = 0; $i < count($packagePaths) && is_null($found); $i++) @@ -305,7 +260,7 @@ class CallerLib if (!is_null($found)) { // Load the file - $loaded = $this->ci->load->file($found); + $loaded = $this->_ci->load->file($found); // If the resource is not present inside the file if (!class_exists($resourceName)) { diff --git a/application/libraries/FiltersLib.php b/application/libraries/FiltersLib.php index 1cd7e7691..22fd77d4b 100644 --- a/application/libraries/FiltersLib.php +++ b/application/libraries/FiltersLib.php @@ -34,6 +34,9 @@ class FiltersLib const DATASET_NAME_PARAMETER = 'datasetName'; const FILTER_KURZBZ_PARAMETER = 'filterKurzbz'; + // ...to specify permissions that are needed to use this FilterWidget + const REQUIRED_PERMISSIONS_PARAMETER = 'requiredPermissions'; + // ...stament to retrive the dataset const QUERY_PARAMETER = 'query'; @@ -70,6 +73,9 @@ class FiltersLib const FILTER_PAGE_PARAM = 'filter_page'; // Filter page parameter name + const PERMISSION_FILTER_METHOD = 'FilterWidget'; // Name for fake method to be checked by the PermissionLib + const PERMISSION_TYPE = 'rw'; + private $_ci; // Code igniter instance private $_filterUniqueId; // unique id for this filter widget @@ -80,12 +86,33 @@ class FiltersLib { $this->_ci =& get_instance(); // get code igniter instance + // Loads authentication helper + $this->_ci->load->helper('fhc_authentication'); // NOTE: needed to load custom filters do not remove! + $this->_filterUniqueId = $this->_getFilterUniqueId($params); // sets the id for the related filter widget } //------------------------------------------------------------------------------------------------------------------ // Public methods + /** + * Checks if at least one of the permissions given as parameter (requiredPermissions) belongs + * to the authenticated user, if confirmed then is allowed to use this FilterWidget. + * If the parameter requiredPermissions is NOT given or is not present in the session, + * then NO one is allow to use this FilterWidget + * Wrapper method to permissionlib->hasAtLeastOne + */ + public function isAllowed($requiredPermissions = null) + { + $this->_ci->load->library('PermissionLib'); // Load permission library + + // Gets the required permissions from the session if they are not provided as parameter + $rq = $requiredPermissions; + if ($rq == null) $rq = $this->getElementSession(self::REQUIRED_PERMISSIONS_PARAMETER); + + return $this->_ci->permissionlib->hasAtLeastOne($rq, self::PERMISSION_FILTER_METHOD, self::PERMISSION_TYPE); + } + /** * Wrapper method to the session helper funtions to retrive the whole session for this filter */ @@ -236,6 +263,7 @@ class FiltersLib public function generateDatasetQuery($query, $filters) { $datasetQuery = 'SELECT * FROM ('.$query.') '.self::DATASET_TABLE_ALIAS; + $trimedval = trim($query); // If the given query is valid and the parameter filters is an array if (!isEmptyString($query) && $filters != null && is_array($filters)) @@ -247,7 +275,8 @@ class FiltersLib { $filterDefinition = $filters[$filtersCounter]; // definition of one filter - if ($filtersCounter > 0) $where .= ' AND '; // if it's NOT the last one + if ($filtersCounter > 0) + $where .= ' AND '; // if it's NOT the last one if (!isEmptyString($filterDefinition->name)) // if the name of the applied filter is valid { @@ -289,7 +318,7 @@ class FiltersLib public function getFilterName($filterJson) { $filterName = $filterJson->name; // always present, used as default - + $trimedname = (isset($filterJson->namePhrase)?trim($filterJson->namePhrase):''); // Filter name from phrases system if (isset($filterJson->namePhrase) && !isEmptyString($filterJson->namePhrase)) { @@ -297,7 +326,7 @@ class FiltersLib $this->_ci->load->library('PhrasesLib', array(self::FILTER_PHRASES_CATEGORY)); $tmpFilterNamePhrase = $this->_ci->phraseslib->t(self::FILTER_PHRASES_CATEGORY, $filterJson->namePhrase); - if (isset($tmpFilterNamePhrase) && !isEmptyString($tmpFilterNamePhrase)) // if is not null or an empty string + if (!isEmptyString($tmpFilterNamePhrase)) // if is not null or an empty string { $filterName = $tmpFilterNamePhrase; } @@ -337,9 +366,9 @@ class FiltersLib public function removeSelectedField($selectedField) { $removeSelectedField = false; - + $trimedval = (isset($selectedField)?trim($selectedField):''); // Checks the parameter selectedField - if (isset($selectedField) && !isEmptyString($selectedField)) + if (!isEmptyString($selectedField)) { // Retrives all the used fields by the current filter $fields = $this->getElementSession(self::SESSION_FIELDS); @@ -371,9 +400,9 @@ class FiltersLib public function addSelectedField($selectedField) { $removeSelectedField = false; - + $trimedval = (isset($selectedField)?trim($selectedField):''); // Checks the parameter selectedField - if (isset($selectedField) && !isEmptyString($selectedField)) + if (!isEmptyString($selectedField)) { // Retrives all the used fields by the current filter $fields = $this->getElementSession(self::SESSION_FIELDS); @@ -400,9 +429,9 @@ class FiltersLib public function removeAppliedFilter($appliedFilter) { $removeAppliedFilter = false; - + $trimedval = (isset($appliedFilter)?trim($appliedFilter):''); // Checks the parameter appliedFilter - if (isset($appliedFilter) && !isEmptyString($appliedFilter)) + if (!isEmptyString($appliedFilter)) { // Retrives all the used fields by the current filter $fields = $this->getElementSession(self::SESSION_FIELDS); @@ -488,9 +517,9 @@ class FiltersLib public function addFilter($filter) { $addFilter = false; - + $trimedval = (isset($filter)?trim($filter):''); // Checks the parameter filter - if (isset($filter) && !isEmptyString($filter)) + if (!isEmptyString($filter)) { // Retrives all the used fields by the current filter $fields = $this->getElementSession(self::SESSION_FIELDS); @@ -531,9 +560,9 @@ class FiltersLib public function saveCustomFilter($customFilterDescription) { $saveCustomFilter = false; // by default returns a failure - + $trimedval = (isset($customFilterDescription)?trim($customFilterDescription):''); // Checks parameter customFilterDescription if not valid stop the execution - if (!isset($customFilterDescription) || isEmptyString($customFilterDescription)) + if (isEmptyString($customFilterDescription)) { return $saveCustomFilter; } diff --git a/application/libraries/MessageLib.php b/application/libraries/MessageLib.php index 8d04b9824..ce03fe6dc 100644 --- a/application/libraries/MessageLib.php +++ b/application/libraries/MessageLib.php @@ -268,7 +268,7 @@ class MessageLib } /** - * sendMessageVorlage() - sends new internal message using a template + * Sends new internal message using a template */ public function sendMessageVorlage($sender_id, $receiver_id, $vorlage_kurzbz, $oe_kurzbz, $data, $relationmessage_id = null, $orgform_kurzbz = null, $multiPartMime = true) { @@ -298,16 +298,12 @@ class MessageLib { $receiver_id = $receivers->retval[$i]->person_id; + // Checks if the receiver exists $result = $this->ci->PersonModel->load($receiver_id); if (hasData($result)) { - // Set the language with the global value - $sprache = DEFAULT_LANGUAGE; - // If the receiver has a prefered language use this - if (isset($result->retval[0]->sprache) && $result->retval[0]->sprache != '') - { - $sprache = $result->retval[0]->sprache; - } + // Retrives the language of the logged user + $sprache = getUserLanguage(); // Loads template data $result = $this->ci->vorlagelib->loadVorlagetext($vorlage_kurzbz, $oe_kurzbz, $orgform_kurzbz, $sprache); diff --git a/application/libraries/NavigationLib.php b/application/libraries/NavigationLib.php index ceeddca52..1b15943ea 100644 --- a/application/libraries/NavigationLib.php +++ b/application/libraries/NavigationLib.php @@ -19,6 +19,8 @@ class NavigationLib const NAVIGATION_PAGE_PARAM = 'navigation_page'; // Navigation page parameter name + const PERMISSION_NAVIGATION_METHOD = 'NavigationWidget'; // Name for fake method to be checked by the PermissionLib + private $_ci; // Code igniter instance private $_navigationPage; // unique id for this navigation widget @@ -67,7 +69,7 @@ class NavigationLib public function oneLevel( $description, $link = '#', $children = null, $icon = '', $expand = false, $subscriptDescription = null, $subscriptLinkClass = null, $subscriptLinkValue = null, $target = '', - $sort = null) + $sort = null, $requiredPermissions = null) { return array( 'description' => $description, @@ -79,7 +81,8 @@ class NavigationLib 'subscriptDescription' => $subscriptDescription, 'subscriptLinkClass' => $subscriptLinkClass, 'subscriptLinkValue' => $subscriptLinkValue, - 'sort' => $sort + 'sort' => $sort, + 'requiredPermissions' => $requiredPermissions ); } @@ -208,7 +211,7 @@ class NavigationLib { $navigationArray = array(); - if (isset($navigationPage)) + if (isset($navigationPage)) // if the current page name is given { // Load Header Entries of Core $configArray = $this->_ci->config->item($configName); @@ -219,6 +222,7 @@ class NavigationLib if (hasData($extensions)) { $extensionArray = array(); + foreach ($extensions->retval as $ext) { $filename = APPPATH.'config/'.ExtensionsLib::EXTENSIONS_DIR_NAME.'/'.$ext->name.'/'.self::CONFIG_NAVIGATION_FILENAME; @@ -226,6 +230,7 @@ class NavigationLib { unset($config); include($filename); + if (isset($config[$configName]) && is_array($config[$configName])) { $extensionArray = array_merge_recursive( @@ -236,6 +241,7 @@ class NavigationLib } } } + $navigationArray = array_merge_recursive($navigationArray, $extensionArray); } @@ -246,7 +252,9 @@ class NavigationLib } } - $this->_sortArray($navigationArray); + $this->_rmNotAllowedEntries($navigationArray); // remove not allowed menu entries + + $this->_sortNavigationArray($navigationArray); // sort menu entries return $navigationArray; } @@ -319,9 +327,9 @@ class NavigationLib /** * Sorts using the sort element present in the array */ - private function _sortArray(&$array) + private function _sortNavigationArray(&$navigationArray) { - uasort($array, function($a, $b) { + uasort($navigationArray, function($a, $b) { // If the element sort is not present then the default value is 999 $sortA = 999; @@ -335,13 +343,55 @@ class NavigationLib }); // Sort also the children - foreach ($array as $key => $value) + foreach ($navigationArray as $menuName => $singleMenu) { - if (isset($value['children']) && is_array($value['children']) && count($value['children']) > 0) + if (isset($singleMenu['children']) && !isEmptyArray($singleMenu['children'])) { - // NOTE: keep this way to give the element by reference, $value has a different reference! + // NOTE: keep this way to give the element by reference, $singleMenu has a different reference! // otherwise the children will not be sorted - $this->_sortArray($array[$key]['children']); // recursive call + $this->_sortNavigationArray($navigationArray[$menuName]['children']); // recursive call + } + } + } + + /** + * Remove menu entries that the logged user is not allow to use + */ + private function _rmNotAllowedEntries(&$navigationArray) + { + $this->_ci->load->library('PermissionLib'); // Load permission library + + if (isset($navigationArray)) // to avoid error in the foreach + { + // Loops through the navigation array + foreach ($navigationArray as $menuName => $singleMenu) + { + // If the property requiredPermissions is present is checked + if (isset($singleMenu['requiredPermissions'])) + { + // Checks if the logged uses has at least one of required permissions + $isAllowed = $this->_ci->permissionlib->hasAtLeastOne( + $singleMenu['requiredPermissions'], + self::PERMISSION_NAVIGATION_METHOD + ); + + // If the user is not allowed then this menu entry and its children (sub menus) are removed and not displayed + if (!$isAllowed) + { + unset($navigationArray[$menuName]); + } + } + // Otherwise this menu entry is displayed + + // If the menu entry was NOT removed, then checks if it has children (sub menus) to check them for permissions + // NOTE: used $navigationArray[$menuName] because could be removed by the previous unset command + // therefore $singleMenu is still set + if (isset($navigationArray[$menuName]) && isset($singleMenu['children']) && !isEmptyArray($singleMenu['children'])) + { + // NOTE: keep this way to give the element by reference, $value has a different reference! + // otherwise the children will not be checked correctly + $this->_rmNotAllowedEntries($navigationArray[$menuName]['children']); // recursive call + } } } } diff --git a/application/libraries/PermissionLib.php b/application/libraries/PermissionLib.php index dfaa22368..980598d9b 100644 --- a/application/libraries/PermissionLib.php +++ b/application/libraries/PermissionLib.php @@ -23,13 +23,24 @@ require_once(FHCPATH.'include/benutzerberechtigung.class.php'); class PermissionLib { - // Available rights + // Available rights in the DB const SELECT_RIGHT = 's'; const UPDATE_RIGHT = 'u'; const INSERT_RIGHT = 'i'; const DELETE_RIGHT = 'd'; const REPLACE_RIGHT = 'ui'; + // Available rights to access a controller + const READ_RIGHT = 'r'; + const WRITE_RIGHT = 'w'; + const READ_WRITE_RIGHT = 'rw'; + + const PERMISSION_SEPARATOR = ':'; // used as separator berween permission and right + + // Conversion from HTTP method to access type method + const READ_HTTP_METHOD = 'GET'; + const WRITE_HTTP_METHOD = 'POST'; + private $_ci; // CI instance private $acl; // conversion array from a source to a permission private static $bb; // benutzerberechtigung @@ -58,33 +69,6 @@ class PermissionLib } } - /** - * Check if the user is entitled to get access to a source with the given access type - * - * @return bool true if a user has the right to access to the specified - * resource with a specified permission type, false otherwise - */ - public function isEntitled($sourceName, $permissionType) - { - $isEntitled = false; - - if(!is_cli()) - { - // If the resource exists - if (isset($this->acl[$sourceName])) - { - // Checks permission - $isEntitled = $this->isBerechtigt($this->acl[$sourceName], $permissionType); - } - } - else - { - $isEntitled = true; - } - - return $isEntitled; - } - /** * Get a permission by a given source */ @@ -117,4 +101,149 @@ class PermissionLib return $isBerechtigt; } + + /** + * Checks if the caller is allowed to access to this content with the given permissions + * - if it's called from command line than it's trusted + * - checks if the parameter $requiredPermissions is set, is an array and contains at least one element + * - checks if the given $requiredPermissions parameter contains the called method of the controller + * - checks if the HTTP method used to call is GET or POST + * - convert the required permissions to an array if needed + * - loops through the required permissions + * - checks if the permission is well formatted + * - retrives permission and required access type from the $requiredPermissions array + * - checks if the required access type is compliant with the HTTP method (GET => r, POST => w) + * - if the user has one of the permissions than exit the loop + * - checks if the user has the same required permissiond with the same required access type + * - returns true if all the checks are ok, otherwise false + * + * NOTE: the displayed error messages are used to warn the developer about any issues that could occur, + * they are not intended for the final user! + */ + public function isEntitled($requiredPermissions, $calledMethod) + { + $checkPermissions = false; + $requestMethod = $_SERVER['REQUEST_METHOD']; + + // If it's called from command line than it's trusted + if (is_cli()) return true; + + // Checks if the parameter $requiredPermissions is set, is an array and contains at least one element + if (isset($requiredPermissions) && !isEmptyArray($requiredPermissions)) + { + // Checks if the given $requiredPermissions parameter contains the called method of the controller + if (isset($requiredPermissions[$calledMethod])) + { + // Checks if the HTTP method used to call is GET or POST + if ($requestMethod == self::READ_HTTP_METHOD || $requestMethod == self::WRITE_HTTP_METHOD) + { + $permissions = $requiredPermissions[$calledMethod]; + // Convert the required permissions to an array if needed + if (!is_array($permissions)) + { + $permissions = array($requiredPermissions[$calledMethod]); + } + + if (!isEmptyArray($permissions)) + { + // Loops through the required permissions + for ($pCounter = 0; $pCounter < count($permissions); $pCounter++) + { + // Checks if the permission is well formatted + if (strpos($permissions[$pCounter], PermissionLib::PERMISSION_SEPARATOR) !== false) + { + // Retrives permission and required access type from the $requiredPermissions array + list($permission, $requiredAccessType) = explode(PermissionLib::PERMISSION_SEPARATOR, $permissions[$pCounter]); + + $accessType = ''; + + // Checks if the required access type is compliant with the HTTP method (GET => r, POST => w) + if (strpos($requiredAccessType, PermissionLib::READ_RIGHT) !== false) + { + $accessType = PermissionLib::SELECT_RIGHT; // S + } + if (strpos($requiredAccessType, PermissionLib::WRITE_RIGHT) !== false) + { + $accessType .= PermissionLib::REPLACE_RIGHT.PermissionLib::DELETE_RIGHT; // UID + } + + if (!isEmptyString($accessType)) // if compliant + { + // Checks if the user has the same required permissiond with the same required access type + $checkPermissions = $this->isBerechtigt($permission, $accessType); + + // If the user has one of the permissionsm than exit the loop + if ($checkPermissions === true) break; + } + } + else + { + show_error('The given permission does not use the correct format'); + } + } + } + else + { + show_error('No permissions are set for this method, an empty array is given'); + } + } + else + { + show_error('You are trying to access to this content with a not valid HTTP method'); + } + } + else + { + show_error('The given permission array does not contain the called method or is not correctly set'); + } + } + else + { + show_error('You must give the permissions array as parameter to the constructor of the controller'); + } + + return $checkPermissions; + } + + /** + * Checks if at least one of the permissions given as parameter (requiredPermissions) belongs to the authenticated user + * It checks the given permissions against a given method (controller method name) and a given permission type (R and/or W) + * If the $permissionType is not given then it is assumed that is already present inside requiredPermissions + * Wrapper method for isEntitled, it uses method to build an associative array of permissions having as key the method itself + */ + public function hasAtLeastOne($requiredPermissions, $method, $permissionType = null) + { + $isAllowed = false; // by default is NOT allowed + + // If the parameter requiredPermissions is NOT given, then no one is allow to use this FilterWidget + if ($requiredPermissions != null) + { + // If requiredPermissions is NOT an array then converts it to an array + if (!is_array($requiredPermissions)) + { + $requiredPermissions = array($requiredPermissions); + } + + // Checks if at least one of the permissions given as parameter belongs to the authenticated user... + for ($p = 0; $p < count($requiredPermissions); $p++) + { + $pt = ''; // by default the permission is alredy present in $requiredPermissions[$p] + if ($permissionType != null) // if is it given as parameter + { + $pt = self::PERMISSION_SEPARATOR.$permissionType; // then build the permission type string + } + + $isAllowed = $this->_ci->permissionlib->isEntitled( + array( + $method => $requiredPermissions[$p].$pt + ), + $method + ); + + if ($isAllowed === true) break; // ...if confirmed then is allowed to use this FilterWidget + } + } + + return $isAllowed; + } } diff --git a/application/libraries/PhrasesLib.php b/application/libraries/PhrasesLib.php index 62def656a..88e79b467 100644 --- a/application/libraries/PhrasesLib.php +++ b/application/libraries/PhrasesLib.php @@ -194,6 +194,7 @@ class PhrasesLib { $_phrase = $this->_phrases[$i]; // single phrase + $trimedval = trim($_phrase->text); // If the single phrase match the given parameters and is not an empty string if ($_phrase->category == $category && $_phrase->phrase == $phrase @@ -241,18 +242,8 @@ class PhrasesLib $categories = array($categories); } - // Use the given language if present, otherwise retrives the language for the logged user - $language = DEFAULT_LANGUAGE; - if (count($parameters) == 2 && !isEmptyString($parameters[1]) && is_string($parameters[1])) - { - $language = $parameters[1]; - } - else - { - $this->_ci->load->model('person/Person_model', 'PersonModel'); - - $language = $this->_ci->PersonModel->getLanguage(getAuthUID()); - } + // Retrives the language of the logged user + $language = getUserLanguage(count($parameters) == 2 ? $parameters[1] : null); // If only categories is not an empty array then loads phrases if (count($categories) > 0) $this->_setPhrases($categories, $language); diff --git a/application/libraries/UDFLib.php b/application/libraries/UDFLib.php index eeb546ae3..1e46eaade 100644 --- a/application/libraries/UDFLib.php +++ b/application/libraries/UDFLib.php @@ -711,7 +711,7 @@ class UDFLib || isset($jsonSchema->{UDFLib::TITLE}) || isset($jsonSchema->{UDFLib::PLACEHOLDER})) { - // Loads PhrasesLib + // Loads phrases library $this->_ci->load->library('PhrasesLib'); // If is set the label property in the json schema @@ -720,7 +720,7 @@ class UDFLib // Load the related phrase $tmpResult = $this->_ci->phraseslib->getPhrases( UDFLib::PHRASES_APP_NAME, - DEFAULT_LANGUAGE, + getUserLanguage(), $jsonSchema->{UDFLib::LABEL}, null, null, @@ -738,7 +738,7 @@ class UDFLib // Load the related phrase $tmpResult = $this->_ci->phraseslib->getPhrases( UDFLib::PHRASES_APP_NAME, - DEFAULT_LANGUAGE, + getUserLanguage(), $jsonSchema->{UDFLib::TITLE}, null, null, @@ -756,7 +756,7 @@ class UDFLib // Load the related phrase $tmpResult = $this->_ci->phraseslib->getPhrases( UDFLib::PHRASES_APP_NAME, - DEFAULT_LANGUAGE, + getUserLanguage(), $jsonSchema->{UDFLib::PLACEHOLDER}, null, null, diff --git a/application/models/codex/Orgform_model.php b/application/models/codex/Orgform_model.php index 69a9d6b0d..0de30f1db 100644 --- a/application/models/codex/Orgform_model.php +++ b/application/models/codex/Orgform_model.php @@ -11,20 +11,17 @@ class Orgform_model extends DB_Model $this->dbTable = 'bis.tbl_orgform'; $this->pk = 'orgform_kurzbz'; } - + /** * Returns all the orgform except VBB and ZGS */ public function getOrgformLV() { - // Checks rights - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - $query = "SELECT * FROM bis.tbl_orgform WHERE orgform_kurzbz NOT IN ('VBB', 'ZGS') ORDER BY orgform_kurzbz"; - + return $this->execQuery($query); } } diff --git a/application/models/content/Ampel_model.php b/application/models/content/Ampel_model.php index 4b8fab15a..c50025a12 100644 --- a/application/models/content/Ampel_model.php +++ b/application/models/content/Ampel_model.php @@ -50,7 +50,7 @@ class Ampel_model extends DB_Model */ public function execBenutzerSelect($benutzer_select) { - if (isset($benutzer_select) && !isEmptyString($benutzer_select)) + if (!isEmptyString($benutzer_select)) { return $this->execQuery($benutzer_select); } diff --git a/application/models/crm/Akte_model.php b/application/models/crm/Akte_model.php index a5d67c96f..b30e175c3 100644 --- a/application/models/crm/Akte_model.php +++ b/application/models/crm/Akte_model.php @@ -17,9 +17,6 @@ class Akte_model extends DB_Model */ public function getAkten($person_id, $dokument_kurzbz = null, $stg_kz = null, $prestudent_id = null) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - $query = 'SELECT akte_id, person_id, dokument_kurzbz, @@ -76,9 +73,6 @@ class Akte_model extends DB_Model */ public function getAktenAccepted($person_id, $dokument_kurzbz = null) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - $query = 'SELECT a.akte_id, a.person_id, a.dokument_kurzbz, @@ -122,10 +116,6 @@ class Akte_model extends DB_Model */ public function getAktenAcceptedDms($person_id, $dokument_kurzbz = null) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - if (isError($ent = $this->isEntitled('campus.tbl_dms', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - $query = 'SELECT a.akte_id, a.person_id, a.dokument_kurzbz, @@ -183,8 +173,6 @@ class Akte_model extends DB_Model */ public function getAktenWithDokInfo($person_id, $dokument_kurzbz = null, $nachgereicht = null) { - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - $this->addSelect('public.tbl_akte.*, bezeichnung_mehrsprachig, dokumentbeschreibung_mehrsprachig, public.tbl_dokument.bezeichnung as dokument_bezeichnung, bis.tbl_nation.*, ausstellungsdetails'); $this->addJoin('public.tbl_dokument', 'dokument_kurzbz'); $this->addJoin('bis.tbl_nation', 'ausstellungsnation = nation_code', 'LEFT'); @@ -203,5 +191,4 @@ class Akte_model extends DB_Model return success($dokumente->retval); } - } diff --git a/application/models/crm/Dokumentprestudent_model.php b/application/models/crm/Dokumentprestudent_model.php index 001df404b..ab4764479 100644 --- a/application/models/crm/Dokumentprestudent_model.php +++ b/application/models/crm/Dokumentprestudent_model.php @@ -11,17 +11,14 @@ class Dokumentprestudent_model extends DB_Model $this->dbTable = 'public.tbl_dokumentprestudent'; $this->pk = array('prestudent_id', 'dokument_kurzbz'); } - + /** * setAccepted */ public function setAccepted($prestudent_id, $studiengang_kz) { - if (isError($ent = $this->isEntitled('public.tbl_dokumentprestudent', PermissionLib::INSERT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $result = null; - + if (is_numeric($prestudent_id) && is_numeric($studiengang_kz)) { $query = 'INSERT INTO public.tbl_dokumentprestudent (dokument_kurzbz, prestudent_id, insertamum) ( @@ -37,23 +34,20 @@ class Dokumentprestudent_model extends DB_Model AND p.prestudent_id = ? AND ds.studiengang_kz = ? )'; - + $result = $this->execQuery($query, array($prestudent_id, $studiengang_kz)); } - + return $result; } - + /** * setAcceptedDocuments */ public function setAcceptedDocuments($prestudent_id, $dokument_kurzbz) { - if (isError($ent = $this->isEntitled('public.tbl_dokumentprestudent', PermissionLib::INSERT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $result = null; - + if (is_numeric($prestudent_id) && is_array($dokument_kurzbz) && count($dokument_kurzbz) > 0) { $query = 'INSERT INTO public.tbl_dokumentprestudent (dokument_kurzbz, prestudent_id, insertamum) ( @@ -68,10 +62,10 @@ class Dokumentprestudent_model extends DB_Model WHERE prestudent_id = ? ) )'; - + $result = $this->execQuery($query, array($prestudent_id, $dokument_kurzbz, $prestudent_id)); } - + return $result; } } diff --git a/application/models/crm/Dokumentstudiengang_model.php b/application/models/crm/Dokumentstudiengang_model.php index 697920409..67b546811 100644 --- a/application/models/crm/Dokumentstudiengang_model.php +++ b/application/models/crm/Dokumentstudiengang_model.php @@ -11,19 +11,16 @@ class Dokumentstudiengang_model extends DB_Model $this->dbTable = 'public.tbl_dokumentstudiengang'; $this->pk = array('studiengang_kz', 'dokument_kurzbz'); } - + /** * getDokumentstudiengangByStudiengang_kz */ public function getDokumentstudiengangByStudiengang_kz($studiengang_kz, $onlinebewerbung = null, $pflicht = null, $nachreichbar = null) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('public.tbl_dokument', 's', FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - $this->addJoin('public.tbl_dokument', 'dokument_kurzbz'); - + $parameterArray = array('studiengang_kz' => $studiengang_kz); - + if( isset($onlinebewerbung)) { $parameterArray['onlinebewerbung'] = $onlinebewerbung; @@ -33,12 +30,12 @@ class Dokumentstudiengang_model extends DB_Model { $parameterArray['pflicht'] = $pflicht; } - + if( isset($nachreichbar)) { $parameterArray['nachreichbar'] = $nachreichbar; } - + return $this->loadWhere($parameterArray); } } diff --git a/application/models/crm/Prestudent_model.php b/application/models/crm/Prestudent_model.php index 2473099eb..4cfe08e9a 100644 --- a/application/models/crm/Prestudent_model.php +++ b/application/models/crm/Prestudent_model.php @@ -17,12 +17,6 @@ class Prestudent_model extends DB_Model */ public function getLastStatuses($person_id, $studiensemester_kurzbz = null, $studiengang_kz = null, $status_kurzbz = null) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('public.tbl_status', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - if (isError($ent = $this->isEntitled('public.tbl_prestudent', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - if (isError($ent = $this->isEntitled('public.tbl_prestudentstatus', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $query = 'SELECT * FROM public.tbl_prestudent p JOIN ( @@ -87,8 +81,6 @@ class Prestudent_model extends DB_Model $studiengang = null, $studiensemester = null, $gruppe = null, $reihungstest = null, $stufe = null ) { - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - $this->addSelect( 'p.person_id, prestudent_id, diff --git a/application/models/crm/Prestudentstatus_model.php b/application/models/crm/Prestudentstatus_model.php index f2ba9ee0a..db98ddff6 100644 --- a/application/models/crm/Prestudentstatus_model.php +++ b/application/models/crm/Prestudentstatus_model.php @@ -18,12 +18,6 @@ class Prestudentstatus_model extends DB_Model */ public function getLastStatus($prestudent_id, $studiensemester_kurzbz = '', $status_kurzbz = '') { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('public.tbl_status', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - if (isError($ent = $this->isEntitled('lehre.tbl_studienplan', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - if (isError($ent = $this->isEntitled('public.tbl_prestudentstatus', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $query = 'SELECT tbl_prestudentstatus.*, bezeichnung AS studienplan_bezeichnung, tbl_studienplan.orgform_kurzbz as orgform, @@ -59,8 +53,6 @@ class Prestudentstatus_model extends DB_Model */ public function updateStufe($prestudentIdArray, $stufe) { - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - return $this->execQuery( 'UPDATE public.tbl_prestudentstatus SET rt_stufe = ? @@ -85,10 +77,6 @@ class Prestudentstatus_model extends DB_Model */ public function getStatusByFilter($prestudent_id, $status_kurzbz = '', $ausbildungssemester = '', $studiensemester_kurzbz = '') { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('public.tbl_prestudentstatus', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $query = ' SELECT tbl_prestudentstatus.* diff --git a/application/models/organisation/Studiengang_model.php b/application/models/organisation/Studiengang_model.php index a091c9059..af790c831 100644 --- a/application/models/organisation/Studiengang_model.php +++ b/application/models/organisation/Studiengang_model.php @@ -17,11 +17,6 @@ class Studiengang_model extends DB_Model */ public function getAllForBewerbung() { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - if (isError($ent = $this->isEntitled('bis.tbl_lgartcode', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - if (isError($ent = $this->isEntitled('lehre.vw_studienplan', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - $allForBewerbungQuery = 'SELECT DISTINCT studiengang_kz, typ, organisationseinheittyp_kurzbz, @@ -103,8 +98,6 @@ class Studiengang_model extends DB_Model */ public function getStudienplan($studiensemester_kurzbz, $ausbildungssemester, $aktiv, $onlinebewerbung) { - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - // Join table public.tbl_studiengang with table lehre.tbl_studienordnung on column studiengang_kz $this->addJoin('lehre.tbl_studienordnung', 'studiengang_kz'); // Then join with table lehre.tbl_studienplan on column studienordnung_id @@ -140,8 +133,6 @@ class Studiengang_model extends DB_Model */ public function getStudiengangBewerbung($oe_kurzbz = null) { - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - // Join table public.tbl_studiengang with table lehre.tbl_studienordnung on column studiengang_kz $this->addJoin('lehre.tbl_studienordnung', 'studiengang_kz'); // Join table lehre.tbl_studienordnung with table lehre.tbl_akadgrad on column akadgrad_id @@ -213,8 +204,6 @@ class Studiengang_model extends DB_Model */ public function getAppliedStudiengang($person_id, $studiensemester_kurzbz, $titel) { - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - // Then join with table public.tbl_prestudent $this->addJoin('public.tbl_prestudent', 'studiengang_kz'); // Join table public.tbl_prestudentstatus @@ -262,8 +251,6 @@ class Studiengang_model extends DB_Model */ public function getAppliedStudiengangFromNow($person_id, $titel) { - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - // Then join with table public.tbl_prestudent $this->addJoin('public.tbl_prestudent', 'studiengang_kz'); // Join table public.tbl_prestudentstatus @@ -315,8 +302,6 @@ class Studiengang_model extends DB_Model */ public function getAppliedStudiengangFromNowOE($person_id, $titel, $oe_kurzbz) { - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - // Then join with table public.tbl_prestudent $this->addJoin('public.tbl_prestudent', 'studiengang_kz'); // Join table public.tbl_prestudentstatus @@ -381,17 +366,6 @@ class Studiengang_model extends DB_Model */ public function getAvailableReihungstestByPersonId($person_id) { - if (isError($ent = $this->isEntitled('lehre.tbl_studienplan', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_prestudent', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_reihungstest', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('lehre.tbl_studienordnung', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_prestudentstatus', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $this->addJoin('lehre.tbl_studienordnung', 'studiengang_kz'); $this->addJoin('lehre.tbl_studienplan', 'studienordnung_id'); diff --git a/application/models/organisation/Studiensemester_model.php b/application/models/organisation/Studiensemester_model.php index e3c1261ca..cb693144d 100644 --- a/application/models/organisation/Studiensemester_model.php +++ b/application/models/organisation/Studiensemester_model.php @@ -12,37 +12,31 @@ class Studiensemester_model extends DB_Model $this->pk = 'studiensemester_kurzbz'; $this->hasSequence = false; } - + /** * getLastOrAktSemester */ public function getLastOrAktSemester($days = 60) { - // Checks rights - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - if (!is_numeric($days)) { $days = 60; } - + $query = 'SELECT studiensemester_kurzbz FROM public.tbl_studiensemester WHERE start < NOW() - \'' . $days . ' DAYS\'::INTERVAL ORDER BY start DESC LIMIT 1'; - + return $this->execQuery($query); } - + /** * getNextFrom */ public function getNextFrom($studiensemester_kurzbz) { - // Checks rights - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - $query = 'SELECT studiensemester_kurzbz, start, ende @@ -54,24 +48,20 @@ class Studiensemester_model extends DB_Model ) ORDER BY start LIMIT 1'; - + return $this->execQuery($query, array($studiensemester_kurzbz)); } - + /** * getNearest */ public function getNearest($semester = '') { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('public.vw_studiensemester', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $query = 'SELECT studiensemester_kurzbz, start, ende FROM public.vw_studiensemester'; - + if (is_numeric($semester)) { if ($semester % 2 == 0) @@ -85,9 +75,9 @@ class Studiensemester_model extends DB_Model $query .= ' WHERE SUBSTRING(studiensemester_kurzbz FROM 1 FOR 2) = \'' . $ss . '\''; } - + $query .= ' ORDER BY delta LIMIT 1'; - + return $this->execQuery($query); } } diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php index 274b66c2f..0492719a4 100644 --- a/application/models/person/Person_model.php +++ b/application/models/person/Person_model.php @@ -27,17 +27,6 @@ class Person_model extends DB_Model */ public function checkBewerbung($email, $studiensemester_kurzbz = null) { - if (isError($ent = $this->isEntitled('public.tbl_person', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_kontakt', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_benutzer', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_prestudent', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_prestudentstatus', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $checkBewerbungQuery = ''; $parametersArray = array($email, $email, $email); @@ -103,12 +92,6 @@ class Person_model extends DB_Model */ public function getPersonFromStatus($status_kurzbz, $von, $bis) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('public.tbl_prestudent', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_prestudentstatus', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $this->addJoin('public.tbl_prestudent', 'person_id'); $this->addJoin('public.tbl_benutzer', 'person_id'); diff --git a/application/models/system/Extensions_model.php b/application/models/system/Extensions_model.php index 0792732d8..8898ebd50 100644 --- a/application/models/system/Extensions_model.php +++ b/application/models/system/Extensions_model.php @@ -17,8 +17,6 @@ class Extensions_model extends DB_Model */ public function getDependencies($dependencies) { - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - return $this->execQuery( 'SELECT * FROM '.$this->dbTable.' @@ -49,8 +47,6 @@ class Extensions_model extends DB_Model */ public function executeQuery($sql) { - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - return $this->execQuery($sql); } } diff --git a/application/models/system/MessageToken_model.php b/application/models/system/MessageToken_model.php index a7f5b6b5c..04f23382d 100644 --- a/application/models/system/MessageToken_model.php +++ b/application/models/system/MessageToken_model.php @@ -18,7 +18,7 @@ class MessageToken_model extends CI_Model $this->config->load('message'); // Load return message helper - $this->load->helper('message'); + $this->load->helper('fhc_message'); // Loads the database object $this->load->database(); @@ -32,6 +32,7 @@ class MessageToken_model extends CI_Model $sql = 'SELECT r.message_id, m.person_id as sender_id, r.person_id as receiver_id, + r.sent, m.subject, m.body, m.insertamum, @@ -176,7 +177,35 @@ class MessageToken_model extends CI_Model } /** - * + * Get data of a person + */ + public function getPersonData($person_id) + { + $sql = 'SELECT person_id, + vorname as "Vorname", + nachname as "Nachname", + anrede as "Anrede", + titelpost as "TitelPost", + titelpre as "TitelPre", + vornamen as "Vornamen" + FROM public.tbl_person + WHERE person_id %s ?'; + + $result = $this->db->query(sprintf($sql, is_array($person_id) ? 'IN' : '='), array($person_id)); + + // If no errors occurred + if ($result) + { + return success($result->result()); + } + else + { + return error($this->db->error()); + } + } + + /** + * Searchs for a person by its person_id and checks if it is an employee */ public function isEmployee($person_id) { diff --git a/application/models/system/Message_model.php b/application/models/system/Message_model.php index 80a2b35ad..764c3ae14 100644 --- a/application/models/system/Message_model.php +++ b/application/models/system/Message_model.php @@ -19,14 +19,6 @@ class Message_model extends DB_Model */ public function getMessagesByPerson($person_id, $oe_kurzbz, $all) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('public.tbl_person', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_msg_status', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $sql = 'SELECT m.message_id, m.person_id, m.subject, @@ -93,16 +85,6 @@ class Message_model extends DB_Model */ public function getMessagesOfPerson($person_id, $status = null) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('public.tbl_person', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_msg_status', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_msg_recipient', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $sql = 'SELECT m.message_id, m.person_id, m.subject, @@ -129,7 +111,7 @@ class Message_model extends DB_Model s.statusinfo, s.insertamum AS statusamum FROM public.tbl_msg_message m - JOIN public.tbl_msg_recipient r ON m.message_id = r.message_id + JOIN public.tbl_msg_recipient r ON m.message_id = r.message_id JOIN public.tbl_person se ON (m.person_id = se.person_id) JOIN public.tbl_person re ON (r.person_id = re.person_id) LEFT JOIN ( diff --git a/application/models/system/PersonLog_model.php b/application/models/system/PersonLog_model.php index e5f2c543d..325fba88e 100644 --- a/application/models/system/PersonLog_model.php +++ b/application/models/system/PersonLog_model.php @@ -42,11 +42,6 @@ class PersonLog_model extends CI_Model */ public function getLastLog($person_id, $taetigkeit_kurzbz = null, $app = null, $oe_kurzbz = null) { - // Check Permissions - $this->load->library('PermissionLib'); - if(!$this->permissionlib->isEntitled('system.tbl_log',PermissionLib::SELECT_RIGHT)) - show_error('Permission denied - You need Access to system.tbl_log'); - $this->db->order_by('zeitpunkt', 'DESC'); $this->db->order_by('log_id', 'DESC'); $this->db->limit(1); @@ -72,11 +67,6 @@ class PersonLog_model extends CI_Model */ public function filterLog($person_id, $taetigkeit_kurzbz = null, $app = null, $oe_kurzbz = null) { - // Check Permissions - $this->load->library('PermissionLib'); - if(!$this->permissionlib->isEntitled('system.tbl_log',PermissionLib::SELECT_RIGHT)) - show_error('Permission denied - You need Access to system.tbl_log'); - $this->db->order_by('zeitpunkt', 'DESC'); $this->db->order_by('log_id', 'DESC'); if (!is_null($taetigkeit_kurzbz)) diff --git a/application/models/system/Phrase_model.php b/application/models/system/Phrase_model.php index 65ced9c99..50b36a429 100644 --- a/application/models/system/Phrase_model.php +++ b/application/models/system/Phrase_model.php @@ -17,12 +17,6 @@ class Phrase_model extends DB_Model */ public function getPhrases($app, $sprache, $phrase = null, $orgeinheit_kurzbz = null, $orgform_kurzbz = null) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('system.tbl_phrase', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('system.tbl_phrasentext', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $parametersArray = array('app' => $app, 'sprache' => $sprache); $query = 'SELECT phrase, diff --git a/application/models/system/Recipient_model.php b/application/models/system/Recipient_model.php index b9e170fbf..654a9a883 100644 --- a/application/models/system/Recipient_model.php +++ b/application/models/system/Recipient_model.php @@ -18,16 +18,6 @@ class Recipient_model extends DB_Model */ public function getMessage($message_id, $person_id) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('public.tbl_person', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_kontakt', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_msg_recipient', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $query = 'SELECT mr.message_id, mr.person_id, mm.subject, @@ -55,17 +45,10 @@ class Recipient_model extends DB_Model */ public function getMessageByToken($token) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('public.tbl_msg_recipient', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_msg_status', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $sql = 'SELECT r.message_id, m.person_id as sender_id, r.person_id as receiver_id, + r.sent, m.subject, m.body, m.insertamum, @@ -89,16 +72,6 @@ class Recipient_model extends DB_Model */ public function getMessagesByPerson($person_id, $oe_kurzbz, $all) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('public.tbl_msg_recipient', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_person', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_msg_status', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $sql = 'SELECT DISTINCT ON (r.message_id) r.message_id, m.person_id, m.subject, @@ -166,21 +139,6 @@ class Recipient_model extends DB_Model */ public function getMessagesByUID($uid, $oe_kurzbz, $all) { - // Checks if the operation is permitted by the API caller - // TODO: Define the special right for reading own messages 'basis/message:own' - // if same user - if ($uid === getAuthUID()) - { - if (isError($ent = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - } - // if different user, for reading messages from other users - else - { - if (isError($ent = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - } - // get Data $sql = 'SELECT DISTINCT ON (r.message_id) r.message_id, m.person_id, @@ -249,14 +207,6 @@ class Recipient_model extends DB_Model */ public function getMessages($kontaktType, $sent, $limit = null, $message_id = null) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('public.tbl_msg_recipient', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_kontakt', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $query = 'SELECT mm.message_id, ks.kontakt as sender, kr.kontakt as receiver, @@ -321,12 +271,6 @@ class Recipient_model extends DB_Model */ public function getCountUnreadMessages($person_id, $oe_kurzbz) { - // Checks if the operation is permitted by the API caller - if (isError($ent = $this->isEntitled('public.tbl_msg_recipient', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - if (isError($ent = $this->isEntitled('public.tbl_msg_status', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) - return $ent; - $sql = 'SELECT COUNT(r.message_id) AS unreadMessages FROM public.tbl_msg_recipient r JOIN public.tbl_msg_status s ON (r.message_id = s.message_id AND r.person_id = s.person_id) diff --git a/application/models/system/Vorlage_model.php b/application/models/system/Vorlage_model.php index 380f26b99..8022e71fc 100644 --- a/application/models/system/Vorlage_model.php +++ b/application/models/system/Vorlage_model.php @@ -17,11 +17,8 @@ class Vorlage_model extends DB_Model */ public function getMimeTypes() { - // Checks rights - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - $query = 'SELECT DISTINCT mimetype FROM public.tbl_vorlage ORDER BY mimetype'; - + return $this->execQuery($query); } } diff --git a/application/models/system/Vorlagedokument_model.php b/application/models/system/Vorlagedokument_model.php index e557d6e4d..1a61cf8c7 100644 --- a/application/models/system/Vorlagedokument_model.php +++ b/application/models/system/Vorlagedokument_model.php @@ -17,9 +17,6 @@ class Vorlagedokument_model extends DB_Model */ public function loadDokumenteFromVorlagestudiengang($vorlagestudiengang_id) { - // Checks rights - if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - $qry = 'SELECT vorlagedokument_id, sort, vorlagestudiengang_id, @@ -29,7 +26,7 @@ class Vorlagedokument_model extends DB_Model JOIN public.tbl_dokument USING(dokument_kurzbz) WHERE vorlagestudiengang_id = ? ORDER BY sort ASC'; - + return $this->execQuery($qry, array($vorlagestudiengang_id)); } } diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 06e29a44f..f1276bb36 100755 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -196,6 +196,7 @@ ) ORDER BY "LastAction" ASC ', + 'requiredPermissions' => 'infocenter', 'checkboxes' => 'PersonId', 'additionalColumns' => array('Details'), 'columnsAliases' => array( @@ -218,6 +219,7 @@ ), 'formatRow' => function($datasetRaw) { + /* NOTE: Dont use $this here for PHP Version compatibility */ $datasetRaw->{'Details'} = sprintf( 'Details', site_url('system/infocenter/InfoCenter/showDetails'), @@ -306,7 +308,7 @@ ); $filterWidgetArray['app'] = $APP; - $filterWidgetArray['datasetName'] = 'PersonActions'; + $filterWidgetArray['datasetName'] = 'overview'; $filterWidgetArray['filterKurzbz'] = 'InfoCenterSentApplicationAll'; $filterWidgetArray['filter_id'] = $this->input->get('filter_id'); diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php index 145c2e323..d96f42c9f 100644 --- a/application/views/system/infocenter/infocenterFreigegebenData.php +++ b/application/views/system/infocenter/infocenterFreigegebenData.php @@ -133,6 +133,7 @@ ) ORDER BY "LastAction" DESC ', + 'requiredPermissions' => 'infocenter', 'checkboxes' => 'PersonId', 'additionalColumns' => array('Details'), 'columnsAliases' => array( @@ -152,6 +153,7 @@ ), 'formatRow' => function($datasetRaw) { + /* NOTE: Dont use $this here for PHP Version compatibility */ $datasetRaw->{'Details'} = sprintf( 'Details', site_url('system/infocenter/InfoCenter/showDetails'), @@ -215,7 +217,7 @@ ); $filterWidgetArray['app'] = $APP; - $filterWidgetArray['datasetName'] = 'PersonActions'; + $filterWidgetArray['datasetName'] = 'freigegeben'; $filterWidgetArray['filterKurzbz'] = 'InfoCenterFreigegeben5days'; $filterWidgetArray['filter_id'] = $this->input->get('filter_id'); diff --git a/application/views/system/messageForm.php b/application/views/system/messageForm.php new file mode 100644 index 000000000..d1436a492 --- /dev/null +++ b/application/views/system/messageForm.php @@ -0,0 +1,81 @@ +
+
+
+ +
+
+ 1 && $i % 10 == 0) + { + echo '
'; + } + echo $receiver->Vorname." ".$receiver->Nachname."; "; + } + ?> +
+
+
+
+
+
+ +
  + subject; + } + ?> +
+ +
+
+
+
+
+
+ +

On '.date_format(date_create($message->sent), 'd.m.Y H:i').' '.$receivers[0]->Vorname.' '.$receivers[0]->Nachname.' wrote:'.'
'; + $body .= '
'; + $body .= $message->body.'
'; + } + ?> + +
+ +
+
+ + +
+
+ +
+
+
+
+ +
+
\ No newline at end of file diff --git a/application/views/system/messageHTML.php b/application/views/system/messageHTML.php index 6a1d509ba..0ae6c3866 100644 --- a/application/views/system/messageHTML.php +++ b/application/views/system/messageHTML.php @@ -1,58 +1,75 @@ -load->view("templates/header", array("title" => "Message viewer")); ?> - + load->view( + 'templates/FHC-Header', + array( + 'title' => 'MessageSent', + 'jquery' => true, + 'bootstrap' => true, + 'fontawesome' => true, + 'sbadmintemplate' => true, + 'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messaging/messageReply.css') + ) + ); + ?> -
-

- - - - - - - - - - - - - - - - - - - - - -
- From: - -   - - vorname.' '.$sender->nachname; ?> -
- Subject: - -   - - subject; ?> -
-
- Message: -
-   - - body; ?> -
- Reply -
-
- +
+
+
+
+
+ +
+
+
+
+
+
+ subject; ?> +
+
+ + + + + + + + + + + + + +
+ From: + + vorname.' '.$sender->nachname; ?> +
+ Subject: + + subject; ?> +
+ Message: + + body; ?> +
+
+ +
+
+
+
+
+
- -load->view("templates/footer"); ?> + load->view("templates/FHC-Footer"); ?> \ No newline at end of file diff --git a/application/views/system/messageSent.php b/application/views/system/messageSent.php new file mode 100644 index 000000000..257bace0b --- /dev/null +++ b/application/views/system/messageSent.php @@ -0,0 +1,107 @@ +load->view( + 'templates/FHC-Header', + array( + 'title' => 'MessageSent', + 'jquery' => true, + 'bootstrap' => true, + 'fontawesome' => true, + 'sbadmintemplate' => true, + 'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messaging/messageSent.css') + ) +); +?> + +
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+
+
+ Message sent successfully! +
+
+ Nachricht erfolgreich versandt! +
+
+
+
+
+
+ + Thank you for your message. + + + We will get back to you shortly. + +
+
+ + Herzlichen Dank für Ihre Nachricht. + + + Wir werden uns schnellstmöglich um Ihr Anliegen kümmern. + +
+
+
+
+
+ You can safely close this window. +
+
+ Sie können dieses Fenster schließen. +
+
+
+
+
+ Ihr InfoCenter@FHTW Team +
+
+ Your InfoCenter@FHTW Team +
+
+
+
+
+
+
+

+ Fachhochschule Technikum Wien | University of Applied Sciences Technikum Wien +
Hoechstaedtplatz 6, 1200 Wien, AUSTRIA +
www.technikum-wien.at +

+
+
+
+ +
+
+
+
+ + +load->view("templates/FHC-Footer"); ?> diff --git a/application/views/system/messageWrite.php b/application/views/system/messageWrite.php index 6b7b1a4ae..e53872ac4 100644 --- a/application/views/system/messageWrite.php +++ b/application/views/system/messageWrite.php @@ -8,24 +8,14 @@ $this->load->view( 'fontawesome' => true, 'tinymce' => true, 'sbadmintemplate' => true, - 'customCSSs' => 'public/css/sbadmin2/admintemplate_contentonly.css', - 'customJSs' => 'public/js/bootstrapper.js' + 'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messaging/messageWrite.css'), + 'customJSs' => array('public/js/bootstrapper.js') ) ); ?> -
@@ -38,10 +28,10 @@ $href = str_replace("/system/Messages/write", "/system/Messages/send", $_SERVER[
-
+
-
+
-
-
- +
+
+
  subject; } ?> -
+
+ name="subject">
@@ -110,7 +100,7 @@ $href = str_replace("/system/Messages/write", "/system/Messages/send", $_SERVER[

-
+
widgetlib->widget( 'Vorlage_widget', @@ -119,7 +109,7 @@ $href = str_replace("/system/Messages/write", "/system/Messages/send", $_SERVER[ ); ?>
-
+
@@ -136,7 +126,7 @@ $href = str_replace("/system/Messages/write", "/system/Messages/send", $_SERVER[
@@ -24,13 +24,13 @@ - phrasentext_id; ?> + phrasentext_id; ?> sprache; ?> orgeinheit_kurzbz; ?> orgform_kurzbz; ?> text; ?> description; ?> - edit + edit delete diff --git a/application/views/system/vorlage/templatetextList.php b/application/views/system/vorlage/templatetextList.php index 7eb2b84e3..8736b36ee 100644 --- a/application/views/system/vorlage/templatetextList.php +++ b/application/views/system/vorlage/templatetextList.php @@ -5,7 +5,7 @@

Vorlagentext -

-
+
@@ -28,8 +28,8 @@ - vorlagestudiengang_id; ?> - vorlage_kurzbz; ?> + vorlagestudiengang_id; ?> + vorlage_kurzbz; ?> version; ?> oe_kurzbz; ?> diff --git a/application/views/templates/FHC-Header.php b/application/views/templates/FHC-Header.php index 78b5692cc..0e1021da3 100755 --- a/application/views/templates/FHC-Header.php +++ b/application/views/templates/FHC-Header.php @@ -1,160 +1,39 @@ config->item('index_page'); -$calledPath = $this->router->directory.$this->router->class; -$calledMethod = $this->router->method; + // Retrives the name of the index page, the URL path of the called controller and the called controller + // NOTE: placed here because it doesn't work inside functions + $indexPage = $this->config->item('index_page'); + $calledPath = $this->router->directory.$this->router->class; + $calledMethod = $this->router->method; -// By default set the parameters to null -$title = isset($title) ? $title : null; -$customCSSs = isset($customCSSs) ? $customCSSs : null; -$customJSs = isset($customJSs) ? $customJSs : null; -$phrases = isset($phrases) ? $phrases : null; - -// By default set the parameters to false -$jquery = isset($jquery) ? $jquery : false; -$jqueryui = isset($jqueryui) ? $jqueryui : false; -$ajaxlib = isset($ajaxlib) ? $ajaxlib : false; -$bootstrap = isset($bootstrap) ? $bootstrap : false; -$fontawesome = isset($fontawesome) ? $fontawesome : false; -$tablesorter = isset($tablesorter) ? $tablesorter : false; -$tinymce = isset($tinymce) ? $tinymce : false; -$sbadmintemplate = isset($sbadmintemplate) ? $sbadmintemplate : false; -$addons = isset($addons) ? $addons : false; -$filterwidget = isset($filterwidget) ? $filterwidget : false; -$navigationwidget = isset($navigationwidget) ? $navigationwidget : false; - -/** - * Print the given title of the page - * NOTE: this is a required field, must be specified otherwise an error is shown - */ -function _printTitle($title) -{ - if ($title != null) - { - echo $title; - } - else - { - show_error('The title for this page is not set'); - } -} - -/** - * Generates tags for the style sheets you want to include, the parameter could by a string or an array of strings - */ -function _generateCSSsInclude($CSSs) -{ - $cssLink = ''; - - if (isset($CSSs)) - { - $tmpCSSs = is_array($CSSs) ? $CSSs : array($CSSs); - - for ($tmpCSSsCounter = 0; $tmpCSSsCounter < count($tmpCSSs); $tmpCSSsCounter++) - { - $toPrint = sprintf($cssLink, base_url($tmpCSSs[$tmpCSSsCounter])).PHP_EOL; - - if ($tmpCSSsCounter > 0) $toPrint = "\t\t".$toPrint; - - echo $toPrint; - } - } -} - -/** - * Generates global JS-Object to pass parms to other javascripts - */ -function _generateJSDataStorageObject($indexPage, $calledPath, $calledMethod) -{ - $toPrint = "\n"; - $toPrint .= ''; - $toPrint .= "\n\n"; - - echo $toPrint; -} - -/** - * Generates global JS-Object to pass phrases to other javascripts - */ -function _generateJSPhrasesStorageObject($phrases) -{ - $ci =& get_instance(); - $ci->load->library('PhrasesLib', array($phrases), 'pj'); - - $toPrint = "\n"; - $toPrint .= ''; - $toPrint .= "\n\n"; - - echo $toPrint; -} - -/** - * Generates tags for the javascripts you want to include, the parameter could by a string or an array of strings - */ -function _generateJSsInclude($JSs) -{ - $jsInclude = ''; - - if (isset($JSs)) - { - $tmpJSs = is_array($JSs) ? $JSs : array($JSs); - - for ($tmpJSsCounter = 0; $tmpJSsCounter < count($tmpJSs); $tmpJSsCounter++) - { - $toPrint = sprintf($jsInclude, base_url($tmpJSs[$tmpJSsCounter])).PHP_EOL; - - if ($tmpJSsCounter > 0) $toPrint = "\t\t".$toPrint; - - echo $toPrint; - } - } -} - -/** - * Generates all the includes needed by the Addons - */ -function _generateAddonsJSsInclude($calledFrom) -{ - $aktive_addons = array_filter(explode(";", ACTIVE_ADDONS)); - - foreach ($aktive_addons as $addon) - { - $hookfile = DOC_ROOT.'addons/'.$addon.'/hooks.config.inc.php'; - if (file_exists($hookfile)) - { - include($hookfile); - if (key_exists($calledFrom, $js_hooks)) - { - foreach ($js_hooks[$calledFrom] as $js_file) - _generateJSsInclude('addons/'.$addon.'/'.$js_file); - } - } - } -} + // By default set the parameters to null + $title = isset($title) ? $title : null; + $customCSSs = isset($customCSSs) ? $customCSSs : null; + $customJSs = isset($customJSs) ? $customJSs : null; + $phrases = isset($phrases) ? $phrases : null; + // By default set the parameters to false + $addons = isset($addons) ? $addons : false; + $ajaxlib = isset($ajaxlib) ? $ajaxlib : false; + $bootstrap = isset($bootstrap) ? $bootstrap : false; + $filterwidget = isset($filterwidget) ? $filterwidget : false; + $fontawesome = isset($fontawesome) ? $fontawesome : false; + $jquery = isset($jquery) ? $jquery : false; + $jqueryui = isset($jqueryui) ? $jqueryui : false; + $jquerytreetable = isset($jquerytreetable) ? $jquerytreetable : false; + $navigationwidget = isset($navigationwidget) ? $navigationwidget : false; + $sbadmintemplate = isset($sbadmintemplate) ? $sbadmintemplate : false; + $tablesorter = isset($tablesorter) ? $tablesorter : false; + $tinymce = isset($tinymce) ? $tinymce : false; ?> + - <?php _printTitle($title); ?> + <?php printPageTitle($title); ?> @@ -162,40 +41,49 @@ function _generateAddonsJSsInclude($calledFrom) // -------------------------------------------------------------------------------------------------------- // CSS + // -------------------------------------------------------------------------------------------------------- + // From vendor folder + // jQuery UI CSS - if ($jqueryui === true) _generateCSSsInclude('vendor/components/jqueryui/themes/base/jquery-ui.min.css'); + if ($jqueryui === true) generateCSSsInclude('vendor/components/jqueryui/themes/base/jquery-ui.min.css'); // Bootstrap CSS - if ($bootstrap === true) _generateCSSsInclude('vendor/twbs/bootstrap/dist/css/bootstrap.min.css'); + if ($bootstrap === true) generateCSSsInclude('vendor/twbs/bootstrap/dist/css/bootstrap.min.css'); // Font Awesome CSS - if ($fontawesome === true) _generateCSSsInclude('vendor/components/font-awesome/css/font-awesome.min.css'); - - // AjaxLib CSS - if ($ajaxlib === true) _generateCSSsInclude('public/css/AjaxLib.css'); + if ($fontawesome === true) generateCSSsInclude('vendor/components/font-awesome/css/font-awesome.min.css'); // Table sorter CSS if ($tablesorter === true) { - _generateCSSsInclude('vendor/mottie/tablesorter/dist/css/theme.default.min.css'); - _generateCSSsInclude('vendor/mottie/tablesorter/dist/css/jquery.tablesorter.pager.min.css'); + generateCSSsInclude('vendor/mottie/tablesorter/dist/css/theme.default.min.css'); + generateCSSsInclude('vendor/mottie/tablesorter/dist/css/jquery.tablesorter.pager.min.css'); } // SB Admin 2 template CSS if ($sbadmintemplate === true) { - _generateCSSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/vendor/metisMenu/metisMenu.min.css'); - _generateCSSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/dist/css/sb-admin-2.min.css'); + generateCSSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/vendor/metisMenu/metisMenu.min.css'); + generateCSSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/dist/css/sb-admin-2.min.css'); } + // jQuery treetable + if ($jquerytreetable === true) generateCSSsInclude('vendor/ludo/jquery-treetable/css/jquery.treetable.css'); + + // -------------------------------------------------------------------------------------------------------- + // From public folder + + // AjaxLib CSS + if ($ajaxlib === true) generateCSSsInclude('public/css/AjaxLib.css'); + // FilterWidget CSS - if ($filterwidget === true) _generateCSSsInclude('public/css/FilterWidget.css'); + if ($filterwidget === true) generateCSSsInclude('public/css/FilterWidget.css'); // NavigationWidget CSS - if ($navigationwidget === true) _generateCSSsInclude('public/css/NavigationWidget.css'); + if ($navigationwidget === true) generateCSSsInclude('public/css/NavigationWidget.css'); // Eventually required CSS - _generateCSSsInclude($customCSSs); // Eventually required CSS + generateCSSsInclude($customCSSs); // Eventually required CSS // -------------------------------------------------------------------------------------------------------- @@ -203,61 +91,72 @@ function _generateAddonsJSsInclude($calledFrom) // Generates the global object to pass useful parameters to other javascripts // NOTE: must be called before any other JS include - _generateJSDataStorageObject($indexPage, $calledPath, $calledMethod); + generateJSDataStorageObject($indexPage, $calledPath, $calledMethod); // Generates the global object to pass phrases to javascripts // NOTE: must be called before including the PhrasesLib.js - _generateJSPhrasesStorageObject($phrases); + if ($phrases != null) generateJSPhrasesStorageObject($phrases); - // JQuery V3 - if ($jquery === true) _generateJSsInclude('vendor/components/jquery/jquery.min.js'); + // -------------------------------------------------------------------------------------------------------- + // From vendor folder - // JQuery UI + // jQuery V3 + if ($jquery === true) generateJSsInclude('vendor/components/jquery/jquery.min.js'); + + // jQuery UI if ($jqueryui === true) { - _generateJSsInclude('vendor/components/jqueryui/jquery-ui.min.js'); - _generateJSsInclude('vendor/components/jqueryui/ui/i18n/datepicker-de.js'); // datepicker german language file + generateJSsInclude('vendor/components/jqueryui/jquery-ui.min.js'); + generateJSsInclude('vendor/components/jqueryui/ui/i18n/datepicker-de.js'); // datepicker german language file } // Bootstrap JS - if ($bootstrap === true) _generateJSsInclude('vendor/twbs/bootstrap/dist/js/bootstrap.min.js'); + if ($bootstrap === true) generateJSsInclude('vendor/twbs/bootstrap/dist/js/bootstrap.min.js'); // Table sorter JS if ($tablesorter === true) { - _generateJSsInclude('vendor/mottie/tablesorter/dist/js/jquery.tablesorter.min.js'); - _generateJSsInclude('vendor/mottie/tablesorter/dist/js/jquery.tablesorter.widgets.min.js'); - _generateJSsInclude('vendor/mottie/tablesorter/dist/js/extras/jquery.tablesorter.pager.min.js'); + generateJSsInclude('vendor/mottie/tablesorter/dist/js/jquery.tablesorter.min.js'); + generateJSsInclude('vendor/mottie/tablesorter/dist/js/jquery.tablesorter.widgets.min.js'); + generateJSsInclude('vendor/mottie/tablesorter/dist/js/extras/jquery.tablesorter.pager.min.js'); } // Tinymce JS - if($tinymce === true) _generateJSsInclude('vendor/tinymce/tinymce/tinymce.min.js') ; + if ($tinymce === true) generateJSsInclude('vendor/tinymce/tinymce/tinymce.min.js'); // SB Admin 2 template JS if ($sbadmintemplate === true) { - _generateJSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/vendor/metisMenu/metisMenu.min.js'); - _generateJSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/dist/js/sb-admin-2.min.js'); + generateJSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/vendor/metisMenu/metisMenu.min.js'); + generateJSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/dist/js/sb-admin-2.min.js'); + generateBackwardCompatibleJSMsIe('vendor/afarkas/html5shiv/dist/html5shiv.min.js'); + generateBackwardCompatibleJSMsIe('vendor/scottjehl/Respond/dest/respond.min.js'); } + // jQuery treetable + if ($jquerytreetable === true) generateJSsInclude('vendor/ludo/jquery-treetable/jquery.treetable.js'); + + // -------------------------------------------------------------------------------------------------------- + // From public folder + // AjaxLib JS // NOTE: must be called before including others JS libraries that use it - if ($ajaxlib === true) _generateJSsInclude('public/js/AjaxLib.js'); + if ($ajaxlib === true) generateJSsInclude('public/js/AjaxLib.js'); // PhrasesLib JS - if ($phrases != null) _generateJSsInclude('public/js/PhrasesLib.js'); + if ($phrases != null) generateJSsInclude('public/js/PhrasesLib.js'); // FilterWidget JS - if($filterwidget === true) _generateJSsInclude('public/js/FilterWidget.js') ; + if ($filterwidget === true) generateJSsInclude('public/js/FilterWidget.js'); // NavigationWidget JS - if($navigationwidget === true) _generateJSsInclude('public/js/NavigationWidget.js') ; + if ($navigationwidget === true) generateJSsInclude('public/js/NavigationWidget.js'); // Load addon hooks JS - if ($addons === true) _generateAddonsJSsInclude($calledPath.'/'.$calledMethod); + if ($addons === true) generateAddonsJSsInclude($calledPath.'/'.$calledMethod); // Eventually required JS - _generateJSsInclude($customJSs); + generateJSsInclude($customJSs); ?> diff --git a/application/views/widgets/navigationHeader.php b/application/views/widgets/navigationHeader.php index 8e2a936a4..25b557773 100644 --- a/application/views/widgets/navigationHeader.php +++ b/application/views/widgets/navigationHeader.php @@ -1,11 +1,3 @@ diff --git a/application/widgets/FilterWidget.php b/application/widgets/FilterWidget.php index 6350e8057..219c5a103 100644 --- a/application/widgets/FilterWidget.php +++ b/application/widgets/FilterWidget.php @@ -12,9 +12,13 @@ class FilterWidget extends Widget const WIDGET_URL_SELECT_FILTERS = 'widgets/filter/selectFilters'; const WIDGET_URL_SAVE_FILTER = 'widgets/filter/saveFilter'; + // Default formats const DEFAULT_DATE_FORMAT = 'd.m.Y H:i:s'; const DEFAULT_MARK_ROW_CLASS = 'text-danger'; + // Required permissions to use this FilterWidget + private $_requiredPermissions; + // Fitler info from DB private $_app; private $_datasetName; @@ -54,7 +58,9 @@ class FilterWidget extends Widget $this->_initFilterWidget($args); // checks parameters and initialize properties - $this->_startFilterWidget(); // let's start + // Let's start if it's allowed + // NOTE: If it is NOT allowed then no data are loaded + if ($this->filterslib->isAllowed($this->_requiredPermissions)) $this->_startFilterWidget(); } //------------------------------------------------------------------------------------------------------------------ @@ -125,6 +131,7 @@ class FilterWidget extends Widget // If here then everything is ok // Initialize class properties + $this->_requiredPermissions = null; $this->_app = null; $this->_datasetName = null; $this->_filterKurzbz = null; @@ -138,6 +145,12 @@ class FilterWidget extends Widget $this->_hideHeader = null; $this->_hideSave = null; + // Retrived the required permissions parameter if present + if (isset($args[FiltersLib::REQUIRED_PERMISSIONS_PARAMETER])) + { + $this->_requiredPermissions = $args[FiltersLib::REQUIRED_PERMISSIONS_PARAMETER]; + } + // Parameters needed to retrive univocally a filter from DB if (isset($args[FiltersLib::APP_PARAMETER])) { @@ -250,7 +263,7 @@ class FilterWidget extends Widget // Read the all session for this filter widget $session = $this->filterslib->getSession(); - // If session is NOT empty + // If session is NOT empty -> a filter was already loaded if ($session != null) { // Retrive the filterId stored in the session @@ -266,9 +279,9 @@ class FilterWidget extends Widget { // Get SESSION_RELOAD_DATASET from the session $reloadDataset = $this->filterslib->getElementSession(FiltersLib::SESSION_RELOAD_DATASET); - if ($reloadDataset === true) // if it's value is very true, reload the dataset + if ($reloadDataset === true) // if it's value is very true then reload the dataset { - // set as false to stop changing the dataset + // Set as false to stop changing the dataset $this->filterslib->setElementSession(FiltersLib::SESSION_RELOAD_DATASET, false); // Generate dataset query using filters from the session @@ -294,7 +307,7 @@ class FilterWidget extends Widget } } - // If the session is empty + // If the session is empty -> first time that this filter is loaded if ($session == null) { // Load filter definition data from DB @@ -326,27 +339,29 @@ class FilterWidget extends Widget // Stores an array that contains all the data useful for $this->filterslib->setSession( array( - FiltersLib::FILTER_ID => $this->_filterId, // - FiltersLib::APP_PARAMETER => $this->_app, // - FiltersLib::DATASET_NAME_PARAMETER => $this->_datasetName, // - - FiltersLib::SESSION_FILTER_NAME => $filterName, // - - FiltersLib::SESSION_FIELDS => $this->FiltersModel->getExecutedQueryListFields(), // - FiltersLib::SESSION_SELECTED_FIELDS => $this->_getColumnsNames($parsedFilterJson->columns), // - FiltersLib::SESSION_COLUMNS_ALIASES => $this->_columnsAliases, // - FiltersLib::SESSION_ADDITIONAL_COLUMNS => $this->_additionalColumns, // - FiltersLib::SESSION_CHECKBOXES => $this->_checkboxes, // - FiltersLib::SESSION_FILTERS => $parsedFilterJson->filters, // - FiltersLib::SESSION_METADATA => $this->FiltersModel->getExecutedQueryMetaData(), // - FiltersLib::SESSION_ROW_NUMBER => count($dataset->retval), // - FiltersLib::SESSION_DATASET => $dataset->retval, // - FiltersLib::SESSION_RELOAD_DATASET => false // + FiltersLib::FILTER_ID => $this->_filterId, // the current filter id + FiltersLib::APP_PARAMETER => $this->_app, // the current app parameter + FiltersLib::DATASET_NAME_PARAMETER => $this->_datasetName, // the carrent dataset name + FiltersLib::SESSION_FILTER_NAME => $filterName, // the current filter name + FiltersLib::SESSION_FIELDS => $this->FiltersModel->getExecutedQueryListFields(), // all the fields of the dataset + FiltersLib::SESSION_SELECTED_FIELDS => $this->_getColumnsNames($parsedFilterJson->columns), // all the selected fields + FiltersLib::SESSION_COLUMNS_ALIASES => $this->_columnsAliases, // all the fields aliases + FiltersLib::SESSION_ADDITIONAL_COLUMNS => $this->_additionalColumns, // additional columns + FiltersLib::SESSION_CHECKBOXES => $this->_checkboxes, // the name of the field used to build the checkboxes column + FiltersLib::SESSION_FILTERS => $parsedFilterJson->filters, // all the filters used to filter the dataset + FiltersLib::SESSION_METADATA => $this->FiltersModel->getExecutedQueryMetaData(), // the metadata of the dataset + FiltersLib::SESSION_ROW_NUMBER => count($dataset->retval), // the number of loaded rows by this filter + FiltersLib::SESSION_DATASET => $dataset->retval, // the entire dataset + FiltersLib::SESSION_RELOAD_DATASET => false // if the dataset must be reloaded, not needed the first time ) ); } } } + + // To be always stored in the session, otherwise is not possible to load data from Filters controller + // NOTE: must the latest operation to be performed in the session to be shure that is always present + $this->filterslib->setElementSession(FiltersLib::REQUIRED_PERMISSIONS_PARAMETER, $this->_requiredPermissions); } /** diff --git a/composer.json b/composer.json index 25d4e3407..32e0a063c 100644 --- a/composer.json +++ b/composer.json @@ -64,11 +64,10 @@ "type": "package", "package": { "name": "borgar/textile-js", - "version": "1.0", - "source": { - "url": "https://github.com/borgar/textile-js.git", - "type": "git", - "reference": "master" + "version": "2.0.4", + "dist": { + "url": "https://github.com/borgar/textile-js/archive/v2.0.4.zip", + "type": "zip" } } }, @@ -77,10 +76,9 @@ "package": { "name": "rmariuzzo/jquery-checkboxes", "version": "1.0.7", - "source": { - "url": "https://github.com/rmariuzzo/checkboxes.js.git", - "type": "git", - "reference": "081cac1eb9b504dc32be27b57f32f6d1d29a5253" + "dist": { + "url": "https://github.com/rmariuzzo/checkboxes.js/archive/v1.0.7.zip", + "type": "zip" } } }, @@ -139,30 +137,6 @@ } } }, - { - "type": "package", - "package": { - "name": "jquery-archive/jquery-metadata", - "version": "1.0", - "source": { - "url": "https://github.com/jquery-archive/jquery-metadata.git", - "type": "git", - "reference": "e5a9e4315675bf4d68716872ca754e858088f8ab" - } - } - }, - { - "type": "package", - "package": { - "name": "tomazdragar/SimpleCropper", - "version": "1.0", - "source": { - "url": "https://github.com/tomazdragar/SimpleCropper.git", - "type": "git", - "reference": "9750b81fa55ed07b3b429297d18ffbeac07a2cde" - } - } - }, { "type": "package", "package": { @@ -190,10 +164,9 @@ "package": { "name": "nicolaskruchten/pivottable", "version": "2.15.0", - "source": { - "url": "https://github.com/nicolaskruchten/pivottable.git", - "type": "git", - "reference": "b15ea33268b587d986371c0b6f215c36ffbb860c" + "dist": { + "url": "https://github.com/nicolaskruchten/pivottable/archive/v2.15.0.zip", + "type": "zip" } } }, @@ -201,11 +174,10 @@ "type": "package", "package": { "name": "BlackrockDigital/startbootstrap-sb-admin-2", - "version": "3.3.7", - "source": { - "url": "https://github.com/BlackrockDigital/startbootstrap-sb-admin-2.git", - "type": "git", - "reference": "e85ee3814ba12b7095024d31424cc9d19d791d05" + "version": "3.3.7.1", + "dist": { + "url": "https://github.com/BlackrockDigital/startbootstrap-sb-admin-2/archive/v3.3.7+1.zip", + "type": "zip" } } }, @@ -214,10 +186,44 @@ "package": { "name": "ludo/jquery-treetable", "version": "3.2.0", + "dist": { + "url": "https://github.com/ludo/jquery-treetable/archive/3.2.0.zip", + "type": "zip" + } + } + }, + { + "type": "package", + "package": { + "name": "scottjehl/Respond", + "version": "1.4.2", + "dist": { + "url": "https://github.com/scottjehl/Respond/archive/1.4.2.zip", + "type": "zip" + } + } + }, + { + "type": "package", + "package": { + "name": "jquery-archive/jquery-metadata", + "version": "1.0", "source": { - "url": "https://github.com/ludo/jquery-treetable.git", + "url": "https://github.com/jquery-archive/jquery-metadata.git", "type": "git", - "reference": "73690a9df26dbc1a49981f9335df2a9cd9808813" + "reference": "e5a9e4315675bf4d68716872ca754e858088f8ab" + } + } + }, + { + "type": "package", + "package": { + "name": "tomazdragar/SimpleCropper", + "version": "1.0", + "source": { + "url": "https://github.com/tomazdragar/SimpleCropper.git", + "type": "git", + "reference": "9750b81fa55ed07b3b429297d18ffbeac07a2cde" } } } @@ -225,44 +231,51 @@ "require": { "php": ">=5.4.0", + "afarkas/html5shiv": "^3.7", "alvaro-prieto/colResizable": "^1.6", - "borgar/textile-js": "1.0", - "BlackrockDigital/startbootstrap-sb-admin-2": "^3.3", - "christianbach/tablesorter": "^1.0", + "borgar/textile-js": "2.0.4", + "BlackrockDigital/startbootstrap-sb-admin-2": "^3.3", + + "christianbach/tablesorter": "^1.0", "codeigniter/framework": "3.*", "codeigniter-restserver": "2.6", - "components/jquery": "^3.2", "components/jqueryui": "^1.12", "components/font-awesome": "^4.7", "components/angular.js": "1.3.16", "easyrdf/easyrdf": "0.9.*", + "fgelinas/timepicker": "^0.3.3", "fzaninotto/faker": "1.*", - "joeldbirch/superfish": "^1.7", + "joeldbirch/superfish": "^1.7", "jquery/jqueryV1": "^1.12", "jquery/jqueryV2": "^2.2", "jquery/sizzle": "^1.0", - "jquery-archive/jquery-metadata": "^1.0", "json-forms": "1.4.0", "jsoneditor": "5.5.6", + "kingsquare/json-schema-form": "*", + "ludo/jquery-treetable": "^3.2", + "michelf/php-markdown": "1.5.0", "ml/json-ld": "1.*", "mottie/tablesorter": "^2.29", + "netcarver/textile": "^3.5", "nicolaskruchten/pivottable": "^2.15.0", - "rmariuzzo/jquery-checkboxes": "1.0.7", + "rmariuzzo/jquery-checkboxes": "1.0.7", "rougin/combustor": "1.1.*", "rougin/refinery": "*", + "scottjehl/Respond": "^1.4", + "tapmodo/Jcrop": "^2.0", "tinymce/tinymce": "4.*", "tomazdragar/SimpleCropper": "^1.0", @@ -280,4 +293,3 @@ "bin-dir": "vendor/bin" } } - diff --git a/composer.lock b/composer.lock index 506882e61..8fc88a639 100644 --- a/composer.lock +++ b/composer.lock @@ -4,19 +4,51 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "00d176bc89167feef10405c7457b6d6a", - "content-hash": "8cd3ddef525145593a8fe885184ef4cc", + "hash": "db46edf729b6e4d5f0508eba65d3d201", + "content-hash": "201f046d574ccb1447f8d9b820b6b9e2", "packages": [ { "name": "BlackrockDigital/startbootstrap-sb-admin-2", - "version": "3.3.7", - "source": { - "type": "git", - "url": "https://github.com/BlackrockDigital/startbootstrap-sb-admin-2.git", - "reference": "master" + "version": "3.3.7.1", + "dist": { + "type": "zip", + "url": "https://github.com/BlackrockDigital/startbootstrap-sb-admin-2/archive/v3.3.7+1.zip", + "reference": null, + "shasum": null }, "type": "library" }, + { + "name": "afarkas/html5shiv", + "version": "3.7.3", + "source": { + "type": "git", + "url": "https://github.com/aFarkas/html5shiv.git", + "reference": "ed28c56c071bddfe7d635ad88995674957a016be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/aFarkas/html5shiv/zipball/ed28c56c071bddfe7d635ad88995674957a016be", + "reference": "ed28c56c071bddfe7d635ad88995674957a016be", + "shasum": "" + }, + "type": "component", + "extra": { + "component": { + "scripts": [ + "dist/html5shiv.js" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT", + "GPL-2.0" + ], + "description": "Defacto way to enable use of HTML5 sectioning elements in legacy Internet Explorer.", + "homepage": "http://paulirish.com/2011/the-history-of-the-html5-shiv/", + "time": "2015-07-20 20:04:00" + }, { "name": "alvaro-prieto/colResizable", "version": "1.6", @@ -30,11 +62,12 @@ }, { "name": "borgar/textile-js", - "version": "1.0", - "source": { - "type": "git", - "url": "https://github.com/borgar/textile-js.git", - "reference": "master" + "version": "2.0.4", + "dist": { + "type": "zip", + "url": "https://github.com/borgar/textile-js/archive/v2.0.4.zip", + "reference": null, + "shasum": null }, "type": "library" }, @@ -69,16 +102,16 @@ }, { "name": "codeigniter/framework", - "version": "3.1.8", + "version": "3.1.9", "source": { "type": "git", "url": "https://github.com/bcit-ci/CodeIgniter.git", - "reference": "71e647782764184e3aab4faffe6d99176758979f" + "reference": "30e2eafa86c4c7b6b39cea3e7089a90df9f603fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bcit-ci/CodeIgniter/zipball/71e647782764184e3aab4faffe6d99176758979f", - "reference": "71e647782764184e3aab4faffe6d99176758979f", + "url": "https://api.github.com/repos/bcit-ci/CodeIgniter/zipball/30e2eafa86c4c7b6b39cea3e7089a90df9f603fb", + "reference": "30e2eafa86c4c7b6b39cea3e7089a90df9f603fb", "shasum": "" }, "require": { @@ -98,7 +131,7 @@ ], "description": "The CodeIgniter framework", "homepage": "https://codeigniter.com", - "time": "2018-03-22 14:48:55" + "time": "2018-06-12 13:45:46" }, { "name": "components/angular.js", @@ -833,16 +866,16 @@ }, { "name": "kevinlebrun/colors.php", - "version": "1.0.2", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/kevinlebrun/colors.php.git", - "reference": "6d7140aeedef46c97c2324f09b752c599ef17dac" + "reference": "cdda5eee41314b87cd5a8bb91b1ffc7c0210e673" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/kevinlebrun/colors.php/zipball/6d7140aeedef46c97c2324f09b752c599ef17dac", - "reference": "6d7140aeedef46c97c2324f09b752c599ef17dac", + "url": "https://api.github.com/repos/kevinlebrun/colors.php/zipball/cdda5eee41314b87cd5a8bb91b1ffc7c0210e673", + "reference": "cdda5eee41314b87cd5a8bb91b1ffc7c0210e673", "shasum": "" }, "require": { @@ -880,7 +913,7 @@ "console", "shell" ], - "time": "2016-04-12 20:58:34" + "time": "2018-05-30 08:34:23" }, { "name": "kingsquare/json-schema-form", @@ -919,10 +952,11 @@ { "name": "ludo/jquery-treetable", "version": "3.2.0", - "source": { - "type": "git", - "url": "https://github.com/ludo/jquery-treetable.git", - "reference": "73690a9df26dbc1a49981f9335df2a9cd9808813" + "dist": { + "type": "zip", + "url": "https://github.com/ludo/jquery-treetable/archive/3.2.0.zip", + "reference": null, + "shasum": null }, "type": "library" }, @@ -1076,16 +1110,16 @@ }, { "name": "mottie/tablesorter", - "version": "v2.30.1", + "version": "v2.30.7", "source": { "type": "git", "url": "https://github.com/Mottie/tablesorter.git", - "reference": "c74a34b070002776133757faa5b8613988b42470" + "reference": "90f7326819c573ee5ab333f4a0672623d7c52e1e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Mottie/tablesorter/zipball/c74a34b070002776133757faa5b8613988b42470", - "reference": "c74a34b070002776133757faa5b8613988b42470", + "url": "https://api.github.com/repos/Mottie/tablesorter/zipball/90f7326819c573ee5ab333f4a0672623d7c52e1e", + "reference": "90f7326819c573ee5ab333f4a0672623d7c52e1e", "shasum": "" }, "require": { @@ -1123,7 +1157,7 @@ "sorting", "table" ], - "time": "2018-03-19 12:17:24" + "time": "2018-07-10 13:32:19" }, { "name": "netcarver/textile", @@ -1181,10 +1215,11 @@ { "name": "nicolaskruchten/pivottable", "version": "2.15.0", - "source": { - "type": "git", - "url": "https://github.com/nicolaskruchten/pivottable.git", - "reference": "b15ea33268b587d986371c0b6f215c36ffbb860c" + "dist": { + "type": "zip", + "url": "https://github.com/nicolaskruchten/pivottable/archive/v2.15.0.zip", + "reference": null, + "shasum": null }, "type": "library" }, @@ -1299,10 +1334,11 @@ { "name": "rmariuzzo/jquery-checkboxes", "version": "1.0.7", - "source": { - "type": "git", - "url": "https://github.com/rmariuzzo/checkboxes.js.git", - "reference": "081cac1eb9b504dc32be27b57f32f6d1d29a5253" + "dist": { + "type": "zip", + "url": "https://github.com/rmariuzzo/checkboxes.js/archive/v1.0.7.zip", + "reference": null, + "shasum": null }, "type": "library" }, @@ -1599,18 +1635,29 @@ ], "time": "2015-10-23 08:27:10" }, + { + "name": "scottjehl/Respond", + "version": "1.4.2", + "dist": { + "type": "zip", + "url": "https://github.com/scottjehl/Respond/archive/1.4.2.zip", + "reference": null, + "shasum": null + }, + "type": "library" + }, { "name": "symfony/console", - "version": "v2.8.38", + "version": "v2.8.42", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "7f78892d900c72a40acd1fe793c856ef0c110f26" + "reference": "e8e59b74ad1274714dad2748349b55e3e6e630c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/7f78892d900c72a40acd1fe793c856ef0c110f26", - "reference": "7f78892d900c72a40acd1fe793c856ef0c110f26", + "url": "https://api.github.com/repos/symfony/console/zipball/e8e59b74ad1274714dad2748349b55e3e6e630c7", + "reference": "e8e59b74ad1274714dad2748349b55e3e6e630c7", "shasum": "" }, "require": { @@ -1624,7 +1671,7 @@ "symfony/process": "~2.1|~3.0.0" }, "suggest": { - "psr/log": "For using the console logger", + "psr/log-implementation": "For using the console logger", "symfony/event-dispatcher": "", "symfony/process": "" }, @@ -1658,7 +1705,7 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-04-03 05:20:27" + "time": "2018-05-15 21:17:45" }, { "name": "symfony/debug", @@ -1718,17 +1765,72 @@ "time": "2016-07-30 07:22:48" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.7.0", + "name": "symfony/polyfill-ctype", + "version": "v1.8.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7cc359f1b7b80fc25ed7796be7d96adc9b354bae", + "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-04-30 19:57:29" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.8.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "3296adf6a6454a050679cde90f95350ad604b171" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171", + "reference": "3296adf6a6454a050679cde90f95350ad604b171", "shasum": "" }, "require": { @@ -1740,7 +1842,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "1.8-dev" } }, "autoload": { @@ -1774,24 +1876,25 @@ "portable", "shim" ], - "time": "2018-01-30 19:27:44" + "time": "2018-04-26 10:06:28" }, { "name": "symfony/yaml", - "version": "v2.8.38", + "version": "v2.8.42", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "be720fcfae4614df204190d57795351059946a77" + "reference": "51356b7a2ff7c9fd06b2f1681cc463bb62b5c1ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/be720fcfae4614df204190d57795351059946a77", - "reference": "be720fcfae4614df204190d57795351059946a77", + "url": "https://api.github.com/repos/symfony/yaml/zipball/51356b7a2ff7c9fd06b2f1681cc463bb62b5c1ff", + "reference": "51356b7a2ff7c9fd06b2f1681cc463bb62b5c1ff", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.3.9", + "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { @@ -1823,7 +1926,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-01-03 07:36:31" + "time": "2018-05-01 22:52:40" }, { "name": "tapmodo/Jcrop", @@ -1838,16 +1941,16 @@ }, { "name": "tinymce/tinymce", - "version": "4.7.11", + "version": "4.8.0", "source": { "type": "git", "url": "https://github.com/tinymce/tinymce-dist.git", - "reference": "a7178e20d6053b92a177900531ffd2cdcb77f77c" + "reference": "0ca397b293d81cfb83de39c0952091233f6a6977" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tinymce/tinymce-dist/zipball/a7178e20d6053b92a177900531ffd2cdcb77f77c", - "reference": "a7178e20d6053b92a177900531ffd2cdcb77f77c", + "url": "https://api.github.com/repos/tinymce/tinymce-dist/zipball/0ca397b293d81cfb83de39c0952091233f6a6977", + "reference": "0ca397b293d81cfb83de39c0952091233f6a6977", "shasum": "" }, "type": "component", @@ -1880,7 +1983,7 @@ "tinymce", "wysiwyg" ], - "time": "2018-04-11 09:26:11" + "time": "2018-07-11 08:59:33" }, { "name": "tomazdragar/SimpleCropper", diff --git a/config/global.config-default.inc.php b/config/global.config-default.inc.php index 73ca346bb..dca284e7c 100644 --- a/config/global.config-default.inc.php +++ b/config/global.config-default.inc.php @@ -227,4 +227,7 @@ define('VILESCI_STUNDENSATZ_VORRUECKUNG', ''); // Wenn true, werden die Content-Aufrufe des CIS in der tbl_webservicelog mitgeloggt. Zuvor manuell einen neuen Webservicetyp "content" anlegen! define('LOG_CONTENT', false); +// ContentID of default content-template for reports. New contents will be childs of this. +define('REPORT_CONTENT_TEMPLATE', ''); + ?> diff --git a/config/vilesci.config-default.inc.php b/config/vilesci.config-default.inc.php index 713367bd7..049109471 100644 --- a/config/vilesci.config-default.inc.php +++ b/config/vilesci.config-default.inc.php @@ -191,6 +191,8 @@ define('SIGNATUR_DEFAULT_PROFILE', 'FHC_AMT_GROSS_DE'); */ // Code der Bildungseinrichtung define('DVB_BILDUNGSEINRICHTUNG_CODE','XX'); +// Datenverbund-Portal +define('DVB_PORTAL', 'https://stubei-p.portal.at'); // Username define('DVB_USERNAME','username'); // Passwort diff --git a/content/pdfExport.php b/content/pdfExport.php index 2954dc276..e65a1fe89 100644 --- a/content/pdfExport.php +++ b/content/pdfExport.php @@ -63,15 +63,15 @@ if (isset($_GET['archivdokument'])) $archivdokument = $_GET['archivdokument']; $allDocs = array(); $errorText = ''; - + $dokument = new dokument(); $dokument->loadDokumenttyp($archivdokument); - + $pdf = new pdf(); - + // Temporaeren Ordner fuer die Erstellung der Dokumente generieren $tmpDir = sys_get_temp_dir() . "/fhc_archivexport_" . uniqid(); - + if (!file_exists($tmpDir)) mkdir($tmpDir, 0777, true); @@ -90,11 +90,11 @@ if (isset($_GET['archivdokument'])) { $rechte = new benutzerberechtigung(); $rechte->getBerechtigungen($user); - + if (!$rechte->isBerechtigt('admin', $student_obj->studiengang_kz, 'suid') && !$rechte->isBerechtigt('assistenz', $student_obj->studiengang_kz, 'suid')) die('Sie haben keine Berechtigung für diese Studierenden'); - else + else { // Die jeweils letzte (aktuellste) Akte dieses Typs von jedem Studierenden laden und in eine temporäre Datei schreiben foreach ($uids AS $value) @@ -102,28 +102,28 @@ if (isset($_GET['archivdokument'])) // Leere Einträge überspringen if ($value == '') continue; - + $student_obj = new student($value); $person_id = $student_obj->person_id; $akte = new akte(); $akte->getAkten($person_id, $archivdokument, null, null, true, 'erstelltam DESC'); - + if (isset($akte->result[0])) { $filename = ''; if($akte->result[0]->inhalt != '') { $filename = $tmpDir . "/" . uniqid(); - + $fileData = base64_decode($akte->result[0]->inhalt); file_put_contents($filename, $fileData); - + $allDocs[] = $filename; } else $errorText .= "Das Dokument ".$dokument->bezeichnung." bei ".$student_obj->nachname." ".$student_obj->vorname." (".$value.") ist leer\n"; } - else + else $errorText .= $student_obj->nachname." ".$student_obj->vorname." (".$value.") hat kein Dokument '".$dokument->bezeichnung."' im Archiv\n"; } if (count($allDocs) == 0) @@ -131,19 +131,19 @@ if (isset($_GET['archivdokument'])) rmdir($tmpDir); die('Bei keinem der gewählten Studierenden ist einen Bescheid vorhanden'); } - + // Textseite mit Errormessages generieren und in PDF umwandeln if ($errorText != '') { $errorfile = $tmpDir . "/" . uniqid() . ".txt"; file_put_contents($errorfile, $errorText); - + $newnameErrorfile = $tmpDir . "/" . uniqid(); - + $docExport = new dokument_export(); $docExport->convert($errorfile, $newnameErrorfile, "pdf"); unlink($errorfile); - + // Konvertiertes File an erste Position im Array hängen array_unshift($allDocs, $newnameErrorfile); } @@ -155,46 +155,46 @@ if (isset($_GET['archivdokument'])) unlink($doc); $fsize = filesize($finishedPdf); - + if(!$handle = fopen($finishedPdf,'r')) die('load failed'); - + header('Content-type: application/pdf'); header('Content-Disposition: attachment; filename="'.$archivdokument.'_Album.pdf"'); header('Content-Length: '.$fsize); - + while (!feof($handle)) { echo fread($handle, 8192); } fclose($handle); - + unlink($finishedPdf); rmdir($tmpDir); } } - else + else die('Der/Die Studierenden konnte nicht geladen werden'); } } -else +else { //Parameter holen if (isset($_GET['xml'])) $xml = $_GET['xml']; else die('Fehlerhafte Parameteruebergabe'); - + if (isset($_GET['xsl'])) $xsl = $_GET['xsl']; else die('Fehlerhafte Parameteruebergabe'); - + if(isset($_GET['sign'])) $sign = true; else $sign = false; - + // Studiengang ermitteln dessen Vorlage verwendet werden soll $xsl_stg_kz = 0; // Direkte uebergabe des Studienganges dessen Vorlage verwendet werden soll @@ -215,7 +215,7 @@ else $uids = explode(';',$_GET['uid']); else $uids[1] = $_GET['uid']; - + $student_obj = new student(); if ($student_obj->load($uids[1])) { @@ -228,7 +228,7 @@ else $prestudent_ids = explode(';',$_GET['prestudent_id']); else $prestudent_ids[1] = $_GET['prestudent_id']; - + $prestudent_obj = new prestudent(); if ($prestudent_obj->load($prestudent_ids[1])) { @@ -241,10 +241,10 @@ else $xsl_oe_kurzbz = $_GET['xsl_oe_kurzbz']; else $xsl_oe_kurzbz = ''; - + //Parameter setzen $params = 'xmlformat=xml'; - + // GET Parameter die an XML durchgereicht werden foreach ($_GET as $getkey=>$getvalue) { @@ -259,7 +259,7 @@ else $params .= '&'.$getkey.'='.urlencode($getvalue); } } - + if (isset($_GET['vertrag_id'])) { foreach($_GET['vertrag_id'] as $id) @@ -271,14 +271,14 @@ else $version = $_GET['version']; else $version = null; - + $output = (isset($_GET['output'])?$_GET['output']:'odt'); - + $rechte = new benutzerberechtigung(); $rechte->getBerechtigungen($user); - + //OE fuer Output ermitteln - + if ($xsl_oe_kurzbz != '') { $oe_kurzbz = $xsl_oe_kurzbz; @@ -291,7 +291,7 @@ else $oe->load($xsl_stg_kz); $oe_kurzbz = $oe->oe_kurzbz; } - + //Darf der User Dokumente in einem NICHT-PDF-Format exportieren? if (isset($_GET['output']) && $_GET['output'] != 'pdf') { @@ -304,16 +304,16 @@ else } else $output = 'pdf'; - + $vorlage = new vorlage(); if(!$vorlage->loadVorlage($xsl)) die('Vorlage wurde nicht gefunden'); - + //Berechtigung pruefen if ($xsl == 'AccountInfo') { $isberechtigt = false; - + $uids = explode(';',$_GET['uid']); foreach ($uids as $uid) { @@ -327,7 +327,7 @@ else $isberechtigt = true; } } - + $stud = new student(); if ($stud->load($uid)) { @@ -342,7 +342,7 @@ else } } } - + if (!$isberechtigt) { echo 'Sie haben keine Berechtigung um dieses AccountInfoBlatt zu drucken'; @@ -360,7 +360,7 @@ else { if ($xsl_stg_kz == '') $xsl_stg_kz = '0'; - + $vorlagestudiengang->getAktuelleVorlage($xsl_stg_kz, $xsl, $version); } // Wenn Berechtigung direkt beim der Vorlage angegeben ist @@ -384,7 +384,7 @@ else exit; } } - + //wenn uid gefunden wird, dann den Nachnamen zum Dateinamen dazuhaengen $nachname = ''; if (isset($_GET['uid']) && $_GET['uid']!='') @@ -393,10 +393,10 @@ else $benutzer_obj = new benutzer(); if ($benutzer_obj->load($uid)) $nachname = '_'.convertProblemChars($benutzer_obj->nachname); - + } $filename = $xsl.$nachname; - + if ($xsl_oe_kurzbz == '') { if ($xsl_stg_kz == '') @@ -406,19 +406,19 @@ else die($stg_obj->errormsg); $xsl_oe_kurzbz = $stg_obj->oe_kurzbz; } - + if($sign === true && $vorlage->signierbar === false) { die('Diese Vorlage darf nicht signiert werden'); } - + if (!isset($_REQUEST["archive"])) { if (mb_strstr($vorlage->mimetype, 'application/vnd.oasis.opendocument')) { $dokument = new dokument_export($xsl, $xsl_oe_kurzbz, $version); $dokument->addDataURL($xml, $params); - + /** * Get Filename * TODO cleanup @@ -427,7 +427,7 @@ else $filename = $vorlage->bezeichnung.$nachname; else $filename = $vorlage->vorlage_kurzbz.$nachname; - + switch($xsl) { case 'LV_Informationen': @@ -444,19 +444,19 @@ else $filename = 'Studienordnung-Studienplan-'. sprintf("%'.04d",$studienordnung->studiengang_kz).'-'.$studienordnung->studiengangkurzbzlang; break; } - + $dokument->setFilename($filename); - + if ($sign === true) { $dokument->sign($user); } - + if ($dokument->create($output)) $dokument->output(); else echo $dokument->errormsg; - + $dokument->close(); } } @@ -464,22 +464,22 @@ else { if(!$vorlage->archivierbar) die('Dieses Dokument ist nicht archivierbar'); - + // Archivieren von Dokumenten $uid = $_REQUEST["uid"]; $heute = date('Y-m-d'); - + $student = new student(); $student->load($uid); - + if (isset($_REQUEST['ss'])) { $ss = $_REQUEST["ss"]; - + $prestudent = new prestudent(); $prestudent->getLastStatus($student->prestudent_id,$ss); $semester = $prestudent->ausbildungssemester; - + $query = "SELECT tbl_studiengang.studiengang_kz, tbl_studentlehrverband.semester, tbl_studiengang.typ, tbl_studiengang.kurzbz, tbl_person.person_id FROM tbl_person, tbl_benutzer, @@ -490,14 +490,14 @@ else AND tbl_studentlehrverband.studiengang_kz = tbl_studiengang.studiengang_kz AND tbl_studentlehrverband.student_uid = ".$db->db_add_param($uid)." AND tbl_studentlehrverband.studiensemester_kurzbz = ".$db->db_add_param($ss); - + if ($result = $db->db_query($query)) { if ($row = $db->db_fetch_object($result)) { $person_id = $row->person_id; - $titel = $xsl."_".strtoupper($row->typ).strtoupper($row->kurzbz)."_".$semester; - $bezeichnung = $xsl." ".strtoupper($row->typ).strtoupper($row->kurzbz)." ".$semester.". Semester"; + $titel = mb_substr($xsl."_".strtoupper($row->typ).strtoupper($row->kurzbz)."_".$semester.'_'.$ss, 0, 64); + $bezeichnung = mb_substr($xsl." ".strtoupper($row->typ).strtoupper($row->kurzbz)." ".$semester.". Semester".' '.$ss, 0, 64); $studiengang_kz = $row->studiengang_kz; } else @@ -515,26 +515,26 @@ else $titel = $vorlage->bezeichnung.'_'.$studiengang->kuerzel; $bezeichnung = $vorlage->bezeichnung.'_'.$studiengang->kuerzel; } - + if ($rechte->isBerechtigt('admin', $studiengang_kz, 'suid') || $rechte->isBerechtigt('assistenz', $studiengang_kz, 'suid')) { $dokument = new dokument_export($xsl, $xsl_oe_kurzbz, $version); $dokument->addDataURL($xml, $params); - + $dokument->setFilename($filename); - + $error = false; - + // Beim Archivieren wird das Dokument immer signiert wenn moeglich if($vorlage->signierbar) $sign = true; - + if ($sign === true) { $dokument->sign($user); } - + if ($dokument->create($output)) $doc = $dokument->output(false); else @@ -542,9 +542,9 @@ else $errormsg = $dokument->errormsg; $error = true; } - + $dokument->close(); - + if(!$error) { $hex = base64_encode($doc); @@ -570,7 +570,7 @@ else $akte->archiv = true; $akte->signiert = $sign; $akte->stud_selfservice = $vorlage->stud_selfservice; - + if (!$akte->save()) { echo 'Erstellen Fehlgeschlagen: '.$akte->errormsg; diff --git a/include/dokument_export.class.php b/include/dokument_export.class.php index 0ea033e64..b1eee8df3 100644 --- a/include/dokument_export.class.php +++ b/include/dokument_export.class.php @@ -382,7 +382,8 @@ class dokument_export if($this->styles_xsl!='') unlink('styles.xml'); - unlink($this->temp_filename); + if(file_exists($this->temp_filename)) + unlink($this->temp_filename); if($this->signed_filename != '') unlink($this->signed_filename); diff --git a/include/dvb.class.php b/include/dvb.class.php index 6d570a740..69b407388 100644 --- a/include/dvb.class.php +++ b/include/dvb.class.php @@ -32,11 +32,11 @@ require_once(dirname(__FILE__).'/prestudent.class.php'); class dvb extends basis_db { - const DVB_URL_WEBSERVICE_OAUTH = 'https://stubei-q.portal.at/dvb/oauth/token'; - const DVB_URL_WEBSERVICE_SVNR = 'https://stubei-q.portal.at/rws/0.2/simpleStudentBySozialVersicherungsnummer.xml'; - const DVB_URL_WEBSERVICE_ERSATZKZ = 'https://stubei-q.portal.at/rws/0.2/simpleStudentByErsatzKennzeichen.xml'; - const DVB_URL_WEBSERVICE_RESERVIERUNG = 'https://stubei-q.portal.at/dvb/matrikelnummern/1.0/reservierung.xml'; - const DVB_URL_WEBSERVICE_MELDUNG = 'https://stubei-q.portal.at/dvb/matrikelnummern/1.0/meldung.xml'; + const DVB_URL_WEBSERVICE_OAUTH = DVB_PORTAL.'/dvb/oauth/token'; + const DVB_URL_WEBSERVICE_SVNR = DVB_PORTAL.'/rws/0.2/simpleStudentBySozialVersicherungsnummer.xml'; + const DVB_URL_WEBSERVICE_ERSATZKZ = DVB_PORTAL.'/rws/0.2/simpleStudentByErsatzKennzeichen.xml'; + const DVB_URL_WEBSERVICE_RESERVIERUNG = DVB_PORTAL.'/dvb/matrikelnummern/1.0/reservierung.xml'; + const DVB_URL_WEBSERVICE_MELDUNG = DVB_PORTAL.'/dvb/matrikelnummern/1.0/meldung.xml'; public $authentication; private $username; diff --git a/public/css/AjaxLib.css b/public/css/AjaxLib.css index 61c9f9234..46711a2d9 100644 --- a/public/css/AjaxLib.css +++ b/public/css/AjaxLib.css @@ -1,4 +1,4 @@ -.veil { +.fhc-ajaxclient-veil { position: absolute; z-index: 9999; top: 0; @@ -11,3 +11,26 @@ background-repeat: no-repeat; background-position: center; } + +.fhc-ajaxclient-error-td { + padding-right: 10px; +} + +.no-close .ui-dialog-titlebar-close { + display: none; +} + +.ui-dialog-buttonset { + padding-top: 10px; + width: 100%; + text-align: center; +} + +.ui-dialog-buttonset button { + width: 50%; + font-weight: bold; +} + +.ui-front { + z-index: 9999; +} diff --git a/public/css/NavigationWidget.css b/public/css/NavigationWidget.css index b6d6c800e..0f3f30666 100644 --- a/public/css/NavigationWidget.css +++ b/public/css/NavigationWidget.css @@ -34,21 +34,23 @@ text-decoration: underline; } -.navbar-brand { - float: left; - height: 50px; +.navbar-header { padding-top: 15px; - padding-right: 20px; - padding-left: 7px; - font-size: 18px; - line-height: 20px; + height: 50px; } .navbar-brand-icon { - float: left; height: 50px; - padding-top: 15px; - padding-left: 7px; + top: 0px; font-size: 16px; margin-right: 3px; } + +.header-menu-link-entry { + padding-right: 23px; + padding-top: 15px; + font-size: 18px; + color: #5e5e5e !important; + background-color: transparent; + text-decoration: none !important; +} diff --git a/public/css/messaging/messageReply.css b/public/css/messaging/messageReply.css new file mode 100644 index 000000000..17f978ecc --- /dev/null +++ b/public/css/messaging/messageReply.css @@ -0,0 +1,17 @@ +.panel-heading { + font-size: 16px; +} + +@media screen and (min-width: 1500px) { + #msgtable { + width: 70%; + } +} + +#msgtable td { + border: none !important; +} + +#replybutton { + width: 120px; +} diff --git a/public/css/messaging/messageSent.css b/public/css/messaging/messageSent.css new file mode 100644 index 000000000..96403d797 --- /dev/null +++ b/public/css/messaging/messageSent.css @@ -0,0 +1,25 @@ +.panel-heading { + font-size: 16px; +} + +.signatureblock { + color: grey; +} + +.signatureblocklink { + color: grey; +} + +.signatureblocklink:hover { + color: #337ab7; +} + +.rwd-line { + display: block; +} + +@media screen and (min-width: 1831px) { + .rwd-line { + display: inline; + } +} diff --git a/public/css/messaging/messageWrite.css b/public/css/messaging/messageWrite.css new file mode 100644 index 000000000..91b20729f --- /dev/null +++ b/public/css/messaging/messageWrite.css @@ -0,0 +1,24 @@ +/*smaller subject field*/ +input[type=text] { + height: 28px; + padding: 0; +} + +.msgfield label { + margin-bottom: 0 !important; + margin-top: 3px; +} + +@media screen and (min-width: 1200px) { + .col-lg-1.msgfieldcol-left { + width: 13%; + } + + .col-lg-11.msgfieldcol-right { + width: 87%; + } +} + +#sendButton { + width: 120px; +} \ No newline at end of file diff --git a/public/js/AjaxLib.js b/public/js/AjaxLib.js index bd2b22689..b47654041 100644 --- a/public/js/AjaxLib.js +++ b/public/js/AjaxLib.js @@ -128,7 +128,7 @@ var FHC_AjaxClient = { * Retrives error message from response object */ getError: function(response) { - var error = 'Generic error'; + var error = "Generic error"; if (jQuery.type(response) == "object" && !jQuery.isEmptyObject(response) && response.hasOwnProperty(RESPONSE)) { @@ -182,13 +182,13 @@ var FHC_AjaxClient = { */ getUrlParameter: function(sParam) { var sPageURL = decodeURIComponent(window.location.search.substring(1)), - sURLVariables = sPageURL.split('&'), + sURLVariables = sPageURL.split("&"), sParameterName, i; - for (i = 0; i < sURLVariables.length; i++) + for (var i = 0; i < sURLVariables.length; i++) { - sParameterName = sURLVariables[i].split('='); + sParameterName = sURLVariables[i].split("="); if (sParameterName[0] === sParam) { @@ -260,11 +260,81 @@ var FHC_AjaxClient = { FHC_AjaxClient._printDebug(this._data, null, errorThrown); // debug time! - // Call the error callback saved in _errorCallback property - // NOTE: this is not referred to FHC_AjaxClient but to the ajax object + // Call the error callback saved in _errorCallback property + // NOTE: this is not referred to FHC_AjaxClient but to the ajax object this._errorCallback(jqXHR, textStatus, errorThrown); }, + /** + * Method to call after the ajax call has ended + */ + _onComplete: function(jqXHR, textStatus) { + + FHC_AjaxClient._printDebug(this._data, null, jqXHR.responseJSON); // debug time! + + // Call the complete callback if it was saved in the _completeCallback property + // NOTE: this is not referred to FHC_AjaxClient but to the ajax object. + // It's known that it's a function because it was already checked before in the + // _checkAndGenerateAjaxParams method + if (this.hasOwnProperty("_completeCallback")) + { + this._completeCallback(jqXHR, textStatus); + } + + FHC_AjaxClient._hideVeil(); // finally hide the veil + }, + + /** + * If an error callback is not given, this is the default error callback that is used + * to display useful info about the occurred error. It uses the JQuery UI dialog + */ + _defaultErrorCallback: function(jqXHR, textStatus, errorThrown) { + + // Row table format + var tableRowFormat = "%1s: %2s"; + var strDivDialog = "
"; // dialog div and open the error table + + // If textStatus is usable then place it in the table + if (textStatus != null) strDivDialog += tableRowFormat.replace(/%1s/g, "Error").replace(/%2s/g, textStatus); + + // If errorThrown is usable then place it in the table + if (errorThrown != null) strDivDialog += tableRowFormat.replace(/%1s/g, "Error text").replace(/%2s/g, errorThrown); + + // If jqXHR.status is usable then place it in the table + if (jqXHR != null && jqXHR.hasOwnProperty("status")) + { + strDivDialog += tableRowFormat.replace(/%1s/g, "HTTP status").replace(/%2s/g, jqXHR.status); + } + + // If jqXHR.responseText is usable then place it in the table + if (jqXHR != null && jqXHR.hasOwnProperty("responseText")) + { + strDivDialog += tableRowFormat.replace(/%1s/g, "HTTP response").replace(/%2s/g, jqXHR.responseText); + } + + strDivDialog += "
"; // close table and div + + $(strDivDialog).appendTo("body"); // append the dialog div to the body + + // Dialog definition + $("#fhc-ajaxclient-dialog").dialog({ + title: "Error occurred", + dialogClass: "no-close", + autoOpen: true, + modal: true, + resizable: false, + height: "auto", + width: 700, + closeOnEscape: false, + buttons: [{ + text: "Ok", + click: function() { + $(this).dialog("close"); + } + }] + }); + }, + /** * Instantiate a new object and copy in it the properties from the parameter */ @@ -285,7 +355,7 @@ var FHC_AjaxClient = { _showVeil: function() { if (FHC_AjaxClient._veilCallersCounter == 0) { - $("
").appendTo('body'); + $("
").appendTo("body"); } FHC_AjaxClient._veilCallersCounter++; @@ -305,7 +375,7 @@ var FHC_AjaxClient = { if (FHC_AjaxClient._veilCallersCounter == 0) { - $(".veil").remove(); + $(".fhc-ajaxclient-veil").remove(); } } }, @@ -388,6 +458,11 @@ var FHC_AjaxClient = { valid = false; } } + else // if is not given then call the default errorCallback + { + ajaxParameters._errorCallback = FHC_AjaxClient._defaultErrorCallback; // save as property the callback error + ajaxParameters.error = FHC_AjaxClient._onError; // function to call if an error occurred + } // If present, successCallback must be a function if (ajaxCallParameters.hasOwnProperty("successCallback")) @@ -404,14 +479,27 @@ var FHC_AjaxClient = { } } - // If present, veilTimeout must be a number and cannot be less then 0 or greater then 60000 - if (ajaxCallParameters.hasOwnProperty("veilTimeout") && typeof ajaxCallParameters.veilTimeout == "number") + // If present, completeCallback must be a function + if (ajaxCallParameters.hasOwnProperty("completeCallback")) { + if (typeof ajaxCallParameters.completeCallback == "function") + { + ajaxParameters._completeCallback = ajaxCallParameters.completeCallback; // save as property the callback complete + } + else + { + console.error("Invalid completeCallback, it must be a function"); + valid = false; + } + } + + // If present, veilTimeout must be a number and cannot be less then 0 or greater then 60000 + if (ajaxCallParameters.hasOwnProperty("veilTimeout") && typeof ajaxCallParameters.veilTimeout == "number") + { if (ajaxCallParameters.veilTimeout > 0 && ajaxCallParameters.veilTimeout < 60000) { ajaxParameters._veilTimeout = ajaxCallParameters.veilTimeout; ajaxParameters.beforeSend = FHC_AjaxClient._showVeil; - ajaxParameters.complete = FHC_AjaxClient._hideVeil; } else if(ajaxCallParameters.veilTimeout == 0) { @@ -422,13 +510,15 @@ var FHC_AjaxClient = { console.error("Invalid veilTimeout parameter, must be a number >= 0 and <= 60000"); valid = false; } - } + } else // is not present or the value is invalid { ajaxParameters._veilTimeout = VEIL_TIMEOUT; ajaxParameters.beforeSend = FHC_AjaxClient._showVeil; - ajaxParameters.complete = FHC_AjaxClient._hideVeil; } + + // Function to call after the ajax call is ended, is it here because it must be always called + ajaxParameters.complete = FHC_AjaxClient._onComplete; } if (valid === false) diff --git a/public/js/FilterWidget.js b/public/js/FilterWidget.js index 21352c622..b87019a55 100644 --- a/public/js/FilterWidget.js +++ b/public/js/FilterWidget.js @@ -138,9 +138,16 @@ var FHC_FilterWidget = { }, { successCallback: function(data, textStatus, jqXHR) { - if (FHC_AjaxClient.hasData(data) && typeof renderFunction == "function") + if (FHC_AjaxClient.hasData(data)) { - renderFunction(FHC_AjaxClient.getData(data)); + if (typeof renderFunction == "function") + { + renderFunction(FHC_AjaxClient.getData(data)); + } + } + else + { + console.log(FHC_AjaxClient.getError(data)); } } } @@ -540,10 +547,7 @@ var FHC_FilterWidget = { */ _renderDropDownFields: function(data) { - if (data.hasOwnProperty("fields") && $.isArray(data.fields)) - { - FHC_FilterWidget._renderDropDown(data, data.selectedFields, 'addField'); - } + FHC_FilterWidget._renderDropDown(data, data.selectedFields, 'addField'); }, /** @@ -552,34 +556,37 @@ var FHC_FilterWidget = { */ _renderDropDown: function(data, elements, ddElementId) { - for (var i = 0; i < data.fields.length; i++) + if (data.hasOwnProperty("fields") && $.isArray(data.fields)) { - var toBeDisplayed = true; - - for (var j = 0; j < elements.length; j++) + for (var fc = 0; fc < data.fields.length; fc++) { - var elementName = elements[j].hasOwnProperty("name") ? elements[j].name : elements[j]; + var toBeDisplayed = true; - if (data.fields[i] == elementName) + for (var ec = 0; ec < elements.length; ec++) { - toBeDisplayed = false; - break; - } - } + var elementName = elements[ec].hasOwnProperty("name") ? elements[ec].name : elements[ec]; - if (toBeDisplayed == true) - { - var fieldName = data.fields[i]; - var fieldToDisplay = data.fields[i]; - - if (data.hasOwnProperty("columnsAliases") && $.isArray(data.columnsAliases)) - { - fieldToDisplay = data.columnsAliases[i]; + if (data.fields[fc] == elementName) + { + toBeDisplayed = false; + break; + } } - if ($("#" + ddElementId).length) // checks if the element exists + if (toBeDisplayed == true) { - $("#" + ddElementId).append(""); + var fieldName = data.fields[fc]; + var fieldToDisplay = data.fields[fc]; + + if (data.hasOwnProperty("columnsAliases") && $.isArray(data.columnsAliases)) + { + fieldToDisplay = data.columnsAliases[fc]; + } + + if ($("#" + ddElementId).length) // checks if the element exists + { + $("#" + ddElementId).append(""); + } } } } @@ -594,11 +601,11 @@ var FHC_FilterWidget = { if (data.hasOwnProperty("datasetMetadata") && $.isArray(data.datasetMetadata) && data.hasOwnProperty("filters") && $.isArray(data.filters)) { - for (var i = 0; i < data.filters.length; i++) + for (var fc = 0; fc < data.filters.length; fc++) { - for (var j = 0; j < data.datasetMetadata.length; j++) + for (var dmc = 0; dmc < data.datasetMetadata.length; dmc++) { - if (data.filters[i].name == data.datasetMetadata[j].name) + if (data.filters[fc].name == data.datasetMetadata[dmc].name) { var appliedFilters = "
"; @@ -606,17 +613,17 @@ var FHC_FilterWidget = { if (data.hasOwnProperty("columnsAliases") && $.isArray(data.columnsAliases)) { - fieldToDisplay = data.columnsAliases[j]; + fieldToDisplay = data.columnsAliases[dmc]; } else { - fieldToDisplay = data.datasetMetadata[j].name; + fieldToDisplay = data.datasetMetadata[dmc].name; } appliedFilters += fieldToDisplay; appliedFilters += ""; - appliedFilters += FHC_FilterWidget._renderSingleAppliedFilter(data.filters[i], data.datasetMetadata[j]); + appliedFilters += FHC_FilterWidget._renderSingleAppliedFilter(data.filters[fc], data.datasetMetadata[dmc]); appliedFilters += "
"; @@ -849,13 +856,13 @@ var FHC_FilterWidget = { { if (data.hasOwnProperty("columnsAliases") && $.isArray(data.columnsAliases)) { - for (var i = 0; i < data.selectedFields.length; i++) + for (var sfc = 0; sfc < data.selectedFields.length; sfc++) { - for (var j = 0; j < data.fields.length; j++) + for (var fc = 0; fc < data.fields.length; fc++) { - if (data.selectedFields[i] == data.fields[j]) + if (data.selectedFields[sfc] == data.fields[fc]) { - arrayFieldsToDisplay[i] = data.columnsAliases[j]; + arrayFieldsToDisplay[sfc] = data.columnsAliases[fc]; } } } diff --git a/public/js/NavigationWidget.js b/public/js/NavigationWidget.js index ee9adb83d..232bff455 100644 --- a/public/js/NavigationWidget.js +++ b/public/js/NavigationWidget.js @@ -32,13 +32,13 @@ var FHC_NavigationWidget = { if (FHC_AjaxClient.hasData(data)) { - var strHeaderMenu = ''; + var strHeaderMenu = ""; jQuery.each(FHC_AjaxClient.getData(data), function(i, e) { if (e != null) strHeaderMenu += FHC_NavigationWidget._buildHeaderMenuStructure(e); }); - $(".menu-header-items").html(strHeaderMenu); + $("#header-menu").html(strHeaderMenu); } } } @@ -63,7 +63,7 @@ var FHC_NavigationWidget = { { FHC_NavigationWidget._printCollapseIcon(); // Applies bootstrap SB Admin 2 theme elements to the left menu - var strLeftMenu = ''; + var strLeftMenu = ""; // Builds left menu jQuery.each(FHC_AjaxClient.getData(data), function(i, e) { @@ -140,17 +140,58 @@ var FHC_NavigationWidget = { */ _buildHeaderMenuStructure: function(item) { - var strHeaderMenu = ''; + var strHeaderMenu = ""; - if (item['icon'] != 'undefined' && item['icon'] != '') + var icon = ""; + if (item["icon"] != null && item["icon"] != "") { - strHeaderMenu += ''; + icon = ''; } - var target = ''; - if (item['target'] != null) target = item['target']; + var target = ""; + if (item["target"] != null) target = item["target"]; - strHeaderMenu += '' + item['description'] + ''; + strHeaderMenu += ''; + + if (item["children"] != null && Object.keys(item["children"]).length > 0) + { + strHeaderMenu += ''; + strHeaderMenu += icon; + strHeaderMenu += item["description"] + " "; + strHeaderMenu += ''; + strHeaderMenu += ''; + + strHeaderMenu += ''; + } + else + { + strHeaderMenu += '' + + icon + + item["description"] + + ''; + } + + strHeaderMenu += ''; return strHeaderMenu; }, @@ -161,45 +202,45 @@ var FHC_NavigationWidget = { _buildLeftMenuStructure: function(item, depth = 1) { strLeftMenu = ""; - var expanded = item['expand'] != null && item['expand'] === true ? ' active' : ''; + var expanded = item["expand"] != null && item["expand"] === true ? ' active' : ""; strLeftMenu += '
  • '; - if (item['subscriptLinkClass'] != null && item['subscriptDescription'] != null) + if (item["subscriptLinkClass"] != null && item["subscriptDescription"] != null) { strLeftMenu += ''; } - var target = ''; - if (item['target'] != null) target = item['target']; + var target = ""; + if (item["target"] != null) target = item["target"]; - strLeftMenu += ''; + strLeftMenu += ''; - if (item['icon'] != 'undefined') + if (item["icon"] != "undefined") { - strLeftMenu += ' '; + strLeftMenu += ' '; } - strLeftMenu += item['description']; + strLeftMenu += item["description"]; - if (item['children'] != null && Object.keys(item['children']).length > 0) + if (item["children"] != null && Object.keys(item["children"]).length > 0) { strLeftMenu += ''; } strLeftMenu += ''; - if (item['subscriptLinkClass'] != null && item['subscriptDescription'] != null) + if (item["subscriptLinkClass"] != null && item["subscriptDescription"] != null) { - strLeftMenu += '' + - ' (' + item['subscriptDescription'] + ')' + + strLeftMenu += '' + + ' (' + item["subscriptDescription"] + ')' + ''; strLeftMenu += ''; } - if (item['children'] != null && Object.keys(item['children']).length > 0) + if (item["children"] != null && Object.keys(item["children"]).length > 0) { - var level = ''; + var level = ""; if (depth === 1) { level = 'second'; @@ -211,7 +252,7 @@ var FHC_NavigationWidget = { strLeftMenu += '