元数据导入的时候修复联系人少导入的问题;

元数据显示的时候分类展示。
This commit is contained in:
wlx 2010-01-04 04:08:00 +00:00
parent 39a9ae5372
commit 0ad5649b04
3 changed files with 41 additions and 30 deletions

View File

@ -548,7 +548,7 @@ class DataController extends Zend_Controller_Action
$row=$db->fetchRow($sql); $row=$db->fetchRow($sql);
if ($row) $this->view->doc=$row['linkage']; if ($row) $this->view->doc=$row['linkage'];
//相关用户 //相关用户
$sql="select p.individual,p.organisation,r.role from role r left join responsible p on r.resid=p.id where r.uuid=?"; $sql="select p.individual,p.organisation,r.role from role r left join responsible p on r.resid=p.id where r.uuid=? order by r.role,p.individual";
$this->view->authors=$db->fetchAll($sql,array($uuid)); $this->view->authors=$db->fetchAll($sql,array($uuid));
//相关元数据,根据同名关键词实现 //相关元数据,根据同名关键词实现
//$sql="select distinct(md.uuid),md.title from keyword kw left join metadata md on kw.id=md.id where kw.keyword in (select k.keyword from keyword k left join metadata m on k.id=m.id where m.id=? and k.keytype='theme') and kw.id<>? limit 10"; //$sql="select distinct(md.uuid),md.title from keyword kw left join metadata md on kw.id=md.id where kw.keyword in (select k.keyword from keyword k left join metadata m on k.id=m.id where m.id=? and k.keytype='theme') and kw.id<>? limit 10";

View File

@ -83,10 +83,22 @@ else
<ul> <ul>
<?php <?php
$party_zh=array('resourceProvider'=>'资源提供者','custodian'=>'维护者','owner'=>'拥有者','user'=>'用户','distributor'=>'分发者','originator'=>'创建者','pointOfContact'=>'联系人','principalInvestigator'=>'调查者','processor'=>'处理者','publisher'=>'发布者','author'=>'元数据作者'); $party_zh=array('resourceProvider'=>'资源提供者','custodian'=>'维护者','owner'=>'拥有者','user'=>'用户','distributor'=>'分发者','originator'=>'创建者','pointOfContact'=>'联系人','principalInvestigator'=>'调查者','processor'=>'处理者','publisher'=>'发布者','author'=>'元数据作者');
foreach($this->authors as $author) : $r='';
?> $i=0;
<li title="<?php echo $author['organisation'];?>"><?php echo $party_zh[$author['role']]; ?><strong><?php echo $author['individual']; ?></strong></li> foreach($this->authors as $k=>$author) :
<?php endforeach; ?> if ($author['role']!=$r)
{
$r=$author['role'];
$i=0;
if ($k>0) echo '</li>';
echo '<li>'.$party_zh[$author['role']].'';
}
if ($i>0) echo '';
$i+=1;
echo '<strong title='.$author['organisation'].'>'.$author['individual'].'</strong>';
if ($k+1==count($this->authors)) echo '</li>';
endforeach;
?>
</ul><h2>其他信息</h2><ul> </ul><h2>其他信息</h2><ul>
<li>元数据更新时间:<?php print date('Y-m-d',strtotime($md->ts_created)); ?></li> <li>元数据更新时间:<?php print date('Y-m-d',strtotime($md->ts_created)); ?></li>
<li><a href="/data/detail/id/<?php echo $md->id;?>">详细元数据</a></li> <li><a href="/data/detail/id/<?php echo $md->id;?>">详细元数据</a></li>

View File

@ -183,7 +183,6 @@ class ISO19115
@$this->projection=$this->dom->getElementsByTagName('identCode')->item(0)->nodeValue; @$this->projection=$this->dom->getElementsByTagName('identCode')->item(0)->nodeValue;
//数据作者 //数据作者
$authors=$this->dom->getElementsByTagName('citRespParty'); $authors=$this->dom->getElementsByTagName('citRespParty');
$cnt=count($authors);
foreach($authors as $k=>$author) foreach($authors as $k=>$author)
{ {
$this->author[$k]['individual']=$author->getElementsByTagName('rpIndName')->item(0)->nodeValue; $this->author[$k]['individual']=$author->getElementsByTagName('rpIndName')->item(0)->nodeValue;
@ -198,37 +197,37 @@ class ISO19115
$this->author[$k]['country']=$author->getElementsByTagName('country')->item(0)->nodeValue; $this->author[$k]['country']=$author->getElementsByTagName('country')->item(0)->nodeValue;
$this->author[$k]['role']=$author->getElementsByTagName('RoleCd')->item(0)->attributes->getNamedItem('value')->nodeValue; $this->author[$k]['role']=$author->getElementsByTagName('RoleCd')->item(0)->attributes->getNamedItem('value')->nodeValue;
} }
$cnt=$k+1;
$authors=$this->dom->getElementsByTagName('mdContact'); $authors=$this->dom->getElementsByTagName('mdContact');
$cnt+=count($authors);
foreach($authors as $j=>$author) foreach($authors as $j=>$author)
{ {
$this->author[$cnt+$j+1]['individual']=$author->getElementsByTagName('rpIndName')->item(0)->nodeValue; $this->author[$cnt+$j]['individual']=$author->getElementsByTagName('rpIndName')->item(0)->nodeValue;
$this->author[$cnt+$j+1]['organisation']=$author->getElementsByTagName('rpOrgName')->item(0)->nodeValue; $this->author[$cnt+$j]['organisation']=$author->getElementsByTagName('rpOrgName')->item(0)->nodeValue;
$this->author[$cnt+$j+1]['position']=$author->getElementsByTagName('rpPosName')->item(0)->nodeValue; $this->author[$cnt+$j]['position']=$author->getElementsByTagName('rpPosName')->item(0)->nodeValue;
$this->author[$cnt+$j+1]['delivery']=$author->getElementsByTagName('delPoint')->item(0)->nodeValue; $this->author[$cnt+$j]['delivery']=$author->getElementsByTagName('delPoint')->item(0)->nodeValue;
$this->author[$cnt+$j+1]['phone']=$author->getElementsByTagName('voiceNum')->item(0)->nodeValue; $this->author[$cnt+$j]['phone']=$author->getElementsByTagName('voiceNum')->item(0)->nodeValue;
$this->author[$cnt+$j+1]['email']=$author->getElementsByTagName('eMailAdd')->item(0)->nodeValue; $this->author[$cnt+$j]['email']=$author->getElementsByTagName('eMailAdd')->item(0)->nodeValue;
$this->author[$cnt+$j+1]['postal']=$author->getElementsByTagName('postCode')->item(0)->nodeValue; $this->author[$cnt+$j]['postal']=$author->getElementsByTagName('postCode')->item(0)->nodeValue;
$this->author[$cnt+$j+1]['city']=$author->getElementsByTagName('city')->item(0)->nodeValue; $this->author[$cnt+$j]['city']=$author->getElementsByTagName('city')->item(0)->nodeValue;
$this->author[$cnt+$j+1]['administrative']=$author->getElementsByTagName('adminArea')->item(0)->nodeValue; $this->author[$cnt+$j]['administrative']=$author->getElementsByTagName('adminArea')->item(0)->nodeValue;
$this->author[$cnt+$j+1]['country']=$author->getElementsByTagName('country')->item(0)->nodeValue; $this->author[$cnt+$j]['country']=$author->getElementsByTagName('country')->item(0)->nodeValue;
$this->author[$cnt+$j+1]['role']=$author->getElementsByTagName('RoleCd')->item(0)->attributes->getNamedItem('value')->nodeValue; $this->author[$cnt+$j]['role']=$author->getElementsByTagName('RoleCd')->item(0)->attributes->getNamedItem('value')->nodeValue;
} }
$cnt+=$j+1;
$authors=$this->dom->getElementsByTagName('distorCont'); $authors=$this->dom->getElementsByTagName('distorCont');
$cnt+=count($authors);
foreach($authors as $m=>$author) foreach($authors as $m=>$author)
{ {
$this->author[$cnt+$m+2]['individual']=$author->getElementsByTagName('rpIndName')->item(0)->nodeValue; $this->author[$cnt+$m]['individual']=$author->getElementsByTagName('rpIndName')->item(0)->nodeValue;
$this->author[$cnt+$m+2]['organisation']=$author->getElementsByTagName('rpOrgName')->item(0)->nodeValue; $this->author[$cnt+$m]['organisation']=$author->getElementsByTagName('rpOrgName')->item(0)->nodeValue;
$this->author[$cnt+$m+2]['position']=$author->getElementsByTagName('rpPosName')->item(0)->nodeValue; $this->author[$cnt+$m]['position']=$author->getElementsByTagName('rpPosName')->item(0)->nodeValue;
$this->author[$cnt+$m+2]['delivery']=$author->getElementsByTagName('delPoint')->item(0)->nodeValue; $this->author[$cnt+$m]['delivery']=$author->getElementsByTagName('delPoint')->item(0)->nodeValue;
$this->author[$cnt+$m+2]['phone']=$author->getElementsByTagName('voiceNum')->item(0)->nodeValue; $this->author[$cnt+$m]['phone']=$author->getElementsByTagName('voiceNum')->item(0)->nodeValue;
$this->author[$cnt+$m+2]['email']=$author->getElementsByTagName('eMailAdd')->item(0)->nodeValue; $this->author[$cnt+$m]['email']=$author->getElementsByTagName('eMailAdd')->item(0)->nodeValue;
$this->author[$cnt+$m+2]['postal']=$author->getElementsByTagName('postCode')->item(0)->nodeValue; $this->author[$cnt+$m]['postal']=$author->getElementsByTagName('postCode')->item(0)->nodeValue;
$this->author[$cnt+$m+2]['city']=$author->getElementsByTagName('city')->item(0)->nodeValue; $this->author[$cnt+$m]['city']=$author->getElementsByTagName('city')->item(0)->nodeValue;
$this->author[$cnt+$m+2]['administrative']=$author->getElementsByTagName('adminArea')->item(0)->nodeValue; $this->author[$cnt+$m]['administrative']=$author->getElementsByTagName('adminArea')->item(0)->nodeValue;
$this->author[$cnt+$m+2]['country']=$author->getElementsByTagName('country')->item(0)->nodeValue; $this->author[$cnt+$m]['country']=$author->getElementsByTagName('country')->item(0)->nodeValue;
$this->author[$cnt+$m+2]['role']=$author->getElementsByTagName('RoleCd')->item(0)->attributes->getNamedItem('value')->nodeValue; $this->author[$cnt+$m]['role']=$author->getElementsByTagName('RoleCd')->item(0)->attributes->getNamedItem('value')->nodeValue;
} }
/* /*
foreach($authors as $author) foreach($authors as $author)