Added new Ablehnungstext and checks to Lector Detail View

. Changed Ablehnungstext
. Trim text and focus on textarea to fasten editing
. Check if forgot to add own Begründungstext
This commit is contained in:
Cris
2023-03-09 16:11:37 +01:00
parent 3e092bf375
commit 1da8881905
2 changed files with 31 additions and 2 deletions
@@ -21,6 +21,7 @@ $this->load->view(
'systemfehler',
'bitteMindEinenAntragWaehlen',
'bitteBegruendungAngeben',
'bitteBegruendungVervollstaendigen',
'anrechnungenWurdenEmpfohlen',
'anrechnungenWurdenNichtEmpfohlen'
),
@@ -234,7 +235,7 @@ $this->load->view(
</span>
</li>
<li class="list-group-item">
<span><?php echo $this->p->t('anrechnung', 'empfehlungNegativKenntnisseNichtGleichwertig'); ?></span>&emsp;
<span><?php echo $this->p->t('anrechnung', 'empfehlungNegativKenntnisseNichtGleichwertigWeil'); ?></span>&emsp;
<span class="btn-copyIntoTextarea pull-right" data-toggle="tooltip"
data-placement="right"
title="<?php echo $this->p->t('ui', 'textUebernehmen'); ?>">
@@ -133,6 +133,13 @@ $(function(){
return;
}
// Check if forgot to fulfill begruendung
if (begruendung.trim().endsWith('weil') || begruendung.endsWith('because of'))
{
FHC_DialogLib.alertInfo(FHC_PhrasesLib.t("ui", "bitteBegruendungVervollstaendigen"));
return;
}
// Get form data
let form_data = $('form').serializeArray();
@@ -241,8 +248,29 @@ var reviewAnrechnung = {
// Find closest textarea
let textarea = $(elem).closest('div').find('textarea');
// Find Begruendung span
let textspan = $(elem).parent().find('span:first');
// Get Begruendung
let begruendung = textspan.text();
// Check if Begruendung has helptext
let hasHelptext = textspan.children('span #helpTxtBegruendungErgaenzen').length > 0;
if (hasHelptext)
{
let helptext = textspan.children('span #helpTxtBegruendungErgaenzen').text();
// Remove helptext
begruendung = begruendung.replace(helptext, '');
// Focus into textarea to encourage writing
textarea.focus();
}
// Copy begruendung into textarea
textarea.val($.trim($(elem).parent().find('span:first').text()));
textarea.val($.trim(begruendung));
},
formatEmpfehlungIsTrue: function(empfehlungAm, emfehlungVon, statusBezeichnung){
$('#reviewAnrechnungDetail-status_kurzbz').text(statusBezeichnung);