修复了后台元数据管理中不能同步的问题

This commit is contained in:
wlx 2012-06-12 04:18:10 +00:00
parent 0a33209af3
commit e001c1e370
1 changed files with 12 additions and 12 deletions

View File

@ -80,17 +80,6 @@ class Admin_DataController extends Zend_Controller_Action
$this->db->exec($sql); $this->db->exec($sql);
} }
$this->view->msg='成功同步WESTDC元数据到GEONETWORK'; $this->view->msg='成功同步WESTDC元数据到GEONETWORK';
} elseif (!empty($uuid) && isset($_POST['submit'])) {
//同步单条元数据
$sql=$this->db->quoteInto("select data,source from geonetworkmetadata where uuid=?",$uuid);
if ($rs=$this->db->fetchRow($sql)) {
$this->import($rs->data);
$this->db->exec($this->db->quoteInto("update metadata set source=? where uuid='$uuid'",$rs->source));
$userid = Zend_Auth::getInstance()->getIdentity()->id;
$this->db->query("insert into mdstatus (uuid,status,ts_accepted,userid) select uuid,1,now(),?
from geonetworkmetadata gn where uuid not in (select uuid from mdstatus) and uuid=?",array($userid,$uuid));
$this->view->msg='成功同步元数据:'.$uuid;
} else $this->view->msg='不存在此元数据:'.$uuid;
} elseif (!empty($uuid) && isset($_POST['gnsubmit'])) { } elseif (!empty($uuid) && isset($_POST['gnsubmit'])) {
//同步单条元数据到geonetwork //同步单条元数据到geonetwork
$sql=$this->db->quoteInto("select m.uuid,m.source,x.data,g.id from metadata m left join xml x on m.id=x.id left join geonetworkmetadata g on g.uuid=m.uuid where m.uuid=?",$uuid); $sql=$this->db->quoteInto("select m.uuid,m.source,x.data,g.id from metadata m left join xml x on m.id=x.id left join geonetworkmetadata g on g.uuid=m.uuid where m.uuid=?",$uuid);
@ -169,6 +158,17 @@ class Admin_DataController extends Zend_Controller_Action
} }
} }
$this->view->msg='已成功同步帐号!'; $this->view->msg='已成功同步帐号!';
} elseif (!empty($uuid) && (isset($_POST['submit']) || (!isset($_POST['gnsubmit'] && !isset($_POST['watersubmit']))))) {
//同步单条元数据
$sql=$this->db->quoteInto("select data,source from geonetworkmetadata where uuid=?",$uuid);
if ($rs=$this->db->fetchRow($sql)) {
$this->import($rs->data);
$this->db->exec($this->db->quoteInto("update metadata set source=? where uuid='$uuid'",$rs->source));
$userid = Zend_Auth::getInstance()->getIdentity()->id;
$this->db->query("insert into mdstatus (uuid,status,ts_accepted,userid) select uuid,1,now(),?
from geonetworkmetadata gn where uuid not in (select uuid from mdstatus) and uuid=?",array($userid,$uuid));
$this->view->msg='成功同步元数据:'.$uuid;
} else $this->view->msg='不存在此元数据:'.$uuid;
} }
} }