dokumentenpruefung im infocenter in eigenes js ausgelagert, reloaden der anzeige beim nachreichen eines doks

This commit is contained in:
ma0048
2021-06-30 13:09:56 +02:00
parent 67aa887981
commit 36507959ac
8 changed files with 218 additions and 100 deletions
@@ -127,6 +127,7 @@ class InfoCenter extends Auth_Controller
'updateNotiz' => 'infocenter:rw',
'reloadZgvPruefungen' => 'infocenter:r',
'reloadMessages' => 'infocenter:r',
'reloadDoks' => 'infocenter:r',
'reloadNotizen' => 'infocenter:r',
'reloadLogs' => 'infocenter:r',
'outputAkteContent' => 'infocenter:r',
@@ -1023,6 +1024,13 @@ class InfoCenter extends Auth_Controller
$this->load->view('system/infocenter/logs.php', array('logs' => $logs));
}
public function reloadDoks($person_id)
{
$dokumente_nachgereicht = $this->AkteModel->getAktenWithDokInfo($person_id, null, true);
$this->load->view('system/infocenter/dokNachzureichend.php', array('dokumente_nachgereicht' => $dokumente_nachgereicht->retval));
}
/**
* Outputs content of an Akte, sends appropriate headers (so the document can be downloaded)
* @param $akte_id
@@ -1225,13 +1233,31 @@ class InfoCenter extends Auth_Controller
];
if (!in_array($typ, array_keys($allowedTypes)))
$this->terminateWithJsonError('Bei dem Dokument ist keine Nachreichung möglich');
$this->terminateWithJsonError($this->p->t('ui', 'fehlerBeimSpeichern'));
if (empty($nachreichungAm))
$this->terminateWithJsonError('Ein Datum muss im folgenden Format angegeben werden: tt.mm.jjjj');
$this->terminateWithJsonError($this->p->t('infocenter', 'datumUngueltig'));
if (!preg_match('/^\d{2}\.\d{2}\.(\d{2}|\d{4})$/ ', $nachreichungAm))
$this->terminateWithJsonError('Bitte das Datum im folgenden Format angeben: tt.mm.jjjj');
{
$this->terminateWithJsonError($this->p->t('infocenter', 'datumUngueltig'));
}
else
{
$ds = explode('.', $nachreichungAm);
if (! checkdate($ds[1], $ds[0], $ds[2]))
{
$this->terminateWithJsonError($this->p->t('infocenter', 'datumUngueltig'));
}
}
$nachreichungAm = (date_format(date_create($nachreichungAm), 'Y-m-d'));
$today = date('Y-m-d H:i:s');
if($nachreichungAm < $today)
$this->terminateWithJsonError($this->p->t('infocenter', 'nachreichDatumNichtVergangenheit'));
$akte = $this->AkteModel->loadWhere(array('person_id' => $person_id, 'dokument_kurzbz' => $allowedTypes[$typ]));
@@ -1241,10 +1267,10 @@ class InfoCenter extends Auth_Controller
$akte->akte_id,
array(
'anmerkung' => $nachreichungAnmerkung,
'updateamum' => date('Y-m-d H:i:s'),
'updateamum' => $today,
'updatevon' => get_uid(),
'nachgereicht' => true,
'nachgereicht_am' => date_format(date_create($nachreichungAm), 'Y-m-d')
'nachgereicht_am' => $nachreichungAm
)
);
}
@@ -1257,13 +1283,13 @@ class InfoCenter extends Auth_Controller
'erstelltam' => NULL,
'gedruckt' => false,
'anmerkung' => $nachreichungAnmerkung,
'updateamum' => date('Y-m-d H:i:s'),
'updateamum' => $today,
'updatevon' => get_uid(),
'insertamum' => date('Y-m-d H:i:s'),
'insertamum' => $today,
'insertvon' => get_uid(),
'uid' => NULL,
'nachgereicht' => true,
'nachgereicht_am' => date_format(date_create($nachreichungAm), 'Y-m-d')
'nachgereicht_am' => $nachreichungAm
)
);
}
@@ -0,0 +1,32 @@
<?php if (count($dokumente_nachgereicht) > 0): ?>
<br/>
<p><?php echo ucfirst($this->p->t('infocenter','nachzureichendeDokumente')) ?></p>
<table id="nachgdoctable" class="table table-bordered">
<thead>
<tr>
<th><?php echo ucfirst($this->p->t('global','typ')) ?></th>
<th><?php echo ucfirst($this->p->t('infocenter','nachzureichenAm')) ?></th>
<th><?php echo ucfirst($this->p->t('infocenter','ausstellungsnation')) ?></th>
<th><?php echo ucfirst($this->p->t('global','anmerkung')) ?></th>
</tr>
</thead>
<tbody>
<?php
foreach ($dokumente_nachgereicht as $dokument):
?>
<tr>
<td><?php echo $dokument->dokument_bezeichnung ?></td>
<td>
<?php echo isset($dokument->nachgereicht_am) ? date_format(date_create($dokument->nachgereicht_am), 'd.m.Y') : ''; ?>
</td>
<td>
<?php echo $dokument->langtext ?>
</td>
<td>
<?php echo $dokument->anmerkung; ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif; ?>
@@ -76,36 +76,4 @@
<?php endforeach ?>
</tbody>
</table>
</div>
<?php if (count($dokumente_nachgereicht) > 0): ?>
<br/>
<p><?php echo ucfirst($this->p->t('infocenter','nachzureichendeDokumente')) ?></p>
<table id="nachgdoctable" class="table table-bordered">
<thead>
<tr>
<th><?php echo ucfirst($this->p->t('global','typ')) ?></th>
<th><?php echo ucfirst($this->p->t('infocenter','nachzureichenAm')) ?></th>
<th><?php echo ucfirst($this->p->t('infocenter','ausstellungsnation')) ?></th>
<th><?php echo ucfirst($this->p->t('global','anmerkung')) ?></th>
</tr>
</thead>
<tbody>
<?php
foreach ($dokumente_nachgereicht as $dokument):
?>
<tr>
<td><?php echo $dokument->dokument_bezeichnung ?></td>
<td>
<?php echo isset($dokument->nachgereicht_am) ? date_format(date_create($dokument->nachgereicht_am), 'd.m.Y') : ''; ?>
</td>
<td>
<?php echo $dokument->langtext ?>
</td>
<td>
<?php echo $dokument->anmerkung; ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif; ?>
</div>
@@ -49,7 +49,9 @@
'zgvInPruefung',
'zgvErfuellt',
'zgvNichtErfuellt',
'zgvErfuelltPruefung'
'zgvErfuelltPruefung',
'datumUngueltig',
'nachreichDatumNichtVergangenheit'
),
'ui' => array(
'gespeichert',
@@ -127,6 +129,9 @@
</div>
<div class="panel-body">
<?php $this->load->view('system/infocenter/dokpruefung.php'); ?>
<div id="nachzureichendeDoks">
<?php $this->load->view('system/infocenter/dokNachzureichend.php'); ?>
</div>
</div> <!-- ./panel-body -->
</div> <!-- ./panel -->
</div> <!-- ./column -->
@@ -116,6 +116,9 @@
</div>
<div class="panel-body">
<?php $this->load->view('system/infocenter/dokpruefung.php', array('formalReadonly' => true)); ?>
<div id="nachzureichendeDoks">
<?php $this->load->view('system/infocenter/dokNachzureichend.php'); ?>
</div>
</div> <!-- ./panel-body -->
<div class="panel-body zgvBearbeitungButtons" id="zgvBearbeitungButtons_<?php echo $prestudent_id ?>">
+82 -9
View File
@@ -1,8 +1,20 @@
const ALLOWED_DOC_TYPES = ['VorlSpB2', 'ZgvBaPre', 'ZgvMaPre'];
$(document).ready(function ()
{
DocUeberpruefung._formatDocTable();
DocUeberpruefung.checkNachreichungButtons();
var personid = $("#hiddenpersonid").val();
DocUeberpruefung.checkNachreichungButtons();
//add click events to "formal geprüft" checkboxes
$(".prchbox").click(function ()
{
var boxid = this.id;
var akteid = InfocenterDetails._getPrestudentIdFromElementId(boxid);
var checked = this.checked;
DocUeberpruefung.saveFormalGeprueft(personid, akteid, checked)
});
$('select.aktenid').change(function()
{
@@ -33,14 +45,15 @@ $(document).ready(function ()
if(nachreichungAm === '')
{
FHC_DialogLib.alertError('Ein Datum muss im folgenden Format angegeben werden: tt.mm.jjjj');
FHC_DialogLib.alertError(FHC_PhrasesLib.t('infocenter', 'datumUngueltig'));
return false;
}
var regEx = /^\d{2}\.\d{2}\.(\d{2}|\d{4})$/;
if(nachreichungAm.match(regEx) === null)
{
FHC_DialogLib.alertError('Bitte das Datum im folgenden Format angeben: tt.mm.jjjj')
FHC_DialogLib.alertError(FHC_PhrasesLib.t('infocenter', 'datumUngueltig'))
return false;
}
@@ -50,10 +63,48 @@ $(document).ready(function ()
var DocUeberpruefung = {
saveFormalGeprueft: function(personid, akteid, checked)
{
FHC_AjaxClient.ajaxCallPost(
CALLED_PATH + '/saveFormalGeprueft/' + encodeURIComponent(personid),
{
akte_id: akteid,
formal_geprueft: checked
},
{
successCallback: function(data, textStatus, jqXHR) {
if (FHC_AjaxClient.hasData(data))
{
var timestamp = data.retval[0];
if (timestamp === "")
{
$("#formalgeprueftam_" + akteid).text("");
}
else
{
var fgdatum = $.datepicker.parseDate("yy-mm-dd", timestamp);
var gerfgdatum = $.datepicker.formatDate("dd.mm.yy", fgdatum);
$("#formalgeprueftam_" + akteid).text(gerfgdatum);
}
//refresh doctable tablesorter, formal geprueft changed!
$("#doctable").trigger("update");
InfocenterDetails._refreshLog();
}
else
{
InfocenterDetails._genericSaveError();
}
},
errorCallback: InfocenterDetails._genericSaveError,
veilTimeout: 0
}
);
},
saveDocTyp: function(personid, akteid, typ)
{
FHC_AjaxClient.ajaxCallPost(
CALLED_PATH + "/saveDocTyp/"+encodeURIComponent(personid),
CALLED_PATH + "/saveDocTyp/" + encodeURIComponent(personid),
{
"akte_id": akteid,
"typ" : typ
@@ -81,7 +132,7 @@ var DocUeberpruefung = {
saveNachreichung: function (personid, nachreichungAm, nachreichungAnmerkung, typ)
{
FHC_AjaxClient.ajaxCallPost(
CALLED_PATH + "/saveNachreichung/"+encodeURIComponent(personid),
CALLED_PATH + "/saveNachreichung/" + encodeURIComponent(personid),
{
"nachreichungAm": nachreichungAm,
"nachreichungAnmerkung" : nachreichungAnmerkung,
@@ -91,8 +142,9 @@ var DocUeberpruefung = {
successCallback: function(data, textStatus, jqXHR) {
if (FHC_AjaxClient.isSuccess(data))
{
FHC_DialogLib.alertSuccess("Done!");
DocUeberpruefung._refreshNachzureichendeDoks();
InfocenterDetails._refreshLog();
FHC_DialogLib.alertSuccess("Done!");
}
else
{
@@ -132,14 +184,35 @@ var DocUeberpruefung = {
checkNachreichungButton: function(akteid)
{
var allowedTyps = ['VorlSpB2', 'ZgvBaPre', 'ZgvMaPre'];
var typ = $('#aktenid_' + akteid).val();
var infos = $('#nachreichungInfos_' + akteid);
if ($.inArray(typ, allowedTyps) === -1)
if ($.inArray(typ, ALLOWED_DOC_TYPES) === -1)
{
infos.addClass('hidden');
}
else
{
infos.removeClass('hidden');
}
}
},
_refreshNachzureichendeDoks: function()
{
var personid = $("#hiddenpersonid").val();
$("#nachzureichendeDoks").load(
CONTROLLER_URL + '/reloadDoks/' + personid + '?fhc_controller_id=' + FHC_AjaxClient.getUrlParameter('fhc_controller_id'),
function () {
DocUeberpruefung._formatDocTable();
}
);
},
_formatDocTable: function()
{
Tablesort.addTablesorter("doctable", [[2, 1], [1, 0]], ["zebra"]);
Tablesort.addTablesorter("nachgdoctable", [[2, 0], [1, 1]], ["zebra"]);
},
}
-49
View File
@@ -21,9 +21,6 @@ const ONHOLDNAME = 'onhold';
*/
$(document).ready(function ()
{
//initialise table sorter
Tablesort.addTablesorter("doctable", [[2, 1], [1, 0]], ["zebra"]);
Tablesort.addTablesorter("nachgdoctable", [[2, 0], [1, 1]], ["zebra"]);
InfocenterDetails._formatMessageTable();
InfocenterDetails._formatNotizTable();
@@ -37,15 +34,6 @@ $(document).ready(function ()
$("#sendmsgform").submit();
});
//add click events to "formal geprüft" checkboxes
$(".prchbox").click(function ()
{
var boxid = this.id;
var akteid = InfocenterDetails._getPrestudentIdFromElementId(boxid);
var checked = this.checked;
InfocenterDetails.saveFormalGeprueft(personid, akteid, checked)
});
//add click events to zgv Prüfung section
InfocenterDetails._addZgvPruefungEvents(personid);
@@ -133,43 +121,6 @@ var InfocenterDetails = {
// -----------------------------------------------------------------------------------------------------------------
// ajax calls
saveFormalGeprueft: function(personid, akteid, checked)
{
FHC_AjaxClient.ajaxCallPost(
CALLED_PATH + '/saveFormalGeprueft/' + encodeURIComponent(personid),
{
akte_id: akteid,
formal_geprueft: checked
},
{
successCallback: function(data, textStatus, jqXHR) {
if (FHC_AjaxClient.hasData(data))
{
var timestamp = data.retval[0];
if (timestamp === "")
{
$("#formalgeprueftam_" + akteid).text("");
}
else
{
var fgdatum = $.datepicker.parseDate("yy-mm-dd", timestamp);
var gerfgdatum = $.datepicker.formatDate("dd.mm.yy", fgdatum);
$("#formalgeprueftam_" + akteid).text(gerfgdatum);
}
//refresh doctable tablesorter, formal geprueft changed!
$("#doctable").trigger("update");
InfocenterDetails._refreshLog();
}
else
{
InfocenterDetails._genericSaveError();
}
},
errorCallback: InfocenterDetails._genericSaveError,
veilTimeout: 0
}
);
},
saveBewPriorisierung: function(data)
{
FHC_AjaxClient.ajaxCallPost(
+60
View File
@@ -3506,6 +3506,66 @@ $phrases = array(
)
)
),
array(
'app' => 'infocenter',
'category' => 'infocenter',
'phrase' => 'datumUngueltig',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Das Datumsformat ist ungültig oder liegt außerhalb des gültigen Bereichs. Bitte geben Sie ein gültiges Datum im Format tt.mm.jjjj ein.',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Date is invalid or out of range. Please enter a valid date in the format dd.mm.yyyy.',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'infocenter',
'category' => 'infocenter',
'phrase' => 'dokUngueltig',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Bei dem Dokument ist keine Nachreichung möglich.',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Date is invalid or out of range. Please enter a valid date in the format dd.mm.yyyy.',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'infocenter',
'category' => 'infocenter',
'phrase' => 'nachreichDatumNichtVergangenheit',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Das Datum der Nachreichung darf nicht in der Vergangenheit liegen.',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'The date of submission may not be in the past.',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'global',