From 26ddd404c00c3845023e50e6ec0855b0dbbd8f5f Mon Sep 17 00:00:00 2001 From: ma0068 Date: Thu, 9 Jul 2026 08:57:17 +0200 Subject: [PATCH 1/6] add geschlecht to dropdown and adapt default according to geschlecht --- .../Details/Abschlusspruefung/Abschlusspruefung.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Abschlusspruefung/Abschlusspruefung.js b/public/js/components/Stv/Studentenverwaltung/Details/Abschlusspruefung/Abschlusspruefung.js index 1c2c53dd7..df9b74c05 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Abschlusspruefung/Abschlusspruefung.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Abschlusspruefung/Abschlusspruefung.js @@ -434,7 +434,10 @@ export default { } if (!this.formData.akadgrad_id && this.arrAkadGrad.length > 0) { - this.formData.akadgrad_id = this.arrAkadGrad[0].akadgrad_id; + if(this.student.geschlecht == 'w') + this.formData.akadgrad_id = this.arrAkadGrad[1].akadgrad_id; + else + this.formData.akadgrad_id = this.arrAkadGrad[0].akadgrad_id; } }, printDocument(link) { @@ -718,7 +721,7 @@ export default { :key="grad.akadgrad_id" :value="grad.akadgrad_id" > - {{grad.titel}} + {{ grad.titel }} ({{ grad.geschlecht }}) Date: Wed, 29 Jul 2026 11:17:03 +0200 Subject: [PATCH 2/6] fixed issue with displayed locked profile images in other lv plan --- .../api/frontend/v1/OtherLvPlan.php | 86 ++++++++++--------- 1 file changed, 44 insertions(+), 42 deletions(-) diff --git a/application/controllers/api/frontend/v1/OtherLvPlan.php b/application/controllers/api/frontend/v1/OtherLvPlan.php index cad654f12..d3eceae67 100644 --- a/application/controllers/api/frontend/v1/OtherLvPlan.php +++ b/application/controllers/api/frontend/v1/OtherLvPlan.php @@ -17,60 +17,62 @@ */ if (!defined('BASEPATH')) - exit('No direct script access allowed'); + exit('No direct script access allowed'); class OtherLvPlan extends FHCAPI_Controller { - /** - * Object initialization - */ - public function __construct() - { - parent::__construct([ - 'otherLvPlanViewData' => ['basis/other_lv_plan:r'], - ]); + /** + * Object initialization + */ + public function __construct() + { + parent::__construct([ + 'otherLvPlanViewData' => ['basis/other_lv_plan:r'], + ]); - $this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel'); - $this->load->model('person/Benutzer_model', 'BenutzerModel'); + $this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel'); + $this->load->model('person/Benutzer_model', 'BenutzerModel'); - } + } - //------------------------------------------------------------------------------------------------------------------ - // Public methods + //------------------------------------------------------------------------------------------------------------------ + // Public methods - /** - * retrieves viewData for other lv plan view - * @access public - * @param $uid the userID for which the other lv plan is being viewed - */ - public function otherLvPlanViewData($uid) - { - $isMitarbeiterResult = $this->MitarbeiterModel->isMitarbeiter($uid); - $isMitarbeiter = getData($isMitarbeiterResult); - $isStudent = !$isMitarbeiter; + /** + * retrieves viewData for other lv plan view + * @access public + * @param $uid the userID for which the other lv plan is being viewed + */ + public function otherLvPlanViewData($uid) + { + $isMitarbeiterResult = $this->MitarbeiterModel->isMitarbeiter($uid); + $isMitarbeiter = getData($isMitarbeiterResult); + $isStudent = !$isMitarbeiter; - $this->BenutzerModel->addSelect(["foto", "vorname", "nachname"]); - $this->BenutzerModel->addJoin("tbl_person", "person_id"); - $personResult = $this->BenutzerModel->load([$uid]); - $person = hasData($personResult) ? getData($personResult) : null; + $this->BenutzerModel->addSelect(["foto", "foto_sperre", "vorname", "nachname"]); + $this->BenutzerModel->addJoin("tbl_person", "person_id"); + $personResult = $this->BenutzerModel->load([$uid]); + $person = hasData($personResult) ? getData($personResult) : null; - $viewData = [ - "user_data" => [ - "username" => $uid, - "is_student" => $isStudent, - "is_mitarbeiter" => $isMitarbeiter, - "foto" => $person[0]->foto, - "vorname" => $person[0]->vorname, - "nachname" => $person[0]->nachname, - ], - ]; + $photo = $person[0]->foto_sperre ? base64_encode(file_get_contents(DOC_ROOT . 'skin/images/profilbild_dummy.jpg')) : $person[0]->foto; - $this->terminateWithSuccess($viewData); - } + $viewData = [ + "user_data" => [ + "username" => $uid, + "is_student" => $isStudent, + "is_mitarbeiter" => $isMitarbeiter, + "foto" => $photo, + "vorname" => $person[0]->vorname, + "nachname" => $person[0]->nachname, + ], + ]; - // ----------------------------------------------------------------------------------------------------------------- - // Private methods + $this->terminateWithSuccess($viewData); + } + + // ----------------------------------------------------------------------------------------------------------------- + // Private methods } From d1ca6eb988977f240b8eb3e179d5816ca7452c0d Mon Sep 17 00:00:00 2001 From: adisposkofh Date: Wed, 29 Jul 2026 11:28:13 +0200 Subject: [PATCH 3/6] reworked other lv plan view data controller using profil library --- .../controllers/api/frontend/v1/OtherLvPlan.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/application/controllers/api/frontend/v1/OtherLvPlan.php b/application/controllers/api/frontend/v1/OtherLvPlan.php index d3eceae67..a48113270 100644 --- a/application/controllers/api/frontend/v1/OtherLvPlan.php +++ b/application/controllers/api/frontend/v1/OtherLvPlan.php @@ -33,6 +33,7 @@ class OtherLvPlan extends FHCAPI_Controller $this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel'); $this->load->model('person/Benutzer_model', 'BenutzerModel'); + $this->load->library('ProfilLib'); } @@ -50,21 +51,17 @@ class OtherLvPlan extends FHCAPI_Controller $isMitarbeiter = getData($isMitarbeiterResult); $isStudent = !$isMitarbeiter; - $this->BenutzerModel->addSelect(["foto", "foto_sperre", "vorname", "nachname"]); - $this->BenutzerModel->addJoin("tbl_person", "person_id"); - $personResult = $this->BenutzerModel->load([$uid]); - $person = hasData($personResult) ? getData($personResult) : null; - - $photo = $person[0]->foto_sperre ? base64_encode(file_get_contents(DOC_ROOT . 'skin/images/profilbild_dummy.jpg')) : $person[0]->foto; + $profileData = $this->profillib->getView($uid); + $profileData = hasData($profileData) ? getData($profileData) : null; $viewData = [ "user_data" => [ "username" => $uid, "is_student" => $isStudent, "is_mitarbeiter" => $isMitarbeiter, - "foto" => $photo, - "vorname" => $person[0]->vorname, - "nachname" => $person[0]->nachname, + "foto" => $profileData->data->foto, + "vorname" => $profileData->data->vorname, + "nachname" => $profileData->data->nachname, ], ]; From 69048f8f48ee0749952924f3b9648be3ef5692f1 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Fri, 31 Jul 2026 09:51:04 +0200 Subject: [PATCH 4/6] bugfix semester calculation between semesters --- application/libraries/StundenplanLib.php | 4 +- .../organisation/Studiensemester_model.php | 76 +++++++++++++++++++ 2 files changed, 79 insertions(+), 1 deletion(-) diff --git a/application/libraries/StundenplanLib.php b/application/libraries/StundenplanLib.php index a7bec61ec..5535c6168 100644 --- a/application/libraries/StundenplanLib.php +++ b/application/libraries/StundenplanLib.php @@ -80,6 +80,7 @@ class StundenplanLib if (isError($semester_range)) return $semester_range; $semester_range = getData($semester_range); + $this->_ci->addMeta('semester_range', $semester_range); $this->sortStudienSemester($semester_range); @@ -784,7 +785,8 @@ class StundenplanLib $this->_ci->load->model('organisation/Studiensemester_model', 'StudiensemesterModel'); // gets all studiensemester from the student from start_date to end_date - $semester_range = $this->_ci->StudiensemesterModel->getByDateRange($start_date, $end_date); + //$semester_range = $this->_ci->StudiensemesterModel->getByDateRange($start_date, $end_date); + $semester_range = $this->_ci->StudiensemesterModel->getContainingOrNearestByDateRange($start_date, $end_date); if (isError($semester_range)) return $semester_range; diff --git a/application/models/organisation/Studiensemester_model.php b/application/models/organisation/Studiensemester_model.php index e6492b52e..1b480771f 100644 --- a/application/models/organisation/Studiensemester_model.php +++ b/application/models/organisation/Studiensemester_model.php @@ -229,6 +229,82 @@ class Studiensemester_model extends DB_Model return $this->execQuery($query, array($date,$date,$date,$date)); } + /** + * Gets all Studiensemester where the range dates are contained + * or the nearest if date is not contained + * @param $from + * @param $to + * @return array|null + */ + public function getContainingOrNearestByDateRange($from, $to) + { + if (date_format(date_create($from), 'Y-m-d') > (date_format(date_create($to), 'Y-m-d'))) + return success(array()); + + $query = <<db->escape($from)}::date BETWEEN s.start AND s.ende + ORDER BY + s.start DESC + LIMIT 1 + ), + semester_interval_enddate AS ( + SELECT + s.* + FROM + public.tbl_studiensemester s + WHERE + {$this->db->escape($to)}::date BETWEEN s.start AND s.ende + ORDER BY + s.start DESC + LIMIT 1 + ), + nearest_semester_interval_startdate AS ( + SELECT + LEAST(ABS(s.start - {$this->db->escape($from)}::date), ABS(s.ende - {$this->db->escape($from)}::date)) AS mindiff, + s.* + FROM + public.tbl_studiensemester s + WHERE + s.ende < {$this->db->escape($from)}::date + ORDER BY + 1 ASC + LIMIT 1 + ), + nearest_semester_interval_enddate AS ( + SELECT + LEAST(ABS(s.start - {$this->db->escape($to)}::date), ABS(s.ende - {$this->db->escape($to)}::date)) AS mindiff, + s.* + FROM + public.tbl_studiensemester s + WHERE + s.start > {$this->db->escape($to)}::date + ORDER BY + 1 ASC + LIMIT 1 + ) + SELECT + COALESCE( + (SELECT studiensemester_kurzbz FROM semester_interval_startdate), + (SELECT studiensemester_kurzbz FROM nearest_semester_interval_startdate) + ) AS studiensemester_kurzbz + UNION + SELECT + COALESCE( + (SELECT studiensemester_kurzbz FROM semester_interval_enddate), + (SELECT studiensemester_kurzbz FROM nearest_semester_interval_enddate) + ) AS studiensemester_kurzbz + +EOSQL; + + return $this->execReadonlyQuery($query); + } + /** * Gets all Studiensemester between two dates * @param $from From b9d4aefd5e0681569b772b2133b292ebcf5a7625 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Fri, 31 Jul 2026 11:02:46 +0200 Subject: [PATCH 5/6] add meta info --- application/libraries/StundenplanLib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/libraries/StundenplanLib.php b/application/libraries/StundenplanLib.php index 5535c6168..1d88ad0db 100644 --- a/application/libraries/StundenplanLib.php +++ b/application/libraries/StundenplanLib.php @@ -85,6 +85,7 @@ class StundenplanLib $this->sortStudienSemester($semester_range); $function_error = $this->applyLoadUeberSemesterHaelfte($semester_range); + $this->_ci->addMeta('nach_apply_semester_range', $semester_range); if ($function_error) return $function_error; From 2686aee1583ed4eeae474ddcccdb75c0a50b6bdd Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Mon, 3 Aug 2026 19:30:49 +0200 Subject: [PATCH 6/6] avoid multiple assignments to one variable --- application/controllers/api/frontend/v1/OtherLvPlan.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/controllers/api/frontend/v1/OtherLvPlan.php b/application/controllers/api/frontend/v1/OtherLvPlan.php index a48113270..af075fbc3 100644 --- a/application/controllers/api/frontend/v1/OtherLvPlan.php +++ b/application/controllers/api/frontend/v1/OtherLvPlan.php @@ -51,8 +51,8 @@ class OtherLvPlan extends FHCAPI_Controller $isMitarbeiter = getData($isMitarbeiterResult); $isStudent = !$isMitarbeiter; - $profileData = $this->profillib->getView($uid); - $profileData = hasData($profileData) ? getData($profileData) : null; + $resProfileData = $this->profillib->getView($uid); + $profileData = hasData($resProfileData) ? getData($resProfileData) : null; $viewData = [ "user_data" => [