HOR-1736
This commit is contained in:
@@ -282,7 +282,7 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
|||||||
return (int)$total;
|
return (int)$total;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
public function loadList($usr_uid, $filters = array(), $callbackRecord = null, $appUid = '')
|
||||||
{
|
{
|
||||||
$pmTable = new PmTable();
|
$pmTable = new PmTable();
|
||||||
$criteria = $pmTable->addPMFieldsToList('sent');
|
$criteria = $pmTable->addPMFieldsToList('sent');
|
||||||
@@ -311,6 +311,12 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
|||||||
$criteria->addSelectColumn(ListParticipatedLastPeer::DEL_PRIORITY);
|
$criteria->addSelectColumn(ListParticipatedLastPeer::DEL_PRIORITY);
|
||||||
$criteria->addSelectColumn(ListParticipatedLastPeer::DEL_THREAD_STATUS);
|
$criteria->addSelectColumn(ListParticipatedLastPeer::DEL_THREAD_STATUS);
|
||||||
$criteria->add( ListParticipatedLastPeer::USR_UID, $usr_uid, Criteria::EQUAL );
|
$criteria->add( ListParticipatedLastPeer::USR_UID, $usr_uid, Criteria::EQUAL );
|
||||||
|
|
||||||
|
//Check if the user was participated in a specific case
|
||||||
|
if($appUid != ''){
|
||||||
|
$criteria->add( ListParticipatedLastPeer::APP_UID, $appUid, Criteria::EQUAL );
|
||||||
|
}
|
||||||
|
|
||||||
self::loadFilters($criteria, $filters);
|
self::loadFilters($criteria, $filters);
|
||||||
|
|
||||||
$sort = (!empty($filters['sort'])) ? $filters['sort'] : "DEL_DELEGATE_DATE";
|
$sort = (!empty($filters['sort'])) ? $filters['sort'] : "DEL_DELEGATE_DATE";
|
||||||
|
|||||||
@@ -1004,7 +1004,6 @@ switch (($_POST['action']) ? $_POST['action'] : $_REQUEST['action']) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "previusJump":
|
case "previusJump":
|
||||||
//require_once 'classes/model/Application.php';
|
|
||||||
|
|
||||||
$oCriteria = new Criteria( 'workflow' );
|
$oCriteria = new Criteria( 'workflow' );
|
||||||
$response = array ("success" => true );
|
$response = array ("success" => true );
|
||||||
@@ -1017,8 +1016,27 @@ switch (($_POST['action']) ? $_POST['action'] : $_REQUEST['action']) {
|
|||||||
|
|
||||||
if (is_array( $aApplication )) {
|
if (is_array( $aApplication )) {
|
||||||
$response['exists'] = true;
|
$response['exists'] = true;
|
||||||
|
|
||||||
|
//Check if the user is a supervisor to this Process
|
||||||
|
if(isset($_POST['actionFromList']) && $_POST['actionFromList']==='to_revise'){
|
||||||
|
$oAppCache = new AppCacheView();
|
||||||
|
$aProcesses = $oAppCache->getProUidSupervisor($_SESSION['USER_LOGGED']);
|
||||||
|
if(!in_array($aApplication['PRO_UID'], $aProcesses)){
|
||||||
|
$response['exists'] = false;
|
||||||
|
$response['message'] = G::LoadTranslation('ID_NO_PERMISSION_NO_PARTICIPATED');
|
||||||
|
}
|
||||||
|
} else {//Check if the user participated in this case
|
||||||
|
$oParticipated = new ListParticipatedLast();
|
||||||
|
$aParticipated = $oParticipated->loadList($_SESSION['USER_LOGGED'], array(), null, $aApplication['APP_UID']);
|
||||||
|
if(!sizeof($aParticipated)){
|
||||||
|
//Check in the selfservice list
|
||||||
|
$response['exists'] = false;
|
||||||
|
$response['message'] = G::LoadTranslation('ID_NO_PERMISSION_NO_PARTICIPATED');
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$response['exists'] = false;
|
$response['exists'] = false;
|
||||||
|
$response['message'] = G::LoadTranslation('ID_CASE_DOES_NOT_EXIST_JS', array($_POST['appNumber']));
|
||||||
}
|
}
|
||||||
|
|
||||||
echo Bootstrap::json_encode( $response );
|
echo Bootstrap::json_encode( $response );
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ switch ($RBAC->userCanAccess( 'PM_SUPERVISOR' )) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//If the user does not have the permission and the user can be access from url
|
||||||
$processUser = new ProcessUser();
|
$processUser = new ProcessUser();
|
||||||
$userAccess = $processUser->validateUserAccess($_GET['PRO_UID'], $_SESSION['USER_LOGGED'], 'SUPERVISOR');
|
$userAccess = $processUser->validateUserAccess($_GET['PRO_UID'], $_SESSION['USER_LOGGED'], 'SUPERVISOR');
|
||||||
if(!$userAccess) {
|
if(!$userAccess) {
|
||||||
|
|||||||
@@ -54,17 +54,6 @@ if (! isset( $_GET['APP_UID'] ) || ! isset( $_GET['DEL_INDEX'] )) {
|
|||||||
$delIndex = htmlspecialchars($_GET['DEL_INDEX']);
|
$delIndex = htmlspecialchars($_GET['DEL_INDEX']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( isset($_GET['actionFromList']) && ($_GET['actionFromList'] == 'to_revise') ) {
|
|
||||||
$oApp = new Application;
|
|
||||||
$oApp->Load($appUid);
|
|
||||||
if($oApp->getAppStatus() == 'COMPLETED') {
|
|
||||||
unset($_GET['to_revise']);
|
|
||||||
} else {
|
|
||||||
$_GET['APP_UID'] = $appUid;
|
|
||||||
$_GET['DEL_INDEX'] = $delIndex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
require_once ("classes/model/Step.php");
|
require_once ("classes/model/Step.php");
|
||||||
G::LoadClass( "configuration" );
|
G::LoadClass( "configuration" );
|
||||||
G::LoadClass( "case" );
|
G::LoadClass( "case" );
|
||||||
@@ -105,14 +94,21 @@ if( isset($_GET['action']) && ($_GET['action'] == 'jump') ) {
|
|||||||
$case = $oCase->loadCase( $appUid, $delIndex );
|
$case = $oCase->loadCase( $appUid, $delIndex );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! isset( $_GET['to_revise'] )) {
|
if(isset($_GET['actionFromList']) && ($_GET['actionFromList'] === 'to_revise') ){
|
||||||
$script = 'cases_Open?';
|
$oApp = new Application;
|
||||||
|
$oApp->Load($appUid);
|
||||||
|
//If the case is completed can not update the information from supervisor/review
|
||||||
|
if($oApp->getAppStatus() === 'COMPLETED') {
|
||||||
|
$script = 'cases_Open?';
|
||||||
|
} else {
|
||||||
|
$script = 'cases_OpenToRevise?APP_UID=' . $appUid . '&DEL_INDEX=' . $delIndex;
|
||||||
|
$oHeadPublisher->assign( 'treeToReviseTitle', G::loadtranslation( 'ID_STEP_LIST' ) );
|
||||||
|
$casesPanelUrl = 'casesToReviseTreeContent?APP_UID=' . $appUid . '&DEL_INDEX=' . $delIndex;
|
||||||
|
$oHeadPublisher->assign( 'casesPanelUrl', $casesPanelUrl ); //translations
|
||||||
|
echo "<div id='toReviseTree'></div>";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$script = 'cases_OpenToRevise?';
|
$script = 'cases_Open?';
|
||||||
$oHeadPublisher->assign( 'treeToReviseTitle', G::loadtranslation( 'ID_STEP_LIST' ) );
|
|
||||||
$casesPanelUrl = 'casesToReviseTreeContent?APP_UID=' . $appUid . '&DEL_INDEX=' . $delIndex;
|
|
||||||
$oHeadPublisher->assign( 'casesPanelUrl', $casesPanelUrl ); //translations
|
|
||||||
echo "<div id='toReviseTree'></div>";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// getting bpmn projects
|
// getting bpmn projects
|
||||||
|
|||||||
@@ -156,11 +156,7 @@ function jumpToCase(appNumber){
|
|||||||
if (res.exists === true) {
|
if (res.exists === true) {
|
||||||
params = 'APP_NUMBER=' + appNumber;
|
params = 'APP_NUMBER=' + appNumber;
|
||||||
params += '&action=jump';
|
params += '&action=jump';
|
||||||
|
params += '&actionFromList='+action;
|
||||||
if(action == 'to_revise') {
|
|
||||||
params += '&to_revise=true';
|
|
||||||
params += '&actionFromList=' + action;
|
|
||||||
}
|
|
||||||
|
|
||||||
requestFile = '../cases/open';
|
requestFile = '../cases/open';
|
||||||
redirect(requestFile + '?' + params);
|
redirect(requestFile + '?' + params);
|
||||||
@@ -168,10 +164,10 @@ function jumpToCase(appNumber){
|
|||||||
Ext.MessageBox.hide();
|
Ext.MessageBox.hide();
|
||||||
var message = new Array();
|
var message = new Array();
|
||||||
message['CASE_NUMBER'] = appNumber;
|
message['CASE_NUMBER'] = appNumber;
|
||||||
msgBox(_('ID_INPUT_ERROR'), _('ID_CASE_DOES_NOT_EXIST_JS', appNumber), 'error');
|
msgBox(_('ID_INPUT_ERROR'), _(res.message), 'error');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
params: {action:'previusJump', appNumber: appNumber}
|
params: {action:'previusJump', appNumber: appNumber, actionFromList: action}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user