public function notice($request, $response)
 {/*{{{*/
     if(XDateTime::isSpringHoliday())
     {
         $response->setRedirect(Intention::getIntentionTongzhiUrl());
         return false;
     } 
     $response->next = $request->next;
     $response->refer = $request->refer;
 }/*}}}*/
    private function ensureCanAsk($request, $response)
    {/*{{{*/
        $caseHostUserId = $request->getRequest('host_user_id', 0);
        $askSpace = DAL::get()->find('space', $caseHostUserId);
        if(XDateTime::isSpringHoliday() || XDateTime::isClosedThreadTime())
        {
            AskSessionInfo::session_destroy();
            $response->setRedirect(Intention::getIntentionTongzhiUrl());
            return false;
        } 

        if(false == $askSpace->isNull())
        {
            if ($askSpace->host instanceof Doctor)
            {
                $askSpace->host->doctorIsDead();
            }
            if ($this->skipHospitals($askSpace) || $this->skipDoctors($askSpace))
            {
                $response->setRedirect('http://www.'.URL_PREFIX.'haodf.com/info/spacefrontnotice.php');
                return false;
            }
        }
        try
        {
            SpaceClient::getInstance()->ensureAllowAskRule($this->_newUser, $askSpace);
        }
        catch(SpaceUnconfirmException $ex)
        {
            $response->setRedirect('http://'.URL_PREFIX.'zixun.haodf.com/newcase/askintentionintro?spaceid='.$askSpace->id.'&message='.$ex->getMessage());
            return false;
        }
        catch(SpaceCaseClosedException $ex)
        {
            $message = "暂时关闭,无法回复您的问题。";
            $response->setRedirect('http://'.URL_PREFIX.'zixun.haodf.com/newcase/askintentionintro?spaceid='.$askSpace->id.'&message='.$message);
            return false;
        }
        catch(SpaceForbiddenAnswerException $ex)
        {
            $message = "暂时关闭,无法回复您的问题。";
            $response->setRedirect('http://'.URL_PREFIX.'zixun.haodf.com/newcase/askintentionintro?spaceid='.$askSpace->id.'&message='.$message);
            return false;
        }
        return true;
    }/*}}}*/
    public function showFuwaiAsk($request, $response)
    {/*{{{*/
        if (XDateTime::isSpringHoliday())
        {
            $response->setRedirect(Intention::getIntentionTongzhiUrl());
		    return false;
        }
        $space = array();
        if ($request->host_user_id)
        {
            $space = DAL::get()->find('space', $request->host_user_id);
            if($space->isNull() == false && ($space->modulecase->allowNewMaxNumber == 0 || $space->isCaseAndNewCaseOpen() == false 
                    || $space->isNewCaseOpen() == false || false == $space->user->allowAnswer()))
            {
                throw new BizException('此功能暂时关闭'); 
            }
        }
        $response->caseTitle = $request->case_title;
        $response->isLogin = UserClient::getInstance()->isLogin();
        $response->space = $space;
        $response->categoryList = ThreadCateClient::getInstance()->getTopLevelList();
    }/*}}}*/
	public function showAsk($request, $response)
    {/*{{{*/
        if (XDateTime::isSpringHoliday())
        {
            $response->setRedirect(Intention::getIntentionTongzhiUrl());
		    return false;
        }

		$caseHostUserId = $request->getRequest('host_user_id', 0);

        //判断是否存在流关系:要判断caseHostUserId不可为空
        if($this->_newUser->isNull() == false && empty($caseHostUserId) == false)
        {
            $patients = $this->_newUser->patients;
            $patient = array_shift($patients);
            $doctorPatientRef = new NullEntity();
            if($patient != null)
            {
                $doctorPatientRef = FlowClient::getInstance()->getValidFlowRef($caseHostUserId, $patient->id);
            }
            if($doctorPatientRef->isNull() == false)
            {
                $response->setRedirect($doctorPatientRef->url);
                return;
            }
        } 

		$attachments = array();
		if (false == $this->_newUser->isNull())
		{
			//附件的获取
			$attachments = $this->_newUser->attachments;
			if (is_array($attachments) == false){
				if ($attachments->isNull())
				$attachments = array();
			}
		}

		$response->patientAttachments = $attachments;
		$askSpace = array();
		if ($caseHostUserId) {
			$askSpace = DAL::get()->find('space', $caseHostUserId);
		}
		/** 登录用户的咨询列表 */
		$userCaseList = array();

		/** 用户提问的一些限制 */
		$out = array();
		$res = $this->_userIsAllowAsk($askSpace, $out, $response);

		//咨询区未满,并且允许普通用户或者患者提问
		if ($res && false == $out['askSpaceFull'] && ($out['allowUserAsk'] || $out['allowPatientAsk'])) {
			$response->askSpaceObjectBefore = array();
		} else {
			$response->askSpaceObjectBefore = $askSpace;
			$askSpace = array();
		}


        $patients = $this->_newUser->patients;
        if(is_array($patients) && false == empty($patients))
        {
            $patient = array_shift($patients);
        }
        else
        {
            $patient = new NullEntity();
        }
        $response->patientInfo = $patient;
		$response->askSpaceRes = $out;
		$response->askSpace = $askSpace;
		$response->userCaseList = $userCaseList;
		$response->moduleCase = array();
		$response->allowPhone = isset($out['allowPhone'])?$out['allowPhone']:false;
	}/*}}}*/