From 4175ecc209e231f28da159bccf276d55ed492bb3 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Tue, 5 Sep 2023 16:49:19 +0200 Subject: [PATCH] UHSTAT1 form: added firstname and lastname of student --- application/controllers/codex/UHSTAT1.php | 17 +++++++++++++++++ application/views/codex/uhstat1.php | 6 ++++++ 2 files changed, 23 insertions(+) diff --git a/application/controllers/codex/UHSTAT1.php b/application/controllers/codex/UHSTAT1.php index 0795959c7..6bbd4d4f8 100644 --- a/application/controllers/codex/UHSTAT1.php +++ b/application/controllers/codex/UHSTAT1.php @@ -279,8 +279,11 @@ class UHSTAT1 extends FHC_Controller private function _getFormMetaData() { $person_id = $this->_getValidPersonId('s'); + + // read only display param $readOnly = $this->input->get('readOnly'); + // depending on permissions, editing or deleting is possible $editPermission = $this->_checkPermission('sui'); $deletePermission = $this->_checkPermission('suid'); @@ -297,6 +300,20 @@ class UHSTAT1 extends FHC_Controller 'readOnly' => $readOnly ); + // get person data + $this->load->model('person/Person_model', 'PersonModel'); + $this->PersonModel->addSelect("vorname, nachname"); + $personRes = $this->PersonModel->load($person_id); + + if (isError($personRes)) return $personRes; + + if (hasData($personRes)) + { + $person = getData($personRes)[0]; + $formMetaData['vorname'] = $person->vorname; + $formMetaData['nachname'] = $person->nachname; + } + $nationTextFieldName = $languageIdx == 1 ? 'langtext' : 'engltext'; // get nation list diff --git a/application/views/codex/uhstat1.php b/application/views/codex/uhstat1.php index 2d9bc5ebf..a09f9c70a 100644 --- a/application/views/codex/uhstat1.php +++ b/application/views/codex/uhstat1.php @@ -32,6 +32,12 @@ $saved = isset($saved) && $saved === true; ?>
+

+ +

p->t('uhstat', 'uhstat1AnmeldungUeberschrift') ?>