From dc0b83af5cd53d1c6a94b3d3ce8f8a68eb40f979 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Mon, 11 Jun 2012 07:56:02 +0000 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E6=89=80=E6=9C=89=E6=95=B0=E6=8D=AE=E4=BD=9C=E8=80=85=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 | 59 +++++++++++- .../views/scripts/data/author-list.phtml | 95 +++++++++++++++++++ .../admin/views/scripts/data/author.phtml | 6 ++ 3 files changed, 157 insertions(+), 3 deletions(-) create mode 100644 application/admin/views/scripts/data/author-list.phtml diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index 88264dae..031df715 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -2181,14 +2181,24 @@ class Admin_DataController extends Zend_Controller_Action /* - authorAction() 数据作者 - */ + * authorAction() 数据作者 + * + * param string $ac //动作 + =add 添加 + =edit 编辑 + =update 更新 + =del 删除 + =list 列出所有数据作者 + + * param string $uuid //UUID + * + * return view|application-json + */ public function authorAction(){ $ac = $this->_getParam('ac'); $uuid = $this->_getParam('uuid'); - if(empty($ac) && empty($uuid)) { @@ -2393,6 +2403,49 @@ class Admin_DataController extends Zend_Controller_Action }//认证作者 + else if($ac =="list") + { + $this->_helper->viewRenderer('author-list'); + + $sql = "SELECT u.id,u.realname,u.email,count(a.id) as d FROM mdauthor a + LEFT JOIN users u ON a.userid=u.id + WHERE a.status>0 + GROUP BY u.id,u.realname,u.email + ORDER BY u.id DESC"; + + $sth = $this->db->prepare($sql); + $sth->execute(); + $rows = $sth->fetchAll(); + + $paginator = Zend_Paginator::factory($rows); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(15); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); + $this->view->paginator=$paginator; + } + + else if($ac == "userdatas") + { + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + $id = $this->_getParam('id'); + + $sql = "SELECT md.title,md.uuid FROM mdauthor a + LEFT JOIN metadata md ON a.uuid=md.uuid + WHERE a.userid=? AND a.status>0 + ORDER BY a.ts_created"; + $sth = $this->db->prepare($sql); + $sth->execute(array($id)); + $rows = $sth->fetchAll(); + + $data = array("datas"=>$rows); + $this->jsonexit($data); + return true; + + } + }//authorAction() 数据作者管理 diff --git a/application/admin/views/scripts/data/author-list.phtml b/application/admin/views/scripts/data/author-list.phtml new file mode 100644 index 00000000..b1761e3a --- /dev/null +++ b/application/admin/views/scripts/data/author-list.phtml @@ -0,0 +1,95 @@ +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/jquery.colorbox-min.js'); +$this->headLink()->appendStylesheet('/css/author.css'); +$this->headLink()->appendStylesheet('/css/colorbox.css'); +$this->breadcrumb('首页'); +$this->breadcrumb('数据管理'); +$this->breadcrumb('数据作者管理'); +$this->breadcrumb()->setSeparator(' > '); +?> + +
+ partial('data/left.phtml'); ?> +
+ + + +
+ +
+

请输入元数据标题关键字进行搜索

+
+ + +
+
+
+ paginator)): + if ($this->mdtitle) echo "

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

"; + echo "
    "; + $autoindex=0; + foreach ($this->paginator as $item): + $autoindex++;?> +
  • +

    +

    + + 数据个数 : | 查看数据 | Email: + +

    +
  • + "; + endif; ?> + +
+
+ + diff --git a/application/admin/views/scripts/data/author.phtml b/application/admin/views/scripts/data/author.phtml index 9de8f1b0..12e163a9 100644 --- a/application/admin/views/scripts/data/author.phtml +++ b/application/admin/views/scripts/data/author.phtml @@ -20,6 +20,12 @@ $this->breadcrumb()->setSeparator(' > ');
+

请输入元数据标题关键字进行搜索