diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index 616c90fc..f6a752a0 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -1,6 +1,7 @@ _helper->viewRenderer('ref-add'); $id = $this->_getParam('id'); + $attid = $this->_getParam('attid'); if(!empty($submit)) { @@ -1160,9 +1162,18 @@ class Admin_DataController extends Zend_Controller_Action view::Post($this,$msg,"/admin/data/ref/ac/add"); } }else{ + $this->view->data = array(); if(!empty($id) && is_numeric($id)) { $this->view->data = $reference->getOneReferenceData($id); + }else{ + if(!empty($attid)) + { + $files = new Files(); + $attfile = $files->getOne($attid); + $this->view->data['attid'] = $attid; + $this->view->data['file'] = $attfile; + } } } @@ -1189,6 +1200,21 @@ class Admin_DataController extends Zend_Controller_Action return true; } + //批量上传 + if($ac == "multiupload") + { + $this->_helper->viewRenderer('ref-multiupload'); + return true; + } + + //文件管理 + if($ac == "files") + { + $this->_helper->viewRenderer('ref-files'); + view::addPaginator($reference->getReferenceFiles(),$this,10); + return true; + } + }//文献管理 refAction() /* diff --git a/application/admin/views/scripts/data/ref-add.phtml b/application/admin/views/scripts/data/ref-add.phtml index e9b4f818..cc4ceee1 100644 --- a/application/admin/views/scripts/data/ref-add.phtml +++ b/application/admin/views/scripts/data/ref-add.phtml @@ -45,6 +45,12 @@ table thead tr th {background:#EBF2F6;} +
+ +
+ "> +
+
@@ -58,7 +64,7 @@ table thead tr th {background:#EBF2F6;}
- +
diff --git a/application/admin/views/scripts/data/ref-files.phtml b/application/admin/views/scripts/data/ref-files.phtml new file mode 100644 index 00000000..9bf1e160 --- /dev/null +++ b/application/admin/views/scripts/data/ref-files.phtml @@ -0,0 +1,105 @@ +headTitle($this->config->title->site); +$this->headTitle('后台管理'); +$this->headTitle()->setSeparator(' - '); +$this->breadcrumb('首页'); +$this->breadcrumb('数据管理'); +$this->breadcrumb('文献管理'); +$this->breadcrumb()->setSeparator(' > '); +$this->theme->AppendPlus($this,'colorbox'); +$this->theme->AppendPlus($this,'admin_plugin'); +?> + +
+
+ partial('data/left.phtml'); ?> +
+
+
+ partial('data/ref-nav.phtml',array('ac'=>$this->ac)); ?> +
+
+
+
+ + +
+
+
+ error)) { ?> + error ?> + + msg)) { ?> + msg ?> + +
+ paginator)): ?> + + + + + + + + + + paginator as $item): + $autoindex++;?> + + + + + + + +
文件名状态操作
未编辑':"已编辑" ?> + 编辑 + 删除 +
+ + +
+ +
+
+ + \ No newline at end of file diff --git a/application/admin/views/scripts/data/ref-multiupload.phtml b/application/admin/views/scripts/data/ref-multiupload.phtml new file mode 100644 index 00000000..af777c89 --- /dev/null +++ b/application/admin/views/scripts/data/ref-multiupload.phtml @@ -0,0 +1,119 @@ +headTitle($this->config->title->site); +$this->headTitle('后台管理'); +$this->headTitle()->setSeparator(' - '); +$this->breadcrumb('首页'); +$this->breadcrumb('数据管理'); +$this->breadcrumb('文献管理'); +$this->breadcrumb()->setSeparator(' > '); +$this->theme->AppendPlus($this,'colorbox'); +$this->theme->AppendPlus($this,"uploadify"); +$this->theme->AppendPlus($this,'admin_plugin'); +?> + +
+
+ partial('data/left.phtml'); ?> +
+
+
+ partial('data/ref-nav.phtml',array('ac'=>$this->ac)); ?> +
+ error)) { ?> + error ?> + + msg)) { ?> + msg ?> + +
+
+ +
+ +
+
+
+ +
+ +
+
+ + +data['attid']) && !empty($this->data['attid'])){ ?> +' /> + + \ No newline at end of file diff --git a/application/module/Reference/Reference.php b/application/module/Reference/Reference.php index fe936e0e..dde39619 100644 --- a/application/module/Reference/Reference.php +++ b/application/module/Reference/Reference.php @@ -170,5 +170,16 @@ class Reference return $row; } + + //获得reference类型的附件 + public function getReferenceFiles() + { + $sql = "SELECT att.*,ref.attid,ref.id as refid FROM {$this->table->attachments} att + LEFT JOIN {$this->table->reference} ref ON att.id=ref.attid + WHERE att.filetype='reference'"; + $rs = $this->db->query($sql); + $rows = $rs->fetchAll(); + return $rows; + } } \ No newline at end of file