From a8e413c921ce3cf39372e5b4db0c5bff5bc3983b Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Wed, 28 Jul 2021 13:22:43 +0800 Subject: [PATCH 1/7] * Fix bugs. --- lib/pager/pager.class.php | 2 +- module/common/lang/menu.php | 6 +++--- module/doc/control.php | 6 ------ 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/pager/pager.class.php b/lib/pager/pager.class.php index 50e9f01746..1dd0dac22a 100644 --- a/lib/pager/pager.class.php +++ b/lib/pager/pager.class.php @@ -52,7 +52,7 @@ class pager extends basePager { /* 如果设置了请求的原始方法名,则把其赋值给$this->methodName。*/ /* If the original method name of the request is set, assign it to $this->methodName. */ - if(isset($this->app->rawMethod) and $this->app->rawModule != 'doc') + if(isset($this->app->rawMethod)) { $this->methodName = $this->app->rawMethod; } diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index 10f33be06f..4cbb6a8d31 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -335,9 +335,9 @@ $lang->doc->menu->dashboard = array('link' => "{$lang->dashboard}|doc|index"); $lang->doc->menu->recent = array('link' => "{$lang->doc->recent}|doc|browse|browseTyp=byediteddate", 'alias' => 'recent'); $lang->doc->menu->my = array('link' => "{$lang->doc->my}|doc|browse|browseTyp=openedbyme", 'alias' => 'my'); $lang->doc->menu->collect = array('link' => "{$lang->doc->favorite}|doc|browse|browseTyp=collectedbyme", 'alias' => 'collect'); -$lang->doc->menu->product = array('link' => "{$lang->doc->product}|doc|tableContents|type=product", 'alias' => 'product'); -if($config->systemMode == 'new') $lang->doc->menu->project = array('link' => "{$lang->doc->project}|doc|tableContents|type=project", 'alias' => 'project'); -if($config->systemMode == 'classic') $lang->doc->menu->execution = array('link' => "{$lang->doc->execution}|doc|tableContents|type=execution", 'alias' => 'execution'); +$lang->doc->menu->product = array('link' => "{$lang->doc->product}|doc|tableContents|type=product", 'alias' => 'showfiles,product'); +if($config->systemMode == 'new') $lang->doc->menu->project = array('link' => "{$lang->doc->project}|doc|tableContents|type=project", 'alias' => 'showfiles,project'); +if($config->systemMode == 'classic') $lang->doc->menu->execution = array('link' => "{$lang->doc->execution}|doc|tableContents|type=execution", 'alias' => 'showfiles,execution'); $lang->doc->menu->custom = array('link' => "{$lang->doc->custom}|doc|tableContents|type=custom", 'alias' => 'custom'); $lang->doc->dividerMenu = ',product,'; diff --git a/module/doc/control.php b/module/doc/control.php index e7489c8cad..f655c50066 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -776,8 +776,6 @@ class doc extends control $libs = $this->doc->getLibsByObject('product', $objectID); $this->lang->modulePageNav = $this->doc->select($type, $objects, $objectID, $libs); - - $this->app->rawMethod = 'product'; } else if($type == 'project') { @@ -787,8 +785,6 @@ class doc extends control $libs = $this->doc->getLibsByObject('project', $objectID); $this->lang->modulePageNav = $this->doc->select($type, $objects, $objectID, $libs); - - $this->app->rawMethod = 'project'; } else if($type == 'execution') { @@ -797,8 +793,6 @@ class doc extends control $libs = $this->doc->getLibsByObject('execution', $objectID); $this->lang->modulePageNav = $this->doc->select($type, $objects, $objectID, $libs); - - $this->app->rawMethod = 'execution'; } $openApp = strpos('doc,product,project,execution', $this->app->openApp) !== false ? $this->app->openApp : 'doc'; From 034fe1fe7a4a3786a8a9fc5343cb04d70f5b5dd7 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Wed, 28 Jul 2021 13:38:00 +0800 Subject: [PATCH 2/7] * Fix bug #13853. --- module/doc/model.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/module/doc/model.php b/module/doc/model.php index 4c278c3985..d46e8591b4 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -1793,6 +1793,12 @@ class docModel extends model return $html; } + /** + * Build collect button from document. + * + * @access public + * @return string + */ public function buildCollectButton4Doc() { $allLibs = array_keys($this->getLibs('all')); @@ -2160,7 +2166,7 @@ class docModel extends model foreach($moduleDocs[$module->id] as $doc) { if(!$docID and $currentMethod != 'tablecontents') $docID = $doc->id; - $treeMenu[$module->id] = 'id == $docID ? ' class="active"' : '') . '>'; + $treeMenu[$module->id] .= 'id == $docID ? ' class="active"' : '') . '>'; if($currentMethod == 'tablecontents') { From 49640a9e3b7ca3988a0c90c2bb232c9d35edaead Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Wed, 28 Jul 2021 13:42:07 +0800 Subject: [PATCH 3/7] * Add language for files. --- module/doc/lang/de.php | 5 +++++ module/doc/lang/en.php | 5 +++++ module/doc/lang/fr.php | 5 +++++ module/doc/lang/vi.php | 5 +++++ module/doc/lang/zh-tw.php | 9 +++++++-- module/doc/model.php | 15 +++++++++++---- 6 files changed, 38 insertions(+), 6 deletions(-) diff --git a/module/doc/lang/de.php b/module/doc/lang/de.php index d0d1663b6a..e39bbd0237 100644 --- a/module/doc/lang/de.php +++ b/module/doc/lang/de.php @@ -39,6 +39,7 @@ $lang->doc->fileTitle = 'Dateiname'; $lang->doc->filePath = 'Dateipfad'; $lang->doc->extension = 'Erweiterung'; $lang->doc->size = 'Größe der Anlage'; +$lang->doc->source = 'Source'; $lang->doc->download = 'Download'; $lang->doc->acl = 'Rechte'; $lang->doc->fileName = 'Files'; @@ -212,6 +213,10 @@ $lang->doc->noticeAcl['doc']['private'] = 'Only the one who created it can acces $lang->doc->placeholder = new stdclass(); $lang->doc->placeholder->url = 'Url'; +$lang->doc->summary = "Total files on this page: %s , total size: %s, %s"; +$lang->doc->ge = ':'; +$lang->doc->point = '.'; + $lang->doclib = new stdclass(); $lang->doclib->name = 'Name'; $lang->doclib->control = 'Zugriffskontrolle'; diff --git a/module/doc/lang/en.php b/module/doc/lang/en.php index 85839271bf..15f88c2f59 100644 --- a/module/doc/lang/en.php +++ b/module/doc/lang/en.php @@ -40,6 +40,7 @@ $lang->doc->fileTitle = 'File Name'; $lang->doc->filePath = 'File Path'; $lang->doc->extension = 'Extension'; $lang->doc->size = 'Files Size'; +$lang->doc->source = 'Source'; $lang->doc->download = 'Download'; $lang->doc->acl = 'Right'; $lang->doc->fileName = 'Files'; @@ -217,6 +218,10 @@ $lang->doc->noticeAcl['doc']['private'] = 'Only the one who created it can acces $lang->doc->placeholder = new stdclass(); $lang->doc->placeholder->url = 'URL'; +$lang->doc->summary = "Total files on this page: %s , total size: %s, %s"; +$lang->doc->ge = ':'; +$lang->doc->point = '.'; + $lang->doclib = new stdclass(); $lang->doclib->name = 'Name'; $lang->doclib->control = 'Access Control'; diff --git a/module/doc/lang/fr.php b/module/doc/lang/fr.php index 3776a77a2d..2f2c81cd50 100644 --- a/module/doc/lang/fr.php +++ b/module/doc/lang/fr.php @@ -39,6 +39,7 @@ $lang->doc->fileTitle = 'Nom du Fichier'; $lang->doc->filePath = 'Chemin Fichier'; $lang->doc->extension = 'Extension'; $lang->doc->size = 'Taille de la pièce jointe'; +$lang->doc->source = 'Source'; $lang->doc->download = 'Téléchargement'; $lang->doc->acl = 'Droit'; $lang->doc->fileName = 'Fichiers'; @@ -212,6 +213,10 @@ $lang->doc->noticeAcl['doc']['private'] = 'Seulement celui qui a ajouté le docu $lang->doc->placeholder = new stdclass(); $lang->doc->placeholder->url = 'URL'; +$lang->doc->summary = "Total files on this page: %s , total size: %s, %s"; +$lang->doc->ge = ':'; +$lang->doc->point = '.'; + $lang->doclib = new stdclass(); $lang->doclib->name = 'Nom'; $lang->doclib->control = "Contrôle d'Accès"; diff --git a/module/doc/lang/vi.php b/module/doc/lang/vi.php index 5753c6396e..69aef83cf5 100644 --- a/module/doc/lang/vi.php +++ b/module/doc/lang/vi.php @@ -39,6 +39,7 @@ $lang->doc->fileTitle = 'File tên'; $lang->doc->filePath = 'File Path'; $lang->doc->extension = 'Extension'; $lang->doc->size = 'Cỡ miếng'; +$lang->doc->source = 'Source'; $lang->doc->download = 'Tải về'; $lang->doc->acl = 'Right'; $lang->doc->fileName = 'Files'; @@ -212,6 +213,10 @@ $lang->doc->noticeAcl['doc']['private'] = 'Chỉ the one who created it có th $lang->doc->placeholder = new stdclass(); $lang->doc->placeholder->url = 'URL'; +$lang->doc->summary = "Total files on this page: %s , total size: %s, %s"; +$lang->doc->ge = ':'; +$lang->doc->point = '.'; + $lang->doclib = new stdclass(); $lang->doclib->name = 'Tên'; $lang->doclib->control = 'Quyền truy cập'; diff --git a/module/doc/lang/zh-tw.php b/module/doc/lang/zh-tw.php index 49258a638e..5f016ddea8 100644 --- a/module/doc/lang/zh-tw.php +++ b/module/doc/lang/zh-tw.php @@ -11,7 +11,7 @@ */ /* 欄位列表。*/ $lang->doc->common = '文檔'; -$lang->doc->id = '文檔編號'; +$lang->doc->id = '文檔'; $lang->doc->product = '所屬' . $lang->productCommon; $lang->doc->project = '所屬項目'; $lang->doc->execution = '所屬' . $lang->executionCommon; @@ -36,10 +36,11 @@ $lang->doc->fileObject = '所屬對象'; $lang->doc->whiteList = '白名單'; $lang->doc->contentType = '文檔格式'; $lang->doc->separator = ""; -$lang->doc->fileTitle = '附件名'; +$lang->doc->fileTitle = '附件名稱'; $lang->doc->filePath = '地址'; $lang->doc->extension = '類型'; $lang->doc->size = '附件大小'; +$lang->doc->source = '來源'; $lang->doc->download = '下載'; $lang->doc->acl = '權限'; $lang->doc->fileName = '附件'; @@ -205,6 +206,10 @@ $lang->doc->noticeAcl['doc']['private'] = '只有創建者自己可以訪問。' $lang->doc->placeholder = new stdclass(); $lang->doc->placeholder->url = '相應的連結地址'; +$lang->doc->summary = "本頁共 %s 個附件,共計 %s,其中%s。"; +$lang->doc->ge = '個'; +$lang->doc->point = '、'; + $lang->doclib = new stdclass(); $lang->doclib->name = '文檔庫名稱'; $lang->doclib->control = '訪問控制'; diff --git a/module/doc/model.php b/module/doc/model.php index 3212a48128..13475f0388 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -2059,7 +2059,7 @@ class docModel extends model $selected = $key == $libID ? 'selected' : ''; $output .= html::a(inlink($methodName, "type=$type&objectID=$objectID&libID=$key"), $lib->name, '', "class='$selected' data-app='{$this->app->openApp}'"); } - if($type != 'custom') + if($type != 'custom' and $type != 'book') { $selected = empty($libID) ? 'selected' : ''; $output .= html::a(inlink('showFiles', "type=$type&objectID=$objectID"), $this->lang->doclib->files, '', "class='$selected' data-app='{$this->app->openApp}'"); @@ -2227,10 +2227,17 @@ class docModel extends model $extensionNum = count($extensionCount); foreach($extensionCount as $extension => $count) { - $extensionSummary .= $extension . ' ' . $count . $this->lang->doc->ge; + if(in_array($this->app->getClientLang(), ['zh-cn','zh-tw'])) + { + $extensionSummary .= $extension . ' ' . $count . $this->lang->doc->ge; - $extensionNum--; - if(!empty($extensionNum)) $extensionSummary .= $this->lang->doc->point; + $extensionNum--; + if(!empty($extensionNum)) $extensionSummary .= $this->lang->doc->point; + } + else + { + $extensionSummary .= $extension . ' ' . $this->lang->doc->ge . ' ' . $count . $this->lang->doc->point; + } } return sprintf($this->lang->doc->summary, $filesCount, $sizeCount, $extensionSummary); From 79ed62833fd74be2948603b1a906851c5e5fa028 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Wed, 28 Jul 2021 13:56:34 +0800 Subject: [PATCH 4/7] * Fix bug #13872. --- module/doc/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/doc/model.php b/module/doc/model.php index 13475f0388..c62fe67cca 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -1069,7 +1069,7 @@ class docModel extends model } else { - $objectLibs = $this->dao->select('*')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->andWhere($type)->eq($objectID)->orderBy('`order`, id')->fetchAll('id'); + $objectLibs = $this->dao->select('*')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->andWhere($type)->eq($objectID)->andWhere('type')->eq($type)->orderBy('`order`, id')->fetchAll('id'); } if($type == 'product') From 82239404f18f96bf7f041569c02826f47798fd3c Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Wed, 28 Jul 2021 14:03:48 +0800 Subject: [PATCH 5/7] * Fix an error. --- module/doc/model.php | 1 - 1 file changed, 1 deletion(-) diff --git a/module/doc/model.php b/module/doc/model.php index c62fe67cca..17f88c28c7 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -1302,7 +1302,6 @@ class docModel extends model ->orWhere("(objectType = 'story' and objectID in ($storyIdList))") ->orWhere("(objectType = 'bug' and objectID in ($bugIdList))") ->orWhere("(objectType = 'release' and objectID in ($releaseIdList))") - ->orWhere("(objectType = 'productplan' and objectID in ($planIdList))") ->orWhere("(objectType = 'testreport' and objectID in ($testReportIdList))") ->orWhere("(objectType = 'testcase' and objectID in ($caseIdList))") ->markRight(1) From 4394d810d021936d34c072c0515b7a2fc9a30782 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Wed, 28 Jul 2021 14:04:01 +0800 Subject: [PATCH 6/7] * Adjust page. --- module/project/css/browse.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/project/css/browse.css b/module/project/css/browse.css index b1e0db2860..99c737c8f5 100644 --- a/module/project/css/browse.css +++ b/module/project/css/browse.css @@ -51,5 +51,5 @@ td.c-actions {overflow: visible;} #cards .project-actions .menu-actions {padding-right: 20px;} #cards .project-actions ul {min-width: 35px; padding: 5px 6px;} #cards .project-actions .dropdown-hover:hover>.dropdown-menu ul, .open>.dropdown-menu ul {display: flex;} -#cards .btn.btn-action, .c-actions .btn {margin-bottom: -3px !important; margin-right: 5px;} +#cards .menu-actions .btn.btn-action {margin-bottom: -3px !important; margin-right: 5px;} #cards .icon-ellipsis-v {font-size: 13px;} From 77698397ad6cc1b0979b90678185f345da3188c5 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Wed, 28 Jul 2021 14:30:45 +0800 Subject: [PATCH 7/7] * Fix bug #13846. --- module/doc/control.php | 1 + module/doc/view/tablecontents.html.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index f655c50066..95d1ff7c62 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -1224,6 +1224,7 @@ class doc extends control $this->view->title = $title; $this->view->type = $type; + $this->view->libs = $libs; $this->view->objectID = $objectID; $this->view->libID = $libID; $this->view->moduleTree = $moduleTree; diff --git a/module/doc/view/tablecontents.html.php b/module/doc/view/tablecontents.html.php index 942c7deb6f..6e2f925477 100644 --- a/module/doc/view/tablecontents.html.php +++ b/module/doc/view/tablecontents.html.php @@ -42,7 +42,7 @@ if(empty($type)) $type = 'product'; echo "