Ticket #303 在离线申请通过之前加入了数据作者的意见判断

This commit is contained in:
Li Jianxuan 2012-03-12 09:44:13 +00:00
parent 4d1f68cdbf
commit 70a99bd3b0
1 changed files with 16 additions and 6 deletions

View File

@ -26,7 +26,7 @@ class Admin_DownController extends Zend_Controller_Action
$cancel =(int)$this->_getParam('cancel'); $cancel =(int)$this->_getParam('cancel');
$deny =(int)$this->_getParam('deny'); $deny =(int)$this->_getParam('deny');
$page =(int)$this->_getParam('page'); $page =(int)$this->_getParam('page');
$reset =(int)$this->_getParam('reset'); $reset =(int)$this->_getParam('reset');
$status =(int)$this->_getParam('status'); $status =(int)$this->_getParam('status');
if (!$page) $page=1; if (!$page) $page=1;
@ -84,6 +84,16 @@ class Admin_DownController extends Zend_Controller_Action
$this->_redirect('/admin/down/offlineapp/'.$page); $this->_redirect('/admin/down/offlineapp/'.$page);
} elseif ($finish) { } elseif ($finish) {
try { try {
$sql = "SELECT authorpermitted FROM dataorder WHERE offlineappid=?";
$sth = $this->db->prepare($sql);
$sth->execute(array($finish));
$row = $sth->fetch();
if($row['authorpermitted'] <0)
{
$this->messenger->addMessage('提示信息:数据作者明确反对该下载申请,所以不能进行进一步通过');
$this->_redirect('/admin/down/offlineapp/'.$page);
}
$sql="update dataorder set status=5,ts_approved=now() where offlineappid=?"; $sql="update dataorder set status=5,ts_approved=now() where offlineappid=?";
$this->db->query($sql,array($finish)); $this->db->query($sql,array($finish));
$sql="update offlineapp set ts_approved=now() where id=? and ts_approved is null"; $sql="update offlineapp set ts_approved=now() where id=? and ts_approved is null";
@ -184,13 +194,13 @@ class Admin_DownController extends Zend_Controller_Action
}//reset }//reset
$select="select distinct(o.*),d.status as datastatus from offlineapp o $select="select distinct(o.*),d.status as datastatus from offlineapp o
left join dataorder d on o.id=d.offlineappid"; left join dataorder d on o.id=d.offlineappid";
if ($status==4) if ($status==4)
$select.=" where o.ts_approved is null $select.=" where o.ts_approved is null
and o.pdflink is not null and d.status=4"; and o.pdflink is not null and d.status=4";
elseif ($status==-1) elseif ($status==-1)
$select.=" where o.pdflink is not null and o.status=-1"; $select.=" where o.pdflink is not null and o.status=-1";
else else
$select.=" where o.ts_approved is null $select.=" where o.ts_approved is null
and o.pdflink is not null and d.status in (3,4)"; and o.pdflink is not null and d.status in (3,4)";
$select.=" order by o.ts_created desc"; $select.=" order by o.ts_created desc";