merge heihedata branch from r3748 to r3758.

This commit is contained in:
wlx 2013-06-25 01:01:35 +00:00
parent ade674438e
commit 88548c6a97
4 changed files with 122 additions and 108 deletions

View File

@ -6,6 +6,7 @@
@license http:// @license http://
@link http:// @link http://
*/ */
include_once("data/Author.php");
class AuthorController extends Zend_Controller_Action class AuthorController extends Zend_Controller_Action
{ {
private $limit=10; private $limit=10;
@ -2763,41 +2764,40 @@ class AuthorController extends Zend_Controller_Action
//添加文献信息 //添加文献信息
else if($ac == "add") else if($ac == "add")
{ {
$submit = $this->_request->getParam('submit'); $submit = $this->_request->getParam('submit');
if(!empty($submit)) if(!empty($submit))
{ {
$this->_helper->layout->disableLayout(); $this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender(); $this->_helper->viewRenderer->setNoRender();
$data = ""; $data = "";
try{ try{
$uuid = $this->_request->getParam('uuid'); $uuid = $this->_request->getParam('uuid');
$ref=$this->_request->getParam('ref'); $ref=$this->_request->getParam('ref');
$reftype=$this->_request->getParam('reftype'); $reftype=$this->_request->getParam('reftype');
$url = $this->_request->getParam('url'); $url = $this->_request->getParam('url');
if(empty($uuid) || empty($ref) || !is_numeric($reftype))
{ if(empty($uuid) || empty($ref) || !is_numeric($reftype))
{
$data = array("error"=>"参数错误"); $data = array("error"=>"参数错误");
$this->jsonexit($data); $this->jsonexit($data);
return true; return true;
} }
$sql="select * from mdauthor where userid=? and uuid=? and status=1"; $author = new Author($this->db);
$sth = $this->db->prepare($sql); if(!$author->checkAuthor($uuid))
$sth->execute(array($u_id,$uuid)); {
$row = $sth->fetch();
if (empty($row))
{
$data = array("error"=>$this->alertbox('warning','您不是该数据作者,无法添加对应文献信息。')); $data = array("error"=>$this->alertbox('warning','您不是该数据作者,无法添加对应文献信息。'));
$this->jsonexit($data); $this->jsonexit($data);
return true; return true;
} }
$sql="select id from reference where reference=?"; $sql="select id from reference where reference=?";
$sth = $this->db->prepare($sql); $sth = $this->db->prepare($sql);
$sth->execute(array($ref)); $sth->execute(array($ref));
$row = $sth->fetch(); $row = $sth->fetch();
if (!$row)
if(empty($row['id']))
{ {
$sql="insert into reference (reference,link) values(?,?)"; $sql="insert into reference (reference,link) values(?,?)";
$sth = $this->db->prepare($sql); $sth = $this->db->prepare($sql);
@ -2811,7 +2811,7 @@ class AuthorController extends Zend_Controller_Action
$sth = $this->db->prepare($sql); $sth = $this->db->prepare($sql);
$ex=$sth->execute(array($uuid,$row['id'],$reftype)); $ex=$sth->execute(array($uuid,$row['id'],$reftype));
if($ex) if($ex)
{ {
$data = array("commited"=>1,"error"=>$this->alertbox('ok','成功添加文献!')); $data = array("commited"=>1,"error"=>$this->alertbox('ok','成功添加文献!'));
$this->jsonexit($data); $this->jsonexit($data);
@ -2821,8 +2821,9 @@ class AuthorController extends Zend_Controller_Action
$this->jsonexit($data); $this->jsonexit($data);
return true; return true;
} }
}catch(Exception $e) {
$msg = "提交失败,请确认权限后重试"; }catch(Exception $e) {
$msg = "提交失败,您提交的数据可能已经存在";
if($this->debug>0) if($this->debug>0)
{$msg .= $e->getMessage();} {$msg .= $e->getMessage();}
$data = array("error"=>$this->alertbox('error',$msg)); $data = array("error"=>$this->alertbox('error',$msg));

View File

@ -190,16 +190,23 @@ class HiwaterController extends DataController
{ {
$this->getmd(array('','自动气象站')); $this->getmd(array('','自动气象站'));
$this->_helper->viewRenderer('base'); $this->_helper->viewRenderer('base');
$archive = new Archive($this->db);
$this->view->info = $archive->getOneArchive('HiWATER-通量观测矩阵','about');
} }
function ecAction() function ecAction()
{ {
$this->getmd(array('','涡动相关仪')); $this->getmd(array('','涡动相关仪'));
$this->_helper->viewRenderer('base'); $this->_helper->viewRenderer('base');
$archive = new Archive($this->db);
$this->view->info = $archive->getOneArchive('HiWATER-通量观测矩阵','about');
} }
function lasAction() function lasAction()
{ {
$this->getmd(array('','大孔径闪烁仪')); $this->getmd(array('','大孔径闪烁仪'));
$this->_helper->viewRenderer('base'); $this->_helper->viewRenderer('base');
$archive = new Archive($this->db);
$this->view->info = $archive->getOneArchive('HiWATER-通量观测矩阵','about');
} }
function precAction() function precAction()
{ {
@ -289,6 +296,8 @@ class HiwaterController extends DataController
{ {
$this->getmd(array('自动气象站','涡动相关仪','大孔径闪烁仪','稳定同位素观测系统','热扩散液流计TDP','宇宙射线土壤水分')); $this->getmd(array('自动气象站','涡动相关仪','大孔径闪烁仪','稳定同位素观测系统','热扩散液流计TDP','宇宙射线土壤水分'));
$this->_helper->viewRenderer('base'); $this->_helper->viewRenderer('base');
$archive = new Archive($this->db);
$this->view->info = $archive->getOneArchive('HiWATER-通量观测矩阵','about');
} }
function isotopeAction() function isotopeAction()

View File

@ -2,6 +2,7 @@
$this->headTitle($this->config->title->site); $this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->author); $this->headTitle($this->config->title->author);
$this->headTitle()->setSeparator(' - '); $this->headTitle()->setSeparator(' - ');
$this->theme->AppendPlus($this,'colorbox');
$this->headLink()->appendStylesheet('/css/author.css'); $this->headLink()->appendStylesheet('/css/author.css');
$this->breadcrumb('<a href="/">首页</a>'); $this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/author">数据作者</a>'); $this->breadcrumb('<a href="/author">数据作者</a>');
@ -36,7 +37,7 @@ $this->breadcrumb()->setSeparator(' > ');
<a href="/author/comment/ac/view/uuid/<?php echo $item['uuid']; ?>">反馈</a> | <a href="/author/comment/ac/view/uuid/<?php echo $item['uuid']; ?>">反馈</a> |
<a href="/author/document/uuid/<?php echo $item['uuid']; ?>">文档</a> | <a href="/author/document/uuid/<?php echo $item['uuid']; ?>">文档</a> |
<a href="/author/literature/uuid/<?php echo $item['uuid']; ?>">文献</a> | <a href="/author/literature/uuid/<?php echo $item['uuid']; ?>">文献</a> |
<a href="/author/literature/ac/add/uuid/<?php echo $item['uuid']; ?>">添加文献</a> | <a href="/author/literature/ac/add/uuid/<?php echo $item['uuid']; ?>" class="more iframe">添加文献</a> |
<a href="/service/geonetwork?url=metadata.edit?id=<?php echo $item['gid']; ?>" target="_blank">修改元数据</a> | <a href="/service/geonetwork?url=metadata.edit?id=<?php echo $item['gid']; ?>" target="_blank">修改元数据</a> |
<a href="/author/version/uuid/<?php echo $item['uuid']; ?>">版本</a> | <a href="/author/version/uuid/<?php echo $item['uuid']; ?>">版本</a> |
<a href="/author/qa/uuid/<?php echo $item['uuid']; ?>">QA</a> | <a href="/author/qa/uuid/<?php echo $item['uuid']; ?>">QA</a> |
@ -73,3 +74,6 @@ $this->breadcrumb()->setSeparator(' > ');
</div> </div>
</div> </div>
<script>
$(".iframe").colorbox({iframe:true, width:"60%", height:"80%"});
</script>

View File

@ -105,7 +105,7 @@
<div class="accordion-heading" id="Nav-hiwater-mso"> <div class="accordion-heading" id="Nav-hiwater-mso">
<a href="/hiwater/mso" title="查看详细" class="pull-right detail-link"><i class="icon-arrow-right"></i></a> <a href="/hiwater/mso" title="查看详细" class="pull-right detail-link"><i class="icon-arrow-right"></i></a>
<a class="accordion-toggle" data-toggle="collapse" data-parent="#side_accordion" href="#collapse6"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#side_accordion" href="#collapse6">
地表蒸散发的多尺度观测试验 非均匀下垫面地表蒸散发的多尺度观测试验
</a> </a>
</div> </div>
<div id="collapse6" class="accordion-body collapse"> <div id="collapse6" class="accordion-body collapse">