From ba7cfc389071f893b69f6fe0c0fedf0870340ad3 Mon Sep 17 00:00:00 2001 From: chfhtw Date: Wed, 1 Oct 2025 14:50:18 +0200 Subject: [PATCH 1/2] Make showOnlyWithUid and showOnlyWithoutUid available for multiselects --- .../js/components/Stv/Studentenverwaltung/Details.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/public/js/components/Stv/Studentenverwaltung/Details.js b/public/js/components/Stv/Studentenverwaltung/Details.js index 8222d637e..9c0773038 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details.js +++ b/public/js/components/Stv/Studentenverwaltung/Details.js @@ -31,10 +31,14 @@ export default { if (this.students.length == 1) { const student = this.students[0]; if (student.uid) - return Object.fromEntries(Object.entries(this.configStudent).filter(([key, value]) => !value.showOnlyWithoutUid)); - return Object.fromEntries(Object.entries(this.configStudent).filter(([key, value]) => !value.showOnlyWithUid)); + return Object.fromEntries(Object.entries(this.configStudent).filter(([ , value ]) => !value.showOnlyWithoutUid)); + return Object.fromEntries(Object.entries(this.configStudent).filter(([ , value ]) => !value.showOnlyWithUid)); + } else if (this.students.every(student => student.uid)) { + return Object.fromEntries(Object.entries(this.configStudents).filter(([ , value ]) => !value.showOnlyWithoutUid)); + } else if (this.students.every(student => !student.uid)) { + return Object.fromEntries(Object.entries(this.configStudents).filter(([ , value ]) => !value.showOnlyWithUid)); } - return this.configStudents; + return Object.fromEntries(Object.entries(this.configStudents).filter(([ , value ]) => !value.showOnlyWithUid && !value.showOnlyWithUid)); } }, methods: { From 2f20ddaefa6957d05bb75e98a5d09b3db8490a04 Mon Sep 17 00:00:00 2001 From: chfhtw Date: Wed, 1 Oct 2025 14:51:29 +0200 Subject: [PATCH 2/2] Change StV config to hide Tabs when Prestudents without UID are selected --- .../api/frontend/v1/stv/Config.php | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/application/controllers/api/frontend/v1/stv/Config.php b/application/controllers/api/frontend/v1/stv/Config.php index d52016943..a466ad94f 100644 --- a/application/controllers/api/frontend/v1/stv/Config.php +++ b/application/controllers/api/frontend/v1/stv/Config.php @@ -106,15 +106,18 @@ class Config extends FHCAPI_Controller ]; $result['resources'] = [ 'title' => $this->p->t('stv', 'tab_resources'), - 'component' => './Stv/Studentenverwaltung/Details/Betriebsmittel.js' + 'component' => './Stv/Studentenverwaltung/Details/Betriebsmittel.js', + 'showOnlyWithUid' => true ]; $result['groups'] = [ 'title' => $this->p->t('stv', 'tab_groups'), - 'component' => './Stv/Studentenverwaltung/Details/Gruppen.js' + 'component' => './Stv/Studentenverwaltung/Details/Gruppen.js', + 'showOnlyWithUid' => true ]; $result['messages'] = [ 'title' => $this->p->t('stv', 'tab_messages'), - 'component' => './Stv/Studentenverwaltung/Details/Messages.js' + 'component' => './Stv/Studentenverwaltung/Details/Messages.js', + 'showOnlyWithUid' => true ]; $result['grades'] = [ @@ -132,7 +135,8 @@ class Config extends FHCAPI_Controller $result['exam'] = [ 'title' => $this->p->t('stv', 'tab_exam'), - 'component' => './Stv/Studentenverwaltung/Details/Pruefung.js' + 'component' => './Stv/Studentenverwaltung/Details/Pruefung.js', + 'showOnlyWithUid' => true ]; $result['exemptions'] = [ @@ -144,12 +148,14 @@ class Config extends FHCAPI_Controller $result['finalexam'] = [ 'title' => $this->p->t('stv', 'tab_finalexam'), 'component' => './Stv/Studentenverwaltung/Details/Abschlusspruefung.js', + 'showOnlyWithUid' => true, 'config' => $config['finalexam'] ]; $result['mobility'] = [ 'title' => $this->p->t('stv', 'tab_mobility'), - 'component' => './Stv/Studentenverwaltung/Details/Mobility.js' + 'component' => './Stv/Studentenverwaltung/Details/Mobility.js', + 'showOnlyWithUid' => true ]; $result['archive'] = [ @@ -162,7 +168,8 @@ class Config extends FHCAPI_Controller $result['jointstudies'] = [ 'title' => $this->p->t('stv', 'tab_jointstudies'), - 'component' => './Stv/Studentenverwaltung/Details/JointStudies.js' + 'component' => './Stv/Studentenverwaltung/Details/JointStudies.js', + 'showOnlyWithUid' => true ]; $result['coursedates'] = [ @@ -177,7 +184,8 @@ class Config extends FHCAPI_Controller $result['functions'] = [ 'title' => $this->p->t('stv', 'tab_functions'), - 'component' => './Stv/Studentenverwaltung/Details/Funktionen.js' + 'component' => './Stv/Studentenverwaltung/Details/Funktionen.js', + 'showOnlyWithUid' => true ]; Events::trigger('stv_conf_student', function & () use (&$result) { @@ -219,6 +227,7 @@ class Config extends FHCAPI_Controller $result['finalexam'] = [ 'title' => $this->p->t('stv', 'tab_finalexam'), 'component' => './Stv/Studentenverwaltung/Details/Abschlusspruefung.js', + 'showOnlyWithUid' => true, 'config' => $config['finalexam'] ]; $result['archive'] = [