diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php
index 4ac74dde5..7dceb954c 100644
--- a/application/controllers/system/infocenter/InfoCenter.php
+++ b/application/controllers/system/infocenter/InfoCenter.php
@@ -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
diff --git a/application/views/system/infocenter/dokpruefung.php b/application/views/system/infocenter/dokpruefung.php
index 7ee77e815..214f450b0 100644
--- a/application/views/system/infocenter/dokpruefung.php
+++ b/application/views/system/infocenter/dokpruefung.php
@@ -28,6 +28,36 @@
echo ""
?>
+
+
+
+
+
+
+
+
erstelltam), 'd.m.Y') ?> |
langtext ?> |
diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php
index a448e95ce..dbfff7d08 100644
--- a/application/views/system/infocenter/infocenterDetails.php
+++ b/application/views/system/infocenter/infocenterDetails.php
@@ -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(
diff --git a/public/css/infocenter/infocenterDetails.css b/public/css/infocenter/infocenterDetails.css
index 38a7824fa..2f2debc00 100644
--- a/public/css/infocenter/infocenterDetails.css
+++ b/public/css/infocenter/infocenterDetails.css
@@ -76,6 +76,17 @@
font-weight: normal;
}
+.nachreichungInfos
+{
+ float: right;
+ margin: 5px 15px 0 0;
+}
+
+.nachreichungInputs .row
+{
+ margin-top: 5px;
+}
+
@media screen and (max-width: 1510px)
{
#postponing{
diff --git a/public/js/infocenter/docUeberpruefung.js b/public/js/infocenter/docUeberpruefung.js
new file mode 100644
index 000000000..495257f41
--- /dev/null
+++ b/public/js/infocenter/docUeberpruefung.js
@@ -0,0 +1,145 @@
+$(document).ready(function ()
+{
+ var personid = $("#hiddenpersonid").val();
+
+ DocUeberpruefung.checkNachreichungButtons();
+
+ $('select.aktenid').change(function()
+ {
+ var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id);
+ var typ = $(this).val();
+ DocUeberpruefung.saveDocTyp(personid, akteid, typ);
+ });
+
+ $('.nachreichungInfos').click(function()
+ {
+ var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id);
+ DocUeberpruefung.checkNachreichungInputs(akteid);
+ });
+
+ $('.nachreichungAbbrechen').click(function()
+ {
+ var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id);
+ DocUeberpruefung.checkNachreichungInputs(akteid);
+ });
+
+ $('.nachreichungSpeichern').click(function()
+ {
+ var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id);
+ var typ = $('#aktenid_' + akteid).val();
+
+ var nachreichungAm = $('#nachreichungAm_' + akteid).val();
+ var nachreichungAnmerkung = $('#nachreichungAnmerkung_' + akteid).val();
+
+ if(nachreichungAm === '')
+ {
+ FHC_DialogLib.alertError('Ein Datum muss im folgenden Format angegeben werden: tt.mm.jjjj');
+ 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')
+ return false;
+ }
+
+ DocUeberpruefung.saveNachreichung(personid, nachreichungAm, nachreichungAnmerkung, typ);
+ })
+});
+
+var DocUeberpruefung = {
+
+ saveDocTyp: function(personid, akteid, typ)
+ {
+ FHC_AjaxClient.ajaxCallPost(
+ CALLED_PATH + "/saveDocTyp/"+encodeURIComponent(personid),
+ {
+ "akte_id": akteid,
+ "typ" : typ
+ },
+ {
+ successCallback: function(data, textStatus, jqXHR) {
+ if (FHC_AjaxClient.isSuccess(data))
+ {
+ FHC_DialogLib.alertSuccess("Done!");
+ InfocenterDetails._refreshLog();
+ DocUeberpruefung.checkNachreichungButton(akteid);
+ }
+ else
+ {
+ FHC_DialogLib.alertError(data);
+ }
+ },
+ errorCallback: function() {
+ FHC_DialogLib.alertWarning("Fehler beim Speichern!");
+ }
+ }
+ );
+ },
+
+ saveNachreichung: function (personid, nachreichungAm, nachreichungAnmerkung, typ)
+ {
+ FHC_AjaxClient.ajaxCallPost(
+ CALLED_PATH + "/saveNachreichung/"+encodeURIComponent(personid),
+ {
+ "nachreichungAm": nachreichungAm,
+ "nachreichungAnmerkung" : nachreichungAnmerkung,
+ "typ" : typ
+ },
+ {
+ successCallback: function(data, textStatus, jqXHR) {
+ if (FHC_AjaxClient.isSuccess(data))
+ {
+ FHC_DialogLib.alertSuccess("Done!");
+ InfocenterDetails._refreshLog();
+ }
+ else
+ {
+ FHC_DialogLib.alertError(data);
+ }
+ },
+ errorCallback: function() {
+ FHC_DialogLib.alertWarning("Fehler beim Speichern!");
+ }
+ }
+ );
+ },
+
+ checkNachreichungInputs: function(akteid)
+ {
+ var inputs = $('#nachreichungInputs_' + akteid);
+
+ if (inputs.hasClass('hidden'))
+ {
+ inputs.removeClass('hidden');
+ }
+ else
+ {
+ inputs.addClass('hidden');
+ $('#nachreichungAnmerkung_' + akteid).val("");
+ $('#nachreichungAm_' + akteid).val("");
+ }
+ },
+
+ checkNachreichungButtons: function()
+ {
+ $('select.aktenid').each(function () {
+ var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id);
+ DocUeberpruefung.checkNachreichungButton(akteid);
+ });
+ },
+
+ checkNachreichungButton: function(akteid)
+ {
+ var allowedTyps = ['VorlSpB2', 'ZgvBaPre', 'ZgvMaPre'];
+ var typ = $('#aktenid_' + akteid).val();
+ var infos = $('#nachreichungInfos_' + akteid);
+
+ if ($.inArray(typ, allowedTyps) === -1)
+ infos.addClass('hidden');
+ else
+ infos.removeClass('hidden');
+ }
+
+}
\ No newline at end of file
diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js
index de2ba0064..1e393fc28 100644
--- a/public/js/infocenter/infocenterDetails.js
+++ b/public/js/infocenter/infocenterDetails.js
@@ -119,11 +119,6 @@ $(document).ready(function ()
}
);
- $('.aktenid').change(function(){
- var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id);
- var typ = $(this).val();
- InfocenterDetails.saveDocTyp(personid, akteid, typ);
- });
});
var InfocenterDetails = {
@@ -751,33 +746,6 @@ var InfocenterDetails = {
);
},
- saveDocTyp: function(personid, akteid, typ)
- {
- FHC_AjaxClient.ajaxCallPost(
- CALLED_PATH + "/saveDocTyp/"+encodeURIComponent(personid),
- {
- "akte_id": akteid,
- "typ" : typ
- },
- {
- successCallback: function(data, textStatus, jqXHR) {
- if (FHC_AjaxClient.isSuccess(data))
- {
- FHC_DialogLib.alertSuccess("Done!");
- InfocenterDetails._refreshLog();
- }
- else
- {
- FHC_DialogLib.alertError("Fehler beim Speichern des Dokumententypes!");
- }
- },
- errorCallback: function() {
- FHC_DialogLib.alertWarning("Document type could not be updated");
- }
- }
- );
- },
-
// -----------------------------------------------------------------------------------------------------------------
// (private) methods executed after ajax (refreshers)
diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php
index b977e28a8..9559cb0c2 100644
--- a/system/phrasesupdate.php
+++ b/system/phrasesupdate.php
@@ -3486,6 +3486,26 @@ $phrases = array(
)
)
),
+ array(
+ 'app' => 'infocenter',
+ 'category' => 'infocenter',
+ 'phrase' => 'dokumentWirdNachgereicht',
+ 'insertvon' => 'system',
+ 'phrases' => array(
+ array(
+ 'sprache' => 'German',
+ 'text' => 'Dokument wird nachgereicht',
+ 'description' => '',
+ 'insertvon' => 'system'
+ ),
+ array(
+ 'sprache' => 'English',
+ 'text' => 'Document will be submitted later',
+ 'description' => '',
+ 'insertvon' => 'system'
+ )
+ )
+ ),
array(
'app' => 'core',
'category' => 'global',