From 0b520fe71c44251d8a2c7e7c26c5a0f45af5d5ef Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Thu, 27 Oct 2011 08:42:31 +0000 Subject: [PATCH] =?UTF-8?q?#174=20=E5=A2=9E=E5=8A=A0=E4=BA=86=E6=8C=89?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=9D=A5=E6=BA=90=E6=9F=A5=E7=9C=8B=E5=85=83?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=88=97=E8=A1=A8=E7=9A=84=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E4=BA=86=E6=B8=85=E9=99=A4=E5=85=83?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=A1=B9=E7=9B=AE=E6=9D=A5=E6=BA=90=E7=9A=84?= =?UTF-8?q?=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 | 63 +++++++++++++++++++ .../admin/views/scripts/data/source.phtml | 6 +- .../views/scripts/data/sourcefetchone.phtml | 61 ++++++++++++++++++ .../views/scripts/data/sourceselect.phtml | 15 +++++ 4 files changed, 144 insertions(+), 1 deletion(-) create mode 100644 application/admin/views/scripts/data/sourcefetchone.phtml diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index 4742d3b7..f1cba491 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -976,6 +976,69 @@ class Admin_DataController extends Zend_Controller_Action } }// 删除项目来源 + else if($do == 'fetch' && !empty($id)) + { + + $wheresql = array(); + + $wheresql[] = " ds.sourceid='$id' "; + + if(!empty($q) && !empty($search)) + { + $this->view->q = $q; + $wheresql[] = " title like '%$q%' "; + } + + if(count($wheresql>0))$wheresql = join(' and ',$wheresql); + else $wheresql=''; + + if($wheresql!='') + { + $wheresql = 'where '.$wheresql; + } + + $sql = "select md.title,md.uuid,ds.id,ds.sourceid,s.title as stitle,s.code from metadata md + left join datasource ds on ds.uuid=md.uuid + left join source s on s.id=ds.sourceid + $wheresql + order by id desc"; + $rs = $this->db->query($sql); + $rows = $rs->fetchAll(); + + $paginator = Zend_Paginator::factory($rows); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(30); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); + $this->view->paginator=$paginator; + + $this->_helper->viewRenderer('sourcefetchone'); + + }//查看某项目来源中的所有元数据 + + else if($do == 'delsource' && !empty($id)) + { + $redirect = "/admin/data/source/do/datasource/uuid/$uuid"; + + $sql = "delete from datasource where id='$id'"; + + try{ + if($this->db->exec($sql)) + { + $this->messenger->addMessage('删除成功'); + $this->_redirect($redirect); + }else{ + $this->messenger->addMessage('删除失败,可能该数据已不存在'); + $this->_redirect($redirect); + } + }catch (Exception $e){ + $this->messenger->addMessage('删除失败:'.$e->getMessage()); + $this->_redirect($redirect); + } + + + }// 清除元数据来源记录 + else { $wheresql = array(); diff --git a/application/admin/views/scripts/data/source.phtml b/application/admin/views/scripts/data/source.phtml index 9789cd95..3b2bb1e7 100644 --- a/application/admin/views/scripts/data/source.phtml +++ b/application/admin/views/scripts/data/source.phtml @@ -52,7 +52,11 @@ - 查看编辑|删除 + + 查看编辑| + 查看元数据| + 删除 + diff --git a/application/admin/views/scripts/data/sourcefetchone.phtml b/application/admin/views/scripts/data/sourcefetchone.phtml new file mode 100644 index 00000000..31a88d9b --- /dev/null +++ b/application/admin/views/scripts/data/sourcefetchone.phtml @@ -0,0 +1,61 @@ +headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->headLink()->appendStylesheet('/css/admin.css'); + $this->headScript()->appendFile('/js/jquery-1.6.4.min.js'); + $this->breadcrumb('首页'); + $this->breadcrumb('后台首页'); + $this->breadcrumb('数据管理'); + $this->breadcrumb('项目来源管理'); + $this->breadcrumb()->setSeparator(' > '); +?> +
+partial('data/left.phtml'); ?> +
+
+msg or $this->messages) :?> +
+msg) : ?> +

msg; ?>

+messages): foreach($this->messages as $msg): ?> +

+ +
+ + + + + + + + + + + + + + paginator)): ?> + + paginator as $item): ?> + + + + + + + +
标题操作
清除数据来源
+ +
+ \ No newline at end of file diff --git a/application/admin/views/scripts/data/sourceselect.phtml b/application/admin/views/scripts/data/sourceselect.phtml index 09844ba0..eab90f68 100644 --- a/application/admin/views/scripts/data/sourceselect.phtml +++ b/application/admin/views/scripts/data/sourceselect.phtml @@ -71,6 +71,21 @@ ?> +info['id'])) + { + ?> +
+ + + + +
+
+ + \ No newline at end of file