* stream_icon1  咨询病情
 * stream_icon2  送礼物
 * stream_icon3  诊后报到
 * stream_icon4  转诊预约
 * stream_icon5  电话咨询
 * stream_icon6  复查报告
 * stream_icon7  随访患者报到
 * stream_icon15  感谢信
 */
$cssTuPian4flow = array('AnswerNaire' => 'stream_icon6', 'BookingLog' => 'stream_icon4', 'DoctorComment' => 'stream_icon15', 'CureExp' => 'stream_icon15', 'FollowupOwner' => 'stream_icon6', 'FollowupPost' => 'stream_icon6', 'FollowupReport' => 'stream_icon6', 'FollowupStateSummary' => 'stream_icon6', 'HealthDiary' => 'stream_icon1', 'HealthRecordSchemeLog' => 'stream_icon6', 'PatientSignin' => 'stream_icon3', 'PresentOrder' => 'stream_icon2', 'ReGroupMember' => 'stream_icon1', 'TelOrder' => 'stream_icon5', 'TelVisit' => 'stream_icon5', PresentOrder::SON_CLASS_WISH => 'stream_icon2');
$ctime = $flow->ctime;
$className = get_class($flow);
if ('PresentOrder' == $className && $flow->space->user->id == $flow->user->id) {
    $className = PresentOrder::SON_CLASS_WISH;
}
$statusInfo = DoctorPatientRef::flowItemStatusAndStyle($className);
$cssStyle = $flow instanceof CureThankLetter || $flow instanceof CureExp ? 'stream_icon15' : '';
if (empty($cssStyle)) {
    if (isset($cssTuPian4flow[$className])) {
        $cssStyle = $cssTuPian4flow[$className];
    } else {
        $cssStyle = 'stream_icon1';
    }
}
?>
<p class="<?php 
echo $cssStyle;
?>
 bb_d3"><?php 
echo $statusInfo['title'];
?>
<table align="center" width="1020" cellspacing="0" cellpadding="0" border="0" class="zixun-doctor bc">
	<tr>
		<td valign="top" width="720" class="f14">
        <?php
        //回复列表
        if (false == $flow->isPrivated() || $user->id == $flow->user->id)
        {/*{{{*/
            foreach ($flowableList as $flowable)
            {
                if(($flowable instanceof DoctorPatientPost) || ($flowable instanceof Post))
                {
                    include(dirname(__FILE__).'/flow/_thread_post_detail.php');
                }
                else
                {
                    include dirname(__FILE__).'/flow/'.DoctorPatientRef::getPostTemplate(get_class($flowable), 'browser');
                }
			}
		}/*}}}*/

        //继续提问
        //include dirname(__FILE__).'/_patient_reply.php';
        ?>
		</td>
		<td width="10">&nbsp;</td>
		<td valign="top" width="220">
            <?php
            $isFuwai = true;
            //患者信息
            $user = $flow->user;
            if(isset($object) && $object != 'browser')
Esempio n. 3
0
    if($flow instanceof DoctorPatientPost && $flow->isDeleted())
    {
?>
       <div style="word-break : break-all;">此对话已删除<a href="<?=$router->urlfor('nfsaudit/recoverdeletedpost', array('postId'=>$flow->id,'ticketId'=>$ticket->id)) ?>">[误删复原]</a> </div>
    <?php
    }

    else if($flow instanceof FollowupPost && $flow->isDeleted())
    {
?>
       <div style="word-break : break-all;">此对话已删除<a href="<?=$router->urlfor('nfsaudit/recoverdeletedfollowuppost', array('postid'=>$flow->id,'ticketId'=>$ticket->id)) ?>">[误删复原]</a> </div>
    <?php
    }
    else
    {
        include dirname(__FILE__).'/incdetail/'.DoctorPatientRef::getPostTemplate(get_class($flow));
        if ($flow instanceof DoctorPatientPost || $flow instanceof FollowupPost)
        {
            $attachmentIds = $flow->getDisplayAttachmentIds();
            if (false == empty($attachmentIds))
            {
                $aids = array();
                foreach ($attachmentIds as $attachId)
                {
                    if($flow instanceof DoctorPatientPost){
                        $attach = isset($attachments[$attachId])?$attachments[$attachId]:null;
                        if ($attach && false == $attach->isDeleted())
                            $aids[] = $attachId;
                    }
                    else
                    {
Esempio n. 4
0
 private function checkCanUserReply(DoctorPatientRef $ref)
 {
     $followupOwner = $ref->getFollowupOwner();
     $space = $ref->space;
     $canReplyFollowupOwner = false == $followupOwner->isNull() && $followupOwner->isOpenFollowup();
     $doctorChargeFlowProduct = ProductClient::getInstance()->getDoctorChargeFlowProduct($ref->space);
     $message = '';
     if (false == $canReplyFollowupOwner && false == $space->isCaseOpen()) {
         $message = '医生已经关闭了咨询区,您暂时不能向医生提问';
     } elseif ($ref->isClosePost()) {
         $message = '医患关系已关闭,无法继续交流';
     } elseif ($space->isChargeOpened() && $ref->isSpaceCanPost() == false && $doctorChargeFlowProduct instanceof Product && false == $ref->hasSpaceLeftAllowCnt()) {
         $message = '您和医生的交流次数已用完';
     }
     return $message;
 }
	public function sosPost($request, $response)
	{
		$tel = $request->tel;
		$time = $request->time;
        $isAjax = $request->isAjax;
		$confirm = $request->confirm;
        if($isAjax)
        {
            $adviceContent = mb_convert_encoding(trim($request->adviceContent),'gbk','utf-8');
            $clientInfo = mb_convert_encoding($request->clientInfo, 'gbk', 'utf-8');
        }
        else
        {
            $adviceContent = trim($request->adviceContent);
            $clientInfo = $request->clientInfo;
        }

        $msg = null;
		
		if( empty($adviceContent) )
		{
            $msg  = '您还没有简要描述您使用好大夫在线所遇到的困难或需要的帮助,请填写后再点击提交';
            if(false == $isAjax)
            {
                MsgHtml::msg($msg, '', array('button' => 'back' ));
                exit;
            }
		}
        else
        {
            $title = "空间求助 (" . date ( "y-m-d H:i" ) . ")";
            $content = "";
            $content .= "来自 " . XIpLocation::getLocationArea() . '[' . XIpLocation::getIp() . "] 的用户发送了一条空间求助, 内容如下:\n";
            $content .= $adviceContent ."\n";
            if (! $this->_newSpace->isConfirmed()) {
                $content .= "<font color=red>注意: 该用户未认证(" . date ( 'y-m-d H:i:s', time() ) . "之前)!!!</font>\n";
            }
            $content .= "所提交的空间: <a href=\"http://" . $this->_newSpace->userName . ".haodf.com\" target=\"_blank\">" . $this->_newSpace->host->name . "</a>\n";
            if($request->id)
            {
                if($request->type == DoctorPatientRef::DOCTORPATIENTREF_TYPE) 
                {
                    $sourceUrl = DoctorPatientRef::getStaticUrl($this->_newSpace->userName, $request->id);
                    $content .= "<a href= '{$sourceUrl}'  target='_blank' > 来源链接 </a>\n";
                }
                else if($request->type == DoctorPatientRef::THREAD_TYPE) 
                {
                    $sourceUrl = Thread::getStaticUrl($this->_newSpace->userName, $request->id);
                    $content .= "<a href= '{$sourceUrl}'  target='_blank' > 来源链接 </a>\n";
                }
            }
            $content .= "----------------------------------------------------------------------------\n";
            $content .= "联系电话: " . $tel . "\n";

            if ($time) {
                $content .= "方便联系的时间: " . $time . "\n";
            }
            $content .= "----------------------------------------------------------------------------\n";
            $content .= "发送时间: " . date("Y-m-d H:i");
            $content .= "----------------------------------------------------------------------------\n";
            $content .= "用户端信息: \n" . $clientInfo;
            UserClient::getInstance()->addUserAdvice('空间求助', $content, $this->_newSpace->user->id);

            $msg = '信息发送成功,感谢对好大夫在线的支持,管理员稍后为您处理遇到的问题,处理后我们会发送站内信通知您,请继续浏览网站信息';
            if(false == $isAjax)
            {
                MsgHtml::msg($msg, $this->_newSpace->getUrl());
            }
        }
        $response->msg = $msg;
	}
<?php

$canCompliant = false;
foreach ($flowList as $flow) {
    if ($flow->isNull()) {
        continue;
    }
    if ($flow instanceof DoctorPatientPost || $flow instanceof Post) {
        if ($editPost->isNull() || $editPost->id != $flow->id) {
            include dirname(__FILE__) . '/' . DoctorPatientRef::getPostTemplate(get_class($flow), $object);
        }
    } else {
        include dirname(__FILE__) . '/' . DoctorPatientRef::getPostTemplate(get_class($flow), $object);
    }
    if ($flow instanceof DoctorPatientPost || $flow instanceof Post || $flow instanceof Thread) {
        $canCompliant = true;
    }
}
if ($canCompliant) {
    include dirname(__FILE__) . '/_complaint_popbox.php';
    $scripts[] = 'doctorzone/flow/complaint.js';
    ?>
    <script type="text/javascript">
    $(document).ready(function(){
        initFancyBox("a.showComplaint");
    });
    </script>
<?php 
}
foreach ($flowables as $flowable) {
    if ($flowable instanceof XDateTime)
    {
        include dirname(__FILE__).'/flowposttemplates/_datetime.php';
    }
    else if ($flowable instanceof ServiceCard)//这儿走不到了,会改为别的实现,但页面保留
    {
        include dirname(__FILE__).'/flowposttemplates/_servicecard.php';
    }
    else
    {
        if ($firstThread instanceof Proposal && $flowable->id == $firstThread->id)
        {
            continue;
        }
        include dirname(__FILE__).'/flowposttemplates/'.DoctorPatientRef::getPostTemplate(get_class($flowable));
    }
}
if ($nowPage == $pages && ($orderdesc || $userSelfIsLogin))
{
    include_once dirname(__file__).'/flowdetailinc/_serviceused.php'; 
    include_once dirname(__file__).'/flowdetailinc/_serviceprovider.php'; 
    include_once dirname(__file__).'/flowdetailinc/_serviceapply.php'; 
}
?>
<script type="text/javascript">
$(document).ready(function(){
    $("#container a").attr("target", "");
});
</script>
    private function spaceReplyCase4Flow(DoctorPatientRef $ref, $options, $attachmentIds, $user, $content) 
    {/*{{{*/
        if(false == $ref->isSpaceCanPost())
        {
            $this->setErrorCode(842);
            return 0;
        }
        if ($ref->isClosePost()) 
        {
            DoctorPatientPostClient::getInstance()->switchPatientPostCan($ref->space->user->id, $ref->id);
        }
        if($ref->replyLimitationIsApproaching())
        {
            $option['removeReplyLimitation']  = isset($options['removeReplyLimitation']) ? $options['removeReplyLimitation'] : 0;
        }
        if(isset($option['removeReplyLimitation']) && $option['removeReplyLimitation'])
        {
            if($ref->space->isChargeOpened())
            {
                //当是收费咨询的时候,取消remove参数。因为传0或者1都会在addPost再次改变次数
                unset($option['removeReplyLimitation']);
                FlowClient::getInstance()->addFreeServcieCardBySystem($ref);
            }
        }

        //加入默认患友会
        if($user->id == $ref->space->user->id
        && $ref->space->isPatientOpened()
            && $ref->isReGroupMember() == false)
        {
            FlowClient::getInstance()->addUserToDefaultReGroup($ref->id, $user->id);
        }

        $attachmentIds = explode(',', $attachmentIds);
        $option['attachmentIds'] = $attachmentIds;
        if(isset($options['isPrivated']) && $options['isPrivated'])
        {
            $option['isPrivated'] = true;
        }
        $post = DoctorPatientPostClient::getInstance()->addPost($ref->id, $user->id, $content, $option);
        DBC::requireFalse($post->isNull(), '系统繁忙,请稍后重试');
        if (false == $post->isNull())
        {
            ScoreClient::getInstance()->replyForFlow($user, $ref);
        }
        try{
            FlowClient::getInstance()->addLog($ref, $user, DoctorPatientLog::TYPE_SYSTEM_LOG, 'CaseDataBucket::spaceReplyCase', $post);
        }catch(Exception $ex)
        {}
        return $post;
    }/*}}}*/
 private function getSitemapSourceUrl($spaceUserName,$sourceId,$sourceType)
 {/*{{{*/
     switch ($sourceType)
     {
         case Space::SPACE_SITEMAP_SOURCE_CASE :
             $url = Thread::getStaticUrl($spaceUserName,$sourceId);
             break;
         case Space::SPACE_SITEMAP_SOURCE_ARTICLE :
             $url = Article::buildUrl($spaceUserName,$sourceId);
             break;
         case Space::SPACE_SITEMAP_SOURCE_FLOW :
             $url = DoctorPatientRef::getStaticUrl($spaceUserName,$sourceId);
             break;
         default:
             $url = '';
     }
     return $url;
 }/*}}}*/