Merge branch 'development' of http://git.westgis.ac.cn:8000/lijianxuan/westdc-core into development

This commit is contained in:
Li Jianxuan 2015-02-07 14:14:55 +08:00
commit 4d52d2f698
3 changed files with 75 additions and 10 deletions

View File

@ -49,17 +49,14 @@ class Layout
$inlineScriptHelper = $viewHelperManager->get('inlineScript'); $inlineScriptHelper = $viewHelperManager->get('inlineScript');
$inlineScriptHelper ->captureStart(); $inlineScriptHelper ->captureStart();
echo "$('#page-nav-".$this->getControllerNavName($controller)."-".$action."').addClass('active');"; echo "$('#Nav-".$this->getControllerNavName($controller)."-".$action."').addClass('active');";
$inlineScriptHelper ->captureEnd(); $inlineScriptHelper ->captureEnd();
} }
public function getControllerNavName($invokename) public function getControllerNavName($invokename)
{ {
$ctl = array( $controller_spell = explode("\\",$invokename);
'Application\Controller\Index' => 'index', return strtolower(end($controller_spell));
'Application\Controller\Account' => 'account'
);
return isset($ctl[$invokename]) ? $ctl[$invokename]:"";
} }
//添加用户Ajax脚本 //添加用户Ajax脚本

View File

@ -16,7 +16,7 @@ use Zend\Paginator\Adapter\DbSelect;
use Zend\Paginator\Adapter\DbTableGateway; use Zend\Paginator\Adapter\DbTableGateway;
use Zend\Paginator\Paginator as Zend_Paginator; use Zend\Paginator\Paginator as Zend_Paginator;
use Zend\Db\Sql\Select; use Zend\Db\Sql\Select;
use Zend\Db\TableGateway\TableGateway; use Zend\Db\TableGateway;
class Paginator implements ServiceManagerAwareInterface{ class Paginator implements ServiceManagerAwareInterface{
@ -113,7 +113,7 @@ class Paginator implements ServiceManagerAwareInterface{
$data = new DbSelect($data,$zendDb); $data = new DbSelect($data,$zendDb);
} }
if($data instanceof TableGateway) if($data instanceof TableGateway\TableGatewayInterface || $data instanceof TableGateway\AbstractTableGateway)
$data = new DbTableGateway($data,$this->sqlQuery,$this->sqlOrder,$this->sqlGroup,$this->sqlHaving); $data = new DbTableGateway($data,$this->sqlQuery,$this->sqlOrder,$this->sqlGroup,$this->sqlHaving);
$paginator = new Zend_Paginator($data); $paginator = new Zend_Paginator($data);

View File

@ -277,7 +277,75 @@ class Review extends AbstractEventManager implements ServiceManagerAwareInterfac
return $select; return $select;
}//accept() }//getAccept()
/**
* 获得我负责的元数据
* @param string $filter
* @return null
*/
public function getAdminReviews($filter = "")
{
$authService = $this->serviceManager->get('Auth');
$user_id = $authService->getIdentity('id');
if(empty($user_id))
return false;
$wheresql = array();
$ordersql = array();
$wheresql[] = " m.status in (1,2,3,4) ";
$wheresql[] = " u.id=$user_id ";
if(isset($filter['keyword']) && !empty($filter['keyword']))
{
$wheresql[] = " md.title like '%".$filter['keyword']."%' ";
}
if(isset($filter['code']) && !empty($filter['code']))
{
$wheresql[] = " s.sourceid=".$filter['code']." ";
}
if(isset($filter['order']) && !empty($filter['order']))
{
$sort = "DESC";
if(isset($filter['sort']) && !empty($filter['sort']) && in_array( strtolower($filter['sort']),array('desc','asc')))
{
$sort = $filter['sort'];
}
$ordersql[] = " {$filter['order']} $sort ";
}
if(count($wheresql)>0)
{
$wheresql = " WHERE ".join(" AND ",$wheresql);
}else{
$wheresql = "";
}
if(count($ordersql)>0)
{
$ordersql = " ORDER BY ".join(',',$ordersql);
}else{
$ordersql = " ORDER BY m.status desc,m.ts_accepted desc ";
}
$sql = "select m.id,g.id as gid, md.uuid,md.title,u.username,u.realname,m.status,md.id as mdid,md.author,m.ts_accepted,count(r.id) as reviews
FROM mdstatus m
right join metadata md on md.uuid=m.uuid
left join geonetworkmetadata g on m.uuid=g.uuid
left join users u on u.id=m.userid
left join datasource s on s.uuid=md.uuid
left join mdreview r ON r.uuid=md.uuid
$wheresql
GROUP BY m.id,g.id, md.uuid,md.title,u.username,u.realname,m.status,md.id,md.author,m.ts_accepted
$ordersql";
$re = $this->db->query($sql);
$rows = $re->fetchAll();
return $rows;
}//getAdminReviews
/** /**
* 取消评审 * 取消评审
@ -374,7 +442,7 @@ class Review extends AbstractEventManager implements ServiceManagerAwareInterfac
$this->getEventManager()->trigger('review.reset', $this, compact('id')); $this->getEventManager()->trigger('review.reset', $this, compact('id'));
return true; return true;
} }//reset()
/** /**
* 更改管理员 * 更改管理员