Merged in bugfix/HOR-3155 (pull request #5646)

HOR-3155

Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
Paula Quispe
2017-05-11 18:27:10 +00:00
committed by Julio Cesar Laura Avendaño
3 changed files with 36 additions and 11 deletions

View File

@@ -90,7 +90,13 @@ try {
case 'DRAFT':
case 'TO_DO':
//Check if the case is in pause, check a valid record in table APP_DELAY
if (AppDelay::isPaused( $sAppUid, $iDelIndex )) {
$isPaused = AppDelay::isPaused($sAppUid, $iDelIndex);
//Check if the case is a waiting for a SYNCHRONOUS subprocess
$subAppData = new \SubApplication();
$caseSubprocessPending = $subAppData->isSubProcessWithCasePending($sAppUid, $iDelIndex);
if ($isPaused || $caseSubprocessPending) {
//the case is paused show only the resume
$_SESSION['APPLICATION'] = $sAppUid;
$_SESSION['INDEX'] = $iDelIndex;
@@ -109,19 +115,11 @@ try {
if ($_action == 'search') {
//verify if the case is with the current user
$c = new Criteria( 'workflow' );
$c->add( AppDelegationPeer::APP_UID, $sAppUid );
$c->add( AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN' );
$c->add( AppDelegationPeer::DEL_INDEX, $iDelIndex );
$oDataset = AppDelegationPeer::doSelectRs( $c );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
$aData = $oDataset->getRow();
if ($aData['USR_UID'] !== $_SESSION['USER_LOGGED'] && $aData['USR_UID'] !== '') {
$aData = AppDelegation::getCurrentUsers($sAppUid, $iDelIndex);
if ($aData['USR_UID'] !== $_SESSION['USER_LOGGED'] && !empty($aData['USR_UID'])) {
//distinct "" for selfservice
//so we show just the resume
$_SESSION['alreadyDerivated'] = true;
//the case is paused show only the resume
$_SESSION['APPLICATION'] = $sAppUid;
$_SESSION['INDEX'] = $iDelIndex;
$_SESSION['PROCESS'] = $aFields['PRO_UID'];