diff --git a/application/admin/controllers/ReviewController.php b/application/admin/controllers/ReviewController.php index ac7642bb..d672d753 100644 --- a/application/admin/controllers/ReviewController.php +++ b/application/admin/controllers/ReviewController.php @@ -141,6 +141,8 @@ class Admin_ReviewController extends Zend_Controller_Action $update = $this->_request->getParam('update'); $invite = $this->_request->getParam('invite'); + include_once("helper/view.php"); + if($cancel>0) { if($this->changestatus($cancel,-1)) @@ -153,16 +155,17 @@ class Admin_ReviewController extends Zend_Controller_Action $sth->execute(array($cancel)); $data = $sth->fetch(); $search->del($data['uuid'],'uuid'); - $this->messenger->addMessage('操作成功:已取消该数据的评审'); - $this->_redirect("/admin/review/accept"); + view::Post($this,array("content"=>'操作成功:已取消该数据的评审','url'=>'/admin/review/accept')); + return true; } else{ - $this->messenger->addMessage('操作失败'); - $this->_redirect("/admin/review/accept"); + view::Post($this,array("content"=>'操作失败','url'=>'/admin/review/accept')); + return true; } }//取消元数据评审 if($search) { + $keyword = $this->_request->getParam('keyword'); if(!empty($keyword)) { @@ -335,6 +338,8 @@ class Admin_ReviewController extends Zend_Controller_Action $this->view->id = $id; + include_once("helper/view.php"); + if(!empty($submit)) { if(is_array($exps)) @@ -357,7 +362,8 @@ class Admin_ReviewController extends Zend_Controller_Action $rows = $rs->fetch(); if($rows['id']!='') { - $this->messenger->addMessage('已经邀请过专家:'.$rows['realname']); + view::Post($this,array("content"=>'已经邀请过专家:'.$rows['realname'],'url'=>-1)); + return true; }//已经有评审记录 else { @@ -388,14 +394,17 @@ class Admin_ReviewController extends Zend_Controller_Action $mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, $md['title'].'.pdf'); if($mail->send()) { - $this->messenger->addMessage('成功邀请专家:'.$expinfo['realname']); + view::Post($this,array("content"=>'成功邀请专家:'.$expinfo['realname'],'url'=>-1)); + return true; }else { - $this->messenger->addMessage('邀请专家'.$expinfo['realname'].'的邮件发送失败,请尝试手动发送邀请邮件'); + view::Post($this,array("content"=>'邀请专家'.$expinfo['realname'].'的邮件发送失败,请尝试手动发送邀请邮件','url'=>-1)); + return true; } } }catch(Exception $e){ - $this->messenger->addMessage('邀请失败:'.$e->getMessage()); + view::Post($this,array("content"=>'邀请失败:'.$e->getMessage(),'url'=>-1)); + return true; } }//不存在原来的记录 }//循环结束 @@ -403,8 +412,8 @@ class Admin_ReviewController extends Zend_Controller_Action } else { - $this->messenger->addMessage('请选择要邀请的专家'); - $this->_redirect("/admin/review/invite/?id=$id"); + view::Post($this,array("content"=>'请选择要邀请的专家','url'=>"/admin/review/invite/?id=$id")); + return true; } } elseif ($user>0) { $uuid=$this->_request->getParam('uuid'); @@ -425,12 +434,12 @@ class Admin_ReviewController extends Zend_Controller_Action $mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, $row['title'].'.pdf'); if($mail->send()) { - $this->messenger->addMessage('成功再次邀请专家:'.$row['realname']); - $this->_redirect("/admin/review/inreview/show/$id"); + view::Post($this,array("content"=>'成功再次邀请专家:'.$row['realname'],'url'=>"/admin/review/inreview/show/$id")); + return true; }else { - $this->messenger->addMessage('邀请专家'.$row['realname'].'的邮件发送失败,请尝试手动发送邀请邮件'); - $this->_redirect("/admin/review/inreview/show/$id"); + view::Post($this,array("content"=>'邀请专家'.$row['realname'].'的邮件发送失败,请尝试手动发送邀请邮件','url'=>"/admin/review/inreview/show/$id")); + return true; } } $searchjoin = ""; @@ -493,12 +502,12 @@ class Admin_ReviewController extends Zend_Controller_Action $sql = "update mdstatus set userid='$uid' where id='$id'"; if($this->db->exec($sql)>0) { - $this->messenger->addMessage('更改管理员成功'); - $this->_redirect("/admin/review/changeadmin/?id=$id"); + include_once('helper/view.php'); + view::Post($this,array("content"=>'修改成功','url'=>-1)); + return true; } } - - + $sql = "select u.* from users u where usertype='administrator'"; $re = $this->db->query($sql); @@ -530,27 +539,29 @@ class Admin_ReviewController extends Zend_Controller_Action $re = $this->db->query($sql); $row = $re->fetch(); + include_once('helper/view.php'); + if(empty($row['id'])) { $sql = "insert into mdstatus (uuid,userid,status) values ('$uuid','$userid','0')"; try{ if($this->db->exec($sql)>0) { - $this->messenger->addMessage('操作成功!该数据已放入评审'); - $this->_redirect("/admin/review/draft"); + view::Post($this,array("content"=>'操作成功!该数据已放入评审','url'=>'/admin/review/draft')); + return true; } }catch( Exception $e){ - $this->messenger->addMessage('操作失败:'.$e->getMessage()); - $this->_redirect("/admin/review/draft"); + view::Post($this,array("content"=>'操作失败:'.$e->getMessage(),'url'=>'/admin/review/draft')); + return true; } } else if ($row['status']==5){ $sql="update mdstatus set status=1,ts_accepted=now() where status=5 and id=".$row['id']; $this->db->query($sql); - $this->messenger->addMessage('操作成功!该数据已重新放入评审'); - $this->_redirect("/admin/review/accept"); + view::Post($this,array("content"=>'操作成功!该数据已重新放入评审','url'=>'/admin/review/accept')); + return true; } else { - $this->messenger->addMessage('该数据已放入评审'); - $this->_redirect("/admin/data/md"); + view::Post($this,array("content"=>'该数据已放入评审','url'=>'/admin/data/md')); + return true; } }//将数据放入评审 @@ -585,10 +596,10 @@ class Admin_ReviewController extends Zend_Controller_Action $this->view->keyword = $keyword; } - $sql = "select m.id,md.uuid,md.title,u.username,u.realname,m.status from mdstatus m + $sql = "select m.id,md.uuid,md.title,u.username,u.realname,m.status,md.id as mdid from mdstatus m right join metadata md on md.uuid=m.uuid left join users u on u.id=m.userid - where m.status in (0,1,2,3,4) and u.id='$userid' $searchjoin order by m.status desc,m.ts_accepted desc"; + where m.status in (0,1,2,3,4) and u.id='$userid' $searchjoin order by m.status desc,m.ts_accepted desc"; $re = $this->db->query($sql); $rows = $re->fetchAll(); @@ -644,6 +655,7 @@ class Admin_ReviewController extends Zend_Controller_Action $id = $this->_request->getParam('id'); $emails = $this->_request->getParam('emails'); + include_once('helper/view.php'); $auth = Zend_Auth::getInstance(); if($auth->hasIdentity()) { @@ -659,7 +671,6 @@ class Admin_ReviewController extends Zend_Controller_Action if($this->changestatus($id,5)) { - $this->messenger->addMessage('操作成功:该元数据成功发布'); //发布正式版本 $sql = "UPDATE mdversion SET changelog=?,userid=? WHERE id in (select id from mdversion where uuid in (select uuid from mdstatus where id=?) order by ts_created desc limit 1)"; $this->db->query($sql,array('发布第一个正式版本 version 1.0',$userid,$id)); @@ -677,26 +688,25 @@ class Admin_ReviewController extends Zend_Controller_Action $mail->addTo($emails); $mail->setSubject($mailtp->getSubject()); $mail->send(); - $this->_redirect("/admin/review/myreview"); + + view::Post($this,array("content"=>'操作成功:该元数据成功发布','url'=>"/admin/review/myreview")); + return true; }else{ - $this->messenger->addMessage('操作失败'); - $this->_redirect("/admin/review/myreview"); + view::Post($this,array("content"=>'操作失败','url'=>"/admin/review/myreview")); + return true; } }else{ - - $this->messenger->addMessage('您没有权限操作其他管理员管理的元数据评审'); - $this->_redirect("/admin/review/myreview"); - + view::Post($this,array("content"=>'您没有权限操作其他管理员管理的元数据评审','url'=>"/admin/review/myreview")); + return true; } }else { - $this->messenger->addMessage('权限读取失败'); - $this->_redirect("/admin/review/myreview"); + view::Post($this,array("content"=>'权限读取失败','url'=>"/admin/review/myreview")); + return true; } - }//发布元数据 /* @@ -709,19 +719,17 @@ class Admin_ReviewController extends Zend_Controller_Action * 对需要重新评审的元数据进行回滚,即状态为3 */ function rollbackAction(){ - $id=$this->_request->getParam('id'); - + include_once("helper/view.php"); if($this->changestatus($id,3)) { - $this->messenger->addMessage('操作成功!'); - $this->_redirect("/admin/review/reviewed"); + view::Post($this,array("content"=>'操作成功!','url'=>"/admin/review/reviewed")); + return true; } else{ - $this->messenger->addMessage('操作失败'.$id); - $this->_redirect("/admin/review/reviewed"); + view::Post($this,array("content"=>'操作失败'.$id,'url'=>"/admin/review/reviewed")); + return true; } - }//重新评审 @@ -741,6 +749,8 @@ class Admin_ReviewController extends Zend_Controller_Action $keyword = $this->_request->getParam('keyword'); $update = $this->_request->getParam('update'); + include_once("helper/view.php"); + if($update>0 || is_array($update)) { $ids = ''; @@ -791,12 +801,12 @@ class Admin_ReviewController extends Zend_Controller_Action $mail->send(); } } - $this->messenger->addMessage('操作成功!'); - $this->_redirect("/admin/review/draft"); + view::Post($this,array("content"=>'操作成功!'.$id,'url'=>"/admin/review/draft")); + return true; } else{ - $this->messenger->addMessage('操作失败'); - $this->_redirect("/admin/review/accept"); + view::Post($this,array("content"=>'操作失败'.$id,'url'=>"/admin/review/accept")); + return true; } }//开始评审 @@ -843,7 +853,7 @@ class Admin_ReviewController extends Zend_Controller_Action $search=$this->_request->getParam('search'); $keyword = $this->_request->getParam('keyword'); $update = $this->_request->getParam('update'); - + include_once('helper/view.php'); if($update>0 || is_array($update)) { $ids = ''; @@ -852,12 +862,12 @@ class Admin_ReviewController extends Zend_Controller_Action if($this->changestatus($ids,0)) { - $this->messenger->addMessage('操作成功!'); - $this->_redirect("/admin/review/canceled"); + view::Post($this,array("content"=>'操作成功!','url'=>"/admin/review/canceled")); + return true; } else{ - $this->messenger->addMessage('操作失败'.$ids); - $this->_redirect("/admin/review/canceled"); + view::Post($this,array("content"=>'操作失败'.$ids,'url'=>"/admin/review/canceled")); + return true; } }//取消评审 @@ -939,6 +949,7 @@ class Admin_ReviewController extends Zend_Controller_Action function deleteAction(){ $id=$this->_request->getParam('id'); + include_once("helper/view.php"); try{ $auth = Zend_Auth::getInstance(); if($auth->hasIdentity()) @@ -955,30 +966,26 @@ class Admin_ReviewController extends Zend_Controller_Action $sql = "delete from mdstatus where id='$id'"; if($this->db->exec($sql)) { - $this->messenger->addMessage('删除成功'); - $this->_redirect("/admin/review/myreview"); + view::Post($this,array("content"=>'删除成功','url'=>"/admin/review/myreview")); + return true; }else{ - $this->messenger->addMessage('删除失败'); - $this->_redirect("/admin/review/myreview"); + view::Post($this,array("content"=>'删除失败','url'=>"/admin/review/myreview")); + return true; } }else{ - - $this->messenger->addMessage('您没有权限操作其他管理员管理的元数据评审'); - $this->_redirect("/admin/review/myreview"); - + view::Post($this,array("content"=>'您没有权限操作其他管理员管理的元数据评审','url'=>"/admin/review/myreview")); + return true; } - }else { - $this->messenger->addMessage('权限读取失败'); - $this->_redirect("/admin/review/myreview"); + view::Post($this,array("content"=>'权限读取失败','url'=>"/admin/review/myreview")); + return true; } }catch(Exception $e){ - $this->messenger->addMessage('删除失败:'.$e->getMessage()); - $this->_redirect("/admin/review/myreview"); + view::Post($this,array("content"=>'删除失败:'.$e->getMessage(),'url'=>"/admin/review/myreview")); + return true; } - } @@ -1004,6 +1011,8 @@ class Admin_ReviewController extends Zend_Controller_Action $del = $this->_request->getParam('del'); $add = $this->_request->getParam('add'); + include_once("helper/view.php"); + if($add) { if(!empty($submit)) @@ -1043,9 +1052,8 @@ class Admin_ReviewController extends Zend_Controller_Action if(!empty($test['id'])) { - $this->messenger->addMessage('用户名或邮箱重复'); - $this->_redirect("/admin/review/experts"); - + view::Post($this,array("content"=>'用户名或邮箱重复','url'=>"/admin/review/experts")); + return true; } else @@ -1079,8 +1087,8 @@ class Admin_ReviewController extends Zend_Controller_Action $sql="insert into mdexperts (id,speciality) values ('{$row['id']}','$speciality')"; if($this->db->exec($sql)>0) { - $this->messenger->addMessage('成功添加评审专家'); - $this->_redirect("/admin/review/experts"); + view::Post($this,array("content"=>'成功添加评审专家','url'=>"/admin/review/experts")); + return true; } } @@ -1098,8 +1106,8 @@ class Admin_ReviewController extends Zend_Controller_Action $sql="delete from mdexperts where id='$del'"; if($this->db->exec($sql)>0) { - $this->messenger->addMessage('删除成功!'); - $this->_redirect('/admin/review/experts'); + view::Post($this,array("content"=>'删除成功!','url'=>'/admin/review/experts')); + return true; } } @@ -1111,8 +1119,8 @@ class Admin_ReviewController extends Zend_Controller_Action $sql = "update mdexperts set speciality='$speciality',ts_modified='".date("Y-m-d H:i:s",time())."' where id='$edit'"; if($this->db->exec($sql)>0) { - $this->messenger->addMessage('编辑成功!'); - $this->_redirect('/admin/review/experts'); + view::Post($this,array("content"=>'编辑成功!','url'=>'/admin/review/experts')); + return true; } } else @@ -1189,15 +1197,15 @@ class Admin_ReviewController extends Zend_Controller_Action $id = $this->_request->getParam('id'); $q = $this->_request->getParam('q'); $search = $this->_request->getParam('search'); - + include_once('helper/view.php'); if($ac=='view' && !empty($id)) { $redirect = "/admin/review/comments/ac/view/id/$id"; if(!is_numeric($id)) { - $this->messenger->addMessage('参数不正确,请按正确的步骤进行访问'); - $this->_redirect($redirect); + view::Post($this,array("content"=>'参数不正确,请按正确的步骤进行访问','url'=>$redirect)); + return true; } $sql = "select r.*,md.title,u.realname,u.id as uid from mdreview r @@ -1212,8 +1220,8 @@ class Admin_ReviewController extends Zend_Controller_Action if(empty($row['id'])) { - $this->messenger->addMessage('该评审不存在或者已删除'); - $this->_redirect($redirect); + view::Post($this,array("content"=>'该评审不存在或者已删除','url'=>$redirect)); + return true; } $sql = "select att.realname,att.id from attachments att @@ -1270,8 +1278,8 @@ class Admin_ReviewController extends Zend_Controller_Action { if (preg_match("/[<|>|#|$|%|^|*|(|)|{|}|'|\"|;|:]/i",$q) || !is_numeric($search)) { - $this->messenger->addMessage('您的输入的搜索条件包含非法请求,请不要输入特殊符号'); - $this->_redirect($redirect); + view::Post($this,array("content"=>'您的输入的搜索条件包含非法请求,请不要输入特殊符号','url'=>$redirect)); + return true; } $this->view->q = $q; $wheresql[] = " (md.title like '%$q%' or u.realname like '%$q%') "; @@ -1321,8 +1329,8 @@ class Admin_ReviewController extends Zend_Controller_Action { if (preg_match("/[<|>|#|$|%|^|*|(|)|{|}|'|\"|;|:]/i",$q) || !is_numeric($search)) { - $this->messenger->addMessage('您的输入的搜索条件包含非法请求,请不要输入特殊符号'); - $this->_redirect($redirect); + view::Post($this,array("content"=>'您的输入的搜索条件包含非法请求,请不要输入特殊符号','url'=>$redirect)); + return true; } $this->view->q = $q; $wheresql[] = " u.realname like '%$q%' "; @@ -1366,8 +1374,8 @@ class Admin_ReviewController extends Zend_Controller_Action if(!is_numeric($id)) { - $this->messenger->addMessage('参数不正确,请按正确的步骤进行访问'); - $this->_redirect($redirect); + view::Post($this,array("content"=>'参数不正确,请按正确的步骤进行访问','url'=>$redirect)); + return true; } $sql = "select r.id,att.filename,ratt.attachid as attid from mdreview r @@ -1390,8 +1398,8 @@ class Admin_ReviewController extends Zend_Controller_Action $sql = "delete from mdreview where id='$id'"; if($this->db->exec($sql)>0) { - $this->messenger->addMessage('评审意见删除成功!'); - $this->_redirect($redirect); + view::Post($this,array("content"=>'评审意见删除成功!','url'=>$redirect)); + return true; } } else @@ -1399,16 +1407,16 @@ class Admin_ReviewController extends Zend_Controller_Action $sql = "delete from mdreview where id='$id'"; if($this->db->exec($sql)>0) { - $this->messenger->addMessage('评审意见删除成功!但附件删除失败,请手动删除文件:'.$row['filename']); - $this->_redirect($redirect); + view::Post($this,array("content"=>'评审意见删除成功!但附件删除失败,请手动删除文件:'.$row['filename'],'url'=>$redirect)); + return true; } } }else{ $sql = "delete from mdreview where id='$id'"; if($this->db->exec($sql)>0) { - $this->messenger->addMessage('评审意见删除成功!'); - $this->_redirect($redirect); + view::Post($this,array("content"=>'评审意见删除成功!','url'=>$redirect)); + return true; } } }//删除评审意见 同时删除附件 @@ -1424,16 +1432,16 @@ class Admin_ReviewController extends Zend_Controller_Action if($this->db->exec($sql)) { - $this->messenger->addMessage('更改成功'); - $this->_redirect($redirect); + view::Post($this,array("content"=>'更改成功','url'=>$redirect)); + return true; }else{ - $this->messenger->addMessage('更新失败'); - $this->_redirect($redirect); + view::Post($this,array("content"=>'更改失败','url'=>$redirect)); + return true; } }catch(Exception $e){ - $this->messenger->addMessage('更新失败:'.$e->getMessage()); - $this->_redirect($redirect); + view::Post($this,array("content"=>'更新失败:'.$e->getMessage(),'url'=>$redirect)); + return true; } }//为用户重置为草稿状态 @@ -1451,8 +1459,8 @@ class Admin_ReviewController extends Zend_Controller_Action { if (preg_match("/[<|>|#|$|%|^|*|(|)|{|}|'|\"|;|:]/i",$q) || !is_numeric($search)) { - $this->messenger->addMessage('您的输入的搜索条件包含非法请求,请不要输入特殊符号'); - $this->_redirect($redirect); + view::Post($this,array("content"=>'您的输入的搜索条件包含非法请求,请不要输入特殊符号','url'=>$redirect)); + return true; }//非法请求过滤 $this->view->q = $q; $wheresql[] = " md.title like '%$q%' "; diff --git a/application/admin/views/scripts/review/accept.phtml b/application/admin/views/scripts/review/accept.phtml index 6d6f9e9b..9308cd20 100644 --- a/application/admin/views/scripts/review/accept.phtml +++ b/application/admin/views/scripts/review/accept.phtml @@ -2,13 +2,15 @@ $this->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'); ?> @@ -23,21 +25,20 @@
- - + - +
- - - - + + + + paginator)): ?> @@ -58,5 +59,4 @@
元数据标题负责编辑时间操作元数据标题负责编辑时间操作
- - \ No newline at end of file + \ No newline at end of file diff --git a/application/admin/views/scripts/review/draft.phtml b/application/admin/views/scripts/review/draft.phtml index b5cc8fdd..b0e14656 100644 --- a/application/admin/views/scripts/review/draft.phtml +++ b/application/admin/views/scripts/review/draft.phtml @@ -2,58 +2,59 @@ $this->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 + +
+
+ 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/myreview.phtml b/application/admin/views/scripts/review/myreview.phtml index 4fe9afda..d96cd1a3 100644 --- a/application/admin/views/scripts/review/myreview.phtml +++ b/application/admin/views/scripts/review/myreview.phtml @@ -43,7 +43,7 @@ table thead tr th {background:#EBF2F6;color:#444;} paginator as $item): ?> - + [编辑]