mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 08:34:29 +00:00
Nachreichdatum kann nun auch ueber das Infocenter gesetzt werden
This commit is contained in:
@@ -112,6 +112,7 @@ class InfoCenter extends Auth_Controller
|
||||
'unlockPerson' => 'infocenter:rw',
|
||||
'saveFormalGeprueft' => 'infocenter:rw',
|
||||
'saveDocTyp' => 'infocenter:rw',
|
||||
'saveNachreichung' => 'infocenter:rw',
|
||||
'getPrestudentData' => 'infocenter:r',
|
||||
'getLastPrestudentWithZgvJson' => 'infocenter:r',
|
||||
'getZgvInfoForPrestudent' => 'infocenter:r',
|
||||
@@ -1211,6 +1212,64 @@ class InfoCenter extends Auth_Controller
|
||||
$this->outputJsonSuccess('success');
|
||||
}
|
||||
|
||||
public function saveNachreichung($person_id)
|
||||
{
|
||||
$nachreichungAm = $this->input->post('nachreichungAm');
|
||||
$nachreichungAnmerkung = empty($this->input->post('nachreichungAnmerkung')) ? NULL : $this->input->post('nachreichungAnmerkung');
|
||||
$typ = $this->input->post('typ');
|
||||
|
||||
$allowedTypes = [
|
||||
'VorlSpB2' => 'SprachB2',
|
||||
'ZgvBaPre' => 'zgv_bakk',
|
||||
'ZgvMaPre' => 'zgv_mast'
|
||||
];
|
||||
|
||||
if (!in_array($typ, array_keys($allowedTypes)))
|
||||
$this->terminateWithJsonError('Bei dem Dokument ist keine Nachreichung möglich');
|
||||
|
||||
if (empty($nachreichungAm))
|
||||
$this->terminateWithJsonError('Ein Datum muss im folgenden Format angegeben werden: tt.mm.jjjj');
|
||||
|
||||
if (!preg_match('/^\d{2}\.\d{2}\.(\d{2}|\d{4})$/ ', $nachreichungAm))
|
||||
$this->terminateWithJsonError('Bitte das Datum im folgenden Format angeben: tt.mm.jjjj');
|
||||
|
||||
$akte = $this->AkteModel->loadWhere(array('person_id' => $person_id, 'dokument_kurzbz' => $allowedTypes[$typ]));
|
||||
|
||||
if (hasData($akte)) {
|
||||
$akte = getData($akte)[0];
|
||||
$this->AkteModel->update(
|
||||
$akte->akte_id,
|
||||
array(
|
||||
'anmerkung' => $nachreichungAnmerkung,
|
||||
'updateamum' => date('Y-m-d H:i:s'),
|
||||
'updatevon' => get_uid(),
|
||||
'nachgereicht' => true,
|
||||
'nachgereicht_am' => date_format(date_create($nachreichungAm), 'Y-m-d')
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->AkteModel->insert(
|
||||
array(
|
||||
'dokument_kurzbz' => $allowedTypes[$typ],
|
||||
'person_id' => $person_id,
|
||||
'erstelltam' => NULL,
|
||||
'gedruckt' => false,
|
||||
'anmerkung' => $nachreichungAnmerkung,
|
||||
'updateamum' => date('Y-m-d H:i:s'),
|
||||
'updatevon' => get_uid(),
|
||||
'insertamum' => date('Y-m-d H:i:s'),
|
||||
'insertvon' => get_uid(),
|
||||
'uid' => NULL,
|
||||
'nachgereicht' => true,
|
||||
'nachgereicht_am' => date_format(date_create($nachreichungAm), 'Y-m-d')
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess("Done!");
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
|
||||
@@ -28,6 +28,36 @@
|
||||
echo "<option " . ($dokumenttyp->bezeichnung === $dokument->dokument_bezeichnung ? 'selected' : '') . " value = " . $dokumenttyp->dokument_kurzbz . ">" . $dokumenttyp->bezeichnung . "</option>"
|
||||
?>
|
||||
</select>
|
||||
|
||||
<div class="row">
|
||||
<button class="nachreichungInfos hidden" id="nachreichungInfos_<?php echo $dokument->akte_id?>"><?php echo ucfirst($this->p->t('infocenter','dokumentWirdNachgereicht')) ?></button>
|
||||
</div>
|
||||
|
||||
<div class="nachreichungInputs hidden" id="nachreichungInputs_<?php echo $dokument->akte_id?>">
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control nachreichungAnmerkung" id="nachreichungAnmerkung_<?php echo $dokument->akte_id?>" maxlength="128" placeholder="Institution des Ausstellers (zB: TGM Wien)">
|
||||
<span class="input-group-addon" style="color: grey;">128</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control nachreichungAm" id="nachreichungAm_<?php echo $dokument->akte_id?>" autofocus="autofocus" placeholder="tt.mm.jjjj">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="btn-group pull-right">
|
||||
<input type="button" value="OK" class="btn btn-primary nachreichungSpeichern" id="nachreichungSpeichern_<?php echo $dokument->akte_id?>">
|
||||
<input type="button" value="Abbrechen" class="btn btn-default nachreichungAbbrechen" id="nachreichungAbbrechen_<?php echo $dokument->akte_id?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</td>
|
||||
<td><?php echo date_format(date_create($dokument->erstelltam), 'd.m.Y') ?></td>
|
||||
<td><?php echo $dokument->langtext ?></td>
|
||||
|
||||
@@ -26,7 +26,8 @@
|
||||
'public/js/tablesort/tablesort.js',
|
||||
'public/js/infocenter/messageList.js',
|
||||
'public/js/infocenter/infocenterDetails.js',
|
||||
'public/js/infocenter/zgvUeberpruefung.js'
|
||||
'public/js/infocenter/zgvUeberpruefung.js',
|
||||
'public/js/infocenter/docUeberpruefung.js'
|
||||
),
|
||||
'phrases' => array(
|
||||
'infocenter' => array(
|
||||
|
||||
Reference in New Issue
Block a user