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'); ?> -
元数据标题 | -操作 | -
---|---|
- | - 评审 查看 - | -
当前没有对应元数据。
+元数据标题 | -收稿时间 | -
---|---|
- | - - | -
当前没有对应元数据。
+元数据标题 | -收稿时间 | -状态 | -
---|---|---|
- | - - | -- - | -
当前没有对应元数据。
+当前没有对应元数据。
+元数据标题 | -评审结束时间 | -操作 | -
---|---|---|
- | - - | -查看评审页 | -
当前没有对应元数据。
+