From f03411c668ac00238e8cb79f122b1009bd2c8ba6 Mon Sep 17 00:00:00 2001 From: Johann Hoffmann Date: Wed, 8 Oct 2025 17:41:00 +0200 Subject: [PATCH] legacy cis abgabetool routes; abgabetool.css for legacy cis; endupload & fixtermin logic enabled; paabgabe template rearranged; legacy view, controller has cis4 switch; viewData & router props workaround with CI3 router logic; wrapper app legacy cis; fix enduplaod validation; --- application/config/routes.php | 5 + application/controllers/Cis/Abgabetool.php | 28 ++- .../controllers/api/frontend/v1/Abgabe.php | 7 +- application/views/Cis/Abgabetool.php | 39 ++++ public/css/Cis4/Cis.css | 2 +- public/css/components/abgabetool/abgabe.css | 19 ++ public/js/apps/Abgabetool/Abgabetool.js | 61 +++++++ .../Cis/Abgabetool/AbgabeMitarbeiterDetail.js | 86 +++++---- .../Cis/Abgabetool/AbgabeStudentDetail.js | 17 +- .../Cis/Abgabetool/AbgabetoolMitarbeiter.js | 2 +- .../Cis/Abgabetool/AbgabetoolStudent.js | 4 +- .../Cis/Abgabetool/DeadlineOverview.js | 2 +- system/phrasesupdate.php | 168 +++++++++++++----- 13 files changed, 334 insertions(+), 106 deletions(-) create mode 100644 application/views/Cis/Abgabetool.php create mode 100644 public/js/apps/Abgabetool/Abgabetool.js diff --git a/application/config/routes.php b/application/config/routes.php index de8e6e098..9a3651f24 100644 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -65,6 +65,11 @@ $route['Cis/LvPlan/.*'] = 'Cis/LvPlan/index/$1'; $route['Cis/MyLvPlan/.*'] = 'Cis/MyLvPlan/index/$1'; $route['Cis/MyLv/.*'] = 'Cis/MyLv/index/$1'; +$route['Abgabetool/Mitarbeiter'] = 'Cis/Abgabetool/Mitarbeiter'; +$route['Abgabetool/Student'] = 'Cis/Abgabetool/Student'; +$route['Abgabetool/Student/.*'] = 'Cis/Abgabetool/Student/$1'; +$route['Abgabetool/Deadlines'] = 'Cis/Abgabetool/Deadlines'; + // Studierendenverwaltung List Routes $route['api/frontend/v1/stv/[sS]tudents/inout'] = 'api/frontend/v1/stv/Students/index'; $route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})'] = 'api/frontend/v1/stv/Students/index'; diff --git a/application/controllers/Cis/Abgabetool.php b/application/controllers/Cis/Abgabetool.php index 269496738..35970b6e9 100644 --- a/application/controllers/Cis/Abgabetool.php +++ b/application/controllers/Cis/Abgabetool.php @@ -34,17 +34,27 @@ class Abgabetool extends Auth_Controller 'uid'=>getAuthUID(), ); - $this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'Abgabetool']); + if(defined('CIS4') && CIS4) { + $this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'Abgabetool']); + } else { + $this->load->view('Cis/Abgabetool.php', ['uid' => getAuthUID(), 'route' => 'Abgabetool']); + } } - public function Student() + public function Student($student_uid_prop = '') { $viewData = array( 'uid'=>getAuthUID(), ); - $this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'AbgabetoolStudent']); + + + if(defined('CIS4') && CIS4) { + $this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'AbgabetoolStudent']); + } else { + $this->load->view('Cis/Abgabetool.php', ['uid' => getAuthUID(), 'route' => 'AbgabetoolStudent', 'student_uid_prop' => $student_uid_prop]); + } } public function Mitarbeiter() @@ -54,7 +64,11 @@ class Abgabetool extends Auth_Controller 'uid'=>getAuthUID(), ); - $this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'AbgabetoolMitarbeiter']); + if(defined('CIS4') && CIS4) { + $this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'AbgabetoolMitarbeiter']); + } else { + $this->load->view('Cis/Abgabetool.php', ['uid' => getAuthUID(), 'route' => 'AbgabetoolMitarbeiter']); + } } public function Deadlines() @@ -64,7 +78,11 @@ class Abgabetool extends Auth_Controller 'uid'=>getAuthUID(), ); - $this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'DeadlinesOverview']); + if(defined('CIS4') && CIS4) { + $this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'DeadlinesOverview']); + } else { + $this->load->view('Cis/Abgabetool.php', ['uid' => getAuthUID(), 'route' => 'DeadlinesOverview']); + } } diff --git a/application/controllers/api/frontend/v1/Abgabe.php b/application/controllers/api/frontend/v1/Abgabe.php index f95655a1d..9be560034 100644 --- a/application/controllers/api/frontend/v1/Abgabe.php +++ b/application/controllers/api/frontend/v1/Abgabe.php @@ -109,8 +109,9 @@ class Abgabe extends FHCAPI_Controller $this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel'); $this->load->model('education/Projektarbeit_model', 'ProjektarbeitModel'); - if (!isset($uid) || isEmptyString($uid)) - $this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general'); + if (!isset($uid) || isEmptyString($uid)) { + $uid = getAuthUID(); + } $isZugeteilterBetreuer = count($this->ProjektarbeitModel->checkZuordnung($uid, getAuthUID())->retval) > 0; $this->addMeta('isZugeteilterBetreuer', $isZugeteilterBetreuer); @@ -779,7 +780,7 @@ class Abgabe extends FHCAPI_Controller // Mail an Student wenn Qualgate negativ beurteilt wurde $this->load->model('crm/Student_model', 'StudentModel'); - $result = $this->StudentModel->load($paabgabe->paabgabetyp_kurzbz); + $result = $this->StudentModel->load([$student_uid]); $studentArr = $this->getDataOrTerminateWithError($result); $student = $studentArr[0]; diff --git a/application/views/Cis/Abgabetool.php b/application/views/Cis/Abgabetool.php new file mode 100644 index 000000000..1b1994e0a --- /dev/null +++ b/application/views/Cis/Abgabetool.php @@ -0,0 +1,39 @@ + 'Cis4', + 'axios027' => true, + 'bootstrap5' => true, + 'fontawesome6' => true, + 'tabulator5' => true, // TODO: upgrade to 6 when available + 'vue3' => true, + 'primevue3' => true, + 'skipID' => '#fhccontent', + 'vuedatepicker11' => true, + 'customCSSs' => array( + 'public/css/components/verticalsplit.css', + 'public/css/components/FilterComponent.css', + 'public/css/components/FormUnderline.css', + 'public/css/theme/default.css', + 'public/css/components/abgabetool/abgabe.css' + ), + 'customJSs' => array( + 'vendor/npm-asset/primevue/accordion/accordion.min.js', + 'vendor/npm-asset/primevue/accordiontab/accordiontab.min.js', + 'vendor/npm-asset/primevue/checkbox/checkbox.min.js', + 'vendor/npm-asset/primevue/inputnumber/inputnumber.min.js', + 'vendor/npm-asset/primevue/speeddial/speeddial.min.js', + 'vendor/npm-asset/primevue/textarea/textarea.min.js', + ), + 'customJSModules' => array( + 'public/js/apps/Abgabetool/Abgabetool.js', + ), + +); + +$this->load->view('templates/FHC-Header', $includesArray); +?> +
uid= student_uid_prop=> + +
+load->view('templates/FHC-Footer', $includesArray); ?> diff --git a/public/css/Cis4/Cis.css b/public/css/Cis4/Cis.css index 3056d36b6..05a63bb3a 100644 --- a/public/css/Cis4/Cis.css +++ b/public/css/Cis4/Cis.css @@ -844,7 +844,7 @@ html { #cis-main .modal-header{ background-color: var(--fhc-primary); - color: var(--fhc-light); + color: var(--fhc-white-50); } #cis-main .modal-header .btn-close{ diff --git a/public/css/components/abgabetool/abgabe.css b/public/css/components/abgabetool/abgabe.css index c9de223fd..ab91d8d2f 100644 --- a/public/css/components/abgabetool/abgabe.css +++ b/public/css/components/abgabetool/abgabe.css @@ -138,3 +138,22 @@ box-shadow: 0 2px 6px rgba(0,0,0,0.12); } +#abgabetoolroot .modal-header{ + background-color: var(--fhc-blue-primary); + color: var(--fhc-white-50); +} + +#abgabetoolroot .modal-header .btn-close{ + filter: invert(1); +} + +#abgabetoolroot .modal-footer { + background-color: var(--fhc-white-20); + +} + +.bordered-modal { + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 0.5rem; + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25); +} diff --git a/public/js/apps/Abgabetool/Abgabetool.js b/public/js/apps/Abgabetool/Abgabetool.js new file mode 100644 index 000000000..1336276af --- /dev/null +++ b/public/js/apps/Abgabetool/Abgabetool.js @@ -0,0 +1,61 @@ +import PluginsPhrasen from '../../plugins/Phrasen.js'; +import AbgabetoolStudent from "../../components/Cis/Abgabetool/AbgabetoolStudent.js"; +import AbgabetoolMitarbeiter from "../../components/Cis/Abgabetool/AbgabetoolMitarbeiter.js"; +import DeadlineOverview from "../../components/Cis/Abgabetool/DeadlineOverview.js"; + +const app = Vue.createApp({ + name: 'AbgabetoolApp', + components: { + AbgabetoolStudent, + AbgabetoolMitarbeiter, + DeadlineOverview + }, + data: function() { + return { + comp: null, + uid: null, + student_uid: null + }; + }, + methods: { + + }, + computed: { + viewData() { + return { uid: this.uid} + }, + student_uid_computed() { + return this.student_uid ?? null + } + }, + created() { + }, + mounted() { + + const root = document.getElementById('abgabetoolroot') + const route = root.getAttribute("route"); + this.comp = route + + const uid = root.getAttribute("uid"); + this.uid = uid + + const student_uid = root.getAttribute("student_uid_prop"); + this.student_uid = student_uid + + }, + template: ` + + ` +}); +app.use(primevue.config.default, { + zIndex: { + overlay: 9000, + tooltip: 8000 + } +}) +app.use(PluginsPhrasen); +app.mount('#abgabetoolroot'); diff --git a/public/js/components/Cis/Abgabetool/AbgabeMitarbeiterDetail.js b/public/js/components/Cis/Abgabetool/AbgabeMitarbeiterDetail.js index 08fc74e04..024aa998b 100644 --- a/public/js/components/Cis/Abgabetool/AbgabeMitarbeiterDetail.js +++ b/public/js/components/Cis/Abgabetool/AbgabeMitarbeiterDetail.js @@ -251,16 +251,7 @@ export const AbgabeMitarbeiterDetail = { return true }, - async handleSaveNewAbgabe(termin) { - - if(!this.validateTermin(termin)) { - this.$fhcAlert.alertWarning('invalid termin') - - return false - } - - await this.saveTermin(termin) - + handleModalClose() { // determined inside saveTermin api.then() if(this.showAutomagicModalPhrase) { this.$refs.modalContainerCreateNewAbgabe.show() @@ -280,7 +271,20 @@ export const AbgabeMitarbeiterDetail = { 'abgabedatum': null, 'insertvon': this.viewData?.uid ?? '' } + } + }, + async handleSaveNewAbgabe(termin) { + + if(!this.validateTermin(termin)) { + this.$fhcAlert.alertWarning('invalid termin') + + return false } + + await this.saveTermin(termin) + + this.handleModalClose() + }, handleChangeAbgabetyp(termin) { // if paabgabetype qualgate is selected, fill out kurzbz textfield with bezeichnung of quality gate so users @@ -321,6 +325,15 @@ export const AbgabeMitarbeiterDetail = { return 'position: static !important;' } }, + watch: { + 'newTermin.bezeichnung'(newVal) { + console.log('\'newTermin.bezeichnung\' watcher', newVal) + + if(newVal?.paabgabetyp_kurzbz === 'qualgate1' || newVal?.paabgabetyp_kurzbz === 'qualgate2') { + this.newTermin.kurzbz = newVal.bezeichnung + } + } + }, created() { }, @@ -344,7 +357,7 @@ export const AbgabeMitarbeiterDetail = {