From d542cf7720b9c0651d8510a18a73916e3200a6ae Mon Sep 17 00:00:00 2001 From: cgfhtw Date: Wed, 14 Aug 2024 16:20:47 +0200 Subject: [PATCH 001/152] s&d --- application/libraries/AntragLib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/libraries/AntragLib.php b/application/libraries/AntragLib.php index c1649587d..1a96eadf1 100644 --- a/application/libraries/AntragLib.php +++ b/application/libraries/AntragLib.php @@ -126,7 +126,7 @@ class AntragLib return $this->_ci->StudierendenantragstatusModel->resumeAntraegeForAbmeldungStgl($antrag_id); } // NOTE(chris): get last status that is not pause - $this->_ci->StudierendenantragstatusModel->addOrder('insertamum'); + $this->_ci->StudierendenantragstatusModel->addOrder('insertamum', 'DESC'); $this->_ci->StudierendenantragstatusModel->addLimit(1); $result = $this->_ci->StudierendenantragstatusModel->loadWhere([ 'studierendenantrag_id' => $antrag_id, From d4feee89142fc6bcbf1222549b5a088376e87225 Mon Sep 17 00:00:00 2001 From: Cristina Date: Tue, 18 Mar 2025 14:30:19 +0100 Subject: [PATCH 002/152] Fixed wrong param causing wrong Notenliste for Wiederholer --- cis/private/lehre/notenliste.xls.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cis/private/lehre/notenliste.xls.php b/cis/private/lehre/notenliste.xls.php index 6c8db5246..c525b2d6c 100644 --- a/cis/private/lehre/notenliste.xls.php +++ b/cis/private/lehre/notenliste.xls.php @@ -339,7 +339,7 @@ else { $worksheet->write($lines,8, trim($elem->matrikelnr), $format_highlight); $pr = new Pruefung(); - $pr->getPruefungen($elem->uid, "Termin2", $lvid, $sem); + $pr->getPruefungen($elem->uid, "Termin2", $lvid, $stsem); $output2 = $pr->result; if ($output2) @@ -360,7 +360,7 @@ else { $worksheet->write($lines,12, trim($elem->matrikelnr), $format_highlight); $pr = new Pruefung(); - $pr->getPruefungen($elem->uid, "Termin3", $lvid, $sem); + $pr->getPruefungen($elem->uid, "Termin3", $lvid, $stsem); $output3 = $pr->result; if ($output3) From cf59bcff12b4e4ad1a14ccbcd34ffbef7478dcf7 Mon Sep 17 00:00:00 2001 From: ma0068 Date: Tue, 19 Aug 2025 09:16:26 +0200 Subject: [PATCH 003/152] add Functionality sendInfomail - expand InputComponent for dynamic adding of actionButton to Form Upload Image - add Phrases for Infomail --- public/js/components/Form/Input.js | 4 +- public/js/components/Form/Upload/Image.js | 13 +++++- .../Studentenverwaltung/Details/Details.js | 12 ++++++ system/phrasesupdate.php | 42 ++++++++++++++++++- 4 files changed, 66 insertions(+), 5 deletions(-) diff --git a/public/js/components/Form/Input.js b/public/js/components/Form/Input.js index c85272aab..4044b32fb 100644 --- a/public/js/components/Form/Input.js +++ b/public/js/components/Form/Input.js @@ -28,7 +28,8 @@ export default { label: String, // NOTE(chris): remove these from $attrs array to prevent doubled event listeners onInput: [Array, Function], - 'onUpdate:modelValue': [Array, Function] + 'onUpdate:modelValue': [Array, Function], + titleActionButton: String }, data() { return { @@ -314,6 +315,7 @@ export default { :id="idCmp" :name="name" :class="validationClass" + :titleActionButton="titleActionButton" @update:model-value="clearValidationForThisName" > diff --git a/public/js/components/Form/Upload/Image.js b/public/js/components/Form/Upload/Image.js index b0b8d5b78..4b96d4c85 100644 --- a/public/js/components/Form/Upload/Image.js +++ b/public/js/components/Form/Upload/Image.js @@ -1,9 +1,14 @@ export default { emits: [ - 'update:modelValue' + 'update:modelValue', + 'actionbutton-clicked' ], props: { - modelValue: String + modelValue: String, + titleActionButton: { + type: String, + default: "" + } }, computed: { valueAsBase64DataString() { @@ -28,6 +33,9 @@ export default { }, deleteImage() { this.$emit('update:modelValue', ''); + }, + emitAction(){ + this.$emit('actionbutton-clicked', this.modelValue); } }, template: ` @@ -42,6 +50,7 @@ export default { + diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Details.js b/public/js/components/Stv/Studentenverwaltung/Details/Details.js index 45ee3bdd5..61eea7605 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Details.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Details.js @@ -158,6 +158,16 @@ export default { }, reload(){ this.updateStudent(this.modelValue); + }, + sendInfomail(){ + const subject = this.$p.t('person', 'betreffProfilfoto'); + const subjectEncoded = encodeURIComponent(subject); + + const body = this.$p.t('person', 'mailText_profilfoto'); + const bodyWithNewLines = body.replace(/\\n/g, '\n'); + const bodyEncoded = encodeURIComponent(bodyWithNewLines); + + window.location.href = "mailto:" + this.modelValue.mail_intern + "?subject=" + subjectEncoded + "&body=" + bodyEncoded; } }, created() { @@ -400,8 +410,10 @@ export default { container-class="col-4 stv-details-details-foto" :label="$p.t('person', 'foto')" type="UploadImage" + titleActionButton="Infomail" v-model="data.foto" name="foto" + @actionbutton-clicked="sendInfomail" > No Image diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 4a3cfd7ec..3b0e607c9 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -30281,8 +30281,6 @@ array( ) ) ), - - //ProfilUpdate Phrasen ende array( 'app' => 'core', @@ -46677,6 +46675,46 @@ and represent the current state of research on the topic. The prescribed citatio ) ) ), + array( + 'app' => 'core', + 'category' => 'person', + 'phrase' => 'mailText_profilfoto', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Hallo,\n\nIhr Profilbild wurde entfernt, da es nicht den aktuellen Bildrichtlinen entspricht. Bitte laden Sie unter CIS->Profil ein neues Profilbild hoch!\n\nDanke!", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Hello,\n\nYour profile picture has been removed because it does not comply with the current image guidelines. Please upload a new profile picture under CIS->Profile!\n\nThank you!", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'person', + 'phrase' => 'betreffProfilfoto', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Profilbild', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Profile picture', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), // FHC-4 Finetuning END //**************************** CORE/search From ba6224bc788e83894627d8fc5770af3c3f97053f Mon Sep 17 00:00:00 2001 From: ma0048 Date: Tue, 2 Sep 2025 11:18:24 +0200 Subject: [PATCH 004/152] oeh betrag aus der eigener tabelle holen studentenverwaltung bei jedem studiensemester wechsel fas nur einmalig ueber die variable --- .../controllers/api/frontend/v1/stv/Konto.php | 45 ++++++++++++++++++- include/konto.class.php | 45 ++++++++++++++++++- public/js/api/factory/stv/konto.js | 10 +++-- .../Studentenverwaltung/Details/Konto/New.js | 18 +++++++- 4 files changed, 110 insertions(+), 8 deletions(-) diff --git a/application/controllers/api/frontend/v1/stv/Konto.php b/application/controllers/api/frontend/v1/stv/Konto.php index a33680ea0..c7c1aa1d5 100644 --- a/application/controllers/api/frontend/v1/stv/Konto.php +++ b/application/controllers/api/frontend/v1/stv/Konto.php @@ -48,7 +48,8 @@ class Konto extends FHCAPI_Controller // Load language phrases $this->loadPhrases([ - 'konto' + 'konto', + 'lehre' ]); } @@ -112,7 +113,7 @@ class Konto extends FHCAPI_Controller * * @return void */ - public function getBuchungstypen() + public function getBuchungstypen($studiensemester_kurzbz = null) { $this->load->model('crm/Buchungstyp_model', 'BuchungstypModel'); @@ -122,6 +123,7 @@ class Konto extends FHCAPI_Controller $data = $this->getDataOrTerminateWithError($result); + $this->_getOEHBeitrag($data, $studiensemester_kurzbz); $this->terminateWithSuccess($data); } @@ -494,4 +496,43 @@ class Konto extends FHCAPI_Controller $this->terminateWithSuccess(); } + + private function _getOEHBeitrag(&$data, $studiensemester_kurzbz = null) + { + if (is_null($studiensemester_kurzbz)) + { + $this->load->library('VariableLib', ['uid' => getAuthUID()]); + $studiensemester_akt = $this->variablelib->getVar('semester_aktuell'); + } + else + { + $this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel'); + if ($this->StudiensemesterModel->isValidStudiensemester($studiensemester_kurzbz)) + $studiensemester_akt = $studiensemester_kurzbz; + else + $this->terminateWithError($this->p->t('lehre', 'error_noStudiensemester')); + } + + $this->load->model('codex/Oehbeitrag_model', 'OehbeitragModel'); + $oehBeitrag = $this->OehbeitragModel->getByStudiensemester($studiensemester_akt); + + $oehStandardbetrag = null; + if (hasData($oehBeitrag)) + { + $oeh = getData($oehBeitrag)[0]; + $summe = ($oeh->studierendenbeitrag + $oeh->versicherung) * -1; + $oehStandardbetrag = number_format((float)$summe, 2, '.', ''); + } + + if ($oehStandardbetrag !== null) + { + $data = array_map(function ($buchungstyp) use ($oehStandardbetrag) { + if (isset($buchungstyp->buchungstyp_kurzbz) && (strtolower($buchungstyp->buchungstyp_kurzbz) === 'oeh')) + { + $buchungstyp->standardbetrag = $oehStandardbetrag; + } + return $buchungstyp; + }, $data); + } + } } diff --git a/include/konto.class.php b/include/konto.class.php index 51f79200b..da76c147f 100644 --- a/include/konto.class.php +++ b/include/konto.class.php @@ -25,6 +25,7 @@ */ require_once(dirname(__FILE__).'/basis_db.class.php'); require_once(dirname(__FILE__).'/'.EXT_FKT_PATH.'/generateZahlungsreferenz.inc.php'); +require_once(dirname(__FILE__).'/variable.class.php'); class konto extends basis_db { @@ -432,6 +433,8 @@ class konto extends basis_db $qry.=" ORDER BY beschreibung"; + $oehBeitrag = $this->_getOEHBeitrag(); + if($this->db_query($qry)) { while($row = $this->db_fetch_object()) @@ -440,7 +443,15 @@ class konto extends basis_db $typ->buchungstyp_kurzbz = $row->buchungstyp_kurzbz; $typ->beschreibung = $row->beschreibung; - $typ->standardbetrag = $row->standardbetrag; + if (strtolower($typ->buchungstyp_kurzbz) === 'oeh' && $oehBeitrag) + { + $typ->standardbetrag = $oehBeitrag; + } + else + { + $typ->standardbetrag = $row->standardbetrag; + } + $typ->standardtext = $row->standardtext; $typ->credit_points = $row->credit_points; $typ->aktiv = $this->db_parse_bool($row->aktiv); @@ -990,6 +1001,38 @@ class konto extends basis_db return false; } } + + private function _getOEHBeitrag() + { + $variablen_obj = new variable(); + $variablen_obj->loadVariables(get_uid()); + + $qry = "WITH semstart AS ( + SELECT start FROM public.tbl_studiensemester + WHERE studiensemester_kurzbz = '". $this->db_escape($variablen_obj->variable->semester_aktuell) . "' + ) + SELECT * FROM bis.tbl_oehbeitrag oehb + JOIN public.tbl_studiensemester semvon ON oehb.von_studiensemester_kurzbz = semvon.studiensemester_kurzbz + LEFT JOIN public.tbl_studiensemester sembis ON oehb.bis_studiensemester_kurzbz = sembis.studiensemester_kurzbz + JOIN semstart ON semstart.start::date >= semvon.start::date AND (sembis.studiensemester_kurzbz IS NULL OR semstart.start::date <= sembis.start::date) + ORDER BY semvon.start + LIMIT 1"; + + if ($this->db_query($qry)) + { + if($row = $this->db_fetch_object()) + { + $summe = ($row->studierendenbeitrag + $row->versicherung) * -1; + return number_format((float)$summe, 2, '.', ''); + } + return false; + } + else + { + $this->errormsg = 'Fehler bei der Abfrage aufgetreten'; + return false; + } + } } ?> diff --git a/public/js/api/factory/stv/konto.js b/public/js/api/factory/stv/konto.js index 6c17d460d..adfc0c44e 100644 --- a/public/js/api/factory/stv/konto.js +++ b/public/js/api/factory/stv/konto.js @@ -65,10 +65,14 @@ export default { params: { buchungsnr } }; }, - getBuchungstypen() { + getBuchungstypen(studiensemester_kurzbz) { + let url = 'api/frontend/v1/stv/konto/getBuchungstypen' + if (!!studiensemester_kurzbz) + url = url + '/' + encodeURIComponent(studiensemester_kurzbz); + return { method: 'get', - url: 'api/frontend/v1/stv/konto/getBuchungstypen' + url: url }; - } + }, }; \ No newline at end of file diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Konto/New.js b/public/js/components/Stv/Studentenverwaltung/Details/Konto/New.js index cdb32de99..4060b5961 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Konto/New.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Konto/New.js @@ -83,6 +83,8 @@ export default { }); }, open() { + + this.getBuchungstypen(this.currentSemester); this.data = { buchungstyp_kurzbz: '', betrag: '-0.00', @@ -105,7 +107,7 @@ export default { const text = typ.standardtext || ''; const creditpoints = typ.credit_points || ''; - if (!this.data.betrag || this.data.betrag == '-0.00') + if (!this.data.betrag || this.data.betrag == '-0.00' || this.data.betrag !== amount) this.data.betrag = amount; if (!this.data.buchungstext) @@ -113,7 +115,18 @@ export default { if (this.config.showCreditpoints && (this.data.credit_points == '0.00' || this.data.credit_points === null)) this.data.credit_points = creditpoints; - } + }, + getBuchungstypen(studiensemester_kurzbz) + { + this.$api + .call(ApiKonto.getBuchungstypen(studiensemester_kurzbz)) + .then(result => { + this.lists.buchungstypen = result.data; + if (this.data.buchungstyp_kurzbz) + this.checkDefaultBetrag(this.data.buchungstyp_kurzbz); + }) + .catch(this.$fhcAlert.handleSystemError); + }, }, template: ` @@ -166,6 +179,7 @@ export default { From 67281c84ed27dc6fbb9cc8157f81f340ea973a7a Mon Sep 17 00:00:00 2001 From: chfhtw Date: Wed, 8 Oct 2025 13:36:20 +0200 Subject: [PATCH 005/152] FhcApps Library --- public/js/FhcApps.js | 50 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 public/js/FhcApps.js diff --git a/public/js/FhcApps.js b/public/js/FhcApps.js new file mode 100644 index 000000000..f9ec61001 --- /dev/null +++ b/public/js/FhcApps.js @@ -0,0 +1,50 @@ +/** + * Copyright (C) 2025 fhcomplete.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +const FhcApps = (function() { + // Logic to extend app here (like adding components, plugins, ...) + + function makeExtendable(app) { + // apply extensions here + return app; + } + + return { + makeExtendable + }; +})(); + +FhcApps.router = (() => { + const extraRoutes = []; + + function addRoute(...route) { + extraRoutes.push(route); + } + + function makeExtendable(router) { + while (extraRoutes.length) { + router.addRoute(...extraRoutes.shift()); + } + router.replace(router.currentRoute.value.fullPath); + } + + return { + addRoute, + makeExtendable + }; +})(); From 842dabc1e7aac7817303aacf0105a7ed8ba24257 Mon Sep 17 00:00:00 2001 From: chfhtw Date: Wed, 8 Oct 2025 13:37:06 +0200 Subject: [PATCH 006/152] add fhcApps functionality to view template --- application/views/templates/FHC-Common.php | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/application/views/templates/FHC-Common.php b/application/views/templates/FHC-Common.php index 71f9c46c4..955583500 100644 --- a/application/views/templates/FHC-Common.php +++ b/application/views/templates/FHC-Common.php @@ -48,3 +48,60 @@ $udfs = isset($udfs) ? $udfs : false; $widgets = isset($widgets) ? $widgets : false; $tags = isset($tags) ? $tags : false; + +// VueJs App magic +if (isset($fhcApps)) { + if (!isset($customJSs)) + $customJSs = ['public/js/FhcApps.js']; + elseif (!is_array($customJSs)) + $customJSs = [$customJSs, 'public/js/FhcApps.js']; + else + array_push($customJSs, 'public/js/FhcApps.js'); + + if (!isset($customJSModules)) + $customJSModules = []; + elseif (!is_array($customJSModules)) + $customJSModules = [$customJSModules]; + + if (!isset($customCSSs)) + $customCSSs = []; + elseif (!is_array($customCSSs)) + $customCSSs = [$customCSSs]; + + $ext_path = 'public/extensions/'; + $ext_realpath = str_replace('/', DIRECTORY_SEPARATOR, $ext_path); + + foreach ($fhcApps as $app) { + if (!strstr($app, ':')) { + $app_js_path = 'public/js/apps/' . $app . '.js'; + $app_css_path = 'public/css/apps/' . $app . '.css'; + $app_js_ext_path = '/js/extend_app/' . $app . '.js'; + $app_css_ext_path = '/css/extend_app/' . $app . '.css'; + } else { + list($ext_name, $app_path) = explode(':', $app); + $app_js_path = 'public/extensions/' . $ext_name . '/js/apps/' . $app_path . '.js'; + $app_css_path = 'public/extensions/' . $ext_name . '/css/apps/' . $app_path . '.css'; + $app_js_ext_path = '/js/extend_app/extensions/' . $ext_name . '/' . $app_path . '.js'; + $app_css_ext_path = '/css/extend_app/extensions/' . $ext_name . '/' . $app_path . '.css'; + } + + if (file_exists(FHCPATH . str_replace('/', DIRECTORY_SEPARATOR, $app_css_path))) + array_push($customCSSs, $app_css_path); + + foreach (scandir(FHCPATH . $ext_realpath) as $extension_name) { + if ($extension_name[0] == '.') + continue; + + $app_js_ext_realpath = str_replace('/', DIRECTORY_SEPARATOR, $app_js_ext_path); + if (file_exists(FHCPATH . $ext_realpath . $extension_name . $app_js_ext_realpath)) { + array_push($customJSModules, $ext_path . $extension_name . $app_js_ext_path); + } + $app_css_ext_realpath = str_replace('/', DIRECTORY_SEPARATOR, $app_css_ext_path); + if (file_exists(FHCPATH . $ext_realpath . $extension_name . $app_css_ext_realpath)) { + array_push($customCSSs, $ext_path . $extension_name . $app_css_ext_path); + } + } + + array_push($customJSModules, $app_js_path); + } +} From d2f21ba4e6fe7aee20fcafdd732c256b653e58d8 Mon Sep 17 00:00:00 2001 From: chfhtw Date: Wed, 8 Oct 2025 14:45:12 +0200 Subject: [PATCH 007/152] use fhcApps for LVVerwaltung --- application/views/LVVerwaltung.php | 4 ++-- public/js/apps/LVVerwaltung.js | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/application/views/LVVerwaltung.php b/application/views/LVVerwaltung.php index 4cebae839..5c4c9549e 100644 --- a/application/views/LVVerwaltung.php +++ b/application/views/LVVerwaltung.php @@ -17,8 +17,8 @@ 'public/css/Lvverwaltung.css' ], - 'customJSModules' => [ - 'public/js/apps/LVVerwaltung.js' + 'fhcApps' => [ + 'LVVerwaltung' ] ); diff --git a/public/js/apps/LVVerwaltung.js b/public/js/apps/LVVerwaltung.js index f365b74a8..18f8a072f 100644 --- a/public/js/apps/LVVerwaltung.js +++ b/public/js/apps/LVVerwaltung.js @@ -89,8 +89,12 @@ const router = VueRouter.createRouter({ ] }); +FhcApps.router.makeExtendable(router); + const app = Vue.createApp(); +FhcApps.makeExtendable(app); + app .use(router) .use(primevue.config.default, { From 09864c515428e7901b32ba9d568ae447ff0f7989 Mon Sep 17 00:00:00 2001 From: chfhtw Date: Thu, 9 Oct 2025 08:41:58 +0200 Subject: [PATCH 008/152] remove unused view that links to a non existing app --- application/views/Cis/Profil.php | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 application/views/Cis/Profil.php diff --git a/application/views/Cis/Profil.php b/application/views/Cis/Profil.php deleted file mode 100644 index f66ebf8a9..000000000 --- a/application/views/Cis/Profil.php +++ /dev/null @@ -1,18 +0,0 @@ - 'Profil', - 'customJSModules' => ['public/js/apps/Cis/Profil.js'], - 'tabulator5' => true, - 'primevue3' => true, - 'customCSSs' => ['public/css/components/calendar.css', 'public/css/components/FilterComponent.css','public/css/components/Profil.css','public/css/components/FormUnderline.css'], - -); - -$this->load->view('templates/CISVUE-Header', $includesArray); -?> - -
- -
- -load->view('templates/CISVUE-Footer', $includesArray); ?> From d389cf87b8b7f31054552e53360fa8c7d78c56e4 Mon Sep 17 00:00:00 2001 From: chfhtw Date: Thu, 9 Oct 2025 08:42:29 +0200 Subject: [PATCH 009/152] delete MyLv->Info because app does not exist anymore and url is rerouted to MyLv->index --- application/controllers/Cis/MyLv.php | 5 ----- application/views/Cis/LvInfo.php | 15 --------------- 2 files changed, 20 deletions(-) delete mode 100644 application/views/Cis/LvInfo.php diff --git a/application/controllers/Cis/MyLv.php b/application/controllers/Cis/MyLv.php index 49a938553..819d56b05 100644 --- a/application/controllers/Cis/MyLv.php +++ b/application/controllers/Cis/MyLv.php @@ -33,9 +33,4 @@ class MyLv extends Auth_Controller $this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'MyLv']); } - - public function Info($studien_semester,$lvid) - { - $this->load->view('Cis/LvInfo',['lvid'=> $lvid, 'studien_semester' => $studien_semester]); - } } diff --git a/application/views/Cis/LvInfo.php b/application/views/Cis/LvInfo.php deleted file mode 100644 index 49a7b7a85..000000000 --- a/application/views/Cis/LvInfo.php +++ /dev/null @@ -1,15 +0,0 @@ - 'LvInfo', - 'customJSModules' => ['public/js/apps/Cis/LvInfo.js'] -); - -$this->load->view('templates/CISVUE-Header', $includesArray); -?> - -
- - -
- -load->view('templates/CISVUE-Footer', $includesArray); ?> From 3c3e92057317877cfb5e6da90fee8e31111a340b Mon Sep 17 00:00:00 2001 From: chfhtw Date: Thu, 9 Oct 2025 08:43:12 +0200 Subject: [PATCH 010/152] use fhcApps for Studentenverwaltung --- application/views/Studentenverwaltung.php | 4 ++-- public/js/apps/Studentenverwaltung.js | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/application/views/Studentenverwaltung.php b/application/views/Studentenverwaltung.php index 01e611657..aa4891e9a 100644 --- a/application/views/Studentenverwaltung.php +++ b/application/views/Studentenverwaltung.php @@ -26,8 +26,8 @@ #'vendor/npm-asset/primevue/tree/tree.min.js', #'vendor/npm-asset/primevue/toast/toast.min.js' ], - 'customJSModules' => [ - 'public/js/apps/Studentenverwaltung.js' + 'fhcApps' => [ + 'Studentenverwaltung' ] ); diff --git a/public/js/apps/Studentenverwaltung.js b/public/js/apps/Studentenverwaltung.js index 5eda16dd6..50763ad6f 100644 --- a/public/js/apps/Studentenverwaltung.js +++ b/public/js/apps/Studentenverwaltung.js @@ -168,10 +168,14 @@ router.afterEach((to, from, failure) => { document.title = title; }); +FhcApps.router.makeExtendable(router); + const app = Vue.createApp({ name: 'StudentenverwaltungApp' }); +FhcApps.makeExtendable(app); + app .use(router) .use(primevue.config.default, { From 0309c04ae09fb0b634d84ede9d0a66972ed435ca Mon Sep 17 00:00:00 2001 From: chfhtw Date: Thu, 9 Oct 2025 08:46:09 +0200 Subject: [PATCH 011/152] use fhcApps for Cis/Documents --- application/views/Cis/Documents.php | 2 +- public/js/apps/Cis/Documents.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/application/views/Cis/Documents.php b/application/views/Cis/Documents.php index f34ce3fc1..fa491fa11 100644 --- a/application/views/Cis/Documents.php +++ b/application/views/Cis/Documents.php @@ -2,7 +2,7 @@ $includesArray = array( 'title' => 'Documents', 'tabulator5' => true, - 'customJSModules' => ['public/js/apps/Cis/Documents.js'] + 'fhcApps' => ['Cis/Documents'] ); $this->load->view('templates/CISVUE-Header', $includesArray); diff --git a/public/js/apps/Cis/Documents.js b/public/js/apps/Cis/Documents.js index de03769b4..149a32446 100644 --- a/public/js/apps/Cis/Documents.js +++ b/public/js/apps/Cis/Documents.js @@ -87,6 +87,8 @@ const app = Vue.createApp({ } }); +FhcApps.makeExtendable(app); + setScrollbarWidth(); app.use(PluginsPhrasen); From ea0b69d4c274ea5f67854d058e8cc630423da720 Mon Sep 17 00:00:00 2001 From: chfhtw Date: Thu, 9 Oct 2025 09:15:26 +0200 Subject: [PATCH 012/152] use fhcApps for ProfilUpdateRequest --- application/views/Cis/ProfilUpdate.php | 4 ++-- public/js/apps/Cis/ProfilUpdateRequests.js | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/application/views/Cis/ProfilUpdate.php b/application/views/Cis/ProfilUpdate.php index e797d436f..525d261a7 100644 --- a/application/views/Cis/ProfilUpdate.php +++ b/application/views/Cis/ProfilUpdate.php @@ -6,8 +6,8 @@ $includesArray = array( 'fontawesome6'=> true, 'axios027' => true, 'tabulator5' => true, - 'customJSModules' => array( - 'public/js/apps/Cis/ProfilUpdateRequests.js' + 'fhcApps' => array( + 'Cis/ProfilUpdateRequests' ), 'customCSSs' => array( 'public/css/components/FilterComponent.css','public/css/components/FormUnderline.css' diff --git a/public/js/apps/Cis/ProfilUpdateRequests.js b/public/js/apps/Cis/ProfilUpdateRequests.js index 68465b202..974b2c362 100644 --- a/public/js/apps/Cis/ProfilUpdateRequests.js +++ b/public/js/apps/Cis/ProfilUpdateRequests.js @@ -34,4 +34,7 @@ const app = Vue.createApp({ }); }, }); + +FhcApps.makeExtendable(app); + app.use(PluginsPhrasen).mount("#content"); \ No newline at end of file From 61600e78b630a3adac25b6f6ba0c9c005025ed3c Mon Sep 17 00:00:00 2001 From: chfhtw Date: Thu, 9 Oct 2025 09:27:31 +0200 Subject: [PATCH 013/152] use fhcApps for Bismeldestichtag/Bismeldestichtag --- application/views/codex/bismeldestichtag.php | 2 +- public/js/apps/Bismeldestichtag/Bismeldestichtag.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/application/views/codex/bismeldestichtag.php b/application/views/codex/bismeldestichtag.php index 37af16cc6..2f024d25e 100644 --- a/application/views/codex/bismeldestichtag.php +++ b/application/views/codex/bismeldestichtag.php @@ -10,7 +10,7 @@ 'tabulator5' => true, 'customCSSs' => array('vendor/vuejs/vuedatepicker_css/main.css'), 'customJSs' => array('vendor/vuejs/vuedatepicker_js/vue-datepicker.iife.js'), - 'customJSModules' => array('public/js/apps/Bismeldestichtag/Bismeldestichtag.js') + 'fhcApps' => array('Bismeldestichtag/Bismeldestichtag') ); $this->load->view('templates/FHC-Header', $includesArray); diff --git a/public/js/apps/Bismeldestichtag/Bismeldestichtag.js b/public/js/apps/Bismeldestichtag/Bismeldestichtag.js index d6e5a4a27..9a9766690 100644 --- a/public/js/apps/Bismeldestichtag/Bismeldestichtag.js +++ b/public/js/apps/Bismeldestichtag/Bismeldestichtag.js @@ -237,4 +237,6 @@ const bismeldestichtagApp = Vue.createApp({ } }); +FhcApps.makeExtendable(bismeldestichtagApp); + bismeldestichtagApp.use(PluginsPhrasen).mount('#main'); From d88cc77a5cb35cbc3c4b2cad034a9d2b896299c7 Mon Sep 17 00:00:00 2001 From: chfhtw Date: Thu, 9 Oct 2025 10:40:02 +0200 Subject: [PATCH 014/152] use fhcApps for Studstatus --- application/views/lehre/Antrag/Create.php | 2 +- application/views/lehre/Antrag/Leitung/List.php | 2 +- application/views/lehre/Antrag/Student/List.php | 2 +- application/views/lehre/Antrag/Wiederholung/Student.php | 2 +- public/js/apps/lehre/Antrag.js | 3 +++ public/js/apps/lehre/Antrag/Leitung.js | 3 +++ public/js/apps/lehre/Antrag/Lvzuweisung.js | 3 +++ public/js/apps/lehre/Antrag/Student.js | 3 +++ 8 files changed, 16 insertions(+), 4 deletions(-) diff --git a/application/views/lehre/Antrag/Create.php b/application/views/lehre/Antrag/Create.php index 00e41d1cd..36a39078f 100644 --- a/application/views/lehre/Antrag/Create.php +++ b/application/views/lehre/Antrag/Create.php @@ -8,7 +8,7 @@ $sitesettings = array( 'fontawesome6' => true, 'phrases' => array( ), - 'customJSModules' => array('public/js/apps/lehre/Antrag.js'), + 'fhcApps' => array('lehre/Antrag'), 'customCSSs' => array( 'public/css/Fhc.css', 'public/css/components/primevue.css', diff --git a/application/views/lehre/Antrag/Leitung/List.php b/application/views/lehre/Antrag/Leitung/List.php index 1225b16b6..b1ba44a4c 100644 --- a/application/views/lehre/Antrag/Leitung/List.php +++ b/application/views/lehre/Antrag/Leitung/List.php @@ -18,7 +18,7 @@ $sitesettings = array( 'lehre', 'person', ), - 'customJSModules' => array('public/js/apps/lehre/Antrag/Leitung.js'), + 'fhcApps' => array('lehre/Antrag/Leitung'), 'customCSSs' => array( 'public/css/Fhc.css', 'public/css/components/primevue.css', diff --git a/application/views/lehre/Antrag/Student/List.php b/application/views/lehre/Antrag/Student/List.php index 6d769dafe..9454e2006 100644 --- a/application/views/lehre/Antrag/Student/List.php +++ b/application/views/lehre/Antrag/Student/List.php @@ -8,7 +8,7 @@ $sitesettings = array( 'fontawesome6' => true, 'phrases' => array( ), - 'customJSModules' => array('public/js/apps/lehre/Antrag/Student.js'), + 'fhcApps' => array('lehre/Antrag/Student'), 'customCSSs' => array( 'public/css/Fhc.css', 'public/css/components/primevue.css', diff --git a/application/views/lehre/Antrag/Wiederholung/Student.php b/application/views/lehre/Antrag/Wiederholung/Student.php index e51cfd1bc..73405fc0a 100644 --- a/application/views/lehre/Antrag/Wiederholung/Student.php +++ b/application/views/lehre/Antrag/Wiederholung/Student.php @@ -12,7 +12,7 @@ $sitesettings = array( 'lehre', 'global' ), - 'customJSModules' => array('public/js/apps/lehre/Antrag/Lvzuweisung.js'), + 'fhcApps' => array('lehre/Antrag/Lvzuweisung'), 'customCSSs' => array( 'public/css/Fhc.css', 'public/css/components/primevue.css', diff --git a/public/js/apps/lehre/Antrag.js b/public/js/apps/lehre/Antrag.js index 97b4bda97..afdfe48ab 100644 --- a/public/js/apps/lehre/Antrag.js +++ b/public/js/apps/lehre/Antrag.js @@ -20,6 +20,9 @@ const app = Vue.createApp({ }; } }); + +FhcApps.makeExtendable(app); + app .use(PluginsPhrasen) .mount('#wrapper'); \ No newline at end of file diff --git a/public/js/apps/lehre/Antrag/Leitung.js b/public/js/apps/lehre/Antrag/Leitung.js index 8fd8b117e..c8169629a 100644 --- a/public/js/apps/lehre/Antrag/Leitung.js +++ b/public/js/apps/lehre/Antrag/Leitung.js @@ -7,6 +7,9 @@ const app = Vue.createApp({ StudierendenantragLeitung } }); + +FhcApps.makeExtendable(app); + app .use(PluginsPhrasen) .use(primevue.config.default,{zIndex: {overlay: 9999}}) diff --git a/public/js/apps/lehre/Antrag/Lvzuweisung.js b/public/js/apps/lehre/Antrag/Lvzuweisung.js index 7504e7dcf..f85a52f62 100644 --- a/public/js/apps/lehre/Antrag/Lvzuweisung.js +++ b/public/js/apps/lehre/Antrag/Lvzuweisung.js @@ -12,6 +12,9 @@ const app = Vue.createApp({ } } }); + +FhcApps.makeExtendable(app); + app .use(PluginsPhrasen) .mount('#wrapper'); \ No newline at end of file diff --git a/public/js/apps/lehre/Antrag/Student.js b/public/js/apps/lehre/Antrag/Student.js index 46150c541..7d40f4339 100644 --- a/public/js/apps/lehre/Antrag/Student.js +++ b/public/js/apps/lehre/Antrag/Student.js @@ -7,6 +7,9 @@ const app = Vue.createApp({ LvPopup } }); + +FhcApps.makeExtendable(app); + app .use(PluginsPhrasen) .mount('#wrapper'); \ No newline at end of file From d294d17e375add1c2d89bef9ee59a7890c681cd3 Mon Sep 17 00:00:00 2001 From: chfhtw Date: Thu, 9 Oct 2025 10:42:22 +0200 Subject: [PATCH 015/152] use fhcApps for lehre/lvplanung/LvTemplates --- application/views/lehre/lvplanung/lvTemplateUebersicht.php | 2 +- public/js/apps/lehre/lvplanung/LvTemplates.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/application/views/lehre/lvplanung/lvTemplateUebersicht.php b/application/views/lehre/lvplanung/lvTemplateUebersicht.php index 5c873486c..1d5a2e777 100644 --- a/application/views/lehre/lvplanung/lvTemplateUebersicht.php +++ b/application/views/lehre/lvplanung/lvTemplateUebersicht.php @@ -9,7 +9,7 @@ $includesArray = array( 'primevue3' => true, 'navigationcomponent' => true, 'filtercomponent' => true, - 'customJSModules' => array('public/js/apps/lehre/lvplanung/LvTemplates.js'), + 'fhcApps' => array('lehre/lvplanung/LvTemplates'), 'customCSSs' => array( 'public/css/Fhc.css', 'public/css/lvTemplateUebersicht.css' diff --git a/public/js/apps/lehre/lvplanung/LvTemplates.js b/public/js/apps/lehre/lvplanung/LvTemplates.js index 655d611ce..b19b1f730 100644 --- a/public/js/apps/lehre/lvplanung/LvTemplates.js +++ b/public/js/apps/lehre/lvplanung/LvTemplates.js @@ -28,6 +28,8 @@ const lvTemplatesApp = Vue.createApp({ } }); +FhcApps.makeExtendable(lvTemplatesApp); + lvTemplatesApp .use(primevue.config.default,{zIndex: {overlay: 9999}}) .use(PluginsPhrasen) From 70c230edcee856a9386f59e97ee136032e1bfae8 Mon Sep 17 00:00:00 2001 From: chfhtw Date: Thu, 9 Oct 2025 10:44:13 +0200 Subject: [PATCH 016/152] use fhcApps for LogsViewer/LogsViewer --- application/views/system/logs/logsViewer.php | 2 +- public/js/apps/LogsViewer/LogsViewer.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/application/views/system/logs/logsViewer.php b/application/views/system/logs/logsViewer.php index ddfe855fe..60d9075d0 100644 --- a/application/views/system/logs/logsViewer.php +++ b/application/views/system/logs/logsViewer.php @@ -13,7 +13,7 @@ 'global' => array('mailAnXversandt'), 'ui' => array('bitteEintragWaehlen') ), - 'customJSModules' => array('public/js/apps/LogsViewer/LogsViewer.js'), + 'fhcApps' => array('LogsViewer/LogsViewer'), ); $this->load->view('templates/FHC-Header', $includesArray); diff --git a/public/js/apps/LogsViewer/LogsViewer.js b/public/js/apps/LogsViewer/LogsViewer.js index eeb4b38a7..ad377a369 100644 --- a/public/js/apps/LogsViewer/LogsViewer.js +++ b/public/js/apps/LogsViewer/LogsViewer.js @@ -42,5 +42,7 @@ const logsViewerApp = Vue.createApp({ } }); +FhcApps.makeExtendable(logsViewerApp); + logsViewerApp.use(PluginsPhrasen).mount('#main'); From 601c4367dccad16d497940aede1d358a471f14a6 Mon Sep 17 00:00:00 2001 From: chfhtw Date: Thu, 9 Oct 2025 10:57:51 +0200 Subject: [PATCH 017/152] use fhcApps for CIS --- application/views/templates/CISVUE-Footer.php | 6 +++--- application/views/templates/CISVUE-Header.php | 6 +++--- public/js/apps/Cis.js | 3 +++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/application/views/templates/CISVUE-Footer.php b/application/views/templates/CISVUE-Footer.php index d7c1de24c..48943650d 100644 --- a/application/views/templates/CISVUE-Footer.php +++ b/application/views/templates/CISVUE-Footer.php @@ -5,9 +5,9 @@ $includesArray = array( 'bootstrap5' => true, 'fontawesome6' => true, 'axios027' => true, - 'customJSModules' => array_merge([ - 'public/js/apps/Cis.js' - ], $customJSModules ?? []), + 'fhcApps' => array_merge([ + 'Cis' + ], $fhcApps ?? []), 'customCSSs' => array_merge([ 'public/css/Cis4/Cis.css' ], $customCSSs ?? []) diff --git a/application/views/templates/CISVUE-Header.php b/application/views/templates/CISVUE-Header.php index 358fc75c9..943d26d80 100644 --- a/application/views/templates/CISVUE-Header.php +++ b/application/views/templates/CISVUE-Header.php @@ -7,9 +7,9 @@ $includesArray = array( 'fontawesome6' => true, 'axios027' => true, 'primevue3' => true, - 'customJSModules' => array_merge([ - 'public/js/apps/Cis.js' - ], $customJSModules ?? []), + 'fhcApps' => array_merge([ + 'Cis' + ], $fhcApps ?? []), 'customCSSs' => array_merge([ 'public/css/Cis4/Cis.css', $this->config->item('theme_css'), diff --git a/public/js/apps/Cis.js b/public/js/apps/Cis.js index 5b76c5721..c88a47a35 100644 --- a/public/js/apps/Cis.js +++ b/public/js/apps/Cis.js @@ -142,6 +142,9 @@ const app = Vue.createApp({ } } }); + +FhcApps.makeExtendable(app); + app.use(primevue.config.default, { zIndex: { overlay: 9000, From 0b6dc342207c4a908d7bedb68f9e75a8d8f723fc Mon Sep 17 00:00:00 2001 From: Paolo Date: Mon, 10 Nov 2025 15:41:01 +0100 Subject: [PATCH 018/152] If docsbox queue is slow, the DocsboxLib can stop checking the queued document status and raise an error --- application/libraries/DocsboxLib.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/libraries/DocsboxLib.php b/application/libraries/DocsboxLib.php index f9167c379..31169d579 100644 --- a/application/libraries/DocsboxLib.php +++ b/application/libraries/DocsboxLib.php @@ -157,6 +157,8 @@ class DocsboxLib ->expectsJson() ->send(); + error_log(print_r($getStatusResponse, 1)); + // Checks that: // - the response is not empty // - the reponse body has the property id @@ -180,7 +182,8 @@ class DocsboxLib } // Just started or still working on it elseif ($getStatusResponse->body->status == self::STATUS_WORKING - || $getStatusResponse->body->status == self::STATUS_STARTED) + || $getStatusResponse->body->status == self::STATUS_STARTED + || $getStatusResponse->body->status == self::STATUS_QUEUED) { // go on! } From 38e8f91fdf404ce565f06205cd567c9bc7d5354b Mon Sep 17 00:00:00 2001 From: ma0068 Date: Tue, 25 Nov 2025 10:48:57 +0100 Subject: [PATCH 019/152] add kurzbzlang to studentDropdown suggestion --- application/models/organisation/Studiengang_model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/models/organisation/Studiengang_model.php b/application/models/organisation/Studiengang_model.php index 02f972690..08f40f6d4 100644 --- a/application/models/organisation/Studiengang_model.php +++ b/application/models/organisation/Studiengang_model.php @@ -594,7 +594,8 @@ class Studiengang_model extends DB_Model $this->addSelect('p.prestudent_id'); $this->addSelect('pers.vorname'); $this->addSelect('pers.nachname'); - $this->addSelect("CONCAT(UPPER(pers.nachname), ' ', pers.vorname, ' (', " . $this->dbTable . ".bezeichnung, ')') AS name"); + $this->addSelect("CONCAT(UPPER(pers.nachname), ' ', pers.vorname, + ' (', " . $this->dbTable . ".bezeichnung, ', ', " . $this->dbTable . ".kurzbzlang,')') AS name"); $this->addJoin('public.tbl_prestudent p', 'studiengang_kz'); $this->addJoin( From 02153e469f9239696520ec0079a9d1085d0ed7c5 Mon Sep 17 00:00:00 2001 From: ma0068 Date: Fri, 19 Dec 2025 11:39:31 +0100 Subject: [PATCH 020/152] Dashboard Admin Cleanup - refactoring Api: FHC-API controller for Edit/Update, widgets and presets - delete dashboard with Prompt - phrases --- .../frontend/v1/dashboard/DashboardAdmin.php | 294 ++++++++++++++++++ .../views/dashboard/dashboard_demo_admin.php | 6 +- .../api/factory/dashboard/dashboardAdmin.js | 85 +++++ ...shboardAdmin.js => DashboardAdmin_DEPR.js} | 0 public/js/components/Dashboard/Admin.js | 83 +++-- public/js/components/Dashboard/Admin/Edit.js | 4 +- .../js/components/Dashboard/Admin/Presets.js | 157 +++++----- .../js/components/Dashboard/Admin/Widgets.js | 34 +- public/js/components/Dashboard/Section.js | 2 +- system/phrasesupdate.php | 121 +++++++ 10 files changed, 664 insertions(+), 122 deletions(-) create mode 100644 application/controllers/api/frontend/v1/dashboard/DashboardAdmin.php create mode 100644 public/js/api/factory/dashboard/dashboardAdmin.js rename public/js/apps/{DashboardAdmin.js => DashboardAdmin_DEPR.js} (100%) diff --git a/application/controllers/api/frontend/v1/dashboard/DashboardAdmin.php b/application/controllers/api/frontend/v1/dashboard/DashboardAdmin.php new file mode 100644 index 000000000..5e5ba4d40 --- /dev/null +++ b/application/controllers/api/frontend/v1/dashboard/DashboardAdmin.php @@ -0,0 +1,294 @@ +. + */ + +if (! defined('BASEPATH')) exit('No direct script access allowed'); + +/** + * This controller operates between (interface) the JS (GUI) and the back-end + * Provides data to the ajax get calls about addresses + * This controller works with JSON calls on the HTTP GET or POST and the output is always JSON + */ +class DashboardAdmin extends FHCAPI_Controller +{ + public function __construct() + { + parent::__construct([ + 'getAllDashboards' => 'dashboard/admin:r', + 'createDashboard' => 'dashboard/admin:rw', + 'updateDashboard' => 'dashboard/admin:rw', + 'deleteDashboard' => 'dashboard/admin:rw', + 'loadWidget' => ['dashboard/benutzer:r', 'dashboard/admin:r'], + 'getAllWidgets' => 'dashboard/admin:r', + 'getWidgetsForDashboard' => ['dashboard/benutzer:rw', 'dashboard/admin:r'], + 'setWidgetAllowed' => 'dashboard/admin:rw', + + 'index' => 'dashboard/benutzer:r', + 'dummy' => 'dashboard/benutzer:r', + 'genWidgetId' => 'dashboard/benutzer:rw', + 'addWidgetsToPreset' => 'dashboard/admin:rw', + 'removeWidgetFromPreset' => 'dashboard/admin:rw', + 'addWidgetsToUserOverride' => 'dashboard/benutzer:rw', + 'removeWidgetFromUserOverride' => 'dashboard/benutzer:rw', + 'funktionen' => 'dashboard/admin:r', + 'preset' => 'dashboard/admin:r', + 'presetBatch' => 'dashboard/admin:r' + ]); + + // Load language phrases + $this->loadPhrases([ + 'ui' + ]); + + $this->load->library('dashboard/DashboardLib', null, 'DashboardLib'); + + $this->load->model('dashboard/Dashboard_model', 'DashboardModel'); + $this->load->model('dashboard/Widget_model', 'WidgetModel'); + $this->load->model('dashboard/Dashboard_Widget_model', 'DashboardWidgetModel'); + $this->load->model('ressource/Funktion_model', 'FunktionModel'); + } + + public function getAllDashboards() + { + $result = $this->DashboardModel->load(); + + if (isError($result)) + { + return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); + } + $this->terminateWithSuccess($result); + } + + public function createDashboard() + { + $dashboard_kurzbz = $this->input->post('dashboard_kurzbz'); + $result = $this->DashboardModel->insert( + [ + 'dashboard_kurzbz' => $dashboard_kurzbz + ] + ); + + if (isError($result)) + { + $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); + } + $this->terminateWithSuccess((getData($result) ?: [])); + } + + public function updateDashboard() + { + $dashboard_id = $this->input->post('dashboard_id'); + $dashboard_kurzbz = $this->input->post('dashboard_kurzbz'); + $beschreibung = $this->input->post('beschreibung'); + if(!$dashboard_id) + { + $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Dashboard ID']), self::ERROR_TYPE_GENERAL); + } + + $result = $this->DashboardModel->update( + [ + 'dashboard_id' => $dashboard_id, + ], + [ + 'dashboard_kurzbz' => $dashboard_kurzbz, + 'beschreibung' => $beschreibung, + ] + ); + + if (isError($result)) + { + $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); + } + $this->terminateWithSuccess($result); + } + + public function deleteDashboard() + { + $dashboard_id = $this->input->post('dashboard_id'); + if(!$dashboard_id) + { + return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Dashboard ID']), self::ERROR_TYPE_GENERAL); + } + + //delete all presets + $this->load->model('dashboard/Dashboard_Preset_model', 'DashboardPresetModel'); + $resultPresets = $this->DashboardPresetModel->delete( + array('dashboard_id' => $dashboard_id) + ); + if ($resultPresets === false) + { + return $this->terminateWithError($resultPresets, self::ERROR_TYPE_GENERAL); + } + + //delete all widgets + $this->load->model('dashboard/Dashboard_Widget_model', 'DashboardWidgetModel'); + + $resultWidgets = $this->DashboardWidgetModel->delete( + array('dashboard_id' => $dashboard_id) + ); + if ($resultWidgets === false) + { + return $this->terminateWithError($resultWidgets, self::ERROR_TYPE_GENERAL); + } + + $result = $this->DashboardModel->delete( + array('dashboard_id' => $dashboard_id) + ); + + if (isError($result)) + { + return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); + } + $this->terminateWithSuccess($result); + } + + public function getAllWidgets() + { + $dashboard_id = $this->input->get('dashboard_id'); + if(!$dashboard_id) + { + return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Dashboard ID']), self::ERROR_TYPE_GENERAL); + } + //$this->terminateWithError($dashboard_id); + $result = $this->WidgetModel->getWithAllowedForDashboard($dashboard_id); + + if (isError($result)) + $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); + + $this->terminateWithSuccess(getData($result) ?: []); + } + + public function setWidgetAllowed() + { + $dashboard_id = $this->input->post('dashboard_id'); + $widget_id = $this->input->post('widget_id'); + $action = $this->input->post('action'); + + if ($action == 'add') + { + $result = $this->DashboardWidgetModel->insert([ + 'dashboard_id' => $dashboard_id, + 'widget_id' => $widget_id + ]); + } + elseif ($action == 'delete') + { + $result = $this->DashboardWidgetModel->delete([ + 'dashboard_id' => $dashboard_id, + 'widget_id' => $widget_id + ]); + } + else + { + $this->terminateWithError("action value invalid", self::ERROR_TYPE_GENERAL); + } + if (isError($result)) + $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); + + $this->terminateWithSuccess(getData($result) ?: []); + } + + //Presets + public function funktionen() + { + $result = $this->FunktionModel->load(); + + if (isError($result)) + $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); + + $this->terminateWithSuccess(getData($result) ?: []); + } + + public function addWidgetsToPreset() + { + $raw = $this->input->raw_input_stream; + $json = json_decode($raw); + + $dashboard_kurzbz = $json->db; + $funktion_kurzbz = $json->funktion_kurzbz; + $widgets = $json->widgets; + + $preset = $this->DashboardLib->getPresetOrCreateEmptyPreset($dashboard_kurzbz, $funktion_kurzbz); + + $preset_decoded = json_decode($preset->preset, true); + $this->DashboardLib->addWidgetsToWidgets($preset_decoded, $dashboard_kurzbz, $funktion_kurzbz, $widgets); + + $preset->preset = json_encode($preset_decoded); + $result = $this->DashboardLib->insertOrUpdatePreset($preset); + + if (isError($result)) + $this->terminateWithError($this->p->t('dashboard', 'error_savePreset'), self::ERROR_TYPE_GENERAL); + $this->terminateWithSuccess($preset_decoded); + } + + public function removeWidgetFromPreset() + { + $raw = $this->input->raw_input_stream; + $json = json_decode($raw); + + $dashboard_kurzbz = $json->db; + $funktion_kurzbz = $json->funktion_kurzbz; + $widgetid = $json->widgetid; + + $preset = $this->DashboardLib->getPreset($dashboard_kurzbz, $funktion_kurzbz); + if ($preset === null) + { + $this->terminateWithError($this->p->t('ui', 'error_presetAndFunctionNotFound', ['dashboard'=> $dashboard_kurzbz, 'funktion'=> $funktion_kurzbz]), self::ERROR_TYPE_GENERAL); + } + + $preset_decoded = json_decode($preset->preset, true); + if (!$this->DashboardLib->removeWidgetFromWidgets($preset_decoded, $funktion_kurzbz, $widgetid)) + { + $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Widget ID']), self::ERROR_TYPE_GENERAL); + } + + $preset->preset = json_encode($preset_decoded); + $result = $this->DashboardLib->insertOrUpdatePreset($preset); + if (isError($result)) + { + $this->terminateWithError($this->p->t('dashboard', 'error_deleteWidget'), self::ERROR_TYPE_GENERAL); + } + $this->terminateWithSuccess(array('msg' => $this->p->t('dashboard', 'success_savePreset'))); + } + + public function presetBatch() + { + $db = $this->input->get('db'); + $funktionen = $this->input->get('funktionen'); + $result = []; + + if($funktionen) + { + foreach ($funktionen as $funktion) { + $conf = $this->DashboardLib->getPreset($db, $funktion); + if ($conf) { + $preset = json_decode($conf->preset, true); + if (!isset($preset[$funktion]) || !isset($preset[$funktion]['widgets'])) + $result[$funktion] = []; + else { + $result[$funktion] = $preset[$funktion]['widgets']; + } + } else + $result[$funktion] = []; + } + } + else + $result = []; + + return $this->terminateWithSuccess($result); + } +} diff --git a/application/views/dashboard/dashboard_demo_admin.php b/application/views/dashboard/dashboard_demo_admin.php index 0d92146a8..b57a2bfa0 100644 --- a/application/views/dashboard/dashboard_demo_admin.php +++ b/application/views/dashboard/dashboard_demo_admin.php @@ -8,9 +8,11 @@ $this->load->view( 'axios027' => true, 'restclient' => true, 'vue3' => true, - 'customJSModules' => ['public/js/apps/DashboardAdmin.js'], + 'primevue3' => true, + 'customJSModules' => ['public/js/apps/Dashboard/Admin.js'], 'customCSSs' => [ - 'public/css/components/dashboard.css' + 'public/css/components/dashboard.css', + 'public/css/components/primevue.css', ], 'navigationcomponent' => true ) diff --git a/public/js/api/factory/dashboard/dashboardAdmin.js b/public/js/api/factory/dashboard/dashboardAdmin.js new file mode 100644 index 000000000..a672460e4 --- /dev/null +++ b/public/js/api/factory/dashboard/dashboardAdmin.js @@ -0,0 +1,85 @@ +/* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +export default { + addDashboard(params) { + return { + method: 'post', + url: 'api/frontend/v1/dashboard/DashboardAdmin/createDashboard', + params + }; + }, + updateDashboard(params) { + return { + method: 'post', + url: 'api/frontend/v1/dashboard/DashboardAdmin/updateDashboard', + params + }; + }, + deleteDashboard(dashboard_id) { + return { + method: 'post', + url: 'api/frontend/v1/dashboard/DashboardAdmin/deleteDashboard', + params: { dashboard_id } + }; + }, + getAllDashboards(){ + return { + method: 'get', + url: 'api/frontend/v1/dashboard/DashboardAdmin/getAllDashboards' + }; + }, + getAllWidgets(dashboard_id){ + return { + method: 'get', + url: 'api/frontend/v1/dashboard/DashboardAdmin/getAllWidgets', + params: {dashboard_id} + }; + }, + setWidgetAllowed(params){ + return { + method: 'post', + url: 'api/frontend/v1/dashboard/DashboardAdmin/setWidgetAllowed', + params + }; + }, + loadFunktionen(){ + return { + method: 'get', + url: 'api/frontend/v1/dashboard/DashboardAdmin/funktionen' + }; + }, + addWidgetsToPreset(params){ + return { + method: 'post', + url: 'api/frontend/v1/dashboard/DashboardAdmin/addWidgetsToPreset', + params + }; + }, + removeWidgetFromPreset(params){ + return { + method: 'post', + url: 'api/frontend/v1/dashboard/DashboardAdmin/removeWidgetFromPreset', + params + }; + }, + presetBatch(params){ + return { + method: 'get', + url: 'api/frontend/v1/dashboard/DashboardAdmin/presetBatch', + params + }; + }, +} \ No newline at end of file diff --git a/public/js/apps/DashboardAdmin.js b/public/js/apps/DashboardAdmin_DEPR.js similarity index 100% rename from public/js/apps/DashboardAdmin.js rename to public/js/apps/DashboardAdmin_DEPR.js diff --git a/public/js/components/Dashboard/Admin.js b/public/js/components/Dashboard/Admin.js index f1a837880..b35346fb5 100644 --- a/public/js/components/Dashboard/Admin.js +++ b/public/js/components/Dashboard/Admin.js @@ -3,11 +3,14 @@ import DashboardAdminEdit from "./Admin/Edit.js"; import DashboardAdminWidgets from "./Admin/Widgets.js"; import DashboardAdminPresets from "./Admin/Presets.js"; +import ApiDashboardAdmin from "../../api/factory/dashboard/dashboardAdmin.js"; + export default { + name: 'DashboardAdmin', components: { DashboardAdminEdit, DashboardAdminWidgets, - DashboardAdminPresets + DashboardAdminPresets, }, provide() { return { @@ -22,9 +25,6 @@ export default { }; }, computed: { - apiurl() { - return FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/dashboard'; - }, dashboard() { return this.dashboards.find(el => el.dashboard_id == this.current); } @@ -35,33 +35,49 @@ export default { BsPrompt.popup('New Dashboard name').then( name => { _name = name; - return axios.post(this.apiurl + '/Dashboard/create', { + const params = { dashboard_kurzbz: name - }) - } - ).then(res => { - let newDashboard = { - dashboard_id: res.data.retval, - dashboard_kurzbz: _name, - beschreibung: '' - }; - this.dashboards.push(newDashboard); - this.current = newDashboard.dashboard_id; - }).catch(err => err !== undefined ? console.error('ERROR:', err) : 0); + }; + return this.$api + .call(ApiDashboardAdmin.addDashboard(params)) + .then(response =>{ + this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave')); //TODO(Manu) phrase here working + + let newDashboard = { + dashboard_id: response.data, + dashboard_kurzbz: _name, + beschreibung: '' + }; + this.dashboards.push(newDashboard); + this.current = newDashboard.dashboard_id; + }) + .catch(this.$fhcAlert.handleSystemError); + }); }, dashboardUpdate(dashboard) { - // TODO(chris): Loading or message - axios.post(this.apiurl + '/Dashboard/update', dashboard).then(() => { - let old = this.dashboards.find(el => el.dashboard_id == dashboard.dashboard_id); - old.dashboard_kurzbz = dashboard.dashboard_kurzbz; - old.beschreibung = dashboard.beschreibung; - }).catch(err => console.error('ERROR:', err)); + return this.$api + .call(ApiDashboardAdmin.updateDashboard(dashboard)) + .then(response =>{ + this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave')); //TODO(Manu) phrase here working + + let old = this.dashboards.find(el => el.dashboard_id == dashboard.dashboard_id); + old.dashboard_kurzbz = dashboard.dashboard_kurzbz; + old.beschreibung = dashboard.beschreibung; + }) + .catch(this.$fhcAlert.handleSystemError); }, dashboardDelete(dashboard_id) { - axios.post(this.apiurl + '/Dashboard/delete', {dashboard_id}).then(() => { - this.current = -1; - this.dashboards = this.dashboards.filter(el => el.dashboard_id != dashboard_id); - }).catch(err => console.error('ERROR:', err)); + return this.$api + .call(ApiDashboardAdmin.deleteDashboard(dashboard_id)) + .then(response => { + this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete')); //TODO(Manu) phrase here NOT always working + + }) + .catch(this.$fhcAlert.handleSystemError) + .finally(() => { + this.current = -1; + this.dashboards = this.dashboards.filter(el => el.dashboard_id != dashboard_id); + }); }, assignWidgets(widgets) { this.widgets = widgets; @@ -72,18 +88,23 @@ export default { } }, created() { - axios.get(this.apiurl + '/Dashboard').then(res => { - this.dashboards = res.data.retval; - }).catch(err => console.error('ERROR:', err)); + this.$api + .call(ApiDashboardAdmin.getAllDashboards()) + .then(result => { + this.dashboards = result.data.retval; + }) + .catch(this.$fhcAlert.handleSystemError); }, template: `
+
- -
+