From eac73402f9c6f97d941a1350363e17eed4d7c750 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Wed, 19 Oct 2011 04:03:13 +0000 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8review=E4=B8=AD=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=BA=86=E6=9F=A5=E7=9C=8B=E8=AF=84=E5=AE=A1=E6=84=8F=E8=A7=81?= =?UTF-8?q?=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/ReviewController.php | 139 ++++++++++++++++-- .../admin/views/scripts/review/comments.phtml | 58 ++++++++ .../views/scripts/review/commentslist.phtml | 58 ++++++++ .../views/scripts/review/commentsview.phtml | 55 +++++++ 4 files changed, 300 insertions(+), 10 deletions(-) create mode 100644 application/admin/views/scripts/review/comments.phtml create mode 100644 application/admin/views/scripts/review/commentslist.phtml create mode 100644 application/admin/views/scripts/review/commentsview.phtml diff --git a/application/admin/controllers/ReviewController.php b/application/admin/controllers/ReviewController.php index d27fae95..3304881d 100644 --- a/application/admin/controllers/ReviewController.php +++ b/application/admin/controllers/ReviewController.php @@ -259,8 +259,8 @@ class Admin_ReviewController extends Zend_Controller_Action function inviteAction(){//邀请 - $id = $this->_request->getParam('id'); - $user = $this->_request->getParam('user'); + $id = $this->_request->getParam('id'); + $user = $this->_request->getParam('user'); if(empty($id)) { $this->_redirect("/admin/review"); @@ -344,12 +344,12 @@ class Admin_ReviewController extends Zend_Controller_Action $this->messenger->addMessage('请选择要邀请的专家'); $this->_redirect("/admin/review/invite/?id=$id"); } - } elseif ($user>0) { - $uuid=$this->_request->getParam('uuid'); - $sql="update mdexpertreview set ts_modified=now() where id='$user' and uuid='$uuid'"; - $this->db->exec($sql); - $sql="select realname,email,(select title from metadata where uuid='$uuid') as title from users where id='$user'"; - $row=$this->db->fetchRow($sql); + } elseif ($user>0) { + $uuid=$this->_request->getParam('uuid'); + $sql="update mdexpertreview set ts_modified=now() where id='$user' and uuid='$uuid'"; + $this->db->exec($sql); + $sql="select realname,email,(select title from metadata where uuid='$uuid') as title from users where id='$user'"; + $row=$this->db->fetchRow($sql); //实例化EmailText $mailtp=new EmailText($this->db,'invite-expert-review',array('user'=>$row['realname'],'uuid'=>$uuid,'title'=>$row['title'])); $mail=new WestdcMailer($this->view->config->smtp); @@ -365,7 +365,7 @@ class Admin_ReviewController extends Zend_Controller_Action }else { $this->messenger->addMessage('邀请专家'.$row['realname'].'的邮件发送失败,请尝试手动发送邀请邮件'); - } + } } $searchjoin = ""; if(!empty($search) && !empty($keyword)) @@ -801,6 +801,125 @@ class Admin_ReviewController extends Zend_Controller_Action }//列表 - }//expertsAction 专家库 + }//expertsAction 专家库 + + function commentsAction(){ + + $ac = $this->_request->getParam('ac'); + $uuid = $this->_request->getParam('uuid'); + $id = $this->_request->getParam('id'); + $q = $this->_request->getParam('q'); + $search = $this->_request->getParam('search'); + + if($ac=='view' && !empty($uuid)) + { + $redirect = "/admin/review/comments"; + + + $this->_helper->viewRenderer(''); + + }//查看单个元数据的评审 + + else if($ac=='list') + { + try{ + + $redirect = "/admin/review/comments/ac/list/"; + + $wheresql = array(); + + if(!empty($uuid)) + { + $redirect.="/uuid/$uuid"; + $wheresql[] = " md.uuid='$uuid' "; + } + + if(!empty($q) && !empty($search)) + { + if (preg_match("/[<|>|#|$|%|^|*|(|)|{|}|'|\"|;|:]/i",$q) || !is_numeric($search)) + { + $this->messenger->addMessage('您的输入的搜索条件包含非法请求,请不要输入特殊符号'); + $this->_redirect($redirect); + } + $this->view->q = $q; + $wheresql[] = " (md.title like '%$q%' or u.realname like '%$q%') "; + } + + if(count($wheresql>0))$wheresql = join(' and ',$wheresql); + else $wheresql=''; + + if($wheresql!='') + { + $wheresql = 'where '.$wheresql; + } + + $sql = "select md.title,md.uuid,u.realname,r.id,r.ts_created,r.is_expert from mdreview r + left join metadata md on md.uuid=r.uuid + left join users u on u.id=r.userid + $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.phtml'); + $this->view->paginator=$paginator; + }catch(Exception $e){ + echo $e->getMessage().'
'; + } + + $this->_helper->viewRenderer('commentslist'); + }//评审意见列表 or 某条元数据的评审意见列表 + + else + { + try{ + $redirect = "/admin/review/comments"; + + $wheresql = array(); + + if(!empty($q) && !empty($search)) + { + if (preg_match("/[<|>|#|$|%|^|*|(|)|{|}|'|\"|;|:]/i",$q) || !is_numeric($search)) + { + $this->messenger->addMessage('您的输入的搜索条件包含非法请求,请不要输入特殊符号'); + $this->_redirect($redirect); + }//非法请求过滤 + $this->view->q = $q; + $wheresql[] = " md.title like '%$q%' "; + } + + if(count($wheresql>0))$wheresql = join(' and ',$wheresql); + else $wheresql=''; + + if($wheresql!='') + { + $wheresql = 'where '.$wheresql; + } + + $sql = "select md.title,md.uuid,count(r.id) as c from mdreview r + left join metadata md on md.uuid=r.uuid + $wheresql + GROUP BY md.title,md.uuid + "; + $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.phtml'); + $this->view->paginator=$paginator; + }catch(Exception $e){ + echo $e->getMessage().'
'; + } + }//列表 + + + }//commentsAction 查看所有评审意见 } diff --git a/application/admin/views/scripts/review/comments.phtml b/application/admin/views/scripts/review/comments.phtml new file mode 100644 index 00000000..faab33fe --- /dev/null +++ b/application/admin/views/scripts/review/comments.phtml @@ -0,0 +1,58 @@ +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()->setSeparator(' > '); +?> +
+partial('review/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/review/commentslist.phtml b/application/admin/views/scripts/review/commentslist.phtml new file mode 100644 index 00000000..cb8e0b61 --- /dev/null +++ b/application/admin/views/scripts/review/commentslist.phtml @@ -0,0 +1,58 @@ +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()->setSeparator(' > '); +?> +
+partial('review/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/review/commentsview.phtml b/application/admin/views/scripts/review/commentsview.phtml new file mode 100644 index 00000000..47ef83ad --- /dev/null +++ b/application/admin/views/scripts/review/commentsview.phtml @@ -0,0 +1,55 @@ +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()->setSeparator(' > '); +?> +
+partial('review/left.phtml'); ?> +
+
+msg or $this->messages) :?> +
+msg) : ?> +

msg; ?>

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

+ +
+ + + + + + + + + + + paginator)): ?> + + paginator as $item): ?> + + + + + + + + +
标题评审条数操作
查看评审
+ +
+ \ No newline at end of file