From 39016b873fd82ef00d7491ee7fd79ea036558881 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 3 Feb 2021 12:41:26 +0100 Subject: [PATCH] Adapted STGL overview: info/begruendungsangabe when approving/rejecting Signed-off-by: cris-technikum --- .../approveAnrechnungUebersicht.php | 57 ++++++++- .../anrechnung/approveAnrechnungUebersicht.js | 67 +++++++++- system/phrasesupdate.php | 121 ++++++++++++++++++ 3 files changed, 240 insertions(+), 5 deletions(-) diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php index a19b13d57..ef9a419ae 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php @@ -115,9 +115,59 @@ $this->load->view( load->view('lehre/anrechnung/approveAnrechnungUebersichtData.php'); ?> - + +
+ + +
+
-
-
@@ -149,7 +198,7 @@ $this->load->view(
-
+ diff --git a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js index bcbf0695d..485596b12 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js @@ -172,6 +172,18 @@ $(function(){ // Approve Anrechnungen $("#approve-anrechnungen").click(function(){ + let genehmigung_panel = $('#approveAnrechnungUebersicht-empfehlung-panel'); + let begruendung_panel = $('#approveAnrechnungUebersicht-begruendung-panel'); + + begruendung_panel.css('display', 'none'); + + if (genehmigung_panel.is(":hidden")) + { + // Show begruendung panel if is hidden + genehmigung_panel.slideDown('slow'); + return; + } + // Get selected rows data let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData') .map(function(data){ @@ -188,12 +200,14 @@ $(function(){ return; } - // Prepare data object for ajax call let data = { 'data': selected_data }; + // Hide genehmigung panel again + genehmigung_panel.slideUp('slow'); + FHC_AjaxClient.ajaxCallPost( FHC_JS_DATA_STORAGE_OBJECT.called_path + "/approve", data, @@ -225,6 +239,28 @@ $(function(){ // Reject Anrechnungen $("#reject-anrechnungen").click(function(){ + let begruendung_panel = $('#approveAnrechnungUebersicht-begruendung-panel'); + let begruendung = $('#approveAnrechnungUebersicht-begruendung').val(); + let genehmigung_panel = $('#approveAnrechnungUebersicht-empfehlung-panel'); + + genehmigung_panel.css('display', 'none'); + + if (begruendung_panel.is(":hidden")) + { + // Show begruendung panel if is hidden + begruendung_panel.slideDown('slow'); + return; + } + else + { + // Check if begruendung is given + if (!begruendung.trim()) // empty or white spaces only + { + FHC_DialogLib.alertInfo('Bitte tragen Sie eine Begründung ein.'); + return; + } + } + // Get selected rows data let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData') .map(function(data){ @@ -252,6 +288,9 @@ $(function(){ 'data': selected_data }; + // Hide begruendung panel again + $(begruendung_panel).slideUp('slow'); + FHC_AjaxClient.ajaxCallPost( FHC_JS_DATA_STORAGE_OBJECT.called_path + "/reject", data, @@ -344,6 +383,24 @@ $(function(){ ); }); + // Break Genehmigung abgeben + $('#approveAnrechnungUebersicht-empfehlung-abbrechen').click(function(){ + $('#approveAnrechnungUebersicht-empfehlung-panel').slideUp('slow'); + + }) + + // Break Ablehnung abgeben + $('#approveAnrechnungUebersicht-begruendung-abbrechen').click(function(){ + $('#approveAnrechnungUebersicht-begruendung').val(''); + $('#approveAnrechnungUebersicht-begruendung-panel').slideUp('slow'); + + }) + + // Copy Begruendung into textarea + $(".btn-copyIntoTextarea").click(function(){ + approveAnrechnung.copyIntoTextarea(this); + }) + }); var approveAnrechnung = { @@ -363,5 +420,13 @@ var approveAnrechnung = { default: $('#requestAnrechnung-status_kurzbz').closest('div').addClass('alert-warning'); } + }, + copyIntoTextarea: function(elem){ + + // Find closest textarea + let textarea = $(elem).closest('div').find('textarea'); + + // Copy begruendung into textarea + textarea.val($.trim($(elem).parent().text())); } } \ No newline at end of file diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 08ae59701..febf31dfd 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -9068,7 +9068,128 @@ Any unusual occurrences 'insertvon' => 'system' ) ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'genehmigungNegativ', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Antrag wird nicht genehmigt.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'genehmigungenNegativ', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anträge werden nicht genehmigt.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'genehmigungNegativPruefungNichtMoeglich', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anrechnung wird nicht genehmigt, weil die Prüfung der Gleichwertigkeit aus formalen Gründen (z.B. mangelhafte Unterlagen) nicht möglich war.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'genehmigungNegativKenntnisseNichtGleichwertig', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anrechnung wird nicht genehmigt, weil die Kenntnisse inhaltlich und umfangmäßig nicht gleichwertig sind.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'genehmigungenPositiv', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anrechnungen werden genehmigt, weil die Kenntnisse inhaltlich und umfangmäßig gleichwertig sind.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'genehmigungPositiv', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anrechnungen wird genehmigt, weil die Kenntnisse inhaltlich und umfangmäßig gleichwertig sind.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) ) + );