Add initial review function for CARD.

This commit is contained in:
wlx 2014-05-10 05:45:25 +00:00
parent 56680eff56
commit 0e6e907cc6
1 changed files with 37 additions and 37 deletions

View File

@ -16,8 +16,8 @@ class Admin_ReviewController extends Zend_Controller_Action
*/
function indexAction()
{
$sql = "select m.id,md.title,u.username,u.realname,m.status from mdstatus m
right join metadata md on md.uuid=m.uuid
$sql = "select m.id,md.title,u.username,u.realname,m.status from en.mdstatus m
right join en.metadata md on md.uuid=m.uuid
left join users u on u.id=m.userid
order by m.id desc limit 10 ";
$re = $this->db->query($sql);
@ -38,8 +38,8 @@ class Admin_ReviewController extends Zend_Controller_Action
$userid = $user->id;
}
$sql = "select m.id,md.title,u.username,u.realname,m.status from mdstatus m
right join metadata md on md.uuid=m.uuid
$sql = "select m.id,md.title,u.username,u.realname,m.status from en.mdstatus m
right join en.metadata md on md.uuid=m.uuid
left join users u on u.id=m.userid
where u.id='$userid'";
@ -105,11 +105,11 @@ class Admin_ReviewController extends Zend_Controller_Action
else
{
if($status==1)
{$sql = "update mdstatus set status='$status',ts_accepted='now()' where id in ($id)"; }
{$sql = "update en.mdstatus set status='$status',ts_accepted='now()' where id in ($id)"; }
else if($status==5)
{$sql = "update mdstatus set status='$status',ts_finished='now()' where id in ($id)";}
{$sql = "update en.mdstatus set status='$status',ts_finished='now()' where id in ($id)";}
else
{$sql = "update mdstatus set status='$status' where id in ($id)";}
{$sql = "update en.mdstatus set status='$status' where id in ($id)";}
try{
if($this->db->exec($sql)>0)
{
@ -168,7 +168,7 @@ class Admin_ReviewController extends Zend_Controller_Action
//update search document
$search=new Search();
//create search view in xunsearch
$sql="select uuid from mdstatus where id=?";
$sql="select uuid from en.mdstatus where id=?";
$sth = $this->db->prepare($sql);
$sth->execute(array($cancel));
$data = $sth->fetch();
@ -187,8 +187,8 @@ class Admin_ReviewController extends Zend_Controller_Action
$keyword = $this->_request->getParam('keyword');
if(!empty($keyword))
{
$sql = "select m.*,md.title,u.username,u.realname from mdstatus m
right join metadata md on md.uuid=m.uuid
$sql = "select m.*,md.title,u.username,u.realname from en.mdstatus m
right join en.metadata md on md.uuid=m.uuid
left join users u on u.id=m.userid
where m.status in (1,2,3,4)
and md.title like '%$keyword%'
@ -206,8 +206,8 @@ class Admin_ReviewController extends Zend_Controller_Action
}//搜索
else
{
$sql = "select m.*,md.title,u.username,u.realname from mdstatus m
right join metadata md on md.uuid=m.uuid
$sql = "select m.*,md.title,u.username,u.realname from en.mdstatus m
right join en.metadata md on md.uuid=m.uuid
left join users u on u.id=m.userid
where m.status in (1,2,3,4)
order by m.ts_created desc";
@ -239,8 +239,8 @@ class Admin_ReviewController extends Zend_Controller_Action
if($show>0)
{
$sql = "select m.*,md.*,u.realname from mdstatus m
right join metadata md on md.uuid=m.uuid
$sql = "select m.*,md.*,u.realname from en.mdstatus m
right join en.metadata md on md.uuid=m.uuid
left join users u on u.id=m.userid
where m.id=$show
";
@ -295,8 +295,8 @@ class Admin_ReviewController extends Zend_Controller_Action
$this->view->keyword = $keyword;
}
$sql = "select m.id,md.title,m.status,m.uuid,u.username,u.realname from mdstatus m
right join metadata md on md.uuid=m.uuid
$sql = "select m.id,md.title,m.status,m.uuid,u.username,u.realname from en.mdstatus m
right join en.metadata md on md.uuid=m.uuid
left join users u on u.id=m.userid
where m.status in (2,3,4) $searchjoin order by m.ts_accepted desc";
$rs = $this->db->query($sql);
@ -358,8 +358,8 @@ class Admin_ReviewController extends Zend_Controller_Action
{
if(is_array($exps))
{
$sql = "select m.uuid,m.title,s.status from metadata m
left join mdstatus s on s.uuid=m.uuid
$sql = "select m.uuid,m.title,s.status from en.metadata m
left join en.mdstatus s on s.uuid=m.uuid
where s.id='$id'";
$rs = $this -> db -> query($sql);
@ -513,7 +513,7 @@ class Admin_ReviewController extends Zend_Controller_Action
if(!empty($uid))
{
$sql = "update mdstatus set userid='$uid' where id='$id'";
$sql = "update en.mdstatus set userid='$uid' where id='$id'";
if($this->db->exec($sql)>0)
{
include_once('helper/view.php');
@ -549,7 +549,7 @@ class Admin_ReviewController extends Zend_Controller_Action
$uuid=$this->_request->getParam('uuid');
$userid=Zend_Auth::getInstance()->getIdentity()->id;
$sql = "select * from mdstatus where uuid='$uuid'";
$sql = "select * from en.mdstatus where uuid='$uuid'";
$re = $this->db->query($sql);
$row = $re->fetch();
@ -557,7 +557,7 @@ class Admin_ReviewController extends Zend_Controller_Action
if(empty($row['id']))
{
$sql = "insert into mdstatus (uuid,userid,status) values ('$uuid','$userid','0')";
$sql = "insert into en.mdstatus (uuid,userid,status) values ('$uuid','$userid','0')";
try{
if($this->db->exec($sql)>0)
{
@ -569,7 +569,7 @@ class Admin_ReviewController extends Zend_Controller_Action
return true;
}
} else if ($row['status']==5){
$sql="update mdstatus set status=1,ts_accepted=now() where status=5 and id=".$row['id'];
$sql="update en.mdstatus set status=1,ts_accepted=now() where status=5 and id=".$row['id'];
$this->db->query($sql);
view::Post($this,array("content"=>'操作成功!该数据已重新放入评审','url'=>'/admin/review/accept'));
return true;
@ -637,7 +637,7 @@ class Admin_ReviewController extends Zend_Controller_Action
$id = $this->view->id = $this->_request->getParam('id');
$sql="select m.title,m.uuid,array_to_string(array(select distinct(email) from role r left join responsible rs on r.resid=rs.id where r.uuid=m.uuid and length(rs.email)>4),',') as emails from mdstatus s left join metadata m on s.uuid=m.uuid where s.id=?";
$sql="select m.title,m.uuid,array_to_string(array(select distinct(email) from en.role r left join en.responsible rs on r.resid=rs.id where r.uuid=m.uuid and length(rs.email)>4),',') as emails from en.mdstatus s left join en.metadata m on s.uuid=m.uuid where s.id=?";
$res=$this->db->fetchRow($this->db->quoteInto($sql,$id));
$rv=explode(',',$res['emails']);
$rows = array();
@ -749,7 +749,7 @@ class Admin_ReviewController extends Zend_Controller_Action
//update search document
$search=new Search();
//create search view in xunsearch
$sql="select * from xunsearch where uuid in (select uuid from mdstatus where id in (".$ids."))";
$sql="select * from en.xunsearch where uuid in (select uuid from en.mdstatus where id in (".$ids."))";
$sth = $this->db->prepare($sql);
$sth->execute();
while ($data = $sth->fetch())
@ -760,7 +760,7 @@ class Admin_ReviewController extends Zend_Controller_Action
//仅对单条数据发送email信息
if (is_numeric($ids))
{
$sql="select distinct u.email,m.title,m.uuid from mdstatus s left join metadata m on s.uuid=m.uuid
$sql="select distinct u.email,m.title,m.uuid from mdstatus s left join en.metadata m on s.uuid=m.uuid
right join mdauthor a on s.uuid=a.uuid left join users u on a.userid=u.id where s.id=? order by u.email";
$rs=$this->db->query($sql,array($ids));
$rows=$rs->fetchAll();
@ -805,10 +805,10 @@ class Admin_ReviewController extends Zend_Controller_Action
$this->view->keyword = $keyword;
}
$sql = "select m.id,md.title,md.uuid,u.username,u.realname,m.status,m.ts_created,gn.id as gnid from mdstatus m
right join metadata md on md.uuid=m.uuid
$sql = "select m.id,md.title,md.uuid,u.username,u.realname,m.status,m.ts_created,gn.id as gnid from en.mdstatus m
right join en.metadata md on md.uuid=m.uuid
left join users u on u.id=m.userid
left join geonetworkmetadata gn on m.uuid=gn.uuid
left join en.geonetworkmetadata gn on m.uuid=gn.uuid
where status=0 $searchjoin order by m.ts_created desc";
$re = $this->db->query($sql);
@ -867,8 +867,8 @@ class Admin_ReviewController extends Zend_Controller_Action
$this->view->keyword = $keyword;
}
$sql = "select m.id,md.title,md.uuid,u.username,u.realname,m.status from mdstatus m
right join metadata md on md.uuid=m.uuid
$sql = "select m.id,md.title,md.uuid,u.username,u.realname,m.status from en.mdstatus m
right join en.metadata md on md.uuid=m.uuid
left join users u on u.id=m.userid
where status=-1 $searchjoin";
@ -907,8 +907,8 @@ class Admin_ReviewController extends Zend_Controller_Action
$this->view->keyword = $keyword;
}
$sql = "select m.id,md.title,md.uuid,u.username,u.realname,m.status,m.ts_finished from mdstatus m
right join metadata md on md.uuid=m.uuid
$sql = "select m.id,md.title,md.uuid,u.username,u.realname,m.status,m.ts_finished from en.mdstatus m
right join en.metadata md on md.uuid=m.uuid
left join users u on u.id=m.userid
where status=5 $searchjoin order by m.ts_finished desc";
@ -945,13 +945,13 @@ class Admin_ReviewController extends Zend_Controller_Action
$user = $auth->getIdentity();
$userid = $user->id;
$sql = "select id from mdstatus where userid='$userid' and id='$id'";
$sql = "select id from en.mdstatus where userid='$userid' and id='$id'";
$rs = $this->db->query($sql);
$row = $rs->fetch();
if(!empty($row['id']))
{
$sql = "delete from mdstatus where id='$id'";
$sql = "delete from en.mdstatus where id='$id'";
if($this->db->exec($sql))
{
view::Post($this,array("content"=>'删除成功','url'=>"/admin/review/myreview"));
@ -1282,7 +1282,7 @@ class Admin_ReviewController extends Zend_Controller_Action
}
$sql = "select md.title,md.uuid,u.realname,r.id,r.ts_created,r.is_expert from mdreview r
left join metadata md on md.uuid=r.uuid
left join en.metadata md on md.uuid=r.uuid
left join users u on u.id=r.userid
$wheresql
order by r.ts_created desc
@ -1333,7 +1333,7 @@ class Admin_ReviewController extends Zend_Controller_Action
}
$sql = "select u.id,u.realname as title,count(r.id) as c from mdreview r
left join metadata md on md.uuid=r.uuid
left join en.metadata md on md.uuid=r.uuid
left join users u on u.id=r.userid
$wheresql
GROUP BY u.id,u.realname
@ -1463,7 +1463,7 @@ class Admin_ReviewController extends Zend_Controller_Action
}
$sql = "select md.title,md.uuid,count(r.id) as c from mdreview r
left join metadata md on md.uuid=r.uuid
left join en.metadata md on md.uuid=r.uuid
$wheresql
GROUP BY md.title,md.uuid
";