public function before($context) { $spaceUserName = WebUtil::getSpaceUserName($context->request); $space = SpaceClient::getInstance()->getSpaceByUserName($spaceUserName); $userId = UserClient::getInstance()->getCheckedSeed('id'); $user = DAL::get()->find('user', $userId); if ($space->isNull()) { header('Location: http://www.haodf.com'); exit; } $auditor = DAL::get()->find_by_userid('auditor', $userId); if (empty($userId) || $space->user->id != $userId && $userId != 6 && FollowupAssistantClient::getInstance()->hasAssistRights($userId, $space->id) == false && $auditor->isNull()) { $msg = rawurlencode('你没有权限操作!'); header('Location: ' . $space->getUrl() . 'index/showmessage?msg=' . $msg); exit; } }
<span <?php echo $cssStr; ?> ><?php echo $userName; ?> </span> <?php if ($postedByUser) { if ($post->agentAuditor->isNull() == false) { echo "<div>管理员:<span style='padding:2px;color:orange;'>{$post->agentAuditor->realName}</span></div>"; } } else { $followupLog = DAL::get()->find_by_doctorpatientpostid('FollowupLog', $post->id); if (false == $followupLog->isNull()) { $fsAssistantRef = FollowupAssistantClient::getInstance()->getAssistantRef($followupLog->user->id, $post->doctorPatientRef->space->id); if (false == $fsAssistantRef->isNull()) { echo "<div style='padding:2px;'>助理:{$fsAssistantRef->assistant->name}</div>"; } } } ?> <?php if ($post->isPrivated()) { ?> <p><span style="color: red">(隐私对话) </span></p> <?php } ?> </td> <td class="tl p10">
public function addAssistantGroupRef($request, $response) { /*{{{*/ $spaceGroupId = $request->spacegroupid; $assistantIds = $request->assistantids; $assistantGroupId = $request->assistantgroupid; $spaceGroup = DAL::get()->find('FollowupSpaceGroup', $spaceGroupId); $assistantGroup = DAL::get()->find('AssistantGroup', $assistantGroupId); $existAssistantIds = array(); $assistantGroupRefs = DAL::get()->find_all_by_assistantgroupid('AssistantGroupRef', $assistantGroupId); foreach ($assistantGroupRefs as $assistantGroupRef) { $existAssistantIds[] = $assistantGroupRef->assistant->id; } foreach ($assistantIds as $assistantId) { if (in_array($assistantId, $existAssistantIds) == false) { $assistant = DAL::get()->find('Assistant', $assistantId); FollowupAssistantClient::getInstance()->addAssistantGroupRef($assistant, $assistantGroup); } } $response->setRedirect($response->router->urlfor('followup/assistantgroup', array('fsGroupId' => $spaceGroupId, 'assistantgroupid' => $assistantGroupId))); }
public function delFSGroup($request, $response) { /*{{{*/ $fsGroupId = $request->fsGroupId; FollowupAssistantClient::getInstance()->deleteFollowupSpaceGroup($fsGroupId); $response->setRedirect($response->router->urlfor('followup/followupassistantlist', array('c' => 'followup', 'a' => 'followupassistantlist', 'doAction' => 'manage'))); }
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); }/*}}}*/