merge heihedata branch to trunk from r4083 to r4095

This commit is contained in:
wlx 2013-11-20 10:03:16 +00:00
parent 012b56501e
commit 491621e821
13 changed files with 62 additions and 10 deletions

View File

@ -761,7 +761,7 @@ class Admin_ReviewController extends Zend_Controller_Action
if (is_numeric($ids))
{
$sql="select distinct u.email,m.title,m.uuid from mdstatus s left join metadata m on s.uuid=m.uuid
left join mdauthor a on s.uuid=a.uuid left join users u on a.userid=u.id where s.id=? order by u.email";
right join mdauthor a on s.uuid=a.uuid left join users u on a.userid=u.id where s.id=? order by u.email";
$rs=$this->db->query($sql,array($ids));
$rows=$rs->fetchAll();
if ($rows)

View File

@ -618,7 +618,7 @@ class DataController extends Zend_Controller_Action
$sql=$this->db->quoteInto($sql,$uuid);
$this->view->themeref=$this->db->fetchAll($sql);
//用户发表文献
$sql="select r.* from reference r left join mdref m on m.refid=r.id where m.uuid=? and m.reftype=1";
$sql="select r.* from reference r left join mdref m on m.refid=r.id where m.uuid=? and m.reftype=1 order by r.language asc,r.year desc,r.ts_created desc limit 15";
$sql=$this->db->quoteInto($sql,$uuid);
$this->view->userref=$this->db->fetchAll($sql);
//多篇引用形式hiwater

View File

@ -42,7 +42,16 @@ class KnowledgeController extends Zend_Controller_Action
function userAction()
{
$sql="select * from reference where id in (select refid from mdref where reftype=1 and uuid in (select uuid from normalmetadata)) order by year desc, reference desc";
$uuid=$this->_request->getParam('uuid');
if (preg_match('/([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/',$uuid))
{
$sql="select uuid,title from metadata where uuid='$uuid'";
$sth = $this->db->prepare($sql);
$sth->execute();
$this->view->md = $sth->fetch();
$sql="select * from reference where id in (select refid from mdref where reftype=1 and uuid='$uuid') order by year desc, reference desc";
} else
$sql="select * from reference where id in (select refid from mdref where reftype=1 and uuid in (select uuid from normalmetadata)) order by year desc, reference desc";
$sth = $this->db->prepare($sql);
$sth->execute();
$rows = $sth->fetchAll();

View File

@ -1667,6 +1667,8 @@ class ServiceController extends Zend_Controller_Action
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
$uuid=$this->_request->getParam('uuid');
//文献id
$id=(int)$this->_request->getParam('id');
$lang=$this->_request->getParam('lang');
$ris='';
if ($lang=='cn' && !empty($uuid))
@ -1708,6 +1710,10 @@ class ServiceController extends Zend_Controller_Action
$ris.='M3 - doi:'.$row['doi']."\r\n";
$ris.='DO - doi:'.$row['doi']."\r\n";
$ris.='ER -'."\r\n";
} else if ($id) {
$sql="select ris from reference where id=$id";
$row=$this->db->fetchRow($sql);
$ris=$row['ris'];
}
if (!empty($ris))
{

View File

@ -100,6 +100,10 @@ if ($md->title_en) echo '<br />'.$this->escape($md->title_en);?>
}
echo "</li>";
endforeach;
if (count($this->userref)==15)
{
echo '<a class="btn btn-danger pull-right" href="/knowledge/user/uuid/'.$md->uuid.'" ><i class="icon-info-sign"></i>更多施引文献</a>';
}
?>
</ol>
<?php endif; ?>

View File

@ -122,6 +122,10 @@ if ($md->title_en) echo '<br />'.$this->escape($md->title_en);?>
}
echo "</li>";
endforeach;
if (count($this->userref)==15)
{
echo '<a class="btn btn-danger pull-right" href="/knowledge/user/uuid/'.$md->uuid.'" ><i class="icon-info-sign"></i>更多施引文献</a>';
}
?>
</ol>
<?php endif; ?>

View File

@ -120,6 +120,10 @@ if ($md->title_en) echo '<br />'.$this->escape($md->title_en);?>
}
echo "</li>";
endforeach;
if (count($this->userref)==15)
{
echo '<a class="btn btn-danger pull-right" href="/knowledge/user/uuid/'.$md->uuid.'" ><i class="icon-info-sign"></i>更多施引文献</a>';
}
?>
</ol>
<?php endif; ?>

View File

@ -66,9 +66,8 @@ $this->headLink()->appendStylesheet('/css/colorbox.css');
echo '<a href="'.$this->paper['link'].'"><i class="icon-download text-success"></i>PDF下载</a>';
}
if (!empty($item['link'])) :
echo ' <a href="'.$item['link'].'">下载</a>';
if (!empty($this->paper['ris'])) :
echo ' <a href="/service/ris/id/'.$this->paper['id'].'"><i class="icon-download text-success"></i>RIS下载</a>';
endif;
?>
<a href="javascript:;" onclick="showdata('<?php echo $this->paper['id'];?>',0)"><i class="icon-external-link text-success"></i>相关数据(共<span id="referenceDataCount"></span>条)</a>

View File

@ -17,6 +17,10 @@ $this->headLink()->appendStylesheet('/css/colorbox.css');
<div class="span9">
<div id="content">
<h2>数据施引文献库</h2>
<?php if ($this->md) :
echo '<h3><a href="/data/'.$this->md['uuid'].'"><i class="icon-folder-open text-success"></i>'.$this->md['title'].'</a></h3>';
endif;
?>
<div>
<?php if (count($this->paginator)): ?>
<ol start="<?php echo ($this->paginator->getCurrentPageNumber() - 1) * $this->paginator->getItemCountPerPage()+1; ?>">

View File

@ -101,6 +101,10 @@ h3.gs_rt{font-size:110%;}
}
echo "</li>";
endforeach;
if (count($this->userref)==15)
{
echo '<a class="btn btn-success pull-right" href="/knowledge/user/uuid/'.$md->uuid.'" ><i class="icon-info-sign"></i>更多施引文献</a>';
}
?>
</ol>
<?php endif; ?>

View File

@ -17,6 +17,8 @@ class Curl
), $options);
}
public $H;
/**
* Send a request to the server, receive a response
*
@ -70,6 +72,11 @@ class Curl
$headers[] = 'Content-Length: 0';
}
if(!empty($this->H) && is_array($this->H) && count($this->H) > 0)
{
$headers = array_merge($headers,$this->H);
}
$this->debug('send '.$httpMethod.' request: '.$url);
$curlOptions += array(

View File

@ -36,6 +36,11 @@ class RisHandler implements \Reference\Event\RisEvent
$wheresql = array();
if(preg_match("/\'/",$ref['title']))
{
$ref['title'] = preg_replace("/\'/","''",$ref['title']);
}
$wheresql[] = " lower(title)=lower('{$ref['title']}') ";
$wheresql[] = " year='{$ref['year']}' ";

View File

@ -277,7 +277,13 @@ class Ris
//创建reference 字段
public function makeReferenceFlag($ref){
$str = join(', ',$ref['author']).'. ';
$str='';
if(is_array($ref['author']) && count($ref['author']) > 0)
{
$str .= join(', ',$ref['author']).'. ';
} else if (is_string($ref['author'])) {
$str .= $ref['author'].'. ';
}
$str .= $ref['title'].'. ';
$str .= $ref['publisher'].', ';
isset($ref['year']) ? $str .= $ref['year'].', ':"";