From a669f56285f05da032996ab6ba3724eb0b04ba74 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Mon, 10 Apr 2023 11:24:09 +0800 Subject: [PATCH] * Code for task #89910. --- module/doc/config.php | 12 +++++++++ module/doc/control.php | 5 ++-- module/doc/css/tablecontents.css | 2 +- module/doc/lang/de.php | 2 ++ module/doc/lang/en.php | 2 ++ module/doc/lang/fr.php | 2 ++ module/doc/lang/zh-cn.php | 4 ++- module/doc/model.php | 31 ++++++++++++++++++------ module/doc/view/mydoclist.html.php | 39 +++++++++++++++++++++++++++--- 9 files changed, 84 insertions(+), 15 deletions(-) diff --git a/module/doc/config.php b/module/doc/config.php index f16bf98786..2b4fa0e959 100644 --- a/module/doc/config.php +++ b/module/doc/config.php @@ -37,6 +37,18 @@ $config->doc->iconList['word'] = 'word'; $config->doc->iconList['ppt'] = 'ppt'; $config->doc->iconList['excel'] = 'excel'; +$config->doc->objectIconList['product'] = 'icon-product'; +$config->doc->objectIconList['project'] = 'icon-project'; +$config->doc->objectIconList['execution'] = 'icon-run'; +$config->doc->objectIconList['mine'] = 'icon-contacts'; +$config->doc->objectIconList['custom'] = 'icon-groups'; + +$config->doc->spaceMethod['mine'] = 'mySpace'; +$config->doc->spaceMethod['product'] = 'productSpace'; +$config->doc->spaceMethod['project'] = 'projectSpace'; +$config->doc->spaceMethod['execution'] = 'projectSpace'; +$config->doc->spaceMethod['custom'] = 'tableContents'; + $config->doc->search['module'] = 'doc'; $config->doc->search['fields']['title'] = $lang->doc->title; $config->doc->search['fields']['id'] = $lang->doc->id; diff --git a/module/doc/control.php b/module/doc/control.php index 1a9218b5b0..d2e295da78 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -55,7 +55,7 @@ class doc extends control /** * My space. * - * @param string $type mine + * @param string $type mine|view|collect|createBy * @param int $libID * @param int $moduleID * @param string $browseType all|draft|bysearch @@ -81,6 +81,7 @@ class doc extends control /* Build the search form. */ $browseType = strtolower($browseType); + $type = strtolower($type); $queryID = $browseType == 'bysearch' ? (int)$param : 0; $params = "libID=$libID&moduleID=$moduleID&browseType=bySearch¶m=myQueryID&orderBy=$orderBy"; if($this->app->rawMethod == 'mySpace') $param = "type=$type&" . $params; @@ -110,7 +111,7 @@ class doc extends control $this->view->pager = $pager; $this->view->type = $type; $this->view->objectID = 0; - $this->view->canExport = 0; + $this->view->canExport = common::hasPriv('doc', 'mine2export'); $this->view->libType = 'lib'; $this->display(); diff --git a/module/doc/css/tablecontents.css b/module/doc/css/tablecontents.css index d062e89317..55044c054f 100644 --- a/module/doc/css/tablecontents.css +++ b/module/doc/css/tablecontents.css @@ -47,7 +47,7 @@ span.dotted-line+a {display: block;} .is-sorting > li ul {display: none!important;} li.drag-shadow ul {display: none!important;} -.table .c-name > .doc-title {display: inline-block; max-width: 90%; overflow: hidden; background: transparent; padding-right:0px;} +.table .c-name > .doc-title {display: inline-block; max-width: calc(100% - 80px); overflow: hidden; background: transparent; padding-right:0px;} .table .c-name > .draft {background-color:rgba(129, 102, 238, 0.12); color:#8166EE;} .table .c-name > .ajaxCollect {float: right; position: relative; right: 10px; top: 0px;} table.table > thead > tr {height: 32px;} diff --git a/module/doc/lang/de.php b/module/doc/lang/de.php index e6d2accdf2..0e3290adb3 100644 --- a/module/doc/lang/de.php +++ b/module/doc/lang/de.php @@ -122,6 +122,8 @@ $lang->doc->closed = 'Closed'; $lang->doc->saveDraft = 'Save Draft'; $lang->doc->defaultSave = 'Default Save: '; $lang->doc->position = 'Position'; +$lang->doc->person = 'Person'; +$lang->doc->team = 'Team'; $lang->doc->moduleDoc = 'Nach Modulen'; $lang->doc->searchDoc = 'Suche'; diff --git a/module/doc/lang/en.php b/module/doc/lang/en.php index c8b6ac9d88..91e14c4891 100644 --- a/module/doc/lang/en.php +++ b/module/doc/lang/en.php @@ -122,6 +122,8 @@ $lang->doc->closed = 'Closed'; $lang->doc->saveDraft = 'Save Draft'; $lang->doc->defaultSave = 'Default Save: '; $lang->doc->position = 'Position'; +$lang->doc->person = 'Person'; +$lang->doc->team = 'Team'; $lang->doc->moduleDoc = 'By Module'; $lang->doc->searchDoc = 'Search'; diff --git a/module/doc/lang/fr.php b/module/doc/lang/fr.php index 18bd797704..14ce3a9d05 100644 --- a/module/doc/lang/fr.php +++ b/module/doc/lang/fr.php @@ -122,6 +122,8 @@ $lang->doc->closed = 'Closed'; $lang->doc->saveDraft = 'Save Draft'; $lang->doc->defaultSave = 'Default Save: '; $lang->doc->position = 'Position'; +$lang->doc->person = 'Person'; +$lang->doc->team = 'Team'; $lang->doc->moduleDoc = 'Par Module'; $lang->doc->searchDoc = 'Rechercher'; diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php index d55bc43115..1417c4380a 100644 --- a/module/doc/lang/zh-cn.php +++ b/module/doc/lang/zh-cn.php @@ -83,7 +83,7 @@ $lang->doc->url = '文档URL'; $lang->doc->files = '附件'; $lang->doc->addedBy = '由谁添加'; $lang->doc->addedByAB = '创建者'; -$lang->doc->addedDate = '创建时间'; +$lang->doc->addedDate = '创建日期'; $lang->doc->editedBy = '修改者'; $lang->doc->editedDate = '修改日期'; $lang->doc->lastEditedBy = '最后更新者'; @@ -122,6 +122,8 @@ $lang->doc->closed = '已关闭'; $lang->doc->saveDraft = '存为草稿'; $lang->doc->defaultSave = '默认存入:'; $lang->doc->position = '所在位置'; +$lang->doc->person = '个人'; +$lang->doc->team = '团队'; $lang->doc->moduleDoc = '按模块浏览'; $lang->doc->searchDoc = '搜索'; diff --git a/module/doc/model.php b/module/doc/model.php index 1c838ca42b..5213f3e96f 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -377,8 +377,9 @@ class docModel extends model */ public function getDocsByBrowseType($browseType, $queryID, $moduleID, $sort, $pager) { - $allLibs = array_keys($this->getLibs('all')); - $docIdList = $this->getPrivDocs(0, $moduleID); + $allLibs = $this->getLibs('all'); + $allLibIDList = array_keys($allLibs); + $docIdList = $this->getPrivDocs(0, $moduleID); $files = $this->dao->select('*')->from(TABLE_FILE) ->where('objectType')->eq('doc') @@ -418,7 +419,7 @@ class docModel extends model $docs = $this->dao->select('*')->from(TABLE_DOC) ->where('deleted')->eq(0) ->andWhere($query) - ->andWhere('lib')->in($allLibs) + ->andWhere('lib')->in($allLibIDList) ->beginIF($this->config->doc->notArticleType)->andWhere('type')->notIN($this->config->doc->notArticleType)->fi() ->andWhere('addedBy', 1)->eq($this->app->user->account) ->orWhere('id')->in(array_keys($docIDList)) @@ -431,7 +432,7 @@ class docModel extends model { $docs = $this->dao->select('*')->from(TABLE_DOC) ->where('deleted')->eq(0) - ->andWhere('lib')->in($allLibs) + ->andWhere('lib')->in($allLibIDList) ->beginIF($this->config->doc->notArticleType)->andWhere('type')->notIN($this->config->doc->notArticleType)->fi() ->andWhere('addedBy')->eq($this->app->user->account) ->orderBy($sort) @@ -448,7 +449,7 @@ class docModel extends model $docs = $this->dao->select('*')->from(TABLE_DOC) ->where('deleted')->eq(0) ->andWhere('id')->in(array_keys($docIDList)) - ->andWhere('lib')->in($allLibs) + ->andWhere('lib')->in($allLibIDList) ->beginIF($this->config->doc->notArticleType)->andWhere('type')->notIN($this->config->doc->notArticleType)->fi() ->orderBy($sort) ->page($pager) @@ -460,7 +461,7 @@ class docModel extends model ->where('deleted')->eq(0) ->andWhere('id')->in($docIdList) ->beginIF($this->config->doc->notArticleType)->andWhere('type')->notIN($this->config->doc->notArticleType)->fi() - ->andWhere('lib')->in($allLibs) + ->andWhere('lib')->in($allLibIDList) ->orderBy('editedDate_desc') ->page($pager) ->fetchAll('id'); @@ -470,7 +471,7 @@ class docModel extends model $docs = $this->dao->select('t1.*')->from(TABLE_DOC)->alias('t1') ->leftJoin(TABLE_DOCACTION)->alias('t2')->on("t1.id=t2.doc && t2.action='collect'") ->where('t1.deleted')->eq(0) - ->andWhere('t1.lib')->in($allLibs) + ->andWhere('t1.lib')->in($allLibIDList) ->beginIF($this->config->doc->notArticleType)->andWhere('t1.type')->notIN($this->config->doc->notArticleType)->fi() ->andWhere('t2.actor')->eq($this->app->user->account) ->orderBy($sort) @@ -482,7 +483,8 @@ class docModel extends model /* Get projects, executions and products by docIdList. */ list($projects, $executions, $products) = $this->getObjectsByDoc(array_keys($docs)); - + $mineLibs = $this->getAllLibsByType('mine'); + $customLibs = $this->getAllLibsByType('custom'); $docContents = $this->dao->select('*')->from(TABLE_DOCCONTENT)->where('doc')->in(array_keys($docs))->orderBy('version,doc')->fetchAll('doc'); $modules = array(); @@ -493,6 +495,7 @@ class docModel extends model if(!isset($modules[$doc->lib])) $modules[$doc->lib] = $this->tree->getOptionMenu($doc->lib, 'doc', 0, 0, 'nodeleted', 'all', ' > '); $doc->moduleName = zget($modules[$doc->lib], $doc->module); $doc->moduleName = ltrim($doc->moduleName, '/'); + $doc->libName = zget($allLibs, $doc->lib); foreach($objects as $type => $object) { if(!empty($doc->{$type})) @@ -503,6 +506,18 @@ class docModel extends model break; } } + if(isset($mineLibs[$doc->lib])) + { + $doc->objectID = 0; + $doc->objectName = $this->lang->doc->person; + $doc->objectType = 'mine'; + } + elseif(isset($customLibs[$doc->lib])) + { + $doc->objectID = 0; + $doc->objectName = $this->lang->doc->team; + $doc->objectType = 'custom'; + } $docs[$index]->fileSize = 0; if(isset($files[$index])) diff --git a/module/doc/view/mydoclist.html.php b/module/doc/view/mydoclist.html.php index 5e2b984ee2..c347f0ffbe 100644 --- a/module/doc/view/mydoclist.html.php +++ b/module/doc/view/mydoclist.html.php @@ -15,10 +15,16 @@ body {margin-bottom: 25px;} #docListForm th.c-id {width: 72px;} #docListForm th.c-user {width: 80px;} #docListForm th.c-actions {width: 84px; padding-left: 15px;} -#docListForm .table .c-name > .doc-title {display: inline-block; max-width: 90%; overflow: hidden; background: transparent; padding-right:0px;} +#docListForm .c-module, #docListForm .c-object {width: 120px; overflow: hidden; white-space: nowrap; text-overflow: clip;} +#docListForm .table .c-name > .doc-title {display: inline-block; max-width: calc(100% - 80px); overflow: hidden; background: transparent; padding-right:0px;} #docListForm .table .c-name > .draft {background-color:rgba(129, 102, 238, 0.12); color:#8166EE;} #docListForm .table .c-name > .ajaxCollect {float: right; position: relative; right: 10px; top: 0px;} #docListForm table.table > thead > tr {height: 32px;} +#docListForm .checkbox-primary {line-height: 16px;} +#docListForm table .checkbox-primary {top: -2px;} +#docListForm .checkbox-primary > label {height: 16px; line-height: 16px; padding-left: 16px;} +#docListForm .checkbox-primary > label:before {left: -1px; font-size: 10px;} +#docListForm .checkbox-primary > label:after {width: 12px; height: 12px;}