From e97afc2e401881ca423985bcedebad5b08c6d028 Mon Sep 17 00:00:00 2001 From: wlx Date: Mon, 16 Feb 2015 02:13:26 +0000 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E6=B7=BB=E5=8A=A0=E5=B7=B2?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E6=95=B0=E6=8D=AE=E7=9A=84=E6=9C=AA=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E7=89=88=E6=9C=AC=E6=B5=8F=E8=A7=88=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/DataController.php | 35 ++++++ .../views/scripts/data/version-bydata.phtml | 7 +- .../scripts/data/version-unpublish.phtml | 115 ++++++++++++++++++ .../admin/views/scripts/data/version.phtml | 1 + 4 files changed, 156 insertions(+), 2 deletions(-) create mode 100644 application/admin/views/scripts/data/version-unpublish.phtml diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index fc26e9bf..78641121 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -2459,6 +2459,41 @@ group by m.uuid,m.title,m.description) md ON md.uuid=v.uuid } + + //未发布版本浏览 + else if($ac=="unpublish") + { + $keywords = $this->_request->getParam('q'); + if(!empty($keywords)) + $this->view->q = $keywords; + $sql = "SELECT md.title,md.uuid,v.ts_created,v.changelog,gm.owner,v.id,u.username,u.realname FROM mdversion v + LEFT JOIN metadata md ON md.uuid=v.uuid + left join geonetworkmetadata gm on md.uuid=gm.uuid + left join users u on gm.owner=u.id + left join mdstatus st on md.uuid=st.uuid + WHERE md.title IS NOT NULL and v.changelog is null and st.status>4 "; + if(!empty($keywords)) + { + $search=new Search($keywords); + $where=$search->sql_expr(array("md.title","md.description")); + $sql.=' and '.$where; + } + $sql.=" order by v.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('version-unpublish'); + } + //删除某个版本 else if($ac=="delete") { diff --git a/application/admin/views/scripts/data/version-bydata.phtml b/application/admin/views/scripts/data/version-bydata.phtml index 79923b6f..9c17e343 100644 --- a/application/admin/views/scripts/data/version-bydata.phtml +++ b/application/admin/views/scripts/data/version-bydata.phtml @@ -19,8 +19,11 @@
diff --git a/application/admin/views/scripts/data/version-unpublish.phtml b/application/admin/views/scripts/data/version-unpublish.phtml new file mode 100644 index 00000000..ba6ae2d9 --- /dev/null +++ b/application/admin/views/scripts/data/version-unpublish.phtml @@ -0,0 +1,115 @@ +headTitle($this->config->title->site); + $this->headTitle($this->config->title->author); + $this->headTitle()->setSeparator(' - '); + $this->headScript()->appendFile('/js/jquery-1.7.min.js'); + $this->headLink()->appendStylesheet('/css/admin.css'); + $this->headScript()->appendFile('/js/lib/colorbox/jquery.colorbox-min.js'); + $this->headLink()->appendStylesheet('/css/author.css'); + $this->headLink()->appendStylesheet('/js/lib/colorbox/colorbox.css'); + $this->breadcrumb('首页'); + $this->breadcrumb('数据管理'); + $this->breadcrumb('数据版本管理'); + $this->breadcrumb()->setSeparator(' > '); +?> +
+ + + + +
+ + paginator)): + if ($this->mdtitle) echo "

元数据:".$this->mdtitle."

"; + echo "
+
+ + +
diff --git a/application/admin/views/scripts/data/version.phtml b/application/admin/views/scripts/data/version.phtml index 153e694f..5388f1e6 100644 --- a/application/admin/views/scripts/data/version.phtml +++ b/application/admin/views/scripts/data/version.phtml @@ -23,6 +23,7 @@