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
This commit is contained in:
ma0068
2025-07-01 14:32:33 +02:00
parent 98f1cd7465
commit c353e854e8
6 changed files with 77 additions and 8 deletions
@@ -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);
}
}
@@ -0,0 +1,14 @@
<?php
class Anrechnunganrechnungstatus_model extends DB_Model
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->dbTable = 'lehre.tbl_anrechnung_anrechnungstatus';
$this->pk = 'anrechnungstatus_id';
}
}
+2 -1
View File
@@ -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;
}
+21 -1
View File
@@ -3,4 +3,24 @@
}
.notizText {
color: darkblue;
}
}
/* 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%;
}
+15 -4
View File
@@ -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(() => {
@@ -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 {
<h5>{{$p.t('lehre', 'anrechnungen')}}</h5>
<div v-if="showNotizen" class="border p-3 overflow-auto" style="height: 200px;">
<div class="justify-content-end pb-3">
<!-- <div class="justify-content-end pb-3">
<form-input
container-class="form-switch"
type="checkbox"
@@ -312,7 +316,10 @@ export default {
@change="onSwitchHide"
>
</form-input>
</div>
</div> -->
<h6><strong>LV {{formData.lehrveranstaltung_id}}:
{{formData.bezeichnung}} | {{formData.bezeichnung_english}}</strong></h6>
<core-notiz
:endpoint="endpoint"
ref="formNotes"
@@ -322,6 +329,7 @@ export default {
show-document
show-tiny-mce
:visibleColumns="['titel','text','verfasser','bearbeiter','dokumente']"
@reload="handleReload"
>
</core-notiz>