示例#1
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;
    }