UHSTAT form: added delete button for employees with permission, edit and delete buttons are only shown if user has permission

This commit is contained in:
KarpAlex
2023-08-15 18:27:30 +02:00
parent d200fc1961
commit c62198b4b5
4 changed files with 397 additions and 231 deletions
+110 -22
View File
@@ -68,6 +68,9 @@ class UHSTAT1 extends FHC_Controller
);
}
// -----------------------------------------------------------------------------------------------------------------
// Public methods
public function index()
{
$formMetaData = $this->_getFormMetaData();
@@ -80,12 +83,10 @@ class UHSTAT1 extends FHC_Controller
if (isError($uhstatData)) show_error(getError($uhstatData));
$readonly = hasData($uhstatData);
$this->load->view("codex/uhstat1.php", array(
'formMetaData' => getData($formMetaData),
'uhstatData' => getData($uhstatData),
'readonly' => $readonly)
'formMetaData' => getData($formMetaData),
'uhstatData' => getData($uhstatData)
)
);
}
@@ -94,7 +95,9 @@ class UHSTAT1 extends FHC_Controller
*/
public function saveUHSTAT1Data()
{
$person_id = $this->_getValidPersonId();
$saved = false;
$person_id = $this->_getValidPersonId('sui');
$this->form_validation->set_error_delimiters('<span class="text-danger">', '</span>');
@@ -155,20 +158,30 @@ class UHSTAT1 extends FHC_Controller
if (isError($formMetaData)) show_error(getError($formMetaData));
if (!hasData($formMetaData)) show_error("No form data could be loaded");
if (!hasData($formMetaData)) show_error("No form meta data could be loaded");
$successMessage = '';
$errorMessage = '';
// pass success/error messages to view
$successMessage = isset($uhstat1datenRes) && isSuccess($uhstat1datenRes) ? $this->p->t('uhstat', 'erfolgreichGespeichert') : '';
$errorMessage = isset($uhstat1datenRes) && isError($uhstat1datenRes) ? $this->p->t('uhstat', 'fehlerBeimSpeichern') : '';
$readOnly = isSuccess($uhstat1datenRes);
if (isset($uhstat1datenRes))
{
if (isSuccess($uhstat1datenRes))
{
$successMessage = $this->p->t('uhstat', 'erfolgreichGespeichert');
$saved = true;
}
else
$errorMessage = $this->p->t('uhstat', 'fehlerBeimSpeichern');
}
// load view with form data
$this->load->view("codex/uhstat1.php", array(
'formMetaData' => getData($formMetaData),
'successMessage' => $successMessage,
'errorMessage' => $errorMessage,
'readonly' => $readOnly
));
'formMetaData' => getData($formMetaData),
'saved' => $saved,
'successMessage' => $successMessage,
'errorMessage' => $errorMessage
)
);
}
/**
@@ -206,12 +219,63 @@ class UHSTAT1 extends FHC_Controller
return false;
}
/**
* Deletes UHSTAT1 entry.
*/
public function deleteUHSTAT1Data()
{
$saved = false;
// uhstat data can only be deleted with permission
if (!$this->_checkPermission('suid')) show_error('no permission');
$person_id = $this->_getValidPersonId('suid');
$uhstat1datenRes = $this->Uhstat1datenModel->delete(
array('person_id' => $person_id)
);
$formMetaData = $this->_getFormMetaData();
if (isError($formMetaData)) show_error(getError($formMetaData));
if (!hasData($formMetaData)) show_error("No form meta data could be loaded");
$successMessage = '';
$errorMessage = '';
// pass success/error messages to view
if (isset($uhstat1datenRes))
{
if (isSuccess($uhstat1datenRes))
{
$successMessage = $this->p->t('uhstat', 'erfolgreichGeloescht');
}
else
$errorMessage = $this->p->t('uhstat', 'fehlerBeimLoeschen');
}
// load view with form data
$this->load->view("codex/uhstat1.php", array(
'formMetaData' => getData($formMetaData),
'successMessage' => $successMessage,
'errorMessage' => $errorMessage
)
);
}
// -----------------------------------------------------------------------------------------------------------------
// Private methods
/**
* Gets initial data needed to display UHSTAT1 form.
*/
private function _getFormMetaData()
{
$person_id = $this->_getValidPersonId();
$person_id = $this->_getValidPersonId('s');
$readOnly = $this->input->get('readOnly');
$editPermission = $this->_checkPermission('sui');
$deletePermission = $this->_checkPermission('suid');
$languageIdx = $this->_getLanguageIndex();
@@ -220,7 +284,10 @@ class UHSTAT1 extends FHC_Controller
'abschluss_oesterreich' => array(),
'abschluss_nicht_oesterreich' => array(),
'jahre' => array(),
'person_id' => $person_id
'person_id' => $person_id,
'editPermission' => $editPermission,
'deletePermission' => $deletePermission,
'readOnly' => $readOnly
);
$nationTextFieldName = $languageIdx == 1 ? 'langtext' : 'engltext';
@@ -234,7 +301,18 @@ class UHSTAT1 extends FHC_Controller
if (isError($nationRes)) return $nationRes;
if (hasData($nationRes)) $formMetaData['nation'] = getData($nationRes);
if (hasData($nationRes))
{
$nations = getData($nationRes);
// put austria in beginning of selection
foreach ($nations as $nation)
{
if ($nation->nation_code == self::CODEX_OESTERREICH) array_unshift($nations, $nation);
}
$formMetaData['nation'] = $nations;
}
// get abschluss list
$abschlussRes = $this->AbschlussModel->getActiveAbschluesse($languageIdx);
@@ -271,7 +349,7 @@ class UHSTAT1 extends FHC_Controller
*/
private function _getUHSTAT1Data()
{
$person_id = $this->_getValidPersonId();
$person_id = $this->_getValidPersonId('s');
$this->Uhstat1datenModel->addSelect(
implode(', ', array_keys($this->_uhstat1Fields))
@@ -306,7 +384,7 @@ class UHSTAT1 extends FHC_Controller
* Can be passed as parameter or be in session.
* @return int person_id
*/
private function _getValidPersonId()
private function _getValidPersonId($berechtigungsArt)
{
// if coming from bewerbungstool - person id is in session (person must be logged in bewerbungstool)
if (isset($_SESSION[self::PERSON_ID_SESSION_INDEX]) && is_numeric($_SESSION[self::PERSON_ID_SESSION_INDEX]))
@@ -319,8 +397,18 @@ class UHSTAT1 extends FHC_Controller
if (!isset($person_id) || !is_numeric($person_id)) show_error("invalid person id");
// ...check if there is a permission for editing UHSTAT1 data
if ($this->permissionlib->isBerechtigt(self::BERECHTIGUNG_UHSTAT_VERWALTEN, 'suid')) return $person_id;
if ($this->_checkPermission($berechtigungsArt)) return $person_id;
show_error("No permission for managing UHSTAT");
show_error("No permission");
}
/**
* Checks if logged user has the UHSTAT management permission.
* @param $art - type of permission, e.g. suid for full permissions
* @return bool
*/
private function _checkPermission($art)
{
return $this->permissionlib->isBerechtigt(self::BERECHTIGUNG_UHSTAT_VERWALTEN, $art);
}
}
+226 -208
View File
@@ -11,7 +11,6 @@ $this->load->view(
),
'customCSSs' => array('public/css/codex/uhstat1.css'),
'customJSs' => array('public/js/codex/uhstat1.js')
)
);
?>
@@ -25,207 +24,27 @@ $vater_geburtsjahr = isset($uhstatData->vater_geburtsjahr) ? $uhstatData->vater_
$vater_geburtsstaat = isset($uhstatData->vater_geburtsstaat) ? $uhstatData->vater_geburtsstaat : set_value('vater_geburtsstaat');
$vater_bildungsstaat = isset($uhstatData->vater_bildungsstaat) ? $uhstatData->vater_bildungsstaat : set_value('vater_bildungsstaat');
$vater_bildungmax = isset($uhstatData->vater_bildungmax) ? $uhstatData->vater_bildungmax : set_value('vater_bildungmax');
$disabled = $readonly === true ? ' disabled' : '';
$readOnly = isset($formMetaData['readOnly']);
$disabled = $readOnly ? ' disabled' : '';
$editPermission = isset($formMetaData['editPermission']) && $formMetaData['editPermission'] === true;
$deletePermission = isset($formMetaData['deletePermission']) && $formMetaData['deletePermission'] === true;
$saved = isset($saved) && $saved === true;
?>
<input type='hidden' id='uhstat1Saved' value='<?php echo isset($readonly) && $readonly == true ? 1 : 0 ?>' />
<div class='container' id='uhstat1Container'>
<h2><?php echo $this->p->t('uhstat', 'uhstat1AnmeldungUeberschrift') ?></h2>
<p>
<?php echo $this->p->t('uhstat', 'rechtsbelehrung') ?>
</p>
<p>
<?php echo $this->p->t('uhstat', 'uhstat1AnmeldungEinleitungstext') ?>
</p>
<br>
<form class="form-horizontal" method="POST" action="<?php echo site_url('codex/UHSTAT1/saveUHSTAT1Data') ?>" id="uhstat1Form">
<input type='hidden' id='person_id' name='person_id' value='<?php echo $formMetaData['person_id'] ?>' />
<fieldset>
<legend><?php echo $this->p->t('uhstat', 'angabenErziehungsberechtigte') ?></legend>
<p>
<?php echo $this->p->t('uhstat', 'angabenErziehungsberechtigteEinleitungstext') ?>
</p>
<br>
<h4><?php echo $this->p->t('uhstat', 'erziehungsberechtigtePersonEins') ?></h4>
<div class="form-group">
<label for="mutter_geburtsjahr" class="col-sm-3 control-label"><?php echo ucfirst($this->p->t('uhstat', 'geburtsjahr')) ?></label>
<div class="col-sm-9">
<select type="text" name="mutter_geburtsjahr" id="mutter_geburtsjahr" class="form-control" <?php echo $disabled ?>>
<option disabled selected value=""><?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?></option>
<?php foreach ($formMetaData['jahre'] as $jahr): ?>
<option
value="<?php echo $jahr ?>"
<?php echo $jahr == $mutter_geburtsjahr ? " selected" : "" ?>>
<?php echo $jahr ?>
</option>
<?php endforeach; ?>
</select>
<?php echo form_error('mutter_geburtsjahr'); ?>
</div>
</div>
<div class="form-group">
<label for="mutter_geburtsstaat" class="col-sm-3 control-label">
<?php echo ucfirst($this->p->t('uhstat', 'geburtsstaat')) ?>
<br>
<?php echo '('.ucfirst($this->p->t('uhstat', 'inDenHeutigenGrenzen')).')' ?>
</label>
<div class="col-sm-9">
<select type="text" name="mutter_geburtsstaat" id="mutter_geburtsstaat" class="form-control" <?php echo $disabled ?>>
<option disabled selected value=""><?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?></option>
<?php foreach ($formMetaData['nation'] as $nation): ?>
<option
value="<?php echo $nation->nation_code ?>"
<?php echo $mutter_geburtsstaat == $nation->nation_code ? " selected" : "" ?>>
<?php echo $nation->nation_text ?>
</option>
<?php endforeach; ?>
</select>
<?php echo form_error('mutter_geburtsstaat'); ?>
</div>
</div>
<div class="form-group">
<label for="mutter_bildungsstaat" class="col-sm-3 control-label">
<?php echo ucfirst($this->p->t('uhstat', 'hoechsterAbschlussStaat')) ?>
<br>
<?php echo '('.ucfirst($this->p->t('uhstat', 'inDenHeutigenGrenzen')).')' ?>
</label>
<div class="col-sm-9">
<select type="text" name="mutter_bildungsstaat" id="mutter_bildungsstaat" class="form-control" <?php echo $disabled ?>>
<option disabled selected value=""><?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?></option>
<?php foreach ($formMetaData['nation'] as $nation): ?>
<option
value="<?php echo $nation->nation_code ?>"
<?php echo $mutter_bildungsstaat == $nation->nation_code ? " selected" : "" ?>>
<?php echo $nation->nation_text ?>
</option>
<?php endforeach; ?>
</select>
<?php echo form_error('mutter_bildungsstaat'); ?>
</div>
</div>
<div class="form-group">
<label for="mutter_bildungmax" class="col-sm-3 control-label"><?php echo ucfirst($this->p->t('uhstat', 'hoechsterAbschluss')) ?></label>
<div class="col-sm-9">
<select type="text" name="mutter_bildungmax" id="mutter_bildungmax" class="form-control" <?php echo $disabled ?>>
<option disabled selected value=""><?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?></option>
<optgroup label="<?php echo $this->p->t('uhstat', 'wennAbschlussInOesterreich') ?>">
<?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?>
<?php foreach ($formMetaData['abschluss_oesterreich'] as $abschluss): ?>
<option
value="<?php echo $abschluss->ausbildung_code ?>"
<?php echo $mutter_bildungmax == $abschluss->ausbildung_code ? " selected" : "" ?>>
<?php echo $abschluss->bezeichnung ?>
</option>
<?php endforeach; ?>
</optgroup>
<optgroup label="<?php echo $this->p->t('uhstat', 'wennAbschlussNichtInOesterreich') ?>">
<?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?>
<?php foreach ($formMetaData['abschluss_nicht_oesterreich'] as $abschluss): ?>
<option
value="<?php echo $abschluss->ausbildung_code ?>"
<?php echo $mutter_bildungmax == $abschluss->ausbildung_code ? " selected" : "" ?>>
<?php echo $abschluss->bezeichnung ?>
</option>
<?php endforeach; ?>
</optgroup>
</select>
<?php echo form_error('mutter_bildungmax'); ?>
</div>
</div>
<br>
<h4><?php echo $this->p->t('uhstat', 'erziehungsberechtigtePersonZwei') ?></h4>
<div class="form-group">
<label for="vater_geburtsjahr" class="col-sm-3 control-label"><?php echo ucfirst($this->p->t('uhstat', 'geburtsjahr')) ?></label>
<div class="col-sm-9">
<select type="text" name="vater_geburtsjahr" id="vater_geburtsjahr" class="form-control" <?php echo $disabled ?>>
<option disabled selected value=""><?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?></option>
<?php foreach ($formMetaData['jahre'] as $jahr): ?>
<option
value="<?php echo $jahr ?>"
<?php echo $vater_geburtsjahr == $jahr ? " selected" : "" ?>>
<?php echo $jahr ?>
</option>
<?php endforeach; ?>
</select>
<?php echo form_error('vater_geburtsjahr'); ?>
</div>
</div>
<div class="form-group">
<label for="vater_geburtsstaat" class="col-sm-3 control-label">
<?php echo ucfirst($this->p->t('uhstat', 'geburtsstaat')) ?>
<br>
<?php echo '('.ucfirst($this->p->t('uhstat', 'inDenHeutigenGrenzen')).')' ?>
</label>
<div class="col-sm-9">
<select type="text" name="vater_geburtsstaat" id="vater_geburtsstaat" class="form-control" <?php echo $disabled ?>>
<option disabled selected value=""><?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?></option>
<?php foreach ($formMetaData['nation'] as $nation): ?>
<option
value="<?php echo $nation->nation_code ?>"
<?php echo $vater_geburtsstaat == $nation->nation_code ? " selected" : "" ?>>
<?php echo $nation->nation_text ?>
</option>
<?php endforeach; ?>
</select>
<?php echo form_error('vater_geburtsstaat'); ?>
</div>
</div>
<div class="form-group">
<label for="vater_bildungsstaat" class="col-sm-3 control-label">
<?php echo $this->p->t('uhstat', 'hoechsterAbschlussStaat') ?>
<br>
<?php echo '('.ucfirst($this->p->t('uhstat', 'inDenHeutigenGrenzen')).')' ?>
</label>
<div class="col-sm-9">
<select type="text" name="vater_bildungsstaat" id="vater_bildungsstaat" class="form-control" <?php echo $disabled ?>>
<option disabled selected value=""><?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?></option>
<?php foreach ($formMetaData['nation'] as $nation): ?>
<option
value="<?php echo $nation->nation_code ?>"
<?php echo $vater_bildungsstaat == $nation->nation_code ? " selected" : "" ?>>
<?php echo $nation->nation_text ?>
</option>
<?php endforeach; ?>
</select>
<?php echo form_error('vater_bildungsstaat'); ?>
</div>
</div>
<div class="form-group">
<label for="vater_bildungmax" class="col-sm-3 control-label">
<?php echo ucfirst($this->p->t('uhstat', 'hoechsterAbschluss')) ?>
</label>
<div class="col-sm-9">
<select type="text" name="vater_bildungmax" id="vater_bildungmax" class="form-control" <?php echo $disabled ?>>
<option disabled selected value=""><?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?></option>
<optgroup label="<?php echo $this->p->t('uhstat', 'wennAbschlussInOesterreich') ?>">
<?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?>
<?php foreach ($formMetaData['abschluss_oesterreich'] as $abschluss): ?>
<option
value="<?php echo $abschluss->ausbildung_code ?>"
<?php echo $vater_bildungmax == $abschluss->ausbildung_code ? " selected" : "" ?>>
<?php echo $abschluss->bezeichnung ?>
</option>
<?php endforeach; ?>
</optgroup>
<optgroup label="<?php echo $this->p->t('uhstat', 'wennAbschlussNichtInOesterreich') ?>">
<?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?>
<?php foreach ($formMetaData['abschluss_nicht_oesterreich'] as $abschluss): ?>
<option
value="<?php echo $abschluss->ausbildung_code ?>"
<?php echo $vater_bildungmax == $abschluss->ausbildung_code ? " selected" : "" ?>>
<?php echo $abschluss->bezeichnung ?>
</option>
<?php endforeach; ?>
</optgroup>
</select>
<?php echo form_error('vater_bildungmax'); ?>
</div>
</div>
</fieldset>
<div id="uhstat1Subcontainer">
<input type='hidden' id='uhstat1Saved' value='<?php echo $saved ? 1 : 0 ?>' />
<h2><?php echo $this->p->t('uhstat', 'uhstat1AnmeldungUeberschrift') ?></h2>
<p>
<?php echo $this->p->t('uhstat', 'rechtsbelehrung') ?>
</p>
<p>
<?php echo $this->p->t('uhstat', 'uhstat1AnmeldungEinleitungstext') ?>
</p>
<br>
<fieldset>
<?php if ($editPermission): ?>
<?php if (isset($successMessage) && !isEmptyString($successMessage)): ?>
<div class="alert alert-success" id="success-alert_uhstat1">
<div class="alert alert-success" id="uhstat_success_alert">
<button type="button" class="close" data-dismiss="alert">x</button>
<strong><?php echo $successMessage ?></strong>
</div>
@@ -233,18 +52,217 @@ $disabled = $readonly === true ? ' disabled' : '';
<?php if (isset($errorMessage) && !isEmptyString($errorMessage)): ?>
<div class='alert alert-danger text-center'><?php echo $errorMessage ?></div>
<?php endif; ?>
<div class="form-group">
<div class="col-sm-12 text-right">
<?php if (!$readonly): ?>
&nbsp;
<button class="btn btn-success btn-md" type="submit" id="uhstat1Submit">
<?php echo $this->p->t('uhstat', 'pruefenUndSpeichern') ?>
</button>
<?php endif; ?>
<?php endif; ?>
<form class="form-horizontal" method="POST" action="<?php echo site_url('codex/UHSTAT1/saveUHSTAT1Data') ?>" id="uhstat1Form">
<input type='hidden' id='person_id' name='person_id' value='<?php echo $formMetaData['person_id'] ?>' />
<fieldset>
<legend><?php echo $this->p->t('uhstat', 'angabenErziehungsberechtigte') ?></legend>
<p>
<?php echo $this->p->t('uhstat', 'angabenErziehungsberechtigteEinleitungstext') ?>
</p>
<br>
<h4><?php echo $this->p->t('uhstat', 'erziehungsberechtigtePersonEins') ?></h4>
<div class="form-group">
<label for="mutter_geburtsjahr" class="col-sm-3 control-label"><?php echo ucfirst($this->p->t('uhstat', 'geburtsjahr')) ?></label>
<div class="col-sm-9">
<select type="text" name="mutter_geburtsjahr" id="mutter_geburtsjahr" class="form-control" <?php echo $disabled ?>>
<option disabled selected value=""><?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?></option>
<?php foreach ($formMetaData['jahre'] as $jahr): ?>
<option
value="<?php echo $jahr ?>"
<?php echo $jahr == $mutter_geburtsjahr ? " selected" : "" ?>>
<?php echo $jahr ?>
</option>
<?php endforeach; ?>
</select>
<?php echo form_error('mutter_geburtsjahr'); ?>
</div>
</div>
</div>
</fieldset>
</form>
<div class="form-group">
<label for="mutter_geburtsstaat" class="col-sm-3 control-label">
<?php echo ucfirst($this->p->t('uhstat', 'geburtsstaat')) ?>
<br>
<?php echo '('.ucfirst($this->p->t('uhstat', 'inDenHeutigenGrenzen')).')' ?>
</label>
<div class="col-sm-9">
<select type="text" name="mutter_geburtsstaat" id="mutter_geburtsstaat" class="form-control" <?php echo $disabled ?>>
<option disabled selected value=""><?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?></option>
<?php foreach ($formMetaData['nation'] as $nation): ?>
<option
value="<?php echo $nation->nation_code ?>"
<?php echo $mutter_geburtsstaat == $nation->nation_code ? " selected" : "" ?>>
<?php echo $nation->nation_text ?>
</option>
<?php endforeach; ?>
</select>
<?php echo form_error('mutter_geburtsstaat'); ?>
</div>
</div>
<div class="form-group">
<label for="mutter_bildungsstaat" class="col-sm-3 control-label">
<?php echo ucfirst($this->p->t('uhstat', 'hoechsterAbschlussStaat')) ?>
<br>
<?php echo '('.ucfirst($this->p->t('uhstat', 'inDenHeutigenGrenzen')).')' ?>
</label>
<div class="col-sm-9">
<select type="text" name="mutter_bildungsstaat" id="mutter_bildungsstaat" class="form-control" <?php echo $disabled ?>>
<option disabled selected value=""><?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?></option>
<?php foreach ($formMetaData['nation'] as $nation): ?>
<option
value="<?php echo $nation->nation_code ?>"
<?php echo $mutter_bildungsstaat == $nation->nation_code ? " selected" : "" ?>>
<?php echo $nation->nation_text ?>
</option>
<?php endforeach; ?>
</select>
<?php echo form_error('mutter_bildungsstaat'); ?>
</div>
</div>
<div class="form-group">
<label for="mutter_bildungmax" class="col-sm-3 control-label"><?php echo ucfirst($this->p->t('uhstat', 'hoechsterAbschluss')) ?></label>
<div class="col-sm-9">
<select type="text" name="mutter_bildungmax" id="mutter_bildungmax" class="form-control" <?php echo $disabled ?>>
<option disabled selected value=""><?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?></option>
<optgroup label="<?php echo $this->p->t('uhstat', 'wennAbschlussInOesterreich') ?>">
<?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?>
<?php foreach ($formMetaData['abschluss_oesterreich'] as $abschluss): ?>
<option
value="<?php echo $abschluss->ausbildung_code ?>"
<?php echo $mutter_bildungmax == $abschluss->ausbildung_code ? " selected" : "" ?>>
<?php echo $abschluss->bezeichnung ?>
</option>
<?php endforeach; ?>
</optgroup>
<optgroup label="<?php echo $this->p->t('uhstat', 'wennAbschlussNichtInOesterreich') ?>">
<?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?>
<?php foreach ($formMetaData['abschluss_nicht_oesterreich'] as $abschluss): ?>
<option
value="<?php echo $abschluss->ausbildung_code ?>"
<?php echo $mutter_bildungmax == $abschluss->ausbildung_code ? " selected" : "" ?>>
<?php echo $abschluss->bezeichnung ?>
</option>
<?php endforeach; ?>
</optgroup>
</select>
<?php echo form_error('mutter_bildungmax'); ?>
</div>
</div>
<br>
<h4><?php echo $this->p->t('uhstat', 'erziehungsberechtigtePersonZwei') ?></h4>
<div class="form-group">
<label for="vater_geburtsjahr" class="col-sm-3 control-label"><?php echo ucfirst($this->p->t('uhstat', 'geburtsjahr')) ?></label>
<div class="col-sm-9">
<select type="text" name="vater_geburtsjahr" id="vater_geburtsjahr" class="form-control" <?php echo $disabled ?>>
<option disabled selected value=""><?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?></option>
<?php foreach ($formMetaData['jahre'] as $jahr): ?>
<option
value="<?php echo $jahr ?>"
<?php echo $vater_geburtsjahr == $jahr ? " selected" : "" ?>>
<?php echo $jahr ?>
</option>
<?php endforeach; ?>
</select>
<?php echo form_error('vater_geburtsjahr'); ?>
</div>
</div>
<div class="form-group">
<label for="vater_geburtsstaat" class="col-sm-3 control-label">
<?php echo ucfirst($this->p->t('uhstat', 'geburtsstaat')) ?>
<br>
<?php echo '('.ucfirst($this->p->t('uhstat', 'inDenHeutigenGrenzen')).')' ?>
</label>
<div class="col-sm-9">
<select type="text" name="vater_geburtsstaat" id="vater_geburtsstaat" class="form-control" <?php echo $disabled ?>>
<option disabled selected value=""><?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?></option>
<?php foreach ($formMetaData['nation'] as $nation): ?>
<option
value="<?php echo $nation->nation_code ?>"
<?php echo $vater_geburtsstaat == $nation->nation_code ? " selected" : "" ?>>
<?php echo $nation->nation_text ?>
</option>
<?php endforeach; ?>
</select>
<?php echo form_error('vater_geburtsstaat'); ?>
</div>
</div>
<div class="form-group">
<label for="vater_bildungsstaat" class="col-sm-3 control-label">
<?php echo $this->p->t('uhstat', 'hoechsterAbschlussStaat') ?>
<br>
<?php echo '('.ucfirst($this->p->t('uhstat', 'inDenHeutigenGrenzen')).')' ?>
</label>
<div class="col-sm-9">
<select type="text" name="vater_bildungsstaat" id="vater_bildungsstaat" class="form-control" <?php echo $disabled ?>>
<option disabled selected value=""><?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?></option>
<?php foreach ($formMetaData['nation'] as $nation): ?>
<option
value="<?php echo $nation->nation_code ?>"
<?php echo $vater_bildungsstaat == $nation->nation_code ? " selected" : "" ?>>
<?php echo $nation->nation_text ?>
</option>
<?php endforeach; ?>
</select>
<?php echo form_error('vater_bildungsstaat'); ?>
</div>
</div>
<div class="form-group">
<label for="vater_bildungmax" class="col-sm-3 control-label">
<?php echo ucfirst($this->p->t('uhstat', 'hoechsterAbschluss')) ?>
</label>
<div class="col-sm-9">
<select type="text" name="vater_bildungmax" id="vater_bildungmax" class="form-control" <?php echo $disabled ?>>
<option disabled selected value=""><?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?></option>
<optgroup label="<?php echo $this->p->t('uhstat', 'wennAbschlussInOesterreich') ?>">
<?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?>
<?php foreach ($formMetaData['abschluss_oesterreich'] as $abschluss): ?>
<option
value="<?php echo $abschluss->ausbildung_code ?>"
<?php echo $vater_bildungmax == $abschluss->ausbildung_code ? " selected" : "" ?>>
<?php echo $abschluss->bezeichnung ?>
</option>
<?php endforeach; ?>
</optgroup>
<optgroup label="<?php echo $this->p->t('uhstat', 'wennAbschlussNichtInOesterreich') ?>">
<?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?>
<?php foreach ($formMetaData['abschluss_nicht_oesterreich'] as $abschluss): ?>
<option
value="<?php echo $abschluss->ausbildung_code ?>"
<?php echo $vater_bildungmax == $abschluss->ausbildung_code ? " selected" : "" ?>>
<?php echo $abschluss->bezeichnung ?>
</option>
<?php endforeach; ?>
</optgroup>
</select>
<?php echo form_error('vater_bildungmax'); ?>
</div>
</div>
</fieldset>
<?php if ($editPermission && !$readOnly): ?>
<br>
<fieldset>
<div class="form-group">
<div class="col-sm-12 text-right">
<button class="btn btn-success btn-md" type="submit" id="uhstat1Submit">
<?php echo $this->p->t('uhstat', 'pruefenUndSpeichern') ?>
</button>
</div>
</div>
</fieldset>
<?php endif; ?>
</form>
<?php if ($deletePermission && !$readOnly): ?>
<form class="form-horizontal" method="POST" action="<?php echo site_url('codex/UHSTAT1/deleteUHSTAT1Data') ?>" id="uhstat1DeleteForm">
<input type='hidden' id='person_id' name='person_id' value='<?php echo $formMetaData['person_id'] ?>' />
<div class="form-group">
<div class="col-sm-12">
<button class="btn btn-danger btn-md" type="submit" id="uhstat1Delete">
<?php echo $this->p->t('uhstat', 'datenLoeschen') ?>
</button>
</div>
</div>
</form>
<?php endif; ?>
</div>
</div>
<?php $this->load->view('templates/FHC-Footer'); ?>
+1 -1
View File
@@ -4,7 +4,7 @@
$(document).ready(function ()
{
window.setTimeout(function() {
$("#success-alert_uhstat1").fadeTo(500, 0).slideUp(500, function(){
$("#uhstat_success_alert").fadeTo(500, 0).slideUp(500, function(){
$(this).remove();
});
}, 1000);
+60
View File
@@ -18522,6 +18522,66 @@ array(
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'uhstat',
'phrase' => 'datenLoeschen',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Daten löschen',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Delete data',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'uhstat',
'phrase' => 'erfolgreichGeloescht',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Erfolgreich gelöscht',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Deleted successfully',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'uhstat',
'phrase' => 'datenLoeschen',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Daten löschen',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Delete data',
'description' => '',
'insertvon' => 'system'
)
)
)
);