diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index 7f6ac475..8b1eb4f2 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -2568,9 +2568,9 @@ class Admin_DataController extends Zend_Controller_Action if(!empty($keywords)) { - $search=new Search($keywords); + $search=new SimpleSearch($keywords); $where=$search->sql_expr(array("md.title")); - $sql.=' and '.$where; + $sql.=' and ('.$where.")"; } $sql .= "GROUP by md.id,md.title,md.uuid,md.ts_created @@ -2816,7 +2816,7 @@ class Admin_DataController extends Zend_Controller_Action if(!empty($keywords)) { - $search=new Search($keywords); + $search=new SimpleSearch($keywords); $where=$search->sql_expr(array("md.title")); $sql.=' WHERE '.$where; } diff --git a/application/admin/controllers/ReviewController.php b/application/admin/controllers/ReviewController.php index c79e2953..ac7642bb 100644 --- a/application/admin/controllers/ReviewController.php +++ b/application/admin/controllers/ReviewController.php @@ -5,13 +5,9 @@ class Admin_ReviewController extends Zend_Controller_Action { $this->db=Zend_Registry::get('db'); $this->view->config = Zend_Registry::get('config'); - $this->messenger=$this->_helper->getHelper('FlashMessenger'); - $this->view->messages = $this->messenger->getMessages(); - } - - function postDispatch() - { - //$this->view->messages = $this->messenger->getMessages(); + $this->view->theme = new Theme(); + $this->_helper->layout->setLayout('administry'); + $this->view->pageID = "review-".$this->_request->getActionName(); } /* @@ -148,7 +144,7 @@ class Admin_ReviewController extends Zend_Controller_Action if($cancel>0) { if($this->changestatus($cancel,-1)) - { + { //update search document $search=new Search(); //create search view in xunsearch @@ -283,7 +279,7 @@ class Admin_ReviewController extends Zend_Controller_Action } $sql = "select m.id,md.title,m.status,m.uuid,u.username,u.realname from mdstatus m - right join metadata md on md.uuid=m.uuid + right join metadata md on md.uuid=m.uuid left join users u on u.id=m.userid where m.status in (2,3,4) $searchjoin order by m.ts_accepted desc"; $rs = $this->db->query($sql); @@ -752,17 +748,17 @@ class Admin_ReviewController extends Zend_Controller_Action else $ids=$update; if($this->changestatus($ids,1)) - { + { //update search document $search=new Search(); //create search view in xunsearch $sql="select * from xunsearch where uuid in (select uuid from mdstatus where id in (".$ids."))"; $sth = $this->db->prepare($sql); - $sth->execute(); - while ($data = $sth->fetch()) + $sth->execute(); + while ($data = $sth->fetch()) { - $search->update($data); - } + $search->update($data); + } //仅对单条数据发送email信息,并且注册为数据作者 if (is_numeric($ids)) @@ -1497,74 +1493,86 @@ class Admin_ReviewController extends Zend_Controller_Action function replyAction(){ $uuid = $this->_getParam('uuid'); - $send = $this->_getParam('send'); + $submit = $this->_getParam('submit'); + + include_once("helper/view.php"); + include_once("data/Review.php"); + include_once("data/Metadata.php"); + include_once("data/Author.php"); if(empty($uuid)) { - $jump_url = $this->view->jump_url = 'javascript:history.go(-1);'; - $this->view->msg = "参数错误,如果页面没有跳转请点击这里"; + view::Post($this,array('content'=>'参数错误','url' => -1)); return true; } + $review = new Review($this->db); + $this->view->uuid = $uuid; - $sql = "SELECT mr.*,u.username,u.realname FROM mdreview mr - LEFT JOIN users u ON mr.userid = u.id - WHERE mr.uuid = '$uuid'"; - - $sth = $this->db->query($sql); - $reviews = $sth->fetchAll(); - + $reviews = $review->getReviews($uuid); $this->view->review = $reviews; - if(!empty($send)) + $metadata = new Metadata($this->db); + $this->view->md = $metadata->View($uuid); + + $body = "元数据《".$this->view->md['title']."》的作者,您好:\r\n + 以下是您的元数据《".$this->view->md['title']."》的反馈信息。\r\n"; + + $body .= "--------------------------------------\r\n"; + if(!empty($reviews)) + foreach($reviews as $k=>$v) { - $sql = "SELECT md.title,u.email FROM metadata md - LEFT JOIN mdauthor a ON md.uuid=a.uuid - WHERE md.uuid='$uuid'"; - $sth = $this->db->query($sql); - $rows = $sth->fetchAll(); + $body .= $v['username'].":".$v['mdcomment']."\r\n"; + } + else + $body .= "\r\n\r\n\r\n"; + $body .= "--------------------------------------"; + $body .= "\r\n 西部数据中心服务组"; - $emails = array(); - foreach($rows as $v); - { - if(!empty($v['email'])) - { - $emails[] = $v['email']; - } - } + $author = new Author($this->db); + $emails = $author->getAuthor($uuid,'email'); + + if(count($emails)<1) + { + $email = ""; + }else{ + $email = join(";",$emails); + } - if(count($emails)<1) - { - $jump_url = $this->view->jump_url = 'javascript:history.go(-1);'; - $this->view->msg = "该元数据未指派作者,如果页面没有跳转请点击这里"; - return true; - } + $data = array( + 'title'=>"您的元数据《".$this->view->md['title']."》有新的反馈", + 'content'=>$body, + 'email'=>$email - $title = $rows[0]['title']; - - $this->_helper->layout->disableLayout(); - $this->_helper->viewRenderer->setNoRender(); - - $body = "元数据《$title》的作者,您好:\r\n -您的元数据《$title》有反馈信息。\r\n"; - - foreach($reviews as $k=>$v) - { - $body .= $v['username'].":".$v['mdcomment']."\r\n"; - } - - $body .= "\r\n 西部数据中心服务组"; + ); + $this->view->data = $data; + + if(!empty($submit)) + { + $this->view->data['title'] = $title = $this->_getParam('title'); + $this->view->data['email'] = $email = $this->_getParam('email'); + $this->view->data['content'] = $cotent = $this->_getParam('content'); + $emails = explode(";",$email); + $mail=new WestdcMailer($this->view->config->smtp); - $mail->setBodyText($body); + $mail->setBodyText($cotent); $mail->setFrom($this->view->config->service->email,'西部数据中心服务组'); foreach($emails as $v) { $mail->addTo($v); } - $mail->setSubject("您的元数据《$title》有新的反馈"); - $mail->send(); + $mail->setSubject($title); + + if($mail->send()) + { + view::Post($this,array('content'=>'发送成功!','url'=>'/admin/review/reply/uuid/'.$uuid)); + return true; + }else{ + $this->view->error = view::Error('邮件发送失败'); + return true; + } } }//replyAction() diff --git a/application/admin/views/scripts/data/author-edit.phtml b/application/admin/views/scripts/data/author-edit.phtml index 2ec8eb93..ac0fd819 100644 --- a/application/admin/views/scripts/data/author-edit.phtml +++ b/application/admin/views/scripts/data/author-edit.phtml @@ -2,46 +2,44 @@ $this->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(' > '); +$this->theme->AppendPlus($this,"colorbox"); ?> - -
msg; ?>
-messages): foreach($this->messages as $msg): ?> - - -元数据标题 | -负责编辑 | -时间 | -操作 | -
= $item['title']?> | -- | - | - ' onclick="return confirm('是否确定取消评审')">取消评审 - '>邀请专家 - 更改管理员 - | -
msg; ?>
+ messages): foreach($this->messages as $msg): ?> + + +元数据标题 | +负责编辑 | +时间 | +操作 | +
= $item['title']?> | ++ | + | + ' onclick="return confirm('是否确定取消评审')">取消评审 + '>邀请专家 + 更改管理员 + | +
msg; ?>
+ messages): foreach($this->messages as $msg): ?> + + +元数据标题 | +状态 | +操作 | +
---|---|---|
= $item['title']?> | ++ | + 邀请专家 + 更改管理员 + 查看详细 + 查看评审意见 + 意见反馈 + ' onclick="return confirm('是否确定取消评审')">取消评审 + 发布 + 删除 + | +
msg; ?>
-messages): foreach($this->messages as $msg): ?> - - -元数据标题 | -状态 | -操作 | -
= $item['title']?> | -- | - 邀请专家 - 更改管理员 - 查看详细 - 查看评审意见 - 意见反馈 - ' onclick="return confirm('是否确定取消评审')">取消评审 - 发布 - 删除 - | -