diff --git a/module/doc/control.php b/module/doc/control.php index 59b50826b9..4858f4c5da 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -594,7 +594,7 @@ class doc extends control * @access public * @return void */ - public function showFiles($type, $objectID, $recTotal = 0, $recPerPage = 20, $pageID = 1) + public function showFiles($type, $objectID, $viewType='card', $orderBy='t1.id_desc', $recTotal=0, $recPerPage=20, $pageID=1) { $uri = $this->app->getURI(true); $this->app->session->set('taskList', $uri); @@ -648,10 +648,16 @@ class doc extends control $this->view->title = $object->name; $this->view->position[] = $object->name; - $this->view->type = $type; - $this->view->object = $object; - $this->view->files = $this->doc->getLibFiles($type, $objectID, $pager); - $this->view->pager = $pager; + $this->view->type = $type; + $this->view->object = $object; + $this->view->files = $this->doc->getLibFiles($type, $objectID, $orderBy, $pager); + $this->view->pager = $pager; + $this->view->viewType = $viewType; + $this->view->orderBy = $orderBy; + $this->view->objectID = $objectID; + $this->view->recTotal = $recTotal; + $this->view->recPerPage = $recPerPage; + $this->display(); } diff --git a/module/doc/lang/en.php b/module/doc/lang/en.php index 3fa42b5348..290511696c 100644 --- a/module/doc/lang/en.php +++ b/module/doc/lang/en.php @@ -36,6 +36,10 @@ $lang->doc->whiteList = 'White List'; $lang->doc->contentType = 'Document Format'; $lang->doc->separator = ""; $lang->doc->fileTitle = 'File Title'; +$lang->doc->filePath = 'File Path'; +$lang->doc->extension = 'Extension'; +$lang->doc->size = 'Size'; +$lang->doc->download = 'Download'; $lang->doc->moduleDoc = 'By Module'; $lang->doc->searchDoc = 'By Search'; diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php index 9a3237b815..b06834d3a3 100644 --- a/module/doc/lang/zh-cn.php +++ b/module/doc/lang/zh-cn.php @@ -36,6 +36,10 @@ $lang->doc->whiteList = '白名单'; $lang->doc->contentType = '文档格式'; $lang->doc->separator = ""; $lang->doc->fileTitle = '附件名'; +$lang->doc->filePath = '地址'; +$lang->doc->extension = '类型'; +$lang->doc->size = '大小'; +$lang->doc->download = '下载'; $lang->doc->moduleDoc = '按模块浏览'; $lang->doc->searchDoc = '搜索'; diff --git a/module/doc/lang/zh-tw.php b/module/doc/lang/zh-tw.php index 3199f1e590..6404af8c1b 100644 --- a/module/doc/lang/zh-tw.php +++ b/module/doc/lang/zh-tw.php @@ -36,6 +36,10 @@ $lang->doc->whiteList = '白名單'; $lang->doc->contentType = '文檔格式'; $lang->doc->separator = ""; $lang->doc->fileTitle = '附件名'; +$lang->doc->filePath = '地址'; +$lang->doc->extension = '類型'; +$lang->doc->size = '大小'; +$lang->doc->download = '下載'; $lang->doc->moduleDoc = '按模組瀏覽'; $lang->doc->searchDoc = '搜索'; diff --git a/module/doc/model.php b/module/doc/model.php index 0411bf9e4f..03c1449135 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -914,7 +914,7 @@ class docModel extends model * @access public * @return array */ - public function getLibFiles($type, $objectID, $pager = null) + public function getLibFiles($type, $objectID, $orderBy, $pager = null) { if($type != 'project' and $type != 'product') return true; $this->loadModel('file'); @@ -936,7 +936,7 @@ class docModel extends model ->orWhere("(objectType = 'productplan' and objectID in ($planIdList))") ->markRight(1) ->beginIF($searchTitle)->andWhere('title')->like("%{$searchTitle}%")->fi() - ->orderBy('t1.id desc') + ->orderBy($orderBy) ->page($pager) ->fetchAll('id'); } @@ -952,7 +952,7 @@ class docModel extends model ->orWhere("(objectType = 'build' and objectID in ($buildIdList))") ->markRight(1) ->beginIF($searchTitle)->andWhere('title')->like("%{$searchTitle}%")->fi() - ->orderBy('t1.id desc') + ->orderBy($orderBy) ->page($pager) ->fetchAll('id'); } diff --git a/module/doc/view/showfiles.html.php b/module/doc/view/showfiles.html.php index 06410948cc..d272ff9c7a 100644 --- a/module/doc/view/showfiles.html.php +++ b/module/doc/view/showfiles.html.php @@ -14,7 +14,7 @@
doclib->files?>
-
+ config->requestType == 'GET') { @@ -22,6 +22,7 @@ echo html::hidden('f', 'showFiles'); echo html::hidden('type', $type); echo html::hidden('objectID', $object->id); + echo html::hidden('viewType', ($viewType == 'list' ? 'list' : 'card')); echo html::hidden('recTotal', isset($this->get->recTotal) ? $this->get->recTotal : 0); echo html::hidden('recPerPage', isset($this->get->recPerPage) ? $this->get->recPerPage : 0); echo html::hidden('pageID', isset($this->get->pageID) ? $this->get->pageID : 0); @@ -35,8 +36,65 @@
+
+ 切换界面布局"); + ?> +
+ + +
+ + + + + + + + + + + + + + + + + pathname)) continue;?> + + + + + + + + + + + + + + + + + +
doc->id);?> doc->fileTitle);?> doc->filePath);?> doc->extension);?> doc->size);?> doc->addedBy);?> doc->addedDate);?> actions;?>
+ id;?> + + title;?> + pathname;?> extension;?>size / 1024 , 1) . 'K';?>addedBy) ? $file->addedBy : '';?>addedDate) ? substr($file->addedDate, 0, 10) : '';?> + id", $lang->doc->download, "data-toggle='modal'"); + commonModel::printLink('file', 'delete', "fileID=$file->id", $lang->delete, "class='deleter'"); + ?> +
+ show();?> +
+
+
pathname)) continue;?> @@ -88,6 +146,8 @@
show();?>
+ +