diff --git a/application/controllers/api/frontend/v1/stv/Config.php b/application/controllers/api/frontend/v1/stv/Config.php
index 922c6a8e7..5d076ffc4 100644
--- a/application/controllers/api/frontend/v1/stv/Config.php
+++ b/application/controllers/api/frontend/v1/stv/Config.php
@@ -33,6 +33,8 @@ class Config extends FHCAPI_Controller
{
// TODO(chris): permissions
parent::__construct([
+ 'get' => ['admin:r', 'assistenz:r'],
+ 'set' => ['admin:r', 'assistenz:r'],
'filter' => ['admin:r', 'assistenz:r'],
'student' => ['admin:r', 'assistenz:r'],
'students' => ['admin:r', 'assistenz:r']
@@ -55,6 +57,95 @@ class Config extends FHCAPI_Controller
}
/**
+ * get App config
+ */
+ public function get()
+ {
+ $this->load->model('system/Variable_model', 'VariableModel');
+ $this->load->config('stv');
+
+ $config = [];
+
+ #number_displayed_past_studiensemester
+ $result = $this->VariableModel->getVariables(getAuthUID(), ['number_displayed_past_studiensemester']);
+ $data = $this->getDataOrTerminateWithError($result);
+
+ $number_displayed_past_studiensemester_default = $this->config->item('number_displayed_past_studiensemester_default');
+
+ $config['number_displayed_past_studiensemester'] = [
+ "type" => "number",
+ "label" => $this->p->t('stv', 'settings_no_displayed_past_sem'),
+ "value" => $data['number_displayed_past_studiensemester']
+ ?? $number_displayed_past_studiensemester_default
+ ];
+
+ #font_size
+ $result = $this->VariableModel->getVariables(getAuthUID(), ['stv_font_size']);
+ $data = $this->getDataOrTerminateWithError($result);
+ $config['font_size'] = [
+ "type" => "select",
+ "label" => $this->p->t('stv', 'settings_fontsize'),
+ "value" => $data['stv_font_size'] ?? "fs_normal",
+ "options" => [
+ "fs_xx-small" => $this->p->t('stv', 'settings_fontsize_xx-small'),
+ "fs_x-small" => $this->p->t('stv', 'settings_fontsize_x-small'),
+ "fs_small" => $this->p->t('stv', 'settings_fontsize_small'),
+ "fs_normal" => $this->p->t('stv', 'settings_fontsize_normal'),
+ "fs_big" => $this->p->t('stv', 'settings_fontsize_big'),
+ "fs_huge" => $this->p->t('stv', 'settings_fontsize_huge')
+ ]
+ ];
+
+ #others
+ Events::trigger('stv_config_get', function & () use (&$config) {
+ return $config;
+ });
+
+ $this->terminateWithSuccess($config);
+ }
+
+ /**
+ * set App config
+ */
+ public function set()
+ {
+ $this->load->model('system/Variable_model', 'VariableModel');
+ $this->load->library('form_validation');
+
+ $this->form_validation->set_rules(
+ 'number_displayed_past_studiensemester',
+ $this->p->t('stv', 'settings_no_displayed_past_sem'),
+ 'required|integer'
+ );
+ $this->form_validation->set_rules(
+ 'font_size',
+ $this->p->t('stv', 'settings_fontsize'),
+ 'required|in_list[fs_xx-small,fs_x-small,fs_small,fs_normal,fs_big,fs_huge]'
+ );
+
+ Events::trigger('stv_config_validation', $this->form_validation);
+
+ if (!$this->form_validation->run())
+ $this->terminateWithValidationErrors($this->form_validation->error_array());
+
+
+ $this->VariableModel->setVariable(
+ getAuthUID(),
+ 'number_displayed_past_studiensemester',
+ $this->input->post('number_displayed_past_studiensemester')
+ );
+ $this->VariableModel->setVariable(
+ getAuthUID(),
+ 'stv_font_size',
+ $this->input->post('font_size')
+ );
+
+ Events::trigger('stv_config_set', $this->input);
+
+ $this->terminateWithSuccess();
+ }
+
+ /*
* Get the config for the student filters
*
* @return void
diff --git a/application/controllers/api/frontend/v1/stv/Verband.php b/application/controllers/api/frontend/v1/stv/Verband.php
index 9fcd97c91..db832b30b 100644
--- a/application/controllers/api/frontend/v1/stv/Verband.php
+++ b/application/controllers/api/frontend/v1/stv/Verband.php
@@ -165,7 +165,17 @@ class Verband extends FHCAPI_Controller
$this->StudiengangModel->addDistinct();
$this->StudiengangModel->addSelect("CONCAT(" . $this->StudiengangModel->escape($link) . ", semester) AS link", false);
- $this->StudiengangModel->addSelect("CONCAT(UPPER(CONCAT(typ, kurzbz)), '-', semester, (SELECT CASE WHEN bezeichnung IS NULL OR bezeichnung='' THEN ''::TEXT ELSE CONCAT(' (', bezeichnung, ')') END FROM public.tbl_lehrverband WHERE studiengang_kz=v.studiengang_kz AND semester=v.semester ORDER BY verband, gruppe LIMIT 1)) AS name", false);
+ $this->StudiengangModel->addSelect("CONCAT(
+ UPPER(CONCAT(typ, kurzbz)),
+ '-',
+ semester,
+ (
+ SELECT CASE WHEN bezeichnung IS NULL OR bezeichnung='' THEN ''::TEXT ELSE CONCAT(' (', bezeichnung, ')') END
+ FROM public.tbl_lehrverband
+ WHERE studiengang_kz=v.studiengang_kz AND semester=v.semester
+ ORDER BY verband, gruppe LIMIT 1
+ )
+ ) AS name", false);
$this->StudiengangModel->addSelect('semester');
$this->StudiengangModel->addSelect($this->StudiengangModel->escape($studiengang_kz) . '::integer AS stg_kz', false);
@@ -188,6 +198,7 @@ class Verband extends FHCAPI_Controller
array_unshift($list, [
'name' => 'PreStudent',
'link' => $link . 'prestudent',
+ 'no_sem_reload' => true,
'stg_kz' => (int)$studiengang_kz,
'children' => $this->getStdSem($link . 'prestudent/', $studiengang_kz)
]);
@@ -216,7 +227,6 @@ class Verband extends FHCAPI_Controller
$list = array_merge($list, $result);
}
}
-
}
$this->terminateWithSuccess($list);
}
diff --git a/application/views/Studentenverwaltung.php b/application/views/Studentenverwaltung.php
index 01e611657..16b8c0045 100644
--- a/application/views/Studentenverwaltung.php
+++ b/application/views/Studentenverwaltung.php
@@ -53,6 +53,8 @@ $configArray = [
active-addons="= defined('ACTIVE_ADDONS') ? ACTIVE_ADDONS : ''; ?>"
stv-root="= site_url('Studentenverwaltung'); ?>"
cis-root="= CIS_ROOT; ?>"
+ avatar-url="= site_url('Cis/Pub/bild/person/' . getAuthPersonId()); ?>"
+ logout-url="= site_url('Cis/Auth/logout'); ?>"
:permissions="= htmlspecialchars(json_encode($permissions)); ?>"
:config="= htmlspecialchars(json_encode($configArray)); ?>"
>
diff --git a/public/css/Studentenverwaltung.css b/public/css/Studentenverwaltung.css
index 56e99b937..eb6becc15 100644
--- a/public/css/Studentenverwaltung.css
+++ b/public/css/Studentenverwaltung.css
@@ -11,6 +11,24 @@
html {
font-size: .875em;
}
+html.fs_xx-small {
+ font-size: .5em;
+}
+html.fs_x-small {
+ font-size: .625em;
+}
+html.fs_small {
+ font-size: .75em;
+}
+html.fs_normal {
+ font-size: .875em;
+}
+html.fs_big {
+ font-size: 1em;
+}
+html.fs_huge {
+ font-size: 1.125em;
+}
#appMenu {
width: 300px;
@@ -43,6 +61,12 @@ html {
flex: 1 1 auto;
}
+#nav-user-btn img {
+ object-fit: contain;
+ height: 2.5rem;
+ width: 2.5rem;
+}
+
.tabulator-row.disabled.tabulator-row-odd .tabulator-cell {
color: var(--gray-400);
}
@@ -160,4 +184,4 @@ html {
.tiny-90 div.tox.tox-tinymce {
height: 90% !important;
-}
\ No newline at end of file
+}
diff --git a/public/js/api/factory/stv/config.js b/public/js/api/factory/stv/config.js
new file mode 100644
index 000000000..c54b2f8b2
--- /dev/null
+++ b/public/js/api/factory/stv/config.js
@@ -0,0 +1,32 @@
+/**
+ * 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