From 62143e2438bf83a97f61e04c30c1860836629057 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Wed, 13 Jun 2012 10:12:30 +0000 Subject: [PATCH] =?UTF-8?q?=E5=85=83=E6=95=B0=E6=8D=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=B8=AD=E5=A2=9E=E5=8A=A0=E4=BA=86=E5=AD=98=E6=A1=A3=E7=9A=84?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E5=92=8C=E4=BF=AE=E6=94=B9=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E4=BA=86=E5=85=83=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=88=97=E8=A1=A8=E7=9A=84=E8=B0=83=E7=94=A8?= =?UTF-8?q?sql=E5=92=8C=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/DataController.php | 88 +++++++++++++++++-- .../admin/views/scripts/data/md-dataset.phtml | 69 +++++++++++++++ application/admin/views/scripts/data/md.phtml | 54 ++++++++---- htdocs/css/admin.css | 11 +++ 4 files changed, 194 insertions(+), 28 deletions(-) create mode 100644 application/admin/views/scripts/data/md-dataset.phtml diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index 4650b9fd..7eb9f6de 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -7,7 +7,7 @@ class Admin_DataController extends Zend_Controller_Action $this->view->config = Zend_Registry::get('config'); $this->messenger=$this->_helper->getHelper('FlashMessenger'); $this->view->messages = $this->messenger->getMessages(); - $this->debug = 0; //1:debug, 0:release + $this->debug = 0; //1:debug, 0:release $this->debug_email='wangliangxu@lzb.ac.cn'; } function postDispatch() @@ -249,6 +249,13 @@ class Admin_DataController extends Zend_Controller_Action Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml'); $this->view->paginator=$paginator; } + + /* + * + * mdAction() + * 元数据管理 + * + */ function mdAction() { $delete=(int)$this->_getParam('delete'); @@ -444,13 +451,18 @@ class Admin_DataController extends Zend_Controller_Action }//search else{ - $select=$this->db->select(); - $select->from('metadata') - ->joinLeft('mdstat','metadata.uuid=mdstat.uuid','viewed') - ->joinLeft('geonetworkmetadata','geonetworkmetadata.uuid=metadata.uuid','id as gid') - ->joinLeft('mdstatus','metadata.uuid=mdstatus.uuid','status as mdstatus') - ->order('metadata.id desc'); - $paginator = Zend_Paginator::factory($select); + + $sql = "SELECT md.*,s.viewed,g.id as gid,st.status as mdstatus,ds.id as datasetid FROM metadata md + LEFT JOIN mdstat s ON md.uuid=s.uuid + LEFT JOIN geonetworkmetadata g ON g.uuid=md.uuid + LEFT JOIN mdstatus st ON md.uuid=st.uuid + LEFT JOIN dataset ds ON md.uuid=ds.uuid + ORDER BY md.id DESC"; + $sth = $this->db->prepare($sql); + $sth->execute(); + $rows = $sth->fetchAll(); + + $paginator = Zend_Paginator::factory($rows); $paginator->setCurrentPageNumber($this->_getParam('page')); $paginator->setItemCountPerPage($this->view->config->page->max); $paginator->setView($this->view); @@ -458,7 +470,65 @@ class Admin_DataController extends Zend_Controller_Action $this->view->paginator=$paginator; } - } + }//mdAction 元数据管理 + + /* + * datasetAction() + * 数据存档 + * + */ + function datasetAction() + { + + $ac = $this->_request->getParam('ac'); + + if($ac == "getdataset") + { + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer('md-dataset'); + + $uuid = $this->_request->getParam('uuid'); + $sql = "SELECT * FROM dataset WHERE uuid=?"; + $sth = $this->db->prepare($sql); + $sth ->execute(array($uuid)); + $row = $sth->fetch(); + + $this->view->dataset = $row; + } + + if($ac == "update") + { + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + $uuid = $this->_request->getParam('uuid'); + $host = $this->_getParam('host'); + $path = $this->_getParam('path'); + + $sql = "UPDATE dataset SET host=?,path=? WHERE uuid=?"; + $sth = $this->db->prepare($sql); + $ds = $sth ->execute(array($host,$path,$uuid)); + + if($ds) + { + $data = array("ok"=>1); + $this->jsonexit($data); + return true; + }else{ + $data = array("error"=>"处理中出现错误"); + $this->jsonexit($data); + return true; + } + + + } + + }//datasetAction存档管理 + + /* + * commentAction() + * 反馈管理 + */ function commentAction() { $delete=(int)$this->_getParam('delete'); diff --git a/application/admin/views/scripts/data/md-dataset.phtml b/application/admin/views/scripts/data/md-dataset.phtml new file mode 100644 index 00000000..29db0d10 --- /dev/null +++ b/application/admin/views/scripts/data/md-dataset.phtml @@ -0,0 +1,69 @@ + + + + +数据存档 + + + + + + + + + + + +
+
+
+ dataset)) + {?> +

主机:

+

路径:

+

+ +
+
+ + + + + \ No newline at end of file diff --git a/application/admin/views/scripts/data/md.phtml b/application/admin/views/scripts/data/md.phtml index c8b06a4a..1d54c7dc 100644 --- a/application/admin/views/scripts/data/md.phtml +++ b/application/admin/views/scripts/data/md.phtml @@ -8,6 +8,9 @@ $this->breadcrumb('数据管理'); $this->breadcrumb('元数据管理'); $this->breadcrumb()->setSeparator(' > '); + $this->headScript()->appendFile('/js/jquery-1.7.min.js'); + $this->headScript()->appendFile('/js/jquery.colorbox-min.js'); + $this->headLink()->appendStylesheet('/css/colorbox.css'); ?>
partial('data/left.phtml'); ?> @@ -37,30 +40,43 @@ 下载全部xml元数据 paginator)): ?> -
+
+
paginator; ?> -
\ No newline at end of file +
+ \ No newline at end of file diff --git a/htdocs/css/admin.css b/htdocs/css/admin.css index 1d3e7cbf..e8dea715 100644 --- a/htdocs/css/admin.css +++ b/htdocs/css/admin.css @@ -373,3 +373,14 @@ fieldset small { } .tables{width:320px;float:left;} .tables .stitle{width:100%;font-size:16px;font-weight:bold;} + +.datalist{overflow:hidden;width:100%;} +.datalist ul{overflow:hidden;} +.datalist ul li{margin:5px 0px;padding:5px 0px;background:#f6f6f6;border:1px solid #FFF;border-radius:3px;word-break:break-all;width:99%;} +.datalist ul li:hover,#datalist ul li:focus{border:1px solid #ccc;background:#fefefe;} +.datalist ul li a{font-size:12px;} +.datalist ul li a.title{font-size:14px;} +.datalist ul li a.more{font-size:12px;} +.datalist ul li p{font-size:12px;line-height:24px;word-break:break-all;white-space:normal;padding:5px;} +.datalist ul li p.content{text-indent:24px;} +.datalist ul li p img {vertical-align:middle;}