在单数据版本中添加编辑链接

This commit is contained in:
wlx 2013-05-16 01:19:12 +00:00
parent a5c49863b8
commit 2a877badb9
2 changed files with 12 additions and 2 deletions

View File

@ -1994,9 +1994,10 @@ class Admin_DataController extends Zend_Controller_Action
if (!empty($uuid) && empty($ac)) if (!empty($uuid) && empty($ac))
{ {
//view the versions of the data //view the versions of the data
$sql = "SELECT md.title,md.uuid,v.ts_created,v.changelog,v.userid,v.id,u.username,u.realname FROM mdversion v $sql = "SELECT md.title,md.uuid,v.ts_created,v.changelog,v.userid,v.id,u.username,u.realname,g.id as gid FROM mdversion v
LEFT JOIN metadata md ON md.uuid=v.uuid LEFT JOIN metadata md ON md.uuid=v.uuid
left join users u on v.userid=u.id left join users u on v.userid=u.id
left join geonetworkmetadata g on md.uuid=g.uuid
WHERE md.title IS NOT NULL AND v.uuid=? WHERE md.title IS NOT NULL AND v.uuid=?
order by v.ts_created desc order by v.ts_created desc
"; ";

View File

@ -32,11 +32,20 @@ $this->breadcrumb()->setSeparator(' > ');
if ($this->mdtitle) echo "<h2>元数据:".$this->mdtitle."</h2>"; if ($this->mdtitle) echo "<h2>元数据:".$this->mdtitle."</h2>";
echo "<ul>"; echo "<ul>";
$autoindex=0; $autoindex=0;
$edited=false;
foreach ($this->paginator as $item): foreach ($this->paginator as $item):
$autoindex++;?> $autoindex++;?>
<li id="list_<?php echo $item['id'];?>"> <li id="list_<?php echo $item['id'];?>">
<p><a href="/data/<?php echo $item['uuid'];?>" target="_blank"><?php echo $item['title'];?></a> <p><a href="/data/<?php echo $item['uuid'];?>" target="_blank"><?php echo $item['title'];?></a>
<a href="/admin/data/version/uuid/<?php echo $item['uuid']; ?>">查看此数据所有版本</a></p> <a href="/admin/data/version/uuid/<?php echo $item['uuid']; ?>">查看此数据所有版本</a>
<?php
if (!$edited && @$item['gid'])
{
$edited=true;
echo '<a href="/service/geonetwork?url=metadata.edit?id='.$item['gid'].'" target="_blank">编辑最新版本</a> ';
}
?>
</p>
<p>版本创建时间: <?php echo date("Y-m-d H:i",strtotime($item['ts_created']));?> <p>版本创建时间: <?php echo date("Y-m-d H:i",strtotime($item['ts_created']));?>
<?php if ($item['userid']) : <?php if ($item['userid']) :
echo "发布人: ".(empty($item['realname'])?$item['username']:$item['realname'])." "; echo "发布人: ".(empty($item['realname'])?$item['username']:$item['realname'])." ";