修改后台评审的模板和一些细节

This commit is contained in:
Li Jianxuan 2013-05-10 09:37:57 +00:00
parent 326572d7c2
commit 01cb81cd1b
5 changed files with 178 additions and 203 deletions

View File

@ -141,6 +141,8 @@ class Admin_ReviewController extends Zend_Controller_Action
$update = $this->_request->getParam('update'); $update = $this->_request->getParam('update');
$invite = $this->_request->getParam('invite'); $invite = $this->_request->getParam('invite');
include_once("helper/view.php");
if($cancel>0) if($cancel>0)
{ {
if($this->changestatus($cancel,-1)) if($this->changestatus($cancel,-1))
@ -153,16 +155,17 @@ class Admin_ReviewController extends Zend_Controller_Action
$sth->execute(array($cancel)); $sth->execute(array($cancel));
$data = $sth->fetch(); $data = $sth->fetch();
$search->del($data['uuid'],'uuid'); $search->del($data['uuid'],'uuid');
$this->messenger->addMessage('操作成功:已取消该数据的评审'); view::Post($this,array("content"=>'操作成功:已取消该数据的评审','url'=>'/admin/review/accept'));
$this->_redirect("/admin/review/accept"); return true;
} }
else{ else{
$this->messenger->addMessage('操作失败'); view::Post($this,array("content"=>'操作失败','url'=>'/admin/review/accept'));
$this->_redirect("/admin/review/accept"); return true;
} }
}//取消元数据评审 }//取消元数据评审
if($search) if($search)
{ {
$keyword = $this->_request->getParam('keyword'); $keyword = $this->_request->getParam('keyword');
if(!empty($keyword)) if(!empty($keyword))
{ {
@ -335,6 +338,8 @@ class Admin_ReviewController extends Zend_Controller_Action
$this->view->id = $id; $this->view->id = $id;
include_once("helper/view.php");
if(!empty($submit)) if(!empty($submit))
{ {
if(is_array($exps)) if(is_array($exps))
@ -357,7 +362,8 @@ class Admin_ReviewController extends Zend_Controller_Action
$rows = $rs->fetch(); $rows = $rs->fetch();
if($rows['id']!='') if($rows['id']!='')
{ {
$this->messenger->addMessage('已经邀请过专家:'.$rows['realname']); view::Post($this,array("content"=>'已经邀请过专家:'.$rows['realname'],'url'=>-1));
return true;
}//已经有评审记录 }//已经有评审记录
else 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'); $mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, $md['title'].'.pdf');
if($mail->send()) if($mail->send())
{ {
$this->messenger->addMessage('成功邀请专家:'.$expinfo['realname']); view::Post($this,array("content"=>'成功邀请专家:'.$expinfo['realname'],'url'=>-1));
return true;
}else }else
{ {
$this->messenger->addMessage('邀请专家'.$expinfo['realname'].'的邮件发送失败,请尝试手动发送邀请邮件'); view::Post($this,array("content"=>'邀请专家'.$expinfo['realname'].'的邮件发送失败,请尝试手动发送邀请邮件','url'=>-1));
return true;
} }
} }
}catch(Exception $e){ }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 else
{ {
$this->messenger->addMessage('请选择要邀请的专家'); view::Post($this,array("content"=>'请选择要邀请的专家','url'=>"/admin/review/invite/?id=$id"));
$this->_redirect("/admin/review/invite/?id=$id"); return true;
} }
} elseif ($user>0) { } elseif ($user>0) {
$uuid=$this->_request->getParam('uuid'); $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'); $mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, $row['title'].'.pdf');
if($mail->send()) if($mail->send())
{ {
$this->messenger->addMessage('成功再次邀请专家:'.$row['realname']); view::Post($this,array("content"=>'成功再次邀请专家:'.$row['realname'],'url'=>"/admin/review/inreview/show/$id"));
$this->_redirect("/admin/review/inreview/show/$id"); return true;
}else }else
{ {
$this->messenger->addMessage('邀请专家'.$row['realname'].'的邮件发送失败,请尝试手动发送邀请邮件'); view::Post($this,array("content"=>'邀请专家'.$row['realname'].'的邮件发送失败,请尝试手动发送邀请邮件','url'=>"/admin/review/inreview/show/$id"));
$this->_redirect("/admin/review/inreview/show/$id"); return true;
} }
} }
$searchjoin = ""; $searchjoin = "";
@ -493,12 +502,12 @@ class Admin_ReviewController extends Zend_Controller_Action
$sql = "update mdstatus set userid='$uid' where id='$id'"; $sql = "update mdstatus set userid='$uid' where id='$id'";
if($this->db->exec($sql)>0) if($this->db->exec($sql)>0)
{ {
$this->messenger->addMessage('更改管理员成功'); include_once('helper/view.php');
$this->_redirect("/admin/review/changeadmin/?id=$id"); view::Post($this,array("content"=>'修改成功','url'=>-1));
return true;
} }
} }
$sql = "select u.* from users u $sql = "select u.* from users u
where usertype='administrator'"; where usertype='administrator'";
$re = $this->db->query($sql); $re = $this->db->query($sql);
@ -530,27 +539,29 @@ class Admin_ReviewController extends Zend_Controller_Action
$re = $this->db->query($sql); $re = $this->db->query($sql);
$row = $re->fetch(); $row = $re->fetch();
include_once('helper/view.php');
if(empty($row['id'])) if(empty($row['id']))
{ {
$sql = "insert into mdstatus (uuid,userid,status) values ('$uuid','$userid','0')"; $sql = "insert into mdstatus (uuid,userid,status) values ('$uuid','$userid','0')";
try{ try{
if($this->db->exec($sql)>0) if($this->db->exec($sql)>0)
{ {
$this->messenger->addMessage('操作成功!该数据已放入评审'); view::Post($this,array("content"=>'操作成功!该数据已放入评审','url'=>'/admin/review/draft'));
$this->_redirect("/admin/review/draft"); return true;
} }
}catch( Exception $e){ }catch( Exception $e){
$this->messenger->addMessage('操作失败:'.$e->getMessage()); view::Post($this,array("content"=>'操作失败:'.$e->getMessage(),'url'=>'/admin/review/draft'));
$this->_redirect("/admin/review/draft"); return true;
} }
} else if ($row['status']==5){ } else if ($row['status']==5){
$sql="update mdstatus set status=1,ts_accepted=now() where status=5 and id=".$row['id']; $sql="update mdstatus set status=1,ts_accepted=now() where status=5 and id=".$row['id'];
$this->db->query($sql); $this->db->query($sql);
$this->messenger->addMessage('操作成功!该数据已重新放入评审'); view::Post($this,array("content"=>'操作成功!该数据已重新放入评审','url'=>'/admin/review/accept'));
$this->_redirect("/admin/review/accept"); return true;
} else { } else {
$this->messenger->addMessage('该数据已放入评审'); view::Post($this,array("content"=>'该数据已放入评审','url'=>'/admin/data/md'));
$this->_redirect("/admin/data/md"); return true;
} }
}//将数据放入评审 }//将数据放入评审
@ -585,10 +596,10 @@ class Admin_ReviewController extends Zend_Controller_Action
$this->view->keyword = $keyword; $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 right join metadata md on md.uuid=m.uuid
left join users u on u.id=m.userid 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); $re = $this->db->query($sql);
$rows = $re->fetchAll(); $rows = $re->fetchAll();
@ -644,6 +655,7 @@ class Admin_ReviewController extends Zend_Controller_Action
$id = $this->_request->getParam('id'); $id = $this->_request->getParam('id');
$emails = $this->_request->getParam('emails'); $emails = $this->_request->getParam('emails');
include_once('helper/view.php');
$auth = Zend_Auth::getInstance(); $auth = Zend_Auth::getInstance();
if($auth->hasIdentity()) if($auth->hasIdentity())
{ {
@ -659,7 +671,6 @@ class Admin_ReviewController extends Zend_Controller_Action
if($this->changestatus($id,5)) 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)"; $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)); $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->addTo($emails);
$mail->setSubject($mailtp->getSubject()); $mail->setSubject($mailtp->getSubject());
$mail->send(); $mail->send();
$this->_redirect("/admin/review/myreview");
view::Post($this,array("content"=>'操作成功:该元数据成功发布','url'=>"/admin/review/myreview"));
return true;
}else{ }else{
$this->messenger->addMessage('操作失败'); view::Post($this,array("content"=>'操作失败','url'=>"/admin/review/myreview"));
$this->_redirect("/admin/review/myreview"); return true;
} }
}else{ }else{
view::Post($this,array("content"=>'您没有权限操作其他管理员管理的元数据评审','url'=>"/admin/review/myreview"));
$this->messenger->addMessage('您没有权限操作其他管理员管理的元数据评审'); return true;
$this->_redirect("/admin/review/myreview");
} }
}else }else
{ {
$this->messenger->addMessage('权限读取失败'); view::Post($this,array("content"=>'权限读取失败','url'=>"/admin/review/myreview"));
$this->_redirect("/admin/review/myreview"); return true;
} }
}//发布元数据 }//发布元数据
/* /*
@ -709,19 +719,17 @@ class Admin_ReviewController extends Zend_Controller_Action
* 对需要重新评审的元数据进行回滚即状态为3 * 对需要重新评审的元数据进行回滚即状态为3
*/ */
function rollbackAction(){ function rollbackAction(){
$id=$this->_request->getParam('id'); $id=$this->_request->getParam('id');
include_once("helper/view.php");
if($this->changestatus($id,3)) if($this->changestatus($id,3))
{ {
$this->messenger->addMessage('操作成功!'); view::Post($this,array("content"=>'操作成功!','url'=>"/admin/review/reviewed"));
$this->_redirect("/admin/review/reviewed"); return true;
} }
else{ else{
$this->messenger->addMessage('操作失败'.$id); view::Post($this,array("content"=>'操作失败'.$id,'url'=>"/admin/review/reviewed"));
$this->_redirect("/admin/review/reviewed"); return true;
} }
}//重新评审 }//重新评审
@ -741,6 +749,8 @@ class Admin_ReviewController extends Zend_Controller_Action
$keyword = $this->_request->getParam('keyword'); $keyword = $this->_request->getParam('keyword');
$update = $this->_request->getParam('update'); $update = $this->_request->getParam('update');
include_once("helper/view.php");
if($update>0 || is_array($update)) if($update>0 || is_array($update))
{ {
$ids = ''; $ids = '';
@ -791,12 +801,12 @@ class Admin_ReviewController extends Zend_Controller_Action
$mail->send(); $mail->send();
} }
} }
$this->messenger->addMessage('操作成功!'); view::Post($this,array("content"=>'操作成功!'.$id,'url'=>"/admin/review/draft"));
$this->_redirect("/admin/review/draft"); return true;
} }
else{ else{
$this->messenger->addMessage('操作失败'); view::Post($this,array("content"=>'操作失败'.$id,'url'=>"/admin/review/accept"));
$this->_redirect("/admin/review/accept"); return true;
} }
}//开始评审 }//开始评审
@ -843,7 +853,7 @@ class Admin_ReviewController extends Zend_Controller_Action
$search=$this->_request->getParam('search'); $search=$this->_request->getParam('search');
$keyword = $this->_request->getParam('keyword'); $keyword = $this->_request->getParam('keyword');
$update = $this->_request->getParam('update'); $update = $this->_request->getParam('update');
include_once('helper/view.php');
if($update>0 || is_array($update)) if($update>0 || is_array($update))
{ {
$ids = ''; $ids = '';
@ -852,12 +862,12 @@ class Admin_ReviewController extends Zend_Controller_Action
if($this->changestatus($ids,0)) if($this->changestatus($ids,0))
{ {
$this->messenger->addMessage('操作成功!'); view::Post($this,array("content"=>'操作成功!','url'=>"/admin/review/canceled"));
$this->_redirect("/admin/review/canceled"); return true;
} }
else{ else{
$this->messenger->addMessage('操作失败'.$ids); view::Post($this,array("content"=>'操作失败'.$ids,'url'=>"/admin/review/canceled"));
$this->_redirect("/admin/review/canceled"); return true;
} }
}//取消评审 }//取消评审
@ -939,6 +949,7 @@ class Admin_ReviewController extends Zend_Controller_Action
function deleteAction(){ function deleteAction(){
$id=$this->_request->getParam('id'); $id=$this->_request->getParam('id');
include_once("helper/view.php");
try{ try{
$auth = Zend_Auth::getInstance(); $auth = Zend_Auth::getInstance();
if($auth->hasIdentity()) if($auth->hasIdentity())
@ -955,30 +966,26 @@ class Admin_ReviewController extends Zend_Controller_Action
$sql = "delete from mdstatus where id='$id'"; $sql = "delete from mdstatus where id='$id'";
if($this->db->exec($sql)) if($this->db->exec($sql))
{ {
$this->messenger->addMessage('删除成功'); view::Post($this,array("content"=>'删除成功','url'=>"/admin/review/myreview"));
$this->_redirect("/admin/review/myreview"); return true;
}else{ }else{
$this->messenger->addMessage('删除失败'); view::Post($this,array("content"=>'删除失败','url'=>"/admin/review/myreview"));
$this->_redirect("/admin/review/myreview"); return true;
} }
}else{ }else{
view::Post($this,array("content"=>'您没有权限操作其他管理员管理的元数据评审','url'=>"/admin/review/myreview"));
$this->messenger->addMessage('您没有权限操作其他管理员管理的元数据评审'); return true;
$this->_redirect("/admin/review/myreview");
} }
}else }else
{ {
$this->messenger->addMessage('权限读取失败'); view::Post($this,array("content"=>'权限读取失败','url'=>"/admin/review/myreview"));
$this->_redirect("/admin/review/myreview"); return true;
} }
}catch(Exception $e){ }catch(Exception $e){
$this->messenger->addMessage('删除失败:'.$e->getMessage()); view::Post($this,array("content"=>'删除失败:'.$e->getMessage(),'url'=>"/admin/review/myreview"));
$this->_redirect("/admin/review/myreview"); return true;
} }
} }
@ -1004,6 +1011,8 @@ class Admin_ReviewController extends Zend_Controller_Action
$del = $this->_request->getParam('del'); $del = $this->_request->getParam('del');
$add = $this->_request->getParam('add'); $add = $this->_request->getParam('add');
include_once("helper/view.php");
if($add) if($add)
{ {
if(!empty($submit)) if(!empty($submit))
@ -1043,9 +1052,8 @@ class Admin_ReviewController extends Zend_Controller_Action
if(!empty($test['id'])) if(!empty($test['id']))
{ {
$this->messenger->addMessage('用户名或邮箱重复'); view::Post($this,array("content"=>'用户名或邮箱重复','url'=>"/admin/review/experts"));
$this->_redirect("/admin/review/experts"); return true;
} }
else else
@ -1079,8 +1087,8 @@ class Admin_ReviewController extends Zend_Controller_Action
$sql="insert into mdexperts (id,speciality) values ('{$row['id']}','$speciality')"; $sql="insert into mdexperts (id,speciality) values ('{$row['id']}','$speciality')";
if($this->db->exec($sql)>0) if($this->db->exec($sql)>0)
{ {
$this->messenger->addMessage('成功添加评审专家'); view::Post($this,array("content"=>'成功添加评审专家','url'=>"/admin/review/experts"));
$this->_redirect("/admin/review/experts"); return true;
} }
} }
@ -1098,8 +1106,8 @@ class Admin_ReviewController extends Zend_Controller_Action
$sql="delete from mdexperts where id='$del'"; $sql="delete from mdexperts where id='$del'";
if($this->db->exec($sql)>0) if($this->db->exec($sql)>0)
{ {
$this->messenger->addMessage('删除成功!'); view::Post($this,array("content"=>'删除成功!','url'=>'/admin/review/experts'));
$this->_redirect('/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'"; $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) if($this->db->exec($sql)>0)
{ {
$this->messenger->addMessage('编辑成功!'); view::Post($this,array("content"=>'编辑成功!','url'=>'/admin/review/experts'));
$this->_redirect('/admin/review/experts'); return true;
} }
} }
else else
@ -1189,15 +1197,15 @@ class Admin_ReviewController extends Zend_Controller_Action
$id = $this->_request->getParam('id'); $id = $this->_request->getParam('id');
$q = $this->_request->getParam('q'); $q = $this->_request->getParam('q');
$search = $this->_request->getParam('search'); $search = $this->_request->getParam('search');
include_once('helper/view.php');
if($ac=='view' && !empty($id)) if($ac=='view' && !empty($id))
{ {
$redirect = "/admin/review/comments/ac/view/id/$id"; $redirect = "/admin/review/comments/ac/view/id/$id";
if(!is_numeric($id)) if(!is_numeric($id))
{ {
$this->messenger->addMessage('参数不正确,请按正确的步骤进行访问'); view::Post($this,array("content"=>'参数不正确,请按正确的步骤进行访问','url'=>$redirect));
$this->_redirect($redirect); return true;
} }
$sql = "select r.*,md.title,u.realname,u.id as uid from mdreview r $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'])) if(empty($row['id']))
{ {
$this->messenger->addMessage('该评审不存在或者已删除'); view::Post($this,array("content"=>'该评审不存在或者已删除','url'=>$redirect));
$this->_redirect($redirect); return true;
} }
$sql = "select att.realname,att.id from attachments att $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)) if (preg_match("/[<|>|#|$|%|^|*|(|)|{|}|'|\"|;|:]/i",$q) || !is_numeric($search))
{ {
$this->messenger->addMessage('您的输入的搜索条件包含非法请求,请不要输入特殊符号'); view::Post($this,array("content"=>'您的输入的搜索条件包含非法请求,请不要输入特殊符号','url'=>$redirect));
$this->_redirect($redirect); return true;
} }
$this->view->q = $q; $this->view->q = $q;
$wheresql[] = " (md.title like '%$q%' or u.realname like '%$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)) if (preg_match("/[<|>|#|$|%|^|*|(|)|{|}|'|\"|;|:]/i",$q) || !is_numeric($search))
{ {
$this->messenger->addMessage('您的输入的搜索条件包含非法请求,请不要输入特殊符号'); view::Post($this,array("content"=>'您的输入的搜索条件包含非法请求,请不要输入特殊符号','url'=>$redirect));
$this->_redirect($redirect); return true;
} }
$this->view->q = $q; $this->view->q = $q;
$wheresql[] = " u.realname like '%$q%' "; $wheresql[] = " u.realname like '%$q%' ";
@ -1366,8 +1374,8 @@ class Admin_ReviewController extends Zend_Controller_Action
if(!is_numeric($id)) if(!is_numeric($id))
{ {
$this->messenger->addMessage('参数不正确,请按正确的步骤进行访问'); view::Post($this,array("content"=>'参数不正确,请按正确的步骤进行访问','url'=>$redirect));
$this->_redirect($redirect); return true;
} }
$sql = "select r.id,att.filename,ratt.attachid as attid from mdreview r $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'"; $sql = "delete from mdreview where id='$id'";
if($this->db->exec($sql)>0) if($this->db->exec($sql)>0)
{ {
$this->messenger->addMessage('评审意见删除成功!'); view::Post($this,array("content"=>'评审意见删除成功!','url'=>$redirect));
$this->_redirect($redirect); return true;
} }
} }
else else
@ -1399,16 +1407,16 @@ class Admin_ReviewController extends Zend_Controller_Action
$sql = "delete from mdreview where id='$id'"; $sql = "delete from mdreview where id='$id'";
if($this->db->exec($sql)>0) if($this->db->exec($sql)>0)
{ {
$this->messenger->addMessage('评审意见删除成功!但附件删除失败,请手动删除文件:'.$row['filename']); view::Post($this,array("content"=>'评审意见删除成功!但附件删除失败,请手动删除文件:'.$row['filename'],'url'=>$redirect));
$this->_redirect($redirect); return true;
} }
} }
}else{ }else{
$sql = "delete from mdreview where id='$id'"; $sql = "delete from mdreview where id='$id'";
if($this->db->exec($sql)>0) if($this->db->exec($sql)>0)
{ {
$this->messenger->addMessage('评审意见删除成功!'); view::Post($this,array("content"=>'评审意见删除成功!','url'=>$redirect));
$this->_redirect($redirect); return true;
} }
} }
}//删除评审意见 同时删除附件 }//删除评审意见 同时删除附件
@ -1424,16 +1432,16 @@ class Admin_ReviewController extends Zend_Controller_Action
if($this->db->exec($sql)) if($this->db->exec($sql))
{ {
$this->messenger->addMessage('更改成功'); view::Post($this,array("content"=>'更改成功','url'=>$redirect));
$this->_redirect($redirect); return true;
}else{ }else{
$this->messenger->addMessage('更新失败'); view::Post($this,array("content"=>'更改失败','url'=>$redirect));
$this->_redirect($redirect); return true;
} }
}catch(Exception $e){ }catch(Exception $e){
$this->messenger->addMessage('更新失败:'.$e->getMessage()); view::Post($this,array("content"=>'更新失败:'.$e->getMessage(),'url'=>$redirect));
$this->_redirect($redirect); return true;
} }
}//为用户重置为草稿状态 }//为用户重置为草稿状态
@ -1451,8 +1459,8 @@ class Admin_ReviewController extends Zend_Controller_Action
{ {
if (preg_match("/[<|>|#|$|%|^|*|(|)|{|}|'|\"|;|:]/i",$q) || !is_numeric($search)) if (preg_match("/[<|>|#|$|%|^|*|(|)|{|}|'|\"|;|:]/i",$q) || !is_numeric($search))
{ {
$this->messenger->addMessage('您的输入的搜索条件包含非法请求,请不要输入特殊符号'); view::Post($this,array("content"=>'您的输入的搜索条件包含非法请求,请不要输入特殊符号','url'=>$redirect));
$this->_redirect($redirect); return true;
}//非法请求过滤 }//非法请求过滤
$this->view->q = $q; $this->view->q = $q;
$wheresql[] = " md.title like '%$q%' "; $wheresql[] = " md.title like '%$q%' ";

View File

@ -2,13 +2,15 @@
$this->headTitle($this->config->title->site); $this->headTitle($this->config->title->site);
$this->headTitle('后台管理'); $this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - '); $this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/admin.css');
$this->headScript()->appendFile('/js/jquery-1.6.4.min.js');
$this->breadcrumb('<a href="/">首页</a>'); $this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/admin">后台首页</a>'); $this->breadcrumb('<a href="/admin">后台首页</a>');
$this->breadcrumb('元数据评审'); $this->breadcrumb('元数据评审');
$this->breadcrumb()->setSeparator(' > '); $this->breadcrumb()->setSeparator(' > ');
?> ?>
<style>
table thead tr th {background:#EBF2F6;color:#444;}
.high{background:#444;color:#FFF;}
</style>
<div class="row-fluid"> <div class="row-fluid">
<div class="span3"> <div class="span3">
<?= $this->partial('review/left.phtml'); ?> <?= $this->partial('review/left.phtml'); ?>
@ -23,21 +25,20 @@
<?php endforeach;endif; ?> <?php endforeach;endif; ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
<div class="search"> <form action="" method="get" class="search input-append">
<form action="" method="get">
<input type="hidden" name="search" value='1' /> <input type="hidden" name="search" value='1' />
<label>搜索关键字</label><input type="text" name="keyword" class="q" value="<?php echo $this->keyword; ?>" /> <input type="text" name="keyword" class="q" value="<?php echo $this->keyword; ?>" />
<input type="submit" class="btn" value="搜索" /> <button type="submit" class="btn">搜索</button>
</form> </form>
</div><!-- search DIV -->
<table class="stylized"><thead> <table class="table table-bordered table-hover"><thead>
<tr> <tr>
<td width='600'>元数据标题</td> <th width='600'>元数据标题</th>
<td width='120'>负责编辑</td> <th width='120'>负责编辑</th>
<td width='120'>时间</td> <th width='120'>时间</th>
<td width='180'>操作</td> <th width='180'>操作</th>
</tr></thead> </tr></thead>
<?php if (count($this->paginator)): ?> <?php if (count($this->paginator)): ?>
<tbody id="list"> <tbody id="list">
@ -58,5 +59,4 @@
</table> </table>
<div class="pagenavi"><?= $this->paginator; ?></div> <div class="pagenavi"><?= $this->paginator; ?></div>
</div><!-- span9 --> </div><!-- span9 -->
</div> </div>
<script>$("#list tr").mouseover(function(){$(this).addClass("high")}).mouseout(function(){$(this).removeClass("high")})</script>

View File

@ -2,58 +2,59 @@
$this->headTitle($this->config->title->site); $this->headTitle($this->config->title->site);
$this->headTitle('后台管理'); $this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - '); $this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/admin.css');
$this->headScript()->appendFile('/js/jquery-1.6.4.min.js');
$this->breadcrumb('<a href="/">首页</a>'); $this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/admin">后台首页</a>'); $this->breadcrumb('<a href="/admin">后台首页</a>');
$this->breadcrumb('元数据评审'); $this->breadcrumb('元数据评审');
$this->breadcrumb()->setSeparator(' > '); $this->breadcrumb()->setSeparator(' > ');
?> ?>
<div id="leftPanel"> <style>
<?= $this->partial('review/left.phtml'); ?> table thead tr th {background:#EBF2F6;color:#444;}
</div> .high{background:#444;color:#FFF;}
<div id="rightPanel"> </style>
<?php if ($this->msg or $this->messages) :?> <div class="row-fluid">
<div id="message"> <div class="span3">
<?php if ($this->msg) : ?> <?= $this->partial('review/left.phtml'); ?>
<p><?php echo $this->msg; ?></p> </div>
<?php endif; if ($this->messages): foreach($this->messages as $msg): ?> <div class="span9">
<p><?php echo $msg; ?></p> <?php if ($this->msg or $this->messages) :?>
<?php endforeach;endif; ?> <div id="message">
</div> <?php if ($this->msg) : ?>
<?php endif; ?> <p><?php echo $this->msg; ?></p>
<div class="search"> <?php endif; if ($this->messages): foreach($this->messages as $msg): ?>
<form action="" method="get"> <p><?php echo $msg; ?></p>
<input type="hidden" name="search" value='1' /> <?php endforeach;endif; ?>
<input type="hidden" name="id" value='<?php echo $this->id;?>' /> </div>
<label>搜索关键字</label><input type="text" name="keyword" class="q" value="<?php echo $this->keyword; ?>" /> <?php endif; ?>
<input type="submit" class="btn" value="搜索" /> <form action="" method="get" class="search input-append">
</form> <input type="hidden" name="search" value='1' />
</div><!-- search DIV --> <input type="hidden" name="id" value='<?php echo $this->id;?>' />
<form action="" method="post"> <input type="text" name="keyword" class="q" value="<?php echo $this->keyword; ?>" />
<table class="stylized"><thead> <button type="submit" class="btn">搜索</button>
<tr> </form>
<td width='40'>选择</td> <form action="" method="post">
<td width='600'>标题</td> <table class="table table-bordered table-hover"><thead>
<td width='120'>时间</td> <tr>
<td width="180">操作</td> <th width='40'>选择</th>
</tr></thead> <th width='600'>标题</th>
<?php if (count($this->paginator)): ?> <th width='120'>时间</th>
<tbody id="list"> <th width="180">操作</th>
<?php foreach ($this->paginator as $item): ?> </tr></thead>
<tr> <?php if (count($this->paginator)): ?>
<td><input type="checkbox" name="update[]" value="<?php echo $item['id']; ?>"/></td> <tbody id="list">
<td><a href="/data/<?php echo $item['uuid'];?>"><?php echo $item['title']; ?></a></td> <?php foreach ($this->paginator as $item): ?>
<td><?php echo date("Y-m-d H:i",strtotime($item['ts_created']));?></td> <tr>
<td><a href="/admin/review/draft/update/<?php echo $item['id']; ?>">接收</a> <td><input type="checkbox" name="update[]" value="<?php echo $item['id']; ?>"/></td>
</td> <td><a href="/data/<?php echo $item['uuid'];?>"><?php echo $item['title']; ?></a></td>
</tr> <td><?php echo date("Y-m-d H:i",strtotime($item['ts_created']));?></td>
<?php endforeach; ?> <td><a href="/admin/review/draft/update/<?php echo $item['id']; ?>">接收</a>
</tbody> </td>
<?php endif; ?> </tr>
</table> <?php endforeach; ?>
<input type="submit" value="接收已选择的元数据" /> </tbody>
</form> <?php endif; ?>
<div class="pagenavi"><?= $this->paginator; ?></div> </table>
</div> <input type="submit" class="btn btn-primary" value="接收已选择的元数据" />
<script>$("#list tr").mouseover(function(){$(this).addClass("high")}).mouseout(function(){$(this).removeClass("high")})</script> </form>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div>
</div>

View File

@ -43,7 +43,7 @@ table thead tr th {background:#EBF2F6;color:#444;}
<tbody id="list"> <tbody id="list">
<?php foreach ($this->paginator as $item): ?> <?php foreach ($this->paginator as $item): ?>
<tr> <tr>
<td><?= $item['title']?></td> <td><?= $item['title']?> [<a href="/service/geonetwork?url=metadata.edit?id=<?= $item['mdid'] ?>" target="_blank">编辑</a>]</td>
<td><?php <td><?php
if($item['status'] == 0) echo "初始"; if($item['status'] == 0) echo "初始";
if($item['status'] == -1) echo "取消审核"; if($item['status'] == -1) echo "取消审核";

View File

@ -51,40 +51,6 @@
</div> </div>
</form> </form>
<script> <script>
function send(){
var dom = "#submit";
var html = $(dom).html();
$.ajax({
'type':"POST",
'url':'/admin/review/reply/',
'data':'uuid=<?= $this->uuid?>&send=1',
'success':function(data){
if (typeof(data)=='object')
{
if(typeof(data.error)!='undefined')
{Alert(data.error);return false;}
if(typeof(data.msg)!='undefined')
{Alert(data.msg);}
if(typeof(data.invited)!='undefined')
{$('#expert_name_'+id).val('');$('#expert_email_'+id).val('');}
}
else{
Alert('出现错误,请稍后再试');
}
},
'timeout': 30000,
'error': function(){
Alert('处理中出现错误,请刷新页面后重试');
},
'beforeSend':function(){
$(dom).html('<img src="/images/ajax-load-small.gif" />处理中...');
$(dom).attr("disabled","disabled")
},
'complete':function(){
$(dom).html(html);$(dom).removeAttr("disabled");dom = null;
}
});
}
</script> </script>
</div> </div>
</div> </div>