增加了查看在审元数据的功能

This commit is contained in:
Li Jianxuan 2011-10-13 09:30:53 +00:00
parent 43434c27f2
commit 9883620c8e
3 changed files with 133 additions and 3 deletions

View File

@ -64,7 +64,7 @@ class ReviewController extends Zend_Controller_Action
} }
$wheresql = array(); $wheresql = array();
$wheresql[]=" mdexp.id=7381 "; $wheresql[]=" mdexp.id='$uid' ";
if(!empty($keyword) && !empty($search)) if(!empty($keyword) && !empty($search))
{ {
@ -115,7 +115,7 @@ class ReviewController extends Zend_Controller_Action
if (preg_match("/[<|>|#|$|%|^|*|(|)|{|}|'|\"|;|:]/i",$keyword) || !is_numeric($search)) if (preg_match("/[<|>|#|$|%|^|*|(|)|{|}|'|\"|;|:]/i",$keyword) || !is_numeric($search))
{ {
$this->messenger->addMessage('您的输入的搜索条件包含非法请求,请不要输入特殊符号'); $this->messenger->addMessage('您的输入的搜索条件包含非法请求,请不要输入特殊符号');
$this->_redirect('/review/myreview'); $this->_redirect('/review/draft');
}//非法请求过滤 }//非法请求过滤
$this->view->keyword = $keyword; $this->view->keyword = $keyword;
$wheresql[] = " md.title like '%$keyword%' "; $wheresql[] = " md.title like '%$keyword%' ";
@ -144,5 +144,74 @@ class ReviewController extends Zend_Controller_Action
}//最新收稿 }//最新收稿
function inreviewAction(){
$keyword = $this->_request->getParam('q');
$search = $this->_request->getParam('search');
try{
$wheresql = array();
$wheresql[]=" ms.status in (2,3,4) ";
if(!empty($keyword) && !empty($search))
{
if (preg_match("/[<|>|#|$|%|^|*|(|)|{|}|'|\"|;|:]/i",$keyword) || !is_numeric($search))
{
$this->messenger->addMessage('您的输入的搜索条件包含非法请求,请不要输入特殊符号');
$this->_redirect('/review/inreview');
}//非法请求过滤
$this->view->keyword = $keyword;
$wheresql[] = " md.title like '%$keyword%' ";
}
$wheresql = join(' and ',$wheresql);
$sql = "select ms.uuid,ms.status,ms.ts_created,md.title,md.author from mdstatus ms
left join metadata md on md.uuid=ms.uuid
where $wheresql";
$rs = $this->db->query($sql);
$rows = $rs->fetchAll();
foreach($rows as $k=>$v)
{
$rows[$k]['status']=$this->rewiterstatus($v['status']);
}
$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_param.phtml');
$this->view->paginator=$paginator;
}catch(Exception $e){
$this->messenger->addMessage('查询失败,请稍后重试 :(');
$this->_redirect('/review/inreview');
}
}//在审阶段的元数据
function rewiterstatus($status){
if($status==-1)
{return "取消评审";}
else if($status==0)
{return "初始状态";}
else if($status==1)
{return "接受元数据评审";}
else if($status==2)
{return "专家评审中";}
else if($status==3)
{return "专家评审中";}
else if($status==4)
{return "专家反馈";}
else if($status==5)
{return "已发布";}
else
{return "";}
}//function rewriterstatus
} }

View File

@ -25,7 +25,7 @@ setTimeout("document.getElementsByClassName('box-info').remove(0)",5000);
<h3>最新收稿的元数据:</h3> <h3>最新收稿的元数据:</h3>
<form action="/review/myreview" method="POST"> <form action="/review/draft" method="POST">
<input class="" type="text" id="q" name="q" value="<?php echo $this->keyword;?>" /> <input class="" type="text" id="q" name="q" value="<?php echo $this->keyword;?>" />
<input type="hidden" name="search" value="1" /> <input type="hidden" name="search" value="1" />
<input type="submit" value="搜索" /></form> <input type="submit" value="搜索" /></form>

View File

@ -0,0 +1,61 @@
<?php
$config = Zend_Registry::get('config');
$this->headTitle($config->title->site);
$this->headTitle($config->title->mdreview);
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/mdreview.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/review">元数据评审</a>');
$this->breadcrumb()->setSeparator(' > ');
?>
<div id='rightPanel'>
<?php if ($this->msg or $this->messages) :?>
<div class="box box-info">
<?php if ($this->msg) : ?>
<?php echo $this->msg; ?>
<?php endif; if ($this->messages): foreach($this->messages as $msg): ?>
<?php echo $msg; ?>
<?php endforeach;endif; ?>
<script language="javascript">
setTimeout("document.getElementsByClassName('box-info').remove(0)",5000);
</script>
</div>
<?php endif; ?>
<h3>目前在审的元数据:</h3>
<form action="/review/inreview" method="POST">
<input class="" type="text" id="q" name="q" value="<?php echo $this->keyword;?>" />
<input type="hidden" name="search" value="1" />
<input type="submit" value="搜索" /></form>
<table>
<thead>
<tr>
<th>元数据标题</th>
<th>收稿时间</th>
<th>状态</th>
</tr>
</thead>
<tbody>
<?php
if (count($this->paginator)):
$autoindex=0;
foreach ($this->paginator as $item):
$autoindex++;?>
<tr class="<?php if($autoindex%2 == 0) echo 'even'; else echo 'odd'; ?>">
<td> <img src="/images/westdc_20w.gif" /> <a href="<?php echo $item['uuid'];?>"><?php echo $item['title'];?></a></td>
<td>
<?php echo date("Y-m-d",strtotime($item['ts_created']));?>
</td>
<td>
<?php echo $item['status'];?>
</td>
</tr>
<?php endforeach; endif; ?>
</tbody>
</table>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div>