$_SESSION['alreadyDerivated'] = true;
                    //the case is paused show only the resume
                    $_SESSION['APPLICATION'] = $sAppUid;
                    $_SESSION['INDEX'] = $iDelIndex;
                    $_SESSION['PROCESS'] = $aFields['PRO_UID'];
                    $_SESSION['TASK'] = - 1;
                    $_SESSION['STEP_POSITION'] = 0;

                    require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php');
                    exit();
                }
            }

            //proceed and try to open the case
            $oAppDelegation = new AppDelegation();
            $aDelegation = $oAppDelegation->load( $sAppUid, $iDelIndex );

            //if there are no user in the delegation row, this case is in selfservice
            if ($aDelegation['USR_UID'] == "" /*&& $aDelegation['DEL_THREAD_STATUS'] == 'SELFSERVICE'*/ ) {

                $_SESSION['APPLICATION'] = $sAppUid;
                $_SESSION['INDEX'] = $iDelIndex;
                $_SESSION['PROCESS'] = $aFields['PRO_UID'];
                $_SESSION['TASK'] = - 1;
                $_SESSION['STEP_POSITION'] = 0;
                $_SESSION['CURRENT_TASK'] = $aFields['TAS_UID'];

                //if the task is in the valid selfservice tasks for this user, then catch the case, else just view the resume
                if ($oCase->isSelfService( $_SESSION['USER_LOGGED'], $aFields['TAS_UID'], $sAppUid )) {
                    require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_CatchSelfService.php');
                } else {
Exemple #2
0
    /**
     * claim case
     *
     * @param $userUid
     * @param $Fields
     * @param $type
     * @throws \Exception
     */
    public function claimCaseUser($userUid, $sAppUid)
    {
        $response = array("status" => "fail");
        $oCase = new \Cases();
        $iDelIndex = $oCase->getCurrentDelegation( $sAppUid, $userUid );

        $oAppDelegation = new \AppDelegation();
        $aDelegation = $oAppDelegation->load( $sAppUid, $iDelIndex );

        //if there are no user in the delegation row, this case is still in selfservice
        if ($aDelegation['USR_UID'] == "") {
            $oCase->setCatchUser( $sAppUid,$iDelIndex, $userUid );
            $response = array("status" => "ok");
        } else {
            //G::SendMessageText( G::LoadTranslation( 'ID_CASE_ALREADY_DERIVATED' ), 'error' );
        }
        return $response;
    }