public function newCasePostPost($request, $response)
    {/*{{{*/
        $this->initialize($request, $response);
        $this->forceSpaceModuleCheck('Case', $response);
        $threadId = (int)$request->case_id;
        $isForward = $request->forward;
        $thread = DAL::get()->find('thread', $threadId);
        $response->thread = $thread;
        $ajaxJump=(bool)$request->ajaxJump;
        $response->commonCaseNote = $this->_newSpace->commonCaseNote;
        if ($this->_refuseNotIsUserCase($response, $thread)) 
        {
            return false;
        }
        if(false == $ajaxJump)
        {
            //不是患友会分组跳转,而是回复case
            $isForward = $request->forward;
            if(false == $isForward)
            {
                $this->doSubmitPost($request, $response, $thread);
            }
        }

        /** 患者或者科室网站发表直接跳回当前咨询 */
        if ($this->_newUser->id == $thread->user->id || $thread->space->type == Space::HOST_TYPE_FACULTY) {
            $response->setRedirect($thread->getUrl().'?_m_m_=true#reply');
        } else {
            SpaceLogClient::getInstance()->addLog($this->_newUser->id, SpaceLog::SPACE_LOG_TYPE_REPLY_CASE, $thread->id, $thread->title);
            $nextUnreadUrl = rawurldecode($request->nextUnreadUrl);
            if(false == empty($nextUnreadUrl))
            {
                $spaceAttr = DAL::get()->find_by_fld_spaceuserid_and_name('spaceAttribute', 
                    $this->_newSpace->id, Space::ATTR_FLOW_PROCESS);
                $flowProcess = $spaceAttr->isNull() ? SpaceAttribute::FLOW_PROCESS_FORWARD: $spaceAttr->value;
                if(SpaceAttribute::FLOW_PROCESS_FORWARD == $flowProcess)
                {
                    $response->setRedirect($nextUnreadUrl);
                    return;
                }
            }
            $response->setRedirect($thread->getUrl().'#reply');
        }
    }/*}}}*/
							</span>	
					
					<?php 	}
					} ?>
				</td>
              </tr>
           </table>
           <!-------------------------------------新修改的--------------------------------->
<?php 
        if($doctor->hasSpace() && !$newSpace->isNull() && $newSpace->homepageOpened)
        {  
?>   
           <table width="100%" border="0" cellspacing="0" cellpadding="0" class="doct_data_xxzx">
           <?php 
              	$alltime = floor((time() - (int)$activityTime ) / 60);
              	$time_put = SpaceLogClient::getInstance()->printTime($activityTime);
           ?>
            <?php if($isDead == false) { ?>
            <tr>
              <td width="26" valign="top"><img src="http://i1.hdfimg.com/images/doctor/iconhome16.gif" align="absmiddle"/></td>
              <td width="63" valign="top">个人网站:</td>
              <td valign="top">
              	<a href="<?=$newSpace->getUrl()?>" target="_blank" class="blue"><?=$newSpace->getUrl()?></a>
              	<!--(<span class="orange"><?=$time_put?>在线</span>)-->
              	(<span class="orange" id="active_<?=$newSpace->id?>"></span>)
              </td>
              <?php Pagelet::addJs('http://www.'.URL_PREFIX.'haodf.com/api/get_activetime.php?d='.$newSpace->id); ?>
              <td align="right"><a href="<?=$newSpace->getUrl()?>" target="_blank" class="xxzx_button">访问个人网站</a></td>
            </tr>
            <?php }?>
           <!-------------------------------------诊后报到--------------------------------->
    public function index($request,$response)
    {/*{{{*/
        /* bigpipe用来做切换,true表示关闭,以普通模式浏览 */
        $response->nobp = ($request->nobp == null) ? false : true;
        //搜索
        $response->searchWords = $this->getHotSearchWords();
        List($blueImage, $redImage) = $this->getHomeBigImage();
        $response->blueImage = $blueImage;
        $response->redImage = $redImage;
        //在线专家
        $response->onLineDoctorList = DoctorClient::getInstance()->getOnLineDoctor4HomePage();

        //按医院找大夫
        $provList = $this->getProvList();
        $provKeyList = $this->getProvKey();
        $hospitalIds = array();
        foreach ($provList as $p => $prov)
        {
            foreach ($prov as $h => $hospital)
            {
                $hospitalIds[] = $h;
            }
        }
        $response->hospitalList = DAL::get()->find('hospital', $hospitalIds);
        $response->provList = $provList;
        $response->provKeyList = $provKeyList;

                
        //咨询专家 咨询列表
        $response->doctorPatientSets = $this->getFlowList4HomePage(self::THREADCATEGORY_COUNT, self::THREAD_COUNT);
        $response->statistics = SpaceClient::getInstance()->getStatistics();

        //咨询专家 电话咨询列表
		$recommendDoctorList = PaymentClient::getInstance()->getRecDoctorList4HomePage(10, 3);
        $response->recommendDoctorList = $recommendDoctorList; 
        $spaceUserIds = $doctorIds = array();
        foreach ($recommendDoctorList as $facultyInfo)
        {
            $facultyDoctorInfo = isset($facultyInfo['doctor']) ? $facultyInfo['doctor'] : array();
            foreach ($facultyDoctorInfo as $doctor)
            {
                $spaceUserIds[] = $doctor->getSpace()->user->id;
                $doctorIds[] = $doctor->id;
            }
        }

		$productList = $lastOrders = array();
		if(!empty($spaceUserIds) && !empty($doctorIds))
		{
			//电话咨询产品
			$productList = ProductClient::getInstance()->getProductsBySpaceIds($spaceUserIds, array(ServiceDef::TYPE_TELORDER));
			//取最新订单
			$lastOrders = PaymentClient::getInstance()->getLatestServiceList($doctorIds);
		}
		$response->productList = $productList;
        $lastOrderGroupBySpace = array();
        foreach ($lastOrders as $lastOrder)
        {
            if ($lastOrder->getSpace() instanceof Space)
            {
                $lastOrderGroupBySpace[$lastOrder->getSpace()->id] = $lastOrder;
            } 
        }
        $response->lastOrderGroupBySpace = $lastOrderGroupBySpace;

        //预约加号
        $doctorNumber = PlussignChannelClient::getInstance()->getPlusSignDoctorCount();//全国开通加号医生总数目
        $patientNumber = SpaceClient::getInstance()->getPlusSignPatientCount();
        $patientOrderList = PatientClient::getInstance()->getPatientOrderList();
        $response->doctorNumber = $doctorNumber;
        $response->patientNumber = $patientNumber;	
        $response->patientOrderList = $patientOrderList;

        //分享经验
        $commentCount = DoctorCommentClient::getInstance()->getCommentCount();
        $response->thankListCount = isset($commentCount['letter']) ? $commentCount['letter'] : 0;
        $response->doctorCommentListCount = isset($commentCount['comment']) ? $commentCount['comment'] : 0;

        $expList = DAL::get()->find_all_for_top('cureexp', 4);
        $response->expList = $expList;

        $thankList = DAL::get()->find_all_for_top('curethankletter', 4);
        $response->thankList = $thankList;        

        //出诊 停诊信息
        $response->hospitalAnnounceList = HospitalClient::getInstance()->getHospitalAnnounceList4HomePage(3);
        $response->cmslinkList = CmsClient::getInstance()->getCmsLinkList(self::CMS_COUNT);

        //好大夫动态
        $response->latestList = SpaceLogClient::getInstance()->getLatestList(self::LAST_COUNT);
        $response->images = $this->_images;

        //礼物动态
        $spaceId = 0;
        $result = PresentClient::getInstance()->showPresentBanner($spaceId, 12, $request->from, array(), false);
        $response->presentOrders = $result['presentOrders'];

        //最新专家文章
        $limit = self::ARTICLE_COUNT - substr_count(Place::getPlaceContent('haodf_index','wenzhang_url','onlyone'), '<li>');
        $articleList = ArticleClient::getInstance()->getArticleList4Index($limit);
        $response->articleList = $articleList;
    }/*}}}*/
Example #4
0
                <?php
                    foreach($patientOrderList as $patientOrder){
                    $user = $patientOrder->user;
                    $orderSpace = $patientOrder->space;
                    if (isset($user->name) && isset($patientOrder->ctime) && isset($orderSpace->userName) && isset($orderSpace->name)) {
                        $userName = $user->name;
                        $userSchedule = $patientOrder->ctime;
                        $hospitalName = $orderSpace->host->hospitalfaculty->hospital->commonName;
                        $hospitalfacultyName = $orderSpace->host->hospitalfaculty->name;
                        $doctorName = $orderSpace->name;
                        $doctorUserName = $orderSpace->userName;
                        $doctorGrade = $orderSpace->host->grade;
                    }
                ?>

              <li><?=$userName?>&nbsp;<span class="orange2"><?=SpaceLogClient::getInstance()->printTime($userSchedule)?></span>&nbsp;预约成功<br>
              <?=$hospitalName?><?=$hospitalfacultyName?>&nbsp;&nbsp;
              <a class="blue" target="_self" href="<?=$orderSpace->host->getUrl($_SERVER['HTTP_HOST'])?>"><?=$orderSpace->name?></a><?=$doctorGrade?>
              </li>
              <?php }?>
            </ul>
            </div>
        </div>
      </div>
      <div class="jia_hao_sidebar">
        <ul class="j_h_title2">
        <li class="s_l"></li>
        <li>网上预约服务专家</li>
        <li class="s_r"></li>
        </ul>
        <div class="j_h_con_bg" style="padding-top:0px">
Example #5
0
                <?php
                    foreach($patientOrderList as $patientOrder){
                    $user = $patientOrder->user;
                    $space = $patientOrder->space;
                    if (isset($user->name) && isset($patientOrder->ctime) && isset($space->user->name) && isset($space->name)) {
                        $userName = $user->name;
                        $userSchedule = $patientOrder->ctime;
                        $hospitalName = $space->host->hospitalfaculty->hospital->commonName;
                        $hospitalfacultyName = $space->host->hospitalfaculty->name;
                        $doctorName = $space->name;
                        $doctorUserName = $space->user->name;
                        $doctorGrade = $space->host->grade;
                    }
                ?>

              <li><?= XString::truncate($userName, 1, '***')?>&nbsp;<span class="orange2"><?=SpaceLogClient::getInstance()->printTime($userSchedule)?></span>&nbsp;预约成功<br>
              <?=$hospitalName?><?=$hospitalfacultyName?>&nbsp;&nbsp;
              <a class="blue" target="_blank" href="http://<?=$doctorUserName?>.haodf.com"><?=$doctorName?></a><?=$doctorGrade?>
              </li>
              <?php }?>
            </ul>
            </div>
        </div>
      </div>
      <div class="jia_hao_sidebar">
        <ul class="j_h_title2">
        <li class="s_l"></li>
        <li>网上预约服务专家</li>
        <li class="s_r"></li>
        </ul>
        <div class="j_h_con_bg" style="padding-top:0px">
 /**
  * @brief 新建一条post
  * @author lhl
  * @version branches/v2.14.23
  * @date 2013-07-25
  */
 public function createPost($request, $response)
 {
     /*{{{*/
     $ref = DAL::get()->find('DoctorPatientRef', $request->refid);
     if ($ref->isNull() || false == in_array($this->user->id, array($ref->user->id, $ref->space->user->id))) {
         header('Location: ' . $this->space->url);
         return;
     }
     if ($this->user->id == $ref->user->id) {
         $errMsg = $this->checkCanUserReply($ref);
         if ('' != $errMsg) {
             $this->message($errMsg, $response);
             return false;
         }
     }
     // 如果还有继续能回复post的就打开post回复开关
     if ($ref->isClosePost()) {
         DoctorPatientPostClient::getInstance()->switchPatientPostCan($this->user->id, $ref->id);
     }
     $option = array();
     $attachmentIds = $request->attachmentIds != null ? $request->attachmentIds : '';
     $attachmentArr = explode(',', $attachmentIds);
     $option['attachmentIds'] = $attachmentArr;
     if ($ref->replyLimitationIsApproaching()) {
         $option['removeReplyLimitation'] = $request->removeReplyLimitation;
     }
     if ($this->user->id == $ref->space->user->id) {
         $postContent = $request->getUnSafeData('content');
     } else {
         $postContent = $request->content;
     }
     if (($postContent == '请填写咨询内容...' || $postContent == '') && $attachmentIds != '') {
         $postContent = '有新资料上传';
     }
     $post = DoctorPatientPostClient::getInstance()->addPost($ref->id, $this->user->id, $postContent, $option);
     if (false == $post->isNull()) {
         //系统日志
         try {
             FlowClient::getInstance()->addLog($ref, $this->user, DoctorPatientLog::TYPE_SYSTEM_LOG, 'FlowController::createPost', $post);
         } catch (Exception $ex) {
         }
         //积分的更改
         //这个逻辑有可能不用了
         $this->modifyScore($ref);
     }
     if ($ref->space->user->id == $this->user->id) {
         SpaceLogClient::getInstance()->addLog($this->user->id, SpaceLog::SPACE_LOG_TYPE_REPLY_FLOW, $ref->id, $ref->title);
     } else {
         if ($ref->user->id == $this->user->id) {
             //管理员给患者的提示信息失效
             PatientSigninClient::getInstance()->disablePatientNotice($ref->id);
         }
     }
     $url = $ref->url . '#reply';
     if ($ref->space->user->id == $this->user->id) {
         $spaceAttr = DAL::get()->find_by_fld_spaceuserid_and_name('spaceAttribute', $this->space->id, Space::ATTR_FLOW_PROCESS);
         $flowProcess = $spaceAttr->isNull() ? SpaceAttribute::FLOW_PROCESS_FORWARD : $spaceAttr->value;
         if (SpaceAttribute::FLOW_PROCESS_FORWARD == $flowProcess && $request->nextUnreadUrl) {
             $url = rawurldecode($request->nextUnreadUrl);
         }
     }
     $response->setRedirect($url);
 }
		$latestImgUrl = $latest->user->space->host->getTinyHeadImage();
	}
?>
<div class="r_bar_doc3" <?=($llCount==count($latestList)?"style='border-bottom:0px'":"")?>>
<div class="r_bar_doc3_l">
<table cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td valign="middle" align="center" style="padding: 0px; border: 1px solid #DFDFDF; height: 31px; vertical-align: middle; width: 31px;">
<a target="_blank" href="http://<?=URL_PREFIX?><?=$latest->user->name?>.haodf.com"><img style="border:none;" src="<?=$latestImgUrl?>"></a>
</td>
</tr>
</tbody>
</table>
</div>
<div class="r_bar_doc3_c"><span style="float:right;"><?=SpaceLogClient::getInstance()->printTime($latest->ctime)?></span><a href="http://<?=URL_PREFIX?><?=$latest->user->name?>.haodf.com" class="blue2" target="_blank"><?php if ($latest->user->space->host instanceof doctor) { echo (($latest->user->space->host->name) ? $latest->user->space->host->name : $latest->user->realName); } else { echo $latest->user->realName; } ?></a> 
<?php if ($latest->user->space->host instanceof doctor) {?>
<?=$latest->user->space->host->grade?><br />
<?=$latest->user->space->host->hospitalfaculty->hospital->commonName?> 
<?php } ?>
<?=$latest->action?> <br />
</div>
<div class="clear"></div>
</div>
<?php 
$llCount++;
} 
?>

</div>
<!--好大夫动态-->
    public function createPost($request, $response)
    {/*{{{*/
        $ddtt = "";
        $ref = DAL::get()->find('DoctorPatientRef', $request->refid);
        if ($ref->isNull() || in_array($this->_newUser->id, array($ref->user->id, $ref->space->user->id)) == false)
        {
            header('Location: '.$this->_newSpace->url);
            return;
        }

        // 如果还有继续能回复post的就打开post回复开关
        if ($ref->isClosePost())
        {
            DoctorPatientPostClient::getInstance()->switchPatientPostCan($this->_newUser->id, $ref->id);
        }
        $option = array();
        $attachmentIds = ($request->attachmentIds != null) ? $request->attachmentIds : '';
        $attachmentArr = explode(',', $attachmentIds);
        $option['attachmentIds'] = $attachmentArr;
        if ($ref->replyLimitationIsApproaching())
        {
            $option['removeReplyLimitation'] = $request->removeReplyLimitation;
        }
        if ($this->_newUser->id == $ref->space->user->id)
        {
            $postContent = $request->getUnSafeData('content');
        }
        else
        {
            $postContent = $request->content;
            $this->sendTelAdMsg($ref);
        }
        if(($postContent == '点击此处跟大夫对话!' || $postContent == '') && $attachmentIds <> '')
    	{
            $postContent = '有新资料上传';
    	}
        
        $post = DoctorPatientPostClient::getInstance()->addPost($ref->id, $this->_newUser->id, $postContent, $option);

        if ($post)
        {
            //系统日志
		      try{
		      	FlowClient::getInstance()->addLog($ref,$this->_newUser, DoctorPatientLog::TYPE_SYSTEM_LOG, 'FlowController::createPost', $post);
		      }catch(Exception $ex)
		      {}
		      
              //积分的更改  
            $this->modifyScore($ref);
        }
        
        if($ref->space->user->id == $this->_newUser->id)
    	{
			SpaceLogClient::getInstance()->addLog($this->_newUser->id, SpaceLog::SPACE_LOG_TYPE_REPLY_FLOW, $ref->id, $ref->title);
            $content = $ref->space->name."大夫和您有新对话<a href='".$ref->url."' target='_blank'>点击查看详情</a>";
            $title = $ref->space->name."大夫和您有新对话";
            $options = array('relationShip' => $ref, 'ispush' => 1);
    		StationLetterClient::getInstance()->sendMsg(Message::AdminUserId, $ref->user->id, $title, $content, $options);
    	}
        else if($ref->user->id == $this->_newUser->id)
        {
            //管理员给患者的提示信息失效
            PatientSigninClient::getInstance()->disablePatientNotice($ref->id);
        }

        //加入默认患友会
        if($this->_newUser->id == $ref->space->user->id
            && $ref->space->isPatientOpened()
            && $ref->isReGroupMember() == false)
        {
            $groupMemberId = FlowClient::getInstance()->addUserToDefaultReGroup($ref->id, $this->_newUser->id);
            if($groupMemberId>0)
            {
                $msgContent = $ref->user->name.",您好!<br/>".$ref->space->name."
                    大夫已经邀请您参加患友会  !<br/>
                    建议您在疾病治疗过程中,多跟病友交流,分享经验!<br/>
                    点这儿,<a href='http://".$ref->space->user->name.".haodf.com/huanyouhui/index.htm' target='_blank'>去大夫患友会</a> >>
                    ";
                StationLetterClient::getInstance()->sendMsg(Message::AdminUserId, $ref->user->id, Box::RESIDENTEVIL_TITLE, $msgContent);
            }
        }
        
        $url = $ref->url.'#reply';
    	if($ref->space->user->id == $this->_newUser->id)
        {
            $spaceAttr = DAL::get()->find_by_fld_spaceuserid_and_name('spaceAttribute', 
                $this->_newSpace->id, Space::ATTR_FLOW_PROCESS);
            $flowProcess = $spaceAttr->isNull() ? SpaceAttribute::FLOW_PROCESS_FORWARD: $spaceAttr->value;
            if(SpaceAttribute::FLOW_PROCESS_FORWARD == $flowProcess && $request->nextUnreadUrl)
            {
                $url = rawurldecode($request->nextUnreadUrl);
            }
        }
        $response->setRedirect($url);
    }/*}}}*/
  public function createPost($request, $response)
  {/*{{{*/
      $ref = DAL::get()->find('DoctorPatientRef', $request->refid);
      if($ref->isNull())
      {
          die('流关系不存在');
          return;
      }
      if (false == FollowupAssistantClient::getInstance()->hasAssistRights($this->user->id, $ref->space->id))
      {
          echo '没有权限发表';
          exit;
      }
      $option = array();

      $attachmentIds = ($request->attachmentIds != null) ? $request->attachmentIds : '';
      $attachmentArr = explode(',', $attachmentIds);
      $option['attachmentIds'] = $attachmentArr;

      $content = $ref->space->name."大夫和您有新对话<a href='".$ref->url."' target='_blank'>点击查看详情</a>";
      $title = $ref->space->name."大夫和您有新对话";
      StationLetterClient::getInstance()->sendMsg(Message::AdminUserId, $ref->user->id, $title, $content);

      $postContent = $request->getRequest('content');
      if(($postContent == '点击此处跟大夫对话!' || $postContent == '') && $attachmentIds <> '')
      {
          $postContent = '有新资料上传';
      }
      $post = DoctorPatientPostClient::getInstance()->addPost($request->refid, $ref->space->user->id, $postContent, $option);
      DBC::requireFalse($post->isNull(), '系统繁忙,请稍后重试');
      
      //系统日志
   	  try{
      	FlowClient::getInstance()->addLog($ref,$ref->space->user, DoctorPatientLog::TYPE_SYSTEM_LOG, 'SuiFangController::createPost', $post);
      }catch(Exception $ex)
      {}
      
      //记录助理日志
      if ($this->user->id != $ref->space->id)
      {
          FollowupClient::getInstance()->addFollowupLog($this->user->id, $post->id);
          SpaceLogClient::getInstance()->addLog($ref->space->user->id, SpaceLog::SPACE_LOG_TYPE_REPLY_FLOW, $ref->id, $ref->title);
      }
      $response->setRedirect('/suifang/taskdetail?refId='.$ref->id);
  }/*}}}*/
            continue;
        }
        $tclass = "zx_bg2";
        if($k%2==0)
        {
            $tclass = "zx_bg1";
        }
?>
    <li class="<?=$tclass?>">
    <?php
    $doctorHospitalName = $doctorPatientRef->space->host->hospitalfaculty->hospital->commonName.$doctorPatientRef->space->host->hospitalfaculty->name;
    $doctorName = $doctorPatientRef->space->host->name;
    ?>
    <span class="gray f_rt"><?=$doctorHospitalName."&nbsp;&nbsp;".$doctorName?>回复</span>
    <a href="<?=$doctorPatientRef->url?>" target="_blank"><?=XString::truncate($doctorPatientRef->title, 35)?></a> 
    <a class="gray" style="text-decoration:none;"><?=SpaceLogClient::getInstance()->printTime($doctorPatientRef->lastPostTime);?></a>
    </li>
<?php
    $k++;
    } 
?>
</ul>
</div>
<?php 
        $j++;
        $display = 'none';
    } 
?>
</div>
<div class="zx_more"><span class="f_rt"><a href="http://<?=URL_PREFIX?>zixun.haodf.com/dispatched/all.htm" class="blue2" target="_blank">查看全部<?=number_format($statistics['threads'])?>条咨询>></a>
</div>
                    $user = $patientOrder->user;
                    $space = $patientOrder->space;
                    if($space->host->hospitalfaculty->hospital->isInnerTestHospital())
                    {
                        continue;
                    }
                    if (isset($user->name) && isset($patientOrder->ctime) && isset($space->user->name) && isset($space->name)) {
                        $userName = $user->getPrivateName();
                        $userSchedule = $patientOrder->ctime;
                        $hospitalUrl = $space->host->hospitalfaculty->hospital->getEncodeId();
                        $hospitalFacultyUrl = $space->host->hospitalfaculty->getEncodeId();
                        $hospitalName = $space->host->hospitalfaculty->hospital->commonName;
                        $hospitalfacultyName = $space->host->hospitalfaculty->name;
                        $doctorName = $space->name;
                        $doctorUserName = $space->user->name;
                    }
?>

	<li <?=($m%2==0)?'class="jh_bg1"':''?>><span class="f_rt gray"><?=SpaceLogClient::getInstance()->printTime($userSchedule)?></span><?=$userName?>预约成功
	<?=$hospitalName?><?=$hospitalfacultyName?>
	<a class="blue" target="_blank"	href="http://<?=$doctorUserName?>.haodf.com"><?=$doctorName?></a>大夫</li>
<?php 
$m++;
} 
?>
</ul>
</div>
<div class="clear"></div>
</div>
<!--转诊预约-->