From f95c5ec7cf4bc44fe97638dd86017dafbe34e8c5 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Wed, 7 Jun 2023 19:25:23 +0200 Subject: [PATCH] added overview for editing Bismeldestichtage --- .../components/filters/Bismeldestichtag.php | 17 +++++++ .../controllers/codex/Bismeldestichtag.php | 44 ++++++++++++++++++ application/views/codex/bismeldestichtag.php | 41 +++++++++++++++++ .../apps/Bismeldestichtag/Bismeldestichtag.js | 43 +++++++++++++++++ .../apps/Bismeldestichtag/TabulatorSetup.js | 46 +++++++++++++++++++ system/filtersupdate.php | 19 ++++++++ 6 files changed, 210 insertions(+) create mode 100644 application/components/filters/Bismeldestichtag.php create mode 100644 application/controllers/codex/Bismeldestichtag.php create mode 100644 application/views/codex/bismeldestichtag.php create mode 100644 public/js/apps/Bismeldestichtag/Bismeldestichtag.js create mode 100644 public/js/apps/Bismeldestichtag/TabulatorSetup.js diff --git a/application/components/filters/Bismeldestichtag.php b/application/components/filters/Bismeldestichtag.php new file mode 100644 index 000000000..d7900a9b1 --- /dev/null +++ b/application/components/filters/Bismeldestichtag.php @@ -0,0 +1,17 @@ + 'core', + 'datasetName' => 'bismeldestichtag', + 'query' => ' + SELECT + bmt.meldestichtag_id AS "Id", + bmt.meldestichtag AS "Meldestichtag", + bmt.studiensemester_kurzbz AS "Studiensemester" + FROM + bis.tbl_bismeldestichtag bmt + ORDER BY + meldestichtag DESC, meldestichtag_id DESC + ', + 'requiredPermissions' => 'admin' + ); + diff --git a/application/controllers/codex/Bismeldestichtag.php b/application/controllers/codex/Bismeldestichtag.php new file mode 100644 index 000000000..3c76486ca --- /dev/null +++ b/application/controllers/codex/Bismeldestichtag.php @@ -0,0 +1,44 @@ + 'admin:r' + ) + ); + + // Loads WidgetLib + $this->load->library('WidgetLib'); + + // Loads phrases system + $this->loadPhrases( + array( + 'global', + 'ui', + 'filter' + ) + ); + } + + // ----------------------------------------------------------------------------------------------------------------- + // Public methods + + /** + * Everything has a beginning + */ + public function index() + { + $this->load->view('codex/bismeldestichtag.php'); + } +} diff --git a/application/views/codex/bismeldestichtag.php b/application/views/codex/bismeldestichtag.php new file mode 100644 index 000000000..cb4b1de7f --- /dev/null +++ b/application/views/codex/bismeldestichtag.php @@ -0,0 +1,41 @@ + 'Logs Viewer', + 'axios027' => true, + 'bootstrap5' => true, + 'fontawesome6' => true, + 'vue3' => true, + 'filtercomponent' => true, + 'navigationcomponent' => true, + 'tabulator5' => true, + 'phrases' => array( + 'global' => array('mailAnXversandt'), + 'ui' => array('bitteEintragWaehlen') + ), + 'customJSModules' => array('public/js/apps/Bismeldestichtag/Bismeldestichtag.js') + ); + + $this->load->view('templates/FHC-Header', $includesArray); +?> + +
+ + + + +
+
+ + + +
+
+
+ +load->view('templates/FHC-Footer', $includesArray); ?> + diff --git a/public/js/apps/Bismeldestichtag/Bismeldestichtag.js b/public/js/apps/Bismeldestichtag/Bismeldestichtag.js new file mode 100644 index 000000000..f2be375b9 --- /dev/null +++ b/public/js/apps/Bismeldestichtag/Bismeldestichtag.js @@ -0,0 +1,43 @@ +/** + * Copyright (C) 2022 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 . + */ + +import {BismeldestichtagTabulatorOptions} from './TabulatorSetup.js'; +import {BismeldestichtagTabulatorEventHandlers} from './TabulatorSetup.js'; + +import {CoreFilterCmpt} from '../../components/filter/Filter.js'; +import {CoreNavigationCmpt} from '../../components/navigation/Navigation.js'; + +const bismeldestichtagApp = Vue.createApp({ + data: function() { + return { + appSideMenuEntries: {}, + bismeldestichtagTabulatorOptions: BismeldestichtagTabulatorOptions, + bismeldestichtagTabulatorEventHandlers: BismeldestichtagTabulatorEventHandlers + }; + }, + components: { + CoreNavigationCmpt, + CoreFilterCmpt + }, + methods: { + newSideMenuEntryHandler: function(payload) { + this.appSideMenuEntries = payload; + } + } +}); + +bismeldestichtagApp.mount('#main'); diff --git a/public/js/apps/Bismeldestichtag/TabulatorSetup.js b/public/js/apps/Bismeldestichtag/TabulatorSetup.js new file mode 100644 index 000000000..eb63b8eed --- /dev/null +++ b/public/js/apps/Bismeldestichtag/TabulatorSetup.js @@ -0,0 +1,46 @@ +/** + * Copyright (C) 2022 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 . + */ + +/** + * + */ +export const BismeldestichtagTabulatorOptions = { + height: 700, + layout: 'fitColumns', + columns: [ + {title: 'ID', field: 'Id', headerFilter: true}, + {title: 'Meldestichtag', field: 'Meldestichtag', headerFilter: true}, + {title: 'Studiensemester', field: 'Studiensemester', headerFilter: true} + ], + rowFormatter: function(row) { + + let data = row.getData(); // get data for this row + } +}; + +/** + * + */ +export const BismeldestichtagTabulatorEventHandlers = [ + { + event: "rowClick", + handler: function(e, row) { + alert(row.getData().Data); + } + } +]; + diff --git a/system/filtersupdate.php b/system/filtersupdate.php index 241e44f2f..d71d8ea33 100644 --- a/system/filtersupdate.php +++ b/system/filtersupdate.php @@ -1256,6 +1256,25 @@ $filters = array( } ', 'oe_kurzbz' => null, + ), + array( + 'app' => 'core', + 'dataset_name' => 'bismeldestichtag', + 'filter_kurzbz' => 'bismeldestichtag', + 'description' => '{Bismeldestichtage verwalten}', + 'sort' => 1, + 'default_filter' => true, + 'filter' => ' + { + "name": "bismeldestichtag", + "columns": [ + {"name": "Meldestichtag"}, + {"name": "Studiensemester"} + ], + "filters": [] + } + ', + 'oe_kurzbz' => null, ) );