增加了项目来源的删除功能

This commit is contained in:
Li Jianxuan 2011-10-27 03:26:02 +00:00
parent 0e13e997e4
commit 7d8dde03f2
2 changed files with 21 additions and 2 deletions

View File

@ -955,7 +955,26 @@ class Admin_DataController extends Zend_Controller_Action
$this->view->paginator=$paginator; $this->view->paginator=$paginator;
$this->_helper->viewRenderer('sourceselect'); $this->_helper->viewRenderer('sourceselect');
}// 为元数据选择项目来源
else if($do == 'del' && !empty($id))
{
$redirect = "/admin/data/source/";
$sql = "delete from source 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
{ {

View File

@ -52,7 +52,7 @@
<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></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>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>