diff --git a/application/default/controllers/ReviewController.php b/application/default/controllers/ReviewController.php index b6af7f2d..67557b69 100644 --- a/application/default/controllers/ReviewController.php +++ b/application/default/controllers/ReviewController.php @@ -29,239 +29,71 @@ class ReviewController extends Zend_Controller_Action } function myreviewAction(){ - - $keyword = $this->_request->getParam('q'); - $search = $this->_request->getParam('search'); - - try{ - $auth = Zend_Auth::getInstance(); - if($auth->hasIdentity()) - { - $user = $auth->getIdentity(); - $uid = $user->id; - } - else - { - $this->_redirect('/account/login/?href=/review/myreview'); - } - - $sql = "select md.title,md.uuid,md.id,md.description,s.status from metadata md left join mdstatus s on md.uuid=s.uuid - where md.uuid in (select uuid from mdexpertreview er where er.id=$uid - union select uuid from mdreview r where r.userid=$uid)"; - - if(!empty($keyword) && !empty($search)) - { - if (preg_match("/[<|>|#|$|%|^|*|(|)|{|}|'|\"|;|:]/i",$keyword) || !is_numeric($search)) - { - $this->messenger->addMessage('您的输入的搜索条件包含非法请求,请不要输入特殊符号'); - $this->_redirect('/review/myreview'); - }//非法请求过滤 - $this->view->keyword = $keyword; - $sql.= " and md.title like '%$keyword%' "; - // e.g. (... or md.author like '%keyword%') - } - - $rs = $this->db->query($sql); - $rows = $rs->fetchAll(); - - foreach($rows as $k=>$v) - { - $rows[$k]['status']=$this->rewritestatus($v['status']); - } - - $paginator = Zend_Paginator::factory($rows); - $paginator->setCurrentPageNumber($this->_getParam('page')); - $paginator->setItemCountPerPage($this->view->config->page->max); - $paginator->setView($this->view); - Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); - $this->view->paginator=$paginator; - }catch(Exception $e){ - $this->messenger->addMessage('查询失败,请稍后重试 :('); - $this->_redirect('/review/myreview'); - } - + $auth = Zend_Auth::getInstance(); + if($auth->hasIdentity()) + { + $user = $auth->getIdentity(); + $uid = $user->id; + }else{ + $this->_redirect('/account/login/?href=/review/myreview'); + } + $page=@(int)$this->_request->getParam('page'); + if (empty($page)) $page=1; + $offset=$this->limit*($page-1); + $row=$this->db->fetchAll("select count(s.*) from mdstatus s left join normalmetadata m on s.uuid=m.uuid where m.uuid in (select uuid from mdexpertreview er where er.id=$uid union select uuid from mdreview r where r.userid=$uid)"); + $sum=$row[0]['count']; + $sql="select m.uuid,m.title,m.id,m.description,s.status,s.ts_accepted,s.ts_finished,g.id as gid,t.filename from mdstatus s left join normalmetadata m on s.uuid=m.uuid left join geonetworkmetadata g on g.uuid=m.uuid left join thumbnail t on t.id=m.id where m.uuid in (select uuid from mdexpertreview er where er.id=$uid union select uuid from mdreview r where r.userid=$uid) order by s.ts_created desc,m.title limit ? offset ?"; + $this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset)); + $this->view->page=new Pagination($sum,$page,$this->limit); + foreach($this->view->metadata as $k=>$v) + { + $this->view->metadata[$k]['statustext']=$this->rewritestatus($v['status']); + } }//我参审的 function draftAction(){ - - $keyword = $this->_request->getParam('q'); - $search = $this->_request->getParam('search'); - - try{ - - $wheresql = array(); - $wheresql[]=" ms.status=0 "; - - if(!empty($keyword) && !empty($search)) - { - if (preg_match("/[<|>|#|$|%|^|*|(|)|{|}|'|\"|;|:]/i",$keyword) || !is_numeric($search)) - { - $this->messenger->addMessage('您的输入的搜索条件包含非法请求,请不要输入特殊符号'); - $this->_redirect('/review/draft'); - }//非法请求过滤 - $this->view->keyword = $keyword; - $wheresql[] = " md.title like '%$keyword%' "; - } - - $wheresql = join(' and ',$wheresql); - - $sql = "select ms.uuid,ms.status,ms.ts_created,md.title,md.author from mdstatus ms - left join metadata md on md.uuid=ms.uuid - where $wheresql"; - - $rs = $this->db->query($sql); - $rows = $rs->fetchAll(); - - $paginator = Zend_Paginator::factory($rows); - $paginator->setCurrentPageNumber($this->_getParam('page')); - $paginator->setItemCountPerPage($this->view->config->page->max); - $paginator->setView($this->view); - Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); - $this->view->paginator=$paginator; - - }catch(Exception $e){ - $this->messenger->addMessage('查询失败,请稍后重试 :('); - $this->_redirect('/review/draft'); - } - + $page=@(int)$this->_request->getParam('page'); + if (empty($page)) $page=1; + $offset=$this->limit*($page-1); + $row=$this->db->fetchAll("select count(s.*) from mdstatus s left join metadata m on s.uuid=m.uuid where s.status in (0)"); + $sum=$row[0]['count']; + $sql="select m.uuid,m.title,m.id,m.description,s.status,s.ts_created,g.id as gid,t.filename from mdstatus s left join metadata m on s.uuid=m.uuid left join geonetworkmetadata g on g.uuid=m.uuid left join thumbnail t on t.id=m.id where s.status in (0) order by s.ts_created desc,m.title limit ? offset ?"; + $this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset)); + $this->view->page=new Pagination($sum,$page,$this->limit); }//最新收稿 function acceptAction(){ - - $keyword = $this->_request->getParam('q'); - $search = $this->_request->getParam('search'); - - try{ - - $wheresql = array(); - $wheresql[]=" ms.status=1 "; - - if(!empty($keyword) && !empty($search)) - { - if (preg_match("/[<|>|#|$|%|^|*|(|)|{|}|'|\"|;|:]/i",$keyword) || !is_numeric($search)) - { - $this->messenger->addMessage('您的输入的搜索条件包含非法请求,请不要输入特殊符号'); - $this->_redirect('/review/draft'); - }//非法请求过滤 - $this->view->keyword = $keyword; - $wheresql[] = " md.title like '%$keyword%' "; - } - - $wheresql = join(' and ',$wheresql); - - $sql = "select ms.uuid,ms.status,ms.ts_created,md.title,md.author from mdstatus ms - left join metadata md on md.uuid=ms.uuid - where $wheresql"; - - $rs = $this->db->query($sql); - $rows = $rs->fetchAll(); - - $paginator = Zend_Paginator::factory($rows); - $paginator->setCurrentPageNumber($this->_getParam('page')); - $paginator->setItemCountPerPage($this->view->config->page->max); - $paginator->setView($this->view); - Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); - $this->view->paginator=$paginator; - - }catch(Exception $e){ - $this->messenger->addMessage('查询失败,请稍后重试 :('); - $this->_redirect('/review/draft'); - } - + $page=@(int)$this->_request->getParam('page'); + if (empty($page)) $page=1; + $offset=$this->limit*($page-1); + $row=$this->db->fetchAll("select count(s.*) from mdstatus s left join normalmetadata m on s.uuid=m.uuid where s.status in (1)"); + $sum=$row[0]['count']; + $sql="select m.uuid,m.title,m.id,m.description,s.status,s.ts_accepted,g.id as gid,t.filename from mdstatus s left join normalmetadata m on s.uuid=m.uuid left join geonetworkmetadata g on g.uuid=m.uuid left join thumbnail t on t.id=m.id where s.status in (1) order by s.ts_created desc,m.title limit ? offset ?"; + $this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset)); + $this->view->page=new Pagination($sum,$page,$this->limit); }//最新收稿 function inreviewAction(){ - - $keyword = $this->_request->getParam('q'); - $search = $this->_request->getParam('search'); - - try{ - - $wheresql = array(); - $wheresql[]=" ms.status in (2,3,4) "; - - if(!empty($keyword) && !empty($search)) - { - if (preg_match("/[<|>|#|$|%|^|*|(|)|{|}|'|\"|;|:]/i",$keyword) || !is_numeric($search)) - { - $this->messenger->addMessage('您的输入的搜索条件包含非法请求,请不要输入特殊符号'); - $this->_redirect('/review/inreview'); - }//非法请求过滤 - $this->view->keyword = $keyword; - $wheresql[] = " md.title like '%$keyword%' "; - } - - $wheresql = join(' and ',$wheresql); - - $sql = "select ms.uuid,ms.status,ms.ts_created,md.title,md.author from mdstatus ms - left join metadata md on md.uuid=ms.uuid - where $wheresql"; - - $rs = $this->db->query($sql); - $rows = $rs->fetchAll(); - - foreach($rows as $k=>$v) - { - $rows[$k]['status']=$this->rewritestatus($v['status']); - } - - $paginator = Zend_Paginator::factory($rows); - $paginator->setCurrentPageNumber($this->_getParam('page')); - $paginator->setItemCountPerPage($this->view->config->page->max); - $paginator->setView($this->view); - Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); - $this->view->paginator=$paginator; - - }catch(Exception $e){ - $this->messenger->addMessage('查询失败,请稍后重试 :('); - $this->_redirect('/review/inreview'); - } - + $page=@(int)$this->_request->getParam('page'); + if (empty($page)) $page=1; + $offset=$this->limit*($page-1); + $row=$this->db->fetchAll("select count(s.*) from mdstatus s left join normalmetadata m on s.uuid=m.uuid where s.status in (2,3,4)"); + $sum=$row[0]['count']; + $sql="select m.uuid,m.title,m.id,m.description,s.status,s.ts_accepted,g.id as gid,t.filename from mdstatus s left join normalmetadata m on s.uuid=m.uuid left join geonetworkmetadata g on g.uuid=m.uuid left join thumbnail t on t.id=m.id where s.status in (2,3,4) order by s.ts_created desc,m.title limit ? offset ?"; + $this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset)); + $this->view->page=new Pagination($sum,$page,$this->limit); }//在审阶段的元数据 function reviewedAction(){ - - $keyword = $this->_request->getParam('q'); - $search = $this->_request->getParam('search'); - - try{ - - $wheresql = array(); - $wheresql[]=" ms.status=5 "; - - if(!empty($keyword) && !empty($search)) - { - if (preg_match("/[<|>|#|$|%|^|*|(|)|{|}|'|\"|;|:]/i",$keyword) || !is_numeric($search)) - { - $this->messenger->addMessage('您的输入的搜索条件包含非法请求,请不要输入特殊符号'); - $this->_redirect('/review/reviewed'); - }//非法请求过滤 - $this->view->keyword = $keyword; - $wheresql[] = " md.title like '%$keyword%' "; - } - - $wheresql = join(' and ',$wheresql); - - $sql = "select ms.uuid,ms.status,ms.ts_created,ts_finished,md.title,md.author from mdstatus ms - left join metadata md on md.uuid=ms.uuid - where $wheresql"; - - $rs = $this->db->query($sql); - $rows = $rs->fetchAll(); - - $paginator = Zend_Paginator::factory($rows); - $paginator->setCurrentPageNumber($this->_getParam('page')); - $paginator->setItemCountPerPage($this->view->config->page->max); - $paginator->setView($this->view); - Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); - $this->view->paginator=$paginator; - - }catch(Exception $e){ - $this->messenger->addMessage('查询失败,请稍后重试 :('); - $this->_redirect('/review/reviewed'); - } - + $page=@(int)$this->_request->getParam('page'); + if (empty($page)) $page=1; + $offset=$this->limit*($page-1); + $row=$this->db->fetchAll("select count(s.*) from mdstatus s left join normalmetadata m on s.uuid=m.uuid where s.status in (5)"); + $sum=$row[0]['count']; + $sql="select m.uuid,m.title,m.id,m.description,s.status,s.ts_finished,g.id as gid,t.filename from mdstatus s left join normalmetadata m on s.uuid=m.uuid left join geonetworkmetadata g on g.uuid=m.uuid left join thumbnail t on t.id=m.id where s.status in (5) order by s.ts_created desc,m.title limit ? offset ?"; + $this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset)); + $this->view->page=new Pagination($sum,$page,$this->limit); }//已完成评审的元数据 diff --git a/application/default/views/scripts/review/accept.phtml b/application/default/views/scripts/review/accept.phtml index 081cf0f2..6b4a0af4 100644 --- a/application/default/views/scripts/review/accept.phtml +++ b/application/default/views/scripts/review/accept.phtml @@ -1,57 +1,47 @@ headTitle($config->title->site); -$this->headTitle($config->title->mdreview); -$this->headTitle()->setSeparator(' - '); -$this->headLink()->appendStylesheet('/css/mdreview.css'); -$this->breadcrumb('首页'); -$this->breadcrumb('元数据评审'); -$this->breadcrumb()->setSeparator(' > '); +$this->headTitle($this->config->title->site); +$this->headTitle($this->config->title->review); +$this->headTitle('接收元数据'); +$this->headTitle()->setSeparator(' - '); +$this->headLink()->appendStylesheet('/css/mdreview.css'); +$this->breadcrumb('首页'); +$this->breadcrumb(''.$this->config->title->review.''); +$this->breadcrumb('接收元数据'); +$this->breadcrumb()->setSeparator(' > '); +$this->headScript()->appendFile('/js/pubfunc.js'); ?> -
- -msg or $this->messages) :?> -
-msg) : ?> - msg; ?> -messages): foreach($this->messages as $msg): ?> - - - -
- - -

最新收稿的元数据:

- -
- - -
- - - - - - - - - - paginator)): - $autoindex=0; - foreach ($this->paginator as $item): - $autoindex++;?> - - - - - - -
元数据标题操作
- 评审 查看 -
- - -
\ No newline at end of file + +metadata)) : ?> +
+page->getNavigation(); ?> +
+metadata as $md) : + $thumburl='/gndata/'.sprintf('%05d',floor(($md['gid']+0.1)/100)*100).'-'.sprintf('%05d',ceil(($md['gid']+0.1)/100)*100-1)."/".$md['gid']; + $thumburl.='/public/'.str_replace('_s.','.',$md['filename']); +?> +
+
+ escape($md['title']); ?> 【接收时间:】 + + 查看评审页 + +
+ + <?php echo $this->escape($md['title']);?> + +
+ +
+
+page->getNavigation(); +else : +?> +
+

当前没有对应元数据。

+
+ \ No newline at end of file diff --git a/application/default/views/scripts/review/draft.phtml b/application/default/views/scripts/review/draft.phtml index f5b12c29..79f2b40d 100644 --- a/application/default/views/scripts/review/draft.phtml +++ b/application/default/views/scripts/review/draft.phtml @@ -1,57 +1,44 @@ headTitle($config->title->site); -$this->headTitle($config->title->mdreview); -$this->headTitle()->setSeparator(' - '); -$this->headLink()->appendStylesheet('/css/mdreview.css'); -$this->breadcrumb('首页'); -$this->breadcrumb('元数据评审'); -$this->breadcrumb()->setSeparator(' > '); +$this->headTitle($this->config->title->site); +$this->headTitle($this->config->title->review); +$this->headTitle('投稿元数据'); +$this->headTitle()->setSeparator(' - '); +$this->headLink()->appendStylesheet('/css/mdreview.css'); +$this->breadcrumb('首页'); +$this->breadcrumb(''.$this->config->title->review.''); +$this->breadcrumb('投稿元数据'); +$this->breadcrumb()->setSeparator(' > '); +$this->headScript()->appendFile('/js/pubfunc.js'); ?> -
- -msg or $this->messages) :?> -
-msg) : ?> - msg; ?> -messages): foreach($this->messages as $msg): ?> - - - -
- - -

最新收稿的元数据:

- -
- - -
- - - - - - - - - - paginator)): - $autoindex=0; - foreach ($this->paginator as $item): - $autoindex++;?> - - - - - - -
元数据标题收稿时间
- -
- - -
\ No newline at end of file + +metadata)) : ?> +
+page->getNavigation(); ?> +
+metadata as $md) : + $thumburl='/gndata/'.sprintf('%05d',floor(($md['gid']+0.1)/100)*100).'-'.sprintf('%05d',ceil(($md['gid']+0.1)/100)*100-1)."/".$md['gid']; + $thumburl.='/public/'.str_replace('_s.','.',$md['filename']); +?> +
+
+ escape($md['title']); ?>【投稿时间:】 +
+ + <?php echo $this->escape($md['title']);?> + +
+ +
+
+page->getNavigation(); +else : +?> +
+

当前没有对应元数据。

+
+ \ No newline at end of file diff --git a/application/default/views/scripts/review/inreview.phtml b/application/default/views/scripts/review/inreview.phtml index f1fb42ed..1e04e283 100644 --- a/application/default/views/scripts/review/inreview.phtml +++ b/application/default/views/scripts/review/inreview.phtml @@ -1,59 +1,47 @@ headTitle($config->title->site); -$this->headTitle($config->title->mdreview); -$this->headTitle()->setSeparator(' - '); -$this->headLink()->appendStylesheet('/css/mdreview.css'); -$this->breadcrumb('首页'); -$this->breadcrumb('元数据评审'); -$this->breadcrumb()->setSeparator(' > '); +$this->headTitle($this->config->title->site); +$this->headTitle($this->config->title->review); +$this->headTitle('在审元数据'); +$this->headTitle()->setSeparator(' - '); +$this->headLink()->appendStylesheet('/css/mdreview.css'); +$this->breadcrumb('首页'); +$this->breadcrumb(''.$this->config->title->review.''); +$this->breadcrumb('在审元数据'); +$this->breadcrumb()->setSeparator(' > '); +$this->headScript()->appendFile('/js/pubfunc.js'); ?> -
- -msg or $this->messages) :?> -
-msg) : ?> - msg; ?> -messages): foreach($this->messages as $msg): ?> - - - -
- - -

目前在审的元数据:

- -
- - -
- - - - - - - - - - - paginator)): - foreach ($this->paginator as $item): - ?> - - - - - - - -
元数据标题收稿时间状态
- - - -
- -
\ No newline at end of file + +metadata)) : ?> +
+page->getNavigation(); ?> +
+metadata as $md) : + $thumburl='/gndata/'.sprintf('%05d',floor(($md['gid']+0.1)/100)*100).'-'.sprintf('%05d',ceil(($md['gid']+0.1)/100)*100-1)."/".$md['gid']; + $thumburl.='/public/'.str_replace('_s.','.',$md['filename']); +?> +
+
+ escape($md['title']); ?> 【接收时间:】 + + 查看评审页 + +
+ + <?php echo $this->escape($md['title']);?> + +
+ +
+
+page->getNavigation(); +else : +?> +
+

当前没有对应元数据。

+
+ \ No newline at end of file diff --git a/application/default/views/scripts/review/myreview.phtml b/application/default/views/scripts/review/myreview.phtml index e6da9caa..15dbb70d 100644 --- a/application/default/views/scripts/review/myreview.phtml +++ b/application/default/views/scripts/review/myreview.phtml @@ -1,61 +1,50 @@ -headTitle($this->config->title->site); -$this->headTitle($this->config->title->mdreview); -$this->headTitle()->setSeparator(' - '); -$this->headLink()->appendStylesheet('/css/mdreview.css'); -$this->headScript()->appendFile('/js/jquery-1.6.4.min.js'); -$this->headScript()->appendFile('/js/jquery.masonry.min.js'); -$this->breadcrumb('首页'); -$this->breadcrumb('元数据评审'); -$this->breadcrumb('我参审的元数据'); -$this->breadcrumb()->setSeparator(' > '); -?> -
- -msg or $this->messages) :?> -
-msg) : ?> - msg; ?> -messages): foreach($this->messages as $msg): ?> - - - -
- - -

我参审的元数据:

- -
- - -
- -
- paginator)): ?> - - -
- - -
- \ No newline at end of file +headTitle($this->config->title->site); +$this->headTitle($this->config->title->review); +$this->headTitle('我参审的元数据'); +$this->headTitle()->setSeparator(' - '); +$this->headLink()->appendStylesheet('/css/mdreview.css'); +$this->breadcrumb('首页'); +$this->breadcrumb(''.$this->config->title->review.''); +$this->breadcrumb('我参审的元数据'); +$this->breadcrumb()->setSeparator(' > '); +$this->headScript()->appendFile('/js/pubfunc.js'); +?> + +metadata)) : ?> +
+page->getNavigation(); ?> +
+metadata as $md) : + $thumburl='/gndata/'.sprintf('%05d',floor(($md['gid']+0.1)/100)*100).'-'.sprintf('%05d',ceil(($md['gid']+0.1)/100)*100-1)."/".$md['gid']; + $thumburl.='/public/'.str_replace('_s.','.',$md['filename']); +?> +
+
+ escape($md['title']); ?> 【状态:】 + + 查看评审页 + + 【接收时间: + 审结时间:】 + +
+ + <?php echo $this->escape($md['title']);?> + +
+ +
+
+page->getNavigation(); +else : +?> +
+

当前没有对应元数据。

+
+ \ No newline at end of file diff --git a/application/default/views/scripts/review/reviewed.phtml b/application/default/views/scripts/review/reviewed.phtml index 142690f3..afcd2e39 100644 --- a/application/default/views/scripts/review/reviewed.phtml +++ b/application/default/views/scripts/review/reviewed.phtml @@ -1,58 +1,47 @@ headTitle($this->config->title->site); -$this->headTitle($this->config->title->review); -$this->headTitle()->setSeparator(' - '); -$this->headLink()->appendStylesheet('/css/mdreview.css'); -$this->breadcrumb('首页'); -$this->breadcrumb('元数据评审'); -$this->breadcrumb()->setSeparator(' > '); +$this->headTitle($this->config->title->site); +$this->headTitle($this->config->title->review); +$this->headTitle('审结元数据'); +$this->headTitle()->setSeparator(' - '); +$this->headLink()->appendStylesheet('/css/mdreview.css'); +$this->breadcrumb('首页'); +$this->breadcrumb(''.$this->config->title->review.''); +$this->breadcrumb('审结元数据'); +$this->breadcrumb()->setSeparator(' > '); +$this->headScript()->appendFile('/js/pubfunc.js'); ?> -
- -msg or $this->messages) :?> -
-msg) : ?> - msg; ?> -messages): foreach($this->messages as $msg): ?> - - - -
- - -

已经通过审核的元数据:

- -
- - -
- - - - - - - - - - - paginator)): - $autoindex=0; - foreach ($this->paginator as $item): - $autoindex++;?> - - - - - - - -
元数据标题评审结束时间操作
- - 查看评审页
- - -
\ No newline at end of file + +metadata)) : ?> +
+page->getNavigation(); ?> +
+metadata as $md) : + $thumburl='/gndata/'.sprintf('%05d',floor(($md['gid']+0.1)/100)*100).'-'.sprintf('%05d',ceil(($md['gid']+0.1)/100)*100-1)."/".$md['gid']; + $thumburl.='/public/'.str_replace('_s.','.',$md['filename']); +?> +
+
+ escape($md['title']); ?> 【接收时间:】 + + 查看评审页 + +
+ + <?php echo $this->escape($md['title']);?> + +
+ +
+
+page->getNavigation(); +else : +?> +
+

当前没有对应元数据。

+
+ \ No newline at end of file