From 279157b920a2130b7f8a851e136e4f9484ae8101 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 25 Mar 2021 17:12:38 +0100 Subject: [PATCH] Added button to copy Empfehlungstext into reason textarea when rejecting Signed-off-by: cris-technikum --- .../anrechnung/approveAnrechnungDetail.php | 8 ++++++++ .../anrechnung/approveAnrechnungDetail.js | 13 ++++++++++-- system/phrasesupdate.php | 20 +++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/application/views/lehre/anrechnung/approveAnrechnungDetail.php b/application/views/lehre/anrechnung/approveAnrechnungDetail.php index 773cb290f..39c1c47d8 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungDetail.php +++ b/application/views/lehre/anrechnung/approveAnrechnungDetail.php @@ -286,6 +286,14 @@ $this->load->view( +
  • + p->t('anrechnung', 'genehmigungNegativEmpfehlungstextUebernehmen'); ?> + + + +
  • p->t('anrechnung', 'andereBegruendung'); ?>

  • diff --git a/public/js/lehre/anrechnung/approveAnrechnungDetail.js b/public/js/lehre/anrechnung/approveAnrechnungDetail.js index 3fd469294..107bc6a31 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungDetail.js +++ b/public/js/lehre/anrechnung/approveAnrechnungDetail.js @@ -351,8 +351,17 @@ var approveAnrechnungDetail = { // Find closest textarea let textarea = $(elem).closest('div').find('textarea'); - // Copy begruendung into textarea - textarea.val($.trim($(elem).parent().find('span:first').text())); + if (elem.id.length && elem.id == 'empfehlungstextUebernehmen') + { + // Copy Empfehlungstext into textarea + textarea.val($('#approveAnrechnungDetail-empfehlungDetail-begruendung').text()); + return; + } + else + { + // Copy begruendung into textarea + textarea.val($.trim($(elem).parent().find('span:first').text())); + } }, formatEmpfehlungIsRequested: function(empfehlungAngefordertAm, statusBezeichnung) { $('#approveAnrechnungDetail-empfehlungDetail').children().addClass('hidden'); diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index fce82a1d5..6d8651603 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -10430,6 +10430,26 @@ array( ) ) ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'genehmigungNegativEmpfehlungstextUebernehmen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Empfehlungstext des Lektors als Begründung übernehmen.", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Copy the lectors recommendation text as reason for the rejection.", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), );