Merge pull request #881 from Jennydmz/BUG-8905
Bug 8905 Unpause a Case from a supervisor session.
This commit is contained in:
@@ -419,6 +419,42 @@ class AppCacheView extends BaseAppCacheView
|
||||
return $this->getUnassigned($userUid, false);
|
||||
}
|
||||
|
||||
public function getProUidSupervisor($userUid)
|
||||
{
|
||||
//finding cases PRO_UID where $userUid is supervising
|
||||
require_once ('classes/model/ProcessUser.php');
|
||||
require_once ('classes/model/GroupUser.php');
|
||||
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(ProcessUserPeer::USR_UID, $userUid);
|
||||
$oCriteria->add(ProcessUserPeer::PU_TYPE, 'SUPERVISOR');
|
||||
$oDataset = ProcessUserPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$aProcesses = array();
|
||||
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aProcesses[] = $aRow['PRO_UID'];
|
||||
$oDataset->next();
|
||||
}
|
||||
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(ProcessUserPeer::PRO_UID);
|
||||
$oCriteria->add(ProcessUserPeer::PU_TYPE, 'GROUP_SUPERVISOR');
|
||||
$oCriteria->addJoin(ProcessUserPeer::USR_UID, GroupUserPeer::USR_UID, Criteria::LEFT_JOIN);
|
||||
$oCriteria->add(GroupUserPeer::USR_UID, $userUid);
|
||||
$oDataset = ProcessUserPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aProcesses[] = $aRow['PRO_UID'];
|
||||
$oDataset->next();
|
||||
}
|
||||
|
||||
return $aProcesses;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the PAUSED cases list criteria
|
||||
* param $userUid the current userUid
|
||||
@@ -435,7 +471,14 @@ class AppCacheView extends BaseAppCacheView
|
||||
$criteria = $this->addPMFieldsToCriteria('paused');
|
||||
}
|
||||
|
||||
$criteria->add(AppCacheViewPeer::USR_UID, $userUid);
|
||||
$aProcesses = $this->getProUidSupervisor($userUid);
|
||||
|
||||
//add a validation to show the processes of which $userUid is supervisor
|
||||
//$criteria->add(AppCacheViewPeer::USR_UID, $userUid);
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion(AppCacheViewPeer::USR_UID, $userUid)->
|
||||
addOr($criteria->getNewCriterion(AppCacheViewPeer::PRO_UID, $aProcesses, Criteria::IN))
|
||||
);
|
||||
|
||||
//join with APP_DELAY table using APP_UID and DEL_INDEX
|
||||
$appDelayConds[] = array(AppCacheViewPeer::APP_UID, AppDelayPeer::APP_UID);
|
||||
@@ -481,38 +524,7 @@ class AppCacheView extends BaseAppCacheView
|
||||
*/
|
||||
public function getToRevise($userUid, $doCount)
|
||||
{
|
||||
require_once ('classes/model/ProcessUser.php');
|
||||
require_once ('classes/model/GroupUser.php');
|
||||
|
||||
//adding configuration fields from the configuration options
|
||||
//and forming the criteria object
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(ProcessUserPeer::USR_UID, $userUid);
|
||||
$oCriteria->add(ProcessUserPeer::PU_TYPE, 'SUPERVISOR');
|
||||
$oDataset = ProcessUserPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$aProcesses = array();
|
||||
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aProcesses[] = $aRow['PRO_UID'];
|
||||
$oDataset->next();
|
||||
}
|
||||
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(ProcessUserPeer::PRO_UID);
|
||||
$oCriteria->add(ProcessUserPeer::PU_TYPE, 'GROUP_SUPERVISOR');
|
||||
$oCriteria->addJoin(ProcessUserPeer::USR_UID, GroupUserPeer::USR_UID, Criteria::LEFT_JOIN);
|
||||
$oCriteria->add(GroupUserPeer::USR_UID, $userUid);
|
||||
$oDataset = ProcessUserPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aProcesses[] = $aRow['PRO_UID'];
|
||||
$oDataset->next();
|
||||
}
|
||||
|
||||
$aProcesses = $this->getProUidSupervisor($userUid, $doCount);
|
||||
|
||||
if ($doCount && !isset($this->confCasesList['PMTable']) && !empty($this->confCasesList['PMTable'])) {
|
||||
$c = new Criteria('workflow');
|
||||
|
||||
Reference in New Issue
Block a user