增加了专家拒绝邀请的功能

This commit is contained in:
Li Jianxuan 2011-11-15 08:54:42 +00:00
parent 1c3d7e9002
commit 21edc6794c
2 changed files with 102 additions and 2 deletions

View File

@ -328,17 +328,42 @@ class ReviewController extends Zend_Controller_Action
if($data['status']>=0)
{
echo '<script>$("#postcomment").remove();</script>';
@$mailtp=new EmailText(
$this->db,
"mdreview-post-comment",
array(
'user' => $user->username,
'uuid' => $uuid,
'title'=> $md['title'],
'content' => $mdcomment
)
);
@$body = $mailtp->getBody();
@$mail=new WestdcMailer($this->view->config->smtp);
@$mail->setBodyText($body);
@$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
if($data['is_expert']=='true')
{
@$mail->addTo($email); //管理员邮箱
}else
{
@$mail->addTo($email); //元数据作者
@$mail->addCc(); //管理员
}
@$mail->setSubject($subject);
@$mail->send();
}
echo "</div>";
exit();
}catch(Exception $e){
echo '<div class="box box-error">保存草稿出错,请稍后再试!</div>';
echo '<div class="box box-error">保存出错,请稍后再试!</div>';
exit();
}
}
}else{
echo '<div class="box box-error">保存草稿出错,请稍后再试!</div>';
echo '<div class="box box-error">保存出错,请稍后再试!</div>';
exit();
}
}catch (Exception $e){
@ -506,5 +531,67 @@ class ReviewController extends Zend_Controller_Action
}// downattAction 下载附件
function denyinviteAction(){
$id = $this->_request->getParam('id');
$uuid = $this->_request->getParam('uuid');
if(empty($id) || empty($uuid) || !is_numeric($id) ||!preg_match("/^[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12}$/",$uuid))
{
$this->view->message = "参数错误";
}else{
$auth = Zend_Auth::getInstance();
if($auth->hasIdentity())
{
$user = $auth->getIdentity();
$userid = $user->id;
if($id==$userid)
{
try{
$sql = "select md.title,r.status,rp.status as expint from mdreview r
left join metadata md on md.uuid=r.uuid
left join mdexpertreview rp on rp.id=md.id
where r.id='$id' and r.uuid='$uuid'
";
$rs = $this->db->query($sql);
$rows = $rs->fetchAll();
if(empty($rows['expint']))
{
$this->view->message = "您无权限进行此操作";
}else
{
if($rows['status']>=3 || $rows['expint']>=0)
{
$this->view->message = "该元数据的当前状态不能被拒绝对其的评审";
}else{
$sql = "update mdexpertreview set status=-1 where id='$id' and uuid='$uuid'";
if($this->db->exec($sql))
$this->view->message = "您已经拒绝该元数据的评审邀请";
}
}
}catch(Exception $e){
$this->view->message = $e->getMessage();
}
}//end if
else
{
$this->view->message = "您无权使用此通知";
}//非本人操作,或尝试删除他人信息
}//end if
else
{
$this->view->message = '请登录后再执行此操作,请<a href="/account/login/?href=/review/denyinvite/id/'.$id.'/uuid/'.$uuid.'">点击此处登录</a>';
}//未登录
}
}// denyinviteAction() 专家拒绝邀请
}

View File

@ -0,0 +1,13 @@
<?php
$config = Zend_Registry::get('config');
$this->headTitle($config->title->site);
$this->headTitle($config->title->review);
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/mdreview.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('元数据评审');
$this->breadcrumb()->setSeparator(' > ');
?>
<div>
<?php echo $this->message;?>
</div>