Adapted GUI to display and save begruendung_ects and begruendung_lvinhalt

This commit is contained in:
Cris
2023-07-20 13:38:52 +02:00
parent 8bb3b6d53c
commit 54d819e1ea
2 changed files with 66 additions and 8 deletions
@@ -1,5 +1,7 @@
<?php
const HERKUNFT_DER_KENNTNISSE_MAX_LENGTH = 125;
const CHAR_LENGTH125 = 125;
const CHAR_LENGTH500 = 500;
const CHAR_LENGTH1500 = 1500;
$this->load->view(
'templates/FHC-Header',
@@ -197,6 +199,47 @@ $this->load->view(
</div>
</div>
</div>
<!-- Begruendung ECTS -->
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
<b><?php echo $this->p->t('anrechnung', 'begruendungEcts'); ?></b>&emsp;
<span class="requestAnrechnung-anrechnungInfoTooltip" data-toggle="tooltip" data-placement="right"
title="<?php echo $this->p->t('anrechnung', 'anrechnungBegruendungEctsTooltipText'); ?>">
<i class="fa fa-lg fa-info-circle" aria-hidden="true"></i>
</span>
<a href="https://www.technikum-wien.at" target="_blank" class="pull-right">ECTS Berechnung Referenzbeispiele</a>
</div>
<div class="panel-body">
<textarea class="form-control" name="begruendung_ects" rows="3" id="requestAnrechnung-begruendungEcts"
maxlength="<?php echo CHAR_LENGTH125 ?>" required><?php echo $anrechnungData->begruendung_ects; ?></textarea>
<small><span class="text-muted pull-right"><?php echo $this->p->t('ui', 'maxZeichen'); ?> :<span id="requestAnrechnung-begruendungEcts-charCounter"><?php echo CHAR_LENGTH125 ?></span></span></small>
</div>
</div>
</div>
</div>
<!-- Begruendung LV Inhalt -->
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
<b><?php echo $this->p->t('anrechnung', 'begruendungLvinhalt'); ?></b>&emsp;
<span class="requestAnrechnung-anrechnungInfoTooltip" data-toggle="tooltip" data-placement="right"
title="<?php echo $this->p->t('anrechnung', 'anrechnungBegruendungLvinhaltTooltipText'); ?>">
<i class="fa fa-lg fa-info-circle" aria-hidden="true"></i>
</span>
</div>
<div class="panel-body">
<textarea class="form-control" name="begruendung_lvinhalt" rows="7" id="requestAnrechnung-begruendungLvinhalt"
minlength="<?php echo CHAR_LENGTH500 ?>"
maxlength="<?php echo CHAR_LENGTH1500 ?>" required><?php echo $anrechnungData->begruendung_lvinhalt; ?></textarea>
<small><span class="text-muted pull-right">&nbsp;/&nbsp;<?php echo $this->p->t('ui', 'maxZeichen'); ?> :<span id="requestAnrechnung-begruendungLvinhalt-charCounterMax"><?php echo CHAR_LENGTH1500 ?></span></span></small>
<small><span class="text-muted pull-right"><?php echo $this->p->t('ui', 'fehlendeMinZeichen'); ?> :<span id="requestAnrechnung-begruendungLvinhalt-charCounterMin"><?php echo CHAR_LENGTH500 ?></span></span></small>
</div>
</div>
</div>
</div>
<!-- Dokument Upload-->
<div class="row">
<div class="col-lg-12">
@@ -242,8 +285,8 @@ $this->load->view(
</div>
<div class="panel-body">
<textarea class="form-control" name="anmerkung" rows="1" id="requestAnrechnung-herkunftDerKenntnisse"
maxlength="<?php echo HERKUNFT_DER_KENNTNISSE_MAX_LENGTH ?>" required><?php echo $anrechnungData->anmerkung; ?></textarea>
<small><span class="text-muted pull-right"><?php echo $this->p->t('ui', 'maxZeichen'); ?> :<span id="requestAnrechnung-herkunftDerKenntnisse-charCounter"><?php echo HERKUNFT_DER_KENNTNISSE_MAX_LENGTH ?></span></span></small>
maxlength="<?php echo CHAR_LENGTH125 ?>" required><?php echo $anrechnungData->anmerkung; ?></textarea>
<small><span class="text-muted pull-right"><?php echo $this->p->t('ui', 'maxZeichen'); ?> :<span id="requestAnrechnung-herkunftDerKenntnisse-charCounter"><?php echo CHAR_LENGTH125 ?></span></span></small>
</div>
</div>
</div>
@@ -1,6 +1,8 @@
const ANRECHNUNGSTATUS_APPROVED = 'approved';
const ANRECHNUNGSTATUS_REJECTED = 'rejected';
const HERKUNFT_DER_KENNTNISSE_MAX_LENGTH = 125;
const CHAR_LENGTH125 = 125;
const CHAR_LENGTH500 = 500;
const CHAR_LENGTH1500 = 1500;
const COLOR_DANGER = '#f2dede';
@@ -25,7 +27,7 @@ $(function(){
// Alert message inside Begruendungsbox, if maximum ECTS exceeded
requestAnrechnung.alertIfMaxEctsExceededInsideBegruendungsbox();
// Set chars counter for textarea 'Herkunft der Kenntnisse'
// Set chars counter for textareas
requestAnrechnung.setCharsCounter();
// If Sperregrund exists: display Sperre panel, hide Status panel and disable all form elements
@@ -98,6 +100,8 @@ $(function(){
begruendung: this.begruendung.value,
lv_id: this.lv_id.value,
studiensemester: this.studiensemester.value,
begruendung_ects: this.begruendung_ects.value,
begruendung_lvinhalt: this.begruendung_lvinhalt.value,
bestaetigung: this.bestaetigung.value,
uploadfile: this.uploadfile.files
},
@@ -207,11 +211,22 @@ var requestAnrechnung = {
},
setCharsCounter: function(){
$('#requestAnrechnung-herkunftDerKenntnisse').keyup(function() {
let length = HERKUNFT_DER_KENNTNISSE_MAX_LENGTH - $(this).val().length;
let length = CHAR_LENGTH125 - $(this).val().length;
$('#requestAnrechnung-herkunftDerKenntnisse-charCounter').text(length);
});
$('#requestAnrechnung-begruendungEcts').keyup(function() {
let length = CHAR_LENGTH125 - $(this).val().length;
$('#requestAnrechnung-begruendungEcts-charCounter').text(length);
});
$('#requestAnrechnung-begruendungLvinhalt').keyup(function() {
let maxlength = CHAR_LENGTH1500 - $(this).val().length;
$('#requestAnrechnung-begruendungLvinhalt-charCounterMax').text(maxlength);
let minlength = CHAR_LENGTH500 - $(this).val().length;
$('#requestAnrechnung-begruendungLvinhalt-charCounterMin').text(minlength);
});
},
formatAnrechnungIsApplied: function (antragdatum, dms_id, filename){
$('#requestAnrechnung-antragdatum').text(antragdatum);