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