diff --git a/application/config/navigation.php b/application/config/navigation.php index 11fd1a3a6..bb6cc50ba 100644 --- a/application/config/navigation.php +++ b/application/config/navigation.php @@ -336,3 +336,18 @@ $config['navigation_menu']['system/issues/Issues/*'] = array( 'requiredPermissions' => array('admin:rw') ), ); + +$config['navigation_menu']['apps'] = [ + 'stv' => [ + 'link' => site_url('studentenverwaltung'), + 'description' => 'Studierendenverwaltung', + #'icon' => 'users', + 'requiredPermissions' => array('admin:r', 'assistenz:r') + ], + 'lvv' => [ + 'link' => site_url('lVVerwaltung'), + 'description' => 'LV Verwaltung', + #'icon' => 'person-chalkboard', + 'requiredPermissions' => array('admin:r', 'assistenz:r') + ] +]; diff --git a/application/controllers/api/frontend/v1/ProfilUpdate.php b/application/controllers/api/frontend/v1/ProfilUpdate.php index 604ae33c9..f97546288 100644 --- a/application/controllers/api/frontend/v1/ProfilUpdate.php +++ b/application/controllers/api/frontend/v1/ProfilUpdate.php @@ -637,7 +637,7 @@ class ProfilUpdate extends FHCAPI_Controller //? Send email to the Studiengangsassistentinnen $this->StudentModel->addSelect(["public.tbl_studiengang.email"]); $this->StudentModel->addJoin("public.tbl_benutzer", "public.tbl_benutzer.uid = public.tbl_student.student_uid"); - $this->StudentModel->addJoin("public.tbl_prestudent", "public.tbl_benutzer.person_id = public.tbl_prestudent.person_id"); + $this->StudentModel->addJoin("public.tbl_prestudent", "public.tbl_benutzer.person_id = public.tbl_prestudent.person_id and public.tbl_student.studiengang_kz = public.tbl_prestudent.studiengang_kz"); $this->StudentModel->addJoin("public.tbl_prestudentstatus", "public.tbl_prestudentstatus.prestudent_id = public.tbl_prestudent.prestudent_id"); $this->StudentModel->addJoin("public.tbl_studiengang", "public.tbl_studiengang.studiengang_kz = public.tbl_prestudent.studiengang_kz"); $this->StudentModel->addGroupBy(["public.tbl_studiengang.email"]); diff --git a/public/css/Studentenverwaltung.css b/public/css/Studentenverwaltung.css index bb2588926..56e99b937 100644 --- a/public/css/Studentenverwaltung.css +++ b/public/css/Studentenverwaltung.css @@ -1,15 +1,21 @@ @import './Fhc.css'; +@import './SvgIcons.css'; @import './components/searchbar/searchbar.css'; @import './components/verticalsplit.css'; @import './components/FilterComponent.css'; @import './components/Tabs.css'; @import './components/Notiz.css'; @import './components/Messages.css'; +@import './components/AppMenu.css'; html { font-size: .875em; } +#appMenu { + width: 300px; +} + .navbar-dark .navbar-brand:focus { box-shadow: 0 0 0 .25rem rgba(13,110,253,.25); z-index: 3; @@ -37,10 +43,6 @@ html { flex: 1 1 auto; } -#sidebarMenu { - width: 0%; -} - .tabulator-row.disabled.tabulator-row-odd .tabulator-cell { color: var(--gray-400); } diff --git a/public/css/SvgIcons.css b/public/css/SvgIcons.css new file mode 100644 index 000000000..f25d842a4 --- /dev/null +++ b/public/css/SvgIcons.css @@ -0,0 +1,28 @@ +/* Themable Variables */ +:root { + --svg-icon-apps: var(--fhc-icon-apps, url('data:image/svg+xml,\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + ')); +} +.svg-icon { + display: inline-block; + width: 1rem; + line-height: 1; + background-color: currentColor; +} +.svg-icon:before { + content: "\00a0"; +} +.svg-icon.svg-icon-apps { + -webkit-mask-image: var(--svg-icon-apps); + mask-image: var(--svg-icon-apps); +} diff --git a/public/css/components/AppMenu.css b/public/css/components/AppMenu.css new file mode 100644 index 000000000..b980c1efc --- /dev/null +++ b/public/css/components/AppMenu.css @@ -0,0 +1,26 @@ +.fhc-app-menu { + display: flex; + flex-direction: column; + padding-left: 0; + margin: calc(var(--bs-offcanvas-padding-y) * -1) calc(var(--bs-offcanvas-padding-x) * -1); +} +.fhc-app-menu li { + display: block; + border: var(--bs-border-width) solid var(--bs-border-color); +} +.fhc-app-menu li + li { + border-top-width: 0; +} +.fhc-app-menu li a { + display: block; + padding: .5rem 1rem; + text-decoration: none; +} +.fhc-app-menu li a.active, +.fhc-app-menu li a:hover { + --bs-link-color-rgb: var(--bs-link-hover-color-rgb); + background: var(--surface-hover); +} +.fhc-app-menu li a.active { + pointer-events: none; +} diff --git a/public/js/components/AppMenu.js b/public/js/components/AppMenu.js new file mode 100644 index 000000000..33d35f8df --- /dev/null +++ b/public/js/components/AppMenu.js @@ -0,0 +1,68 @@ +/** + * Copyright (C) 2025 fhcomplete.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import ApiNavigation from '../api/factory/navigation.js'; + +export default { + name: 'AppMenu', + props: { + appIdentifier: { + type: String, + required: true + }, + navigationPage: { + type: String, + default: 'apps' + } + }, + data() { + return { + items: [] + }; + }, + watch: { + navigationPage() { + this.getItems(); + } + }, + methods: { + getItems() { + this.$api + .call(ApiNavigation.getMenu(this.navigationPage)) + .then(result => { + this.items = result.data; + }) + .catch(this.$fhcAlert.handleSystemError); + } + }, + created() { + this.getItems(); + }, + template: /* html */` + ` +}; diff --git a/public/js/components/LVVerwaltung/LVVerwaltung.js b/public/js/components/LVVerwaltung/LVVerwaltung.js index c03e7c84c..eed4bf3c5 100644 --- a/public/js/components/LVVerwaltung/LVVerwaltung.js +++ b/public/js/components/LVVerwaltung/LVVerwaltung.js @@ -1,5 +1,6 @@ import CoreSearchbar from "../searchbar/searchbar.js"; import VerticalSplit from "../verticalsplit/verticalsplit.js"; +import AppMenu from "../AppMenu.js"; import StvVerband from "../Stv/Studentenverwaltung/Verband.js"; import StvStudiensemester from "../Stv/Studentenverwaltung/Studiensemester.js"; import LvTable from "./Setup/Table.js"; @@ -17,6 +18,7 @@ export default { components: { CoreSearchbar, VerticalSplit, + AppMenu, StvVerband, StvStudiensemester, LvTable, @@ -247,14 +249,47 @@ export default { .catch(this.$fhcAlert.handleSystemError); }, - template: ` + template: /* html */`
+