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 ->captureStart();
echo "$('#page-nav-".$this->getControllerNavName($controller)."-".$action."').addClass('active');";
echo "$('#Nav-".$this->getControllerNavName($controller)."-".$action."').addClass('active');";
$inlineScriptHelper ->captureEnd();
}
public function getControllerNavName($invokename)
{
$ctl = array(
'Application\Controller\Index' => 'index',
'Application\Controller\Account' => 'account'
);
return isset($ctl[$invokename]) ? $ctl[$invokename]:"";
$controller_spell = explode("\\",$invokename);
return strtolower(end($controller_spell));
}
//添加用户Ajax脚本

View File

@ -16,7 +16,7 @@ use Zend\Paginator\Adapter\DbSelect;
use Zend\Paginator\Adapter\DbTableGateway;
use Zend\Paginator\Paginator as Zend_Paginator;
use Zend\Db\Sql\Select;
use Zend\Db\TableGateway\TableGateway;
use Zend\Db\TableGateway;
class Paginator implements ServiceManagerAwareInterface{
@ -113,7 +113,7 @@ class Paginator implements ServiceManagerAwareInterface{
$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);
$paginator = new Zend_Paginator($data);

View File

@ -277,7 +277,75 @@ class Review extends AbstractEventManager implements ServiceManagerAwareInterfac
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'));
return true;
}
}//reset()
/**
* 更改管理员