This commit is contained in:
Julio Cesar Laura Avendaño
2017-06-12 16:41:09 -04:00
parent 4c8abed264
commit 440c2e5f22
2 changed files with 5 additions and 3 deletions

View File

@@ -3348,7 +3348,7 @@ class Cases
* @return integer
*/
public function getCurrentDelegation($sApplicationUID = '', $sUserUID = '')
public function getCurrentDelegation($sApplicationUID = '', $sUserUID = '', $onlyOpenThreads = false)
{
$oCriteria = new Criteria();
$oCriteria->add(AppDelegationPeer::APP_UID, $sApplicationUID);
@@ -3363,7 +3363,9 @@ class Cases
//if the user is not in the task, we need to return a valid del index, so we are returning the latest delindex
$oCriteria = new Criteria();
$oCriteria->add(AppDelegationPeer::APP_UID, $sApplicationUID);
$oCriteria->add(AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN');
if ($onlyOpenThreads) {
$oCriteria->add(AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN');
}
$oCriteria->addDescendingOrderByColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
$oApplication = AppDelegationPeer::doSelectOne($oCriteria);
if (!is_null($oApplication)) {

View File

@@ -1017,7 +1017,7 @@ class Light
{
$response = array("status" => "fail");
$oCase = new \Cases();
$iDelIndex = $oCase->getCurrentDelegation( $sAppUid, '' );
$iDelIndex = $oCase->getCurrentDelegation( $sAppUid, '', true );
$oAppDelegation = new \AppDelegation();
$aDelegation = $oAppDelegation->load( $sAppUid, $iDelIndex );