UHSTAT1 form: added firstname and lastname of student

This commit is contained in:
KarpAlex
2023-09-05 16:49:19 +02:00
parent fab1022c49
commit 4175ecc209
2 changed files with 23 additions and 0 deletions
+17
View File
@@ -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
+6
View File
@@ -32,6 +32,12 @@ $saved = isset($saved) && $saved === true;
?>
<div class='container' id='uhstat1Container'>
<h1 class="text-center">
<?php echo isset($formMetaData['nachname'])
? 'UHSTAT1 Daten für '.(isset($formMetaData['vorname']) ? $formMetaData['vorname'].' ' : '').$formMetaData['nachname']
: ''
?>
</h1>
<div id="uhstat1Subcontainer">
<input type='hidden' id='uhstat1Saved' value='<?php echo $saved ? 1 : 0 ?>' />
<h2><?php echo $this->p->t('uhstat', 'uhstat1AnmeldungUeberschrift') ?></h2>