예제 #1
0
    public function __construct($request, $response) 
    {/*{{{*/
        parent::__construct($request, $response);
        UserClient::getInstance()->checkGuest();

        $response->user = $this->user = $this->getCookieUser();
        $response->askSpace = $this->askSpace = AskSessionInfo::getBindSpace();
        $response->touchAppName = BeanFinder::get('configs')->touchAppName;
        $response->touchUrl = BeanFinder::get('configs')->touchUrl;
        $response->touchUrlHome = BeanFinder::get('configs')->touchUrl.'/index.htm';
        $response->touchDomain = BeanFinder::get('configs')->touchDomain;
        $this->touchDomain = BeanFinder::get('configs')->touchDomain;
        $response->imgTimestamp = BeanFinder::get('configs')->imgTimestamp;
        $response->mobileUrl = "http://".URL_PREFIX."m.haodf.com/p";
        $response->wwwUrl = "http://www.".URL_PREFIX."haodf.com/";
        $response->suggestionUrl = BeanFinder::get('configs')->touchUrl."/suggestion/suggestion";
        $response->fromOtherHost =$request->isQueryFromOtherHost();
        $response->backCnt = 1;
        $response->hostUri = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
        if(isset($_SERVER['HTTP_REFERER']))
        {
            $response->backCnt = (strstr($_SERVER['HTTP_REFERER'], self::SELECT_PAGE_PARAM))?2:1;
        }
        $response->_action = $request->action;
        $response->mCanUpload = $this->canUpload();
    }/*}}}*/
예제 #2
0
	public function __construct($request, $response){
		//如果出现$user, $ssUser,则改为$newUser
		$userId = UserClient::getInstance()->getCheckedSeed('id');
        if($request->userId != null)
        {
            $userId = $request->userId;
        }
		if ($userId)
		    $this->_newUser = DAL::get()->find('user',$userId);
        else
            $this->_newUser = new NullEntity();
            	
        $response->newUser = $this->_newUser;
        
        $configs = BeanFinder::get('configs');
        $response->zixunBaseUrl = $configs->zixunBaseUrl;
        $response->imgBaseUrl = $configs->imgUrl;
		$response->domain = $request->getRequest('domain', URL_PREFIX.'zixun.haodf.com');
        $response->askSpace = AskSessionInfo::getBindSpace();
	}
예제 #3
0
 public function doctorPatientThread($request, $response)
 {/*{{{*/
     $response->title = $response->topTitle = "";
     $askSpace = AskSessionInfo::getBindSpace();
     $patient = AskSessionInfo::getBindPatient();
     $threads = array();
     if(false == empty($askSpace) && false == $askSpace->isNull() && false == $patient->isNull())
     {
         $response->askSpace = $askSpace;
         $thread = DAL::get()->find('doctorpatientref', $request->id);
         if ($thread->isNull())
         {
             $statusArr= array(Thread::STATUS_VALID,Thread::STATUS_AUDITING);
             $statusStr = implode(',', $statusArr);
             $threads = DAL::get()->find_all_by_condition('thread', 'patientid=? and spaceid=? and status in ('.$statusStr.')', array($patient->id, $askSpace->id));
             XString::sortArray($threads, 'ctime');
         }
         else
         {
             $threads[] = $thread;
         }
     }
     $response->threads = $threads;
 }/*}}}*/
예제 #4
0
    /**
     * askPost 
     * 
     * @param mixed $request 
     * @param mixed $response 
     * @access public
     * @return void
     */
    public function askPost($request, $response)
    {/*{{{*/
        AskSessionInfo::checkBindDtos();

        $askSpace = AskSessionInfo::getBindSpace();
        $patient = AskSessionInfo::getBindPatient();

        if($patient->isNull())
        {
            $response->setRedirect($response->router->urlfor('newcase/askindex'));
            return false;
        }

        $bindBingLiDtos = AskSessionInfo::getBindDtos();
        if (empty($bindBingLiDtos))
        {
            $response->setRedirect($response->router->urlfor('newcase/askindex'));
            return false;
        }

        if(false == $askSpace->isNull())
        {
            $product = ProductClient::getInstance()->getFirstFlowProduct($askSpace);
        }
        else
        {
            $product = FirstFlowPoolVirtualProduct::fetch();
         //   $product = new FirstFlowPoolVirtualProduct();
        }

        $intention = IntentionClient::getInstance()->createWithProduct($patient, $product, Intention::SRC_WEB, $bindBingLiDtos);

        if(false == $intention->isNull())
        {
            AskSessionInfo::session_destroy();
            $response->setRedirect($response->router->urlfor('newcase/asksuccess', array('id'=>$intention->id)));
        }
        else
        {
            $this->message('提交医疗请求出错,请重试', $response);
        }
    }/*}}}*/