Merged in bugfix/PMCORE-3182 (pull request #8277)

PMCORE-3182

Approved-by: Julio Cesar Laura Avendaño
This commit is contained in:
Paula Quispe
2021-11-16 14:56:01 +00:00
committed by Julio Cesar Laura Avendaño
2 changed files with 23 additions and 8 deletions

View File

@@ -16,6 +16,7 @@
use ProcessMaker\BusinessModel\Cases as BmCases; use ProcessMaker\BusinessModel\Cases as BmCases;
use ProcessMaker\BusinessModel\ProcessSupervisor; use ProcessMaker\BusinessModel\ProcessSupervisor;
use ProcessMaker\Core\System;
$tBarGmail = false; $tBarGmail = false;
if (isset($_GET['gmail']) && $_GET['gmail'] == 1) { if (isset($_GET['gmail']) && $_GET['gmail'] == 1) {
@@ -157,6 +158,7 @@ if ($isBpmn && $viewSummaryForm && $isNoEmpty) {
} }
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
$pmDynaform = new PmDynaform();
$step = new Step(); $step = new Step();
$step = $step->loadByProcessTaskPosition($case['PRO_UID'], $case['TAS_UID'], 1); $step = $step->loadByProcessTaskPosition($case['PRO_UID'], $case['TAS_UID'], 1);
$headPublisher->assign('uri', $script . $uri); $headPublisher->assign('uri', $script . $uri);
@@ -171,6 +173,11 @@ $headPublisher->assign('appStatus', $case['APP_STATUS']);
$headPublisher->assign('tbarGmail', $tBarGmail); $headPublisher->assign('tbarGmail', $tBarGmail);
$headPublisher->assign('showCustomForm', $showCustomForm); $headPublisher->assign('showCustomForm', $showCustomForm);
$headPublisher->assign('canClaimCase', $canClaimCase); $headPublisher->assign('canClaimCase', $canClaimCase);
$headPublisher->assign('_CREDENTIALS', G::json_encode($pmDynaform->getCredentials()));
$headPublisher->assign('_SERVER', System::getHttpServerHostnameRequestsFrontEnd());
$headPublisher->assign('_WORKSPACE', config("system.workspace"));
$headPublisher->assign('_DEL_INDEX_DELEGATE', $delIndex);
$headPublisher->assign('_USR_DELEGATE', $case['CURRENT_USER_UID']);
if (!isset($_SESSION['APPLICATION']) || !isset($_SESSION['TASK']) || !isset($_SESSION['INDEX'])) { if (!isset($_SESSION['APPLICATION']) || !isset($_SESSION['TASK']) || !isset($_SESSION['INDEX'])) {
$_SESSION['PROCESS'] = $case['PRO_UID']; $_SESSION['PROCESS'] = $case['PRO_UID'];

View File

@@ -1368,7 +1368,8 @@ Ext.onReady(function(){
Actions.reassignCase = function() Actions.reassignCase = function()
{ {
var rowSelected = Ext.getCmp("grdpnlUsersToReassign").getSelectionModel().getSelected(); var rowSelected = Ext.getCmp("grdpnlUsersToReassign").getSelectionModel().getSelected();
var msg = "";
var credentials = JSON.parse(_CREDENTIALS);
if( rowSelected ) { if( rowSelected ) {
if (Ext.getCmp('idTextareaReason').getValue() === '') { if (Ext.getCmp('idTextareaReason').getValue() === '') {
Ext.Msg.alert(_('ID_ALERT'), _('ID_THE_REASON_REASSIGN_USER_EMPTY')); Ext.Msg.alert(_('ID_ALERT'), _('ID_THE_REASON_REASSIGN_USER_EMPTY'));
@@ -1376,11 +1377,17 @@ Ext.onReady(function(){
} }
PMExt.confirm(_('ID_CONFIRM'), _('ID_REASSIGN_CONFIRM'), function(){ PMExt.confirm(_('ID_CONFIRM'), _('ID_REASSIGN_CONFIRM'), function(){
Ext.Ajax.request({ Ext.Ajax.request({
url : 'ajaxListener' , method:"PUT",
params : {action : 'reassignCase', USR_UID: rowSelected.data.USR_UID, NOTE_REASON: Ext.getCmp('idTextareaReason').getValue(), NOTIFY_REASSIGN: Ext.getCmp('idCheckboxReason').getValue()}, url: _SERVER + "/api/1.0/" + _WORKSPACE + `/cases/${_APP_UID}/reassign-case`,
success: function ( result, request ) { headers: {
var data = Ext.util.JSON.decode(result.responseText); "Accept": "application/json",
if( data.status == 0 ) { "Content-Type": "application/json",
"Authorization": `Bearer ` + credentials.accessToken,
},
jsonData : {del_index : _DEL_INDEX_DELEGATE, usr_uid_target: rowSelected.data.USR_UID,usr_uid_source: _USR_DELEGATE, reason: Ext.getCmp('idTextareaReason').getValue()},
success: function (result, request) {
var data = result;
if( data.status == 0 || data.status == 200) {
try { try {
if (typeof parent.notify !== "undefined") { if (typeof parent.notify !== "undefined") {
parent.notify('', data.msg); parent.notify('', data.msg);
@@ -1402,8 +1409,9 @@ Ext.onReady(function(){
alert(data.msg); alert(data.msg);
} }
}, },
failure: function ( result, request) { failure: function (result, request) {
Ext.MessageBox.alert( _('ID_FAILED') , result.responseText); msg = JSON.parse(result.responseText);
Ext.MessageBox.alert( _('ID_FAILED') , msg.error? msg.error.message: "");
} }
}); });
}); });