From d3e7af02b18d8f652b8b4b5f46281002b025c2ea Mon Sep 17 00:00:00 2001 From: wlx Date: Tue, 5 Jan 2010 02:11:06 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BB=8E=E5=85=83=E6=95=B0=E6=8D=AE=E4=B8=AD?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E6=8F=90=E5=8F=96=E6=95=B0=E6=8D=AE=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E5=A3=B0=E6=98=8E=EF=BC=9B=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=E9=A1=B5=E9=9D=A2=E4=B8=BA=E6=8B=BC?= =?UTF-8?q?=E9=9F=B3=E6=8E=92=E5=BA=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/DataController.php | 18 ++++++++++++++++++ .../default/controllers/DataController.php | 5 ++++- application/models/ISO19115.php | 6 ++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index 4088423f..229e473e 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -730,6 +730,24 @@ class Admin_DataController extends Zend_Controller_Action } } } + //处理数据限制信息 + foreach($iso->limits as $uselimit) + { + $sql="select id from uselimit where uselimit=?"; + $row=$this->db->fetchRow($sql,array($uselimit)); + if (!$row) + { + $sql="insert into uselimit (uselimit) values (?)"; + $this->db->query($sql,array($uselimit)); + } + $sql="select id from uselimit where uselimit=?"; + $row=$this->db->fetchRow($sql,array($uselimit)); + if ($row) + { + $sql="insert into mdlimit (uuid,lid) values(?,?)"; + $this->db->query($sql,array($iso->uuid,$row->id)); + } + } $iso->save("../data/import/$iso->uuid.xml"); } catch (Exception $e) { //数据重复插入,此处忽略所有错误 diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php index a049f84f..582d6633 100755 --- a/application/default/controllers/DataController.php +++ b/application/default/controllers/DataController.php @@ -209,7 +209,7 @@ class DataController extends Zend_Controller_Action if (empty($page)) $page=1; $limit=10; $offset=$limit*($page-1); - $state=$db->query('select keyword,count(*),keytype from keyword group by keyword,keytype order by keytype,count desc,keyword'); + $state=$db->query('select keyword,count(*),keytype from keyword group by keyword,keytype order by keytype,keyword,count desc'); $this->view->keywords=$state->fetchAll(); if ($id>0 or !empty($key)) { if (empty($key)) { @@ -550,6 +550,9 @@ class DataController extends Zend_Controller_Action //相关用户 $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,r.id"; $this->view->authors=$db->fetchAll($sql,array($uuid)); + //数据限制信息 + $sql="select u.* from uselimit u left join mdlimit m on u.id=m.lid where m.uuid=?"; + $this->view->uselimits=$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 kw.id<>? limit 10"; diff --git a/application/models/ISO19115.php b/application/models/ISO19115.php index 33e011b0..581a3d01 100755 --- a/application/models/ISO19115.php +++ b/application/models/ISO19115.php @@ -181,6 +181,12 @@ class ISO19115 @$this->fileformat=$this->dom->getElementsByTagName('formatName')->item(0)->nodeValue; //投影类型,可以多个,但只选一个 @$this->projection=$this->dom->getElementsByTagName('identCode')->item(0)->nodeValue; + //数据限制信息 + $limits=$this->dom->getElementsByTagName('useLimit'); + foreach($limits as $limit) + { + $this->limits[]=$limit->nodeValue; + } //数据作者 $authors=$this->dom->getElementsByTagName('citRespParty'); foreach($authors as $k=>$author)