From 6574af6518476c2136b70f8105215c02cb0d0812 Mon Sep 17 00:00:00 2001 From: Gerald Raab Date: Thu, 16 Jun 2016 12:10:11 +0200 Subject: [PATCH 1/6] DB add tables for phrases --- application/migrations/009_phrase.php | 85 +++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100755 application/migrations/009_phrase.php diff --git a/application/migrations/009_phrase.php b/application/migrations/009_phrase.php new file mode 100755 index 000000000..708f1e6b6 --- /dev/null +++ b/application/migrations/009_phrase.php @@ -0,0 +1,85 @@ +db->table_exists('public.tbl_phrase')) + { + $this->db->insert('system.tbl_berechtigung', array( + 'berechtigung_kurzbz' => 'basis/phrase', + 'beschreibung' => 'Phrase System')); + $this->db->insert('system.tbl_rolleberechtigung', array( + 'berechtigung_kurzbz' => 'basis/phrase', + 'rolle_kurzbz' => 'admin', + 'art' => 'suid')); + + $query= " + CREATE TABLE public.tbl_app ( + app varchar(32), + PRIMARY KEY (app) + ); + GRANT SELECT ON TABLE public.tbl_app TO web; + GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tbl_app TO admin; + GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tbl_app TO vilesci; + + CREATE TABLE public.tbl_phrase ( + phrase_id serial, + app varchar(32) NOT NULL, + phrase varchar(64) NOT NULL, + insertamum timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + insertvon varchar(32), + PRIMARY KEY (phrase_id) + ); + GRANT SELECT ON TABLE public.tbl_phrase TO web; + GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tbl_phrase TO admin; + GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tbl_phrase TO vilesci; + GRANT SELECT, UPDATE ON SEQUENCE public.tbl_phrase_phrase_id_seq TO web; + GRANT SELECT, UPDATE ON SEQUENCE public.tbl_phrase_phrase_id_seq TO admin; + GRANT SELECT, UPDATE ON SEQUENCE public.tbl_phrase_phrase_id_seq TO vilesci; + + CREATE TABLE public.tbl_phrase_inhalt ( + phrase_inhalt_id serial, + phrase_id bigint NOT NULL, + sprache varchar(32) NOT NULL, + orgeinheit_kurzbz varchar(32) NOT NULL, + orgform_kurzbz varchar(32) NOT NULL, + text text, + insertamum timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + insertvon varchar(32), + PRIMARY KEY (phrase_inhalt_id) + ); + GRANT SELECT ON TABLE public.tbl_phrase_inhalt TO web; + GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tbl_phrase_inhalt TO admin; + GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tbl_phrase_inhalt TO vilesci; + GRANT SELECT, UPDATE ON SEQUENCE public.tbl_phrase_inhalt_phrase_inhalt_id_seq TO web; + GRANT SELECT, UPDATE ON SEQUENCE public.tbl_phrase_inhalt_phrase_inhalt_id_seq TO admin; + GRANT SELECT, UPDATE ON SEQUENCE public.tbl_phrase_inhalt_phrase_inhalt_id_seq TO vilesci; + "; + if (!$this->db->simple_query($query)) + { + echo "Error creating Basis DB-Schema!"; + } + } + } + + public function down() + { + try + { + $this->db->delete('system.tbl_rolleberechtigung', array('berechtigung_kurzbz' => 'basis/phrase')); + $this->db->delete('system.tbl_berechtigung', array('berechtigung_kurzbz' => 'basis/phrase')); + $this->dbforge->drop_table('public.tbl_phrase_inhalt'); + $this->dbforge->drop_table('public.tbl_phrase'); + $this->dbforge->drop_table('public.tbl_app'); + echo "Table public.tbl_phrase_inhalt, public.tbl_phrase and public.tbl_app dropped!"; + } + catch(Exception $e) + { + echo 'Exception abgefangen: ', $e->getMessage(), "\n"; + echo $this->db->error(); + } + } +} From 0c2c0468afab1484e9a4704d40456f5c6d26c6aa Mon Sep 17 00:00:00 2001 From: paolo Date: Thu, 16 Jun 2016 12:15:52 +0200 Subject: [PATCH 2/6] - Added helper message with the functions success and error - Added methods _success and _error to classes FHC_model and APIv1_Controller --- application/core/APIv1_Controller.php | 24 ++++++++++++++++++-- application/core/FHC_Model.php | 21 +++++------------ application/helpers/message_helper.php | 31 ++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 17 deletions(-) create mode 100644 application/helpers/message_helper.php diff --git a/application/core/APIv1_Controller.php b/application/core/APIv1_Controller.php index 50b5e1f52..fe2bbe212 100644 --- a/application/core/APIv1_Controller.php +++ b/application/core/APIv1_Controller.php @@ -7,10 +7,30 @@ class APIv1_Controller extends REST_Controller function __construct() { parent::__construct(); - //$this->load->library('session'); // -> autoload - //$this->load->library('database'); -> autoload + $this->load->helper('Message'); } + /** --------------------------------------------------------------- + * Success + * + * @param mixed $retval + * @return array + */ + protected function _success($retval, $message = null) + { + return success($retval, $message); + } + + /** --------------------------------------------------------------- + * General Error + * + * @return array + */ + protected function _error($retval, $message = null) + { + return error($retval, $message); + } + /** * * @param type $data diff --git a/application/core/FHC_Model.php b/application/core/FHC_Model.php index 14b50a109..485678c94 100644 --- a/application/core/FHC_Model.php +++ b/application/core/FHC_Model.php @@ -10,6 +10,7 @@ class FHC_Model extends CI_Model $this->load->helper('language'); $this->lang->load('fhc_model'); $this->lang->load('fhcomplete'); + $this->load->helper('Message'); $uid = null; @@ -46,14 +47,9 @@ class FHC_Model extends CI_Model * @param mixed $retval * @return array */ - protected function _success($retval, $message = FHC_SUCCESS) + protected function _success($retval, $message = null) { - $return = new stdClass(); - $return->error = EXIT_SUCCESS; - $return->fhcCode = $message; - $return->msg = lang('fhc_' . $message); - $return->retval = $retval; - return $return; + return success($retval, $message); } /** --------------------------------------------------------------- @@ -61,13 +57,8 @@ class FHC_Model extends CI_Model * * @return array */ - protected function _error($retval = '', $message = FHC_MODEL_ERROR) + protected function _error($retval, $message = null) { - $return = new stdClass(); - $return->error = EXIT_MODEL; - $return->fhcCode = $message; - $return->msg = lang('fhc_' . $message); - $return->retval = $retval; - return $return; + return error($retval, $message); } -} +} \ No newline at end of file diff --git a/application/helpers/message_helper.php b/application/helpers/message_helper.php new file mode 100644 index 000000000..0a70a1015 --- /dev/null +++ b/application/helpers/message_helper.php @@ -0,0 +1,31 @@ +error = EXIT_SUCCESS; + $return->fhcCode = $message; + $return->msg = lang('fhc_' . $message); + $return->retval = $retval; + return $return; +} + +/** --------------------------------------------------------------- + * General Error + * + * @return array + */ +function error($retval = '', $message = FHC_MODEL_ERROR) +{ + $return = new stdClass(); + $return->error = EXIT_MODEL; + $return->fhcCode = $message; + $return->msg = lang('fhc_' . $message); + $return->retval = $retval; + return $return; +} \ No newline at end of file From c5ee56f23d340224db1556775cfe71aa36cb28de Mon Sep 17 00:00:00 2001 From: paolo Date: Thu, 16 Jun 2016 12:18:29 +0200 Subject: [PATCH 3/6] Moved _validate method from the model Person_model to the controller Person --- .../controllers/api/v1/person/Person.php | 198 +++++++++++++++++- application/models/person/Person_model.php | 196 ----------------- 2 files changed, 197 insertions(+), 197 deletions(-) diff --git a/application/controllers/api/v1/person/Person.php b/application/controllers/api/v1/person/Person.php index f30352f02..1992150ab 100644 --- a/application/controllers/api/v1/person/Person.php +++ b/application/controllers/api/v1/person/Person.php @@ -70,7 +70,7 @@ class Person extends APIv1_Controller public function postPerson() { $person = $this->_parseData($this->post()); - $validation = $this->PersonModel->_validate($this->post()); + $validation = $this->_validate($this->post()); if (is_object($validation) && $validation->error == EXIT_SUCCESS) { @@ -110,4 +110,200 @@ class Person extends APIv1_Controller $this->response(); } } + + private function _validate($person = NULL) + { + if (!isset($person)) + { + return $this->_error('Parameter is null'); + } + + $person['nachname'] = trim($person['nachname']); + $person['vorname'] = trim($person['vorname']); + $person['vornamen'] = trim($person['vornamen']); + $person['anrede'] = trim($person['anrede']); + $person['titelpost'] = trim($person['titelpost']); + $person['titelpre'] = trim($person['titelpre']); + + if (mb_strlen($person['sprache']) > 16) + { + return $this->_error('Sprache darf nicht laenger als 16 Zeichen sein'); + } + if (mb_strlen($person['anrede']) > 16) + { + return $this->_error('Anrede darf nicht laenger als 16 Zeichen sein'); + } + if (mb_strlen($person['titelpost']) > 32) + { + return $this->_error('Titelpost darf nicht laenger als 32 Zeichen sein'); + } + if (mb_strlen($person['titelpre']) > 64) + { + return $this->_error('Titelpre darf nicht laenger als 64 Zeichen sein'); + } + if (mb_strlen($person['nachname']) > 64) + { + return $this->_error('Nachname darf nicht laenger als 64 Zeichen sein'); + } + if ($person['nachname'] == '' || is_null($person['nachname'])) + { + return $this->_error('Nachname muss eingegeben werden'); + } + + if (mb_strlen($person['vorname']) > 32) + { + return $this->_error('Vorname darf nicht laenger als 32 Zeichen sein'); + } + if (mb_strlen($person['vornamen']) > 128) + { + return $this->_error('Vornamen darf nicht laenger als 128 Zeichen sein'); + } + //ToDo Gebdatum pruefen -> laut bis muss student aelter als 10 Jahre sein + /* if (strlen($person['gebdatum) == 0 || is_null($person['gebdatum)) + { + return $this->_error("Geburtsdatum muss eingegeben werden\n"; + return false; + } */ + if (mb_strlen($person['gebort']) > 128) + { + return $this->_error('Geburtsort darf nicht laenger als 128 Zeichen sein'); + } + + if (mb_strlen($person['homepage']) > 256) + { + return $this->_error('Homepage darf nicht laenger als 256 Zeichen sein'); + } + if (mb_strlen($person['svnr']) > 16) + { + return $this->_error('SVNR darf nicht laenger als 16 Zeichen sein'); + } + + if (mb_strlen($person['matr_nr']) > 32) + { + return $this->_error('Matrikelnummer darf nicht laenger als 32 Zeichen sein'); + return false; + } + + if ($person['svnr'] != '' && mb_strlen($person['svnr']) != 16 && mb_strlen($person['svnr']) != 10) + { + return $this->_error('SVNR muss 10 oder 16 Zeichen lang sein'); + } + + if ($person['svnr'] != '' && mb_strlen($person['svnr']) == 10) + { + //SVNR mit Pruefziffer pruefen + //Die 4. Stelle in der SVNR ist die Pruefziffer + //(Summe von (gewichtung[i]*svnr[i])) modulo 11 ergibt diese Pruefziffer + //Falls nicht, ist die SVNR ungueltig + $gewichtung = array(3, 7, 9, 0, 5, 8, 4, 2, 1, 6); + $erg = 0; + //Quersumme bilden + for ($i = 0; $i < 10; $i++) + { + $erg += $gewichtung[$i] * $person['svnr']{$i}; + } + + if ($person['svnr']{3} != ($erg % 11)) //Vergleichen der Pruefziffer mit Quersumme Modulo 11 + { + return $this->_error('SVNR ist ungueltig'); + } + } + + /*if ($person['svnr'] != '') + { + //Pruefen ob bereits ein Eintrag mit dieser SVNR vorhanden ist + $qry = "SELECT person_id FROM public.tbl_person WHERE svnr=" . $person['svnr']; + if (db_query($qry)) + { + if ($row = db_fetch_object()) + { + if ($row->person_id != $person['person_id']) + { + return $this->_error('Es existiert bereits eine Person mit dieser SVNR! Daten wurden NICHT gespeichert.'); + } + } + } + }*/ + + if (mb_strlen($person['ersatzkennzeichen']) > 10) + { + return $this->_error('Ersatzkennzeichen darf nicht laenger als 10 Zeichen sein'); + } + if (mb_strlen($person['familienstand']) > 1) + { + return $this->_error('Familienstand ist ungueltig'); + } + if ($person['anzahlkinder'] != '' && !is_numeric($person['anzahlkinder'])) + { + return $this->_error('Anzahl der Kinder ist ungueltig'); + } + if ($person['aktiv'] != "t" && $person['aktiv'] != "f") + { + return $this->_error('Aktiv ist ungueltig'); + } + if (!isset($person['person_id']) && mb_strlen($person['insertvon']) > 32) + { + return $this->_error('Insertvon darf nicht laenger als 32 Zeichen sein'); + } + if (mb_strlen($person['updatevon']) > 32) + { + return $this->_error('Updatevon darf nicht laenger als 32 Zeichen sein'); + } + /*if ($person['ext_id'] != '' && !is_numeric($person['ext_id'])) + { + return $this->_error('Ext_ID ist keine gueltige Zahl'; + return false; + }*/ + if (mb_strlen($person['geschlecht']) > 1) + { + return $this->_error('Geschlecht darf nicht laenger als 1 Zeichen sein'); + } + if (mb_strlen($person['geburtsnation']) > 3) + { + return $this->_error('Geburtsnation darf nicht laenger als 3 Zeichen sein'); + } + if (mb_strlen($person['staatsbuergerschaft']) > 3) + { + return $this->_error('Staatsbuergerschaft darf nicht laenger als 3 Zeichen sein'); + } + if ($person['geschlecht'] != 'm' && $person['geschlecht'] != 'w' && $person['geschlecht'] != 'u') + { + return $this->_error('Geschlecht muss w, m oder u sein!'); + } + + //Pruefen ob das Geburtsdatum mit der SVNR uebereinstimmt. + if ($person['svnr'] != '' && $person['gebdatum'] != '') + { + if (mb_ereg("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4})", $person['gebdatum'], $regs)) + { + //$day = sprintf('%02s',$regs[1]); + //$month = sprintf('%02s',$regs[2]); + //$year = mb_substr($regs[3],2,2); + } + elseif (mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})", $person['gebdatum'], $regs)) + { + //$day = sprintf('%02s',$regs[3]); + //$month = sprintf('%02s',$regs[2]); + //$year = mb_substr($regs[1],2,2); + } + else + { + return $this->_error('Format des Geburtsdatums ist ungueltig'); + } + + /* das muss nicht immer so sein + $day_svnr = mb_substr($person['svnr, 4, 2); + $month_svnr = mb_substr($person['svnr, 6, 2); + $year_svnr = mb_substr($person['svnr, 8, 2); + + if ($day_svnr!=$day || $month_svnr!=$month || $year_svnr!=$year) + { + return $this->_error('SVNR und Geburtsdatum passen nicht zusammen'; + return false; + } + */ + } + + return $this->_success('Input data are valid'); + } } \ No newline at end of file diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php index 98c32e38c..a186ce08e 100644 --- a/application/models/person/Person_model.php +++ b/application/models/person/Person_model.php @@ -68,200 +68,4 @@ class Person_model extends DB_Model else return $this->_error($this->db->error(), FHC_DB_ERROR); } - - public function _validate($person = NULL) - { - if (!isset($person)) - { - return $this->_error('Parameter is null'); - } - - $person['nachname'] = trim($person['nachname']); - $person['vorname'] = trim($person['vorname']); - $person['vornamen'] = trim($person['vornamen']); - $person['anrede'] = trim($person['anrede']); - $person['titelpost'] = trim($person['titelpost']); - $person['titelpre'] = trim($person['titelpre']); - - if (mb_strlen($person['sprache']) > 16) - { - return $this->_error('Sprache darf nicht laenger als 16 Zeichen sein'); - } - if (mb_strlen($person['anrede']) > 16) - { - return $this->_error('Anrede darf nicht laenger als 16 Zeichen sein'); - } - if (mb_strlen($person['titelpost']) > 32) - { - return $this->_error('Titelpost darf nicht laenger als 32 Zeichen sein'); - } - if (mb_strlen($person['titelpre']) > 64) - { - return $this->_error('Titelpre darf nicht laenger als 64 Zeichen sein'); - } - if (mb_strlen($person['nachname']) > 64) - { - return $this->_error('Nachname darf nicht laenger als 64 Zeichen sein'); - } - if ($person['nachname'] == '' || is_null($person['nachname'])) - { - return $this->_error('Nachname muss eingegeben werden'); - } - - if (mb_strlen($person['vorname']) > 32) - { - return $this->_error('Vorname darf nicht laenger als 32 Zeichen sein'); - } - if (mb_strlen($person['vornamen']) > 128) - { - return $this->_error('Vornamen darf nicht laenger als 128 Zeichen sein'); - } - //ToDo Gebdatum pruefen -> laut bis muss student aelter als 10 Jahre sein - /* if (strlen($person['gebdatum) == 0 || is_null($person['gebdatum)) - { - return $this->_error("Geburtsdatum muss eingegeben werden\n"; - return false; - } */ - if (mb_strlen($person['gebort']) > 128) - { - return $this->_error('Geburtsort darf nicht laenger als 128 Zeichen sein'); - } - - if (mb_strlen($person['homepage']) > 256) - { - return $this->_error('Homepage darf nicht laenger als 256 Zeichen sein'); - } - if (mb_strlen($person['svnr']) > 16) - { - return $this->_error('SVNR darf nicht laenger als 16 Zeichen sein'); - } - - if (mb_strlen($person['matr_nr']) > 32) - { - return $this->_error('Matrikelnummer darf nicht laenger als 32 Zeichen sein'); - return false; - } - - if ($person['svnr'] != '' && mb_strlen($person['svnr']) != 16 && mb_strlen($person['svnr']) != 10) - { - return $this->_error('SVNR muss 10 oder 16 Zeichen lang sein'); - } - - if ($person['svnr'] != '' && mb_strlen($person['svnr']) == 10) - { - //SVNR mit Pruefziffer pruefen - //Die 4. Stelle in der SVNR ist die Pruefziffer - //(Summe von (gewichtung[i]*svnr[i])) modulo 11 ergibt diese Pruefziffer - //Falls nicht, ist die SVNR ungueltig - $gewichtung = array(3, 7, 9, 0, 5, 8, 4, 2, 1, 6); - $erg = 0; - //Quersumme bilden - for ($i = 0; $i < 10; $i++) - { - $erg += $gewichtung[$i] * $person['svnr']{$i}; - } - - if ($person['svnr']{3} != ($erg % 11)) //Vergleichen der Pruefziffer mit Quersumme Modulo 11 - { - return $this->_error('SVNR ist ungueltig'); - } - } - - /*if ($person['svnr'] != '') - { - //Pruefen ob bereits ein Eintrag mit dieser SVNR vorhanden ist - $qry = "SELECT person_id FROM public.tbl_person WHERE svnr=" . $person['svnr']; - if (db_query($qry)) - { - if ($row = db_fetch_object()) - { - if ($row->person_id != $person['person_id']) - { - return $this->_error('Es existiert bereits eine Person mit dieser SVNR! Daten wurden NICHT gespeichert.'); - } - } - } - }*/ - - if (mb_strlen($person['ersatzkennzeichen']) > 10) - { - return $this->_error('Ersatzkennzeichen darf nicht laenger als 10 Zeichen sein'); - } - if (mb_strlen($person['familienstand']) > 1) - { - return $this->_error('Familienstand ist ungueltig'); - } - if ($person['anzahlkinder'] != '' && !is_numeric($person['anzahlkinder'])) - { - return $this->_error('Anzahl der Kinder ist ungueltig'); - } - if ($person['aktiv'] != "t" && $person['aktiv'] != "f") - { - return $this->_error('Aktiv ist ungueltig'); - } - if (!isset($person['person_id']) && mb_strlen($person['insertvon']) > 32) - { - return $this->_error('Insertvon darf nicht laenger als 32 Zeichen sein'); - } - if (mb_strlen($person['updatevon']) > 32) - { - return $this->_error('Updatevon darf nicht laenger als 32 Zeichen sein'); - } - /*if ($person['ext_id'] != '' && !is_numeric($person['ext_id'])) - { - return $this->_error('Ext_ID ist keine gueltige Zahl'; - return false; - }*/ - if (mb_strlen($person['geschlecht']) > 1) - { - return $this->_error('Geschlecht darf nicht laenger als 1 Zeichen sein'); - } - if (mb_strlen($person['geburtsnation']) > 3) - { - return $this->_error('Geburtsnation darf nicht laenger als 3 Zeichen sein'); - } - if (mb_strlen($person['staatsbuergerschaft']) > 3) - { - return $this->_error('Staatsbuergerschaft darf nicht laenger als 3 Zeichen sein'); - } - if ($person['geschlecht'] != 'm' && $person['geschlecht'] != 'w' && $person['geschlecht'] != 'u') - { - return $this->_error('Geschlecht muss w, m oder u sein!'); - } - - //Pruefen ob das Geburtsdatum mit der SVNR uebereinstimmt. - if ($person['svnr'] != '' && $person['gebdatum'] != '') - { - if (mb_ereg("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4})", $person['gebdatum'], $regs)) - { - //$day = sprintf('%02s',$regs[1]); - //$month = sprintf('%02s',$regs[2]); - //$year = mb_substr($regs[3],2,2); - } - elseif (mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})", $person['gebdatum'], $regs)) - { - //$day = sprintf('%02s',$regs[3]); - //$month = sprintf('%02s',$regs[2]); - //$year = mb_substr($regs[1],2,2); - } - else - { - return $this->_error('Format des Geburtsdatums ist ungueltig'); - } - - /* das muss nicht immer so sein - $day_svnr = mb_substr($person['svnr, 4, 2); - $month_svnr = mb_substr($person['svnr, 6, 2); - $year_svnr = mb_substr($person['svnr, 8, 2); - - if ($day_svnr!=$day || $month_svnr!=$month || $year_svnr!=$year) - { - return $this->_error('SVNR und Geburtsdatum passen nicht zusammen'; - return false; - } - */ - } - - return $this->_success('Input data are valid'); - } } \ No newline at end of file From 8a64b70ea2909650032531e5a7c4d9c78b86bcbf Mon Sep 17 00:00:00 2001 From: Gerald Raab Date: Thu, 16 Jun 2016 12:31:20 +0200 Subject: [PATCH 4/6] rights for phrase --- application/config/fhcomplete.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) mode change 100644 => 100755 application/config/fhcomplete.php diff --git a/application/config/fhcomplete.php b/application/config/fhcomplete.php old mode 100644 new mode 100755 index cb307908c..a5d5f2c2f --- a/application/config/fhcomplete.php +++ b/application/config/fhcomplete.php @@ -1,4 +1,4 @@ - 'basis/ortraumtyp', 'public.tbl_person' => 'basis/person', 'public.tbl_personfunktionstandort' => 'basis/personfunktionstandort', + 'public.tbl_phrase' => 'basis/phrase', + 'public.tbl_phrase_inhalt' => 'basis/phrase', 'public.tbl_preincoming' => 'basis/preincoming', 'public.tbl_preinteressent' => 'basis/preinteressent', 'public.tbl_preinteressentstudiengang' => 'basis/preinteressentstudiengang', @@ -229,6 +231,6 @@ $config['fhc_acl'] = array 'wawi.tbl_rechnungsbetrag' => 'basis/rechnungsbetrag', 'wawi.tbl_rechnungstyp' => 'basis/rechnungstyp', 'wawi.tbl_zahlungstyp' => 'basis/zahlungstyp', - + 'public.tbl_sprache' => 'admin' ); From e5cd3c5a9e92b09337f91019b1f22ba32bc2e662 Mon Sep 17 00:00:00 2001 From: paolo Date: Thu, 16 Jun 2016 15:11:20 +0200 Subject: [PATCH 5/6] Fixed header.php: removed body tag --- application/views/templates/header.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/application/views/templates/header.php b/application/views/templates/header.php index 3b3fb9fa9..cc9a24ef7 100644 --- a/application/views/templates/header.php +++ b/application/views/templates/header.php @@ -41,6 +41,4 @@ if ($tablesort) - - - + \ No newline at end of file From 3397192298a623825e73047f135b8995a81b3707 Mon Sep 17 00:00:00 2001 From: paolo Date: Thu, 16 Jun 2016 18:02:18 +0200 Subject: [PATCH 6/6] Fix: check if data are present --- ci_db_extra.php | 5 +++ vilesci/personen/student_vorrueckung.php | 52 +++++++++++++++--------- 2 files changed, 37 insertions(+), 20 deletions(-) diff --git a/ci_db_extra.php b/ci_db_extra.php index 1ab1ccaa1..dbdf590d2 100755 --- a/ci_db_extra.php +++ b/ci_db_extra.php @@ -145,4 +145,9 @@ trait db_extra else return pg_field_name($result, $i); } + + public function db_last_error() + { + return pg_last_error(); + } } \ No newline at end of file diff --git a/vilesci/personen/student_vorrueckung.php b/vilesci/personen/student_vorrueckung.php index 9be75f94d..02e539975 100644 --- a/vilesci/personen/student_vorrueckung.php +++ b/vilesci/personen/student_vorrueckung.php @@ -163,9 +163,9 @@ $sql_query="SELECT tbl_student.*,tbl_person.*, tbl_studentlehrverband.semester a AND studiensemester_kurzbz=".$db->db_add_param($studiensemester_kurzbz); if($semester<100) { - $sql_query.="AND tbl_studentlehrverband.semester=".$db->db_add_param($semester, FHC_INTEGER); //semester = 100 wählt alle aus + $sql_query.=" AND tbl_studentlehrverband.semester=".$db->db_add_param($semester, FHC_INTEGER); //semester = 100 wählt alle aus } -$sql_query.="ORDER BY semester, nachname"; +$sql_query.=" ORDER BY semester, nachname"; //echo $sql_query; if (!$result_std=$db->db_query($sql_query)) @@ -314,13 +314,17 @@ foreach ($studiengang as $stg) $outp.=''; //Auswahl angezeigtes Studiensemester $outp.="
Angezeigtes Studiensemester: "; $outp.= '
Ausbildungssemester der Anzeige: -- '; @@ -333,13 +337,17 @@ $outp.= '-----Vorrückung Studiengang ".$s[$stg_kz]->kurzbz."----------------------------------------------------------------------------------------------------------"; $outp.="
Ausgangs-Studiensemester:     \n"; $outp.= '
Ausgangs-Ausbildungssemester:   -- '; @@ -350,13 +358,17 @@ for ($j=0;$j<=$s[$stg_kz]->max_sem;$j++) $outp.= '
alle -- '; //Auswahl Studiensemester in das vorgerückt werden soll $outp.="
Ziel-Studiensemester:              \n"; $outp.="
Vorrückung von ".$studiensemester_kurzbz_akt." / ".($semesterv<100?$semesterv.".":'alle')." Semester -> ".$studiensemester_kurzbz_zk;