修复专家拒绝功能

This commit is contained in:
wlx 2011-11-23 10:24:07 +00:00
parent 5432058cdf
commit 814cee43bc
1 changed files with 7 additions and 25 deletions

View File

@ -535,7 +535,8 @@ class ReviewController extends Zend_Controller_Action
}// downattAction 下载附件 }// downattAction 下载附件
function denyinviteAction(){ function denyinviteAction()
{
$id = $this->_request->getParam('id'); $id = $this->_request->getParam('id');
$uuid = $this->_request->getParam('uuid'); $uuid = $this->_request->getParam('uuid');
@ -553,31 +554,12 @@ class ReviewController extends Zend_Controller_Action
if($id==$userid) if($id==$userid)
{ {
try{ 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'"; $sql = "update mdexpertreview set status=-1 where id='$id' and uuid='$uuid'";
if($this->db->exec($sql)) if($this->db->exec($sql))
$this->view->message = "您已经拒绝该元数据的评审邀请"; $this->view->message = "您已经拒绝该元数据的评审邀请";
} else
} $this->view->message = "您无权限进行此操作";
}catch(Exception $e){ }catch(Exception $e){
$this->view->message = $e->getMessage(); $this->view->message = $e->getMessage();
} }