From da7e1005a08e3e05d9b6232218db06d0594f710c Mon Sep 17 00:00:00 2001 From: Gerald Raab Date: Tue, 8 Jan 2019 15:22:44 +0100 Subject: [PATCH 01/18] =?UTF-8?q?DienstreiseMT-Stempelungen=20k=C3=B6nnen?= =?UTF-8?q?=20parallel=20zu=20Arbeitszeit=20eingetragen=20werden?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/zeitaufzeichnung.class.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/include/zeitaufzeichnung.class.php b/include/zeitaufzeichnung.class.php index 486f06db8..509444d39 100755 --- a/include/zeitaufzeichnung.class.php +++ b/include/zeitaufzeichnung.class.php @@ -135,15 +135,19 @@ class zeitaufzeichnung extends basis_db return false; // check ob identischer eintrag existiert - $check_qry = 'SELECT count(*) from campus.tbl_zeitaufzeichnung where uid='.$this->db_add_param($this->uid).' and start = '.$this->db_add_param($this->start).' and ende = '.$this->db_add_param($this->ende); - if($this->db_query($check_qry) && $this->new) + // DienstreiseMT-Einträge sind hier ausgenommen da eintägige Dienstreisen mit der identen Arbeitszeit eingetragen werden könnten + if ($this->aktivitaet_kurzbz != 'DienstreiseMT') { - if($row = $this->db_fetch_object()) + $check_qry = 'SELECT count(*) from campus.tbl_zeitaufzeichnung where uid='.$this->db_add_param($this->uid).' and aktivitaet_kurzbz != \'DienstreiseMT\' and start = '.$this->db_add_param($this->start).' and ende = '.$this->db_add_param($this->ende); + if($this->db_query($check_qry) && $this->new) { - if ($row->count) + if($row = $this->db_fetch_object()) { - $this->errormsg = 'Identischer Eintrag existiert!'; - return false; + if ($row->count) + { + $this->errormsg = 'Identischer Eintrag existiert!'; + return false; + } } } } From e5acc1b29257853919ebcbd19f74020afb42239b Mon Sep 17 00:00:00 2001 From: Andreas Oesterreicher Date: Wed, 9 Jan 2019 10:58:52 +0100 Subject: [PATCH 02/18] =?UTF-8?q?LVPlan=20SQL=20f=C3=BCr=20LOAD=5FUEBER=5F?= =?UTF-8?q?SEMESTERHAELFTE=20angepasst=20damit=20auch=20f=C3=BCr=20Wiederh?= =?UTF-8?q?oler=20ein=20korrektes=20ergebnis=20geliefert=20wird?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/lehrstunde.class.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/lehrstunde.class.php b/include/lehrstunde.class.php index 5ed27674e..6cbc5db0a 100644 --- a/include/lehrstunde.class.php +++ b/include/lehrstunde.class.php @@ -329,10 +329,12 @@ class lehrstunde extends basis_db if($lvplan_load_ueber_semesterhaelfte) { $sql_query="SELECT studiengang_kz, semester, verband, gruppe - FROM public.tbl_studentlehrverband - WHERE student_uid=".$this->db_add_param($uid)." - AND studiensemester_kurzbz in(".$this->db_add_param($this->ss).",".$this->db_add_param($this->ssnext).",".$this->db_add_param($this->ssprev).") - order by semester desc limit 2"; + FROM + public.tbl_studentlehrverband + JOIN public.tbl_studiensemester USING(studiensemester_kurzbz) + WHERE student_uid=".$this->db_add_param($uid)." + AND studiensemester_kurzbz in(".$this->db_add_param($this->ss).",".$this->db_add_param($this->ssnext).",".$this->db_add_param($this->ssprev).") + ORDER BY start desc LIMIT 2"; } else { From 17ba5c15d8d94ac99ac482575c348f65ea78f392 Mon Sep 17 00:00:00 2001 From: Paolo Date: Wed, 9 Jan 2019 13:59:03 +0100 Subject: [PATCH 03/18] Changed file permissions --- .../organisation/reihungstest/ReihungstestUebersichtData.php | 0 application/views/system/infocenter/infocenterData.php | 0 application/views/system/infocenter/infocenterDetails.php | 0 application/views/system/infocenter/infocenterFreigegeben.php | 0 application/views/system/infocenter/infocenterFreigegebenData.php | 0 .../system/infocenter/infocenterReihungstestAbsolviertData.php | 0 application/views/system/infocenter/stammdaten.php | 0 application/views/templates/FHC-Header.php | 0 cis/private/coodle/termin.php | 0 cis/private/info/service_uebersicht.php | 0 cis/private/profile/index.php | 0 cis/private/profile/zeitsperre_resturlaub.php | 0 cis/private/tools/zeitaufzeichnung.php | 0 include/kontakt.class.php | 0 include/service.class.php | 0 include/zeitaufzeichnung.class.php | 0 include/zeitsperre.class.php | 0 locale/de-AT/profil.php | 0 locale/de-AT/services.php | 0 locale/de-AT/zeitaufzeichnung.php | 0 locale/de-AT/zeitsperre.php | 0 locale/en-US/profil.php | 0 locale/en-US/zeitaufzeichnung.php | 0 locale/en-US/zeitsperre.php | 0 system/dbupdate_3.3.php | 0 system/filtersupdate.php | 0 vilesci/personen/leistungsstipendium.php | 0 vilesci/stammdaten/service_uebersicht.php | 0 28 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 application/views/organisation/reihungstest/ReihungstestUebersichtData.php mode change 100755 => 100644 application/views/system/infocenter/infocenterData.php mode change 100755 => 100644 application/views/system/infocenter/infocenterDetails.php mode change 100755 => 100644 application/views/system/infocenter/infocenterFreigegeben.php mode change 100755 => 100644 application/views/system/infocenter/infocenterFreigegebenData.php mode change 100755 => 100644 application/views/system/infocenter/infocenterReihungstestAbsolviertData.php mode change 100755 => 100644 application/views/system/infocenter/stammdaten.php mode change 100755 => 100644 application/views/templates/FHC-Header.php mode change 100755 => 100644 cis/private/coodle/termin.php mode change 100755 => 100644 cis/private/info/service_uebersicht.php mode change 100755 => 100644 cis/private/profile/index.php mode change 100755 => 100644 cis/private/profile/zeitsperre_resturlaub.php mode change 100755 => 100644 cis/private/tools/zeitaufzeichnung.php mode change 100755 => 100644 include/kontakt.class.php mode change 100755 => 100644 include/service.class.php mode change 100755 => 100644 include/zeitaufzeichnung.class.php mode change 100755 => 100644 include/zeitsperre.class.php mode change 100755 => 100644 locale/de-AT/profil.php mode change 100755 => 100644 locale/de-AT/services.php mode change 100755 => 100644 locale/de-AT/zeitaufzeichnung.php mode change 100755 => 100644 locale/de-AT/zeitsperre.php mode change 100755 => 100644 locale/en-US/profil.php mode change 100755 => 100644 locale/en-US/zeitaufzeichnung.php mode change 100755 => 100644 locale/en-US/zeitsperre.php mode change 100755 => 100644 system/dbupdate_3.3.php mode change 100755 => 100644 system/filtersupdate.php mode change 100755 => 100644 vilesci/personen/leistungsstipendium.php mode change 100755 => 100644 vilesci/stammdaten/service_uebersicht.php diff --git a/application/views/organisation/reihungstest/ReihungstestUebersichtData.php b/application/views/organisation/reihungstest/ReihungstestUebersichtData.php old mode 100755 new mode 100644 diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php old mode 100755 new mode 100644 diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php old mode 100755 new mode 100644 diff --git a/application/views/system/infocenter/infocenterFreigegeben.php b/application/views/system/infocenter/infocenterFreigegeben.php old mode 100755 new mode 100644 diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php old mode 100755 new mode 100644 diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php old mode 100755 new mode 100644 diff --git a/application/views/system/infocenter/stammdaten.php b/application/views/system/infocenter/stammdaten.php old mode 100755 new mode 100644 diff --git a/application/views/templates/FHC-Header.php b/application/views/templates/FHC-Header.php old mode 100755 new mode 100644 diff --git a/cis/private/coodle/termin.php b/cis/private/coodle/termin.php old mode 100755 new mode 100644 diff --git a/cis/private/info/service_uebersicht.php b/cis/private/info/service_uebersicht.php old mode 100755 new mode 100644 diff --git a/cis/private/profile/index.php b/cis/private/profile/index.php old mode 100755 new mode 100644 diff --git a/cis/private/profile/zeitsperre_resturlaub.php b/cis/private/profile/zeitsperre_resturlaub.php old mode 100755 new mode 100644 diff --git a/cis/private/tools/zeitaufzeichnung.php b/cis/private/tools/zeitaufzeichnung.php old mode 100755 new mode 100644 diff --git a/include/kontakt.class.php b/include/kontakt.class.php old mode 100755 new mode 100644 diff --git a/include/service.class.php b/include/service.class.php old mode 100755 new mode 100644 diff --git a/include/zeitaufzeichnung.class.php b/include/zeitaufzeichnung.class.php old mode 100755 new mode 100644 diff --git a/include/zeitsperre.class.php b/include/zeitsperre.class.php old mode 100755 new mode 100644 diff --git a/locale/de-AT/profil.php b/locale/de-AT/profil.php old mode 100755 new mode 100644 diff --git a/locale/de-AT/services.php b/locale/de-AT/services.php old mode 100755 new mode 100644 diff --git a/locale/de-AT/zeitaufzeichnung.php b/locale/de-AT/zeitaufzeichnung.php old mode 100755 new mode 100644 diff --git a/locale/de-AT/zeitsperre.php b/locale/de-AT/zeitsperre.php old mode 100755 new mode 100644 diff --git a/locale/en-US/profil.php b/locale/en-US/profil.php old mode 100755 new mode 100644 diff --git a/locale/en-US/zeitaufzeichnung.php b/locale/en-US/zeitaufzeichnung.php old mode 100755 new mode 100644 diff --git a/locale/en-US/zeitsperre.php b/locale/en-US/zeitsperre.php old mode 100755 new mode 100644 diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php old mode 100755 new mode 100644 diff --git a/system/filtersupdate.php b/system/filtersupdate.php old mode 100755 new mode 100644 diff --git a/vilesci/personen/leistungsstipendium.php b/vilesci/personen/leistungsstipendium.php old mode 100755 new mode 100644 diff --git a/vilesci/stammdaten/service_uebersicht.php b/vilesci/stammdaten/service_uebersicht.php old mode 100755 new mode 100644 From 1bdf8bd435da3a53ca72fc8fe3942040fb432647 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 9 Jan 2019 18:10:55 +0100 Subject: [PATCH 04/18] Infocenter notizen update - removed html specialchars in quickinfo - notizen are retrieved by ajax when click on tablerow --- .../system/infocenter/InfoCenter.php | 19 ++++- .../views/system/infocenter/notizen.php | 4 +- public/js/infocenter/infocenterDetails.js | 76 ++++++++++++++----- system/phrasesupdate.php | 20 +++++ 4 files changed, 94 insertions(+), 25 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 1f808da53..65a6aec07 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -84,6 +84,7 @@ class InfoCenter extends Auth_Controller 'saveZgvPruefung' => 'infocenter:rw', 'saveAbsage' => 'infocenter:rw', 'saveFreigabe' => 'infocenter:rw', + 'getNotiz' => 'infocenter:r', 'saveNotiz' => 'infocenter:rw', 'updateNotiz' => 'infocenter:rw', 'reloadZgvPruefungen' => 'infocenter:r', @@ -533,6 +534,20 @@ class InfoCenter extends Auth_Controller $this->output->set_content_type('application/json')->set_output(json_encode($json)); } + /** + * Gets a Notiz + */ + public function getNotiz() + { + $notiz_id = $this->input->get('notiz_id'); + + $result = $this->NotizModel->load( + $notiz_id + ); + + $this->output->set_content_type('application/json')->set_output(json_encode($result)); + } + /** * Saves a new Notiz for a person * @param $person_id @@ -557,10 +572,10 @@ class InfoCenter extends Auth_Controller * Updates a new Notiz for a person * @param int $notiz_id * @param int $person_id - * @return bool true if success */ - public function updateNotiz($notiz_id, $person_id) + public function updateNotiz($notiz_id) { + $person_id = $this->input->post('person_id'); $titel = $this->input->post('notiztitel'); $text = $this->input->post('notiz'); diff --git a/application/views/system/infocenter/notizen.php b/application/views/system/infocenter/notizen.php index 53d289721..13f7bb6e1 100644 --- a/application/views/system/infocenter/notizen.php +++ b/application/views/system/infocenter/notizen.php @@ -9,11 +9,11 @@ + title="text) ? html_escape($notiz->text) : '' ?>" style="cursor: pointer"> insertamum), 'd.m.Y H:i:s') ?> titel) ?> verfasser_uid ?> - notiz_id ?> + notiz_id ?> diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index 8de1d2c6f..84f68bf11 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -45,10 +45,12 @@ $(document).ready(function () $("#notizform").on("submit", function (e) { e.preventDefault(); - var notizId = $("#notizform :input[name='hiddenNotizId']").val(); + var notizid = $("#notizform :input[name='hiddenNotizId']").val(); var formdata = $(this).serializeArray(); var data = {}; + data.person_id = personid; + for (var i = 0; i < formdata.length; i++) { data[formdata[i].name] = formdata[i].value; @@ -56,9 +58,9 @@ $(document).ready(function () $("#notizmsg").empty(); - if (notizId !== '') + if (notizid !== '') { - InfocenterDetails.updateNotiz(notizId, personid, data); + InfocenterDetails.updateNotiz(notizid, data); } else { @@ -72,16 +74,9 @@ $(document).ready(function () { $("#notizmsg").empty(); - var notizId = $(this).find("td:eq(3)").html(); - var notizTitle = $(this).find("td:eq(1)").text(); - var notizContent = this.title; + var notizid = $(this).find("td.hiddennotizid").html(); - $("#notizform label:first").text(FHC_PhrasesLib.t('infocenter', 'notizAendern')).css("color", "red"); - $("#notizform :input[type='reset']").css("display", "inline-block"); - - $("#notizform :input[name='hiddenNotizId']").val(notizId); - $("#notizform :input[name='notiztitel']").val(notizTitle); - $("#notizform :input[name='notiz']").val(notizContent); + InfocenterDetails.getNotiz(notizid); } ); @@ -297,7 +292,40 @@ var InfocenterDetails = { } ); }, - saveNotiz: function(personid, data) + getNotiz: function(notiz_id) + { + FHC_AjaxClient.ajaxCallGet( + CALLED_PATH + '/getNotiz', + { + "notiz_id": notiz_id + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.hasData(data)) + { + var notiz = data.retval[0]; + + $("#notizform label:first").text(FHC_PhrasesLib.t('infocenter', 'notizAendern')).css("color", "red"); + $("#notizform :input[type='reset']").css("display", "inline-block"); + + $("#notizform :input[name='hiddenNotizId']").val(notiz_id); + $("#notizform :input[name='notiztitel']").val(notiz.titel); + $("#notizform :input[name='notiz']").val(notiz.text); + } + else + { + InfocenterDetails._notizError('fehlerBeimLesen'); + } + }, + errorCallback: function() + { + InfocenterDetails._notizError('fehlerBeimLesen'); + }, + veilTimeout: 0 + } + ); + }, + saveNotiz: function(data) { FHC_AjaxClient.ajaxCallPost( CALLED_PATH + '/saveNotiz/' + encodeURIComponent(personid), @@ -311,18 +339,21 @@ var InfocenterDetails = { } else { - InfocenterDetails._errorSaveNotiz(); + InfocenterDetails._notizError('fehlerBeimSpeichern'); } }, - errorCallback: InfocenterDetails._errorSaveNotiz, + errorCallback: function() + { + InfocenterDetails._notizError('fehlerBeimSpeichern'); + }, veilTimeout: 0 } ); }, - updateNotiz: function(notizId, personId, data) + updateNotiz: function(notizid, data) { FHC_AjaxClient.ajaxCallPost( - CALLED_PATH + '/updateNotiz/' + encodeURIComponent(notizId) + "/" + encodeURIComponent(personId), + CALLED_PATH + '/updateNotiz/' + encodeURIComponent(notizid), data, { successCallback: function(data, textStatus, jqXHR) { @@ -334,10 +365,13 @@ var InfocenterDetails = { } else { - InfocenterDetails._errorSaveNotiz(); + InfocenterDetails._notizError('fehlerBeimSpeichern'); } }, - errorCallback: InfocenterDetails._errorSaveNotiz, + errorCallback: function() + { + InfocenterDetails._notizError('fehlerBeimSpeichern'); + }, veilTimeout: 0 } ); @@ -815,8 +849,8 @@ var InfocenterDetails = { $("#notizform label:first").text(FHC_PhrasesLib.t('infocenter', 'notizHinzufuegen')).css("color", "black"); $("#notizform :input[type='reset']").css("display", "none"); }, - _errorSaveNotiz: function() + _notizError: function(phrasename) { - $("#notizmsg").text(FHC_PhrasesLib.t('ui', 'fehlerBeimSpeichern')); + $("#notizmsg").text(FHC_PhrasesLib.t('ui', phrasename)); } }; diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 5bbef50b2..4f9d885d0 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -1394,6 +1394,26 @@ $phrases = array( ) ) ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'fehlerBeimLesen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Fehler beim Lesen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Error on Reading', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'ui', From a090468126cdde718172939e06ad1b99742e1675 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 9 Jan 2019 18:15:17 +0100 Subject: [PATCH 05/18] added personid param for adding notiz --- public/js/infocenter/infocenterDetails.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index 84f68bf11..5a1fd7653 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -325,7 +325,7 @@ var InfocenterDetails = { } ); }, - saveNotiz: function(data) + saveNotiz: function(personid, data) { FHC_AjaxClient.ajaxCallPost( CALLED_PATH + '/saveNotiz/' + encodeURIComponent(personid), From fa9976ec66099a6118eb358dac795bcb8d59e4b3 Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 11 Jan 2019 15:14:53 +0100 Subject: [PATCH 06/18] - FilterWidget can represents the retrieved data with tablesorter or pivotUI - Added new constants to FiltersLib - Added new parameter pivotui to FHC-Header to load JS and CSS for pivotUI - Renamed constat WIDGET_URL_TABLE_DATASET to WIDGET_URL_DATASET_TABLESORTER in FilterWidget - Added new constat WIDGET_URL_DATASET_PIVOTUI to FilterWidget - Added new private properties _datasetRepresentation and _datasetRepresentationOptions to FilterWidget - Renamed FilterWidget->loadViewTableDataset to loadViewDataset - FilterWidget->loadViewDataset loads tablesorter or pivotUI view depending on the value of property _datasetRepresentation - FilterWidget accepts two new parameter: datasetRepresentation and datasetRepOptions - datasetRepresentation is required - FilterWidget stores in session the _datasetRepresentation and _datasetRepresentationOptions properties - Adapted view views/widgets/filter/filter to use loadViewDataset - All views using FilterWidget have been adapted to use the required parameter datasetRepresentation - Added new constats DATASET_REP_TABLESORTER and DATASET_REP_PIVOTUI to public/js/FilterWidget.js - Added new private property _datasetRepresentation to FHC_FilterWidget in public/js/FilterWidget.js - Based on property _datasetRepresentation FilterWidget.js will represent the FilterWidget data with tablesorter or pivotUI - Added new private method _renderDataset to FHC_FilterWidget in public/js/FilterWidget.js - Renamed method _renderTableDataset to _renderDatasetTablesorter in FHC_FilterWidget in public/js/FilterWidget.js - Added new method _renderDatasetPivotUI to FHC_FilterWidget in public/js/FilterWidget.js - Added bew method _setDatasetRepresentation to FHC_FilterWidget in public/js/FilterWidget.js --- application/libraries/FiltersLib.php | 10 ++ .../ReihungstestUebersichtData.php | 1 + application/views/person/bpk/bpkData.php | 1 + .../system/infocenter/infocenterData.php | 1 + .../infocenter/infocenterFreigegebenData.php | 1 + .../infocenterReihungstestAbsolviertData.php | 1 + application/views/templates/FHC-Header.php | 13 ++ application/views/widgets/filter/filter.php | 2 +- .../views/widgets/filter/pivotUIDataset.php | 1 + application/widgets/FilterWidget.php | 66 ++++++-- public/js/FilterWidget.js | 153 ++++++++++++++++-- 11 files changed, 229 insertions(+), 21 deletions(-) create mode 100644 application/views/widgets/filter/pivotUIDataset.php diff --git a/application/libraries/FiltersLib.php b/application/libraries/FiltersLib.php index 48f6c413a..3b719b5f3 100644 --- a/application/libraries/FiltersLib.php +++ b/application/libraries/FiltersLib.php @@ -20,6 +20,8 @@ class FiltersLib const SESSION_DATASET = 'dataset'; const SESSION_ROW_NUMBER = 'rowNumber'; const SESSION_RELOAD_DATASET = 'reloadDataset'; + const SESSION_DATASET_REPRESENTATION = 'datasetRepresentation'; + const SESSION_DATASET_REP_OPTIONS = 'datasetRepresentationOptions'; // Alias for the dynamic table used to retrive the dataset const DATASET_TABLE_ALIAS = 'datasetFilterTable'; @@ -55,6 +57,14 @@ class FiltersLib const CUSTOM_MENU = 'customMenu'; // ...to specify if the menu for this filter is custom (true) or not (false) + // ...to specify how to represent the dataset (ex: tablesorter, pivotUI, ...) + const DATASET_REPRESENTATION = 'datasetRepresentation'; + const DATASET_REP_OPTIONS = 'datasetRepOptions'; + + // Different dataset representations + const DATASET_REP_TABLESORTER = 'tablesorter'; + const DATASET_REP_PIVOTUI = 'pivotUI'; + // Filter operations values const OP_EQUAL = 'equal'; const OP_NOT_EQUAL = 'nequal'; diff --git a/application/views/organisation/reihungstest/ReihungstestUebersichtData.php b/application/views/organisation/reihungstest/ReihungstestUebersichtData.php index 158a46e3b..719370ab3 100644 --- a/application/views/organisation/reihungstest/ReihungstestUebersichtData.php +++ b/application/views/organisation/reihungstest/ReihungstestUebersichtData.php @@ -111,6 +111,7 @@ ) data ", 'requiredPermissions' => 'infocenter', + 'datasetRepresentation' => 'tablesorter', 'additionalColumns' => array('Details'), 'columnsAliases' => array( 'ReihungstestID', diff --git a/application/views/person/bpk/bpkData.php b/application/views/person/bpk/bpkData.php index f7bf75b50..7e375030f 100644 --- a/application/views/person/bpk/bpkData.php +++ b/application/views/person/bpk/bpkData.php @@ -13,6 +13,7 @@ person_id=tbl_person.person_id AND tbl_benutzer.aktiv=true) ', 'requiredPermissions' => 'admin', + 'datasetRepresentation' => 'tablesorter', 'additionalColumns' => array('Details'), 'columnsAliases' => array( 'PersonID', diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 8922de4c0..9baac9ea6 100644 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -232,6 +232,7 @@ 'filterKurzbz' => 'InfoCenterSentApplicationAll', 'filter_id' => $this->input->get('filter_id'), 'requiredPermissions' => 'infocenter', + 'datasetRepresentation' => 'tablesorter', 'customMenu' => true, 'checkboxes' => 'PersonId', 'additionalColumns' => array('Details'), diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php index 02981a6c6..b3ee8c9e5 100644 --- a/application/views/system/infocenter/infocenterFreigegebenData.php +++ b/application/views/system/infocenter/infocenterFreigegebenData.php @@ -192,6 +192,7 @@ 'datasetName' => 'freigegeben', 'filter_id' => $this->input->get('filter_id'), 'requiredPermissions' => 'infocenter', + 'datasetRepresentation' => 'tablesorter', 'checkboxes' => 'PersonId', 'additionalColumns' => array('Details'), 'columnsAliases' => array( diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php index 63a2d906c..2a976771b 100644 --- a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php +++ b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php @@ -186,6 +186,7 @@ 'datasetName' => 'reihungstestAbsolviert', 'filter_id' => $this->input->get('filter_id'), 'requiredPermissions' => 'infocenter', + 'datasetRepresentation' => 'tablesorter', 'checkboxes' => 'PersonId', 'additionalColumns' => array('Details'), 'columnsAliases' => array( diff --git a/application/views/templates/FHC-Header.php b/application/views/templates/FHC-Header.php index 0e1021da3..785ac0184 100644 --- a/application/views/templates/FHC-Header.php +++ b/application/views/templates/FHC-Header.php @@ -26,6 +26,7 @@ $navigationwidget = isset($navigationwidget) ? $navigationwidget : false; $sbadmintemplate = isset($sbadmintemplate) ? $sbadmintemplate : false; $tablesorter = isset($tablesorter) ? $tablesorter : false; + $pivotui = isset($pivotui) ? $pivotui : false; $tinymce = isset($tinymce) ? $tinymce : false; ?> @@ -60,6 +61,12 @@ generateCSSsInclude('vendor/mottie/tablesorter/dist/css/jquery.tablesorter.pager.min.css'); } + // PivotUI CSS + if ($pivotui === true) + { + generateCSSsInclude('vendor/nicolaskruchten/pivottable/dist/pivot.min.css'); + } + // SB Admin 2 template CSS if ($sbadmintemplate === true) { @@ -121,6 +128,12 @@ generateJSsInclude('vendor/mottie/tablesorter/dist/js/extras/jquery.tablesorter.pager.min.js'); } + // PivotUI CSS + if ($pivotui === true) + { + generateJSsInclude('vendor/nicolaskruchten/pivottable/dist/pivot.min.js'); + } + // Tinymce JS if ($tinymce === true) generateJSsInclude('vendor/tinymce/tinymce/tinymce.min.js'); diff --git a/application/views/widgets/filter/filter.php b/application/views/widgets/filter/filter.php index bae5110e9..dc20e58b6 100644 --- a/application/views/widgets/filter/filter.php +++ b/application/views/widgets/filter/filter.php @@ -46,7 +46,7 @@
- +
diff --git a/application/views/widgets/filter/pivotUIDataset.php b/application/views/widgets/filter/pivotUIDataset.php new file mode 100644 index 000000000..570f41ae0 --- /dev/null +++ b/application/views/widgets/filter/pivotUIDataset.php @@ -0,0 +1 @@ +
diff --git a/application/widgets/FilterWidget.php b/application/widgets/FilterWidget.php index 1ae29cb42..86e954e93 100644 --- a/application/widgets/FilterWidget.php +++ b/application/widgets/FilterWidget.php @@ -8,7 +8,8 @@ class FilterWidget extends Widget // Paths of the views const WIDGET_URL_FILTER = 'widgets/filter/filter'; const WIDGET_URL_SELECT_FIELDS = 'widgets/filter/selectFields'; - const WIDGET_URL_TABLE_DATASET = 'widgets/filter/tableDataset'; + const WIDGET_URL_DATASET_TABLESORTER = 'widgets/filter/tableDataset'; + const WIDGET_URL_DATASET_PIVOTUI = 'widgets/filter/pivotUIDataset'; const WIDGET_URL_SELECT_FILTERS = 'widgets/filter/selectFilters'; const WIDGET_URL_SAVE_FILTER = 'widgets/filter/saveFilter'; @@ -45,6 +46,9 @@ class FilterWidget extends Widget private $_customMenu; // if true then method _setFilterMenu is NOT called + private $_datasetRepresentation; // dataset representation (ex: tablesorter, pivotUI, ...) + private $_datasetRepresentationOptions; // dataset representation options for tablesorter, pivotUI, ... + private static $_FilterWidgetInstance; // static property that contains the instance of itself /** @@ -119,11 +123,19 @@ class FilterWidget extends Widget } /** - * Loads the view related to the table dataset + * Loads the view related to the dataset, here is decided how to represent the dataset (ex: tablesorter, pivotUI, ...) */ - public static function loadViewTableDataset() + public static function loadViewDataset() { - self::_loadView(self::WIDGET_URL_TABLE_DATASET); + if (self::$_FilterWidgetInstance->_datasetRepresentation == FiltersLib::DATASET_REP_TABLESORTER) + { + self::_loadView(self::WIDGET_URL_DATASET_TABLESORTER); + } + + if (self::$_FilterWidgetInstance->_datasetRepresentation == FiltersLib::DATASET_REP_PIVOTUI) + { + self::_loadView(self::WIDGET_URL_DATASET_PIVOTUI); + } } //------------------------------------------------------------------------------------------------------------------ @@ -153,6 +165,8 @@ class FilterWidget extends Widget $this->_hideHeader = null; $this->_hideSave = null; $this->_customMenu = null; + $this->_datasetRepresentation = null; + $this->_datasetRepresentationOptions = null; // Retrived the required permissions parameter if present if (isset($args[FiltersLib::REQUIRED_PERMISSIONS_PARAMETER])) @@ -234,10 +248,25 @@ class FilterWidget extends Widget $this->_hideSave = $args[FiltersLib::HIDE_SAVE]; } + // If a custom menu is set if (isset($args[FiltersLib::CUSTOM_MENU]) && is_bool($args[FiltersLib::CUSTOM_MENU])) { $this->_customMenu = $args[FiltersLib::CUSTOM_MENU]; } + + // To specify how to represent the dataset (ex: tablesorter, pivotUI, ...) + if (isset($args[FiltersLib::DATASET_REPRESENTATION]) + && ($args[FiltersLib::DATASET_REPRESENTATION] == FiltersLib::DATASET_REP_TABLESORTER + || $args[FiltersLib::DATASET_REPRESENTATION] == FiltersLib::DATASET_REP_PIVOTUI)) + { + $this->_datasetRepresentation = $args[FiltersLib::DATASET_REPRESENTATION]; + } + + // To specify options for the dataset representation (ex: tablesorter, pivotUI, ...) + if (isset($args[FiltersLib::DATASET_REP_OPTIONS]) && !isEmptyString($args[FiltersLib::DATASET_REP_OPTIONS])) + { + $this->_datasetRepresentationOptions = $args[FiltersLib::DATASET_REP_OPTIONS]; + } } /** @@ -247,7 +276,7 @@ class FilterWidget extends Widget { if (!is_array($args) || (is_array($args) && count($args) == 0)) { - show_error('Second parameter of the widget call must be a not empty associative array'); + show_error('Second parameter of the widget call must be a NOT empty associative array'); } else { @@ -259,12 +288,25 @@ class FilterWidget extends Widget FiltersLib::FILTER_ID.'" must be specified' ); } - else + + if (!isset($args[FiltersLib::QUERY_PARAMETER])) { - if (!isset($args[FiltersLib::QUERY_PARAMETER])) - { - show_error('The parameters "'.FiltersLib::QUERY_PARAMETER.'" must be specified'); - } + show_error('The parameters "'.FiltersLib::QUERY_PARAMETER.'" must be specified'); + } + + if (!isset($args[FiltersLib::DATASET_REPRESENTATION])) + { + show_error('The parameter "'.FiltersLib::DATASET_REPRESENTATION.'" must be specified'); + } + + if (isset($args[FiltersLib::DATASET_REPRESENTATION]) + && $args[FiltersLib::DATASET_REPRESENTATION] != FiltersLib::DATASET_REP_TABLESORTER + && $args[FiltersLib::DATASET_REPRESENTATION] != FiltersLib::DATASET_REP_PIVOTUI) + { + show_error( + 'The parameter "'.FiltersLib::DATASET_REPRESENTATION. + '" must be IN ("'.FiltersLib::DATASET_REP_TABLESORTER.'", "'.FiltersLib::DATASET_REP_PIVOTUI.'")' + ); } } } @@ -370,7 +412,9 @@ class FilterWidget extends Widget 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 + FiltersLib::SESSION_RELOAD_DATASET => false, // if the dataset must be reloaded, not needed the first time + FiltersLib::SESSION_DATASET_REPRESENTATION => $this->_datasetRepresentation, // the choosen dataset representation + FiltersLib::SESSION_DATASET_REP_OPTIONS => $this->_datasetRepresentationOptions // the choosen dataset representation options ) ); } diff --git a/public/js/FilterWidget.js b/public/js/FilterWidget.js index 18082b96d..0f1889486 100644 --- a/public/js/FilterWidget.js +++ b/public/js/FilterWidget.js @@ -63,10 +63,23 @@ function sideMenuHook() }); } +//-------------------------------------------------------------------------------------------------------------------- +// Constants + +// Success +const DATASET_REP_TABLESORTER = "tablesorter"; +const DATASET_REP_PIVOTUI = "pivotUI"; + /** * FHC_FilterWidget this object is used to render the GUI of a filter widget and to operate with it */ var FHC_FilterWidget = { + + //------------------------------------------------------------------------------------------------------------------ + // Properties + + _datasetRepresentation: null, // + //------------------------------------------------------------------------------------------------------------------ // Public methods @@ -138,8 +151,19 @@ var FHC_FilterWidget = { $("#addField").html(""); $("#appliedFilters").html(""); $("#addFilter").html(""); - $("#filterTableDataset > thead > tr").html(""); - $("#filterTableDataset > tbody").html(""); + + // If the choosen dataset representation is tablesorter + if (FHC_FilterWidget._datasetRepresentation == DATASET_REP_TABLESORTER) + { + $("#filterTableDataset > thead > tr").html(""); + $("#filterTableDataset > tbody").html(""); + } + + // If the choosen dataset representation is pivotUI + if (FHC_FilterWidget._datasetRepresentation == DATASET_REP_PIVOTUI) + { + $("#filterPivotUI").html(""); + } }, /** @@ -155,6 +179,7 @@ var FHC_FilterWidget = { }, { successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.hasData(data)) { if (typeof renderFunction == "function") @@ -180,6 +205,9 @@ var FHC_FilterWidget = { _renderFilterWidget: function(data) { FHC_FilterWidget._initSessionStorage(); // initialize the session storage + + FHC_FilterWidget._setDatasetRepresentation(data); // set what type of dataset representation was choosen + FHC_FilterWidget._turnOffEvents(); // turns all the events off FHC_FilterWidget._resetGUI(); // Reset the entire GUI @@ -189,7 +217,7 @@ var FHC_FilterWidget = { FHC_FilterWidget._renderDropDownFields(data); // render the fields drop-down FHC_FilterWidget._renderAppliedFilters(data); // render the GUI for the applied filters FHC_FilterWidget._renderDropDownFilters(data); // render the filters drop-down - FHC_FilterWidget._renderTableDataset(data); // render the table GUI + FHC_FilterWidget._renderDataset(data); FHC_FilterWidget._turnOnEvents(); // turns all the events off }, @@ -230,7 +258,12 @@ var FHC_FilterWidget = { $("#addFilter").off("change"); $("#applyFilter").off("click"); $("#saveCustomFilterButton").off("click"); - FHC_FilterWidget._disableTableSorter(); + + // If the choosen dataset representation is tablesorter + if (FHC_FilterWidget._datasetRepresentation == DATASET_REP_TABLESORTER) + { + FHC_FilterWidget._disableTableSorter(); // disable the tablesorter + } }, /** @@ -249,7 +282,12 @@ var FHC_FilterWidget = { $("#addFilter").change(FHC_FilterWidget._addFilterEvent); // Click event on the applied filters drop-down to add a new filter to the dataset $("#applyFilter").click(FHC_FilterWidget._applyFilterEvent); // Click event on the applied filters drop-down to apply filters to the dataset $("#saveCustomFilterButton").click(FHC_FilterWidget._saveCustomFilterButtonEvent); // Click evento to for the save custom filter button - FHC_FilterWidget._enableTableSorter(); // enable the tablesorter + + // If the choosen dataset representation is tablesorter + if (FHC_FilterWidget._datasetRepresentation == DATASET_REP_TABLESORTER) + { + FHC_FilterWidget._enableTableSorter(); // enable the tablesorter + } }, /** @@ -761,11 +799,26 @@ var FHC_FilterWidget = { return html; }, + _renderDataset: function(data) { + + // If the choosen dataset representation is tablesorter then... + if (FHC_FilterWidget._datasetRepresentation == DATASET_REP_TABLESORTER) + { + FHC_FilterWidget._renderDatasetTablesorter(data); // ...render the tablesorter GUI + } + + // If the choosen dataset representation is pivotUI then... + if (FHC_FilterWidget._datasetRepresentation == DATASET_REP_PIVOTUI) + { + FHC_FilterWidget._renderDatasetPivotUI(data); // ...render the pivotUI GUI + } + }, + /** - * Renders the table for the FilterWidget + * Renders the tablesorter for the FilterWidget * The data to be displayed are retrived from the parameter data */ - _renderTableDataset: function(data) { + _renderDatasetTablesorter: function(data) { if (data.hasOwnProperty("checkboxes") && data.checkboxes!=null && data.checkboxes.trim() != "") { @@ -823,7 +876,6 @@ var FHC_FilterWidget = { { strHtml += "" + record[additionalColumn] + ""; } - }); } @@ -853,7 +905,7 @@ var FHC_FilterWidget = { } }); - // reset filter storage if there is a filter id in url TODO: find better solution + // Reset filter storage if there is a filter id in url TODO: find better solution var filter_id = FHC_AjaxClient.getUrlParameter("filter_id"); if (typeof filter_id !== "undefined") FHC_FilterWidget._cleanTablesorterLocalStorage(); @@ -869,6 +921,78 @@ var FHC_FilterWidget = { $("#filterTableDataset").trigger("disable"); }, + /** + * Renders the pivotUI for the FilterWidget + * The data to be displayed are retrived from the parameter data + */ + _renderDatasetPivotUI: function(data) { + + var options = {}; // eventually contains options fot the pivotUI + + // Checks if options were given + if (data.hasOwnProperty("datasetRepresentationOptions") && data.datasetRepresentationOptions != "") + { + var tmpOptions = eval("(" + data.datasetRepresentationOptions + ")"); // and converts them from string to javascript code + + // If it is an object then can be used + if (typeof tmpOptions == "object") + { + options = tmpOptions; + } + } + + // Manipulation for the representation! + var arrayFieldsToDisplay = FHC_FilterWidget._getFieldsToDisplay(data); + + // If there are fields to be displayed... + if (arrayFieldsToDisplay.length > 0) + { + // ...if there are data to be displayed... + if (data.hasOwnProperty("dataset") && $.isArray(data.dataset)) + { + // Build the array of objects used by pivotUI and store it in pivotUIData + var pivotUIData = []; + + // Loops through data + for (var i = 0; i < data.dataset.length; i++) + { + var record = data.dataset[i]; // Single record + var tmpObj = {}; // New object that represents a record + + // Loops through columns of a record + $.each(arrayFieldsToDisplay, function(i, fieldToDisplay) { + + if (record.hasOwnProperty(data.selectedFields[i])) + { + tmpObj[fieldToDisplay] = record[data.selectedFields[i]]; // Add data with the column alias + } + }); + + // If additional columns are present... + if (data.additionalColumns != null && $.isArray(data.additionalColumns)) + { + // ...loops through them + $.each(data.additionalColumns, function(i, additionalColumn) { + + if (record.hasOwnProperty(additionalColumn)) + { + tmpObj[additionalColumn] = record[additionalColumn]; // Add the additional column + } + }); + } + + pivotUIData.push(tmpObj); // Add tmpObj to pivotUIData + } + + // Renders the pivotUI + $("#filterPivotUI").pivotUI( + pivotUIData, + options + ); + } + } + }, + /** * Retrives the fields to be displayed from the data parameter, if aliases are present then they are used */ @@ -906,6 +1030,17 @@ var FHC_FilterWidget = { _cleanTablesorterLocalStorage: function() { $("#filterTableDataset").trigger("filterResetSaved"); + }, + + /** + * Set what type of dataset representation was choosen + */ + _setDatasetRepresentation: function(data) { + + if (data.hasOwnProperty("datasetRepresentation")) + { + FHC_FilterWidget._datasetRepresentation = data.datasetRepresentation; + } } }; From 89849d30fb347ac7ae01069ce3c6db150d6b457f Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 11 Jan 2019 18:39:48 +0100 Subject: [PATCH 07/18] - added hasSequence in models to avoid sequenceerrors - added getByDate, generateMatrikelnummer methods --- application/models/crm/Student_model.php | 36 ++++++++++++++++++- .../education/Studentlehrverband_model.php | 1 + .../organisation/Studiensemester_model.php | 22 ++++++++++++ application/models/person/Benutzer_model.php | 3 +- 4 files changed, 60 insertions(+), 2 deletions(-) diff --git a/application/models/crm/Student_model.php b/application/models/crm/Student_model.php index 75390b466..0d03fd50f 100644 --- a/application/models/crm/Student_model.php +++ b/application/models/crm/Student_model.php @@ -9,6 +9,40 @@ class Student_model extends DB_Model { parent::__construct(); $this->dbTable = 'public.tbl_student'; - $this->pk = 'student_uid'; + $this->pk = array('student_uid'); + $this->hasSequence = false; + } + + // **** +// * Generiert die Matrikelnummer +// * FORMAT: 0710254001 +// * 07 = Jahr +// * 1/2/0 = WS/SS/incoming +// * 0254 = Studiengangskennzahl vierstellig +// * 001 = Laufende Nummer +// **** + public function generateMatrikelnummer($studiengang_kz, $studiensemester_kurzbz) + { + $jahr = mb_substr($studiensemester_kurzbz, 4); + $sem = mb_substr($studiensemester_kurzbz, 0, 2); + if ($sem == 'SS') + $jahr = $jahr - 1; + $art = 0; + + $matrikelnummer = sprintf("%02d", $jahr).$art.sprintf("%04d", $studiengang_kz); + + $qry = "SELECT matrikelnr FROM public.tbl_student WHERE matrikelnr LIKE ? ORDER BY matrikelnr DESC LIMIT 1"; + + $matrikelnrres = $this->execQuery($qry, array($matrikelnummer.'%')); + + if (hasData($matrikelnrres)) + { + $max = mb_substr($matrikelnrres->retval[0]->matrikelnr, 7); + } + else + $max = 0; + + $max += 1; + return $matrikelnummer.sprintf("%03d", $max); } } diff --git a/application/models/education/Studentlehrverband_model.php b/application/models/education/Studentlehrverband_model.php index 3f8a0e14a..765429396 100644 --- a/application/models/education/Studentlehrverband_model.php +++ b/application/models/education/Studentlehrverband_model.php @@ -10,5 +10,6 @@ class Studentlehrverband_model extends DB_Model parent::__construct(); $this->dbTable = 'public.tbl_studentlehrverband'; $this->pk = array('studiensemester_kurzbz', 'student_uid'); + $this->hasSequence = false; } } diff --git a/application/models/organisation/Studiensemester_model.php b/application/models/organisation/Studiensemester_model.php index 300e13805..ff48708dd 100644 --- a/application/models/organisation/Studiensemester_model.php +++ b/application/models/organisation/Studiensemester_model.php @@ -119,4 +119,26 @@ class Studiensemester_model extends DB_Model return $this->execQuery($query, array($studiensemester_kurzbz, $studiengang_kz)); } + + /** + * Gets all Studiensemester between two dates + * @param $from + * @param $to + * @return array|null + */ + public function getByDate($from, $to) + { + if (date_format(date_create($from), 'Y-m-d') > (date_format(date_create($to), 'Y-m-d'))) + return success(array()); + + $query = "SELECT * + FROM public.tbl_studiensemester + WHERE + (ende > ?::date AND start < ?::date) + OR start = ?::date + OR ende = ?::date + ORDER BY start DESC"; + + return $this->execQuery($query, array($from, $to, $from, $to)); + } } diff --git a/application/models/person/Benutzer_model.php b/application/models/person/Benutzer_model.php index 221688c21..46e5bdb98 100644 --- a/application/models/person/Benutzer_model.php +++ b/application/models/person/Benutzer_model.php @@ -9,7 +9,8 @@ class Benutzer_model extends DB_Model { parent::__construct(); $this->dbTable = 'public.tbl_benutzer'; - $this->pk = 'uid'; + $this->pk = array('uid'); + $this->hasSequence = false; } public function getFromPersonId($person_id) From fe66abbd3dfb12a3166c0cc2ee79436896ba2272 Mon Sep 17 00:00:00 2001 From: Nikolaus Krondraf Date: Mon, 14 Jan 2019 13:58:37 +0100 Subject: [PATCH 08/18] add person.matr_nr to output --- rdf/lehrveranstaltungszeugnis_ktu.rdf.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rdf/lehrveranstaltungszeugnis_ktu.rdf.php b/rdf/lehrveranstaltungszeugnis_ktu.rdf.php index 23f379984..e065925e7 100644 --- a/rdf/lehrveranstaltungszeugnis_ktu.rdf.php +++ b/rdf/lehrveranstaltungszeugnis_ktu.rdf.php @@ -234,7 +234,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml") $pruefer_name = trim($pruefer->titelpre.' '.$pruefer->vorname.' '.$pruefer->nachname.' '.$pruefer->titelpost); } - $query = "SELECT tbl_student.matrikelnr, tbl_student.studiengang_kz, tbl_studiengang.typ, tbl_studiengang.bezeichnung, tbl_person.vorname, tbl_person.nachname,tbl_person.gebdatum,tbl_person.titelpre, tbl_person.titelpost, tbl_person.geschlecht FROM tbl_person, tbl_student, tbl_studiengang, tbl_benutzer WHERE tbl_student.studiengang_kz = tbl_studiengang.studiengang_kz and tbl_student.student_uid = tbl_benutzer.uid and tbl_benutzer.person_id = tbl_person.person_id and tbl_student.student_uid = '".$uid_arr[$i]."'"; + $query = "SELECT tbl_student.matrikelnr, tbl_student.studiengang_kz, tbl_studiengang.typ, tbl_studiengang.bezeichnung, tbl_person.vorname, tbl_person.nachname,tbl_person.gebdatum,tbl_person.titelpre, tbl_person.titelpost, tbl_person.geschlecht, tbl_person.matr_nr FROM tbl_person, tbl_student, tbl_studiengang, tbl_benutzer WHERE tbl_student.studiengang_kz = tbl_studiengang.studiengang_kz and tbl_student.student_uid = tbl_benutzer.uid and tbl_benutzer.person_id = tbl_person.person_id and tbl_student.student_uid = '".$uid_arr[$i]."'"; if($db->db_query($query)) { @@ -275,6 +275,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml") $xml .= "\n ".$gebdatum.""; $xml .= "\n ".$row->geschlecht.""; $xml .= "\n ".$row->matrikelnr.""; + $xml .= "\n ".$row->matr_nr.""; $xml .= "\n ".$stgl.""; $datum_aktuell = date('d.m.Y'); $xml .= "\n Wien, am ".$datum_aktuell.""; From 925a6d40ecd91f2f8da02a45af43ad97d1769116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Mon, 14 Jan 2019 14:09:42 +0100 Subject: [PATCH 09/18] =?UTF-8?q?Neue=20Studienpl=C3=A4ne=20werden=20autom?= =?UTF-8?q?atisch=20zu=20Reihungstests=20hinzugef=C3=BCgt=20zu=20denen=20d?= =?UTF-8?q?er=20alte=20Studienplan=20zugeteilt=20war=20sofern=20die=20G?= =?UTF-8?q?=C3=BCltigkeit=20passt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/jobs/Prestudentstatus.php | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/application/controllers/jobs/Prestudentstatus.php b/application/controllers/jobs/Prestudentstatus.php index 7d2b01b38..3f8a0e903 100644 --- a/application/controllers/jobs/Prestudentstatus.php +++ b/application/controllers/jobs/Prestudentstatus.php @@ -114,6 +114,11 @@ class Prestudentstatus extends FHC_Controller $row_status->person_id, $row_status->studienplan_id, $studienplan->retval[0]->studienplan_id); + + $this->correctReihungstestStudienplan( + $row_status->studiensemester_kurzbz, + $row_status->studienplan_id, + $studienplan->retval[0]->studienplan_id); } } } @@ -188,4 +193,49 @@ class Prestudentstatus extends FHC_Controller } } } + + /** + * When a degree Programm gets a new Studyplan the Placementtests are updated and the + * new studyplan is added + * @param $studiensemester Studiensemester_kurzbz. + * @param $studienplan_id_old Id of the old studyplan + * @param $studienplan_id id of the new studyplan + */ + private function correctReihungstestStudienplan($studiensemester, $studienplan_id_old, $studienplan_id) + { + $this->load->model('crm/RtStudienplan_model', 'RtStudienplanModel'); + + $this->RtStudienplanModel->resetQuery(); + // Correct also Assignments to Placement test + $this->RtStudienplanModel->addJoin( + 'public.tbl_reihungstest', + 'tbl_reihungstest.reihungstest_id = tbl_rt_studienplan.reihungstest_id' + ); + + $rt = $this->RtStudienplanModel->loadWhere(array( + "studienplan_id" => $studienplan_id_old, + "tbl_reihungstest.studiensemester_kurzbz" => $studiensemester + )); + + if(hasData($rt)) + { + foreach($rt->retval as $row_rt) + { + // Add new Studyplan to RtStudienplan if missing + $rt_studienplan = $this->RtStudienplanModel->loadWhere(array( + "reihungstest_id" => $row_rt->reihungstest_id, + "studienplan_id" => $studienplan_id + )); + + if(!hasData($rt_studienplan)) + { + echo "Adding StudienplanId: $studienplan_id to ReihungstestId: $row_rt->reihungstest_id"; + $this->RtStudienplanModel->insert(array( + "reihungstest_id" => $row_rt->reihungstest_id, + "studienplan_id" => $studienplan_id + )); + } + } + } + } } From 7cfff391eb9d7ced49491f2228b7cf92431b1aee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Mon, 14 Jan 2019 14:20:52 +0100 Subject: [PATCH 10/18] Cleanup deprecated Escaping function --- cis/private/info/telefonverzeichnis.php | 89 +++----- .../lehre/abgabe_lektor_terminuebersicht.php | 17 +- .../lehre/anwesenheitsliste_bilder.html.php | 206 ------------------ cis/private/profile/lva_liste.php | 16 +- cis/private/profile/urlaubsfreigabe.php | 2 +- cis/private/profile/urlaubstool.php | 10 +- cis/private/tools/projektabgabe.php | 32 ++- .../tools/projektabgabe_autocomplete.php | 56 +++-- vilesci/personen/zeitwunsch.php | 5 +- 9 files changed, 106 insertions(+), 327 deletions(-) delete mode 100644 cis/private/lehre/anwesenheitsliste_bilder.html.php diff --git a/cis/private/info/telefonverzeichnis.php b/cis/private/info/telefonverzeichnis.php index 8e90a8179..fe276b85b 100644 --- a/cis/private/info/telefonverzeichnis.php +++ b/cis/private/info/telefonverzeichnis.php @@ -28,20 +28,20 @@ require_once('../../../include/functions.inc.php'); require_once('../../../include/basis_db.class.php'); require_once('../../../include/phrasen.class.php'); require_once('../../../include/person.class.php'); - -$sprache = getSprache(); + +$sprache = getSprache(); $p=new phrasen($sprache); if (isset($_GET['zeilenhoehe']) && is_numeric($_GET['zeilenhoehe'])) $zeilenhoehe = $_GET['zeilenhoehe']; else $zeilenhoehe = 28; - + if (isset($_GET['gruppiert']) && ($_GET['gruppiert']=='on')) $gruppiert = true; else $gruppiert = false; - + if (isset($_GET['gst_extra']) && ($_GET['gst_extra']=='on')) $gst_extra = true; else @@ -56,14 +56,12 @@ if (!$user=get_uid()) if(check_lektor($user)) $is_lector=true; else - $is_lector=false; + $is_lector=false; -?> - +?> - + @@ -79,13 +77,13 @@ if(check_lektor($user)) { window.location.reload(); } - $(document).ready(function() - { + $(document).ready(function() + { $("#t1").tablesorter( { sortList: [[0,0]], widgets: ["zebra"] - }); + }); $("#t2").tablesorter( { sortList: [[0,0]], @@ -120,12 +118,12 @@ if(check_lektor($user)) { sortList: [[0,0]], widgets: ["zebra"] - }); + }); $("#t11").tablesorter( { sortList: [[0,0]], widgets: ["zebra"] - }); + }); }); --> @@ -134,11 +132,11 @@ td,th { font-size: 18px; } -@media print +@media print { #nachname,#vorname,#durchwahl,#raum,#person { - background-image: none; + background-image: none; padding-left: 3px; } #formular @@ -156,7 +154,7 @@ td,th Zeilenhöhe: px   Geschäftsstelle extra:>    Gruppiert nach Standort:>    - + @@ -169,19 +167,19 @@ td,th db_query($sql_query); $laststandort='0'; $i=1; - + if ($gruppiert == false) { echo ' @@ -189,7 +187,7 @@ td,th

'.$p->t("telefonverzeichnis/titelTelefonverzeichnis").' '.CAMPUS_NAME.'

- + @@ -199,10 +197,10 @@ td,th '; - + while($row = $db->db_fetch_object($result)) { - echo ' + echo ' @@ -227,7 +225,7 @@ td,th '; $i++; } - else + else { while($row = $db->db_fetch_object($result)) { @@ -244,7 +242,7 @@ td,th } $laststandort = $row->standort_id; $qry_standort = "SELECT tbl_kontakt.kontakt as nummer, tbl_firma.name as name FROM public.tbl_standort JOIN public.tbl_firma USING(firma_id) JOIN public.tbl_kontakt USING(standort_id) - WHERE standort_id='".addslashes($row->standort_id)."' AND kontakttyp='telefon'"; + WHERE standort_id=".$db->db_add_param($row->standort_id)." AND kontakttyp='telefon'"; if($result_standort = $db->db_query($qry_standort)) { if($row_standort = $db->db_fetch_object($result_standort)) @@ -267,18 +265,8 @@ td,th } } } - echo ' + echo ' - @@ -292,20 +280,20 @@ td,th
'.$p->t("lvplan/raum").'
'.$row->nachname.' '.$row->vorname.' '.$row->telefonklappe.'
'; - + if ($gst_extra==true || $gruppiert == true) { - $sql_query = " SELECT vw_mitarbeiter.person_id, vw_mitarbeiter.vorname, vw_mitarbeiter.nachname, vw_mitarbeiter.telefonklappe, vw_mitarbeiter.ort_kurzbz, vw_mitarbeiter.standort_id, tbl_person.foto_sperre + $sql_query = " SELECT vw_mitarbeiter.person_id, vw_mitarbeiter.vorname, vw_mitarbeiter.nachname, vw_mitarbeiter.telefonklappe, vw_mitarbeiter.ort_kurzbz, vw_mitarbeiter.standort_id, tbl_person.foto_sperre FROM campus.vw_mitarbeiter JOIN public.tbl_person USING (person_id) WHERE telefonklappe!='' AND standort_id is not null AND vw_mitarbeiter.aktiv=true AND vw_mitarbeiter.standort_id='4' ORDER BY standort_id, nachname, vorname"; $result = $db->db_query($sql_query); $laststandort='0'; - + echo '

'.$p->t("telefonverzeichnis/titelTelefonverzeichnis").' Geschäftsstelle: +43 1 588 39

- + @@ -315,10 +303,10 @@ td,th '; - + while($row = $db->db_fetch_object($result)) { - echo ' + echo ' @@ -389,18 +377,13 @@ td,th '; } - + if($laststandort!='') { echo '
'.$p->t("lvplan/raum").'
'; } } ?> - - - - - - \ No newline at end of file + diff --git a/cis/private/lehre/abgabe_lektor_terminuebersicht.php b/cis/private/lehre/abgabe_lektor_terminuebersicht.php index c6bd7b946..0cc558e4a 100644 --- a/cis/private/lehre/abgabe_lektor_terminuebersicht.php +++ b/cis/private/lehre/abgabe_lektor_terminuebersicht.php @@ -33,20 +33,19 @@ $datum_obj = new datum(); $sprache = getSprache(); $p = new phrasen($sprache); -echo ' - +echo ' Terminübersicht - + - - - - - + + + + + @@ -101,7 +100,7 @@ $sql_query = " JOIN public.tbl_studiengang ON(tbl_lehrveranstaltung.studiengang_kz=tbl_studiengang.studiengang_kz) JOIN campus.tbl_paabgabetyp USING(paabgabetyp_kurzbz) WHERE - tbl_projektbetreuer.person_id='".addslashes($lektor->person_id)."' AND tbl_paabgabe.datum>=now() AND bn_student.aktiv + tbl_projektbetreuer.person_id=".$db->db_add_param($lektor->person_id)." AND tbl_paabgabe.datum>=now() AND bn_student.aktiv ORDER BY tbl_paabgabe.datum "; diff --git a/cis/private/lehre/anwesenheitsliste_bilder.html.php b/cis/private/lehre/anwesenheitsliste_bilder.html.php deleted file mode 100644 index d138f9704..000000000 --- a/cis/private/lehre/anwesenheitsliste_bilder.html.php +++ /dev/null @@ -1,206 +0,0 @@ -, - * Andreas Oesterreicher and - * Rudolf Hangl . - */ - /** - * - * Erstellt eine Anwesenheitsliste mit Bildern im HTML Format - * - */ - - require_once('../../../config/cis.config.inc.php'); -// ------------------------------------------------------------------------------------------ -// Datenbankanbindung -// ------------------------------------------------------------------------------------------ - require_once('../../../include/basis_db.class.php'); - if (!$db = new basis_db()) - die('Fehler beim Herstellen der Datenbankverbindung'); - - require_once('../../../include/person.class.php'); - require_once('../../../include/studiengang.class.php'); - require_once('../../../include/studiensemester.class.php'); - require_once('../../../include/lehrveranstaltung.class.php'); - error_reporting(E_ALL); - ini_set('display_errors','1'); - - //Uebergabeparameter abpruefen - if(isset($_GET['stg'])) //Studiengang - { - if(is_numeric($_GET['stg'])) - $stg=$_GET['stg']; - else - die('Fehler bei der Parameteruebergabe'); - } - else - $stg=''; - if(isset($_GET['sem'])) //Semester - { - if(is_numeric($_GET['sem'])) - $sem=$_GET['sem']; - else - die('Fehler bei der Parameteruebergabe'); - } - else - $sem=''; - - if(isset($_GET['verband'])) //Verband - $verband=$_GET['verband']; - else - $verband=''; - if(isset($_GET['gruppe'])) //Gruppe - $gruppe=$_GET['gruppe']; - else - $gruppe=''; - if(isset($_GET['gruppe_kurzbz'])) //Einheit - $gruppe_kurzbz = $_GET['gruppe_kurzbz']; - else - $gruppe_kurzbz=''; - - if(isset($_GET['lvid']) && is_numeric($_GET['lvid'])) - $lvid = $_GET['lvid']; - else - die('Fehler bei der Parameteruebergabe'); - - if(isset($_GET['stsem'])) - $stsem = $_GET['stsem']; - else - die('Studiensemester wurde nicht uebergeben'); - - $lehreinheit_id = (isset($_GET['lehreinheit_id'])?$_GET['lehreinheit_id']:''); - - echo ' - - - - - - -'; - -$stgobj=new studiengang(); -$stgobj->load($stg); -//Logo -echo " - - - - -
"; -$lvobj = new lehrveranstaltung($lvid); - -echo 'Anwesenheitsliste '.$lvobj->bezeichnung.''; - -$qry = "SELECT distinct on(kuerzel, semester, verband, gruppe, gruppe_kurzbz) UPPER(stg_typ::varchar(1) || stg_kurzbz) as kuerzel, semester, verband, gruppe, gruppe_kurzbz from campus.vw_lehreinheit WHERE lehrveranstaltung_id='".addslashes($lvid)."' AND studiensemester_kurzbz='".addslashes($stsem)."'"; -if($lehreinheit_id!='') - $qry.=" AND lehreinheit_id='".addslashes($lehreinheit_id)."'"; - -$gruppen=''; -if($result = $db->db_query($qry)) -{ - while($row = $db->db_fetch_object($result)) - { - if($gruppen!='') - $gruppen.=', '; - if($row->gruppe_kurzbz=='') - $gruppen.=trim($row->kuerzel.'-'.$row->semester.$row->verband.$row->gruppe); - else - $gruppen.=$row->gruppe_kurzbz; - } -} - -echo "
Gruppe: $gruppen"; -echo "
Studiensemester: $stsem"; - -echo " -
"; - - -//Studenten holen - -echo '

- - - - - '; - -$stsem_obj = new studiensemester(); -$stsem_obj->load($stsem); -$stsemdatumvon = $stsem_obj->start; -$stsemdatumbis = $stsem_obj->ende; -$qry = "SELECT - distinct on(nachname, vorname, person_id) vorname, nachname, matrikelnr, person_id, - tbl_studentlehrverband.semester, tbl_studentlehrverband.verband, tbl_studentlehrverband.gruppe, - (SELECT status_kurzbz FROM public.tbl_prestudentstatus WHERE prestudent_id=tbl_student.prestudent_id ORDER BY datum DESC, insertamum DESC, ext_id DESC LIMIT 1) as status, - tbl_bisio.bisio_id, tbl_bisio.bis, tbl_bisio.von, - tbl_zeugnisnote.note - FROM - campus.vw_student_lehrveranstaltung JOIN public.tbl_benutzer USING(uid) - JOIN public.tbl_person USING(person_id) JOIN public.tbl_student ON(uid=student_uid) - LEFT JOIN public.tbl_studentlehrverband USING(student_uid,studiensemester_kurzbz) - LEFT JOIN lehre.tbl_zeugnisnote on(vw_student_lehrveranstaltung.lehrveranstaltung_id=tbl_zeugnisnote.lehrveranstaltung_id AND tbl_zeugnisnote.student_uid=tbl_student.student_uid AND tbl_zeugnisnote.studiensemester_kurzbz=tbl_studentlehrverband.studiensemester_kurzbz) - LEFT JOIN bis.tbl_bisio ON(uid=tbl_bisio.student_uid) - WHERE - vw_student_lehrveranstaltung.lehrveranstaltung_id='".addslashes($lvid)."' AND - vw_student_lehrveranstaltung.studiensemester_kurzbz='".addslashes($stsem)."'"; - -if($lehreinheit_id!='') - $qry.=" AND vw_student_lehrveranstaltung.lehreinheit_id='".addslashes($lehreinheit_id)."'"; - -$qry.=' ORDER BY nachname, vorname, person_id, tbl_bisio.bis DESC'; - -if($result = $db->db_query($qry)) -{ - $i=0; - while($elem = $db->db_fetch_object($result)) - { - $i++; - echo ''; - //Abbrecher und Unterbrecher nicht anzeigen - if($elem->status!='Abbrecher' && $elem->status!='Unterbrecher') - { - if($elem->status=='Incoming') - $inc=' (i)'; - else - $inc=''; - - if($elem->bisio_id!='' && $elem->status!='Incoming' && ($elem->bis > $stsemdatumvon || $elem->bis=='') && $elem->von < $stsemdatumbis) //Outgoing - $inc.=' (o)'; - - if($elem->note==6) //angerechnet - $inc.=' (ar)'; - - echo ""; - echo ""; - echo ''; - echo ""; - } - echo ''; - } -} -echo '
Hörer/NameKennzeichenGruppeFoto
$elem->nachname $elem->vorname".trim($elem->matrikelnr)."'.$elem->semester.$elem->verband.$elem->gruppe.'


-(i) ... Incoming
-(o) ... Outgoing
-(ar) ... angerechnet

-Fachhochschulstudiengang ('.strtoupper($stgobj->typ).') '.$stgobj->bezeichnung; - -echo ''; -echo ''; -?> \ No newline at end of file diff --git a/cis/private/profile/lva_liste.php b/cis/private/profile/lva_liste.php index 538d1cb8f..7b394c9d6 100644 --- a/cis/private/profile/lva_liste.php +++ b/cis/private/profile/lva_liste.php @@ -112,19 +112,19 @@ require_once('../../../include/benutzerberechtigung.class.php'); $result=$db->db_query($sql_query); $num_rows=$db->db_num_rows($result); - echo ' + echo ' - + '.$p->t('lvaliste/titel').' - - - - - + + + + +

InteressentIn anlegen

@@ -428,7 +353,7 @@ function setStudienplanData() $rechte = new benutzerberechtigung(); $rechte->getBerechtigungen($user); -if(!$rechte->isBerechtigt('admin') && !$rechte->isBerechtigt('assistenz')) +if (!$rechte->isBerechtigt('admin') && !$rechte->isBerechtigt('assistenz')) die('Sie haben keine Berechtigung fuer diese Seite'); $where = ''; @@ -451,7 +376,7 @@ $plz = (isset($_REQUEST['plz'])?$_REQUEST['plz']:''); //und muessen zuerst nach UTF8 konvertiert werden function utf8($string) { - if(!check_utf8($string)) + if (!check_utf8($string)) return utf8_encode($string); else return $string; @@ -469,7 +394,7 @@ $adresse = utf8($adresse); $adresse_nation = utf8($adresse_nation); $plz = utf8($plz); -if($adresse_nation=='A') +if ($adresse_nation=='A') { $ort = (isset($_REQUEST['ort'])?$_REQUEST['ort']:''); $gemeinde = (isset($_REQUEST['gemeinde'])?$_REQUEST['gemeinde']:''); @@ -484,11 +409,11 @@ $gemeinde = utf8($gemeinde); $ort = utf8($ort); //wenn die Gemeinde leer ist und im Ort etwas steht //dann umdrehen (Das passiert wenn die Daten aus dem Mail von der www importiert werden) -if($gemeinde=='' && $ort!='') +if ($gemeinde == '' && $ort != '') { - $importort=$ort; - $gemeinde=$ort; - $ort=''; + $importort = $ort; + $gemeinde = $ort; + $ort = ''; } $email = (isset($_REQUEST['email'])?$_REQUEST['email']:''); $telefon = (isset($_REQUEST['telefon'])?$_REQUEST['telefon']:''); @@ -497,10 +422,10 @@ $letzteausbildung = (isset($_REQUEST['letzteausbildung'])?$_REQUEST['letzteausbi $ausbildungsart = (isset($_REQUEST['ausbildungsart'])?$_REQUEST['ausbildungsart']:''); $anmerkungen = (isset($_REQUEST['anmerkungen'])?$_REQUEST['anmerkungen']:''); $studiengang_kz = (isset($_REQUEST['studiengang_kz'])?$_REQUEST['studiengang_kz']:''); -if($studiengang_kz=='' && isset($_GET['studiengang_kz'])) +if ($studiengang_kz == '' && isset($_GET['studiengang_kz'])) $studiengang_kz = $_GET['studiengang_kz']; -if($studiengang_kz=='undefined') - $studiengang_kz=''; +if ($studiengang_kz == 'undefined') + $studiengang_kz = ''; $person_id = (isset($_REQUEST['person_id'])?$_REQUEST['person_id']:''); $ueberschreiben = (isset($_REQUEST['ueberschreiben'])?$_REQUEST['ueberschreiben']:''); @@ -510,7 +435,7 @@ $incoming = (isset($_REQUEST['incoming'])?true:false); $orgform_kurzbz = (isset($_REQUEST['orgform_kurzbz'])?$_REQUEST['orgform_kurzbz']:''); $studienplan_id = (isset($_REQUEST['studienplan_id'])?$_REQUEST['studienplan_id']:''); //end Parameter -$geburtsdatum_error=false; +$geburtsdatum_error = false; $ausbildungsart = utf8($ausbildungsart); $anmerkungen = utf8($anmerkungen); @@ -529,17 +454,17 @@ function generateMatrikelnummer($studiengang_kz, $studiensemester_kurzbz) $jahr = mb_substr($studiensemester_kurzbz, 4); $sem = mb_substr($studiensemester_kurzbz, 0, 2); - if($sem=='SS') + if ($sem == 'SS') $jahr = $jahr-1; - $art =0; + $art = 0; $matrikelnummer = sprintf("%02d",$jahr).$art.sprintf("%04d",$studiengang_kz); $qry = "SELECT matrikelnr FROM public.tbl_student WHERE matrikelnr LIKE '$matrikelnummer%' ORDER BY matrikelnr DESC LIMIT 1"; - if($db->db_query($qry)) + if ($db->db_query($qry)) { - if($row = $db->db_fetch_object()) + if ($row = $db->db_fetch_object()) { $max = mb_substr($row->matrikelnr,7); } @@ -556,11 +481,11 @@ function generateMatrikelnummer($studiengang_kz, $studiensemester_kurzbz) } -if($studiensemester_kurzbz == '') +if ($studiensemester_kurzbz == '') { //Im September wird das Aktuelle Studiensemester vorgeschlagen sonst immer das naechste WS /*$stsem = new studiensemester(); - if(date('m')=='9') + if (date('m')=='9') $studiensemester_kurzbz = $stsem->getaktorNext(); else { @@ -569,13 +494,13 @@ if($studiensemester_kurzbz == '') }*/ $stsem = new studiensemester(); - if(defined('VILESCI_PERSON_NEU_STUDIENSEMESTER_UEBERGANGSFRIST') && VILESCI_PERSON_NEU_STUDIENSEMESTER_UEBERGANGSFRIST>0) + if (defined('VILESCI_PERSON_NEU_STUDIENSEMESTER_UEBERGANGSFRIST') && VILESCI_PERSON_NEU_STUDIENSEMESTER_UEBERGANGSFRIST>0) { $studiensemester_kurzbz = $stsem->getNextOrAktSemester(VILESCI_PERSON_NEU_STUDIENSEMESTER_UEBERGANGSFRIST); - if(defined('VILESCI_PERSON_NEU_STUDIENSEMESTER_WINTERONLY') + if (defined('VILESCI_PERSON_NEU_STUDIENSEMESTER_WINTERONLY') && VILESCI_PERSON_NEU_STUDIENSEMESTER_WINTERONLY - && mb_substr($studiensemester_kurzbz,0,2)=='SS') + && mb_substr($studiensemester_kurzbz,0,2) == 'SS') { $studiensemester_kurzbz = $stsem->getNextFrom($studiensemester_kurzbz); } @@ -588,25 +513,19 @@ if($studiensemester_kurzbz == '') } // *** Speichern der Daten *** -if(isset($_POST['save'])) +if (isset($_POST['save'])) { - //echo "Saving Data: Geburtsdatum: $geburtsdatum | Titel: $titel | Nachname: $nachname | Vorname: $vorname | - // Geschlecht: $geschlecht | Adresse: $adresse | Plz: $plz | Ort: $ort | - // Email: $email | Telefon: $telefon | Mobil: $mobil | Letzteausbildung: $letzteausbildung | ausbildungsart: $ausbildungsart | - // anmerkungen: $anmerkungen | studiengang_kz: $studiengang_kz | person_id: $person_id

"; $person = new person(); $prestudent = new prestudent(); - $prestudent_vorhanden=false; - $db->db_query('BEGIN'); //Wenn die person_id=0 dann wird eine neue Person angelegt //Ansosnsten wird es an die Person mit $person_id angehaengt - if($person_id!='0') + if ($person_id != '0') { - if(!$person->load($person_id)) + if (!$person->load($person_id)) { - $error=true; + $error = true; $errormsg = 'Person konnte nicht geladen werden'; } else @@ -619,53 +538,6 @@ if(isset($_POST['save'])) $titelpost = $person->titelpost; $geschlecht = $person->geschlecht; $anrede = $person->anrede; - //Wenn Prestudent bereits existiert, dann abbrechen - if($prestudent->exists($person_id, $studiengang_kz)) - { - //Prestudent ID holen - $qry = "SELECT prestudent_id FROM public.tbl_prestudent WHERE person_id='$person_id' AND studiengang_kz='$studiengang_kz'"; - if($result = $db->db_query($qry)) - { - if($db->db_num_rows($result)>1) - { - // Wenn bereits mehrere Prestudenten in diesem Studingang vorhanden sind, dann abbrechen - $error=true; - $errormsg = 'Der Interessent konnte nicht angelegt werden, da dieser Student bereits mehr als einen Prestudenten in diesem Studiengang hat.'; - } - else - { - $row = $db->db_fetch_object($result); - $prestudent_id=$row->prestudent_id; - - //Wenn der Prestudent noch keinen Studenten eintrag hat, dann wird die neue - //Rolle hinzugefuegt, sonst wird abgebrochen - $qry = "SELECT * FROM public.tbl_prestudentstatus WHERE prestudent_id='$prestudent_id' AND status_kurzbz='Student'"; - if($result = $db->db_query($qry)) - { - if($db->db_num_rows($result)>0) - { - $error=true; - $errormsg = 'Der Interessent konnte nicht angelegt werden, da diese Person bereits als Student in diesem Studiengang angelegt ist.'; - } - else - { - $prestudent_vorhanden=true; - $prestudent->load($prestudent_id); - } - } - else - { - $error=true; - $errormsg = 'Fehler beim Ermitteln der Prestudentrollen!'; - } - } - } - else - { - $error = true; - $errormsg = 'Fehler beim Suchen der PrestudentID'; - } - } } } else @@ -684,27 +556,27 @@ if(isset($_POST['save'])) $person->aktiv = true; $person->insertamum = date('Y-m-d H:i:s'); $person->insertvon = $user; - $person->zugangscode= uniqid(); - if($person->save()) + $person->zugangscode= uniqid(); + if ($person->save()) { - $error=false; + $error = false; } else { - $error=true; + $error = true; $errormsg = "Person konnte nicht gespeichert werden: $person->errormsg"; } } //Adresse anlegen - if($ueberschreiben!='' && !($plz=='' && $adresse=='' && $ort=='')) + if ($ueberschreiben != '' && !($plz == '' && $adresse == '' && $ort == '')) { - if($person_id=='0') - $ueberschreiben='Nein'; + if ($person_id == '0') + $ueberschreiben = 'Nein'; $adr = new adresse(); //Adresse neu anlegen - if($ueberschreiben=='Nein') + if ($ueberschreiben == 'Nein') { $adr->new = true; $adr->insertamum = date('Y-m-d H:i:s'); @@ -712,7 +584,7 @@ if(isset($_POST['save'])) $adr->nation = $adresse_nation; //Wenn die Person neu angelegt wird, dann ist die neue Adresse die Heimatadresse //sonst nicht - if($person_id=='0') + if ($person_id == '0') $adr->heimatadresse = true; else $adr->heimatadresse = false; @@ -721,12 +593,12 @@ if(isset($_POST['save'])) { //Bestehende Adresse Ueberschreiben - //Adressen der Peron laden + //Adressen der Person laden $adr->load_pers($person->person_id); - if(isset($adr->result[0])) + if (isset($adr->result[0])) { //Erste Adresse laden - if($adr->load($adr->result[0]->adresse_id)) + if ($adr->load($adr->result[0]->adresse_id)) { $adr->new = false; $adr->updateamum = date('Y-m-d H:i:s'); @@ -749,7 +621,7 @@ if(isset($_POST['save'])) } } - if(!$error) + if (!$error) { //Adressdaten zuweisen und speichern $adr->person_id = $person->person_id; @@ -759,7 +631,7 @@ if(isset($_POST['save'])) $adr->gemeinde = $gemeinde; $adr->typ = 'h'; $adr->zustelladresse = true; - if(!$adr->save()) + if (!$adr->save()) { $error = true; $errormsg = $adr->errormsg; @@ -768,10 +640,10 @@ if(isset($_POST['save'])) } //Kontaktdaten anlegen - if(!$error) + if (!$error) { //EMail Adresse speichern - if($email!='') + if ($email != '') { $kontakt = new kontakt(); $kontakt->person_id = $person->person_id; @@ -782,14 +654,14 @@ if(isset($_POST['save'])) $kontakt->insertvon = $user; $kontakt->new = true; - if(!$kontakt->save()) + if (!$kontakt->save()) { $error = true; $errormsg = 'Fehler beim Speichern der Email Adresse'; } } //Telefonnummer speichern - if($telefon!='') + if ($telefon != '') { $kontakt = new kontakt(); $kontakt->person_id = $person->person_id; @@ -800,14 +672,14 @@ if(isset($_POST['save'])) $kontakt->insertvon = $user; $kontakt->new = true; - if(!$kontakt->save()) + if (!$kontakt->save()) { $error = true; $errormsg = 'Fehler beim Speichern der Telefonnummer'; } } //Mobiltelefonnummer speichern - if($mobil!='') + if ($mobil != '') { $kontakt = new kontakt(); $kontakt->person_id = $person->person_id; @@ -818,7 +690,7 @@ if(isset($_POST['save'])) $kontakt->insertvon = $user; $kontakt->new = true; - if(!$kontakt->save()) + if (!$kontakt->save()) { $error = true; $errormsg = 'Fehler beim Speichern der Mobiltelefonnummer'; @@ -827,24 +699,35 @@ if(isset($_POST['save'])) } //Prestudent Anlegen - if(!$error && !$prestudent_vorhanden) + if (!$error) { $prestudent->new = true; $prestudent->aufmerksamdurch_kurzbz = 'k.A.'; $prestudent->person_id = $person->person_id; $prestudent->studiengang_kz = $studiengang_kz; $prestudent->ausbildungcode = $letzteausbildung; - $prestudent->anmerkung = $anmerkungen .($ausbildungsart!=''?' Ausbildungsart:'.$ausbildungsart:''); + $prestudent->anmerkung = $anmerkungen .($ausbildungsart != ''?' Ausbildungsart:'.$ausbildungsart:''); $prestudent->reihungstestangetreten = false; $prestudent->bismelden = true; //Wenn die Person schon im System erfasst ist, dann die ZGV des Datensatzes uebernehmen - $qry_zgv = "SELECT * FROM public.tbl_prestudent WHERE person_id='$person->person_id' AND zgv_code is not null ORDER BY zgvmas_code, zgv_code DESC LIMIT 1"; - if($result_zgv = $db->db_query($qry_zgv)) + $qry_zgv = " + SELECT + * + FROM + public.tbl_prestudent + WHERE + person_id = ".$db->db_add_param($person->person_id, FHC_INTEGER)." + AND zgv_code is not null + ORDER BY + zgvmas_code, zgv_code DESC + LIMIT 1"; + + if ($result_zgv = $db->db_query($qry_zgv)) { - if($row_zgv = $db->db_fetch_object($result_zgv)) + if ($row_zgv = $db->db_fetch_object($result_zgv)) { - if($row_zgv->zgv_code!='') + if ($row_zgv->zgv_code != '') { $prestudent->zgv_code = $row_zgv->zgv_code; $prestudent->zgvort = $row_zgv->zgvort; @@ -857,20 +740,20 @@ if(isset($_POST['save'])) } } - if(!$prestudent->save()) + if (!$prestudent->save()) { - $error=true; + $error = true; $errormsg = $prestudent->errormsg; } } - if(!$error) + if (!$error) { //Prestudent Rolle Anlegen $rolle = new prestudent(); $rolle->prestudent_id = $prestudent->prestudent_id; - if(!$incoming) + if (!$incoming) $rolle->status_kurzbz = 'Interessent'; else $rolle->status_kurzbz = 'Incoming'; @@ -884,7 +767,7 @@ if(isset($_POST['save'])) $rolle->new = true; - if(!$rolle->save_rolle()) + if (!$rolle->save_rolle()) { $error = true; $errormsg = $rolle->errormsg; @@ -893,7 +776,7 @@ if(isset($_POST['save'])) $error = false; } - if(!$error && $incoming) + if (!$error && $incoming) { //Matrikelnummer und UID generieren $matrikelnr = generateMatrikelnummer($studiengang_kz, $studiensemester_kurzbz); @@ -918,22 +801,22 @@ if(isset($_POST['save'])) $nachname_clean = str_replace(' ','_', $nachname_clean); $vorname_clean = str_replace(' ','_', $vorname_clean); - if(!defined('GENERATE_ALIAS_STUDENT') || GENERATE_ALIAS_STUDENT===true) + if (!defined('GENERATE_ALIAS_STUDENT') || GENERATE_ALIAS_STUDENT === true) { - $qry_alias = "SELECT * FROM public.tbl_benutzer WHERE alias=LOWER('".$vorname_clean.".".$nachname_clean."')"; + $qry_alias = "SELECT * FROM public.tbl_benutzer WHERE alias = LOWER(".$db->db_add_param(".$vorname_clean.".".$nachname_clean.").")"; $result_alias = $db->db_query($qry_alias); - if($db->db_num_rows($result_alias)==0) - $benutzer->alias =$vorname_clean.'.'.$nachname_clean; + if ($db->db_num_rows($result_alias) == 0) + $benutzer->alias = $vorname_clean.'.'.$nachname_clean; else $benutzer->alias = ''; } else - $benutzer->alias=''; + $benutzer->alias = ''; $benutzer->insertamum = date('Y-m-d H:i:s'); $benutzer->insertvon = $user; - if($benutzer->save(true, false)) + if ($benutzer->save(true, false)) { //Studentendatensatz anlegen $student = new student(); @@ -948,7 +831,7 @@ if(isset($_POST['save'])) $student->insertvon = $user; $lvb = new lehrverband(); - if(!$lvb->exists($student->studiengang_kz, $student->semester, $student->verband, $student->gruppe)) + if (!$lvb->exists($student->studiengang_kz, $student->semester, $student->verband, $student->gruppe)) { $lvb->studiengang_kz = $student->studiengang_kz; $lvb->semester = $student->semester; @@ -960,7 +843,7 @@ if(isset($_POST['save'])) $lvb->save(true); } - if($student->save(true, false)) + if ($student->save(true, false)) { //StudentLehrverband anlegen $studentlehrverband = new student(); @@ -973,7 +856,7 @@ if(isset($_POST['save'])) $studentlehrverband->insertamum = date('Y-m-d H:i:s'); $studentlehrverband->insertvon = $user; - if(!$studentlehrverband->save_studentlehrverband(true)) + if (!$studentlehrverband->save_studentlehrverband(true)) { $error = true; $errormsg = 'StudentLehrverband konnte nicht angelegt werden'; @@ -992,7 +875,7 @@ if(isset($_POST['save'])) } } - if(!$error) + if (!$error) { $db->db_query('COMMIT'); die("".($incoming?'Incoming':'InteressentIn')." $vorname $vornamen $nachname wurde erfolgreich angelegt

Neue Person anlegen"); @@ -1006,30 +889,30 @@ if(isset($_POST['save'])) // *** SAVE ENDE *** $geburtsdatum_orig = $geburtsdatum; -if($geburtsdatum!='') +if ($geburtsdatum != '') { //Wenn das Datum im Format d.m.Y ist dann in Y-m-d umwandeln - if(mb_strpos($geburtsdatum,'.')) + if (mb_strpos($geburtsdatum,'.')) { - if($datum_obj->mktime_datum($geburtsdatum)) + if ($datum_obj->mktime_datum($geburtsdatum)) { $geburtsdatum = date('Y-m-d',$datum_obj->mktime_datum($geburtsdatum)); } else { - $geburtsdatum_error=true; + $geburtsdatum_error = true; } } else { - if(!mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})",$geburtsdatum)) - $geburtsdatum_error=true; + if (!mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})", $geburtsdatum)) + $geburtsdatum_error = true; } - if($geburtsdatum_error) + if ($geburtsdatum_error) echo "Format des Geburtsdatums ist ungueltig!"; } -if(($geburtsdatum=='' && $vorname=='' && $nachname=='') || $geburtsdatum_error) +if (($geburtsdatum == '' && $vorname == '' && $nachname == '') || $geburtsdatum_error) echo "
"; else echo ""; @@ -1056,19 +939,19 @@ echo ''; echo 'Geburtsdatum (Format: dd.mm.JJJJ)'; echo '
Adresse'; -if(isset($adresse_nation) && $adresse_nation=='A' && isset($plz) && $plz>10000) - $nationstyle='style="border: 1px solid red"'; +if (isset($adresse_nation) && $adresse_nation == 'A' && isset($plz) && $plz > 10000) + $nationstyle = 'style="border: 1px solid red"'; else - $nationstyle=''; + $nationstyle = ''; echo ''; @@ -1077,7 +960,7 @@ echo ''; echo ''; echo ''; echo "\n"; echo ' echo ''; echo ''; else { @@ -1186,32 +1069,32 @@ Felder die mit einem * gekennzeichnet sind müssen ausgefüllt werden! db_add_param($geburtsdatum); } } -if($vorname!='' && $nachname!='') +if ($vorname != '' && $nachname != '') { - if($where!='') - $where.=' OR'; - $where.=" (LOWER(vorname)=LOWER(".$db->db_add_param($vorname).") AND LOWER(nachname)=LOWER(".$db->db_add_param($nachname)."))"; + if ($where != '') + $where .= ' OR'; + $where .= " (LOWER(vorname)=LOWER(".$db->db_add_param($vorname).") AND LOWER(nachname)=LOWER(".$db->db_add_param($nachname)."))"; } -elseif($nachname!='') +elseif ($nachname != '') { - if($where!='') - $where.=' OR'; - $where.=" LOWER(nachname)=LOWER(".$db->db_add_param($nachname).")"; + if ($where != '') + $where .= ' OR'; + $where .= " LOWER(nachname)=LOWER(".$db->db_add_param($nachname).")"; } -if($where!='') +if ($where != '') { $qry = "SELECT * FROM public.tbl_person WHERE $where ORDER BY nachname, vorname, gebdatum"; - if($result = $db->db_query($qry)) + if ($result = $db->db_query($qry)) { echo '
Nation
AdresseGemeinde
'; //wenn die Nation Oesterreich ist, dann wird ein DropDown fuer Gemeinde und Ort angezeigt. //wenn die Nation nicht Oesterreich ist, werden nur textfelder angezeigt -if($adresse_nation=='A' && $plz!='') +if ($adresse_nation == 'A' && $plz != '') { echo getGemeindeDropDown($plz); } @@ -1088,14 +971,14 @@ else //wenn der Ort per EMail-Import von der www kommt und der Ort in der Gemeindetabelle //nicht gefunden wird, dann wird der Ort in Klammer neben dem DropDown angezeigt -if($importort!='' && $gemeinde!=$importort) +if ($importort != '' && $gemeinde != $importort) echo ' ( '.$importort.' )'; echo '
'; echo '
Ort
'; -if($adresse_nation=='A' && $plz!='') +if ($adresse_nation == 'A' && $plz != '') { echo getOrtDropDown($plz, $gemeinde); } @@ -1112,7 +995,7 @@ echo '
Mobil'; echo ''; $qry = "SELECT * FROM bis.tbl_ausbildung ORDER BY ausbildungcode"; -if($result = $db->db_query($qry)) +if ($result = $db->db_query($qry)) { while($row = $db->db_fetch_object($result)) { @@ -1128,7 +1011,7 @@ $stg_obj = new studiengang(); $stg_obj->getAll('typ, kurzbz'); foreach ($stg_obj->result as $row) { - if($rechte->isBerechtigt('admin', $row->studiengang_kz, 'suid') || $rechte->isBerechtigt('assistenz', $row->studiengang_kz, 'suid')) + if ($rechte->isBerechtigt('admin', $row->studiengang_kz, 'suid') || $rechte->isBerechtigt('assistenz', $row->studiengang_kz, 'suid')) echo ''; } echo ''; @@ -1148,7 +1031,7 @@ echo '
OrgForm'; echo '
Studienplan
'; -if($studiengang_kz!='') +if ($studiengang_kz!='') echo getStudienplanDropDown($studiengang_kz, $orgform_kurzbz, $studienplan_id, $studiensemester_kurzbz, $ausbildungssemester); else echo 'Bitte zuerst einen Studiengang waehlen'; @@ -1169,7 +1052,7 @@ echo '
Incoming:
'; -if(($geburtsdatum=='' && $vorname=='' && $nachname=='') || $geburtsdatum_error) +if (($geburtsdatum=='' && $vorname=='' && $nachname=='') || $geburtsdatum_error) echo '
'; echo ''; @@ -1223,19 +1106,19 @@ if($where!='') SELECT (get_rolle_prestudent(prestudent_id, null) || ' ' || UPPER(tbl_studiengang.typ::varchar(1) || tbl_studiengang.kurzbz)) as rolle FROM public.tbl_prestudent JOIN public.tbl_studiengang USING(studiengang_kz) WHERE person_id='$row->person_id' UNION SELECT 'PreInteressent' as rolle FROM public.tbl_preinteressent WHERE person_id='$row->person_id'"; - if($result_stati = $db->db_query($qry_stati)) + if ($result_stati = $db->db_query($qry_stati)) { while($row_stati = $db->db_fetch_object($result_stati)) { - $status.=$row_stati->rolle.', '; + $status .= $row_stati->rolle.', '; } } $status = mb_substr($status, 0, mb_strlen($status)-2); echo ''; echo ''; @@ -1246,8 +1129,6 @@ if($where!='') echo '
NachnameVornameWeitere
Vornamen
GebDatumSVNRGeschlechtAdresseStatusDetails
Neue Person anlegen
'."$row->nachname$row->vorname$row->vornamen$row->gebdatum$row->svnr".($row->geschlecht=='m'?'männlich':'weiblich').""; - $qry_adr = "SELECT * FROM public.tbl_adresse WHERE person_id='$row->person_id'"; - if($result_adr = $db->db_query($qry_adr)) - while($row_adr=$db->db_fetch_object($result_adr)) + $qry_adr = "SELECT * FROM public.tbl_adresse WHERE person_id=".$db->db_add_param($row->person_id, FHC_INTEGER); + if ($result_adr = $db->db_query($qry_adr)) + while ($row_adr = $db->db_fetch_object($result_adr)) echo "$row_adr->plz $row_adr->ort, $row_adr->strasse
"; echo '
'.$status.'
'; } } -//else -// echo 'Zum Erstellen des Vorschlags bitte Geburtsdatum oder Vorname und Nachname eingeben'; ?> From 2e1b8279fd92337d794c9de3da01fcf1b9b52c79 Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 18 Jan 2019 15:16:16 +0100 Subject: [PATCH 13/18] - Changed the name of CI session from ci_session to sess_ci_session - Changed CI session expiring time from 7200 to 600 seconds --- application/config/config.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/config/config.php b/application/config/config.php index 2602c12cf..b5278c415 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -347,6 +347,7 @@ $config['encryption_key'] = ''; | 'sess_time_to_update' | | How many seconds between CI regenerating the session ID. +| NOTE: Keep it as it is to prevent security issues (https://en.wikipedia.org/wiki/Session_fixation) | | 'sess_regenerate_destroy' | @@ -359,8 +360,8 @@ $config['encryption_key'] = ''; | */ $config['sess_driver'] = 'files'; -$config['sess_cookie_name'] = 'ci_session'; -$config['sess_expiration'] = 7200; +$config['sess_cookie_name'] = 'sess_ci_session'; +$config['sess_expiration'] = 600; // Session expires every 10 minutes $config['sess_save_path'] = NULL; $config['sess_match_ip'] = FALSE; $config['sess_time_to_update'] = 300; From 86f1671fb67809972904a741da797539a413b215 Mon Sep 17 00:00:00 2001 From: Paolo Date: Mon, 21 Jan 2019 12:56:47 +0100 Subject: [PATCH 14/18] Changed CI session expiring time from 600 to 1800 seconds --- application/config/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/config/config.php b/application/config/config.php index b5278c415..d0bca14b9 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -361,7 +361,7 @@ $config['encryption_key'] = ''; */ $config['sess_driver'] = 'files'; $config['sess_cookie_name'] = 'sess_ci_session'; -$config['sess_expiration'] = 600; // Session expires every 10 minutes +$config['sess_expiration'] = 1800; // Session expires every 30 minutes $config['sess_save_path'] = NULL; $config['sess_match_ip'] = FALSE; $config['sess_time_to_update'] = 300; From d3803a848f2b955074b921138c441638d5c8ef40 Mon Sep 17 00:00:00 2001 From: Gerald Raab Date: Mon, 21 Jan 2019 16:38:06 +0100 Subject: [PATCH 15/18] Bugfix beim Abzug diverser Abwesenheitszeiten von der Gesamtarbeitszeit --- cis/private/tools/zeitaufzeichnung_projektliste.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cis/private/tools/zeitaufzeichnung_projektliste.php b/cis/private/tools/zeitaufzeichnung_projektliste.php index 36bf00ff5..17adfba97 100755 --- a/cis/private/tools/zeitaufzeichnung_projektliste.php +++ b/cis/private/tools/zeitaufzeichnung_projektliste.php @@ -232,7 +232,7 @@ for ($i = 0; $i < count($ztaufdata); $i++) $projectlines[$day]->arbeitszeit -= $subtraction->diff; $lehreExternExists = true; } - else + elseif ($subtraction->typ == $activitiesToSubtract[2] || $subtraction->typ == $activitiesToSubtract[3]) { $projectlines[$day]->arbeitszeit -= $subtraction->diff; } From 42768d7c9215dddbaa7fe5e3cb834a0cd97bcc4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Tue, 22 Jan 2019 14:51:53 +0100 Subject: [PATCH 16/18] Changed Version Number --- locale/de-AT/fas.dtd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/de-AT/fas.dtd b/locale/de-AT/fas.dtd index 229bd92af..cad80671f 100644 --- a/locale/de-AT/fas.dtd +++ b/locale/de-AT/fas.dtd @@ -1,5 +1,5 @@ - + From 631ef93d6b3a26e3ac592ee6600893f369938b25 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 22 Jan 2019 17:45:34 +0100 Subject: [PATCH 17/18] Infocenter: - even if a prestudent is already freigegeben for a studiengang, and if Quereinstieg, "shorter" Quereinstiegsinfomessage is sent when zum RT freigegeben - message sending: replaced ugly html parsing for check if already freigegeben with AJAX call --- .../system/infocenter/InfoCenter.php | 12 ++ .../views/system/infocenter/zgvpruefungen.php | 3 - public/js/infocenter/infocenterDetails.js | 124 ++++++++++++------ 3 files changed, 98 insertions(+), 41 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 65a6aec07..4c71da84a 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -78,6 +78,7 @@ class InfoCenter extends Auth_Controller 'showDetails' => 'infocenter:r', 'unlockPerson' => 'infocenter:rw', 'saveFormalGeprueft' => 'infocenter:rw', + 'getPrestudentData' => 'infocenter:r', 'getLastPrestudentWithZgvJson' => 'infocenter:r', 'getZgvInfoForPrestudent' => 'infocenter:r', 'saveBewPriorisierung' => 'infocenter:rw', @@ -263,6 +264,17 @@ class InfoCenter extends Auth_Controller $this->output->set_content_type('application/json')->set_output(json_encode($json)); } + /** + * Gets prestudent data for a person in json format + * @param $person_id + */ + public function getPrestudentData($person_id) + { + $prestudentdata = $this->_loadPrestudentData($person_id); + + $this->output->set_content_type('application/json')->set_output(json_encode($prestudentdata['zgvpruefungen'])); + } + /** * Gets prestudent that was last modified in json format, for ZGV übernehmen * @param $person_id diff --git a/application/views/system/infocenter/zgvpruefungen.php b/application/views/system/infocenter/zgvpruefungen.php index a26c94177..4f4037f43 100644 --- a/application/views/system/infocenter/zgvpruefungen.php +++ b/application/views/system/infocenter/zgvpruefungen.php @@ -98,9 +98,6 @@ - -
diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index 5a1fd7653..252647a71 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -4,6 +4,7 @@ const CALLED_PATH = FHC_JS_DATA_STORAGE_OBJECT.called_path; const CONTROLLER_URL = BASE_URL + "/"+CALLED_PATH; const RTFREIGABE_MESSAGE_VORLAGE = "InfocenterRTfreigegeben"; const RTFREIGABE_MESSAGE_VORLAGE_QUER = "InfocenterRTfreigegQuer"; +const RTFREIGABE_MESSAGE_VORLAGE_QUER_KURZ = "InfocenterRTfreigegQuerKurz"; const STGFREIGABE_MESSAGE_VORLAGE = "InfocenterSTGfreigegeben"; /** @@ -277,6 +278,9 @@ var InfocenterDetails = { { FHC_AjaxClient.showVeil(); InfocenterDetails.initFrgMessageSend(data.retval.prestudent_id, rtfreigabe); + InfocenterDetails._refreshZgv(); + FHC_AjaxClient.hideVeil(); + InfocenterDetails._refreshLog(); } else if (data.error === 2 && parseInt(data.retval.prestudent_id, 10)) { @@ -460,48 +464,98 @@ var InfocenterDetails = { } ); }, + getPrestudentData: function(personid, callback) + { + FHC_AjaxClient.ajaxCallGet( + CALLED_PATH + "/getPrestudentData/"+encodeURIComponent(personid), + null, + { + successCallback: callback, + veilTimeout: 0 + } + ); + }, initFrgMessageSend: function(prestudentid, rtfreigabe) { - var callback = function () + var callback = function (data) { + if (data == null) + return; + // check if a prestudent in same semester is already freigegeben - then not send message again var freigegeben = false; - var prestudentids = $(".prestudentidinput"); + var receiverPrestudentstatus = null; - if (prestudentids.length > 1) + //get prestudentstatus of message receiver + for(var i = 0; i < data.length; i++) { - prestudentids.each(function() - { - var id = $(this).val(); - - if (parseInt(id) !== parseInt(prestudentid)) - { - if ($("#studiensemester_"+id).val() === $("#studiensemester_"+prestudentid).val() && $("#isfreigegeben_"+id).val() === "1") - { - freigegeben = true; - return false; - } - } - } - ); + if (data[i].prestudentstatus.prestudent_id === prestudentid) + { + receiverPrestudentstatus = data[i].prestudentstatus; + break; + } } + if (receiverPrestudentstatus == null) + return; + + //check other prestudentstati wether already freigegeben + for(var j = 0; j < data.length; j++) + { + var prestudent = data[j]; + var prestudentstatus = prestudent.prestudentstatus; + var id = prestudentstatus.prestudent_id; + + if (id !== prestudentid) + { + if (receiverPrestudentstatus.studiensemester_kurzbz === prestudentstatus.studiensemester_kurzbz + && prestudentstatus.bestaetigtam !== null && prestudentstatus.status_kurzbz === "Interessent" + && prestudent.studiengangtyp === "b") + { + freigegeben = true; + break; + } + } + } + + var ausbildungssemester = receiverPrestudentstatus.ausbildungssemester; + var studiengangbezeichnung = receiverPrestudentstatus.studiengangbezeichnung; + var studiengangbezeichnung_englisch = receiverPrestudentstatus.studiengangbezeichnung_englisch; + var msgvars = {}; + if (freigegeben) { InfocenterDetails._refreshLog(); + //if already freigegeben, still send (shorter) message if Quereinsteiger + if (ausbildungssemester > 1) + { + msgvars = { + 'ausbildungssemester': ausbildungssemester, + 'studiengangbezeichnung': studiengangbezeichnung, + 'studiengangbezeichnung_englisch': studiengangbezeichnung_englisch + }; + InfocenterDetails.sendFreigabeMessage(prestudentid, RTFREIGABE_MESSAGE_VORLAGE_QUER_KURZ, msgvars); + } } else { - var ausbildungssem = $("#ausbildungssem_" + prestudentid).val(); var vorlage_kurzbz = null; - var msgvars = {}; if (rtfreigabe) { - vorlage_kurzbz = isNaN(ausbildungssem) || parseInt(ausbildungssem) === 1 ? RTFREIGABE_MESSAGE_VORLAGE : RTFREIGABE_MESSAGE_VORLAGE_QUER; - msgvars = { - 'rtlink': FHC_JS_DATA_STORAGE_OBJECT.app_root + 'addons/bewerbung/cis/registration.php?active=aufnahme', - 'ausbildungssemester': ausbildungssem + if (ausbildungssemester > 1) + { + vorlage_kurzbz = RTFREIGABE_MESSAGE_VORLAGE_QUER; + msgvars = { + /*'rtlink': FHC_JS_DATA_STORAGE_OBJECT.app_root + 'addons/bewerbung/cis/registration.php?active=aufnahme',*/ + 'ausbildungssemester': ausbildungssemester, + 'studiengangbezeichnung': studiengangbezeichnung, + 'studiengangbezeichnung_englisch': studiengangbezeichnung_englisch + } + } + else + { + vorlage_kurzbz = RTFREIGABE_MESSAGE_VORLAGE; } } else @@ -510,18 +564,16 @@ var InfocenterDetails = { } InfocenterDetails.sendFreigabeMessage(prestudentid, vorlage_kurzbz, msgvars); } - FHC_AjaxClient.hideVeil(); }; - InfocenterDetails._refreshZgv( - false, - //send message only after refresh to have current Ausbildungssemester - callback - ); + var personid = $("#hiddenpersonid").val(); + + InfocenterDetails.getPrestudentData( + personid, callback + ) }, sendFreigabeMessage: function(prestudentid, vorlage_kurzbz, msgvars) { - FHC_AjaxClient.ajaxCallPost( 'system/Messages/sendJson', { @@ -668,7 +720,7 @@ var InfocenterDetails = { $(".freigabeModal").modal("hide"); var prestudent_id = this.id.substr(this.id.indexOf("_") + 1); var data = {"prestudent_id": prestudent_id}; - InfocenterDetails.saveFreigabe(data, true); + InfocenterDetails.saveFreigabe(data, true);//Reihungstestfreigabe } ); @@ -678,17 +730,17 @@ var InfocenterDetails = { var prestudent_id = this.id.substr(this.id.indexOf("_") + 1); var statusgrund_id = $("#frgstatusgrselect_" + prestudent_id + " select[name=frgstatusgrund]").val(); var data = {"prestudent_id": prestudent_id, "statusgrund_id": statusgrund_id}; - InfocenterDetails.saveFreigabe(data); + InfocenterDetails.saveFreigabe(data);//Studiengangfreigabe } ) }, - _refreshZgv: function(preserveCollapseState, callback) + _refreshZgv: function(preserveCollapseState) { var personid = $("#hiddenpersonid").val(); var collapsed = {}; - //save if panel is collapsed to preserve collapse state + //check if panel is collapsed to preserve collapse state if (preserveCollapseState) { $("#zgvpruefungen").find(".panel-collapse").each( @@ -715,10 +767,6 @@ var InfocenterDetails = { $("#"+i).addClass("in"); } } - - // variable callback executed after refresh - if (callback) - callback(); } ); }, From cf347c42f2da89096ceef451a74a8adeb4169706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Tue, 29 Jan 2019 08:18:06 +0100 Subject: [PATCH 18/18] =?UTF-8?q?Beim=20automatischen=20Erstellen=20von=20?= =?UTF-8?q?Pr=C3=BCfungsterminen=20nach=20der=20Noteneintragung=20im=20FAS?= =?UTF-8?q?=20wird=20Lehreinheit=20jetzt=20korrekt=20ermittelt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/student/studentDBDML.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/content/student/studentDBDML.php b/content/student/studentDBDML.php index 6fdbd7306..02fa0deab 100644 --- a/content/student/studentDBDML.php +++ b/content/student/studentDBDML.php @@ -176,10 +176,17 @@ function NotePruefungAnlegen($studiensemester_kurzbz, $student_uid, $lehrveranst // Lehreinheit ermitteln $error = false; - $qry = "SELECT lehreinheit_id FROM campus.vw_student_lehrveranstaltung " - . "WHERE uid=".$db->db_add_param($student_uid)." AND lehrveranstaltung_id=".$db->db_add_param($lehrveranstaltung_id)." " - . "ORDER BY lehreinheit_id ASC " - . "LIMIT 1"; + $qry = " + SELECT + lehreinheit_id + FROM + campus.vw_student_lehrveranstaltung + WHERE + uid=".$db->db_add_param($student_uid)." + AND lehrveranstaltung_id=".$db->db_add_param($lehrveranstaltung_id)." + AND studiensemester_kurzbz=".$db->db_add_param($studiensemester_kurzbz)." + ORDER BY lehreinheit_id ASC + LIMIT 1"; if($result = $db->db_query($qry)) { @@ -1209,7 +1216,7 @@ if(!$error) $rolle->bestaetigtam = $_POST['bestaetigtam']; if($_POST['bestaetigtam']=='') $rolle->bestaetigtvon = null; - + $rolle->bewerbung_abgeschicktamum = $_POST['bewerbung_abgeschicktamum']; $rolle->orgform_kurzbz = $_POST['orgform_kurzbz']; $rolle->studienplan_id = $_POST['studienplan_id'];