diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index def41e44..4742d3b7 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -955,7 +955,26 @@ class Admin_DataController extends Zend_Controller_Action $this->view->paginator=$paginator; $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 { diff --git a/application/admin/views/scripts/data/source.phtml b/application/admin/views/scripts/data/source.phtml index bce02bf8..9789cd95 100644 --- a/application/admin/views/scripts/data/source.phtml +++ b/application/admin/views/scripts/data/source.phtml @@ -52,7 +52,7 @@