From 5bda4db59218977c6f2fd95f841092a1eaab14d8 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Fri, 11 Jul 2025 07:33:10 +0200 Subject: [PATCH] unr beim kopieren setzen gruppen anzeige direktinskription rausgefillert datatree aufklappen bug gefixed kurzbz bei den icons statt eigene spalte --- .../api/frontend/v1/lv/Lehreinheit.php | 1 + .../education/Lehreinheitgruppe_model.php | 8 +++++- .../js/components/LVVerwaltung/Setup/Table.js | 28 ++++++++++--------- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/application/controllers/api/frontend/v1/lv/Lehreinheit.php b/application/controllers/api/frontend/v1/lv/Lehreinheit.php index 0c42c0082..d58489453 100644 --- a/application/controllers/api/frontend/v1/lv/Lehreinheit.php +++ b/application/controllers/api/frontend/v1/lv/Lehreinheit.php @@ -215,6 +215,7 @@ class Lehreinheit extends FHCAPI_Controller $lehreinheit_id_new = getData($insert_result); + $this->_ci->LehreinheitModel->update(array('lehreinheit_id' => $lehreinheit_id_new), array('unr' => $lehreinheit_id_new)); if (in_array($art, array('gruppen', 'alle'))) { $gruppen_result = $this->_ci->LehreinheitgruppeModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id)); diff --git a/application/models/education/Lehreinheitgruppe_model.php b/application/models/education/Lehreinheitgruppe_model.php index 8fc8e09f3..bca395f31 100644 --- a/application/models/education/Lehreinheitgruppe_model.php +++ b/application/models/education/Lehreinheitgruppe_model.php @@ -470,6 +470,12 @@ class Lehreinheitgruppe_model extends DB_Model END AS verplant"); $this->addJoin('tbl_studiengang', 'studiengang_kz', 'LEFT'); $this->addJoin('public.tbl_gruppe', 'gruppe_kurzbz', 'LEFT'); - return $this->loadWhere(array('lehreinheit_id' => $lehreinheit_id)); + + $this->db->where('lehreinheit_id', $lehreinheit_id); + $this->db->group_start() + ->where('tbl_gruppe.direktinskription !=', true) + ->or_where('tbl_gruppe.direktinskription IS NULL') + ->group_end(); + return $this->load(); } } diff --git a/public/js/components/LVVerwaltung/Setup/Table.js b/public/js/components/LVVerwaltung/Setup/Table.js index 34a3b3399..a1b2830f1 100644 --- a/public/js/components/LVVerwaltung/Setup/Table.js +++ b/public/js/components/LVVerwaltung/Setup/Table.js @@ -168,7 +168,7 @@ export default { headerFilterFunc: extendedHeaderFilter, }, layout: 'fitDataStretch', - persistenceID: 'lehrveranstaltungen_2025_07_07_v1', + persistenceID: 'lehrveranstaltungen_2025_07_11_v1', selectableRowsRangeMode: 'click', selectableRows: true, rowContextMenu: (component, e) => { @@ -225,11 +225,19 @@ export default { formatter: (cell, formatterParams) => { const rowData = cell.getRow().getData(); const iconKey = (rowData.lehrtyp_kurzbz || '').toLowerCase(); + const lvkurzbz = (cell.getValue()).toUpperCase(); + const parentspan = document.createElement('span'); const span = document.createElement('span'); + + span.classList.add('lv_table_icon', `icon-${iconKey}`); span.title = iconKey || 'LV-Teil'; - return span; + + parentspan.appendChild(span); + parentspan.appendChild(document.createTextNode(` ${lvkurzbz}`)); + + return parentspan }, cellClick: (e, cell) => { @@ -300,16 +308,6 @@ export default { }, width: 150, }, - { - title: this.$p.t('lehre', 'kurzbz'), - field: "lv_kurzbz_anzeige", - headerFilterFuncParams: {field: 'lv_kurzbz_anzeige'}, - formatter: (cell, formatterParams) => { - let rowData = cell.getRow().getData(); - return rowData?.lv_kurzbz?.toUpperCase(); - }, - headerFilter: true - }, { title: this.$p.t('lehre', 'lehrveranstaltung_id'), field: "lehrveranstaltung_id", @@ -667,7 +665,11 @@ export default { if (level === this.currentTreeLevel - 1 ) { row._row.modules.dataTree.open = true; - lastMatchingRow = row; + + if (row._row.data._children?.length > 0) + { + lastMatchingRow = row; + } } });