mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 08:34:29 +00:00
Fixed: Added formatted download-document-link after application was done
After refactoring the code and doing the application via AJAX call, the document-download-link must be created on ajax success. This was missing and is fixed now. Signed-off-by: cris-technikum <[email protected]>
This commit is contained in:
@@ -110,12 +110,13 @@ class requestAnrechnung extends Auth_Controller
|
||||
// Validate data
|
||||
if (empty($_FILES['uploadfile']['name']))
|
||||
{
|
||||
show_error('Missing upload file');
|
||||
return $this->outputJsonError($this->p->t('ui', 'errorUploadFehlt'));
|
||||
}
|
||||
|
||||
if (isEmptyString($begruendung_id) || isEmptyString($lehrveranstaltung_id) || isEmptyString($studiensemester_kurzbz))
|
||||
if (isEmptyString($begruendung_id) || isEmptyString($anmerkung) ||
|
||||
isEmptyString($lehrveranstaltung_id) || isEmptyString($studiensemester_kurzbz))
|
||||
{
|
||||
show_error('Missing correct parameter');
|
||||
return $this->outputJsonError($this->p->t('ui', 'errorFelderFehlen'));
|
||||
}
|
||||
|
||||
// Exit if user is not a student
|
||||
@@ -172,7 +173,8 @@ class requestAnrechnung extends Auth_Controller
|
||||
|
||||
// Output to AJAX
|
||||
return $this->outputJsonSuccess(array(
|
||||
'antragdatum' => (new DateTime())->format('d.m.Y')
|
||||
'antragdatum' => (new DateTime())->format('d.m.Y'),
|
||||
'dms_id' => $lastInsert_dms_id
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,9 @@ $(function(){
|
||||
if (!data.error && data.retval != null)
|
||||
{
|
||||
requestAnrechnung.formatAnrechnungIsApplied(
|
||||
data.retval.antragdatum
|
||||
data.retval.antragdatum,
|
||||
data.retval.dms_id,
|
||||
formdata.get('uploadfile').name
|
||||
);
|
||||
|
||||
FHC_DialogLib.alertSuccess(FHC_PhrasesLib.t("global", "antragWurdeGestellt"));
|
||||
@@ -83,11 +85,17 @@ var requestAnrechnung = {
|
||||
}
|
||||
);
|
||||
},
|
||||
formatAnrechnungIsApplied: function (antragdatum){
|
||||
formatAnrechnungIsApplied: function (antragdatum, dms_id, filename){
|
||||
$('#requestAnrechnung-antragdatum').text(antragdatum);
|
||||
$('#requestAnrechnung-status_kurzbz').text(FHC_PhrasesLib.t("ui", "inBearbeitung"));
|
||||
$('#requestAnrechnung-status_kurzbz').closest('div').addClass('alert-warning');
|
||||
|
||||
// Display File-Downloadlink
|
||||
$('#requestAnrechnung-downloadDocLink')
|
||||
.removeClass('hidden')
|
||||
.attr('href', 'RequestAnrechnung/download?dms_id=' + dms_id)
|
||||
.html(filename);
|
||||
|
||||
// Disable all form elements
|
||||
$("#requestAnrechnung-form :input").prop("disabled", true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user