Merge branch 'feature-40743/Anrechnung_Config-fuer-zusaetzliche-Felder'

This commit is contained in:
Harald Bamberger
2024-07-17 14:08:55 +02:00
6 changed files with 78 additions and 51 deletions
+3
View File
@@ -21,3 +21,6 @@ $config['grades_blocking_application'] = array(
$config['fbl'] = FALSE;
//Enables Info Mails
$config['send_mail'] = TRUE;
// Display fields to explain equivalence of ECTS and LV-Inhalte
$config['explain_equivalence'] = TRUE;
@@ -111,8 +111,13 @@ class requestAnrechnung extends Auth_Controller
$lehrveranstaltung_id = $this->input->post('lv_id');
$studiensemester_kurzbz = $this->input->post('studiensemester');
$bestaetigung = $this->input->post('bestaetigung');
$begruendung_ects = $this->input->post('begruendung_ects');
$begruendung_lvinhalt = $this->input->post('begruendung_lvinhalt');
$begruendung_ects = $this->config->item('explain_equivalence') === TRUE
? $this->input->post('begruendung_ects')
: NULL;
$begruendung_lvinhalt = $this->config->item('explain_equivalence') === TRUE
? $this->input->post('begruendung_lvinhalt')
: NULL;
// Validate data
if (empty($_FILES['uploadfile']['name']))
@@ -124,8 +129,8 @@ class requestAnrechnung extends Auth_Controller
isEmptyString($anmerkung) ||
isEmptyString($lehrveranstaltung_id) ||
isEmptyString($studiensemester_kurzbz) ||
isEmptyString($begruendung_ects) ||
isEmptyString($begruendung_lvinhalt))
($this->config->item('explain_equivalence') === TRUE && isEmptyString($begruendung_ects)) ||
($this->config->item('explain_equivalence') === TRUE && isEmptyString($begruendung_lvinhalt)))
{
return $this->outputJsonError($this->p->t('ui', 'errorFelderFehlen'));
}
@@ -168,7 +173,7 @@ class requestAnrechnung extends Auth_Controller
// Hold just inserted DMS ID
$lastInsert_dms_id = $result->retval['dms_id'];
// Save Anrechnung and Anrechnungstatus
$result = $this->AnrechnungModel->createAnrechnungsantrag(
$prestudent_id,
@@ -1,4 +1,5 @@
<?php
$this->load->config('anrechnung');
$this->load->view(
'templates/FHC-Header',
array(
@@ -172,14 +173,16 @@ $this->load->view(
<th class="col-xs-4"><?php echo $this->p->t('global', 'begruendung'); ?></th>
<td><span id="begruendung_id" data-begruendung_id="<?php echo $anrechnungData->begruendung_id ?>" ><?php echo $anrechnungData->begruendung ?></span></td>
</tr>
<tr>
<th class="col-xs-4"><?php echo $this->p->t('anrechnung', 'begruendungEctsLabel'); ?></th>
<td><span><?php echo $anrechnungData->begruendung_ects ?></span></td>
</tr>
<tr>
<th class="col-xs-4"><?php echo $this->p->t('anrechnung', 'begruendungLvinhaltLabel'); ?></th>
<td><span><?php echo $anrechnungData->begruendung_lvinhalt ?></span></td>
</tr>
<?php if ($this->config->item('explain_equivalence')): ?>
<tr>
<th class="col-xs-4"><?php echo $this->p->t('anrechnung', 'begruendungEctsLabel'); ?></th>
<td><span><?php echo $anrechnungData->begruendung_ects ?></span></td>
</tr>
<tr>
<th class="col-xs-4"><?php echo $this->p->t('anrechnung', 'begruendungLvinhaltLabel'); ?></th>
<td><span><?php echo $anrechnungData->begruendung_lvinhalt ?></span></td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
@@ -4,6 +4,7 @@ const CHAR_LENGTH150 = 150;
const CHAR_LENGTH500 = 500;
const CHAR_LENGTH1000 = 1000;
$this->load->config('anrechnung');
$this->load->view(
'templates/FHC-Header',
array(
@@ -200,27 +201,29 @@ $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>
</div>
<div class="panel-body">
<textarea class="form-control" name="begruendung_ects" rows="1" id="requestAnrechnung-begruendungEcts"
maxlength="<?php echo CHAR_LENGTH150 ?>" 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_LENGTH150 ?></span></span></small>
<?php if ($this->config->item('explain_equivalence')): ?>
<!-- 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>
</div>
<div class="panel-body">
<textarea class="form-control" name="begruendung_ects" rows="1" id="requestAnrechnung-begruendungEcts"
maxlength="<?php echo CHAR_LENGTH150 ?>" 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_LENGTH150 ?></span></span></small>
</div>
</div>
</div>
</div>
</div>
<!-- Begruendung LV Inhalt -->
<div class="row">
<!-- Begruendung LV Inhalt -->
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
@@ -240,6 +243,8 @@ $this->load->view(
</div>
</div>
</div>
<?php endif; ?>
<!-- Dokument Upload-->
<div class="row">
<div class="col-lg-12">
@@ -1,4 +1,5 @@
<?php
$this->load->config('anrechnung');
$this->load->view(
'templates/FHC-Header',
array(
@@ -143,14 +144,16 @@ $this->load->view(
target="_blank"><?php echo htmlentities($anrechnungData->dokumentname) ?></a>
</td>
</tr>
<tr>
<th class="col-xs-4"><?php echo $this->p->t('anrechnung', 'begruendungEctsLabel'); ?></th>
<td><span><?php echo $anrechnungData->begruendung_ects ?></span></td>
</tr>
<tr>
<th class="col-xs-4"><?php echo $this->p->t('anrechnung', 'begruendungLvinhaltLabel'); ?></th>
<td><span><?php echo $anrechnungData->begruendung_lvinhalt ?></span></td>
</tr>
<?php if ($this->config->item('explain_equivalence')): ?>
<tr>
<th class="col-xs-4"><?php echo $this->p->t('anrechnung', 'begruendungEctsLabel'); ?></th>
<td><span><?php echo $anrechnungData->begruendung_ects ?></span></td>
</tr>
<tr>
<th class="col-xs-4"><?php echo $this->p->t('anrechnung', 'begruendungLvinhaltLabel'); ?></th>
<td><span><?php echo $anrechnungData->begruendung_lvinhalt ?></span></td>
</tr>
<?php endif; ?>
</tbody>
</table>
+20 -12
View File
@@ -101,8 +101,12 @@ $(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,
begruendung_ects: this.begruendung_ects && this.begruendung_ects.value
? this.begruendung_ects.value
: null,
begruendung_lvinhalt: this.begruendung_lvinhalt && this.begruendung_lvinhalt.value
? this.begruendung_lvinhalt.value
: null,
bestaetigung: this.bestaetigung.value,
uploadfile: this.uploadfile.files
},
@@ -216,18 +220,22 @@ var requestAnrechnung = {
$('#requestAnrechnung-herkunftDerKenntnisse-charCounter').text(length);
});
$('#requestAnrechnung-begruendungEcts').keyup(function() {
let length = CHAR_LENGTH150 - $(this).val().length;
$('#requestAnrechnung-begruendungEcts-charCounter').text(length);
});
if ($('#requestAnrechnung-begruendungEcts').length) {
$('#requestAnrechnung-begruendungEcts').keyup(function () {
let length = CHAR_LENGTH150 - $(this).val().length;
$('#requestAnrechnung-begruendungEcts-charCounter').text(length);
});
}
$('#requestAnrechnung-begruendungLvinhalt').keyup(function() {
let maxlength = CHAR_LENGTH1000 - $(this).val().length;
$('#requestAnrechnung-begruendungLvinhalt-charCounterMax').text(maxlength);
if ($('#requestAnrechnung-begruendungLvinhalt').length){
$('#requestAnrechnung-begruendungLvinhalt').keyup(function() {
let maxlength = CHAR_LENGTH1000 - $(this).val().length;
$('#requestAnrechnung-begruendungLvinhalt-charCounterMax').text(maxlength);
let minlength = CHAR_LENGTH500 - $(this).val().length;
$('#requestAnrechnung-begruendungLvinhalt-charCounterMin').text(minlength);
});
let minlength = CHAR_LENGTH500 - $(this).val().length;
$('#requestAnrechnung-begruendungLvinhalt-charCounterMin').text(minlength);
});
}
},
formatAnrechnungIsApplied: function (antragdatum, dms_id, filename){
$('#requestAnrechnung-antragdatum').text(antragdatum);