From 4336d9b35223cd1b7b19cc1643ff42a0f394ec43 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Thu, 4 Aug 2022 15:48:22 +0800 Subject: [PATCH 01/57] * Add test case. --- test/data/pipeline.yaml | 18 +++++------ test/data/zt_repo.yaml | 16 +++++++++- test/model/gogs/checktokenaccess.php | 40 ++++++++++++++++++++++++ test/model/gogs/getgogslistbyaccount.php | 17 ++++++++++ 4 files changed, 81 insertions(+), 10 deletions(-) create mode 100644 test/model/gogs/checktokenaccess.php create mode 100644 test/model/gogs/getgogslistbyaccount.php diff --git a/test/data/pipeline.yaml b/test/data/pipeline.yaml index c4295ea9d7..d09e701877 100644 --- a/test/data/pipeline.yaml +++ b/test/data/pipeline.yaml @@ -3,24 +3,24 @@ author: Zeng gang version: "1.0" fields: - field: id - range: 1-3 + range: 1-5 - field: type - range: gitlab,sonarqube,jenkins + range: gitlab,sonarqube,jenkins,gitea,gogs - field: name - range: gitlab服务器,sonarqube服务器,jenkins服务器 + range: GitLab服务器,SonarQube服务器,Jenkins服务器,Gitea服务器,Gogs服务器 - field: url - range: [http://10.0.1.161:51080],[http://10.0.1.161:59001],[http://10.0.1.161:58080] + range: [http://10.0.1.161:51080],[http://10.0.1.161:59001],[http://10.0.1.161:58080],[http://10.0.7.242:9020],[http://10.0.7.242:9021] - field: account - range: [],[admin]{2} + range: [],[admin]{2},[]{2} - field: password - range: [],[UDJzc3cwcmQ=],[] + range: [],[UDJzc3cwcmQ=],[]{3} - field: token - range: x88fZokrp5hShia2jyBN,YWRtaW46UDJzc3cwcmQ=,1196c85ba525a268570df9da627e3a7b2d + range: x88fZokrp5hShia2jyBN,YWRtaW46UDJzc3cwcmQ=,1196c85ba525a268570df9da627e3a7b2d,c6769e6761a7d719129b2421dcb3112d936e2b1f,9ff43f9d1a369465bcf0781a3785f46bcef782d1 - field: private - range: 08bcc98f75d7d40053dc80722bdc117b,228b25587479f2fc7570428e8bcbabdc,ec8e41481723685d9106c88be5967c41 + range: 08bcc98f75d7d40053dc80722bdc117b,228b25587479f2fc7570428e8bcbabdc,ec8e41481723685d9106c88be5967c41,a56af13f4c4a6a4ed77f24e59794cf39,4fabcbd31314365506ebc56c0c83c1ec - field: createdBy range: admin - field: createdDate - range: [2021-12-09 11:23:35],[2022-01-12 08:47:37],[2022-01-12 08:47:37] + range: [2021-12-09 11:23:35],[2022-01-12 08:47:37],[2022-01-12 08:47:37],[2022-08-01 09:07:37],[2022-08-01 09:09:37] - field: deleted range: 0 diff --git a/test/data/zt_repo.yaml b/test/data/zt_repo.yaml index 0c7d1a9c9f..0e189c2946 100644 --- a/test/data/zt_repo.yaml +++ b/test/data/zt_repo.yaml @@ -47,7 +47,7 @@ fields: format: "" - field: SCM note: "类型" - range: Subversion,Git + range: Subversion,Git,Gitlab,Gitea,Gogs prefix: "" postfix: "" loop: 0 @@ -59,6 +59,20 @@ fields: postfix: "" loop: 0 format: "" + - field: serviceHost + note: "服务器ID" + range: 0,0,1,4,5 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: serviceProject + note: "项目地址" + range: []{2},1569,root/repo121,root/yuyu_project + prefix: "" + postfix: "" + loop: 0 + format: "" - field: commits note: "提交数" range: 1-10000:R diff --git a/test/model/gogs/checktokenaccess.php b/test/model/gogs/checktokenaccess.php new file mode 100644 index 0000000000..0a65a35396 --- /dev/null +++ b/test/model/gogs/checktokenaccess.php @@ -0,0 +1,40 @@ +#!/usr/bin/env php +loadModel('gitlab'); + +$host = ''; +$token = ''; + +$result = $gitlab->checkTokenAccess($host, $token); +if($result === false) $result = 'return false'; +r($result) && p() && e('return false'); //使用空的数据验证token权限 + +$host = 'http://10.0.1.161:5108'; +$result = $gitlab->checkTokenAccess($host, $token); +if(!$result) $result = 'return false'; +r($result) && p() && e('return false'); //使用错误的host验证token权限 + +$host = 'http://10.0.1.161:51080'; +$result = $gitlab->checkTokenAccess($host, $token); +if(empty($result)) $result = 'return null'; +r($result) && p() && e('return null'); //使用正确的host,错误的token验证token权限 + +$token = 'x88fZokrp5hShia2jyBN'; +$result = $gitlab->checkTokenAccess($host, $token); +if(isset($result->id)) $result = 'success'; +r($result) && p() && e('success'); //通过host,token验证token权限 + +$token = 'wVFHE6NZA-cJy-3U2y2J'; +$result = $gitlab->checkTokenAccess($host, $token); +if(!isset($result->id)) $result = 'no access'; +r($result) && p() && e('no access'); //通过host,权限不足的token验证token权限 diff --git a/test/model/gogs/getgogslistbyaccount.php b/test/model/gogs/getgogslistbyaccount.php new file mode 100644 index 0000000000..d7d8b14f8d --- /dev/null +++ b/test/model/gogs/getgogslistbyaccount.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +loadModel('gogs'); + +r(count($gogs->getGogsListByAccount())) && p() && e('0'); //默认admin用户查询绑定的gogs服务器 +r(count($gogs->getGogsListByAccount('user3'))) && p() && e('1'); //使用已绑定一个gogs服务器的用户查询 +r(count($gogs->getGogsListByAccount('test1'))) && p() && e('0'); //使用未绑定gogs服务器的用户查询 From 07c4dd5dfc636b729d8cac8ab1ab35f761b77123 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Fri, 26 Aug 2022 14:29:14 +0800 Subject: [PATCH 02/57] * Add gogs test case. --- test/class/gogs.class.php | 88 +++++++++++++++++++++++++++ test/data/pipeline.yaml | 4 +- test/model/gitea/checktokenaccess.php | 40 ++++++++++++ test/model/gitea/create.php | 2 +- test/model/gitea/update.php | 2 +- test/model/gogs/checktokenaccess.php | 20 +++--- test/model/gogs/create.php | 36 +++++++++++ test/model/gogs/getbyid.php | 31 ++++++++++ test/model/gogs/getlist.php | 23 +++++++ test/model/gogs/getpairs.php | 22 +++++++ test/model/gogs/update.php | 38 ++++++++++++ test/ztest | 3 + 12 files changed, 295 insertions(+), 14 deletions(-) create mode 100644 test/class/gogs.class.php create mode 100644 test/model/gitea/checktokenaccess.php create mode 100644 test/model/gogs/create.php create mode 100755 test/model/gogs/getbyid.php create mode 100755 test/model/gogs/getlist.php create mode 100755 test/model/gogs/getpairs.php create mode 100644 test/model/gogs/update.php diff --git a/test/class/gogs.class.php b/test/class/gogs.class.php new file mode 100644 index 0000000000..68d7c74435 --- /dev/null +++ b/test/class/gogs.class.php @@ -0,0 +1,88 @@ +tester = $tester; + $this->gogs = $this->tester->loadModel('gogs'); + } + + /** + * Get by id. + * + * @param int $id + * @access public + * @return object + */ + public function getByID($id) + { + $gogs = $this->gogs->getByID($id); + if(empty($gogs)) return 0; + return $gogs; + } + + /** + * Get gogs list. + * + * @param string $orderBy + * @access public + * @return object + */ + public function getList($orderBy = 'id_desc') + { + $gogs = $this->gogs->getList($orderBy); + if(empty($gogs)) return 0; + return array_shift($gogs); + } + + /** + * Get gogs pairs + * + * @return string + */ + public function getPairs() + { + $pairs = $this->gogs->getPairs(); + return key($pairs); + } + + /** + * Create a gogs. + * + * @access public + * @return object|string + */ + public function create() + { + $gogsID = $this->gogs->create(); + if(dao::isError()) + { + $errors = dao::getError(); + return key($errors); + } + + return $this->gogs->getById($gogsID); + } + + /** + * Update a gogs. + * + * @param int $id + * @access public + * @return object|string + */ + public function update($id) + { + $this->gogs->update($id); + if(dao::isError()) + { + $errors = dao::getError(); + return key($errors); + } + + return $this->gogs->getById($id); + } +} diff --git a/test/data/pipeline.yaml b/test/data/pipeline.yaml index d09e701877..3d70e5b100 100644 --- a/test/data/pipeline.yaml +++ b/test/data/pipeline.yaml @@ -13,7 +13,7 @@ fields: - field: account range: [],[admin]{2},[]{2} - field: password - range: [],[UDJzc3cwcmQ=],[]{3} + range: [],[UDJzc3cwcmQ=],[RWFzeXNvZnRAcWQyMDEwIQ==],[]{2} - field: token range: x88fZokrp5hShia2jyBN,YWRtaW46UDJzc3cwcmQ=,1196c85ba525a268570df9da627e3a7b2d,c6769e6761a7d719129b2421dcb3112d936e2b1f,9ff43f9d1a369465bcf0781a3785f46bcef782d1 - field: private @@ -21,6 +21,6 @@ fields: - field: createdBy range: admin - field: createdDate - range: [2021-12-09 11:23:35],[2022-01-12 08:47:37],[2022-01-12 08:47:37],[2022-08-01 09:07:37],[2022-08-01 09:09:37] + range: [2022-08-01 09:09:37] - field: deleted range: 0 diff --git a/test/model/gitea/checktokenaccess.php b/test/model/gitea/checktokenaccess.php new file mode 100644 index 0000000000..bbdabbf680 --- /dev/null +++ b/test/model/gitea/checktokenaccess.php @@ -0,0 +1,40 @@ +#!/usr/bin/env php +loadModel('gitea'); + +$host = ''; +$token = ''; + +$result = $gitea->checkTokenAccess($host, $token); +if($result === false) $result = 'return false'; +r($result) && p() && e('return false'); //使用空的数据验证token权限 + +$host = 'http://10.0.7.242:9020'; +$result = $gitea->checkTokenAccess($host, $token); +if(!$result) $result = 'return false'; +r($result) && p() && e('return false'); //使用错误的host验证token权限 + +$host = 'http://10.0.7.242:9020'; +$result = $gitea->checkTokenAccess($host, $token); +if(empty($result)) $result = 'return null'; +r($result) && p() && e('return null'); //使用正确的host,错误的token验证token权限 + +$token = 'c6769e6761a7d719129b2421dcb3112d936e2b1f'; +$result = $gitea->checkTokenAccess($host, $token); +if(isset($result->id)) $result = 'success'; +r($result) && p() && e('success'); //通过host,token验证token权限 + +$token = 'wVFHE6NZA-cJy-3U2y2J'; +$result = $gitea->checkTokenAccess($host, $token); +if(!isset($result->id)) $result = 'no access'; +r($result) && p() && e('no access'); //通过host,权限不足的token验证token权限 diff --git a/test/model/gitea/create.php b/test/model/gitea/create.php index 28e194950c..a701c1bf54 100644 --- a/test/model/gitea/create.php +++ b/test/model/gitea/create.php @@ -13,7 +13,7 @@ pid=1 Gitea名称为空 >> name 服务器地址为空 >> url -正确Gitea数据 >> Gitea,http://10.0.1.161:58080,1196c85ba525a268570df9da627e3a7b2d +正确Gitea数据 >> Gitea,http://10.0.7.242:9020,1196c85ba525a268570df9da627e3a7b2d */ diff --git a/test/model/gitea/update.php b/test/model/gitea/update.php index 6381206528..c33e0ae2ab 100644 --- a/test/model/gitea/update.php +++ b/test/model/gitea/update.php @@ -32,7 +32,7 @@ $_POST['name'] = 'Changed Gitea'; $_POST['url'] = ''; r($gitea->update($giteaID)) && p() && e('url'); // 服务器地址为空 -$_POST['url'] = 'http://10.0.1.161:58080'; +$_POST['url'] = 'http://10.0.7.242:9020'; r($gitea->update($giteaID)) && p('name') && e('Changed Gitea'); // 正确Gitea数据 $db->restoreDB(); diff --git a/test/model/gogs/checktokenaccess.php b/test/model/gogs/checktokenaccess.php index 0a65a35396..2081e017b9 100644 --- a/test/model/gogs/checktokenaccess.php +++ b/test/model/gogs/checktokenaccess.php @@ -4,37 +4,37 @@ include dirname(dirname(dirname(__FILE__))) . '/lib/init.php'; /** -title=测试 gitlabModel::checkTokenAccess(); +title=测试 gogsModel::checkTokenAccess(); cid=1 pid=1 */ -$gitlab = $tester->loadModel('gitlab'); +$gogs = $tester->loadModel('gogs'); $host = ''; $token = ''; -$result = $gitlab->checkTokenAccess($host, $token); +$result = $gogs->checkTokenAccess($host, $token); if($result === false) $result = 'return false'; r($result) && p() && e('return false'); //使用空的数据验证token权限 -$host = 'http://10.0.1.161:5108'; -$result = $gitlab->checkTokenAccess($host, $token); +$host = 'http://10.0.7.242:9021'; +$result = $gogs->checkTokenAccess($host, $token); if(!$result) $result = 'return false'; r($result) && p() && e('return false'); //使用错误的host验证token权限 -$host = 'http://10.0.1.161:51080'; -$result = $gitlab->checkTokenAccess($host, $token); +$host = 'http://10.0.7.242:9021'; +$result = $gogs->checkTokenAccess($host, $token); if(empty($result)) $result = 'return null'; r($result) && p() && e('return null'); //使用正确的host,错误的token验证token权限 -$token = 'x88fZokrp5hShia2jyBN'; -$result = $gitlab->checkTokenAccess($host, $token); +$token = '9ff43f9d1a369465bcf0781a3785f46bcef782d1'; +$result = $gogs->checkTokenAccess($host, $token); if(isset($result->id)) $result = 'success'; r($result) && p() && e('success'); //通过host,token验证token权限 $token = 'wVFHE6NZA-cJy-3U2y2J'; -$result = $gitlab->checkTokenAccess($host, $token); +$result = $gogs->checkTokenAccess($host, $token); if(!isset($result->id)) $result = 'no access'; r($result) && p() && e('no access'); //通过host,权限不足的token验证token权限 diff --git a/test/model/gogs/create.php b/test/model/gogs/create.php new file mode 100644 index 0000000000..f1cb344a34 --- /dev/null +++ b/test/model/gogs/create.php @@ -0,0 +1,36 @@ +#!/usr/bin/env php +switchDB(); +su('admin'); + +/** + +title=测试gogsModel->create(); +cid=1 +pid=1 + +Gogs名称为空 >> name +服务器地址为空 >> url +正确Gogs数据 >> Gogs,http://10.0.7.242:9021,9ff43f9d1a369465bcf0781a3785f46bcef782d1 + +*/ + +$gogs = new gogsTest(); + +$_POST = array(); +$_POST['name'] = ''; +$_POST['url'] = 'http://10.0.7.242:9021'; +$_POST['token'] = '9ff43f9d1a369465bcf0781a3785f46bcef782d1'; + +r($gogs->create()) && p() && e('name'); // Gogs名称为空 + +$_POST['name'] = 'Gogs'; +$_POST['url'] = ''; +r($gogs->create()) && p() && e('url'); // 服务器地址为空 + +$_POST['url'] = 'http://10.0.7.242:9021'; +r($gogs->create()) && p('name,url,token') && e('Gogs,http://10.0.7.242:9021,9ff43f9d1a369465bcf0781a3785f46bcef782d1'); // 正确Gogs数据 + +$db->restoreDB(); diff --git a/test/model/gogs/getbyid.php b/test/model/gogs/getbyid.php new file mode 100755 index 0000000000..73d5ce9d67 --- /dev/null +++ b/test/model/gogs/getbyid.php @@ -0,0 +1,31 @@ +#!/usr/bin/env php +switchDB(); +su('admin'); + +/** + +title=测试gogsModel->gitById(); +cid=1 +pid=1 + +使用存在的ID >> 5 +使用空的ID >> 0 +使用不存在的ID >> 0 + +*/ + +$gogs = new gogsTest(); + +$gogsID = 5; +r($gogs->getById($gogsID)) && p('id') && e('5'); // 使用存在的ID + +$gogsID = 0; +r($gogs->getById($gogsID)) && p() && e(0); // 使用空的ID + +$gogsID = 111; +r($gogs->getById($gogsID)) && p() && e(0); // 使用不存在的ID + +$db->restoreDB(); diff --git a/test/model/gogs/getlist.php b/test/model/gogs/getlist.php new file mode 100755 index 0000000000..8cd6deec9b --- /dev/null +++ b/test/model/gogs/getlist.php @@ -0,0 +1,23 @@ +#!/usr/bin/env php +switchDB(); +su('admin'); + +/** + +title=测试gogsModel->gitList(); +cid=1 +pid=1 + +获取Gogs列表 >> 5 + +*/ + +$gogs = new gogsTest(); + +$orderBy = 'id_desc'; +r($gogs->getList($orderBy)) && p('id') && e('5'); // 获取Gogs列表 + +$db->restoreDB(); diff --git a/test/model/gogs/getpairs.php b/test/model/gogs/getpairs.php new file mode 100755 index 0000000000..ddd5ebe211 --- /dev/null +++ b/test/model/gogs/getpairs.php @@ -0,0 +1,22 @@ +#!/usr/bin/env php +switchDB(); +su('admin'); + +/** + +title=测试gogsModel->gitPairs(); +cid=1 +pid=1 + +获取Gogs >> 5 + +*/ + +$gogs = new gogsTest(); + +r($gogs->getPairs()) && p() && e('5'); // 获取Gogs + +$db->restoreDB(); diff --git a/test/model/gogs/update.php b/test/model/gogs/update.php new file mode 100644 index 0000000000..5ba27752ce --- /dev/null +++ b/test/model/gogs/update.php @@ -0,0 +1,38 @@ +#!/usr/bin/env php +switchDB(); +su('admin'); + +/** + +title=测试gogsModel->update(); +cid=1 +pid=1 + +Gogs名称为空 >> name +服务器地址为空 >> url +正确Gogs数据 >> Changed Gogs + +*/ + +$gogs = new gogsTest(); + +$gogsID = 3; + +$_POST = array(); +$_POST['name'] = ''; +$_POST['url'] = 'http://10.0.7.242:9021'; +$_POST['token'] = '9ff43f9d1a369465bcf0781a3785f46bcef782d1'; + +r($gogs->update($gogsID)) && p() && e('name'); // Gogs名称为空 + +$_POST['name'] = 'Changed Gogs'; +$_POST['url'] = ''; +r($gogs->update($gogsID)) && p() && e('url'); // 服务器地址为空 + +$_POST['url'] = 'http://10.0.7.242:9021'; +r($gogs->update($gogsID)) && p('name') && e('Changed Gogs'); // 正确Gogs数据 + +$db->restoreDB(); diff --git a/test/ztest b/test/ztest index 8454508f16..923d9116dd 100755 --- a/test/ztest +++ b/test/ztest @@ -187,6 +187,9 @@ switch($argv[1]) case 'gitea': ztfRun('model/gitea'); break; + case 'gogs': + ztfRun('model/gogs'); + break; default: ztfExtract($argv[1]); From 9fac11a5de647b51df871e040a581774012bf93a Mon Sep 17 00:00:00 2001 From: dongli Date: Thu, 1 Sep 2022 02:34:21 +0000 Subject: [PATCH 03/57] * Fix bug #26715. --- module/project/js/create.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/module/project/js/create.js b/module/project/js/create.js index 8ef3cc4a52..70ec96dd76 100644 --- a/module/project/js/create.js +++ b/module/project/js/create.js @@ -145,6 +145,18 @@ function setParentProgram(parentProgram) } budgetOverrunTips(); outOfDateTip(); + + $('#budgetUnit').val(data.budgetUnit).trigger("chosen:updated"); + if(typeof(data.availableBudget) == 'undefined') + { + $('#budget').removeAttr('placeholder').attr('disabled', 'disabled'); + $("#future").prop("checked", true); + } + else + { + $('#budget').removeAttr('disabled', 'disabled') + $("#future").prop("checked", false); + } }); $('#parent').attr('data-lastSelected', parentProgram); From ed624850be594a637bd5556f7d9eb9251fc0d1cc Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 1 Sep 2022 10:41:00 +0800 Subject: [PATCH 04/57] * Fix bug #27139. --- module/kanban/js/view.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/kanban/js/view.js b/module/kanban/js/view.js index 92382d372e..5dfd4466f6 100644 --- a/module/kanban/js/view.js +++ b/module/kanban/js/view.js @@ -892,9 +892,9 @@ function updateRegion(regionID, regionData) var $region = $('#kanban'+ regionID).kanban(); if(!$region.length) return false; - if(!regionData) regionData = regions[regionID]; + regions[regionID] = regionData ? regionData : regions[regionID]; - $region.data('zui.kanban').render(regionData.groups); + $region.data('zui.kanban').render(regions[regionID].groups); resetRegionHeight('open'); return true; } From c355db3d3d36f92db221786f418e6589fb38bcc0 Mon Sep 17 00:00:00 2001 From: dongli Date: Thu, 1 Sep 2022 02:49:49 +0000 Subject: [PATCH 05/57] * Fix bug #26715. --- module/project/js/create.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/module/project/js/create.js b/module/project/js/create.js index 70ec96dd76..1a4ce62599 100644 --- a/module/project/js/create.js +++ b/module/project/js/create.js @@ -145,17 +145,16 @@ function setParentProgram(parentProgram) } budgetOverrunTips(); outOfDateTip(); - - $('#budgetUnit').val(data.budgetUnit).trigger("chosen:updated"); + $('#budgetUnit').val(data.budgetUnit).trigger('chosen:updated'); if(typeof(data.availableBudget) == 'undefined') { $('#budget').removeAttr('placeholder').attr('disabled', 'disabled'); - $("#future").prop("checked", true); + $('#future').prop('checked', true); } else { $('#budget').removeAttr('disabled', 'disabled') - $("#future").prop("checked", false); + $('#future').prop('checked', false); } }); From def6b278e99055e64b782a52679c8a5dd95d1dc0 Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Thu, 1 Sep 2022 10:50:45 +0800 Subject: [PATCH 06/57] * Fix bug #26458. --- module/bug/lang/de.php | 4 ++-- module/bug/lang/en.php | 4 ++-- module/bug/lang/fr.php | 4 ++-- module/bug/lang/zh-cn.php | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/module/bug/lang/de.php b/module/bug/lang/de.php index ae67b3dac0..6925197c5b 100644 --- a/module/bug/lang/de.php +++ b/module/bug/lang/de.php @@ -97,8 +97,8 @@ $lang->bug->fixedRate = 'Fixed Rate'; $lang->bug->noticefeedbackBy = 'NoticeFeedbackBy'; $lang->bug->selectProjects = 'Select Projects'; $lang->bug->nextStep = 'Next Step'; -$lang->bug->noProject = 'Haven’t chosen a project yet'; -$lang->bug->noExecution = 'Haven’t chosen a execution yet'; +$lang->bug->noProject = 'Haven’t chosen a project yet.'; +$lang->bug->noExecution = 'Haven’t chosen a ' . strtolower($lang->execution->common) . ' yet.'; /* Method list. */ $lang->bug->index = 'Home'; diff --git a/module/bug/lang/en.php b/module/bug/lang/en.php index f29895386a..8a14403c90 100644 --- a/module/bug/lang/en.php +++ b/module/bug/lang/en.php @@ -97,8 +97,8 @@ $lang->bug->fixedRate = 'Fixed Rate'; $lang->bug->noticefeedbackBy = 'NoticeFeedbackBy'; $lang->bug->selectProjects = 'Select Projects'; $lang->bug->nextStep = 'Next Step'; -$lang->bug->noProject = 'Haven’t chosen a project yet'; -$lang->bug->noExecution = 'Haven’t chosen a execution yet'; +$lang->bug->noProject = 'Haven’t chosen a project yet.'; +$lang->bug->noExecution = 'Haven’t chosen a ' . strtolower($lang->execution->common) . ' yet.'; /* Method list. */ $lang->bug->index = 'Bug Home'; diff --git a/module/bug/lang/fr.php b/module/bug/lang/fr.php index 1d8df84e71..f23542c7ef 100644 --- a/module/bug/lang/fr.php +++ b/module/bug/lang/fr.php @@ -97,8 +97,8 @@ $lang->bug->fixedRate = 'Repair Rate'; $lang->bug->noticefeedbackBy = 'NoticeFeedbackBy'; $lang->bug->selectProjects = 'Select Projects'; $lang->bug->nextStep = 'Next Step'; -$lang->bug->noProject = 'Haven’t chosen a project yet'; -$lang->bug->noExecution = 'Haven’t chosen a execution yet'; +$lang->bug->noProject = 'Haven’t chosen a project yet.'; +$lang->bug->noExecution = 'Haven’t chosen a ' . strtolower($lang->execution->common) . ' yet.'; /* Method list. */ $lang->bug->index = 'Accueil Bug'; diff --git a/module/bug/lang/zh-cn.php b/module/bug/lang/zh-cn.php index 9a6ad14c53..719ba107c1 100644 --- a/module/bug/lang/zh-cn.php +++ b/module/bug/lang/zh-cn.php @@ -98,7 +98,7 @@ $lang->bug->noticefeedbackBy = '通知反馈者'; $lang->bug->selectProjects = '选择项目'; $lang->bug->nextStep = '下一步'; $lang->bug->noProject = '还没有选择项目!'; -$lang->bug->noExecution = '还没有选择执行!'; +$lang->bug->noExecution = "还没有选择{$lang->execution->common}!"; /* 方法列表。*/ $lang->bug->index = '首页'; From f0ab716d295d705d04c9598c893eeb8862d298c3 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 1 Sep 2022 13:22:52 +0800 Subject: [PATCH 07/57] * Fix bug #25848. --- module/execution/css/story.css | 2 +- module/story/config.php | 4 ++-- module/task/config.php | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/module/execution/css/story.css b/module/execution/css/story.css index 5d0c443c1b..3c75842a66 100644 --- a/module/execution/css/story.css +++ b/module/execution/css/story.css @@ -8,7 +8,7 @@ tbody > tr > td > .btn-icon {margin-right: 4px;} #batchToTask .checkbox-primary {display: inline-block; margin-left: 10px;} th.c-pri{width:50px;} .c-estimate {width: 50px;} -.c-status, .c-user {width: 70px;} +.c-user {width: 70px;} .c-assignedTo {width: 100px;} .c-category {width: 75px;} .c-actions-7 {width: 195px;} diff --git a/module/story/config.php b/module/story/config.php index c3f2cf57cc..2ff95f66e0 100644 --- a/module/story/config.php +++ b/module/story/config.php @@ -70,7 +70,7 @@ if($app->tab == 'execution') { $config->story->datatable->fieldList['order']['title'] = 'order'; $config->story->datatable->fieldList['order']['fixed'] = 'left'; - $config->story->datatable->fieldList['order']['width'] = '60'; + $config->story->datatable->fieldList['order']['width'] = '45'; $config->story->datatable->fieldList['order']['sort'] = 'no'; $config->story->datatable->fieldList['order']['required'] = 'no'; $config->story->datatable->fieldList['order']['name'] = $this->lang->story->order; @@ -78,7 +78,7 @@ if($app->tab == 'execution') $config->story->datatable->fieldList['pri']['title'] = 'priAB'; $config->story->datatable->fieldList['pri']['fixed'] = 'left'; -$config->story->datatable->fieldList['pri']['width'] = '50'; +$config->story->datatable->fieldList['pri']['width'] = '35'; $config->story->datatable->fieldList['pri']['required'] = 'no'; $config->story->datatable->fieldList['pri']['name'] = $this->lang->story->pri; diff --git a/module/task/config.php b/module/task/config.php index 96ca1d4d79..e2ffcf4702 100644 --- a/module/task/config.php +++ b/module/task/config.php @@ -73,7 +73,7 @@ $config->task->datatable->fieldList['desc']['control'] = 'textarea'; $config->task->datatable->fieldList['pri']['title'] = 'priAB'; $config->task->datatable->fieldList['pri']['fixed'] = 'left'; -$config->task->datatable->fieldList['pri']['width'] = '50'; +$config->task->datatable->fieldList['pri']['width'] = '35'; $config->task->datatable->fieldList['pri']['required'] = 'no'; $config->task->datatable->fieldList['pri']['name'] = $lang->task->pri; @@ -106,29 +106,29 @@ $config->task->datatable->fieldList['finishedBy']['required'] = 'no'; $config->task->datatable->fieldList['estimate']['title'] = 'estimateAB'; $config->task->datatable->fieldList['estimate']['fixed'] = 'no'; -$config->task->datatable->fieldList['estimate']['width'] = '60'; +$config->task->datatable->fieldList['estimate']['width'] = '55'; $config->task->datatable->fieldList['estimate']['required'] = 'no'; $config->task->datatable->fieldList['consumed']['title'] = 'consumedAB'; $config->task->datatable->fieldList['consumed']['fixed'] = 'no'; -$config->task->datatable->fieldList['consumed']['width'] = '60'; +$config->task->datatable->fieldList['consumed']['width'] = '55'; $config->task->datatable->fieldList['consumed']['required'] = 'no'; $config->task->datatable->fieldList['left']['title'] = 'leftAB'; $config->task->datatable->fieldList['left']['fixed'] = 'no'; -$config->task->datatable->fieldList['left']['width'] = '60'; +$config->task->datatable->fieldList['left']['width'] = '55'; $config->task->datatable->fieldList['left']['required'] = 'no'; $config->task->datatable->fieldList['progress']['title'] = 'progressAB'; $config->task->datatable->fieldList['progress']['fixed'] = 'no'; -$config->task->datatable->fieldList['progress']['width'] = '80'; +$config->task->datatable->fieldList['progress']['width'] = '75'; $config->task->datatable->fieldList['progress']['required'] = 'no'; $config->task->datatable->fieldList['progress']['sort'] = 'no'; $config->task->datatable->fieldList['progress']['name'] = $lang->task->progress; $config->task->datatable->fieldList['deadline']['title'] = 'deadlineAB'; $config->task->datatable->fieldList['deadline']['fixed'] = 'no'; -$config->task->datatable->fieldList['deadline']['width'] = '70'; +$config->task->datatable->fieldList['deadline']['width'] = '65'; $config->task->datatable->fieldList['deadline']['required'] = 'no'; $config->task->datatable->fieldList['deadline']['control'] = 'date'; From 1bcbf8ce89a06652b5ebf334a0b7e17b9c223033 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 1 Sep 2022 13:30:49 +0800 Subject: [PATCH 08/57] * Fix bug #25977. --- module/story/css/edit.css | 1 + 1 file changed, 1 insertion(+) diff --git a/module/story/css/edit.css b/module/story/css/edit.css index 2bae76d3c1..b6c854f3c3 100644 --- a/module/story/css/edit.css +++ b/module/story/css/edit.css @@ -4,3 +4,4 @@ .titleBox {margin: 0px 10px 10px 10px;} .needNotReviewBox {width: 130px;} .needNotReviewBox span.input-group-addon {border: 1px solid #dcdcdc; border-left-width: 0px;} +#moduleIdBox .chosen-container, #planIdBox .chosen-container {min-width: unset;} From db217f9ffee4e8b8fe0d135fdcce4d622e2419a5 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 1 Sep 2022 14:30:18 +0800 Subject: [PATCH 09/57] * fix bug #27056. --- module/task/model.php | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/module/task/model.php b/module/task/model.php index 0605a0af01..ca204e0083 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -1256,6 +1256,19 @@ class taskModel extends model $this->loadModel('feedback')->updateStatus('task', $oldTask->feedback, $task->status, $oldTask->status); if(in_array($task->status, array('done', 'closed'))) $this->loadModel('action')->create('feedback', $oldTask->feedback, 'processed', '', "task {$task->status}"); } + if(isset($oldTask->team)) + { + $users = $this->loadModel('user')->getPairs('noletter|noempty'); + $oldTeams = $oldTask->team; + $oldTask->team = ''; + foreach($oldTeams as $team) $oldTask->team .= "{$this->lang->task->teamMember}: " . zget($users, $team->account) . ", {$this->lang->task->estimateAB}: " . (float)$team->estimate . ", {$this->lang->task->consumedAB}: " . (float)$team->consumed . ", {$this->lang->task->leftAB}: " . (float)$team->left . "\n"; + $task->team = ''; + foreach($this->post->team as $i => $account) + { + if(empty($account)) continue; + $task->team .= "{$this->lang->task->teamMember}: " . zget($users, $account) . ", {$this->lang->task->estimateAB}: " . zget($this->post->teamEstimate, $i, 0) . ", {$this->lang->task->consumedAB}: " . zget($this->post->teamConsumed, $i, 0) . ", {$this->lang->task->leftAB}: " . zget($this->post->teamLeft, $i, 0) . "\n"; + } + } return common::createChanges($oldTask, $task); } @@ -2158,10 +2171,11 @@ class taskModel extends model ->setDefault('assignedTo', $oldTask->openedBy) ->setDefault('assignedDate', $now) ->setDefault('finishedBy', '') - ->setDefault('finishedDate', '0000-00-00') + ->setDefault('finishedDate', '0000-00-00 00:00:00') ->setDefault('canceledBy, lastEditedBy', $this->app->user->account) ->setDefault('canceledDate, lastEditedDate', $now) ->stripTags($this->config->task->editor->cancel['id'], $this->config->allowedTags) + ->setIF(empty($oldTask->finishedDate), 'finishedDate', '') ->remove('comment') ->get(); @@ -2222,12 +2236,15 @@ class taskModel extends model ->setDefault('left', 0) ->setDefault('status', 'doing') ->setDefault('finishedBy, canceledBy, closedBy, closedReason', '') - ->setDefault('finishedDate, canceledDate, closedDate', '0000-00-00') + ->setDefault('finishedDate, canceledDate, closedDate', '0000-00-00 00:00:00') ->setDefault('lastEditedBy', $this->app->user->account) ->setDefault('lastEditedDate', helper::now()) ->setDefault('assignedDate', helper::now()) ->setDefault('activatedDate', helper::now()) ->stripTags($this->config->task->editor->activate['id'], $this->config->allowedTags) + ->setIF(empty($oldTask->finishedDate), 'finishedDate', '') + ->setIF(empty($oldTask->canceledDate), 'canceledDate', '') + ->setIF(empty($oldTask->closedDate), 'closedDate', '') ->remove('comment,uid,multiple,team,teamEstimate,teamConsumed,teamLeft,teamSource') ->get(); From d0e33c4e3c1439e8270b82901dd77c9b8c5a522d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E5=88=9A?= Date: Thu, 1 Sep 2022 06:53:32 +0000 Subject: [PATCH 10/57] * Fix bug#27141,27153 --- module/group/control.php | 7 +++++++ module/group/model.php | 7 +++++++ module/story/view/edit.html.php | 4 +++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/module/group/control.php b/module/group/control.php index 4d8c411c83..2f32259e70 100644 --- a/module/group/control.php +++ b/module/group/control.php @@ -151,11 +151,18 @@ class group extends control $group = $this->group->getByID($groupID); $this->view->title = $this->lang->company->common . $this->lang->colon . $group->name . $this->lang->colon . $this->lang->group->manageView; + /* Get the list of data sets under administrator permission. */ + if(!$this->app->user->admin) + { + $this->app->user->admin = true; + $changeAdmin = true; + } $this->view->group = $group; $this->view->programs = $this->loadModel('program')->getParentPairs('', '', false); $this->view->projects = $this->loadModel('project')->getPairsByProgram('', 'all', true, 'order_desc'); $this->view->executions = $this->loadModel('execution')->getPairs(0, 'all', 'all'); $this->view->products = $this->loadModel('product')->getPairs(); + if(!empty($changeAdmin)) $this->app->user->admin = false; $navGroup = array(); foreach($this->lang->navGroup as $moduleName => $groupName) diff --git a/module/group/model.php b/module/group/model.php index 57f02b3fac..e0b8cfb593 100644 --- a/module/group/model.php +++ b/module/group/model.php @@ -252,7 +252,14 @@ class groupModel extends model ->andWhere('deleted')->eq(0) ->fetchAll('id'); + /* Get the list of program sets under administrator permission. */ + if(!$this->app->user->admin) + { + $this->app->user->admin = true; + $changeAdmin = true; + } $programs = $this->loadModel('program')->getParentPairs('', '', false); + if(!empty($changeAdmin)) $this->app->user->admin = false; $projects = array(); $executions = array(); diff --git a/module/story/view/edit.html.php b/module/story/view/edit.html.php index e28b9d8f26..62528e92cd 100644 --- a/module/story/view/edit.html.php +++ b/module/story/view/edit.html.php @@ -294,10 +294,12 @@
story->legendMisc;?>
+ status == 'closed'):?> - + +
story->duplicateStory;?>story->duplicateStory;?> '') + $productStories, $story->duplicateStory ? $story->duplicateStory : '', "class='form-control' placeholder='{$lang->bug->duplicateTip}'"); ?>
type == 'story' ? $lang->requirement->linkStory : $lang->story->linkStory;?> From a711704373eead43422d19158ae78b28966a93ec Mon Sep 17 00:00:00 2001 From: dongli Date: Thu, 1 Sep 2022 07:04:16 +0000 Subject: [PATCH 11/57] * Fix bug #26715. --- module/project/js/create.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/project/js/create.js b/module/project/js/create.js index 1a4ce62599..d6b73cab40 100644 --- a/module/project/js/create.js +++ b/module/project/js/create.js @@ -148,12 +148,12 @@ function setParentProgram(parentProgram) $('#budgetUnit').val(data.budgetUnit).trigger('chosen:updated'); if(typeof(data.availableBudget) == 'undefined') { - $('#budget').removeAttr('placeholder').attr('disabled', 'disabled'); + $('#budget').removeAttr('placeholder').attr('disabled', true); $('#future').prop('checked', true); } else { - $('#budget').removeAttr('disabled', 'disabled') + $('#budget').removeAttr('disabled', true) $('#future').prop('checked', false); } }); From e2d484c49d972ae8027250655d3c3702b0ed064d Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 1 Sep 2022 15:12:24 +0800 Subject: [PATCH 12/57] * Fix issue #726. --- module/kanban/js/view.js | 5 +++++ module/kanban/view/view.html.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/module/kanban/js/view.js b/module/kanban/js/view.js index b0301ed6bd..859c3fd81e 100644 --- a/module/kanban/js/view.js +++ b/module/kanban/js/view.js @@ -1433,6 +1433,8 @@ function initKanban($kanban) */ $(function() { + $(document).find('main#main').css('padding-top', '16px'); + window.isMultiLanes = laneCount > 1; $.cookie('isFullScreen', 0); @@ -1565,6 +1567,8 @@ $(function() if($(this).hasClass('disabled')) return; swipeRegionNavTabs($('#regionNavTabs').find('ul'), 'right'); }); + + if(Object.values(regions).length <= 1) $('#kanbanBox').removeClass('hidden'); }); /** @@ -1919,4 +1923,5 @@ function initRegionTabs() $regionNavTabs.find('ul')[0].style.transform = 'translateX(' + distance + 'px)'; if(distance < 0) $('#regionTabs').find('.leftBtn').removeClass('disabled'); if($acitiveItem.next().length != 0 && regionTabULWidth > regionTabsWidth) $('#regionTabs').find('.rightBtn').removeClass('disabled'); + $('#kanbanBox').removeClass('hidden'); } diff --git a/module/kanban/view/view.html.php b/module/kanban/view/view.html.php index 6cb317adde..121728b6e8 100644 --- a/module/kanban/view/view.html.php +++ b/module/kanban/view/view.html.php @@ -54,7 +54,7 @@ $canViewArchivedCard = commonModel::hasPriv('kanban', 'viewArchivedCard'); $canViewArchivedColumn = commonModel::hasPriv('kanban', 'viewArchivedColumn'); ?> -
+
@@ -117,39 +100,22 @@ $canViewArchivedColumn = commonModel::hasPriv('kanban', 'viewArchivedColumn');
From c808b526818c2c06c89858b0cf38d42b8db27435 Mon Sep 17 00:00:00 2001 From: dongli Date: Thu, 1 Sep 2022 07:21:09 +0000 Subject: [PATCH 14/57] * Fix bug #26715. --- module/project/js/create.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/project/js/create.js b/module/project/js/create.js index d6b73cab40..9827c7423a 100644 --- a/module/project/js/create.js +++ b/module/project/js/create.js @@ -153,7 +153,7 @@ function setParentProgram(parentProgram) } else { - $('#budget').removeAttr('disabled', true) + $('#budget').removeAttr('disabled') $('#future').prop('checked', false); } }); From 51853ef5232ce69dfe5697ca511ab0a4822d16b4 Mon Sep 17 00:00:00 2001 From: dongli Date: Thu, 1 Sep 2022 07:42:29 +0000 Subject: [PATCH 15/57] * Fix bug #26188. --- module/my/css/changepassword.css | 1 + 1 file changed, 1 insertion(+) diff --git a/module/my/css/changepassword.css b/module/my/css/changepassword.css index 994521df07..85d0a993c3 100644 --- a/module/my/css/changepassword.css +++ b/module/my/css/changepassword.css @@ -1 +1,2 @@ #mainContent table > tbody > tr > td > div.text-danger.help-text {word-break: break-all;} +[lang^=fr] #mainContent table > tbody > tr {white-space: nowrap;} From 30998f7add4838f0174b65717fe1f024e81fe5e4 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 1 Sep 2022 15:47:42 +0800 Subject: [PATCH 16/57] * Finish task #66996. --- module/kanban/js/view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/kanban/js/view.js b/module/kanban/js/view.js index 088b021401..db5d3cda1d 100644 --- a/module/kanban/js/view.js +++ b/module/kanban/js/view.js @@ -1856,7 +1856,7 @@ function swipeRegionNavTabs($object, direction) var radius = $item.hasClass('active') ? radiusWidth : 0; /* Calculate the offset after sliding. */ - if(direction == 'left' && (itemOffset + distance + radius) >= 0) + if(direction == 'left' && (itemOffset + distance + radius) >= -5) { /* If you swipe left, the distance is equal to the item's left. */ distance = - itemLeft + radius - ($item.prev().hasClass('active') ? radiusWidth : 0); From 708494da4eb537d3c283d43610fd23f6c714741b Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 1 Sep 2022 16:17:04 +0800 Subject: [PATCH 17/57] * Fix issue #731. --- module/kanban/css/view.css | 4 ++++ module/kanban/js/view.js | 25 +++++++++++++++++++++++++ module/kanban/view/view.html.php | 15 ++++++--------- 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/module/kanban/css/view.css b/module/kanban/css/view.css index 83f5935427..cf39da2402 100644 --- a/module/kanban/css/view.css +++ b/module/kanban/css/view.css @@ -175,3 +175,7 @@ #regionTabs.affixed ul > li {margin-bottom: 0px !important;} #regionTabs .region-actions .dropdown-menu {top: 25px;} #region-tab-actions {display: flex; position: relative; right: 0px; top: -2px;} +.region {display: none;} +.region.active {display: block;} +.region.active.notAll {margin-top: 0px;} +.region.active.notAll .region-header > * {display: none;} diff --git a/module/kanban/js/view.js b/module/kanban/js/view.js index 088b021401..a18c74ac44 100644 --- a/module/kanban/js/view.js +++ b/module/kanban/js/view.js @@ -1923,3 +1923,28 @@ function initRegionTabs() if($acitiveItem.next().length != 0 && regionTabULWidth > regionTabsWidth) $('#regionTabs').find('.rightBtn').removeClass('disabled'); $('#kanbanBox').removeClass('hidden'); } + +$('[data-tab]').on('shown.zui.tab', function(e) +{ + var $current = $(e.target); + var $prev = $(e.relatedTarget); + var contentID = $current.attr('href'); + + $current.addClass('btn-active-text'); + $current.parent().addClass('active'); + $prev.removeClass('btn-active-text'); + $prev.parent().removeClass('active'); + + if(contentID == 'all') + { + $('.region').addClass('active'); + $('.region').removeClass('notAll'); + } + else + { + var $currentRegion = $(contentID); + $('.region').removeClass('active'); + $currentRegion.addClass('active notAll'); + $currentRegion.find('.kanban').css('display', 'block'); + } +}); diff --git a/module/kanban/view/view.html.php b/module/kanban/view/view.html.php index 08ca0055a9..a42934bff6 100644 --- a/module/kanban/view/view.html.php +++ b/module/kanban/view/view.html.php @@ -61,15 +61,13 @@ $canViewArchivedColumn = commonModel::hasPriv('kanban', 'viewArchivedColumn');
@@ -96,9 +94,8 @@ $canViewArchivedColumn = commonModel::hasPriv('kanban', 'viewArchivedColumn');
- $regions[$regionID]) : $regions;?> - -
+ +
-
+
archived and ($canViewArchivedCard or $canViewArchivedColumn))) and !(isset($this->config->CRKanban) and $this->config->CRKanban == '0' and $kanban->status == 'closed')):?> @@ -95,7 +95,10 @@ $canViewArchivedColumn = commonModel::hasPriv('kanban', 'viewArchivedColumn');
-
+ id == $regionID) ? 'active' : '';?> + + +
From d4cd0de865eecee4a16950e55217be36897990ce Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 2 Sep 2022 09:09:06 +0800 Subject: [PATCH 23/57] * adjust for webhook send weixin message. --- module/webhook/model.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/module/webhook/model.php b/module/webhook/model.php index f34a4ca685..6694e097f9 100644 --- a/module/webhook/model.php +++ b/module/webhook/model.php @@ -565,7 +565,7 @@ class webhookModel extends model } /** - * Get weixin data. + * Get weixin send data. * * @param string $title * @param string $text @@ -573,7 +573,7 @@ class webhookModel extends model * @access public * @return object */ - public function getWeixinData($title, $text, $mobile) + public function getWeixinData($title, $text, $mobile = '') { $data = new stdclass(); $data->msgtype = 'markdown'; @@ -581,13 +581,25 @@ class webhookModel extends model $markdown = new stdclass(); $markdown->content = $text; - if($mobile) $markdown->mentioned_mobile_list = array($mobile); + if($mobile) + { + $data->msgtype = 'text'; + $markdown->mentioned_mobile_list = array($mobile); + } - $data->markdown = $markdown; + $data->{$data->msgtype} = $markdown; return $data; } + /** + * Get feishu send data. + * + * @param string $title + * @param string $text + * @access public + * @return string + */ public function getFeishuData($title, $text) { $data = new stdclass(); From 1d326d5bb9cf37acc255eb827317520458a1da04 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 2 Sep 2022 09:09:47 +0800 Subject: [PATCH 24/57] * code for task #67405. --- config/filter.php | 1 + db/update17.6.sql | 2 ++ db/zentao.sql | 2 ++ module/upgrade/model.php | 11 ++++++++++- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/config/filter.php b/config/filter.php index 16374266ab..39b722daec 100755 --- a/config/filter.php +++ b/config/filter.php @@ -20,6 +20,7 @@ $filter->default->paramName = 'reg::paramName'; $filter->default->paramValue = 'reg::paramValue'; $filter->default->get['onlybody'] = 'equal::yes'; +$filter->default->get['_single'] = 'equal::1'; $filter->default->get['tid'] = 'reg::word'; $filter->default->get['HTTP_X_REQUESTED_WITH'] = 'equal::XMLHttpRequest'; diff --git a/db/update17.6.sql b/db/update17.6.sql index 4774842924..1d60b73fd5 100644 --- a/db/update17.6.sql +++ b/db/update17.6.sql @@ -11,3 +11,5 @@ CREATE TABLE `zt_taskteam` ( PRIMARY KEY (`id`), KEY `task` (`task`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +ALTER TABLE `zt_taskestimate` ADD `order` tinyint unsigned NULL DEFAULT '0'; +ALTER TABLE `zt_effort` ADD `order` tinyint unsigned NOT NULL DEFAULT '0' AFTER `end`; diff --git a/db/zentao.sql b/db/zentao.sql index a986e9e742..8ed0a0d092 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -1594,6 +1594,7 @@ CREATE TABLE IF NOT EXISTS `zt_taskestimate` ( `consumed` float unsigned NOT NULL, `account` char(30) NOT NULL default '', `work` text, + `order` tinyint(3) unsigned NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `task` (`task`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -6534,6 +6535,7 @@ ALTER TABLE `zt_effort` ADD `consumed` float NOT NULL AFTER `left`; ALTER TABLE `zt_effort` CHANGE `begin` `begin` smallint(4) unsigned zerofill NOT NULL AFTER `consumed`; ALTER TABLE `zt_effort` CHANGE `end` `end` smallint(4) unsigned zerofill NOT NULL AFTER `begin`; ALTER TABLE `zt_effort` ADD `deleted` enum('0','1') NOT NULL DEFAULT '0' AFTER `end`; +ALTER TABLE `zt_effort` ADD `order` tinyint unsigned NOT NULL DEFAULT '0' AFTER `end`; ALTER TABLE `zt_effort` ADD INDEX `execution` (`execution`); ALTER TABLE `zt_effort` ADD INDEX `objectID` (`objectID`); ALTER TABLE `zt_effort` ADD INDEX `date` (`date`); diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 0cc9565723..234e436f90 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -7251,7 +7251,7 @@ class upgradeModel extends model */ public function convertTaskteam() { - $oldTeamGroup = $this->dao->select('root as task, account, estimate, consumed, left')->from(TABLE_TEAM)->where('type')->eq('task')->fetchGroup('task'); + $oldTeamGroup = $this->dao->select('root as task, account, estimate, consumed, `left`')->from(TABLE_TEAM)->where('type')->eq('task')->fetchGroup('task'); foreach($oldTeamGroup as $taskID => $oldTeams) { $order = 0; @@ -7263,6 +7263,15 @@ class upgradeModel extends model if($oldTeam->consumed > 0 and $oldTeam->left == 0) $oldTeam->status = 'done'; $this->dao->insert(TABLE_TASKTEAM)->data($oldTeam)->exec(); + + if($this->config->edition == 'open') + { + $this->dao->update(TABLE_TASKESTIMATE)->set('`order`')->eq($order)->where('task')->eq($oldTeam->task)->exec(); + } + else + { + $this->dao->update(TABLE_EFFORT)->set('`order`')->eq($order)->where('objectType')->eq('task')->andWhere('objectID')->eq($oldTeam->task)->exec(); + } $order ++; } } From 65e3fc90348471aa564ef872880736ef4eeb5900 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 2 Sep 2022 09:11:42 +0800 Subject: [PATCH 25/57] * Fix issue #731. --- module/kanban/css/view.css | 4 ++-- module/kanban/js/view.js | 28 ++++++++++++++++------------ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/module/kanban/css/view.css b/module/kanban/css/view.css index c9a67e1bf8..d841043f41 100644 --- a/module/kanban/css/view.css +++ b/module/kanban/css/view.css @@ -161,8 +161,8 @@ #regionTabs {background-color: #efefef; z-index: 100; display: flex;} #regionTabs .leftBtn.disabled i, #regionTabs .rightBtn.disabled i{color: #c2c2c2;} #regionTabs .icon-angle-left, #regionTabs .icon-angle-right {font-size: 20px; vertical-align: -webkit-baseline-middle;} -#regionNavTabs {display: inline-flex; overflow: hidden; width: 100%;} -#regionNavTabs > ul {display: inline-flex; border-bottom: unset; transform: translateX(10px);} +#regionNavTabs {display: inline-flex; overflow: hidden; width: 100%; padding-left: 10px;} +#regionNavTabs > ul {display: inline-flex; border-bottom: unset;} #regionNavTabs > ul > li {padding: 6px 15px; margin-bottom: 6px; border-radius: 4px 4px 0px 0px;} #regionNavTabs > ul > li.active {background-color: #fff;} #regionNavTabs > ul > li.active::before {content: ''; width: 10px; height: 10px; position: absolute; left: -10px; top: 21px; background: radial-gradient(circle at 0% 0%,transparent 10px,#fff 0);} diff --git a/module/kanban/js/view.js b/module/kanban/js/view.js index bfdbe38fbb..8be1cbad72 100644 --- a/module/kanban/js/view.js +++ b/module/kanban/js/view.js @@ -1554,6 +1554,8 @@ $(function() setToolTip(); + distance = 0; + radiusWidth = 10; $(window).on('resize', initRegionTabs); $('.leftBtn').click(function() @@ -1856,13 +1858,13 @@ function swipeRegionNavTabs($object, direction) var radius = $item.hasClass('active') ? radiusWidth : 0; /* Calculate the offset after sliding. */ - if(direction == 'left' && (itemOffset + distance + radius) >= -5) + if(direction == 'left' && (itemOffset + distance + radius + radiusWidth) >= -5) { /* If you swipe left, the distance is equal to the item's left. */ - distance = - itemLeft + radius - ($item.prev().hasClass('active') ? radiusWidth : 0); - if(distance + radius >= 0) + distance = - itemLeft + radius - ($item.prev().hasClass('active') ? radiusWidth : 0) - radiusWidth; + if($item.prev().length == 0) { - distance = radius; + distance = 0; $('.leftBtn').addClass('disabled'); } $object[0].style.transform = 'translateX(' + distance + 'px)'; @@ -1873,13 +1875,13 @@ function swipeRegionNavTabs($object, direction) } var nextRadius = $item.next().hasClass('active') ? radiusWidth : 0; - if(direction == 'right' && itemOffset > (offsetWidth - distance + nextRadius)) + if(direction == 'right' && itemOffset > (offsetWidth - distance + nextRadius + radiusWidth)) { /* If you swipe right, the distance is equal to the left distance of item plus the width of item minus the width of the regionNavTabs. */ - distance = offsetWidth - itemOffset - radius + nextRadius; + distance = offsetWidth - itemOffset - radius + nextRadius - radiusWidth; if($item.next().length == 0) { - distance = - objectWidth + offsetWidth - radius; + distance = - objectWidth + offsetWidth - radiusWidth * 2; $('.rightBtn').addClass('disabled'); } $object[0].style.transform = 'translateX(' + distance + 'px)'; @@ -1914,11 +1916,13 @@ function initRegionTabs() /* Print left and right button. */ if(regionTabULWidth > regionTabsWidth) $('.leftBtn, .rightBtn').removeClass('hidden'); - /* Locate the position of the currently selected item. */ - radiusWidth = 10; - distance = (acitiveItemLeft + acitiveItemWidth) > regionTabsWidth ? - (acitiveItemLeft + acitiveItemWidth - regionTabsWidth + radiusWidth) : 0; - if($acitiveItem.prev().length == 0) distance = radiusWidth; - $regionNavTabs.find('ul')[0].style.transform = 'translateX(' + distance + 'px)'; + if(acitiveItemLeft + distance + radiusWidth < 0 || acitiveItemWidth + acitiveItemLeft + distance + radiusWidth> regionTabsWidth) + { + /* Locate the position of the currently selected item. */ + distance = (acitiveItemLeft + acitiveItemWidth) > regionTabsWidth ? - (acitiveItemLeft + acitiveItemWidth - regionTabsWidth + radiusWidth * 2) : 0; + if($acitiveItem.prev().length == 0) distance = 0; + $regionNavTabs.find('ul')[0].style.transform = 'translateX(' + distance + 'px)'; + } if(distance < 0) $('#regionTabs').find('.leftBtn').removeClass('disabled'); if($acitiveItem.next().length != 0 && regionTabULWidth > regionTabsWidth) $('#regionTabs').find('.rightBtn').removeClass('disabled'); $('#kanbanBox').removeClass('hidden'); From c64c9bbf3ea1669bc3c3476162ad7223b1352127 Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Fri, 2 Sep 2022 09:32:41 +0800 Subject: [PATCH 26/57] * Fix bug #26131. --- module/api/control.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/module/api/control.php b/module/api/control.php index a854a71abc..df74573805 100755 --- a/module/api/control.php +++ b/module/api/control.php @@ -35,6 +35,10 @@ class api extends control */ public function index($libID = 0, $moduleID = 0, $apiID = 0, $version = 0, $release = 0, $appendLib = 0, $browseType = '', $param = 0) { + /* Get all api doc libraries. */ + $libs = $this->doc->getApiLibs($appendLib); + if($libID == 0 and !empty($libs)) $libID = key($libs); + /* Get an api doc. */ if($apiID > 0) { @@ -61,11 +65,6 @@ class api extends control $this->view->typeList = $this->api->getTypeList($libID); } - /* Get all api doc libraries. */ - $libs = $this->doc->getApiLibs($appendLib); - if($libID == 0 and $apiID > 0) $libID = $api->lib; - if($libID == 0 and !empty($libs)) $libID = key($libs); - $lib = $this->doc->getLibById($libID); $appendLib = (!empty($lib) and $lib->deleted == '1') ? $libID : 0; From 62e9b5aa4471b985ffe57d3d649664ee06a75445 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Fri, 2 Sep 2022 09:44:14 +0800 Subject: [PATCH 27/57] * Code for task#66955. --- module/story/model.php | 21 +++++++++------------ module/task/config.php | 2 +- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/module/story/model.php b/module/story/model.php index 3f0060323c..38df6235dd 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -449,18 +449,6 @@ class storyModel extends model { $forceReview = $this->checkForceReview(); - $reviewers = ''; - foreach($_POST['title'] as $index => $value) - { - if($_POST['title'][$index] and isset($_POST['reviewer'][$index]) and empty($_POST['reviewDitto'][$index])) $reviewers = $_POST['reviewer'][$index] = array_filter($_POST['reviewer'][$index]); - if($_POST['title'][$index] and isset($_POST['reviewer'][$index]) and !empty($_POST['reviewDitto'][$index])) $_POST['reviewer'][$index] = $reviewers; - if($_POST['title'][$index] and empty($_POST['reviewer'][$index]) and $forceReview) - { - dao::$errors[] = $this->lang->story->errorEmptyReviewedBy; - return false; - } - } - $this->loadModel('action'); $branch = (int)$branch; $productID = (int)$productID; @@ -499,6 +487,7 @@ class storyModel extends model $extendFields = $this->getFlowExtendFields(); $data = array(); + $reviewers = ''; foreach($stories->title as $i => $title) { if(empty($title)) @@ -513,6 +502,14 @@ class storyModel extends model } if(empty($stories->reviewer[$i]) and empty($stories->reviewerDitto[$i])) $stories->reviewer[$i] = array(); + $reviewers = (isset($stories->reviewDitto[$i])) ? $reviewers : $stories->reviewer[$i]; + $stories->reviewer[$i] = $reviewers; + $_POST['reviewer'][$i] = $reviewers; + if(empty($stories->reviewer[$i]) and $forceReview) + { + dao::$errors[] = $this->lang->story->errorEmptyReviewedBy; + return false; + } $story = new stdclass(); $story->type = $type; diff --git a/module/task/config.php b/module/task/config.php index b45b5d0f00..116412e098 100644 --- a/module/task/config.php +++ b/module/task/config.php @@ -48,7 +48,7 @@ $config->task->custom->createFields = $config->task->customCreateFields; $config->task->custom->batchCreateFields = 'module,story,assignedTo,estimate,desc,pri'; $config->task->custom->batchEditFields = 'module,assignedTo,status,pri,estimate,record,left'; -$config->task->excludeCheckFileds = ',pri,estStartedDitto,deadlineDitto,'; +$config->task->excludeCheckFileds = ',pri,estStartedDitto,deadlineDitto,parent,'; $config->task->datatable = new stdclass(); $config->task->datatable->defaultField = array('id', 'pri', 'name', 'status', 'assignedTo', 'finishedBy', 'estimate', 'consumed', 'left', 'progress', 'deadline', 'actions'); From f3902cda3d3b444a00b739a32cfbd6ba39bb63e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AE=A1=E8=A5=BF=E8=BF=8E?= Date: Fri, 2 Sep 2022 02:00:50 +0000 Subject: [PATCH 28/57] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f191cd48c0..137cdcddbc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ stages: - sonar - unit_test + - uitest - cleanup_packages - package sonarqube: @@ -32,6 +33,14 @@ unit_test: only: - master - merge_requests +uitest: + stage: uitest + script: + - "/home/gitlab-runner/bin/zentao-uitest.sh ${CI_PROJECT_DIR}" + allow_failure: true + only: + - master + - merge_requests #notify: # script: # - 'curl --location --request POST ''http://api.lf.oop.cc/api/v1/xuan/chatMessage'' --header ''Content-Type: application/json'' --data-raw ''{"gid": "84be4c6e-02e3-4fdc-b081-318c0c1eca02", "title": "开源包下载地址", "content": "点击查看详情链接", "url": "http://10.0.7.242:8080/allpacks/"}''' From f667c53c829a28d9e345dd95f3b7391473c6dcfb Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 2 Sep 2022 10:46:07 +0800 Subject: [PATCH 29/57] * Fix issue #731. --- module/kanban/js/view.js | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/module/kanban/js/view.js b/module/kanban/js/view.js index 8be1cbad72..90a26fb613 100644 --- a/module/kanban/js/view.js +++ b/module/kanban/js/view.js @@ -1858,10 +1858,10 @@ function swipeRegionNavTabs($object, direction) var radius = $item.hasClass('active') ? radiusWidth : 0; /* Calculate the offset after sliding. */ - if(direction == 'left' && (itemOffset + distance + radius + radiusWidth) >= -5) + if(direction == 'left' && (itemOffset + distance + radius) >= -5) { /* If you swipe left, the distance is equal to the item's left. */ - distance = - itemLeft + radius - ($item.prev().hasClass('active') ? radiusWidth : 0) - radiusWidth; + distance = - itemLeft + radius - ($item.prev().hasClass('active') ? radiusWidth : 0); if($item.prev().length == 0) { distance = 0; @@ -1875,10 +1875,10 @@ function swipeRegionNavTabs($object, direction) } var nextRadius = $item.next().hasClass('active') ? radiusWidth : 0; - if(direction == 'right' && itemOffset > (offsetWidth - distance + nextRadius + radiusWidth)) + if(direction == 'right' && itemOffset > (offsetWidth - distance + nextRadius + radiusWidth * 2)) { /* If you swipe right, the distance is equal to the left distance of item plus the width of item minus the width of the regionNavTabs. */ - distance = offsetWidth - itemOffset - radius + nextRadius - radiusWidth; + distance = offsetWidth - itemOffset - radius + nextRadius - radiusWidth * 2; if($item.next().length == 0) { distance = - objectWidth + offsetWidth - radiusWidth * 2; @@ -1916,13 +1916,27 @@ function initRegionTabs() /* Print left and right button. */ if(regionTabULWidth > regionTabsWidth) $('.leftBtn, .rightBtn').removeClass('hidden'); - if(acitiveItemLeft + distance + radiusWidth < 0 || acitiveItemWidth + acitiveItemLeft + distance + radiusWidth> regionTabsWidth) + if(acitiveItemLeft + distance < 0) { - /* Locate the position of the currently selected item. */ - distance = (acitiveItemLeft + acitiveItemWidth) > regionTabsWidth ? - (acitiveItemLeft + acitiveItemWidth - regionTabsWidth + radiusWidth * 2) : 0; - if($acitiveItem.prev().length == 0) distance = 0; - $regionNavTabs.find('ul')[0].style.transform = 'translateX(' + distance + 'px)'; + distance = - acitiveItemLeft; + if($acitiveItem.prev().length == 0) + { + distance = 0; + $('.leftBtn').addClass('disabled'); + } + $('#regionNavTabs > ul')[0].style.transform = 'translateX(' + distance + 'px)'; } + else if(acitiveItemWidth + acitiveItemLeft + distance + radiusWidth * 2 > regionTabsWidth && acitiveItemLeft != 0 && acitiveItemWidth != 0) + { + distance = regionTabsWidth - acitiveItemWidth - acitiveItemLeft - radiusWidth * 2; + if($acitiveItem.next().length == 0) + { + distance = regionTabsWidth - acitiveItemWidth - acitiveItemLeft - radiusWidth * 2; + $('.rightBtn').addClass('disabled'); + } + $('#regionNavTabs > ul')[0].style.transform = 'translateX(' + distance + 'px)'; + } + if(distance < 0) $('#regionTabs').find('.leftBtn').removeClass('disabled'); if($acitiveItem.next().length != 0 && regionTabULWidth > regionTabsWidth) $('#regionTabs').find('.rightBtn').removeClass('disabled'); $('#kanbanBox').removeClass('hidden'); From d1cb72d4a2fce1f743b32bb3546ffbacd4e41e72 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 2 Sep 2022 10:49:29 +0800 Subject: [PATCH 30/57] * code for task #67405. --- module/task/control.php | 8 ++++-- module/task/model.php | 60 +++++++++++++++++++++++++++++------------ 2 files changed, 49 insertions(+), 19 deletions(-) diff --git a/module/task/control.php b/module/task/control.php index 3a01acf696..5925c9d0ec 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -1177,8 +1177,12 @@ class task extends control $this->session->set('estimateList', $uri, 'execution'); if(isonlybody()) $this->session->set('estimateList', $uri . (strpos($uri, '?') === false ? '?' : '&') . 'onlybody=yes', 'execution'); - $this->view->task = $this->task->getById($taskID); - $this->view->estimates = $this->task->getTaskEstimate($taskID); + $task = $this->task->getById($taskID); + $orderBy = 'date,id'; + if(!empty($task->team) and $task->mode == 'linear') $orderBy = 'order,date,id'; + + $this->view->task = $task; + $this->view->estimates = $this->task->getTaskEstimate($taskID, '', '', $orderBy); $this->view->title = $this->lang->task->record; $this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter'); $this->display(); diff --git a/module/task/model.php b/module/task/model.php index ca204e0083..230273d374 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -487,7 +487,7 @@ class taskModel extends model $clonedTaskID = $this->dao->lastInsertID(); /* Update the table by judging the beginning of the version number. */ - if(preg_match('/^\d/', $this->config->version)) + if($this->config->edition == 'open') { /* ZenTao Pms update TABLE_TASKESTIMATE. */ $this->dao->update(TABLE_TASKESTIMATE)->set('task')->eq($clonedTaskID)->where('task')->eq($oldParentTask->id)->exec(); @@ -985,6 +985,8 @@ class taskModel extends model $taskID = 0; foreach($teams as $team) { + if(isset($extra['order']) and $team->order == $extra['order'] and $team->account == $account) return $team; + if(empty($taskID)) $taskID = $team->task; if(isset($members[$team->account])) $duplicates[$team->account] = $team->account; if(!isset($members[$team->account])) $members[$team->account] = 0; @@ -1746,7 +1748,7 @@ class taskModel extends model $estimate->account = $this->app->user->account; $estimate->consumed = (!empty($oldTask->team) and $currentTeam) ? $estimate->consumed - $currentTeam->consumed : $estimate->consumed - $oldTask->consumed; if($this->post->comment) $estimate->work = $this->post->comment; - $this->addTaskEstimate($estimate); + $estimateID = $this->addTaskEstimate($estimate); if(!empty($oldTask->team) and $currentTeam) { @@ -1756,6 +1758,7 @@ class taskModel extends model $data->status = 'doing'; $this->dao->update(TABLE_TASKTEAM)->data($data)->where('id')->eq($currentTeam->id)->exec(); + if($oldTask->mode == 'linear') $this->updateEstimateOrder($estimateID, $currentTeam->order); $task = $this->computeHours4Multiple($oldTask, $task); @@ -1834,6 +1837,7 @@ class taskModel extends model $estimates[$id]->left = $record->left[$id]; $estimates[$id]->work = $record->work[$id]; $estimates[$id]->account = $this->app->user->account; + $estimates[$id]->order = !empty($record->order[$id]) ? $record->order[$id] : 0; } } @@ -1903,11 +1907,14 @@ class taskModel extends model /* Process multi-person task. Update consumed on team table. */ if(!empty($task->team)) { - $currentTeam = $this->getTeamByAccount($task->team, $this->app->user->account); + $extra = array('filter' => 'done'); + if(!empty($estimate->order)) $extra['order'] = $estimate->order; + $currentTeam = $this->getTeamByAccount($task->team, $this->app->user->account, $extra); if($currentTeam) { $teamStatus = $estimate->left == 0 ? 'done' : 'doing'; $this->dao->update(TABLE_TASKTEAM)->set('left')->eq($estimate->left)->set("consumed = consumed + {$estimate->consumed}")->set('status')->eq($teamStatus)->where('id')->eq($currentTeam->id)->exec(); + if($task->mode == 'linear') $this->updateEstimateOrder($estimateID, $currentTeam->order); $currentTeam->consumed += $estimate->consumed; $currentTeam->left = $estimate->left; $currentTeam->status = $teamStatus; @@ -1946,12 +1953,15 @@ class taskModel extends model public function resetEffortLeft($taskID, $members) { $table = $this->config->edition == 'open' ? TABLE_TASKESTIMATE : TABLE_EFFORT; - $this->dao->update($table)->set('`left`')->eq(0)->where('account')->in($members) - ->beginIF($this->config->edition == 'open')->andWhere('task')->eq($taskID)->fi() - ->beginIF($this->config->edition != 'open')->andWhere('objectID')->eq($taskID)->andWhere('objectType')->eq('task')->fi() - ->orderBy('date_desc,id_desc') - ->limit('1') - ->exec(); + foreach($members as $account) + { + $this->dao->update($table)->set('`left`')->eq(0)->where('account')->eq($account) + ->beginIF($this->config->edition == 'open')->andWhere('task')->eq($taskID)->fi() + ->beginIF($this->config->edition != 'open')->andWhere('objectID')->eq($taskID)->andWhere('objectType')->eq('task')->fi() + ->orderBy('date_desc,id_desc') + ->limit('1') + ->exec(); + } } /** @@ -2020,11 +2030,12 @@ class taskModel extends model $estimate->account = $this->app->user->account; $estimate->consumed = $consumed; if($this->post->comment) $estimate->work = $this->post->comment; - if($estimate->consumed) $this->addTaskEstimate($estimate); + if($estimate->consumed) $estimateID = $this->addTaskEstimate($estimate); if(!empty($oldTask->team) and $currentTeam) { $this->dao->update(TABLE_TASKTEAM)->set('left')->eq(0)->set('consumed')->eq($task->consumed)->set('status')->eq('done')->where('id')->eq($currentTeam->id)->exec(); + if($oldTask->mode == 'linear' and isset($estimateID)) $this->updateEstimateOrder($estimateID, $currentTeam->order); $task = $this->computeHours4Multiple($oldTask, $task); } @@ -2775,16 +2786,31 @@ class taskModel extends model return $taskCounts; } + /** + * Update estimate order for linear task team. + * + * @param int $estimateID + * @param int $order + * @access public + * @return void + */ + public function updateEstimateOrder($estimateID, $order) + { + $table = $this->config->edition == 'open' ? TABLE_TASKESTIMATE : TABLE_EFFORT; + $this->dao->update($table)->set('`order`')->eq((int)$order)->where('id')->eq($estimateID)->exec(); + } + /** * Get task estimate. * * @param int $taskID * @param string $account * @param string $append + * @param string $orderBy * @access public * @return array */ - public function getTaskEstimate($taskID, $account = '', $append = '') + public function getTaskEstimate($taskID, $account = '', $append = '', $orderBy = 'date,id') { if($this->config->edition == 'open') { @@ -2792,7 +2818,7 @@ class taskModel extends model ->where('task')->eq($taskID) ->beginIF($account)->andWhere('account')->eq($account)->fi() ->beginIF($append)->orWhere('id')->eq($append)->fi() - ->orderBy('date,id') + ->orderBy($orderBy) ->fetchAll(); } return $this->dao->select('*')->from(TABLE_EFFORT)->where('objectID')->eq($taskID) @@ -2800,7 +2826,7 @@ class taskModel extends model ->andWhere('deleted')->eq('0') ->beginIF($account)->andWhere('account')->eq($account)->fi() ->beginIF($append)->orWhere('id')->eq($append)->fi() - ->orderBy('date,id') + ->orderBy($orderBy) ->fetchAll(); } @@ -2838,7 +2864,6 @@ class taskModel extends model /* Check for add effort. */ if(empty($effort)) { - if($task->mode == 'linear' and strpos('|done|closed|cancel|pause|', "|{$task->status}|") !== false) return false; $members = array_map(function($member){ return $member->account; }, $task->team); if(!in_array($this->app->user->account, $members)) return false; if($task->mode == 'linear' and $this->app->user->account != $task->assignedTo) return false; @@ -2899,7 +2924,7 @@ class taskModel extends model if(!empty($task->team)) { - $currentTeam = $this->getTeamByAccount($task->team, $oldEstimate->account, array('effortID' => $estimateID)); + $currentTeam = $this->getTeamByAccount($task->team, $oldEstimate->account, array('order' => $oldEstimate->order)); if($currentTeam) { $newTeamInfo = new stdClass(); @@ -2985,7 +3010,7 @@ class taskModel extends model if(!empty($task->team)) { - $currentTeam = $this->getTeamByAccount($task->team, $estimate->account, array('effortID' => $estimateID)); + $currentTeam = $this->getTeamByAccount($task->team, $estimate->account, array('effortID' => $estimateID, 'order' => $estimate->order)); if($currentTeam) { $left = $currentTeam->left; @@ -3589,11 +3614,12 @@ class taskModel extends model * * @param object $data * @access public - * @return void + * @return int */ public function addTaskEstimate($data) { $this->dao->insert(TABLE_TASKESTIMATE)->data($data)->autoCheck()->exec(); + return $this->dao->lastInsertID(); } /** From 26ba81c2a6f02b3f36dd3caf92147fe07959f72f Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 2 Sep 2022 10:56:48 +0800 Subject: [PATCH 31/57] * Optimize code. --- module/kanban/js/view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/kanban/js/view.js b/module/kanban/js/view.js index 90a26fb613..9870249836 100644 --- a/module/kanban/js/view.js +++ b/module/kanban/js/view.js @@ -1964,7 +1964,7 @@ $('[data-tab]').on('shown.zui.tab', function(e) { $regions.addClass('active').removeClass('notAll'); if(hasActions) $regionActions.removeClass('active'); - } + } else { var $currentRegion = $(contentID); From 7b4a22093c6b73ba362d928a3f4daee7771bcda9 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 2 Sep 2022 11:29:49 +0800 Subject: [PATCH 32/57] * Fix issue #731. --- module/kanban/js/view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/kanban/js/view.js b/module/kanban/js/view.js index 9870249836..9d9012e572 100644 --- a/module/kanban/js/view.js +++ b/module/kanban/js/view.js @@ -1928,7 +1928,7 @@ function initRegionTabs() } else if(acitiveItemWidth + acitiveItemLeft + distance + radiusWidth * 2 > regionTabsWidth && acitiveItemLeft != 0 && acitiveItemWidth != 0) { - distance = regionTabsWidth - acitiveItemWidth - acitiveItemLeft - radiusWidth * 2; + distance = regionTabsWidth - acitiveItemWidth - acitiveItemLeft + (distance != 0 ? - radiusWidth * 2 : radiusWidth); if($acitiveItem.next().length == 0) { distance = regionTabsWidth - acitiveItemWidth - acitiveItemLeft - radiusWidth * 2; From 36389ce51eda32208cb82548ba640bcf0242411a Mon Sep 17 00:00:00 2001 From: dongli Date: Fri, 2 Sep 2022 04:29:10 +0000 Subject: [PATCH 33/57] * Fix bug #27225. --- module/program/js/common.js | 1 + module/project/js/create.js | 12 +----------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/module/program/js/common.js b/module/program/js/common.js index 46541b6234..9dc44667a3 100644 --- a/module/program/js/common.js +++ b/module/program/js/common.js @@ -314,6 +314,7 @@ function setBudgetTipsAndAclList(parentID) budgetNotes = programBudget != 0 ? (PGMParentBudget + PGMBudgetUnit + data.availableBudget) : ''; $('#budget').attr('placeholder', budgetNotes); + refreshBudgetUnit(data); }); $('.aclBox').html($('#subPGMAcl').html()); } diff --git a/module/project/js/create.js b/module/project/js/create.js index 9827c7423a..6a2fc188ec 100644 --- a/module/project/js/create.js +++ b/module/project/js/create.js @@ -145,17 +145,7 @@ function setParentProgram(parentProgram) } budgetOverrunTips(); outOfDateTip(); - $('#budgetUnit').val(data.budgetUnit).trigger('chosen:updated'); - if(typeof(data.availableBudget) == 'undefined') - { - $('#budget').removeAttr('placeholder').attr('disabled', true); - $('#future').prop('checked', true); - } - else - { - $('#budget').removeAttr('disabled') - $('#future').prop('checked', false); - } + refreshBudgetUnit(data); }); $('#parent').attr('data-lastSelected', parentProgram); From 2e870f698b90eb75ad65f459b08746db6cf23082 Mon Sep 17 00:00:00 2001 From: dongli Date: Fri, 2 Sep 2022 04:32:07 +0000 Subject: [PATCH 34/57] * Fix bug #27225. --- www/js/my.full.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/www/js/my.full.js b/www/js/my.full.js index 7d02f6e575..dad5f587d5 100644 --- a/www/js/my.full.js +++ b/www/js/my.full.js @@ -1307,3 +1307,25 @@ function setCustomFieldsStyle(maxFieldCount, $name, nameMinWidth) if($name.width() < nameMinWidth) $name.width(200); } + +/** + * Refresh budget units of the project. + * + * @param object $data + * @access public + * @return void + */ +function refreshBudgetUnit(data) +{ + $('#budgetUnit').val(data.budgetUnit).trigger('chosen:updated'); + if(typeof(data.availableBudget) == 'undefined') + { + $('#budget').removeAttr('placeholder').attr('disabled', true); + $('#future').prop('checked', true); + } + else + { + $('#budget').removeAttr('disabled'); + $('#future').prop('checked', false); + } +} From 041204feb80980891b98a1b38278beadd12cde12 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Fri, 2 Sep 2022 13:09:44 +0800 Subject: [PATCH 35/57] * Modify gogs test case. --- test/data/oauth.yaml | 4 ++-- test/data/pipeline.yaml | 6 +++--- test/data/zentao/config.php | 4 ++-- test/lib/db.class.php | 2 +- test/lib/utils.php | 2 +- test/model/gogs/checktokenaccess.php | 2 +- test/model/gogs/create.php | 2 +- test/model/gogs/getgogslistbyaccount.php | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/test/data/oauth.yaml b/test/data/oauth.yaml index 700ff499a0..cadcdfd2ac 100644 --- a/test/data/oauth.yaml +++ b/test/data/oauth.yaml @@ -10,8 +10,8 @@ fields: - field: account2 range: 3-100 - field: openID - range: 1-100 + range: 1-98,root{2} - field: providerType - range: gitlab + range: gitlab{98},gitea,gogs - field: providerID range: 1 diff --git a/test/data/pipeline.yaml b/test/data/pipeline.yaml index 3d70e5b100..1e69ac16b3 100644 --- a/test/data/pipeline.yaml +++ b/test/data/pipeline.yaml @@ -9,13 +9,13 @@ fields: - field: name range: GitLab服务器,SonarQube服务器,Jenkins服务器,Gitea服务器,Gogs服务器 - field: url - range: [http://10.0.1.161:51080],[http://10.0.1.161:59001],[http://10.0.1.161:58080],[http://10.0.7.242:9020],[http://10.0.7.242:9021] + range: [http://10.0.7.242:9980],[http://10.0.7.242:9990],[http://10.0.7.242:9580],[http://10.0.7.242:9020],[http://10.0.7.242:9021] - field: account range: [],[admin]{2},[]{2} - field: password - range: [],[UDJzc3cwcmQ=],[RWFzeXNvZnRAcWQyMDEwIQ==],[]{2} + range: [],[U2h3N0NldHlsc1ozYkVTVjBreXM=],[TThFbEJqcVZsNmJXcTdNSmJZN3U=],[]{2} - field: token - range: x88fZokrp5hShia2jyBN,YWRtaW46UDJzc3cwcmQ=,1196c85ba525a268570df9da627e3a7b2d,c6769e6761a7d719129b2421dcb3112d936e2b1f,9ff43f9d1a369465bcf0781a3785f46bcef782d1 + range: x88fZokrp5hShia2jyBN,YWRtaW46U2h3N0NldHlsc1ozYkVTVjBreXM=,1196c85ba525a268570df9da627e3a7b2d,c6769e6761a7d719129b2421dcb3112d936e2b1f,9ff43f9d1a369465bcf0781a3785f46bcef782d1 - field: private range: 08bcc98f75d7d40053dc80722bdc117b,228b25587479f2fc7570428e8bcbabdc,ec8e41481723685d9106c88be5967c41,a56af13f4c4a6a4ed77f24e59794cf39,4fabcbd31314365506ebc56c0c83c1ec - field: createdBy diff --git a/test/data/zentao/config.php b/test/data/zentao/config.php index d67e57308f..1dd6d8f647 100644 --- a/test/data/zentao/config.php +++ b/test/data/zentao/config.php @@ -109,12 +109,12 @@ $builder->weeklyreport = array('rows' => 10, 'extends' => array('weeklyreport')) $builder->metting = array('rows' => 10, 'extends' => array('meeting')); $builder->usertpl = array('rows' => 10, 'extends' => array('usertpl')); -$builder->pipeline = array('rows' => 4, 'extends' => array('pipeline')); +$builder->pipeline = array('rows' => 5, 'extends' => array('pipeline')); $builder->holiday = array('rows' => 100, 'extends' => array('holiday')); $builder->repo = array('rows' => 1, 'extends' => array('repo')); $builder->job = array('rows' => 2, 'extends' => array('job')); $builder->mr = array('rows' => 1, 'extends' => array('mr')); -$builder->oauth = array('rows' => 90, 'extends' => array('oauth')); +$builder->oauth = array('rows' => 100, 'extends' => array('oauth')); $builder->notify = array('rows' => 10, 'extends' => array('notify')); $builder->vm = array('rows' => 1, 'extends' => array('vm')); diff --git a/test/lib/db.class.php b/test/lib/db.class.php index c319649560..e0cc0cf622 100644 --- a/test/lib/db.class.php +++ b/test/lib/db.class.php @@ -143,7 +143,7 @@ class db { for($i = 1; $i <= $this->config->test->dbNum; $i++) { - $this->dao->query('DROP DATABASE ' . $this->config->test->dbPrefix . $i); + $this->dao->query('DROP DATABASE IF EXISTS ' . $this->config->test->dbPrefix . $i); $this->dao->query('CREATE DATABASE ' . $this->config->test->dbPrefix . $i); shell_exec("mysql -h{$this->config->db->host} -u {$this->config->db->user} -p{$this->config->db->password} -P {$this->config->db->port} {$this->config->test->dbPrefix}{$i} < {$this->sqlFile}"); diff --git a/test/lib/utils.php b/test/lib/utils.php index 2182360829..60e0f6a9d5 100755 --- a/test/lib/utils.php +++ b/test/lib/utils.php @@ -236,7 +236,7 @@ function copyDB() foreach($dbUsed as $db) { - if ($currentDBNum->num > 0) $dao->query('drop database ' . $db); + if($currentDBNum->num > 0) $dao->query('DROP DATABASE IF EXISTS ' . $db); $dao->query('CREATE DATABASE ' . $db); shell_exec("mysql -h{$config->db->host} -P {$config->db->port} -u{$config->db->user} -p{$config->db->password} $db < $sqlFile"); echo '数据库<' . $db . '>复制成功!' . PHP_EOL; diff --git a/test/model/gogs/checktokenaccess.php b/test/model/gogs/checktokenaccess.php index 2081e017b9..54b4d0dd4e 100644 --- a/test/model/gogs/checktokenaccess.php +++ b/test/model/gogs/checktokenaccess.php @@ -32,7 +32,7 @@ r($result) && p() && e('return null'); //使用正确的host,错误的token验 $token = '9ff43f9d1a369465bcf0781a3785f46bcef782d1'; $result = $gogs->checkTokenAccess($host, $token); if(isset($result->id)) $result = 'success'; -r($result) && p() && e('success'); //通过host,token验证token权限 +r($result) && p() && e('1'); //通过host,token验证token权限 $token = 'wVFHE6NZA-cJy-3U2y2J'; $result = $gogs->checkTokenAccess($host, $token); diff --git a/test/model/gogs/create.php b/test/model/gogs/create.php index f1cb344a34..457192d2f3 100644 --- a/test/model/gogs/create.php +++ b/test/model/gogs/create.php @@ -12,7 +12,7 @@ cid=1 pid=1 Gogs名称为空 >> name -服务器地址为空 >> url +服务器地址为空 >> url 正确Gogs数据 >> Gogs,http://10.0.7.242:9021,9ff43f9d1a369465bcf0781a3785f46bcef782d1 */ diff --git a/test/model/gogs/getgogslistbyaccount.php b/test/model/gogs/getgogslistbyaccount.php index d7d8b14f8d..05727e94e0 100644 --- a/test/model/gogs/getgogslistbyaccount.php +++ b/test/model/gogs/getgogslistbyaccount.php @@ -13,5 +13,5 @@ pid=1 $gogs = $tester->loadModel('gogs'); r(count($gogs->getGogsListByAccount())) && p() && e('0'); //默认admin用户查询绑定的gogs服务器 -r(count($gogs->getGogsListByAccount('user3'))) && p() && e('1'); //使用已绑定一个gogs服务器的用户查询 +r(count($gogs->getGogsListByAccount('user4'))) && p() && e('1'); //使用已绑定一个gogs服务器的用户查询 r(count($gogs->getGogsListByAccount('test1'))) && p() && e('0'); //使用未绑定gogs服务器的用户查询 From c050d868931f772d2db0c43b89cadb6172edd0ab Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Fri, 2 Sep 2022 13:18:45 +0800 Subject: [PATCH 36/57] * Modify gitea test case. --- test/model/gitea/checktokenaccess.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/model/gitea/checktokenaccess.php b/test/model/gitea/checktokenaccess.php index bbdabbf680..eca669c656 100644 --- a/test/model/gitea/checktokenaccess.php +++ b/test/model/gitea/checktokenaccess.php @@ -31,8 +31,7 @@ r($result) && p() && e('return null'); //使用正确的host,错误的token验 $token = 'c6769e6761a7d719129b2421dcb3112d936e2b1f'; $result = $gitea->checkTokenAccess($host, $token); -if(isset($result->id)) $result = 'success'; -r($result) && p() && e('success'); //通过host,token验证token权限 +r($result) && p() && e('1'); //通过host,token验证token权限 $token = 'wVFHE6NZA-cJy-3U2y2J'; $result = $gitea->checkTokenAccess($host, $token); From 86e536203ba5f0dfbd29a9e596b78a91780ba363 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Fri, 2 Sep 2022 13:35:16 +0800 Subject: [PATCH 37/57] * Modify server url. --- test/model/gitlab/apigetcurrentuser.php | 6 +++--- test/model/gitlab/checktokenaccess.php | 4 ++-- test/model/gitlab/create.php | 8 ++++---- test/model/gitlab/update.php | 4 ++-- test/model/jenkins/create.php | 12 ++++-------- test/model/jenkins/update.php | 6 +++--- 6 files changed, 18 insertions(+), 22 deletions(-) diff --git a/test/model/gitlab/apigetcurrentuser.php b/test/model/gitlab/apigetcurrentuser.php index acf6f247ad..e4c465f3a3 100755 --- a/test/model/gitlab/apigetcurrentuser.php +++ b/test/model/gitlab/apigetcurrentuser.php @@ -30,14 +30,14 @@ $result = $gitlab->apiGetCurrentUser($host, $token); if(!$result) $result = 'return null'; r($result) && p() && e('return null'); //使用错误的host获取用户信息 -$host = 'http://10.0.1.161:51080'; +$host = 'http://10.0.7.242:9980'; $result = $gitlab->apiGetCurrentUser($host, $token); r($gitlab->apiGetCurrentUser($host, $token)) && p('message') && e('401 Unauthorized'); //使用正确的host,错误的token获取用户信息 -$token = 'x88fZokrp5hShia2jyBN'; +$token = 'y2UBqwPPzaLxsniy8R6A'; $result = $gitlab->apiGetCurrentUser($host, $token); r($result) && p('id') && e('1'); //通过host,token获取用户信息 $token = 'wVFHE6NZA-cJy-3U2y2J'; $result = $gitlab->apiGetCurrentUser($host, $token); -r($result) && p('error') && e('insufficient_scope'); //通过host,权限不足的token获取用户信息 \ No newline at end of file +r($result) && p('error') && e('insufficient_scope'); //通过host,权限不足的token获取用户信息 diff --git a/test/model/gitlab/checktokenaccess.php b/test/model/gitlab/checktokenaccess.php index 2382aa49c4..641d8db5a2 100755 --- a/test/model/gitlab/checktokenaccess.php +++ b/test/model/gitlab/checktokenaccess.php @@ -30,7 +30,7 @@ $result = $gitlab->checkTokenAccess($host, $token); if(!$result) $result = 'return false'; r($result) && p() && e('return false'); //使用错误的host验证token权限 -$host = 'http://10.0.1.161:51080'; +$host = 'http://10.0.7.242:9980'; $result = $gitlab->checkTokenAccess($host, $token); if(empty($result)) $result = 'return null'; r($result) && p() && e('return null'); //使用正确的host,错误的token验证token权限 @@ -43,4 +43,4 @@ r($result) && p() && e('success'); //通过host,token验证token权限 $token = 'wVFHE6NZA-cJy-3U2y2J'; $result = $gitlab->checkTokenAccess($host, $token); if(!isset($result->id)) $result = 'no access'; -r($result) && p() && e('no access'); //通过host,权限不足的token验证token权限 \ No newline at end of file +r($result) && p() && e('no access'); //通过host,权限不足的token验证token权限 diff --git a/test/model/gitlab/create.php b/test/model/gitlab/create.php index 98b43ccdfb..f698367593 100644 --- a/test/model/gitlab/create.php +++ b/test/model/gitlab/create.php @@ -12,7 +12,7 @@ pid=1 GitLab名称为空 >> name 服务器地址为空 >> url -正确GitLab数据 >> GitLab,http://10.0.1.161:58080,1196c85ba525a268570df9da627e3a7b2d +正确GitLab数据 >> GitLab,http://10.0.7.242:9980,1196c85ba525a268570df9da627e3a7b2d */ @@ -20,7 +20,7 @@ $gitlab = new gitlabTest(); $_POST = array(); $_POST['name'] = ''; -$_POST['url'] = 'http://10.0.1.161:51080'; +$_POST['url'] = 'http://10.0.7.242:9980'; $_POST['token'] = 'y2UBqwPPzaLxsniy8R6A'; $_POST['password'] = ''; @@ -30,7 +30,7 @@ $_POST['name'] = 'GitLab'; $_POST['url'] = ''; r($gitlab->create()) && p() && e('url'); // 服务器地址为空 -$_POST['url'] = 'http://10.0.1.161:51080'; -r($gitlab->create()) && p('name,url,token') && e('GitLab,http://10.0.1.161:51080,y2UBqwPPzaLxsniy8R6A'); // 正确GitLab数据 +$_POST['url'] = 'http://10.0.7.242:9980'; +r($gitlab->create()) && p('name,url,token') && e('GitLab,http://10.0.7.242:9980,y2UBqwPPzaLxsniy8R6A'); // 正确GitLab数据 system("./ztest init"); diff --git a/test/model/gitlab/update.php b/test/model/gitlab/update.php index 4006e3466d..7d3517c934 100644 --- a/test/model/gitlab/update.php +++ b/test/model/gitlab/update.php @@ -22,7 +22,7 @@ $gitlabID = 3; $_POST = array(); $_POST['name'] = ''; -$_POST['url'] = 'http://10.0.1.161:51080'; +$_POST['url'] = 'http://10.0.7.242:9980'; $_POST['account'] = 'admin'; $_POST['token'] = 'y2UBqwPPzaLxsniy8R6A'; $_POST['password'] = ''; @@ -33,7 +33,7 @@ $_POST['name'] = 'Changed GitLab'; $_POST['url'] = ''; r($gitlab->update($gitlabID)) && p() && e('url'); // 服务器地址为空 -$_POST['url'] = 'http://10.0.1.161:51080'; +$_POST['url'] = 'http://10.0.7.242:9980'; r($gitlab->update($gitlabID)) && p('name') && e('Changed GitLab'); // 正确GitLab数据 system("./ztest init"); diff --git a/test/model/jenkins/create.php b/test/model/jenkins/create.php index cebc2d7076..853895bfe7 100755 --- a/test/model/jenkins/create.php +++ b/test/model/jenkins/create.php @@ -11,17 +11,13 @@ title=测试jenkinsModel->create(); cid=1 pid=1 -Jenkins名称为空 >> name -服务器地址为空 >> url -正确Jenkins数据 >> Jenkins,http://10.0.1.161:58080,1196c85ba525a268570df9da627e3a7b2d - */ $jenkins = new jenkinsTest(); $_POST = array(); $_POST['name'] = ''; -$_POST['url'] = 'http://10.0.1.161:58080'; +$_POST['url'] = 'http://10.0.7.242:9580'; $_POST['account'] = 'admin'; $_POST['token'] = '1196c85ba525a268570df9da627e3a7b2d'; $_POST['password'] = ''; @@ -32,7 +28,7 @@ $_POST['name'] = 'Jenkins'; $_POST['url'] = ''; r($jenkins->create()) && p() && e('url'); // 服务器地址为空 -$_POST['url'] = 'http://10.0.1.161:58080'; -r($jenkins->create()) && p('name,url,token') && e('Jenkins,http://10.0.1.161:58080,1196c85ba525a268570df9da627e3a7b2d'); // 正确Jenkins数据 +$_POST['url'] = 'http://10.0.7.242:9580'; +r($jenkins->create()) && p('name,url,token') && e('Jenkins,http://10.0.7.242:9580,1196c85ba525a268570df9da627e3a7b2d'); // 正确Jenkins数据 -$db->restoreDB(); \ No newline at end of file +$db->restoreDB(); diff --git a/test/model/jenkins/update.php b/test/model/jenkins/update.php index f8d0445b29..a51185f738 100755 --- a/test/model/jenkins/update.php +++ b/test/model/jenkins/update.php @@ -23,7 +23,7 @@ $jenkinsID = 3; $_POST = array(); $_POST['name'] = ''; -$_POST['url'] = 'http://10.0.1.161:58080'; +$_POST['url'] = 'http://10.0.7.242:9580'; $_POST['account'] = 'admin'; $_POST['token'] = '1196c85ba525a268570df9da627e3a7b2d'; $_POST['password'] = ''; @@ -34,7 +34,7 @@ $_POST['name'] = 'Changed Jenkins'; $_POST['url'] = ''; r($jenkins->update($jenkinsID)) && p() && e('url'); // 服务器地址为空 -$_POST['url'] = 'http://10.0.1.161:58080'; +$_POST['url'] = 'http://10.0.7.242:9580'; r($jenkins->update($jenkinsID)) && p('name') && e('Changed Jenkins'); // 正确Jenkins数据 -$db->restoreDB(); \ No newline at end of file +$db->restoreDB(); From 3509477e6bf77944928847730c0ba75042f320d0 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 2 Sep 2022 13:44:45 +0800 Subject: [PATCH 38/57] * Fix bug #27238, and fix bug for set switcher. --- module/kanban/control.php | 3 +++ module/kanban/js/view.js | 6 ++++-- module/kanban/view/ajaxgetkanbanmenu.html.php | 16 ++++++++-------- module/kanban/view/view.html.php | 4 ++-- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/module/kanban/control.php b/module/kanban/control.php index 1cdb2f9d00..ceefd81560 100644 --- a/module/kanban/control.php +++ b/module/kanban/control.php @@ -23,6 +23,8 @@ class kanban extends control */ public function space($browseType = 'involved', $recTotal = 0, $recPerPage = 15, $pageID = 1) { + $this->session->set('regionID', 'all', 'kanban'); + /* Load pager. */ $this->app->loadClass('pager', $static = true); $pager = new pager($recTotal, $recPerPage, $pageID); @@ -421,6 +423,7 @@ class kanban extends control } $regions = $this->kanban->getKanbanData($kanbanID); + if(!isset($regions[$regionID])) $this->session->set('regionID', 'all', 'kanban'); $this->view->users = $users; $this->view->title = $this->lang->kanban->view; diff --git a/module/kanban/js/view.js b/module/kanban/js/view.js index 9d9012e572..3cfe027725 100644 --- a/module/kanban/js/view.js +++ b/module/kanban/js/view.js @@ -13,8 +13,10 @@ function loadMore(type, regionID) var link = createLink('kanban', method, 'regionID=' + regionID); $(selector).load(link, function() { - var windowHeight = $(window).height(); - $(selector + ' .panel-body').css('height', windowHeight - 100); + var windowHeight = $(window).height(); + var affixedHeight = $('#regionTabs.affixed').height() + $('#kanbanContainer .kanban-affixed .kanban-cols').height(); + $(selector + ' .panel-body').css('height', windowHeight - affixedHeight); + $(selector).css('top', $('#regionTabs.affixed').height() + $('#kanbanContainer .kanban-affixed .kanban-cols').height()); $(selector).animate({right: 0}, 500); }); } diff --git a/module/kanban/view/ajaxgetkanbanmenu.html.php b/module/kanban/view/ajaxgetkanbanmenu.html.php index 7e79f5fefa..2c3c1faed4 100644 --- a/module/kanban/view/ajaxgetkanbanmenu.html.php +++ b/module/kanban/view/ajaxgetkanbanmenu.html.php @@ -136,10 +136,10 @@ $closedKanbansHtml .= '';