数据作者功能翻译

This commit is contained in:
wlx 2014-06-24 10:20:36 +00:00
parent 98cf5afac3
commit eed79dc33a
7 changed files with 82 additions and 80 deletions

View File

@ -38,7 +38,7 @@ class AuthorController extends Zend_Controller_Action
{
$this->view->pageID = "author-index";
$archives=new Archive($this->db);
$this->view->item=$archives->getOneArchive('数据作者介绍','help');
$this->view->item=$archives->getOneArchive('How to submit data into CARD','help');
}
@ -75,7 +75,7 @@ class AuthorController extends Zend_Controller_Action
if(empty($ac) || $ac=="online" || $ac == "searchonline")
{
$sql = "SELECT o.id,o.userid,o.unit,o.username,o.ts_created,o.project,m.title,m.uuid FROM onlineapp as o
LEFT JOIN metadata as m ON o.uuid=m.uuid
LEFT JOIN en.metadata as m ON o.uuid=m.uuid
LEFT JOIN mdauthor as a ON a.uuid=o.uuid
WHERE (o.id in (SELECT distinct(onlineappid) from dataorder where status>=0)) AND a.userid = ? AND a.status=1";
if ($ac=="searchonline")
@ -117,13 +117,13 @@ class AuthorController extends Zend_Controller_Action
if(!preg_match("/^[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12}$/",$uuid))
{
echo "参数有误!";exit();
echo "Wrong parameter!";exit();
}
//如果用户已经下载过了,就无法在更改对数据申请的意见
$sql = "select md.title,d.uuid,d.status as datastatus,d.authorpermitted from dataorder d
left join offlineapp o on o.id=d.offlineappid
left join metadata md on md.uuid=d.uuid
left join en.metadata md on md.uuid=d.uuid
left join mdauthor a on a.uuid=d.uuid
where o.ts_approved is null and o.pdflink is not null
and d.uuid=? and a.userid=? and d.id=? AND a.status=1
@ -135,12 +135,12 @@ class AuthorController extends Zend_Controller_Action
if($row['datastatus']>4)
{
echo "该申请已经通过并且发放数据";
echo "Order has been approved.";
exit();
}
else if (empty($row) || $row['datastatus']!=4)
{
echo "该数据申请存在问题,请联系数据中心!";
echo "Problems found, please contact CARD via email.";
exit();
}
@ -152,7 +152,7 @@ class AuthorController extends Zend_Controller_Action
if($sth->execute(array($uuid,$oid)))
{
//发送相关邮件给数据中心服务人员
$sql="select m.title,a.username from dataorder o left join metadata m on o.uuid=m.uuid left join offlineapp a on o.offlineappid=a.id where o.id=?";
$sql="select m.title,a.username from dataorder o left join en.metadata m on o.uuid=m.uuid left join offlineapp a on o.offlineappid=a.id where o.id=?";
$sth = $this->db->prepare($sql);
$sth->execute(array($oid));
$row = $sth->fetch();
@ -341,10 +341,10 @@ class AuthorController extends Zend_Controller_Action
$baseStyle = "btn box-shadow";
$selectedStyle = "disabled";
$confrimText = "同意";
$confrimText = "Agree";
$confrimFunc = 'onclick="confirm(\''.$uuid.'\',\''.$oid.'\')"';
$objectionText = "反对";
$objectionText = "NOT Agree";
$objectionFunc = 'onclick="objection(\''.$uuid.'\',\''.$oid.'\')"';
$btns='';
@ -396,10 +396,10 @@ class AuthorController extends Zend_Controller_Action
//列表
if(empty($ac) || $ac=='list' || $ac=='search'){
$sql = "SELECT a.*,m.title,m.description,g.id as gid,mds.status as mdstatus FROM normalmetadata m
$sql = "SELECT a.*,m.title,m.description,g.id as gid,mds.status as mdstatus FROM en.normalmetadata m
LEFT JOIN mdauthor a ON m.uuid=a.uuid
LEFT JOIN geonetworkmetadata g on m.uuid=g.uuid
LEFT JOIN mdstatus mds ON m.uuid=mds.uuid
LEFT JOIN en.geonetworkmetadata g on m.uuid=g.uuid
LEFT JOIN en.mdstatus mds ON m.uuid=mds.uuid
WHERE a.userid=? AND a.status>=0 ";
if ($ac=='search')
{
@ -433,7 +433,7 @@ class AuthorController extends Zend_Controller_Action
try{
$sql = "SELECT a.id,a.activation,a.ts_created,a.ts_activated,md.title,a.uuid,u.id as userid,u.realname,u.email FROM mdauthor a
LEFT JOIN metadata md ON a.uuid=md.uuid
LEFT JOIN en.metadata md ON a.uuid=md.uuid
LEFT JOIN users u ON a.userid=u.id
WHERE a.activation=?";
@ -2236,8 +2236,8 @@ class AuthorController extends Zend_Controller_Action
//查看属于自己的所有的未提交数据列表
else if((empty($ac) && empty($uuid))|| $ac=='list')
{
$sql = "SELECT (regexp_matches(gn.data,'<resTitle>(.*)</resTitle>'))[1] as title,gn.id,gn.uuid FROM geonetworkmetadata gn
WHERE gn.uuid not in (select uuid from metadata) and gn.owner=?
$sql = "SELECT (regexp_matches(gn.data,'<resTitle>(.*)</resTitle>'))[1] as title,gn.id,gn.uuid FROM en.geonetworkmetadata gn
WHERE gn.uuid not in (select uuid from en.metadata) and gn.owner=?
order by gn.id desc
";
$sth = $this->db->prepare($sql);
@ -2286,8 +2286,8 @@ class AuthorController extends Zend_Controller_Action
else if($ac=="add-by-data")
{
$keywords = $this->_request->getParam('q');
$sql = "SELECT md.title,md.uuid,md.description,gn.id as gid FROM normalmetadata md
left join geonetworkmetadata gn on md.uuid=gn.uuid
$sql = "SELECT md.title,md.uuid,md.description,gn.id as gid FROM en.normalmetadata md
left join en.geonetworkmetadata gn on md.uuid=gn.uuid
WHERE gn.id is not null";
if(!empty($keywords))
{
@ -2320,7 +2320,7 @@ class AuthorController extends Zend_Controller_Action
$id = $this->_request->getParam('id');
if(empty($id) || !is_numeric($id))
{
$data = array("error"=>"参数错误");
$data = array("error"=>"Wrong parameter");
$this->jsonexit($data);
return true;
}
@ -2328,15 +2328,15 @@ class AuthorController extends Zend_Controller_Action
$changelog = $this->_request->getParam('changelog');
if(empty($changelog))
{
$data = array("error"=>$this->alertbox('warning','请输入变更信息'));
$data = array("error"=>$this->alertbox('warning','Please add log:'));
$this->jsonexit($data);
return true;
}
// 1. 权限认定当前用户必须和其owner相同
// 数据应当没有评审状态,没有作者信息
$sql="select gn.id from geonetworkmetadata gn
left join mdstatus s on gn.uuid=s.uuid
$sql="select gn.id from en.geonetworkmetadata gn
left join en.mdstatus s on gn.uuid=s.uuid
left join mdauthor a on s.uuid=a.uuid
where s.id is not null and a.id is not null and gn.id=?";
$sth=$this->db->prepare($sql);
@ -2349,13 +2349,13 @@ class AuthorController extends Zend_Controller_Action
return true;
}
$sql="select uuid,data from metadata where id=? and owner=?";
$sql="select uuid,data from en.metadata where id=? and owner=?";
$sth=$this->wdb->prepare($sql);
$sth->execute(array($id,$u_id));
$row=$sth->fetch();
if (empty($row))
{
$data = array("error"=>'无权限修改数据');
$data = array("error"=>'No edit rights.');
$this->jsonexit($data);
return true;
}
@ -2364,7 +2364,7 @@ class AuthorController extends Zend_Controller_Action
@$iso->loadXML($row['data']);
if ($iso->validate())
{
$data=array("error"=>"元数据导入过程中发现错误。<br />".implode("<br />",$iso->error));
$data=array("error"=>"Errors found in import metadata.<br />".implode("<br />",$iso->error));
$this->jsonexit($data);
return true;
}

View File

@ -4,7 +4,7 @@ $this->headTitle($this->config->title->author);
$this->headTitle()->setSeparator(' - ');
$this->headScript()->appendFile('/js/jquery-1.7.min.js');
$this->headLink()->appendStylesheet('/css/author.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/">Home</a>');
$this->breadcrumb($this->config->title->author);
$this->breadcrumb()->setSeparator(' > ');
?>

View File

@ -1,20 +1,22 @@
<div class="sidebar-nav bs-review-nav">
<ul class="nav nav-list bs-review-sidenav">
<li id="Nav-author-index"><a href="/author/"><i class="icon-chevron-right"></i>介绍</a></li>
<li id="Nav-author-newdata"><a href="/author/newdata"><i class="icon-chevron-right"></i>新建数据</a></li>
<li id="Nav-author-apply"><a href="/author/apply"><i class="icon-chevron-right"></i>数据认证</a></li>
<li id="Nav-author-accept"><a href="/author/accept"><i class="icon-chevron-right"></i>我的数据</a></li>
<li id="Nav-author-inauthor"><a href="/author/inauthor"><i class="icon-chevron-right"></i>数据申请管理</a></li>
<li id="Nav-author-comment"><a href="/author/comment"><i class="icon-chevron-right"></i>数据反馈管理</a></li>
<li id="Nav-author-literature"><a href="/author/literature"><i class="icon-chevron-right"></i>数据文献管理</a></li>
<li id="Nav-author-document"><a href="/author/document"><i class="icon-chevron-right"></i>数据文档管理</a></li>
<li id="Nav-author-news"><a href="/author/news"><i class="icon-chevron-right"></i>数据新闻管理</a></li>
<li id="Nav-author-version"><a href="/author/version"><i class="icon-chevron-right"></i>数据版本管理</a></li>
<li id="Nav-author-fund"><a href="/author/fund/ac/data"><i class="icon-chevron-right"></i>支持项目</a></li>
<li id="Nav-author-doi"><a href="/author/doi"><i class="icon-chevron-right"></i>DOI</a></li>
<li id="Nav-author-index"><a href="/author/"><i class="icon-chevron-right"></i>Introduce</a></li>
<li id="Nav-author-newdata"><a href="/author/newdata"><i class="icon-chevron-right"></i>Submit data</a></li>
<li id="Nav-author-accept"><a href="/author/accept"><i class="icon-chevron-right"></i>My datasets</a></li>
<!--
<li id="Nav-author-apply"><a href="/author/apply"><i class="icon-chevron-right"></i>数据认证</a></li>
<li id="Nav-author-inauthor"><a href="/author/inauthor"><i class="icon-chevron-right"></i>数据申请管理</a></li>
<li id="Nav-author-comment"><a href="/author/comment"><i class="icon-chevron-right"></i>数据反馈管理</a></li> -->
<li id="Nav-author-literature"><a href="/author/literature"><i class="icon-chevron-right"></i>Data publications</a></li>
<li id="Nav-author-document"><a href="/author/document"><i class="icon-chevron-right"></i>Data document</a></li>
<li id="Nav-author-news"><a href="/author/news"><i class="icon-chevron-right"></i>Data news</a></li>
<li id="Nav-author-version"><a href="/author/version"><i class="icon-chevron-right"></i>Data versions</a></li>
<!--
<li id="Nav-author-doi"><a href="/author/doi"><i class="icon-chevron-right"></i>DOI</a></li>
<li id="Nav-author-fund"><a href="/author/fund/ac/data"><i class="icon-chevron-right"></i>支持项目</a></li>
<li><a href="/author/survey">数据调查</a></li>
<li><a href="/author/qa">数据QA</a></li> -->
<li><a href="/author/qa">数据QA</a></li>
<li id="Nav-author-statics"><a href="/author/statics"><i class="icon-chevron-right"></i>信息统计</a></li>
-->
</ul>
</div>

View File

@ -4,9 +4,9 @@ $this->headTitle($this->config->title->author);
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/author.css');
$this->theme->AppendPlus($this,'colorbox');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/author">数据作者</a>');
$this->breadcrumb('新建数据');
$this->breadcrumb('<a href="/">Home</a>');
$this->breadcrumb('<a href="/author">Author</a>');
$this->breadcrumb('Submit data');
$this->breadcrumb()->setSeparator(' > ');
?>
<div class="row">
@ -17,19 +17,19 @@ $this->breadcrumb()->setSeparator(' > ');
<div>
<ul class="nav nav-pills">
<li class=""><a href="/author/newdata">未提交数据列表</a></li>
<li class=""><a class="iframe" href="/service/geonetwork?url=metadata.xmlinsert.form">导入元数据</a></li>
<li class=""><a href="/author/newdata/ac/add-by-template">根据模板新建元数据</a></li>
<li class="active"><a href="/author/newdata/ac/add-by-data">根据已有数据新建元数据</a></li>
<li class=""><a href="/author/newdata">Unsubmitted</a></li>
<li class=""><a class="iframe" href="/service/geonetwork?url=metadata.xmlinsert.form">Import new metadata</a></li>
<li class=""><a href="/author/newdata/ac/add-by-template">Create new metadata with templates</a></li>
<li class="active"><a href="/author/newdata/ac/add-by-data">Create new metadata with existed metadata</a></li>
</ul>
</div>
<div>
<h2>根据已有数据创建元数据</h2>
<h2>Create new metadata with existed metadata</h2>
<div class="input-append">
<form id="datasearch" class="search_form" action="/author/newdata/ac/add-by-data">
<input type="text" id="keyword" name="q" value="<?php if(!empty($this->q)) echo $this->q; ?>" />
<button type="submit" class="btn" id="search_btn">搜索</button>
<button type="submit" class="btn" id="search_btn">Search</button>
</form>
</div>
<?php
@ -41,8 +41,8 @@ $this->breadcrumb()->setSeparator(' > ');
?>
<li class="well">
<h4><?php echo $item['title'];?></h4>
<p><a href="/service/geonetwork?url=metadata.create?group=2<?php echo urlencode('&id='.$item['gid']); ?>" target="_blank">以此为模板新建</a>
| <a href="/data/<?php echo $item['uuid'];?>" target="_blank">查看数据</a></p>
<p>[<a href="/service/geonetwork?url=metadata.create?group=2<?php echo urlencode('&id='.$item['gid']); ?>" target="_blank">Create new metadata based on this data</a>
| <a href="/data/<?php echo $item['uuid'];?>" target="_blank">View data</a>]</p>
<p><?php echo mb_strlen($item['description'])>400?$this->escape(mb_substr($item['description'],0,400,'UTF-8').'...'):$this->escape($item['description']); ?></p>
</li>
<?php

View File

@ -17,19 +17,19 @@ $this->breadcrumb()->setSeparator(' > ');
<div>
<ul class="nav nav-pills">
<li class=""><a href="/author/newdata">未提交数据列表</a></li>
<li class=""><a class="iframe" href="/service/geonetwork?url=metadata.xmlinsert.form">导入元数据</a></li>
<li class="active"><a href="/author/newdata/ac/add-by-template">根据模板新建元数据</a></li>
<li class=""><a href="/author/newdata/ac/add-by-data">根据已有数据新建元数据</a></li>
<li class=""><a href="/author/newdata">Unsubmitted</a></li>
<li class=""><a class="iframe" href="/service/geonetwork?url=metadata.xmlinsert.form">Import new metadata</a></li>
<li class="active"><a href="/author/newdata/ac/add-by-template">Create new metadata with templates</a></li>
<li class=""><a href="/author/newdata/ac/add-by-data">Create new metadata with existed metadata</a></li>
</ul>
</div>
<div>
<h3>根据预制元数据模板创建数据</h3>
<h3>Create new metadata with templates</h3>
<div class="input-append">
<form id="datasearch" class="search_form" action="/author/newdata/ac/add-by-template">
<input class="span2" type="text" id="keyword" name="q" value="<?php if(!empty($this->q)) echo $this->q; ?>">
<button class="btn" type="submit">搜索</button>
<button class="btn" type="submit">Search</button>
</form>
</div>
<?php

View File

@ -4,9 +4,9 @@ $this->headTitle($this->config->title->author);
$this->headTitle()->setSeparator(' - ');
$this->theme->AppendPlus($this,'colorbox');
$this->headLink()->appendStylesheet('/css/author.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/">Home</a>');
$this->breadcrumb('<a href="/author">'.$this->config->title->author.'</a>');
$this->breadcrumb('新建数据');
$this->breadcrumb('Submit data');
$this->breadcrumb()->setSeparator(' > ');
?>
<div class="row">
@ -17,10 +17,10 @@ $this->breadcrumb()->setSeparator(' > ');
<div>
<ul class="nav nav-pills">
<li class="active"><a href="/author/newdata">未提交数据列表</a></li>
<li class=""><a class="iframe" href="/service/geonetwork?url=metadata.xmlinsert.form">导入元数据</a></li>
<li class=""><a href="/author/newdata/ac/add-by-template">根据模板新建元数据</a></li>
<li class=""><a href="/author/newdata/ac/add-by-data">根据已有数据新建元数据</a></li>
<li class="active"><a href="/author/newdata">Unsubmitted</a></li>
<li class=""><a class="iframe" href="/service/geonetwork?url=metadata.xmlinsert.form">Import new metadata</a></li>
<li class=""><a href="/author/newdata/ac/add-by-template">Create new metadata with templates</a></li>
<li class=""><a href="/author/newdata/ac/add-by-data">Create new metadata with existed metadata</a></li>
</ul>
</div>
@ -34,18 +34,18 @@ $this->breadcrumb()->setSeparator(' > ');
?>
<li class="well">
<h4><?php echo $item['title'];?></h4>
<a href="/service/geonetwork?url=metadata.show?id=<?php echo $item['id']; ?>" target="_blank">在geonetwork里查看</a>
| <a href="/service/geonetwork?url=metadata.edit?id=<?php echo $item['id']; ?>" target="_blank">在geonetwork里修改</a>
| <a href="/service/geonetwork?url=metadata.delete?id=<?php echo $item['id']; ?>" target="_blank">删除此条数据</a>
| <a href="javascript:;" onclick="getFtp('<?php echo $item['uuid'];?>')">FTP数据上传</a>
| <a onclick="$('#commit_submit').attr('onclick','commit(\'<?php echo $item['id'];?>\');');" href="#commitform" class="more inline">提交评审发布</a>
<a href="/service/geonetwork?url=metadata.show?id=<?php echo $item['id']; ?>" target="_blank">View in GeoNetwork</a>
| <a href="/service/geonetwork?url=metadata.edit?id=<?php echo $item['id']; ?>" target="_blank">Edit in GeoNetwork</a>
| <a href="/service/geonetwork?url=metadata.delete?id=<?php echo $item['id']; ?>" target="_blank">Delete</a>
| <a href="javascript:;" onclick="getFtp('<?php echo $item['uuid'];?>')">Upload data via FTP (get account)</a>
| <a onclick="$('#commit_submit').attr('onclick','commit(\'<?php echo $item['id'];?>\');');" href="#commitform" class="more inline">Submit for review</a>
</p>
</li>
<?php
endforeach;
echo "</ul>";
else :
echo "<p>您当前没有未提交的数据。</p>";
echo "<p>No unsubmitted data now.</p>";
endif; ?>
</div>
<div class="pagenavi"><?= $this->paginator; ?></div>
@ -68,12 +68,12 @@ function action(ac,id){
{$('#changelog').val('');$('#commit_submit').attr('onclick','');}
}
else{
$.colorbox({'innerWidth':'50%','html':'<img src="/images/alert_big_warning.png" /><h4>出现错误,请稍候再试</h4>'});
$.colorbox({'innerWidth':'50%','html':'<img src="/images/alert_big_warning.png" /><h4>Error occupied, please try again later</h4>'});
}
},
'timeout': 30000,
'error': function(){
$.colorbox({'innerWidth':'50%','html':'<img src="/images/alert_big_error.png" /><h4>处理中出现错误,请刷新页面后重试</h4>'});
$.colorbox({'innerWidth':'50%','html':'<img src="/images/alert_big_error.png" /><h4>Errors occupied in processing, please try again later.</h4>'});
}
});
}
@ -96,21 +96,21 @@ function getFtp(uuid){
{
if(data.statu > 0)
{
var html = '<p>临时FTP帐号信息<b>(此帐号仅对应当前数据集!)</b></p><p>ftp://ftp2.westgis.ac.cn/</p>'+
'<p>用户名:'+data.user+
'</p><p>密码:'+data.passwd+'</p>'
+'<p><a href="ftp://'+data.user+':'+data.passwd+'@ftp1.westgis.ac.cn/">或直接点击此链接</a></p>';
var html = '<p>Your FTP account<b>(just upload this data!)</b></p><p>ftp://ftp2.westgis.ac.cn/</p>'+
'<p>username:'+data.user+
'</p><p>password:'+data.passwd+'</p>'
+'<p><a href="ftp://'+data.user+':'+data.passwd+'@ftp2.westgis.ac.cn/">Direct connect</a></p>';
Alert(html);
}
}
}
else{
Alert('出现错误,请稍候再试</h4>');
Alert('errors</h4>');
}
},
'timeout': 30000,
'error': function(){
Alert('处理中出现错误,请刷新页面后重试</h4>');
Alert('errors</h4>');
}
});
}
@ -122,11 +122,11 @@ function Alert(html){
<div id="commitform">
<form>
<p>
<label>简要功能:</label><br />
<label>Introduction briefly:</label><br />
<textarea class="full" style="resize:none;height:200px;" id="changelog"></textarea>
<br /><small>请输入此数据的简要功能和特色</small>
<br /><small>Please describe the dataset briefly</small>
</p>
<input type="button" onclick="" id="commit_submit" class="btn btn-green big" value="提交"/>
<input type="button" onclick="" id="commit_submit" class="btn btn-green big" value="Submit"/>
</form>
</div>
<div class="error"><img src="/images/alert_big_error.png" /><span></span></div>

View File

@ -23,8 +23,8 @@
<ul class="nav" id="mainmenu">
<li id="main-nav-index"><a href="/"><span>Home</span></a></li>
<li id="main-nav-data"><a href="/data"><span>Dataset</span></a></li>
<!--<li id="main-nav-review"><a href="/review"><span>数据评审</span></a></li>
<li id="main-nav-author"><a href="/author"><span>For Author</span></a></li>-->
<!--<li id="main-nav-review"><a href="/review"><span>数据评审</span></a></li>-->
<li id="main-nav-author"><a href="/author"><span>For Author</span></a></li>
<li id="main-nav-knowledge"><a href="/knowledge"><span>Knowledge</span></a></li>
<li><a href="/archives"><span>News & Events</span></a></li>
<li><a href="/about"><span>About</span></a></li>