From 044217117a7516ebbf624eee3efe955cdbf2aa01 Mon Sep 17 00:00:00 2001 From: sunhao Date: Sun, 27 Oct 2024 13:56:07 +0800 Subject: [PATCH] * [story #68481] implement doc-quick control method. --- module/doc/config.php | 6 ++++++ module/doc/control.php | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/module/doc/config.php b/module/doc/config.php index c6667c69e5..85428c08b7 100644 --- a/module/doc/config.php +++ b/module/doc/config.php @@ -115,3 +115,9 @@ $config->doc->showfiles->actionList['download']['hint'] = $lang->doc->download $config->doc->showfiles->actionList['download']['text'] = $lang->doc->download; $config->doc->showfiles->actionList['download']['url'] = array('module' => 'file', 'method' => 'download', 'params' => 'fileID={id}'); $config->doc->showfiles->actionList['download']['target'] = '_blank'; + +$config->doc->quickMenu = array(); +$config->doc->quickMenu['view'] = array('id' => 1, 'name' => $lang->doc->myView); +$config->doc->quickMenu['collect'] = array('id' => 2, 'name' => $lang->doc->myCollection); +$config->doc->quickMenu['createdby'] = array('id' => 3, 'name' => $lang->doc->myCreation); +$config->doc->quickMenu['editedby'] = array('id' => 4, 'name' => $lang->doc->myEdited); diff --git a/module/doc/control.php b/module/doc/control.php index 4343ab1ed5..abdc727f35 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -1529,6 +1529,45 @@ class doc extends control $this->display(); } + /** + * Doc quick access page. + * 快捷访问页面。 + * + * @param string $type 'view'|'collect'|'createdby'|'editedby' + * @param int $docID + * @param string $orderBy + * @param int $recPerPage + * @param int $pageID + * @access public + * @return void + */ + public function quick(string $type = 'view', int $docID = 0, string $orderBy = '', int $recPerPage = 20, int $pageID = 1) + { + if(!isset($this->config->doc->quickMenu[$type])) $type = 'view'; + $menu = $this->config->doc->quickMenu[$type]; + + $currentUser = $this->app->user->account; + $docs = $this->doc->getMineList($type, 'all', 0, $orderBy); + foreach($docs as $doc) + { + unset($doc->draft); + $doc->originLIb = $doc->lib; + $doc->lib = $menu['id']; + $doc->isCollector = strpos($doc->collector, ',' . $currentUser . ',') !== false; + } + + $this->view->docs = $docs; + $this->view->menu = $menu; + $this->view->type = $type; + $this->view->docID = $docID; + $this->view->orderBy = $orderBy; + $this->view->recPerPage = $recPerPage; + $this->view->pageID = $pageID; + $this->view->users = $this->loadModel('user')->getPairs('noclosed,noletter'); + $this->view->title = $this->lang->doc->quick; + $this->display(); + } + /** * Ajax: Get doc space data. * Ajax: 获取文档空间数据。