diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index e593f2b7..8f199708 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -1615,12 +1615,15 @@ class Admin_DataController extends Zend_Controller_Action $redirect = "/admin/data/source/"; - if(!empty($_POST['submit'])) + if(!empty($_POST['submit']) and $_POST['submit']==1) { try{ $title = $this->_request->getParam('title'); $uuid = $this->_request->getParam('uuid'); $code = $this->_request->getParam('code'); + $admin_status = $this->_request->getparam('admin_status'); + $admin_email = '{'.implode(",",$this->_request->getparam('admin_email')).'}'; + $exclude_data = '{'.implode(",",$this->_request->getparam('exclude_data')).'}'; $description = $this->_request->getParam('description'); $has_pages = $this->_request->getParam('has_pages'); $has_agreement = $this->_request->getParam('has_agreement'); @@ -1629,11 +1632,15 @@ class Admin_DataController extends Zend_Controller_Action 'title' => $title, 'uuid' => $uuid, 'code' => $code, + 'admin_status' => $admin_status, + 'admin_email' => $admin_email, + 'exclude_data' => $exclude_data, 'description' => $description, 'has_pages' => $has_pages, 'has_agreement' => $has_agreement ); - +# print_r($data); +# exit(); if($this->db->insert('source',$data)) { $this->messenger->addMessage('添加来源信息成功'); @@ -1652,19 +1659,36 @@ class Admin_DataController extends Zend_Controller_Action else if($do == 'edit' && !empty($id)) { - if(!empty($_POST['submit'])) + if(!empty($_POST['submit']) and $_POST['submit']==1) { try{ $title = $this->_request->getParam('title'); $uuid = $this->_request->getParam('uuid'); $code = $this->_request->getParam('code'); + $admin_status = $this->_request->getparam('admin_status'); + $admin_email = '{'.implode(",",$this->_request->getparam('admin_email')).'}'; + $exclude_data = '{'.implode(",",$this->_request->getparam('exclude_data')).'}'; $description = $this->_request->getParam('description'); $has_pages = $this->_request->getParam('has_pages'); $has_agreement = $this->_request->getParam('has_agreement'); - $sql = "update source set title='$title',uuid='$uuid',code='$code',description='$description',has_pages='$has_pages',has_agreement='$has_agreement' where id='$id'"; + $data = array( + 'title' => $title, + 'uuid' => $uuid, + 'code' => $code, + 'admin_status' => $admin_status, + 'admin_email' => $admin_email, + 'exclude_data' => $exclude_data, + 'description' => $description, + 'has_pages' => $has_pages, + 'has_agreement' => $has_agreement + ); + $sql = "update source set title='$title',uuid='$uuid',code='$code',admin_status='$admin_status',admin_email='$admin_email',exclude_data='$exclude_data',description='$description',has_pages='$has_pages',has_agreement='$has_agreement' where id='$id'"; +# print_r($sql); +# exit(); if($this->db->exec($sql)) + { $this->messenger->addMessage('修改来源信息成功'); $this->_redirect("/admin/data/source/do/edit/id/$id"); @@ -2262,7 +2286,6 @@ class Admin_DataController extends Zend_Controller_Action $files=new Files(); $msg = $files -> upload($_FILES['Filedata'],empty($uuid)?'file/':'md/',true); - if(empty($msg['error'])) { $msg['error']=""; @@ -2271,9 +2294,9 @@ class Admin_DataController extends Zend_Controller_Action $filedesc = $this->_request->getParam('filedesc'); $filetype = 'md'; $realname = $msg['realname']; + $language = $this->_getParam('language'); - - $sql = "insert into attachments (filename,filetype,filedesc,userid,filesize,realname) values ('$filename','$filetype','$filedesc','$userid','$filesize','$realname') RETURNING id"; + $sql = "insert into attachments (filename,filetype,filedesc,userid,filesize,realname,language) values ('$filename','$filetype','$filedesc','$userid','$filesize','$realname','$language') RETURNING id"; $sth = $this->db->prepare($sql); $sth->execute(); $att = $sth->fetch(PDO::FETCH_ASSOC); diff --git a/application/admin/views/scripts/data/attachments.phtml b/application/admin/views/scripts/data/attachments.phtml index 8f1de758..dd7eab55 100644 --- a/application/admin/views/scripts/data/attachments.phtml +++ b/application/admin/views/scripts/data/attachments.phtml @@ -32,7 +32,7 @@ 查看我的附件
-
+ diff --git a/application/admin/views/scripts/data/attachmentsadd.phtml b/application/admin/views/scripts/data/attachmentsadd.phtml index bc744788..0c5bb8b2 100644 --- a/application/admin/views/scripts/data/attachmentsadd.phtml +++ b/application/admin/views/scripts/data/attachmentsadd.phtml @@ -19,32 +19,53 @@ 查看元数据 返回附件管理
- + -

- 注:可选择多个文件
-

+
+ +
+
- -

+
+
+ +
+ +
+
+
+ + \ No newline at end of file diff --git a/application/admin/views/scripts/data/sourcefetchone.phtml b/application/admin/views/scripts/data/sourcefetchone.phtml index 06e3b65c..75e5febe 100644 --- a/application/admin/views/scripts/data/sourcefetchone.phtml +++ b/application/admin/views/scripts/data/sourcefetchone.phtml @@ -31,7 +31,7 @@