From 2e8f0393ce4f81bbe82a83a1af70aee4a79bd148 Mon Sep 17 00:00:00 2001 From: zhujinyong Date: Fri, 16 Jul 2021 11:10:43 +0800 Subject: [PATCH 01/20] + Fix project entry points of API. --- api/v1/entries/project.php | 33 +++++++++++++++++++++++---------- module/project/control.php | 9 ++++++++- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/api/v1/entries/project.php b/api/v1/entries/project.php index 18c7a1772b..05334b9455 100644 --- a/api/v1/entries/project.php +++ b/api/v1/entries/project.php @@ -20,27 +20,40 @@ class projectEntry extends entry $this->sendError(400, 'error'); } - public function put($productID) + public function put($projectID) { - $oldProduct = $this->loadModel('product')->getByID($productID); + $oldProject = $this->loadModel('project')->getByID($projectID); + $linkedProducts = $this->project->getProducts($projectID); /* Set $_POST variables. */ - $fields = 'program,line,name,PO,QD,RD,type,desc,whitelist,status,acl'; - $this->batchSetPost($fields, $oldProduct); + $fields = 'name,begin,end,acl,parent,desc,PM,whitelist'; + $this->batchSetPost($fields, $oldProject); - $control = $this->loadController('product', 'edit'); - $control->edit($productID); + $products = array(); + $plans = array(); + foreach($linkedProducts as $product) + { + $products[] = $product->id; + $plans[] = $product->plan; + } + $this->setPost('products', $products); + $this->setPost('plans', $plans); + + $control = $this->loadController('project', 'edit'); + $control->edit($projectID); $data = $this->getData(); if(isset($data->result) and $data->result == 'fail') return $this->sendError(400, $data->message); + if(!isset($data->result)) return $this->sendError(400, 'error'); - $this->sendSuccess(200, 'success'); + $project = $this->project->getByID($projectID); + $this->send(200, $project); } - public function delete($productID) + public function delete($projectID) { - $control = $this->loadController('product', 'delete'); - $control->delete($productID, 'yes'); + $control = $this->loadController('project', 'delete'); + $control->delete($projectID, 'yes'); $this->getData(); $this->sendSuccess(200, 'success'); diff --git a/module/project/control.php b/module/project/control.php index 591d245f6f..9aa49fa019 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -1416,12 +1416,19 @@ class project extends control /* Delete the execution under the project. */ $executionIdList = $this->loadModel('execution')->getByProject($projectID); - if(empty($executionIdList)) die(js::reload('parent')); + + if(empty($executionIdList)) + { + if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess)); + die(js::reload('parent')); + } $this->dao->update(TABLE_EXECUTION)->set('deleted')->eq(1)->where('id')->in(array_keys($executionIdList))->exec(); foreach($executionIdList as $executionID => $execution) $this->action->create('execution', $executionID, 'deleted', '', ACTIONMODEL::CAN_UNDELETED); $this->user->updateUserView($executionIdList, 'sprint'); + if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess)); + $this->session->set('project', ''); die(js::reload('parent')); } From 22abf816b9e21289550825acf64164e908105fa8 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 16 Jul 2021 11:19:08 +0800 Subject: [PATCH 02/20] * finish task #40290. --- lib/front/front.class.php | 3 +-- module/testcase/model.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/front/front.class.php b/lib/front/front.class.php index 72bf974dc5..102c8cb7bf 100644 --- a/lib/front/front.class.php +++ b/lib/front/front.class.php @@ -177,8 +177,7 @@ class html extends baseHTML } } - $string = ''; - $string .= "\n"; /* The options. */ if(is_array($selectedItems)) $selectedItems = implode(',', $selectedItems); diff --git a/module/testcase/model.php b/module/testcase/model.php index c1cdcb0543..6ef5bbb34f 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -446,7 +446,7 @@ class testcaseModel extends model ->beginIF($auto != 'unit')->andWhere('t1.auto')->ne('unit')->fi() ->beginIF($auto == 'unit')->andWhere('t1.auto')->eq('unit')->fi() ->orderBy($sort) - ->page($pager) + ->page($pager, 't1.id') ->fetchAll(); } elseif($browseType == 'bysuite') From 2017a9cc7813f12f0ba06299a6d899db3e6952fa Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 16 Jul 2021 11:20:23 +0800 Subject: [PATCH 03/20] * finish task #40291. --- lib/scm/gitlab.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/scm/gitlab.class.php b/lib/scm/gitlab.class.php index 341cfa2442..6d3350bd66 100644 --- a/lib/scm/gitlab.class.php +++ b/lib/scm/gitlab.class.php @@ -517,7 +517,7 @@ class gitlab if(!scm::checkRevision($version)) return array(); $api = "commits"; - if(empty($count)) $count = 1; + if(empty($count)) $count = 100; $params = array(); $params['ref_name'] = $branch; $params['per_page'] = $count; @@ -624,6 +624,7 @@ class gitlab if(count($results) < 100) break; } + $files = array(); foreach($allResults as $row) { $file = new stdclass(); From 425280996aa865c3c97d4f143296ab39ce53f942 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 16 Jul 2021 11:21:10 +0800 Subject: [PATCH 04/20] * finish task #40289. --- framework/router.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/router.class.php b/framework/router.class.php index bd58a3c360..e1df5c32c8 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -206,7 +206,7 @@ class router extends baseRouter if($hourKey == STORYPOINT_KEY) $config->hourUnit = 'sp'; if($hourKey == FUNCTIONPOINT_KEY) $config->hourUnit = 'fp'; - $iterationKey = $projectKey; + $iterationKey = $projectKey; /* Set productCommon, projectCommon and hourCommon. Default english lang. */ $lang->productCommon = $this->config->productCommonList[$this->clientLang][PRODUCT_KEY]; From f2620f53ecc9e71b14501e2f5906edb18caabb5c Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 16 Jul 2021 11:45:43 +0800 Subject: [PATCH 05/20] * finish task #40292. --- module/backup/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/backup/control.php b/module/backup/control.php index 39ae5d310a..184519d4ed 100644 --- a/module/backup/control.php +++ b/module/backup/control.php @@ -336,7 +336,7 @@ class backup extends control if($statusFile) { $this->app->loadLang('extension'); - $this->view->error = sprintf($this->lang->extension->noticeOkFile, preg_replace('/^' . str_replace('/', '\\/', dirname($this->app->getBasePath()) . DS) . '/', '', $statusFile)); + $this->view->error = sprintf($this->lang->extension->noticeOkFile, str_replace(dirname($this->app->getBasePath()) . DS, '', $statusFile)); die($this->display()); } From 268c4e47b7e80d04ef905264b93f3b57e5eb38e1 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 16 Jul 2021 13:02:42 +0800 Subject: [PATCH 06/20] * finish task #40293. --- module/block/lang/en.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/block/lang/en.php b/module/block/lang/en.php index eca3778de5..d3dc6dd148 100644 --- a/module/block/lang/en.php +++ b/module/block/lang/en.php @@ -375,7 +375,7 @@ $lang->block->modules['project']->availableBlocks = new stdclass(); $lang->block->modules['project']->availableBlocks->project = 'Project List'; $lang->block->modules['project']->availableBlocks->recentproject = 'Recent Project'; $lang->block->modules['project']->availableBlocks->statistic = 'Project Statistic'; -if($config->systemMode == 'new') $lang->block->modules['project']->availableBlocks->projectteam = 'Project Human Input'; +if($config->systemMode == 'new') $lang->block->modules['project']->availableBlocks->projectteam = 'Project Human Input'; $lang->block->modules['scrum']['index'] = new stdclass(); $lang->block->modules['scrum']['index']->availableBlocks = new stdclass(); From 92ea15541fba9a1a66bdbbcd2da4e02f92f61d80 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 16 Jul 2021 13:03:55 +0800 Subject: [PATCH 07/20] * finish task #40299. --- module/caselib/model.php | 1 - 1 file changed, 1 deletion(-) diff --git a/module/caselib/model.php b/module/caselib/model.php index f83d8a51c2..b0ebca73a3 100644 --- a/module/caselib/model.php +++ b/module/caselib/model.php @@ -218,7 +218,6 @@ class caselibModel extends model { $cases = $this->dao->select('*')->from(TABLE_CASE) ->where('lib')->eq((int)$libID) - ->beginIF($this->config->systemMode == 'new' and $this->lang->navGroup->caselib == 'project')->andWhere('project')->eq($this->session->project)->fi() ->andWhere('product')->eq(0) ->beginIF($moduleIdList)->andWhere('module')->in($moduleIdList)->fi() ->beginIF($browseType == 'wait')->andWhere('status')->eq($browseType)->fi() From 382f8295643815ddafd2f057fc4766214733c60e Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Fri, 16 Jul 2021 13:20:01 +0800 Subject: [PATCH 08/20] * Fix issue #169. --- .../execution/view/ajaxgetdropmenu.html.php | 17 ++++++++------- module/product/view/ajaxgetdropmenu.html.php | 21 ++++++++++--------- module/project/view/ajaxgetdropmenu.html.php | 19 +++++++++-------- 3 files changed, 30 insertions(+), 27 deletions(-) diff --git a/module/execution/view/ajaxgetdropmenu.html.php b/module/execution/view/ajaxgetdropmenu.html.php index 2be1f053ac..4bdd443b9b 100644 --- a/module/execution/view/ajaxgetdropmenu.html.php +++ b/module/execution/view/ajaxgetdropmenu.html.php @@ -3,9 +3,10 @@ $programProducts)
@@ -146,10 +147,10 @@ $(function() $('.nav-tabs li span').hide(); $('.nav-tabs li.active').find('span').show(); - $('.nav-tabs>li').click(function() + $('.nav-tabs>li a').click(function() { - $(this).find('span').show(); - $(this).siblings('li').find('span').hide(); + $(this).siblings().show(); + $(this).parent().siblings('li').find('span').hide(); if($(this).attr('class') != 'active') $('#dropMenu').removeClass('show-right-col'); $("#dropMenu .search-box").width('auto'); }) diff --git a/module/project/view/ajaxgetdropmenu.html.php b/module/project/view/ajaxgetdropmenu.html.php index 8650937e86..a240e49ab3 100644 --- a/module/project/view/ajaxgetdropmenu.html.php +++ b/module/project/view/ajaxgetdropmenu.html.php @@ -3,10 +3,11 @@