diff --git a/application/controllers/lehre/anrechnung/CreateAnrechnung.php b/application/controllers/lehre/anrechnung/CreateAnrechnung.php index e77c0a469..1b52dddf5 100644 --- a/application/controllers/lehre/anrechnung/CreateAnrechnung.php +++ b/application/controllers/lehre/anrechnung/CreateAnrechnung.php @@ -166,8 +166,13 @@ class CreateAnrechnung extends Auth_Controller $this->terminateWithJsonError(getError($result)); } + $lastInsert_anrechnung_id = getData($result); + // Success response to AJAX - $this->outputJsonSuccess($this->p->t('global', 'antragWurdeAngelegt')); + $this->outputJsonSuccess(array( + 'anrechnung_id' => $lastInsert_anrechnung_id, + 'msg' => $this->p->t('global', 'antragWurdeAngelegt') + )); } diff --git a/application/models/education/Anrechnung_model.php b/application/models/education/Anrechnung_model.php index d3d1561ba..d65c79f51 100644 --- a/application/models/education/Anrechnung_model.php +++ b/application/models/education/Anrechnung_model.php @@ -59,7 +59,7 @@ class Anrechnung_model extends DB_Model return error('Failed inserting Anrechnung', EXIT_ERROR); } - return success(); + return success($lastInsert_anrechnung_id); } /** diff --git a/application/views/lehre/anrechnung/createAnrechnung.php b/application/views/lehre/anrechnung/createAnrechnung.php index 7e4e0b4dc..58b0757b9 100644 --- a/application/views/lehre/anrechnung/createAnrechnung.php +++ b/application/views/lehre/anrechnung/createAnrechnung.php @@ -15,7 +15,8 @@ $this->load->view( 'global' => array( 'anerkennungNachgewiesenerKenntnisse', 'antragWurdeGestellt', - 'antragBereitsGestellt' + 'antragBereitsGestellt', + 'antragBearbeiten' ), 'ui' => array( 'hochladen' @@ -153,12 +154,14 @@ $this->load->view( -
+ + +
diff --git a/public/js/lehre/anrechnung/createAnrechnung.js b/public/js/lehre/anrechnung/createAnrechnung.js index 82286205e..176821f2c 100644 --- a/public/js/lehre/anrechnung/createAnrechnung.js +++ b/public/js/lehre/anrechnung/createAnrechnung.js @@ -28,7 +28,10 @@ $(function () { if (FHC_AjaxClient.hasData(data)) { - FHC_DialogLib.alertSuccess(FHC_AjaxClient.getData(data)); + FHC_DialogLib.alertSuccess(FHC_AjaxClient.getData(data).msg); + + // Display button to open Anrechnung in new tab + createAnrechnung.displayButtonToOpenAnrechnung(FHC_AjaxClient.getData(data).anrechnung_id); } }, errorCallback: function (jqXHR, textStatus, errorThrown) @@ -97,6 +100,9 @@ var createAnrechnung = { // Empty form fields (except hidden ones) $('#createAnrechnung-form :input:not([type=hidden])').val(''); + + // Hide eventually displayed button to open Anrechnung + $('#createAnrechnung-openAnrechnung').addClass('hidden'); }, disableFormFields: function(){ let prestudent_id = $('#prestudent_id').data('prestudent_id'); @@ -142,5 +148,12 @@ var createAnrechnung = { } } ); + }, + displayButtonToOpenAnrechnung: function(anrechnung_id){ + // Display button to open Anrechnung in new tab + $('#createAnrechnung-openAnrechnung') + .removeClass('hidden') + .attr('href', 'ApproveAnrechnungDetail/?anrechnung_id=' + anrechnung_id) + .html(' ' + FHC_PhrasesLib.t("global", "antragBearbeiten")); } } \ No newline at end of file diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 3a4b3e276..c1f96974c 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -12212,7 +12212,26 @@ array( ) ) ), - + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'antragBearbeiten', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Antrag bearbeiten", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Go to application", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), );