diff --git a/resources/assets/js/api/Cases.js b/resources/assets/js/api/Cases.js index a6e3ce1a8..893afe686 100644 --- a/resources/assets/js/api/Cases.js +++ b/resources/assets/js/api/Cases.js @@ -236,7 +236,8 @@ export let cases = { usr_uid_target: data.userSelected, del_index: data.DEL_INDEX, reason: data.reasonReassign, - sendMail: data.notifyUser + sendMail: data.notifyUser, + usr_uid_source: window.config.userConfig.usr_uid }, keys: { app_uid: data.APP_UID diff --git a/resources/assets/js/home/modal/ModalReassignCase.vue b/resources/assets/js/home/modal/ModalReassignCase.vue index 393fa6c0b..a6c5135f6 100644 --- a/resources/assets/js/home/modal/ModalReassignCase.vue +++ b/resources/assets/js/home/modal/ModalReassignCase.vue @@ -9,6 +9,15 @@ {{ $t('ID_REASSIGN_CASE') }} + + {{ dataAlert.message }} + @@ -56,7 +65,7 @@ variant="success" @click="reassignCase" > - {{ $t("ID_PAUSE") }} + {{ $t("ID_REASSIGN") }} @@ -75,6 +84,12 @@ export default { mounted() {}, data() { return { + dataAlert: { + dismissSecs: 5, + dismissCountDown: 0, + message: "", + variant: "danger", + }, data: null, locale: 'en-US', users: [], @@ -145,8 +160,31 @@ export default { that.$parent.$refs["vueCardView"].getData(); } } + }) + .catch((e) => { + if(e.response.data && e.response.data.error){ + that.showAlert(e.response.data.error.message, "danger"); + } }); }, + /** + * Show the alert message + * @param {string} message - message to be displayen in the body + * @param {string} type - alert type + */ + showAlert(message, type) { + this.dataAlert.message = message; + this.dataAlert.variant = type || "info"; + this.dataAlert.dismissCountDown = this.dataAlert.dismissSecs; + }, + /** + * Updates the alert dismiss value to update + * dismissCountDown and decrease + * @param {mumber} + */ + countDownChanged(dismissCountDown) { + this.dataAlert.dismissCountDown = dismissCountDown; + } }, }; \ No newline at end of file diff --git a/workflow/engine/methods/cases/viena_init.php b/workflow/engine/methods/cases/viena_init.php index 99dc21d30..2baa635a3 100644 --- a/workflow/engine/methods/cases/viena_init.php +++ b/workflow/engine/methods/cases/viena_init.php @@ -143,4 +143,7 @@ ScriptVariables::add('SYS_LANG', SYS_LANG); ScriptVariables::add('TRANSLATIONS', $translation); ScriptVariables::add('FORMATS', $conf->getFormats()); ScriptVariables::add('userId', User::getId($_SESSION['USER_LOGGED'])); +ScriptVariables::add('userConfig', array( + "usr_uid" => $_SESSION['USER_LOGGED'] +)); echo View::make('Views::home.home', compact("userCanAccess"))->render();