diff --git a/application/default/controllers/AuthorController.php b/application/default/controllers/AuthorController.php index 693cc567..eb847a2d 100644 --- a/application/default/controllers/AuthorController.php +++ b/application/default/controllers/AuthorController.php @@ -2415,6 +2415,9 @@ class AuthorController extends Zend_Controller_Action //添加文献信息 else if($ac == "add") { + $submit = $this->_request->getParam('submit'); + if(!empty($submit)) + { $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(); @@ -2423,6 +2426,7 @@ class AuthorController extends Zend_Controller_Action $uuid = $this->_request->getParam('uuid'); $ref=$this->_request->getParam('ref'); $reftype=$this->_request->getParam('reftype'); + $url = $this->_request->getParam('url'); if(empty($uuid) || empty($ref) || !is_numeric($reftype)) { $data = array("error"=>"参数错误"); @@ -2449,7 +2453,7 @@ class AuthorController extends Zend_Controller_Action { $sql="insert into reference (reference,link) values(?,?)"; $sth = $this->db->prepare($sql); - $sth->execute(array(trim($ref),'')); + $sth->execute(array(trim($ref),$url)); $sql="select id from reference where reference=?"; $sth = $this->db->prepare($sql); $sth->execute(array(trim($ref))); @@ -2477,6 +2481,11 @@ class AuthorController extends Zend_Controller_Action $this->jsonexit($data); return true; } + }else{ + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer('literature-add'); + $this->view->uuid = $this->_request->getParam('uuid'); + } }//添加文献 //删除某个文献 @@ -2520,8 +2529,59 @@ class AuthorController extends Zend_Controller_Action $this->jsonexit($data); return true; } - } - } + } + + //文献附件上传 + else if($ac=='upload') + { + + $this->_helper->layout()->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + $uuid = $this->_getParam('uuid'); + + try{ + + $files=new files(); + $msg = $files -> upload($this->view->config->upload,$_FILES['Filedata'],'md'); + + if(empty($msg['error'])) + { + $msg['error']=""; + $filename = $msg['db_path']; + $filesize = $msg['file_size']; + $filedesc = $this->_request->getParam('filedesc'); + $filetype = $msg['file_type']; + $realname = $msg['realname']; + + + $sql = "insert into attachments (filename,filetype,filedesc,userid,filesize,realname) values ('$filename','$filetype','$filedesc','$u_id','$filesize','$realname') RETURNING id"; + $sth = $this->db->prepare($sql); + $sth->execute(); + $att = $sth->fetch(PDO::FETCH_ASSOC); + $msg['attid'] = $attid = $att['id']; + + $msg['html'] = $realname.'['. round($filesize/1024,2) .' kb]
'; + echo Zend_Json::encode($msg); + exit(); + + + + }else{ + $msg['error'] = '附件上传失败:'.$msg['error']; + @unlink($filename); + echo Zend_Json::encode($msg); + exit(); + } + + }catch(Exception $e){ + $msg['error'] = "错误:".$e->getMessage(); + echo Zend_Json::encode($msg); + exit(); + } + }//文件上传 + + }//文献管理 //文档管理 function documentAction(){ diff --git a/application/default/views/scripts/author/document-upload.phtml b/application/default/views/scripts/author/document-upload.phtml index 0f867f19..0871373d 100644 --- a/application/default/views/scripts/author/document-upload.phtml +++ b/application/default/views/scripts/author/document-upload.phtml @@ -3,7 +3,7 @@ 数据上传 - + @@ -111,7 +111,7 @@ function Submit(){ function deleteatt(attid){ $.ajax({ type:"POST", - url:'/submit/upload/ac/del/id/'+attid, + url:'/service/delreviewatt/id/'+attid, data:'', success:function(html){ $('#uploadedItem_'+attid).remove(); diff --git a/application/default/views/scripts/author/literature-add.phtml b/application/default/views/scripts/author/literature-add.phtml new file mode 100644 index 00000000..045a7ee9 --- /dev/null +++ b/application/default/views/scripts/author/literature-add.phtml @@ -0,0 +1,133 @@ + + + + +数据上传 + + + + + + + + + + + + + +
+
+ +
+
+

+
+
+ + 数据作者的文献 + 数据用户的文献
+ +

+
+ +

+

+

+

+
+ +

+
+
+
+
+ + + + diff --git a/application/default/views/scripts/author/literature-bydata.phtml b/application/default/views/scripts/author/literature-bydata.phtml index 0163967e..02b5e2c9 100644 --- a/application/default/views/scripts/author/literature-bydata.phtml +++ b/application/default/views/scripts/author/literature-bydata.phtml @@ -2,9 +2,9 @@ $this->headTitle($this->config->title->site); $this->headTitle($this->config->title->author); $this->headTitle()->setSeparator(' - '); -$this->headScript()->appendFile('/js/jquery-1.7.min.js'); +$this->headScript()->appendFile('/js/jquery-1.7.min.js'); $this->headScript()->appendFile('/js/jquery.colorbox-min.js'); -$this->headLink()->appendStylesheet('/css/author.css'); +$this->headLink()->appendStylesheet('/css/author.css'); $this->headLink()->appendStylesheet('/css/colorbox.css'); $this->breadcrumb('首页'); $this->breadcrumb('数据作者'); @@ -23,7 +23,7 @@ $this->breadcrumb()->setSeparator(' > ');
@@ -42,9 +42,9 @@ $this->breadcrumb()->setSeparator(' > '); $autoindex++;?>
  • -

    共有数据文献篇。 - 【 查看详细 - | 添加文献 +

    共有数据文献篇。 + 【 查看详细 + | 添加文献

  • 处理中出现错误,请刷新页面后重试

    '}); } }); -} -$(".inline").colorbox({inline:true, width:"50%"}); +} +$(".iframe").colorbox({iframe:true, width:"60%", height:"80%"}); +$(".inline").colorbox({inline:true, width:"50%"}); function commit(id){ action('add&ref='+$('#ref').val()+'&reftype='+$('#reftype').val(),id); } - +