From c353e854e8cacffc2490db255932ec87c1f9be1e Mon Sep 17 00:00:00 2001 From: ma0068 Date: Tue, 1 Jul 2025 14:32:33 +0200 Subject: [PATCH] Tab Anrechnungen/Exemptions - bugfix handle overflow in textfield of Notiz - bugfix delete: remove anrechnung_id also from lehre.tbl_anrechnung_anrechnungstatus - redesign Notizen of Anrechnungen: header with title Lehrveranstaltungen - add reload functionality to update count of notizen in action buttons --- .../api/frontend/v1/stv/Anrechnungen.php | 15 +++++++++++++ .../Anrechnunganrechnungstatus_model.php | 14 ++++++++++++ public/css/Studentenverwaltung.css | 3 ++- public/css/components/Notiz.css | 22 ++++++++++++++++++- public/js/components/Notiz/Notiz.js | 19 ++++++++++++---- .../Details/Anrechnungen/Anrechnungen.js | 12 ++++++++-- 6 files changed, 77 insertions(+), 8 deletions(-) create mode 100644 application/models/education/Anrechnunganrechnungstatus_model.php diff --git a/application/controllers/api/frontend/v1/stv/Anrechnungen.php b/application/controllers/api/frontend/v1/stv/Anrechnungen.php index 85019334f..251e2d5bd 100644 --- a/application/controllers/api/frontend/v1/stv/Anrechnungen.php +++ b/application/controllers/api/frontend/v1/stv/Anrechnungen.php @@ -157,6 +157,7 @@ class Anrechnungen extends FHCAPI_Controller public function loadAnrechnung($anrechnung_id) { + $this->AnrechnungsModel->addJoin('lehre.tbl_lehrveranstaltung lv', 'ON (lv.lehrveranstaltung_id = lehre.tbl_anrechnung.lehrveranstaltung_id)'); $result = $this->AnrechnungsModel->loadWhere( array('anrechnung_id' => $anrechnung_id) ); @@ -231,11 +232,25 @@ class Anrechnungen extends FHCAPI_Controller public function deleteAnrechnung($anrechnung_id) { + // Start DB transaction + $this->db->trans_begin(); + + //delete anrechnung_id of table tbl_anrechnung_anrechnungstatus + $this->load->model('education/Anrechnunganrechnungstatus_model','AnrechnungAnrechnungstatusModel'); + $result = $this->AnrechnungAnrechnungstatusModel->delete( + array('anrechnung_id' => $anrechnung_id) + ); + $this->getDataOrTerminateWithError($result); + + //delete anrechnung_id of table tbl_anrechnung $result = $this->AnrechnungsModel->delete( array('anrechnung_id' => $anrechnung_id) ); $data = $this->getDataOrTerminateWithError($result); + + $this->db->trans_commit(); + $this->terminateWithSuccess($data); } } diff --git a/application/models/education/Anrechnunganrechnungstatus_model.php b/application/models/education/Anrechnunganrechnungstatus_model.php new file mode 100644 index 000000000..68b319506 --- /dev/null +++ b/application/models/education/Anrechnunganrechnungstatus_model.php @@ -0,0 +1,14 @@ +dbTable = 'lehre.tbl_anrechnung_anrechnungstatus'; + $this->pk = 'anrechnungstatus_id'; + } +} diff --git a/public/css/Studentenverwaltung.css b/public/css/Studentenverwaltung.css index d39cfc9b1..0b62e2809 100644 --- a/public/css/Studentenverwaltung.css +++ b/public/css/Studentenverwaltung.css @@ -58,7 +58,8 @@ html { overflow: visible !important; } -.tabulator-cell { +/* to avoid interference with Notiz.css and overflow for textfield */ +.stv-details-abschlusspruefung .tabulator-cell { overflow: visible !important; } diff --git a/public/css/components/Notiz.css b/public/css/components/Notiz.css index 75c69ec80..badfa4538 100644 --- a/public/css/components/Notiz.css +++ b/public/css/components/Notiz.css @@ -3,4 +3,24 @@ } .notizText { color: darkblue; -} \ No newline at end of file +} + +/* Enforce content clipping in the scrollable section */ +.tabulator .tabulator-tableHolder { + overflow-x: hidden; + position: relative; +} + +.tabulator .tabulator-table { + overflow-x: hidden; + table-layout: fixed; + width: 100%; +} + +.tabulator .tabulator-cell { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: 100%; +} + diff --git a/public/js/components/Notiz/Notiz.js b/public/js/components/Notiz/Notiz.js index 44cc56374..0d180d2ff 100644 --- a/public/js/components/Notiz/Notiz.js +++ b/public/js/components/Notiz/Notiz.js @@ -81,6 +81,7 @@ export default { title: "Text", field: "text_stripped", width: 250, + clipContents: true, tooltip:function(e, cell, onRendered){ var el = document.createElement("div"); el.style.backgroundColor = "white"; @@ -174,6 +175,7 @@ export default { }], layout: 'fitColumns', layoutColumnsOnNewData: false, + responsiveLayout: "collapse", height: '250', selectableRangeMode: 'click', selectable: true, @@ -200,10 +202,6 @@ export default { title: this.$p.t('global', 'titel'), //visible: this.showVariables.showTitel }); - cm.getColumnByField('text_stripped').component.updateDefinition({ - title: this.$p.t('global', 'text'), - //visible: this.showVariables.showText - }); cm.getColumnByField('bearbeiter').component.updateDefinition({ title: this.$p.t('notiz', 'bearbeiter'), visible: this.showVariables.showBearbeiter @@ -250,6 +248,16 @@ export default { cm.getColumnByField('actions').component.updateDefinition({ title: this.$p.t('global', 'aktionen') }); + + cm.getColumnByField('text_stripped').component.updateDefinition({ + title: this.$p.t('global', 'text'), + width: 250, + tooltip: true, + clipContents: true, + }); + + // Force layout recalculation for handling overflow text + this.$refs.table.tabulator.redraw(true); } } ], @@ -355,6 +363,7 @@ export default { this.$refs.NotizModal.hide(); } this.reload(); + this.$emit('reload'); }) .catch(this.$fhcAlert.handleSystemError) .finally(() => { @@ -367,6 +376,7 @@ export default { .then(result => { this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete')); this.reload(); + this.$emit('reload'); this.resetFormData(); }) .catch(this.$fhcAlert.handleSystemError) @@ -410,6 +420,7 @@ export default { this.$refs.NotizModal.hide(); } this.reload(); + this.$emit('reload'); }) .catch(this.$fhcAlert.handleSystemError) .finally(() => { diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Anrechnungen/Anrechnungen.js b/public/js/components/Stv/Studentenverwaltung/Details/Anrechnungen/Anrechnungen.js index 23e3819ff..abe5d177d 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Anrechnungen/Anrechnungen.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Anrechnungen/Anrechnungen.js @@ -182,6 +182,7 @@ export default { }, addNote(anrechnung_id){ this.currentAnrechnung_id = anrechnung_id; + this.loadAnrechnung(this.currentAnrechnung_id); this.showNotizen = true; }, addNewAnrechnung(){ @@ -266,6 +267,9 @@ export default { reload() { this.$refs.table.reloadTable(); }, + handleReload(){ + this.reload(); + }, resetForm(){ this.formData = {}; this.statusNew = true; @@ -303,7 +307,7 @@ export default {
{{$p.t('lehre', 'anrechnungen')}}
-
+ +
LV {{formData.lehrveranstaltung_id}}: + {{formData.bezeichnung}} | {{formData.bezeichnung_english}}
+