From c1f648d22a8d8453737dbe6a5134ad06e145d611 Mon Sep 17 00:00:00 2001 From: zenggang Date: Thu, 26 May 2022 05:36:53 +0000 Subject: [PATCH 01/45] * Fix bug#22957 --- module/block/css/dashboard.en.css | 2 ++ module/block/view/projectblock.html.php | 8 ++++---- module/my/css/project.en.css | 1 + module/my/view/project.html.php | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 module/block/css/dashboard.en.css create mode 100644 module/my/css/project.en.css diff --git a/module/block/css/dashboard.en.css b/module/block/css/dashboard.en.css new file mode 100644 index 0000000000..90d1595e5f --- /dev/null +++ b/module/block/css/dashboard.en.css @@ -0,0 +1,2 @@ +.c-leftStories {width: 95px;} +.c-leftTasks, .c-consumed, .c-leftBugs {width: 85px;} diff --git a/module/block/view/projectblock.html.php b/module/block/view/projectblock.html.php index 64d8750cc1..6f7aed43d5 100644 --- a/module/block/view/projectblock.html.php +++ b/module/block/view/projectblock.html.php @@ -14,11 +14,11 @@ project->status;?> project->teamCount;?> - task->consumed;?> + task->consumed;?> project->budget;?> - project->leftStories;?> - project->leftTasks;?> - project->leftBugs;?> + project->leftStories;?> + project->leftTasks;?> + project->leftBugs;?> diff --git a/module/my/css/project.en.css b/module/my/css/project.en.css new file mode 100644 index 0000000000..571f6926a8 --- /dev/null +++ b/module/my/css/project.en.css @@ -0,0 +1 @@ +.c-begin {width: 120px;} diff --git a/module/my/view/project.html.php b/module/my/view/project.html.php index 5b57199850..724d7e38e0 100644 --- a/module/my/view/project.html.php +++ b/module/my/view/project.html.php @@ -39,7 +39,7 @@ project->status);?> - project->begin);?> + project->begin);?> project->end);?> project->budget);?> project->PM);?> From 4efbde2805a9b5b16b8e6bac9644b04c81ce0b1f Mon Sep 17 00:00:00 2001 From: mayue Date: Thu, 26 May 2022 14:49:29 +0800 Subject: [PATCH 02/45] * Fix bug #22972. --- module/projectrelease/model.php | 3 +++ module/release/config.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/module/projectrelease/model.php b/module/projectrelease/model.php index 388eb1345a..5f39246a35 100644 --- a/module/projectrelease/model.php +++ b/module/projectrelease/model.php @@ -109,6 +109,9 @@ class projectreleaseModel extends model $oldRelease = $this->dao->select('*')->from(TABLE_RELEASE)->where('id')->eq($releaseID)->fetch(); $branch = $this->dao->select('branch')->from(TABLE_BUILD)->where('id')->eq((int)$this->post->build)->fetch('branch'); + /* Check build if build is required. */ + if(strpos($this->config->release->edit->requiredFields, 'build') !== false and $this->post->build == false) return dao::$errors['build'] = sprintf($this->lang->error->notempty, $this->lang->release->build); + $release = fixer::input('post')->stripTags($this->config->release->editor->edit['id'], $this->config->allowedTags) ->add('branch', (int)$branch) ->join('mailto', ',') diff --git a/module/release/config.php b/module/release/config.php index 7e52377cd7..e49f950c9e 100644 --- a/module/release/config.php +++ b/module/release/config.php @@ -3,7 +3,7 @@ $config->release = new stdclass(); $config->release->create = new stdclass(); $config->release->edit = new stdclass(); $config->release->create->requiredFields = 'name,date'; -$config->release->edit->requiredFields = 'name,date'; +$config->release->edit->requiredFields = 'name,build,date'; $config->release->editor = new stdclass(); $config->release->editor->create = array('id' => 'desc', 'tools' => 'simpleTools'); From d6017ab11eef2467956d78c014ce3fe64370b26e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Fri, 27 May 2022 08:47:19 +0800 Subject: [PATCH 03/45] * Plan module order by path. --- module/story/model.php | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/module/story/model.php b/module/story/model.php index 81c32d912e..79e7c2a2a2 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2995,13 +2995,30 @@ class storyModel extends model */ public function getPlanStories($planID, $status = 'all', $orderBy = 'id_desc', $pager = null) { - $stories = $this->dao->select('distinct t1.story, t1.plan, t1.order, t2.*') - ->from(TABLE_PLANSTORY)->alias('t1') - ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') - ->where('t1.plan')->eq($planID) - ->beginIF($status and $status != 'all')->andWhere('t2.status')->in($status)->fi() - ->andWhere('t2.deleted')->eq(0) - ->orderBy($orderBy)->page($pager)->fetchAll('id'); + if(strpos($orderBy, 'module') !== false) + { + $orderBy = (strpos($orderBy, 'module_asc') !== false) ? 't3.path asc' : 't3.path desc'; + $stories = $this->dao->select('distinct t1.story, t1.plan, t1.order, t2.*') + ->from(TABLE_PLANSTORY)->alias('t1') + ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') + ->leftJoin(TABLE_MODULE)->alias('t3')->on('t2.module = t3.id') + ->where('t1.plan')->eq($planID) + ->beginIF($status and $status != 'all')->andWhere('t2.status')->in($status)->fi() + ->andWhere('t2.deleted')->eq(0) + ->orderBy($orderBy)->page($pager) + ->fetchAll('id'); + } + else + { + $stories = $this->dao->select('distinct t1.story, t1.plan, t1.order, t2.*') + ->from(TABLE_PLANSTORY)->alias('t1') + ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') + ->where('t1.plan')->eq($planID) + ->beginIF($status and $status != 'all')->andWhere('t2.status')->in($status)->fi() + ->andWhere('t2.deleted')->eq(0) + ->orderBy($orderBy)->page($pager) + ->fetchAll('id'); + } $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story', false); From d57ae082bef1c419606774c0ca284bfad3819fd8 Mon Sep 17 00:00:00 2001 From: zenggang Date: Fri, 27 May 2022 05:53:29 +0000 Subject: [PATCH 04/45] * Group unit --- test/class/group.class.php | 46 ++++++++++++++++++++++++++++++----- test/model/group/copy.php | 12 +++++++-- test/model/group/copypriv.php | 8 ++++-- test/model/group/copyuser.php | 8 +++++- test/model/group/delete.php | 10 ++++++-- 5 files changed, 71 insertions(+), 13 deletions(-) diff --git a/test/class/group.class.php b/test/class/group.class.php index 2f64bae404..82633270ec 100755 --- a/test/class/group.class.php +++ b/test/class/group.class.php @@ -56,13 +56,20 @@ class groupTest * @access public * @return void */ - public function copyTest($groupID) + public function copyTest($groupID, $param) { + foreach($param as $k => $v) $_POST[$k] = $v; + $objects = $this->objectModel->copy($groupID); + unset($_POST); if(dao::isError()) return dao::getError(); - return $objects; + $newGroupID = $this->objectModel->dao->lastInsertID(); + $object = $this->objectModel->getByID($newGroupID); + + $this->objectModel->delete($newGroupID); + return $object; } /** @@ -79,7 +86,22 @@ class groupTest if(dao::isError()) return dao::getError(); - return $objects; + $fromPrivs = $this->objectModel->getPrivs($fromGroup); + $toPrivs = $this->objectModel->getPrivs($toGroup); + + $result = true; + foreach($fromPrivs as $group => $privs) + { + foreach($privs as $key => $priv) + { + if(!isset($toPrivs[$group][$key]) or $toPrivs[$group][$key] != $fromPrivs[$group][$key]) + { + $result = false; + break; + } + } + } + return $result; } /** @@ -96,7 +118,19 @@ class groupTest if(dao::isError()) return dao::getError(); - return $objects; + $fromUsers = $this->objectModel->getUserPairs($fromGroup); + $toUsers = $this->objectModel->getUserPairs($toGroup); + + $result = true; + foreach($fromUsers as $account => $name) + { + if(!isset($toUsers[$account]) or $toUsers[$account] != $fromUsers[$account]) + { + $result = false; + break; + } + } + return $result; } /** @@ -268,11 +302,11 @@ class groupTest */ public function deleteTest($groupID, $null = null) { - $objects = $this->objectModel->delete($groupID, $null = null); + $this->objectModel->delete($groupID, $null = null); if(dao::isError()) return dao::getError(); - return $objects; + return true; } /** diff --git a/test/model/group/copy.php b/test/model/group/copy.php index 804d3dd221..756998f97a 100644 --- a/test/model/group/copy.php +++ b/test/model/group/copy.php @@ -10,8 +10,16 @@ title=测试 groupModel->copy(); cid=1 pid=1 +复制id为2的分组 >> 这是一个复制的分组 +复制名字已存在的分组 >> 『分组名称』已经有『我是一个分组』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。 + */ -$group = new groupTest(); +$groupID = 2; -r($group->copyTest()) && p() && e(); \ No newline at end of file +$data = array('name' => '这是一个复制的分组'); +$existData = array('name' => '我是一个分组'); + +$group = new groupTest(); +r($group->copyTest($groupID, $data)) && p('name') && e('这是一个复制的分组'); // 这是一个复制的分组 +r($group->copyTest($groupID, $existData)) && p('name:0') && e('『分组名称』已经有『我是一个分组』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。'); // 『分组名称』已经有『我是一个分组』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。 diff --git a/test/model/group/copypriv.php b/test/model/group/copypriv.php index df9a1ea721..6888f728c9 100644 --- a/test/model/group/copypriv.php +++ b/test/model/group/copypriv.php @@ -10,8 +10,12 @@ title=测试 groupModel->copyPriv(); cid=1 pid=1 +复制分组6权限到分组7 >> 1 + */ -$group = new groupTest(); +$fromGroup = 6; +$toGroup = 7; -r($group->copyPrivTest()) && p() && e(); \ No newline at end of file +$group = new groupTest(); +r($group->copyPrivTest($fromGroup, $toGroup)) && p() && e('1'); diff --git a/test/model/group/copyuser.php b/test/model/group/copyuser.php index 471519d875..8e5e8171b3 100644 --- a/test/model/group/copyuser.php +++ b/test/model/group/copyuser.php @@ -10,8 +10,14 @@ title=测试 groupModel->copyUser(); cid=1 pid=1 +复制分组6用户到分组7 >> 1 + */ +$fromGroup = 6; +$toGroup = 7; + $group = new groupTest(); -r($group->copyUserTest()) && p() && e(); \ No newline at end of file +r($group->copyUserTest($fromGroup, $toGroup)) && p() && e('1'); // 复制分组6用户到分组7 +system("./ztest init"); diff --git a/test/model/group/delete.php b/test/model/group/delete.php index 9ea473d918..2e14d9c5fd 100644 --- a/test/model/group/delete.php +++ b/test/model/group/delete.php @@ -10,8 +10,14 @@ title=测试 groupModel->delete(); cid=1 pid=1 +删除id为10的组 >> 1 +删除id为0的组 >> 1 + */ -$group = new groupTest(); +$groupID = 10; -r($group->deleteTest()) && p() && e(); \ No newline at end of file +$group = new groupTest(); +r($group->deleteTest($groupID)) && p() && e('1'); // 删除id为10的组 +r($group->deleteTest(0)) && p() && e('1'); // 删除id为0的组 +system("./ztest init"); From 2df1a30c4d5dca3d45a19e56109898f6793b95d0 Mon Sep 17 00:00:00 2001 From: zenggang Date: Fri, 27 May 2022 05:58:49 +0000 Subject: [PATCH 05/45] * Adjust code --- test/model/group/copypriv.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/model/group/copypriv.php b/test/model/group/copypriv.php index 6888f728c9..d98fb151ba 100644 --- a/test/model/group/copypriv.php +++ b/test/model/group/copypriv.php @@ -18,4 +18,4 @@ $fromGroup = 6; $toGroup = 7; $group = new groupTest(); -r($group->copyPrivTest($fromGroup, $toGroup)) && p() && e('1'); +r($group->copyPrivTest($fromGroup, $toGroup)) && p() && e('1'); // 复制分组6权限到分组7 From bb0cd23f510a8f5ec457e112bffab1b200a5bbcf Mon Sep 17 00:00:00 2001 From: zenggang Date: Fri, 27 May 2022 07:33:26 +0000 Subject: [PATCH 06/45] * Adjust code --- module/my/css/project.css | 3 ++- module/my/css/project.en.css | 1 + module/my/view/project.html.php | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/module/my/css/project.css b/module/my/css/project.css index 7dd4be4654..9b0bf46e28 100644 --- a/module/my/css/project.css +++ b/module/my/css/project.css @@ -2,6 +2,7 @@ #projectList .c-actions {overflow: visible;} #projectTableList > tr:last-child .c-actions .dropdown-menu {top: auto; bottom: 100%; margin-bottom: -5px;} -.c-budget {width: 100px;} +.c-date {width: 80px;} +.c-budget {width: 80px;} .label-warning, .label-info {width: 60px !important;} .project-type-label.label-outline {width: 50px; min-width: 50px;} diff --git a/module/my/css/project.en.css b/module/my/css/project.en.css index 571f6926a8..1948d1949e 100644 --- a/module/my/css/project.en.css +++ b/module/my/css/project.en.css @@ -1 +1,2 @@ .c-begin {width: 120px;} +.c-end {width: 100px;} diff --git a/module/my/view/project.html.php b/module/my/view/project.html.php index 724d7e38e0..0f6bbd5308 100644 --- a/module/my/view/project.html.php +++ b/module/my/view/project.html.php @@ -40,7 +40,7 @@ project->status);?> project->begin);?> - project->end);?> + project->end);?> project->budget);?> project->PM);?> actions;?> From 106bd7b3e7b884b7092988f3decc92d7eb28dcd2 Mon Sep 17 00:00:00 2001 From: mayue Date: Fri, 27 May 2022 15:58:57 +0800 Subject: [PATCH 07/45] * Fix issue #654. --- module/execution/view/all.html.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/execution/view/all.html.php b/module/execution/view/all.html.php index f3f06a59e8..bc9a24e3fe 100644 --- a/module/execution/view/all.html.php +++ b/module/execution/view/all.html.php @@ -97,7 +97,7 @@ execution->end);?> execution->realBegan);?> execution->realEnd);?> - actions;?> + actions;?> execution->begin);?> execution->end);?> @@ -169,7 +169,7 @@ end) ? '' : $execution->end;?> realBegan) ? '' : $execution->realBegan;?> realEnd) ? '' : $execution->realEnd;?> - + id}", $execution, 'list', '', '', 'iframe', true); $class = !empty($execution->children) ? 'disabled' : ''; From f4bbddcef60d893ee63037a1d45fbd1c2b946afd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Wed, 1 Jun 2022 11:20:01 +0800 Subject: [PATCH 08/45] * Finish task #55845. --- module/doc/js/objectlibs.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/doc/js/objectlibs.js b/module/doc/js/objectlibs.js index a661bf9b5d..7714d051b7 100644 --- a/module/doc/js/objectlibs.js +++ b/module/doc/js/objectlibs.js @@ -8,6 +8,8 @@ $(function() }) $('.menu-actions > a').blur(function() {$(this).css('background', 'none');}) + + $('#content .table-row .markdown-print a').attr('target', '_blank'); }) /** From 3c259a09d19187d53f0d35954e79a369c06fd95c Mon Sep 17 00:00:00 2001 From: mayue Date: Wed, 1 Jun 2022 11:20:16 +0800 Subject: [PATCH 09/45] * Fix bug #23086. --- module/execution/view/manageproducts.html.php | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/module/execution/view/manageproducts.html.php b/module/execution/view/manageproducts.html.php index bf15c0d789..027dda2f81 100644 --- a/module/execution/view/manageproducts.html.php +++ b/module/execution/view/manageproducts.html.php @@ -24,12 +24,13 @@
execution->linkedProducts;?>
- grade == 2 ? "disabled='disabled'" : '';?> + $productName):?> - grade < 2 and in_array($productID, $unmodifiableProducts) and in_array($branchID, $unmodifiableBranches)) and !empty($linkedStoryIDList[$productID][$branchID])) $attr = "disabled='disabled'";?> - grade < 2 and (!(in_array($productID, $unmodifiableProducts) and in_array($branchID, $unmodifiableBranches)) or empty($linkedStoryIDList[$productID][$branchID]))) $attr = '';?> + + + grade == '2' and ($linkedProducts[$productID]->type == 'normal' or $branchID == 0)) $attr = "disabled='disabled'";?> execution->notAllowRemoveProducts, $linkedStoryIDList[$productID][$branchID]) : $productName;?>
@@ -75,6 +76,29 @@
+
+
execution->unlinkedProducts;?>
+
+ $productName):?> + grade == 2 and isset($linkedProducts[$productID]) and $linkedProducts[$productID]->type != 'normal'):?> +
+
'> +
+ ";?> + +
+ +
+
+ + + +
+
+
+ + +
From 38bdcc9ea45bdb49ea678b5711efe17415bc5628 Mon Sep 17 00:00:00 2001 From: mayue Date: Wed, 1 Jun 2022 11:29:41 +0800 Subject: [PATCH 10/45] * Optimize code. --- module/execution/view/manageproducts.html.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module/execution/view/manageproducts.html.php b/module/execution/view/manageproducts.html.php index 027dda2f81..fb462be2a4 100644 --- a/module/execution/view/manageproducts.html.php +++ b/module/execution/view/manageproducts.html.php @@ -76,11 +76,12 @@ + grade == 2):?>
execution->unlinkedProducts;?>
$productName):?> - grade == 2 and isset($linkedProducts[$productID]) and $linkedProducts[$productID]->type != 'normal'):?> + type != 'normal'):?>
'>
@@ -99,6 +100,7 @@
+
From 226ea6ef16fc7e4300fce38b2355dc1f5f5cfda0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Wed, 1 Jun 2022 14:25:59 +0800 Subject: [PATCH 11/45] * Finish task #55844. --- module/doc/control.php | 8 +------- module/doc/css/objectlibs.css | 2 ++ module/doc/view/content.html.php | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index 47642c5548..ebcef2d830 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -527,11 +527,7 @@ class doc extends control if(!(defined('RUN_MODE') && RUN_MODE == 'api')) $this->locate($browseLink); } - if($doc->contentType == 'markdown') - { - $doc->content = commonModel::processMarkdown($doc->content); - $doc->digest = commonModel::processMarkdown($doc->digest); - } + if($doc->contentType == 'markdown') $doc->digest = commonModel::processMarkdown($doc->digest); /* Check priv when lib is product or project. */ $lib = $this->doc->getLibByID($doc->lib); @@ -1001,8 +997,6 @@ class doc extends control if($doc->contentType == 'markdown') { - $doc->content = commonModel::processMarkdown($doc->content); - $doc->digest = commonModel::processMarkdown($doc->digest); } } diff --git a/module/doc/css/objectlibs.css b/module/doc/css/objectlibs.css index 01c2431ed2..0215993c68 100644 --- a/module/doc/css/objectlibs.css +++ b/module/doc/css/objectlibs.css @@ -18,6 +18,8 @@ #content .title {max-width: 54%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;} #content .detail-content {padding-left: 10px;} #mainContent .scrollbar-hover {max-height: 2000px; overflow: scroll;} +#content .editor-preview {background: #fff} +#content .CodeMirror{border: none} #sidebar {width: 275px;} #sidebar>.cell {width: 100%;} #sidebar>.sidebar-toggle {left: 3px; right: auto;} diff --git a/module/doc/view/content.html.php b/module/doc/view/content.html.php index d1ecb68883..c627cecee1 100644 --- a/module/doc/view/content.html.php +++ b/module/doc/view/content.html.php @@ -100,6 +100,10 @@ echo "
"; } } + elseif($doc->contentType == 'markdown') + { + echo ""; + } else { echo $doc->content; @@ -283,3 +287,16 @@ +contentType == 'markdown'):?> + + +content);?> + + From fba70b09d54ade058caedb16ea0999f7c4ec01f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Wed, 1 Jun 2022 14:29:08 +0800 Subject: [PATCH 12/45] * Remove unused code. --- module/doc/control.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index ebcef2d830..208ab5dd89 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -527,8 +527,6 @@ class doc extends control if(!(defined('RUN_MODE') && RUN_MODE == 'api')) $this->locate($browseLink); } - if($doc->contentType == 'markdown') $doc->digest = commonModel::processMarkdown($doc->digest); - /* Check priv when lib is product or project. */ $lib = $this->doc->getLibByID($doc->lib); $type = $lib->type; @@ -994,10 +992,6 @@ class doc extends control $doc->keywords = str_replace(",", ',', $doc->keywords); $doc->keywords = explode(',', $doc->keywords); } - - if($doc->contentType == 'markdown') - { - } } if(isset($doc) and ($doc->type == 'text' || $doc->type == 'article')) From 358ff4bd2ffdd1fba966a8be6fddbecf1857829d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Wed, 1 Jun 2022 15:05:43 +0800 Subject: [PATCH 13/45] * Fix doc bug. --- module/doc/js/objectlibs.js | 2 -- module/doc/view/content.html.php | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/doc/js/objectlibs.js b/module/doc/js/objectlibs.js index 7714d051b7..a661bf9b5d 100644 --- a/module/doc/js/objectlibs.js +++ b/module/doc/js/objectlibs.js @@ -8,8 +8,6 @@ $(function() }) $('.menu-actions > a').blur(function() {$(this).css('background', 'none');}) - - $('#content .table-row .markdown-print a').attr('target', '_blank'); }) /** diff --git a/module/doc/view/content.html.php b/module/doc/view/content.html.php index c627cecee1..b2c0fa95ba 100644 --- a/module/doc/view/content.html.php +++ b/module/doc/view/content.html.php @@ -297,6 +297,8 @@ $(function() var simplemde = new SimpleMDE({element: $("#markdownContent")[0],toolbar:false, status: false}); simplemde.value(markdownText); simplemde.togglePreview(); + + $('#content .CodeMirror .editor-preview a').attr('target', '_blank'); }) From f79844fd99f9a58df573bfd1c4038b9e7a535a00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Wed, 1 Jun 2022 15:40:49 +0800 Subject: [PATCH 14/45] * Merge create user btn. --- module/company/css/browse.css | 2 ++ module/company/view/browse.html.php | 34 +++++++++++++++++++---------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/module/company/css/browse.css b/module/company/css/browse.css index 9994e9dc9d..595c74318a 100644 --- a/module/company/css/browse.css +++ b/module/company/css/browse.css @@ -5,3 +5,5 @@ #userList tbody td {white-space: nowrap; overflow: hidden;} .space-sm + .text-center {display: none;} .c-role, .c-company, .c-visits {width: 90px;} + +.btn-group a.btn-primary {border-right: 1px solid rgba(255,255,255,0.3);} diff --git a/module/company/view/browse.html.php b/module/company/view/browse.html.php index e2c1b0b0bf..093702aade 100644 --- a/module/company/view/browse.html.php +++ b/module/company/view/browse.html.php @@ -29,19 +29,31 @@ js::set('confirmDelete', $lang->user->confirmDelete); user->search;?>
- " . $lang->user->batchCreate, '', "class='btn btn-secondary'");?> + createLink('tutorial', 'wizard', "module=user&method=create¶ms=$wizardParams"); - echo html::a($link, " {$lang->user->create}", '', "class='btn btn-primary create-user-btn'"); - } - else - { - common::printLink('user', 'create', "dept={$deptID}", " " . $lang->user->create, '', "class='btn btn-primary create-user-btn'"); - } + $wizardParams = helper::safe64Encode("dept=$deptID"); + $link = $this->createLink('tutorial', 'wizard', "module=user&method=create¶ms=$wizardParams"); + echo html::a($link, " {$lang->user->create}", '', "class='btn btn-primary create-user-btn'"); ?> + + + createLink('user', 'create', "dept={$deptID}"); + $batchCreateUserLink = $this->createLink('user', 'batchCreate', "dept={$deptID}"); + ?> + + + " . $lang->user->batchCreate, '', "class='btn btn-secondary'");?> + " . $lang->user->create, '', "class='btn btn-primary'");?> + +
From b0bac9dfaeae749c55f3db1e6c1511238dc9d362 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Wed, 1 Jun 2022 23:21:22 +0800 Subject: [PATCH 15/45] * Fix bug#23185. --- module/program/model.php | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/module/program/model.php b/module/program/model.php index e841646f3b..bd46f84c27 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -135,23 +135,22 @@ class programModel extends model * @access public * @return array */ - public function getList($status = 'all', $orderBy = 'id_asc', $pager = NULL, $type = '', $topIdList = '') + public function getList($status = 'all', $orderBy = 'id_asc', $pager = NULL, $type = '', $topIdList = array()) { - $objectIdList = array(); - if(!$this->app->user->admin) - { - $objectIdList = trim($this->app->user->view->programs, ',') . ',' . trim($this->app->user->view->projects, ','); - $objectIdList = array_filter(explode(',', $objectIdList)); - asort($objectIdList); + $userViewIdList = trim($this->app->user->view->programs, ',') . ',' . trim($this->app->user->view->projects, ','); + $userViewIdList = array_filter(explode(',', $userViewIdList)); + asort($userViewIdList); - if($this->app->rawMethod == 'browse') + $objectIdList = array(); + if($this->app->rawMethod == 'browse') + { + if(!$this->app->user->admin) { $pathList = $this->dao->select('id,path')->from(TABLE_PROJECT) - ->where('id')->in($objectIdList) + ->where('id')->in($userViewIdList) ->andWhere('deleted')->eq(0) ->fetchPairs('id'); - $objectIdList = array(); foreach($pathList as $path) { if($type == 'child' and !empty($topIdList)) @@ -163,6 +162,13 @@ class programModel extends model foreach(explode(',', trim($path, ',')) as $pathID) $objectIdList[$pathID] = $pathID; } } + else + { + foreach($topIdList as $topID) + { + $objectIdList += $this->dao->select('id')->from(TABLE_PROGRAM)->where('path')->like(",$topID,%")->fetchPairs('id'); + } + } } return $this->dao->select('*')->from(TABLE_PROGRAM) @@ -171,8 +177,11 @@ class programModel extends model ->andWhere('vision')->eq($this->config->vision) ->beginIF($status != 'all')->andWhere('status')->eq($status)->fi() ->beginIF(!$this->cookie->showClosed)->andWhere('status')->ne('closed')->fi() + ->beginIF($this->app->rawMethod == 'browse') ->beginIF($type === 'top')->andWhere('parent')->eq(0)->fi() - ->beginIF(!$this->app->user->admin)->andWhere('id')->in($objectIdList)->fi() + ->beginIF($type === 'child' or !$this->app->user->admin)->andWhere('id')->in($objectIdList)->fi() + ->fi() + ->beginIF(!$this->app->user->admin and $this->app->rawMethod != 'browse')->andWhere('id')->in($userViewIdList)->fi() ->orderBy($orderBy) ->page($pager) ->fetchAll('id'); From 6fdcc5f82668a47f37bac08f51cfb01136252b22 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Wed, 1 Jun 2022 23:34:48 +0800 Subject: [PATCH 16/45] * Modify review code for bug#23185. --- module/program/model.php | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/module/program/model.php b/module/program/model.php index bd46f84c27..13bf06b7cf 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -139,35 +139,26 @@ class programModel extends model { $userViewIdList = trim($this->app->user->view->programs, ',') . ',' . trim($this->app->user->view->projects, ','); $userViewIdList = array_filter(explode(',', $userViewIdList)); - asort($userViewIdList); $objectIdList = array(); if($this->app->rawMethod == 'browse') { - if(!$this->app->user->admin) - { - $pathList = $this->dao->select('id,path')->from(TABLE_PROJECT) - ->where('id')->in($userViewIdList) - ->andWhere('deleted')->eq(0) - ->fetchPairs('id'); + $pathList = $this->dao->select('id,path')->from(TABLE_PROJECT) + ->where('type')->in('program,project') + ->beginIF(!$this->app->user->admin)->andWhere('id')->in($userViewIdList)->fi() + ->andWhere('deleted')->eq(0) + ->orderBy('id_asc') + ->fetchPairs('id'); - foreach($pathList as $path) - { - if($type == 'child' and !empty($topIdList)) - { - $topID = $this->getTopByPath($path); - if(!in_array($topID, $topIdList)) continue; - } - - foreach(explode(',', trim($path, ',')) as $pathID) $objectIdList[$pathID] = $pathID; - } - } - else + foreach($pathList as $path) { - foreach($topIdList as $topID) + if($type == 'child' and !empty($topIdList)) { - $objectIdList += $this->dao->select('id')->from(TABLE_PROGRAM)->where('path')->like(",$topID,%")->fetchPairs('id'); + $topID = $this->getTopByPath($path); + if(!in_array($topID, $topIdList)) continue; } + + foreach(explode(',', trim($path, ',')) as $pathID) $objectIdList[$pathID] = $pathID; } } From 1d2ca05e502a769f46a27552d9d368844544a1e7 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 2 Jun 2022 03:54:17 +0800 Subject: [PATCH 17/45] * Fix bug#23154. --- module/bug/control.php | 15 +++++++++++++-- module/bug/js/common.js | 3 ++- module/bug/view/edit.html.php | 1 + 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 334405b8c3..d28b6fc25f 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -982,8 +982,15 @@ class bug extends control $executionID = $bug->execution; $projectID = $bug->project; $currentModuleID = $bug->module; + $product = $this->loadModel('product')->getByID($productID); $this->bug->checkBugExecutionPriv($bug); + if(!isset($this->products[$bug->product])) + { + $this->products[$bug->product] = $product->name; + $this->view->products = $this->products; + } + /* Set the menu. */ if($this->app->tab == 'project') $this->loadModel('project')->setMenu($bug->project); if($this->app->tab == 'execution') $this->loadModel('execution')->setMenu($bug->execution); @@ -1010,7 +1017,7 @@ class bug extends control { $products = array(); $productList = $this->config->CRProduct ? $this->product->getOrderedProducts('all', 40, $bug->project) : $this->product->getOrderedProducts('normal', 40, $bug->project); - foreach($productList as $product) $products[$product->id] = $product->name; + foreach($productList as $productInfo) $products[$productInfo->id] = $productInfo->name; $this->view->products = $products; } @@ -1020,7 +1027,6 @@ class bug extends control $this->view->position[] = $this->lang->bug->edit; /* Assign. */ - $product = $this->loadModel('product')->getByID($productID); $allBuilds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty'); if($executionID) { @@ -1064,6 +1070,11 @@ class bug extends control $branchOption[$branchInfo->id] = $branchInfo->name; $branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : ''); } + if(!isset($branchTagOption[$bug->branch])) + { + $bugBranch = $this->branch->getById($bug->branch, $bug->product, ''); + $branchTagOption[$bug->branch] = $bug->branch == BRANCH_MAIN ? $bugBranch : ($bugBranch->name . ($bugBranch->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '')); + } $moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $bug->branch); if(!isset($moduleOptionMenu[$bug->module])) $moduleOptionMenu += $this->tree->getModulesName($bug->module); diff --git a/module/bug/js/common.js b/module/bug/js/common.js index 3f4f5c7282..16da26ea54 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -629,7 +629,8 @@ function loadProductBranches(productID, param) $('#branch').next('.picker').remove(); var branchStatus = page == 'create' ? 'active' : 'all'; - var param = "productID=" + productID + "&oldBranch=0¶m=" + branchStatus; + var oldBranch = page == 'edit' ? bugBranch : 0; + var param = "productID=" + productID + "&oldBranch=" + oldBranch + "¶m=" + branchStatus; if(typeof(tab) != 'undefined' && (tab == 'execution' || tab == 'project')) param += "&projectID=" + objectID; $.get(createLink('branch', 'ajaxGetBranches', param), function(data) { diff --git a/module/bug/view/edit.html.php b/module/bug/view/edit.html.php index 3981eb1f15..8716ea05fa 100644 --- a/module/bug/view/edit.html.php +++ b/module/bug/view/edit.html.php @@ -27,6 +27,7 @@ js::set('oldResolvedBuild' , $bug->resolvedBuild); js::set('systemMode' , $config->systemMode); js::set('confirmUnlinkBuild' , sprintf($lang->bug->confirmUnlinkBuild, zget($resolvedBuilds, $bug->resolvedBuild))); js::set('tab' , $this->app->tab); +js::set('bugBranch' , $bug->branch); if($this->app->tab == 'execution') js::set('objectID', $bug->execution); if($this->app->tab == 'project') js::set('objectID', $bug->project); ?> From d5f294fd7ba2230421412818304c41f7d4137a0b Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 2 Jun 2022 04:25:09 +0800 Subject: [PATCH 18/45] * Fix bug#23159. --- module/testtask/control.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/module/testtask/control.php b/module/testtask/control.php index 8d29af46bc..cd10ad9833 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -752,6 +752,12 @@ class testtask extends control $this->loadModel('qa')->setMenu($this->products, $productID, $task->branch, $taskID); } + if(!isset($this->products[$productID])) + { + $product = $this->product->getByID($productID); + $this->products[$productID] = $product->name; + } + $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->edit; $this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]); $this->view->position[] = $this->lang->testtask->common; @@ -762,11 +768,15 @@ class testtask extends control $projectID = $this->lang->navGroup->testtask == 'qa' ? 0 : $this->session->project; $executions = empty($productID) ? array() : $this->product->getExecutionPairsByProduct($productID, 0, 'id_desc', $projectID); $executionID = $task->execution; - $builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,notrunk', $executionID, 'execution'); + if(!isset($executions[$executionID])) + { + $appendExecution = $this->loadModel('execution')->getByID($executionID); + $executions[$executionID] = $appendExecution->name; + } $this->view->task = $task; $this->view->executions = $executions; - $this->view->builds = $builds; + $this->view->builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,notrunk', $executionID, 'execution'); $this->view->testreports = $this->loadModel('testreport')->getPairs($task->product, $task->testreport); $this->view->users = $this->loadModel('user')->getPairs('nodeleted|noclosed', $task->owner); $this->view->contactLists = $this->user->getContactLists($this->app->user->account, 'withnote'); From 5b35fab5f6cd170556e7d695a86b7267cb64ddcc Mon Sep 17 00:00:00 2001 From: sunjun Date: Thu, 2 Jun 2022 01:43:24 +0000 Subject: [PATCH 19/45] fixbug_sunjun_23182 --- module/project/lang/en.php | 2 ++ module/project/lang/zh-cn.php | 2 ++ module/project/model.php | 22 ++++++++++++++++++++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/module/project/lang/en.php b/module/project/lang/en.php index d1a16a3a96..4864f75ac9 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -60,6 +60,8 @@ $lang->project->daysGreaterProject = 'Days cannot be greater than days of projec $lang->project->errorHours = 'Hours/Day cannot be greater than『24』'; $lang->project->workdaysExceed = 'No more than『%s』working days'; $lang->project->teamMembersCount = ', there are %s team members.'; +$lang->project->budgetNumber = '『Budget』must be numbers.'; +$lang->project->budgetGe0 = '『Budget』must be greater than or equal to 0.'; /* Fields. */ $lang->project->common = 'Project'; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 239bc43e71..23191cf732 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -60,6 +60,8 @@ $lang->project->daysGreaterProject = '可用工日不能大于项目的可用工 $lang->project->errorHours = '可用工时/天不能大于『24』'; $lang->project->workdaysExceed = '可用工作日不能超过『%s』天'; $lang->project->teamMembersCount = ',团队成员共%s人。'; +$lang->project->budgetNumber = '『预算』金额必须为数字。'; +$lang->project->budgetGe0 = '『预算』金额必须大于等于0。'; /* Fields. */ $lang->project->common = '项目'; diff --git a/module/project/model.php b/module/project/model.php index afa8961fda..987d340cb7 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -99,13 +99,14 @@ class projectModel extends model * @access public * @return array */ + public function getBudgetUnitList() { $budgetUnitList = array(); if($this->config->vision != 'lite') { foreach(explode(',', $this->config->project->unitList) as $unit) $budgetUnitList[$unit] = zget($this->lang->project->unitList, $unit, ''); - } + } return $budgetUnitList; } @@ -1055,7 +1056,6 @@ class projectModel extends model ->setIF($this->post->delta == 999, 'end', LONG_TIME) ->setIF($this->post->delta == 999, 'days', 0) ->setIF($this->post->acl == 'open', 'whitelist', '') - ->setIF($this->post->budget != 0, 'budget', round((float)$this->post->budget, 2)) ->setIF(!isset($_POST['whitelist']), 'whitelist', '') ->setDefault('openedBy', $this->app->user->account) ->setDefault('openedDate', helper::now()) @@ -1116,6 +1116,24 @@ class projectModel extends model return false; } + if(!empty($project->budget)) + { + if(!is_numeric($project->budget)) + { + dao::$errors['budget'] = sprintf($this->lang->project->budgetNumber); + return false; + } + else if(is_numeric($project->budget) and ($project->budget < 0)) + { + dao::$errors['budget'] = sprintf($this->lang->project->budgetGe0); + return false; + } + else + { + $project->budget = round((float)$this->post->budget, 2); + } + } + /* When select create new product, product name cannot be empty and duplicate. */ if(isset($_POST['newProduct'])) { From 29ceb630235f9a5ce9eb46456b06845b488140db Mon Sep 17 00:00:00 2001 From: liyuchun <563917701@qq.com> Date: Thu, 2 Jun 2022 02:49:27 +0000 Subject: [PATCH 20/45] * Fix bug #23132. --- lib/scm/gitlab.class.php | 1 + module/testcase/model.php | 9 ++++++++- module/testtask/model.php | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/scm/gitlab.class.php b/lib/scm/gitlab.class.php index a94bfdc9e8..8fa6b30095 100644 --- a/lib/scm/gitlab.class.php +++ b/lib/scm/gitlab.class.php @@ -359,6 +359,7 @@ class gitlab if($parent == '.') $parent = '/'; if($parent == '') $parent = '/'; $list = $this->tree($parent, 0); + $file = new stdclass(); foreach($list as $node) if($node->path == $entry) $file = $node; diff --git a/module/testcase/model.php b/module/testcase/model.php index 51504e3f0a..acb1fb01c3 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -422,9 +422,16 @@ class testcaseModel extends model if($case->linkCase or $case->fromCaseID) $case->linkCaseTitles = $this->dao->select('id,title')->from(TABLE_CASE)->where('id')->in($case->linkCase)->orWhere('id')->eq($case->fromCaseID)->fetchPairs(); if($version == 0) $version = $case->version; - $case->steps = $this->dao->select('*')->from(TABLE_CASESTEP)->where('`case`')->eq($caseID)->andWhere('version')->eq($version)->orderBy('id')->fetchAll('id'); $case->files = $this->loadModel('file')->getByObject('testcase', $caseID); $case->currentVersion = $version ? $version : $case->version; + + $case->steps = $this->dao->select('*')->from(TABLE_CASESTEP)->where('`case`')->eq($caseID)->andWhere('version')->eq($version)->orderBy('id')->fetchAll('id'); + foreach($case->steps as $key => $step) + { + $step->desc = html_entity_decode($step->desc); + $step->expect = html_entity_decode($step->expect); + } + return $case; } diff --git a/module/testtask/model.php b/module/testtask/model.php index 6946e7f513..9c8720028c 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -1360,6 +1360,8 @@ class testtaskModel extends model foreach($relatedStep as $stepID => $step) { $relatedStep[$stepID] = (array)$step; + $relatedStep[$stepID]['desc'] = html_entity_decode($relatedStep[$stepID]['desc']); + $relatedStep[$stepID]['expect'] = html_entity_decode($relatedStep[$stepID]['expect']); if(isset($result->stepResults[$stepID])) { $relatedStep[$stepID]['result'] = $result->stepResults[$stepID]['result']; From fb239cfa064451d2023f9499a7986a2eaedd1b11 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 2 Jun 2022 12:22:58 +0800 Subject: [PATCH 21/45] * Fix bug #23194. --- module/execution/js/kanban.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 01d6607648..3c60bc6d8f 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -83,6 +83,7 @@ function fullScreen() }) $('.kanban-group-header').hide(); $(".title").attr("disabled", true).css("pointer-events", "none"); + window.sortableDisabled = true; $.cookie('isFullScreen', 1); }; @@ -134,6 +135,7 @@ function exitFullScreen() }) $('.kanban-group-header').show(); $(".title").attr("disabled", false).css("pointer-events", "auto"); + window.sortableDisabled = false; $.cookie('isFullScreen', 0); } @@ -1412,6 +1414,10 @@ $(function() return $ele.parent().children('.kanban-lane'); } }, + before: function() + { + return !window.sortableDisabled; + }, start: function(e) { if(sortType == 'region') @@ -1429,6 +1435,8 @@ $(function() }, finish: function(e) { + if(!e.changed) return; + var url = ''; var orders = []; From c170d623136629f960e5d3f4828f1e81f5f2bc7a Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 2 Jun 2022 13:16:37 +0800 Subject: [PATCH 22/45] * Resoled issue #656. --- module/kanban/model.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/module/kanban/model.php b/module/kanban/model.php index e2f3151aa1..70d0b59a53 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -1595,9 +1595,6 @@ class kanbanModel extends model if(!isset($groupByList[$item->$groupBy])) $groupByList[$item->$groupBy] = $item->$groupBy; } - if(in_array($groupBy, array('module', 'story', 'pri', 'severity'))) $objectPairs[0] = $this->lang->$browseType->$groupBy . ': ' . $this->lang->kanban->noGroup; - if(in_array($groupBy, array('assignedTo', 'type', 'category', 'source'))) $objectPairs[''] = $this->lang->$browseType->$groupBy . ': ' . $this->lang->kanban->noGroup; - if(in_array($groupBy, array('module', 'story', 'assignedTo'))) { if($groupBy == 'module') @@ -1626,14 +1623,19 @@ class kanbanModel extends model } else { + unset($this->lang->$browseType->{$groupBy . 'List'}[0]); + unset($this->lang->$browseType->{$groupBy . 'List'}['']); $objectPairs += $this->lang->$browseType->{$groupBy . 'List'}; } + if(in_array($groupBy, array('module', 'story', 'pri', 'severity'))) $objectPairs[0] = $this->lang->$browseType->$groupBy . ': ' . $this->lang->kanban->noGroup; + if(in_array($groupBy, array('assignedTo', 'source'))) $objectPairs[] = $this->lang->$browseType->$groupBy . ': ' . $this->lang->kanban->noGroup; + $laneColor = 0; $order = 1; foreach($objectPairs as $objectID => $objectName) { - if(!isset($groupByList[$objectID]) and $objectID) continue; + if(!isset($groupByList[$objectID]) and $objectID and !in_array($objectID, array('feature', 'design'))) continue; $lane = new stdclass(); $lane->id = $groupBy . $objectID; From fe5ec04749aa51765362cfc44ff8a44d481d37a4 Mon Sep 17 00:00:00 2001 From: zenggang Date: Thu, 2 Jun 2022 05:22:12 +0000 Subject: [PATCH 23/45] * Code for task#55851 --- module/common/model.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/module/common/model.php b/module/common/model.php index 164a2741d3..1b8503aadd 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -2400,6 +2400,9 @@ EOD; if($inProject && $app->session->project && strpos(",{$app->user->rights['projects']},", ",{$app->session->project},") !== false) return true; } + /* White list of method. */ + if(in_array($module, array('user', 'task', 'story', 'bug', 'testcase')) and $method == 'showimport') return true; + /* If not super admin, check the rights. */ $rights = $app->user->rights['rights']; $acls = $app->user->rights['acls']; From 19654268270c5146ab5bbc2d016c4891573d7a6a Mon Sep 17 00:00:00 2001 From: mayue Date: Thu, 2 Jun 2022 13:22:13 +0800 Subject: [PATCH 24/45] * Finish task #55852. --- config/filter.php | 19 ++++++++++--------- module/company/control.php | 3 +++ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/config/filter.php b/config/filter.php index eeb4c9df87..d66232b8ab 100644 --- a/config/filter.php +++ b/config/filter.php @@ -149,6 +149,7 @@ $filter->todo->export = new stdclass(); $filter->upgrade->license = new stdclass(); $filter->user->login = new stdclass(); $filter->user->edit = new stdclass(); +$filter->user->export = new stdclass(); $filter->webhook->bind = new stdclass(); $filter->user->ajaxgetmore = new stdclass(); $filter->repo->ajaxsynccommit = new stdclass(); @@ -320,8 +321,6 @@ $filter->testtask->default->cookie['preProductID'] = 'int'; $filter->todo->export->cookie['checkedItem'] = 'reg::checked'; -$filter->user->login->cookie['keepLogin'] = 'equal::on'; - $filter->block->default->get['hash'] = 'reg::md5'; $filter->block->main->get['blockid'] = 'code'; $filter->block->main->get['blockTitle'] = 'reg::any'; @@ -359,13 +358,15 @@ $filter->sso->logout->get['token'] = 'reg::md5'; $filter->upgrade->license->get['agree'] = 'equal::true'; -$filter->user->login->get['account'] = 'account'; -$filter->user->login->get['lang'] = 'reg::lang'; -$filter->user->login->get['password'] = 'reg::any'; -$filter->user->edit->get['from'] = 'reg::word'; -$filter->user->ajaxgetmore->get['search'] = 'reg::any'; -$filter->user->ajaxgetmore->get['limit'] = 'int'; -$filter->user->ajaxgetmore->get['params'] = 'reg::base64'; +$filter->user->export->cookie['checkedItem'] = 'reg::checked'; +$filter->user->login->cookie['keepLogin'] = 'equal::on'; +$filter->user->login->get['account'] = 'account'; +$filter->user->login->get['lang'] = 'reg::lang'; +$filter->user->login->get['password'] = 'reg::any'; +$filter->user->edit->get['from'] = 'reg::word'; +$filter->user->ajaxgetmore->get['search'] = 'reg::any'; +$filter->user->ajaxgetmore->get['limit'] = 'int'; +$filter->user->ajaxgetmore->get['params'] = 'reg::base64'; $filter->git->cat->get['repoUrl'] = 'reg::base64'; $filter->git->diff->get['repoUrl'] = 'reg::base64'; diff --git a/module/company/control.php b/module/company/control.php index 55bbbb75c4..17010e0d32 100644 --- a/module/company/control.php +++ b/module/company/control.php @@ -73,6 +73,9 @@ class company extends control /* Get users. */ $users = $this->company->getUsers($browseType, $type, $queryID, $deptID, $sort, $pager); + /* Process the sql, get the conditon partion, save it to session. */ + $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'user', true); + /* Remove passwd. */ foreach($users as $user) unset($user->password); From 0e6fc10f0bad284d8d30c03c1a4a265ca36622da Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Thu, 2 Jun 2022 05:24:18 +0000 Subject: [PATCH 25/45] * Fix bug #23111. --- module/bug/js/common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/bug/js/common.js b/module/bug/js/common.js index 3f4f5c7282..ddc28e7b3e 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -713,7 +713,7 @@ function notice() if(typeof(branch) == 'undefined') branch = 0; var link = createLink('release', 'create', 'productID=' + $('#product').val() + '&branch=' + branch); if(config.onlybody != 'yes') link += link.indexOf('?') >= 0 ? '&onlybody=yes' : '?onlybody=yes'; - html += '' + createBuild + ' '; + html += '' + createRelease + ' '; html += '' + refresh + ''; } else From d8f8e9cce09256e8d5e18c5c0d9b09aa4619f1b0 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 2 Jun 2022 13:26:10 +0800 Subject: [PATCH 26/45] * Modify variable name. --- module/kanban/model.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/module/kanban/model.php b/module/kanban/model.php index 70d0b59a53..0e6e08cd0b 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -1633,12 +1633,12 @@ class kanbanModel extends model $laneColor = 0; $order = 1; - foreach($objectPairs as $objectID => $objectName) + foreach($objectPairs as $objectType => $objectName) { - if(!isset($groupByList[$objectID]) and $objectID and !in_array($objectID, array('feature', 'design'))) continue; + if(!isset($groupByList[$objectType]) and $objectType and !in_array($objectType, array('feature', 'design'))) continue; $lane = new stdclass(); - $lane->id = $groupBy . $objectID; + $lane->id = $groupBy . $objectType; $lane->type = $browseType; $lane->execution = $executionID; $lane->name = $objectName; @@ -1648,7 +1648,7 @@ class kanbanModel extends model $order += 1; $laneColor += 1; if($laneColor == count($this->config->kanban->laneColorList)) $laneColor = 0; - $lanes[$objectID] = $lane; + $lanes[$objectType] = $lane; } return $lanes; From 982d1c72aabb0e6c201a1d7f5347f14949337dc3 Mon Sep 17 00:00:00 2001 From: zenggang Date: Thu, 2 Jun 2022 05:32:33 +0000 Subject: [PATCH 27/45] * Adjust code --- module/common/model.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/module/common/model.php b/module/common/model.php index 1b8503aadd..acf5fe7f61 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -2400,13 +2400,16 @@ EOD; if($inProject && $app->session->project && strpos(",{$app->user->rights['projects']},", ",{$app->session->project},") !== false) return true; } - /* White list of method. */ - if(in_array($module, array('user', 'task', 'story', 'bug', 'testcase')) and $method == 'showimport') return true; - /* If not super admin, check the rights. */ $rights = $app->user->rights['rights']; $acls = $app->user->rights['acls']; + /* White list of method. */ + if(in_array($module, array('user', 'task', 'story', 'bug', 'testcase')) and $method == 'showimport') + { + if(isset($rights[$module]['import']) and commonModel::hasDBPriv($object, $module, 'import')) return true; + } + if(isset($rights[$module][$method])) { if(!commonModel::hasDBPriv($object, $module, $method)) return false; From c95c50021d48a827ce0db9f027ede17d8d5aade7 Mon Sep 17 00:00:00 2001 From: zenggang Date: Thu, 2 Jun 2022 05:33:38 +0000 Subject: [PATCH 28/45] * Adjust code --- module/common/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/common/model.php b/module/common/model.php index acf5fe7f61..ef0b19d054 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -2404,7 +2404,7 @@ EOD; $rights = $app->user->rights['rights']; $acls = $app->user->rights['acls']; - /* White list of method. */ + /* White list of import method. */ if(in_array($module, array('user', 'task', 'story', 'bug', 'testcase')) and $method == 'showimport') { if(isset($rights[$module]['import']) and commonModel::hasDBPriv($object, $module, 'import')) return true; From d3c0e96b98d4e526292ca4af6d97ad3e9e23c9d6 Mon Sep 17 00:00:00 2001 From: sunjun Date: Thu, 2 Jun 2022 05:40:49 +0000 Subject: [PATCH 29/45] fixbug_sunjun_22959 --- module/build/css/create.css | 1 + 1 file changed, 1 insertion(+) diff --git a/module/build/css/create.css b/module/build/css/create.css index 9951f15df9..af5a421167 100644 --- a/module/build/css/create.css +++ b/module/build/css/create.css @@ -1 +1,2 @@ #branch_chosen .chosen-single {border-left: 0px;} +#noProduct {display: inline-block; width: 110%;} From 620aa77d044ce1741a95a4d1e0ab6ac63734d261 Mon Sep 17 00:00:00 2001 From: liyuchun <563917701@qq.com> Date: Thu, 2 Jun 2022 06:02:58 +0000 Subject: [PATCH 30/45] * Finish task #55841. --- module/upgrade/view/afterexec.html.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/upgrade/view/afterexec.html.php b/module/upgrade/view/afterexec.html.php index e61c4c2403..9d45361424 100644 --- a/module/upgrade/view/afterexec.html.php +++ b/module/upgrade/view/afterexec.html.php @@ -48,6 +48,7 @@