diff --git a/application/default/controllers/HiwaterController.php b/application/default/controllers/HiwaterController.php index e01ead85..424388fe 100644 --- a/application/default/controllers/HiwaterController.php +++ b/application/default/controllers/HiwaterController.php @@ -28,6 +28,10 @@ class HiwaterController extends DataController else if(in_array($acName,array("wsn","waternet","soilnet","bnunet",'bnulai'))) { $this->view->pageIn = "collapse5"; + } + else if(in_array($acName,array("fund","tag","timeline","timemap",'author','organization'))) + { + $this->view->pageIn = "collapse10"; } else if(in_array($acName,array("other"))) { @@ -410,32 +414,130 @@ class HiwaterController extends DataController $this->view->offset=$offset+1; } - //从pgsql读取数组并拆分为php数组 - function getArray($str){ - if(strlen($str)>3) - { - return explode(",",substr($str,1,-1)); - }else{ - return NULL; - } - } - - //将php数组组装成pgsql中的数组 - function mkArray($array){ - if(!is_array($array)) - { - return "{".$array."}"; - } - if(count($array)==1) - { - $key = max(array_keys($array)); - return "{".$array[$key]."}"; - } - if(count($array)>1) - { - return "{".join(",",$array)."}"; - } - } - - + //基于数据作者的浏览(包括认证后的数据作者以及未认证的数据作者) + function authorAction() + { + $ac = $this->_request->getParam('ac'); + $id = (int)$this->_request->getParam('id'); + if ($ac=='verified') { + //已经认证过的数据作者 + $this->view->tabID='author-verified'; + $this->view->ac='verified'; + if ($id) { + //列出作者的数据 + $sql="select username,realname from users where id=?"; + $this->view->author=$this->db->fetchRow($sql,array($id)); + $sql="select m.* from normalmetadata m left join mdauthor a on a.uuid=m.uuid where m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='hiwater') and a.userid=?"; + $sth = $this->db->prepare($sql); + $sth->execute(array($id)); + $rows = $sth->fetchAll(); + $paginator = Zend_Paginator::factory($rows); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(10); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); + $this->view->paginator=$paginator; + } else { + //已经认证过的数据作者 + $sql="select u.username,u.realname,u.id,count(u.id) as count from mdauthor a left join users u on a.userid=u.id where a.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='hiwater') and a.status=1 and a.uuid in (select uuid from normalmetadata) group by u.id,u.username,u.realname"; + $sth = $this->db->prepare($sql); + $sth->execute(); + $rows = $sth->fetchAll(); + $paginator = Zend_Paginator::factory($rows); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(50); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); + $this->view->paginator=$paginator; + } + } else if ($ac=='unverified' || empty($ac)) { + //未认证的数据作者 + $this->view->tabID='author-unverified'; + $this->view->ac='unverified'; + if ($id) { + //列出数据 + $sql="select individual as username from responsible where id=?"; + $this->view->author=$this->db->fetchRow($sql,array($id)); + $sql="select distinct m.* from normalmetadata m left join role r on m.uuid=r.uuid left join responsible s on r.resid=s.id where r.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='hiwater') and r.role in ('pointOfContact','resourceProvider','owner') and s.id=?"; + $sth = $this->db->prepare($sql); + $sth->execute(array($id)); + $rows = $sth->fetchAll(); + $paginator = Zend_Paginator::factory($rows); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(10); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); + $this->view->paginator=$paginator; + } else { + //列出所有作者 + $sql="select distinct responsible.individual as username,responsible.id from responsible left join role on role.resid=responsible.id where role.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='hiwater') and role.role in ('pointOfContact','resourceProvider','owner')"; + $sth = $this->db->prepare($sql); + $sth->execute(); + $rows = $sth->fetchAll(); + $paginator = Zend_Paginator::factory($rows); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(50); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); + $this->view->paginator=$paginator; + } + } + } + + function fundAction() + { + $id = (int)$this->_request->getParam('id'); + if (!empty($id)) { + $sql="select * from fund where id=?"; + $this->view->fund=$this->db->fetchRow($sql,array($id)); + if ($this->view->fund) { + $sql="select distinct m.* from normalmetadata m left join mdfund mf on m.uuid=mf.uuid where m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='hiwater') and mf.fid=?"; + $sth = $this->db->prepare($sql); + $sth->execute(array($id)); + $rows = $sth->fetchAll(); + $paginator = Zend_Paginator::factory($rows); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(10); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); + $this->view->paginator=$paginator; + } + } else { + //提供全部分类列表 + $sql="select f.id,f.title,f.fund_id,f.fund_type,f.ts_created,count(m.id) as datacount,sum(md.filesize) as filesize from fund f left join mdfund m on f.id=m.fid left join metadata md on m.uuid=md.uuid where m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='hiwater') group by f.id,f.title,f.fund_id,f.fund_type,f.ts_created order by f.ts_created desc"; + $sth = $this->db->prepare($sql); + $sth->execute(); + $rows = $sth->fetchAll(); + $paginator = Zend_Paginator::factory($rows); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(10); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); + $this->view->paginator=$paginator; + $this->_helper->viewRenderer('fund-list'); + } + } + + function organizationAction() + { + $page = $this->_request->getParam('page'); + $name = $this->_request->getParam('name'); + $state=$this->db->query("select distinct responsible.organisation from responsible left join role on role.resid=responsible.id where role.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='hiwater') and role.role in ('pointOfContact','resourceProvider','owner')"); + $this->view->organisation=$state->fetchAll(); + if (!empty($name)) { + $this->view->codename=$name; + $sql="select distinct m.* from normalmetadata m left join role r on m.uuid=r.uuid left join responsible s on r.resid=s.id where m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='hiwater') and r.role in ('pointOfContact','resourceProvider','owner') and s.organisation=?"; + $sth = $this->db->prepare($sql); + $sth->execute(array($name)); + $rows = $sth->fetchAll(); + $paginator = Zend_Paginator::factory($rows); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(10); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); + $this->view->paginator=$paginator; + } else { + //提供全部分类列表 + } + } } \ No newline at end of file diff --git a/application/default/views/scripts/hiwater/author.phtml b/application/default/views/scripts/hiwater/author.phtml new file mode 100644 index 00000000..e69b9423 --- /dev/null +++ b/application/default/views/scripts/hiwater/author.phtml @@ -0,0 +1,71 @@ +headTitle($this->config->title->site); +$this->headTitle($this->config->title->data); +$this->headTitle('数据作者浏览'); +$this->headTitle()->setSeparator(' - '); +$this->nav[] = array('link'=>"/hiwater",'title'=>'黑河生态水文遥感试验'); +$this->theme->AppendPlus($this,'colorbox'); +$this->headLink()->appendStylesheet('/css/water.css'); +?> +render('breadcrumbs.phtml') ?> +
+
+ partial('hiwater/navi.phtml'); ?> +
+
+ +author) : ?> +paginator)) : ?> + +paginator as $md) : ?> +
+ + + +
+

escape($md['title']);?>

+ +

DOI: + 申请日期: + 创建日期: + + 发布日期: +

+ +

DOI:

+ + + +
',mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']));?>
+
+
+ + + + +paginator)) : ?> + + + + + +
+
+ diff --git a/application/default/views/scripts/hiwater/fund-list.phtml b/application/default/views/scripts/hiwater/fund-list.phtml new file mode 100644 index 00000000..985d46d5 --- /dev/null +++ b/application/default/views/scripts/hiwater/fund-list.phtml @@ -0,0 +1,26 @@ +headTitle($this->config->title->site); +$this->headTitle($this->config->title->data); +$this->headTitle('支持项目'); +$this->headTitle()->setSeparator(' - '); +$this->nav[] = array('link'=>"/hiwater",'title'=>'黑河生态水文遥感试验'); +?> +render('breadcrumbs.phtml') ?> +
+
+ partial('hiwater/navi.phtml'); ?> +
+
+paginator)) : ?> + +paginator as $md) : ?> +
+

escape($md['title']);?>

+编号: | 类型: | 提供数据集:条,5000?(round($md['filesize']/1024,2)).'GB':$md['filesize'].'MB'; ?>
+ + + +暂无对应信息。 + +
+
\ No newline at end of file diff --git a/application/default/views/scripts/hiwater/fund.phtml b/application/default/views/scripts/hiwater/fund.phtml new file mode 100644 index 00000000..73bf9cad --- /dev/null +++ b/application/default/views/scripts/hiwater/fund.phtml @@ -0,0 +1,43 @@ +headTitle($this->config->title->site); +$this->headTitle($this->config->title->data); +$this->headTitle('支持项目'); +$this->headTitle()->setSeparator(' - '); +$this->nav[] = array('link'=>"/hiwater",'title'=>'黑河生态水文遥感试验'); +$this->theme->AppendPlus($this,'colorbox'); +?> +render('breadcrumbs.phtml') ?> +
+
+ partial('hiwater/navi.phtml'); ?> +
+
+
+

escape($this->fund['title']);?>

+编号:fund['fund_id']; ?> | 类型:fund['fund_type']; ?> +
+paginator)) : ?> +
+ +paginator as $md) : ?> +
+ + + +
+

escape($md['title']);?>

+
',mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']));?>
+
+
+ + + +暂无对应信息。 + +
+ \ No newline at end of file diff --git a/application/default/views/scripts/hiwater/navi.phtml b/application/default/views/scripts/hiwater/navi.phtml index 78acca3d..0e789169 100644 --- a/application/default/views/scripts/hiwater/navi.phtml +++ b/application/default/views/scripts/hiwater/navi.phtml @@ -112,7 +112,8 @@
- + +
-
+ +
+ +
+ +
+