添加待处理文献功能

This commit is contained in:
wlx 2013-10-22 13:40:41 +00:00
parent 4c95532808
commit 3628ece4c1
3 changed files with 38 additions and 1 deletions

View File

@ -1157,6 +1157,12 @@ class Admin_DataController extends Zend_Controller_Action
view::addPaginator($reference->fetchThemeReferences('water'),$this,10);
return true;
}
else if ($ac == "todo")
{
$this->view->referenceType = $reference->referenceType();
view::addPaginator($reference->fetchTodoReferences(),$this,10);
return true;
}
//添加
if($ac == "add")

View File

@ -1,6 +1,7 @@
<ul class="nav nav-tabs">
<li <?= empty($this->ac) ? 'class="active"':"" ?>><a href="/admin/data/ref">浏览所有</a></li>
<li <?= $this->ac=="water" ? 'class="active"':"" ?>><a href="/admin/data/ref/ac/water">WATER文献</a></li>
<li <?= $this->ac=="water" ? 'class="active"':"" ?>><a href="/admin/data/ref/ac/water">WATER文献</a></li>
<li <?= $this->ac=="todo" ? 'class="active"':"" ?>><a href="/admin/data/ref/ac/todo">待处理文献</a></li>
<li <?= $this->ac=="add" ? 'class="active"':"" ?>><a href="/admin/data/ref/ac/add">单篇添加</a></li>
<li <?= $this->ac=="multiupload" ? 'class="active"':"" ?>><a href="/admin/data/ref/ac/multiupload">批量上传</a></li>
<li <?= $this->ac=="files" ? 'class="active"':"" ?>><a href="/admin/data/ref/ac/files">文件管理</a></li>

View File

@ -228,6 +228,36 @@ class Reference
$rs=$this->db->query($sql);
return $rs->fetchAll();
}
//Get references which need to deal with
public function fetchTodoReferences()
{
$wheresql = array();
$wheresql[]=" r.uuid is not null ";
if(!empty($this->keyword))
{
$wheresql[] = " (ref.title LIKE '%{$this->keyword}%' OR ref.reference LIKE '%{$this->keyword}%') ";
}
if(count($wheresql)>0)
{
$wheresql = " WHERE ".join(" AND ",$wheresql);
}else{
$wheresql = "";
}
if(empty($this->order))
{
$order = "ref.year,ref.title";
}else{
$order = "ref.{$this->order} {$this->sort}";
}
$sql="select distinct ref.* from mdref r left join {$this->table->reference} ref on r.refid=ref.id
$wheresql
ORDER BY $order";
$rs=$this->db->query($sql);
return $rs->fetchAll();
}
//单条文献的信息
public function getOneReferenceData($id)