修改了元数据放入评审库的步骤,增加了投稿元数据的查看功能

This commit is contained in:
Li Jianxuan 2011-10-10 07:52:42 +00:00
parent 08b268a605
commit 1c6b29f20e
2 changed files with 129 additions and 4 deletions

View File

@ -296,16 +296,16 @@ class Admin_ReviewController extends Zend_Controller_Action
{ {
$user = $auth->getIdentity(); $user = $auth->getIdentity();
$userid = $user->id; $userid = $user->id;
$sql = "insert into mdstatus (uuid,userid,ts_scheduled,status) values ('$uuid','$userid','".date("Y-m-d H:i:s")."','1')"; $sql = "insert into mdstatus (uuid,userid,ts_scheduled,status) values ('$uuid','$userid','".date("Y-m-d H:i:s")."','0')";
try{ try{
if($this->db->exec($sql)>0) if($this->db->exec($sql)>0)
{ {
$this->messenger->addMessage('操作成功!该数据已放入评审'); $this->messenger->addMessage('操作成功!该数据已放入评审');
$this->_redirect("/admin/review"); $this->_redirect("/admin/review/draft");
} }
}catch( Exception $e){ }catch( Exception $e){
$this->messenger->addMessage('操作失败:'.$e->getMessage()); $this->messenger->addMessage('操作失败:'.$e->getMessage());
$this->_redirect("/admin/review"); $this->_redirect("/admin/review/draft");
} }
} }
@ -353,6 +353,66 @@ class Admin_ReviewController extends Zend_Controller_Action
$this->view->paginator=$paginator; $this->view->paginator=$paginator;
}//我管理的元数据 }//我管理的元数据
function draftAction(){
$search=$this->_request->getParam('search');
$keyword = $this->_request->getParam('keyword');
$update = $this->_request->getParam('update');
if($update>0 || is_array($update))
{
$ids = '';
if(is_array($update))$ids = join(',',$update);
else $ids=$update;
$sql = "update mdstatus set status=1 where id in ($ids)";
try{
if($this->db->exec($sql)>0)
{
$this->messenger->addMessage('操作成功!');
$this->_redirect("/admin/review/draft");
}
}catch(Exception $e){
$this->messenger->addMessage('操作失败:'.$e->getMessage());
$this->_redirect("/admin/review/draft");
}
}//开始评审
$searchjoin = "";
if(!empty($search) && !empty($keyword))
{
$searchjoin = " and md.title like '%$keyword%'";
$this->view->keyword = $keyword;
}
$sql = "select m.id,md.title,md.uuid,u.username,u.realname,m.status from mdstatus m
left join metadata md on md.uuid=m.uuid
left join users u on u.id=m.userid
where status=0 $searchjoin";
$re = $this->db->query($sql);
$rows = $re->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;
}// draftAction 投稿元数据
function expertsAction() function expertsAction()
{ {
@ -532,6 +592,5 @@ class Admin_ReviewController extends Zend_Controller_Action
}//expertsAction 专家库 }//expertsAction 专家库
} }

View File

@ -0,0 +1,66 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/admin.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/admin">后台首页</a>');
$this->breadcrumb('元数据评审');
$this->breadcrumb()->setSeparator(' > ');
?>
<div id="divContent">
<div id="leftPanel">
<?= $this->partial('review/left.phtml'); ?>
</div>
<div id="rightPanel">
<?php if ($this->msg or $this->messages) :?>
<div id="message">
<?php if ($this->msg) : ?>
<p><?php echo $this->msg; ?></p>
<?php endif; if ($this->messages): foreach($this->messages as $msg): ?>
<p><?php echo $msg; ?></p>
<?php endforeach;endif; ?>
</div>
<?php endif; ?>
<div id="rightPanel">
<div class="search">
<form action="" method="get">
<input type="hidden" name="search" value='1' />
<input type="hidden" name="id" value='<?php echo $this->id;?>' />
<ul>
<li><label>搜索关键字</label><input type="text" name="keyword" value="<?php echo $this->keyword; ?>" /></li>
<li><input type="submit" class="searchbtn" value="搜索" /></li>
</ul>
</form>
</div><!-- search DIV -->
<form action="" method="post">
<table>
<tr style="color:#FFF;background:#0a3e68;line-height:30px;">
<td width='40'>选择</td>
<td width='600'>标题</td>
<td width="150">操作</td>
</tr>
<?php if (count($this->paginator)): ?>
<?php $autoindex=0;?>
<?php foreach ($this->paginator as $item): ?>
<?php $autoindex++;?>
<tr <?php if($autoindex%2 == 0) echo 'bgcolor="#CCCCCC"'; else echo 'bgcolor="#FFFFFF"'; ?>>
<td><input type="checkbox" name="update[]" value="<?php echo $item['id']; ?>"/></td>
<td><a href="/data/<?php echo $item['uuid'];?>"><?php echo $item['title']; ?></a></td>
<td><a href="/admin/review/draft/update/<?php echo $item['id']; ?>">开始评审</a></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</table>
<input type="submit" value="开始评审已选择的元数据" />
</form>
<div style="width:50%;text-align:left;">
<?= $this->paginator; ?></div>
</div>
</div>
</div>