merge heihedata branch from r3741 to r3746.

This commit is contained in:
wlx 2013-06-21 13:58:44 +00:00
parent 7052e0b5a5
commit ade674438e
7 changed files with 129 additions and 11 deletions

View File

@ -172,7 +172,7 @@ class Admin_ReviewController extends Zend_Controller_Action
$sql = "select m.*,md.title,u.username,u.realname from mdstatus m
right join metadata md on md.uuid=m.uuid
left join users u on u.id=m.userid
where m.status=1
where m.status in (1,2,3,4)
and md.title like '%$keyword%'
";
$re = $this->db->query($sql);
@ -191,7 +191,7 @@ class Admin_ReviewController extends Zend_Controller_Action
$sql = "select m.*,md.title,u.username,u.realname from mdstatus m
right join metadata md on md.uuid=m.uuid
left join users u on u.id=m.userid
where m.status=1 order by m.ts_created desc";
where m.status in (1,2,3,4) order by m.ts_created desc";
$re = $this->db->query($sql);
$rows = $re->fetchAll();

View File

@ -640,7 +640,72 @@ where t.filesize<1024*5)
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
$this->view->paginator=$paginator;
}
} else if ($ac=='heihefund')
{
$sql = "SELECT m.title,m.uuid,g.id as gid
from metadata m
LEFT JOIN mdstatus s ON m.uuid=s.uuid
left join datasource on datasource.uuid=m.uuid
left join source on datasource.sourceid=source.id
left join mdfund mf on mf.uuid=m.uuid
left join geonetworkmetadata g on m.uuid=g.uuid
where s.status>4 and source.code='heihe' and mf.fid is null
ORDER BY m.title DESC;";
$sth = $this->db->prepare($sql);
$sth->execute();
$rows = $sth->fetchAll();
$paginator = Zend_Paginator::factory($rows);
$paginator->setCurrentPageNumber($this->_getParam('page'));
$paginator->setItemCountPerPage($pages);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
$this->view->paginator=$paginator;
$this->_helper->viewRenderer('problem-md');
} else if ($ac=='noemail')
{
$sql = "SELECT distinct m.title,m.uuid,g.id as gid
from metadata m
LEFT JOIN mdstatus s ON m.uuid=s.uuid
left join role on role.uuid=m.uuid
left join geonetworkmetadata g on m.uuid=g.uuid
where m.datatype=1 and s.status>4 and m.uuid not in (
select role.uuid from role left join responsible res on role.resid=res.id
where res.email is not null and role.role in ('resourceProvider','owner','pointOfContact','custodian')
)
ORDER BY m.title DESC;";
$sth = $this->db->prepare($sql);
$sth->execute();
$rows = $sth->fetchAll();
$paginator = Zend_Paginator::factory($rows);
$paginator->setCurrentPageNumber($this->_getParam('page'));
$paginator->setItemCountPerPage($pages);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
$this->view->paginator=$paginator;
$this->_helper->viewRenderer('problem-md');
} else if ($ac=='unmoved')
{
$sql = "SELECT distinct m.title,m.uuid,g.id as gid
from metadata m
LEFT JOIN mdstatus s ON m.uuid=s.uuid
left join geonetworkmetadata g on m.uuid=g.uuid
left join dataset ds on ds.uuid=m.uuid
where s.status>4 and ds.path like '%upload%'
ORDER BY m.title DESC;";
$sth = $this->db->prepare($sql);
$sth->execute();
$rows = $sth->fetchAll();
$paginator = Zend_Paginator::factory($rows);
$paginator->setCurrentPageNumber($this->_getParam('page'));
$paginator->setItemCountPerPage($pages);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
$this->view->paginator=$paginator;
$this->_helper->viewRenderer('problem-md');
}
$this->view->activeID="btn-".$ac;
}
}

View File

@ -91,7 +91,7 @@ table thead tr th {background:#EBF2F6;}
<td><?= $item['fund_type'] ?></td>
<th><?= $item['mds'] ?></th>
<td>
<a href="/author/fund/ac/dataview/id/<?= $item['id'] ?>">查看数据</a>
<a href="/data/fund/ac/dataview/id/<?= $item['id'] ?>">查看数据</a>
</td>
</tr>
<?php endforeach; ?>

View File

@ -0,0 +1,47 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/admin.css');
$this->theme->AppendPlus($this,'colorbox');
?>
<div id="leftPanel">
<?= $this->partial('sys/left.phtml'); ?>
</div>
<div id="rightPanel">
<a id="btn-ref" class="btn" href="/admin/sys/problem/ac/ref">数据引用方式错误</a>
<a id="btn-file" class="btn" href="/admin/sys/problem/ac/file">缺少文件列表</a>
<a id="btn-tiny" class="btn" href="/admin/sys/problem/ac/tiny">数据实体大小不匹配</a>
<a id="btn-heihefund" class="btn" href="/admin/sys/problem/ac/heihefund">黑河计划数据的项目信息缺失</a>
<a id="btn-unmoved" class="btn" href="/admin/sys/problem/ac/unmoved">数据目录未从upload中转移</a>
<a id="btn-noemail" class="btn" href="/admin/sys/problem/ac/noemail">缺少审核人email</a>
<table><thead><tr>
<th>数据标题</th>
<th>uuid</th>
<th>操作</th>
</tr></thead><tbody>
<?php
if (count($this->paginator)):
$autoindex=0;
foreach ($this->paginator as $item):
$autoindex++;?>
<tr class="<?php if($autoindex%2 == 0) echo 'even'; else echo 'odd'; ?>">
<td><a href="/data/<?php echo $item['uuid'];?>"><?php echo $item['title'];?></a></td>
<td><?php echo $item['uuid'];?></td>
<td><a href="/service/geonetwork?url=metadata.edit?id=<?= $item['gid']; ?>" target="_blank">编辑</a></td>
</tr>
<?php endforeach; endif; ?>
</tbody></table>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div>
<?php if(!empty($this->activeID)) : ?>
<script>$('#<?= $this->activeID?>').addClass("btn-primary");</script>
<?php endif; ?>
<script>
$(".iframe").colorbox({iframe:true, width:"50%", height:"50%"});
$(".inline").colorbox({inline:true, width:"50%"});
function Alert(html){
$.colorbox({'innerWidth':'50%','html':'<h4 style="font-size:16px;font-weight:bold;">'+html+'</h4>'});
}
</script>

View File

@ -13,7 +13,9 @@
<a id="btn-ref" class="btn" href="/admin/sys/problem/ac/ref">数据引用方式错误</a>
<a id="btn-file" class="btn" href="/admin/sys/problem/ac/file">缺少文件列表</a>
<a id="btn-tiny" class="btn" href="/admin/sys/problem/ac/tiny">数据实体大小不匹配</a>
<a id="btn-heihefund" class="btn" href="/admin/sys/problem/ac/heihefund">黑河计划数据的项目信息缺失</a>
<a id="btn-unmoved" class="btn" href="/admin/sys/problem/ac/unmoved">数据目录未从upload中转移</a>
<a id="btn-noemail" class="btn" href="/admin/sys/problem/ac/noemail">缺少审核人email</a>
<table><thead><tr>
<th>数据标题</th>
<th>引用</th>

View File

@ -12,7 +12,10 @@
<div id="rightPanel">
<a id="btn-ref" class="btn" href="/admin/sys/problem/ac/ref">数据引用方式错误</a>
<a id="btn-file" class="btn" href="/admin/sys/problem/ac/file">缺少文件列表</a>
<a id="btn-tiny" class="btn" href="/admin/sys/problem/ac/tiny">数据实体过小</a>
<a id="btn-tiny" class="btn" href="/admin/sys/problem/ac/tiny">数据实体过小</a>
<a id="btn-heihefund" class="btn" href="/admin/sys/problem/ac/heihefund">黑河计划数据的项目信息缺失</a>
<a id="btn-unmoved" class="btn" href="/admin/sys/problem/ac/unmoved">数据目录未从upload中转移</a>
<a id="btn-noemail" class="btn" href="/admin/sys/problem/ac/noemail">缺少审核人email</a>
<table><thead><tr>
<th>数据标题</th>
<th>UUID</th>

View File

@ -239,15 +239,16 @@ class ReviewListener implements Zend_EventManager_ListenerAggregate
$this->db->query($sql,array($id));
//email message
if(isset($emails) &&is_array($emails) && count($emails)>0)
{
$mail=new WestdcMailer($this->view->config->smtp);
{
$config=Zend_Registry::get('config');
$mail=new WestdcMailer($config->smtp);
$sql="select m.uuid,m.title from metadata m left join mdstatus s on m.uuid=s.uuid where s.id='$id'";
$rs=$this->db->query($sql);
$res=$rs->fetch();
$mailtp=new EmailText($this->db,'metadata-publish',array('uuid'=>$res['uuid'],'title'=>$res['title']));
$mail->setBodyText($mailtp->getBody());
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
$mail->addTo($emails);
$mail->setBodyText($mailtp->getBody());
$mail->setFrom($config->service->email,'西部数据中心服务组');
foreach($emails as $email) $mail->addTo($email);
$mail->setSubject($mailtp->getSubject());
$mail->send();
}