diff --git a/workflow/engine/controllers/appProxy.php b/workflow/engine/controllers/appProxy.php index b9e985a8a..59bd6fff6 100644 --- a/workflow/engine/controllers/appProxy.php +++ b/workflow/engine/controllers/appProxy.php @@ -181,7 +181,7 @@ class AppProxy extends HttpProxyController throw new Exception( G::LoadTranslation( 'ID_NO_PERMISSION_NO_PARTICIPATED' ) ); } - if ($httpData->action == 'sent') { // Get the last valid delegation for participated list + if (($httpData->action == 'sent') || ($httpData->action == 'search')){ // Get the last valid delegation for participated list $criteria = new Criteria(); $criteria->addSelectColumn(AppDelegationPeer::DEL_INDEX); $criteria->add(AppDelegationPeer::APP_UID, $httpData->appUid); diff --git a/workflow/engine/methods/cases/cases_Open.php b/workflow/engine/methods/cases/cases_Open.php index 03a72afc0..88bfbadc6 100755 --- a/workflow/engine/methods/cases/cases_Open.php +++ b/workflow/engine/methods/cases/cases_Open.php @@ -98,16 +98,18 @@ try { /** * these routine is to verify if the case was acceded from advaced search list */ + if ($_action == 'search') { //verify if the case is with teh current user + $c = new Criteria( 'workflow' ); $c->add( AppDelegationPeer::APP_UID, $sAppUid ); - $c->addDescendingOrderByColumn( AppDelegationPeer::DEL_INDEX ); + $c->addAscendingOrderByColumn( AppDelegationPeer::DEL_INDEX ); $oDataset = AppDelegationPeer::doSelectRs( $c ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); $aData = $oDataset->getRow(); - + if ($aData['USR_UID'] != $_SESSION['USER_LOGGED'] && $aData['USR_UID'] != "") { //distinct "" for selfservice //so we show just the resume