#174 增加了按项目来源查看元数据列表的功能,增加了清除元数据项目来源的功能
This commit is contained in:
parent
d517bcdee4
commit
0b520fe71c
|
@ -976,6 +976,69 @@ class Admin_DataController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
}// 删除项目来源
|
}// 删除项目来源
|
||||||
|
|
||||||
|
else if($do == 'fetch' && !empty($id))
|
||||||
|
{
|
||||||
|
|
||||||
|
$wheresql = array();
|
||||||
|
|
||||||
|
$wheresql[] = " ds.sourceid='$id' ";
|
||||||
|
|
||||||
|
if(!empty($q) && !empty($search))
|
||||||
|
{
|
||||||
|
$this->view->q = $q;
|
||||||
|
$wheresql[] = " title like '%$q%' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(count($wheresql>0))$wheresql = join(' and ',$wheresql);
|
||||||
|
else $wheresql='';
|
||||||
|
|
||||||
|
if($wheresql!='')
|
||||||
|
{
|
||||||
|
$wheresql = 'where '.$wheresql;
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = "select md.title,md.uuid,ds.id,ds.sourceid,s.title as stitle,s.code from metadata md
|
||||||
|
left join datasource ds on ds.uuid=md.uuid
|
||||||
|
left join source s on s.id=ds.sourceid
|
||||||
|
$wheresql
|
||||||
|
order by id desc";
|
||||||
|
$rs = $this->db->query($sql);
|
||||||
|
$rows = $rs->fetchAll();
|
||||||
|
|
||||||
|
$paginator = Zend_Paginator::factory($rows);
|
||||||
|
$paginator->setCurrentPageNumber($this->_getParam('page'));
|
||||||
|
$paginator->setItemCountPerPage(30);
|
||||||
|
$paginator->setView($this->view);
|
||||||
|
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
|
||||||
|
$this->view->paginator=$paginator;
|
||||||
|
|
||||||
|
$this->_helper->viewRenderer('sourcefetchone');
|
||||||
|
|
||||||
|
}//查看某项目来源中的所有元数据
|
||||||
|
|
||||||
|
else if($do == 'delsource' && !empty($id))
|
||||||
|
{
|
||||||
|
$redirect = "/admin/data/source/do/datasource/uuid/$uuid";
|
||||||
|
|
||||||
|
$sql = "delete from datasource where id='$id'";
|
||||||
|
|
||||||
|
try{
|
||||||
|
if($this->db->exec($sql))
|
||||||
|
{
|
||||||
|
$this->messenger->addMessage('删除成功');
|
||||||
|
$this->_redirect($redirect);
|
||||||
|
}else{
|
||||||
|
$this->messenger->addMessage('删除失败,可能该数据已不存在');
|
||||||
|
$this->_redirect($redirect);
|
||||||
|
}
|
||||||
|
}catch (Exception $e){
|
||||||
|
$this->messenger->addMessage('删除失败:'.$e->getMessage());
|
||||||
|
$this->_redirect($redirect);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}// 清除元数据来源记录
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$wheresql = array();
|
$wheresql = array();
|
||||||
|
|
|
@ -52,7 +52,11 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="/data/<?php echo $item['uuid'];?>"><?php echo $item['title']; ?></a></td>
|
<td><a href="/data/<?php echo $item['uuid'];?>"><?php echo $item['title']; ?></a></td>
|
||||||
<td><?php echo $item['code'];?></td>
|
<td><?php echo $item['code'];?></td>
|
||||||
<td><a href="/admin/data/source/do/edit/id/<?php echo $item['id']?>">查看编辑</a>|<a href="/admin/data/source/do/del/id/<?php echo $item['id']?>" onclick="return confirm('是否确定删除该来源')">删除</a></td>
|
<td>
|
||||||
|
<a href="/admin/data/source/do/edit/id/<?php echo $item['id']?>">查看编辑</a>|
|
||||||
|
<a href="/admin/data/source/do/fetch/id/<?php echo $item['id']?>">查看元数据</a>|
|
||||||
|
<a href="/admin/data/source/do/del/id/<?php echo $item['id']?>" onclick="return confirm('是否确定删除该来源')">删除</a>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
<?php
|
||||||
|
$this->headTitle($this->config->title->site);
|
||||||
|
$this->headTitle('后台管理');
|
||||||
|
$this->headTitle()->setSeparator(' - ');
|
||||||
|
$this->headLink()->appendStylesheet('/css/admin.css');
|
||||||
|
$this->headScript()->appendFile('/js/jquery-1.6.4.min.js');
|
||||||
|
$this->breadcrumb('<a href="/">首页</a>');
|
||||||
|
$this->breadcrumb('<a href="/admin">后台首页</a>');
|
||||||
|
$this->breadcrumb('<a href="/admin/data">数据管理</a>');
|
||||||
|
$this->breadcrumb('项目来源管理');
|
||||||
|
$this->breadcrumb()->setSeparator(' > ');
|
||||||
|
?>
|
||||||
|
<div id="leftPanel">
|
||||||
|
<?= $this->partial('data/left.phtml'); ?>
|
||||||
|
</div>
|
||||||
|
<div id="rightPanel">
|
||||||
|
<?php if ($this->msg or $this->messages) :?>
|
||||||
|
<div id="message">
|
||||||
|
<?php if ($this->msg) : ?>
|
||||||
|
<p><?php echo $this->msg; ?></p>
|
||||||
|
<?php endif; if ($this->messages): foreach($this->messages as $msg): ?>
|
||||||
|
<p><?php echo $msg; ?></p>
|
||||||
|
<?php endforeach;endif; ?>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<div class="ctrlplan">
|
||||||
|
<a href="/admin/data/source">项目来源管理</a>
|
||||||
|
<a href="/admin/data/source/do/add">添加项目来源</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="search">
|
||||||
|
<form action="" method="get">
|
||||||
|
<input type="hidden" name="search" value='1' />
|
||||||
|
<input type="hidden" name="id" value='<?php echo $this->id;?>' />
|
||||||
|
<label>搜索关键字</label><input type="text" class="q" name="q" value="<?php echo $this->q; ?>" />
|
||||||
|
<input type="submit" class="btn" value="搜索" />
|
||||||
|
</form>
|
||||||
|
</div><!-- search DIV -->
|
||||||
|
|
||||||
|
<table class="stylized" width="700">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<td width='85%'>标题</td>
|
||||||
|
<td width='15%'>操作</td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<?php if (count($this->paginator)): ?>
|
||||||
|
<tbody id="list">
|
||||||
|
<?php foreach ($this->paginator as $item): ?>
|
||||||
|
<tr>
|
||||||
|
<td><a href="/data/<?php echo $item['uuid'];?>"><?php echo $item['title']; ?></a></td>
|
||||||
|
<td><a href="/admin/data/source/do/delsource/id/<?php echo $item['id']?>/uuid/<?php echo $item['uuid'];?>" onclick="return confirm('是否确定删除该来源')">清除数据来源</a></td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</tbody>
|
||||||
|
<?php endif; ?>
|
||||||
|
</table>
|
||||||
|
<div class="pagenavi"><?= $this->paginator; ?></div>
|
||||||
|
</div>
|
||||||
|
<script>$("#list tr").mouseover(function(){$(this).addClass("high")}).mouseout(function(){$(this).removeClass("high")})</script>
|
|
@ -71,6 +71,21 @@
|
||||||
?>
|
?>
|
||||||
<input type="submit" value="提交" />
|
<input type="submit" value="提交" />
|
||||||
</form>
|
</form>
|
||||||
|
<?php
|
||||||
|
if(!empty($this->info['id']))
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<form method="post" action="/admin/data/source/">
|
||||||
|
<input type="hidden" name="uuid" value="<?php echo $this->uuid;?>" />
|
||||||
|
<input type="hidden" name="do" value="delsource" />
|
||||||
|
<input type="hidden" name="id" value="<?php echo $this->info['id'];?>" />
|
||||||
|
<input type="hidden" name="submit" value="1" />
|
||||||
|
<br /><button type="submit" class="btn btn-red" onclick="return confirm('是否确定删除该来源')">清除数据来源</button>
|
||||||
|
</form>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
<div class="pagenavi"><?= $this->paginator; ?></div>
|
<div class="pagenavi"><?= $this->paginator; ?></div>
|
||||||
</div>
|
</div>
|
||||||
<script>$("#list tr").mouseover(function(){$(this).addClass("high")}).mouseout(function(){$(this).removeClass("high")})</script>
|
<script>$("#list tr").mouseover(function(){$(this).addClass("high")}).mouseout(function(){$(this).removeClass("high")})</script>
|
Loading…
Reference in New Issue