diff --git a/module/project/control.php b/module/project/control.php
index d0a1b45c26..1a78c40116 100644
--- a/module/project/control.php
+++ b/module/project/control.php
@@ -542,7 +542,7 @@ class project extends control
$unmodifiableBranches = array();
foreach($linkedProducts as $productID => $linkedProduct)
{
- if(!isset($allProducts[$productID])) $allProducts[$productID] = $product->name;
+ if(!isset($allProducts[$productID])) $allProducts[$productID] = $linkedProduct->name;
foreach($branches[$productID] as $branchID => $branch)
{
$linkedBranches[$productID][$branchID] = $branchID;
@@ -1716,8 +1716,8 @@ class project extends control
$unmodifiableBranches = array();
foreach($linkedProducts as $productID => $linkedProduct)
{
- if(!isset($allProducts[$productID])) $allProducts[$productID] = $product->name;
$linkedBranches[$productID] = array();
+ if(!isset($allProducts[$productID])) $allProducts[$productID] = $linkedProduct->name;
foreach($branches[$productID] as $branchID => $branch)
{
$linkedBranches[$productID][$branchID] = $branchID;
From 76651524d998302111dfe018757ab482a251c15c Mon Sep 17 00:00:00 2001
From: xieqiyu
Date: Tue, 9 Nov 2021 20:10:07 +0800
Subject: [PATCH 10/28] * Add order.
---
module/branch/model.php | 2 +-
module/branch/view/manage.html.php | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/module/branch/model.php b/module/branch/model.php
index 2732a824df..e01dc801ab 100644
--- a/module/branch/model.php
+++ b/module/branch/model.php
@@ -45,7 +45,7 @@ class branchModel extends model
* @access public
* @return array
*/
- public function getList($productID, $browseType = 'active', $orderBy = 'order_desc', $pager = null)
+ public function getList($productID, $browseType = 'active', $orderBy = 'order', $pager = null)
{
$branchList = $this->dao->select('*')->from(TABLE_BRANCH)
->where('deleted')->eq(0)
diff --git a/module/branch/view/manage.html.php b/module/branch/view/manage.html.php
index 3e1f18bbfc..42cebf1e12 100644
--- a/module/branch/view/manage.html.php
+++ b/module/branch/view/manage.html.php
@@ -14,6 +14,7 @@
+
@@ -50,7 +51,9 @@
+
branch->order;?> |
+
branch->name);?> |
branch->status);?> |
branch->createdDate);?> |
@@ -68,9 +71,11 @@
id => ''));?>
+
'>
';?>
|
+
name;?>
Date: Wed, 10 Nov 2021 09:05:58 +0800
Subject: [PATCH 11/28] * Finish task#43909.
---
module/report/model.php | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/module/report/model.php b/module/report/model.php
index b18647b2a2..74c6913565 100644
--- a/module/report/model.php
+++ b/module/report/model.php
@@ -379,14 +379,14 @@ class reportModel extends model
foreach($userTasks as $task)
{
if(isset($parents[$task->id])) continue;
- $workload[$user]['task']['project'][$task->projectname]['projectID'] = isset($workload[$user]['task']['project'][$task->projectname]['projectID']) ? $workload[$user]['task']['project'][$task->projectname]['projectID'] : $task->project;
- $workload[$user]['task']['project'][$task->projectname]['project'] = isset($workload[$user]['task'][$task->projectname]['project']) ? $workload[$user]['task'][$task->projectname]['project'] : $task->projectname;
- $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['count'] = isset($workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['count']) ? $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['count'] + 1 : 1;
+ $workload[$user]['task']['project'][$task->projectname]['projectID'] = isset($workload[$user]['task']['project'][$task->projectname]['projectID']) ? $workload[$user]['task']['project'][$task->projectname]['projectID'] : $task->project;
+ $workload[$user]['task']['project'][$task->projectname]['project'] = isset($workload[$user]['task']['project'][$task->projectname]['project']) ? $workload[$user]['task']['project'][$task->projectname]['project'] : $task->projectname;
+ $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['count'] = isset($workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['count']) ? $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['count'] + 1 : 1;
$workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['manhour'] = isset($workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['manhour']) ? $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['manhour'] + $task->left : $task->left;
$workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['executionID'] = $task->execution;
$workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['name'] = $task->executionName;
- $workload[$user]['total']['count'] = isset($workload[$user]['total']['count']) ? $workload[$user]['total']['count'] + 1 : 1;
- $workload[$user]['total']['manhour'] = isset($workload[$user]['total']['manhour']) ? $workload[$user]['total']['manhour'] + $task->left : $task->left;
+ $workload[$user]['total']['count'] = isset($workload[$user]['total']['count']) ? $workload[$user]['total']['count'] + 1 : 1;
+ $workload[$user]['total']['manhour'] = isset($workload[$user]['total']['manhour']) ? $workload[$user]['total']['manhour'] + $task->left : $task->left;
}
}
}
From 35504f6745c8c8e6377952e7ac2e858bc72daa4c Mon Sep 17 00:00:00 2001
From: tianshujie
Date: Wed, 10 Nov 2021 09:17:28 +0800
Subject: [PATCH 12/28] * Combine the acquisition branch into a function.
---
module/branch/control.php | 2 ++
module/execution/control.php | 52 ++++++++++--------------------------
module/execution/model.php | 22 +++++++++++++++
3 files changed, 38 insertions(+), 38 deletions(-)
diff --git a/module/branch/control.php b/module/branch/control.php
index 8ee38ee492..a7e98d6937 100644
--- a/module/branch/control.php
+++ b/module/branch/control.php
@@ -217,6 +217,8 @@ class branch extends control
if(empty($product) or $product->type == 'normal') die();
$branches = $this->branch->getPairs($productID, $param);
+
+ /* Remove unlinked branches of the project. */
if($projectID)
{
$projectProducts = $this->loadModel('project')->getBranchesByProject($projectID);
diff --git a/module/execution/control.php b/module/execution/control.php
index 487489c04b..145a068a2a 100644
--- a/module/execution/control.php
+++ b/module/execution/control.php
@@ -1275,25 +1275,17 @@ class execution extends control
$productPlans = array();
if($copyExecutionID)
{
- $copyExecution = $this->dao->select('*')->from(TABLE_EXECUTION)->where('id')->eq($copyExecutionID)->fetch();
- $name = $copyExecution->name;
- $code = $copyExecution->code;
- $team = $copyExecution->team;
- $acl = $copyExecution->acl;
- $whitelist = $copyExecution->whitelist;
- $projectID = $copyExecution->project;
- $products = $this->execution->getProducts($copyExecutionID);
- $branches = $this->project->getBranchesByProject($copyExecutionID);
- $plans = $this->loadModel('productplan')->getGroupByProduct(array_keys($products));
- $projectProducts = $this->loadModel('project')->getBranchesByProject($projectID);
- $branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), 'noclosed');
- foreach($branchGroups as $productID => $branchPairs)
- {
- foreach($branchPairs as $branchID => $branchName)
- {
- if(!isset($projectProducts[$productID][$branchID])) unset($branchGroups[$productID][$branchID]);
- }
- }
+ $copyExecution = $this->dao->select('*')->from(TABLE_EXECUTION)->where('id')->eq($copyExecutionID)->fetch();
+ $name = $copyExecution->name;
+ $code = $copyExecution->code;
+ $team = $copyExecution->team;
+ $acl = $copyExecution->acl;
+ $whitelist = $copyExecution->whitelist;
+ $projectID = $copyExecution->project;
+ $products = $this->execution->getProducts($copyExecutionID);
+ $branches = $this->project->getBranchesByProject($copyExecutionID);
+ $plans = $this->loadModel('productplan')->getGroupByProduct(array_keys($products));
+ $branchGroups = $this->execution->getBranchByProduct(array_keys($products), $projectID);
$linkedBranches = array();
foreach($products as $productID => $product)
@@ -1401,7 +1393,7 @@ class execution extends control
$this->view->whitelist = $whitelist;
$this->view->copyExecutionID = $copyExecutionID;
$this->view->branchGroups = isset($branchGroups) ? $branchGroups : $this->loadModel('branch')->getByProducts(array_keys($products), 'noclosed');
- $this->view->poUsers = $poUsers;
+ $this->view->poUsers = $poUsers;
$this->view->pmUsers = $pmUsers;
$this->view->qdUsers = $qdUsers;
$this->view->rdUsers = $rdUsers;
@@ -1502,15 +1494,7 @@ class execution extends control
$branches = $this->project->getBranchesByProject($executionID);
$plans = $this->productplan->getGroupByProduct(array_keys($linkedProducts));
$executionStories = $this->project->getStoriesByProject($executionID);
- $projectProducts = $this->loadModel('project')->getBranchesByProject($execution->project);
- $branchGroups = $this->loadModel('branch')->getByProducts(array_keys($linkedProducts), 'noclosed');
- foreach($branchGroups as $productID => $branchPairs)
- {
- foreach($branchPairs as $branchID => $branchName)
- {
- if(!isset($projectProducts[$productID][$branchID])) unset($branchGroups[$productID][$branchID]);
- }
- }
+ $branchGroups = $this->execution->getByProducts(array_keys($linkedProducts), $execution->project);
/* If the story of the product which linked the execution, you don't allow to remove the product. */
$unmodifiableProducts = array();
@@ -2292,15 +2276,7 @@ class execution extends control
$linkedBranches = array();
$branches = $this->project->getBranchesByProject($executionID);
$executionStories = $this->project->getStoriesByProject($executionID);
- $projectProducts = $this->loadModel('project')->getBranchesByProject($execution->project);
- $branchGroups = $this->loadModel('branch')->getByProducts(array_keys($linkedProducts), 'noclosed');
- foreach($branchGroups as $productID => $branchPairs)
- {
- foreach($branchPairs as $branchID => $branchName)
- {
- if(!isset($projectProducts[$productID][$branchID])) unset($branchGroups[$productID][$branchID]);
- }
- }
+ $branchGroups = $this->execution->getBranchByProduct(array_keys($linkedProducts), $execution->project);
/* If the story of the product which linked the execution, you don't allow to remove the product. */
$unmodifiableProducts = array();
diff --git a/module/execution/model.php b/module/execution/model.php
index 1e7529bed9..54c37ce3e8 100644
--- a/module/execution/model.php
+++ b/module/execution/model.php
@@ -1655,6 +1655,28 @@ class executionModel extends model
return $query->fetchAll('id');
}
+ /**
+ * Get branch pairs by product id list.
+ *
+ * @param array $products
+ * @param int $projectID
+ * @access public
+ * @return array
+ */
+ public function getBranchByProduct($products, $projectID)
+ {
+ $branchGroups = $this->loadModel('branch')->getByProducts($products, 'noclosed');
+ $projectProducts = $this->loadModel('project')->getBranchesByProject($projectID);
+ foreach($branchGroups as $productID => $branchPairs)
+ {
+ foreach($branchPairs as $branchID => $branchName)
+ {
+ if(!isset($projectProducts[$productID][$branchID])) unset($branchGroups[$productID][$branchID]);
+ }
+ }
+ return $branchGroups;
+ }
+
/**
* Get ordered executions.
*
From 81745401830fd3956aa7b903ad44836a16c1261c Mon Sep 17 00:00:00 2001
From: tianshujie
Date: Wed, 10 Nov 2021 09:22:08 +0800
Subject: [PATCH 13/28] * Remove useless code.
---
module/execution/control.php | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/module/execution/control.php b/module/execution/control.php
index 145a068a2a..bb6f6c028f 100644
--- a/module/execution/control.php
+++ b/module/execution/control.php
@@ -1494,7 +1494,6 @@ class execution extends control
$branches = $this->project->getBranchesByProject($executionID);
$plans = $this->productplan->getGroupByProduct(array_keys($linkedProducts));
$executionStories = $this->project->getStoriesByProject($executionID);
- $branchGroups = $this->execution->getByProducts(array_keys($linkedProducts), $execution->project);
/* If the story of the product which linked the execution, you don't allow to remove the product. */
$unmodifiableProducts = array();
@@ -1546,7 +1545,7 @@ class execution extends control
$this->view->unmodifiableBranches = $unmodifiableBranches;
$this->view->multiBranchProducts = $this->loadModel('product')->getMultiBranchPairs();
$this->view->productPlans = $productPlans;
- $this->view->branchGroups = $branchGroups;
+ $this->view->branchGroups = $this->execution->getByProducts(array_keys($linkedProducts), $execution->project);
$this->display();
}
@@ -2276,7 +2275,6 @@ class execution extends control
$linkedBranches = array();
$branches = $this->project->getBranchesByProject($executionID);
$executionStories = $this->project->getStoriesByProject($executionID);
- $branchGroups = $this->execution->getBranchByProduct(array_keys($linkedProducts), $execution->project);
/* If the story of the product which linked the execution, you don't allow to remove the product. */
$unmodifiableProducts = array();
@@ -2300,12 +2298,12 @@ class execution extends control
$this->view->title = $title;
$this->view->position = $position;
$this->view->allProducts = $allProducts;
- $this->view->execution = $execution;
+ $this->view->execution = $execution;
$this->view->linkedProducts = $linkedProducts;
$this->view->unmodifiableProducts = $unmodifiableProducts;
$this->view->unmodifiableBranches = $unmodifiableBranches;
$this->view->linkedBranches = $linkedBranches;
- $this->view->branchGroups = $branchGroups;
+ $this->view->branchGroups = $this->execution->getBranchByProduct(array_keys($linkedProducts), $execution->project);
$this->display();
}
From 4f90b186eaf37bebf1c4a71eb04484bf0148bfcf Mon Sep 17 00:00:00 2001
From: xieqiyu
Date: Wed, 10 Nov 2021 09:37:59 +0800
Subject: [PATCH 14/28] * Fix a bug: batch edit main branch error.
---
module/branch/control.php | 7 ++--
module/branch/model.php | 47 +++++++++++++++++++--------
module/branch/view/batchedit.html.php | 2 +-
3 files changed, 38 insertions(+), 18 deletions(-)
diff --git a/module/branch/control.php b/module/branch/control.php
index 1fd2c8b4ff..830af4df7d 100644
--- a/module/branch/control.php
+++ b/module/branch/control.php
@@ -102,12 +102,13 @@ class branch extends control
$this->loadModel('action');
$this->loadModel('product')->setMenu($productID);
- if($this->post->name)
+ if($this->post->IDList)
{
- $changes = $this->branch->batchUpdate();
+ $changes = $this->branch->batchUpdate($productID);
foreach($changes as $branchID => $change)
{
- if($change) $this->action->create('branch', $branchID, 'Edited');
+ $extra = $branchID == BRANCH_MAIN ? $productID : '';
+ if($change) $this->action->create('branch', $branchID, 'Edited', '', $extra);
}
die(js::locate($this->session->branchManage, 'parent'));
diff --git a/module/branch/model.php b/module/branch/model.php
index e01dc801ab..c832db544d 100644
--- a/module/branch/model.php
+++ b/module/branch/model.php
@@ -190,28 +190,47 @@ class branchModel extends model
* @access public
* @return array
*/
- public function batchUpdate()
+ public function batchUpdate($productID)
{
$data = fixer::input('post')->get();
- $branchIDList = array_keys($this->post->branchIDList);
- $oldBranchList = $this->dao->select('*')->from(TABLE_BRANCH)->where('id')->in($branchIDList)->fetchAll('id');
+ $oldBranchList = $this->getList($productID, 'all');
+ $branchIDList = array_keys($this->post->IDList);
foreach($branchIDList as $branchID)
{
- $branch = new stdclass();
- $branch->name = $data->name[$branchID];
- $branch->desc = $data->desc[$branchID];
- $branch->status = $data->status[$branchID];
- $branch->default = $branchID == $data->default ? 1 : 0;
+ if($branchID == BRANCH_MAIN)
+ {
+ if($data->default != BRANCH_MAIN) continue;
- $this->dao->update(TABLE_BRANCH)->data($branch)
- ->batchCheck($this->config->branch->create->requiredFields, 'notempty')
- ->where('id')->eq($branchID)
- ->exec();
+ $this->dao->update(TABLE_BRANCH)
+ ->set('default')->eq(0)
+ ->where('product')->eq($productID)
+ ->exec();
- if(dao::isError()) die(js::error('branch#' . $branchID . dao::getError(true)));
+ if(dao::isError()) die(js::error('branch#' . $branchID . dao::getError(true)));
- $changes[$branchID] = common::createChanges($oldBranchList[$branchID], $branch);
+ $newMainBranch = new stdClass();
+ $newMainBranch->default = 1;
+
+ $changes[$branchID] = common::createChanges($oldBranchList[BRANCH_MAIN], $newMainBranch);
+ }
+ else
+ {
+ $branch = new stdclass();
+ $branch->name = $data->name[$branchID];
+ $branch->desc = $data->desc[$branchID];
+ $branch->status = $data->status[$branchID];
+ $branch->default = $branchID == $data->default ? 1 : 0;
+
+ $this->dao->update(TABLE_BRANCH)->data($branch)
+ ->batchCheck($this->config->branch->create->requiredFields, 'notempty')
+ ->where('id')->eq($branchID)
+ ->exec();
+
+ if(dao::isError()) die(js::error('branch#' . $branchID . dao::getError(true)));
+
+ $changes[$branchID] = common::createChanges($oldBranchList[$branchID], $branch);
+ }
}
return $changes;
diff --git a/module/branch/view/batchedit.html.php b/module/branch/view/batchedit.html.php
index a1560bd5cf..8302c0a3d4 100644
--- a/module/branch/view/batchedit.html.php
+++ b/module/branch/view/batchedit.html.php
@@ -30,7 +30,7 @@
id == BRANCH_MAIN ? 'disabled' : '';?>
- | id == BRANCH_MAIN ? '' : $branch->id . html::hidden("branchIDList[$branch->id]", $branch);?> |
+ id == BRANCH_MAIN ? '' : $branch->id) . html::hidden("IDList[$branch->id]", $branch);?> |
id]", $branch->name, "class='form-control chosen' $disabled");?> |
id]", $branch->desc, "class='form-control' $disabled");?> |
id]", $lang->branch->statusList, $branch->status, "class='form-control' chosen $disabled onchange='canSetDefaultBranch(this)'");?> |
From 9fa76f69120590941c9f1b8845fd200e53da1443 Mon Sep 17 00:00:00 2001
From: hufangzhou
Date: Wed, 10 Nov 2021 09:49:29 +0800
Subject: [PATCH 15/28] * Modify the action of main branch.
---
module/action/model.php | 15 +++++++++++++--
module/branch/control.php | 2 +-
module/branch/css/manage.css | 4 ++++
module/branch/view/manage.html.php | 2 +-
4 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/module/action/model.php b/module/action/model.php
index e867ba5d54..71a25eefc0 100755
--- a/module/action/model.php
+++ b/module/action/model.php
@@ -240,6 +240,12 @@ class actionModel extends model
$record->execution = $testtask->execution;
}
+ if($objectType == 'branch' and $objectID == 0)
+ {
+ $record = new stdclass();
+ $record->product = $extra;
+ }
+
if($objectType == 'whitelist' and $extra == 'product') $record->product = $objectID;
if($objectType == 'whitelist' and $extra == 'project') $record->project = $objectID;
if($objectType == 'whitelist' and ($extra == 'sprint' or $extra == 'stage')) $record->execution = $objectID;
@@ -1059,6 +1065,12 @@ class actionModel extends model
->where('t1.id')->in($objectIdList)
->fetchPairs();
}
+ elseif($objectType == 'branch')
+ {
+ $this->app->loadLang('branch');
+ $objectName = $this->dao->select("id,name")->from(TABLE_BRANCH)->where('id')->in($objectIdList)->fetchPairs();
+ if(in_array(0, $objectIdList)) $objectName[0] = $this->lang->branch->main;
+ }
else
{
$objectName = $this->dao->select("id, $field AS name")->from($table)->where('id')->in($objectIdList)->fetchPairs();
@@ -1179,8 +1191,7 @@ class actionModel extends model
}
elseif($action->objectType == 'branch')
{
- $productID = $this->dao->select('product')->from(TABLE_BRANCH)->where('id')->eq($action->objectID)->fetch('product');
- $params = sprintf($vars, $productID);
+ $params = sprintf($vars, trim($action->product, ','));
}
else
{
diff --git a/module/branch/control.php b/module/branch/control.php
index 1fd2c8b4ff..5b73a6fcda 100644
--- a/module/branch/control.php
+++ b/module/branch/control.php
@@ -275,7 +275,7 @@ class branch extends control
$this->branch->setDefault($productID, $branchID);
- $this->loadModel('action')->create('branch', $branchID, 'SetDefaultBranch');
+ $this->loadModel('action')->create('branch', $branchID, 'SetDefaultBranch', '', $productID);
die(js::reload('parent'));
}
diff --git a/module/branch/css/manage.css b/module/branch/css/manage.css
index 4d9f958f35..35334b5a45 100644
--- a/module/branch/css/manage.css
+++ b/module/branch/css/manage.css
@@ -1,3 +1,7 @@
.c-desc {width: 500px;}
.c-order {width: 70px;}
.c-check {width: 40px}
+
+td.flex {display: flex; flex-flow: row nowrap; justify-content: flex-start; align-items: center;}
+td.flex .label-primary {min-width: 40px;}
+td.flex .setDefault {min-width: 120px;}
diff --git a/module/branch/view/manage.html.php b/module/branch/view/manage.html.php
index 42cebf1e12..28ec424d09 100644
--- a/module/branch/view/manage.html.php
+++ b/module/branch/view/manage.html.php
@@ -81,7 +81,7 @@
default)
{
- echo '' . $lang->branch->default . '';
+ echo ' ' . $lang->branch->default . '';
}
elseif($branch->status == 'active')
{
From adaa7cd1d23e9183b9a82a70e76d47e721275ed1 Mon Sep 17 00:00:00 2001
From: xieqiyu
Date: Wed, 10 Nov 2021 09:49:02 +0800
Subject: [PATCH 16/28] * Add dynamic when batch edit main branch.
---
module/branch/model.php | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/module/branch/model.php b/module/branch/model.php
index c832db544d..6d336a34a0 100644
--- a/module/branch/model.php
+++ b/module/branch/model.php
@@ -200,17 +200,22 @@ class branchModel extends model
{
if($branchID == BRANCH_MAIN)
{
- if($data->default != BRANCH_MAIN) continue;
-
- $this->dao->update(TABLE_BRANCH)
- ->set('default')->eq(0)
- ->where('product')->eq($productID)
- ->exec();
-
- if(dao::isError()) die(js::error('branch#' . $branchID . dao::getError(true)));
-
$newMainBranch = new stdClass();
- $newMainBranch->default = 1;
+ if($data->default == BRANCH_MAIN)
+ {
+ $this->dao->update(TABLE_BRANCH)
+ ->set('default')->eq(0)
+ ->where('product')->eq($productID)
+ ->exec();
+
+ if(dao::isError()) die(js::error('branch#' . $branchID . dao::getError(true)));
+
+ $newMainBranch->default = 1;
+ }
+ else
+ {
+ $newMainBranch->default = 0;
+ }
$changes[$branchID] = common::createChanges($oldBranchList[BRANCH_MAIN], $newMainBranch);
}
From fb7f493036da4a50eee60162aab089d6d74f8aac Mon Sep 17 00:00:00 2001
From: tianshujie
Date: Wed, 10 Nov 2021 09:58:49 +0800
Subject: [PATCH 17/28] * Modify the error code.
---
module/execution/control.php | 6 +++---
module/execution/js/create.js | 2 +-
module/execution/js/edit.js | 2 +-
module/execution/view/create.html.php | 2 +-
module/execution/view/edit.html.php | 2 +-
module/project/js/create.js | 2 +-
module/project/js/edit.js | 2 +-
module/project/view/edit.html.php | 2 +-
8 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/module/execution/control.php b/module/execution/control.php
index bb6f6c028f..beff87bc96 100644
--- a/module/execution/control.php
+++ b/module/execution/control.php
@@ -1387,12 +1387,12 @@ class execution extends control
$this->view->productID = $productID;
$this->view->projectID = $projectID;
$this->view->products = $products;
- $this->view->multiBranchProducts = $this->loadModel('product')->getMultiBranchPairs();
+ $this->view->multiBranchProducts = $this->product->getMultiBranchPairs();
$this->view->productPlan = array(0 => '') + $productPlan;
$this->view->productPlans = array(0 => '') + $productPlans;
$this->view->whitelist = $whitelist;
$this->view->copyExecutionID = $copyExecutionID;
- $this->view->branchGroups = isset($branchGroups) ? $branchGroups : $this->loadModel('branch')->getByProducts(array_keys($products), 'noclosed');
+ $this->view->branchGroups = isset($branchGroups) ? $branchGroups : $this->execution->getBranchByProduct(array_keys($products), $projectID);
$this->view->poUsers = $poUsers;
$this->view->pmUsers = $pmUsers;
$this->view->qdUsers = $qdUsers;
@@ -1545,7 +1545,7 @@ class execution extends control
$this->view->unmodifiableBranches = $unmodifiableBranches;
$this->view->multiBranchProducts = $this->loadModel('product')->getMultiBranchPairs();
$this->view->productPlans = $productPlans;
- $this->view->branchGroups = $this->execution->getByProducts(array_keys($linkedProducts), $execution->project);
+ $this->view->branchGroups = $this->execution->getBranchByProduct(array_keys($linkedProducts), $execution->project);
$this->display();
}
diff --git a/module/execution/js/create.js b/module/execution/js/create.js
index 44246f978e..3ee176db92 100644
--- a/module/execution/js/create.js
+++ b/module/execution/js/create.js
@@ -81,7 +81,7 @@ $(function()
$('#submit').click(function()
{
- var products = [];
+ var products = new Array();
var existedBranch = false;
/* Determine whether the products of the same branch are linked. */
diff --git a/module/execution/js/edit.js b/module/execution/js/edit.js
index 8c4303edc8..81039a601b 100644
--- a/module/execution/js/edit.js
+++ b/module/execution/js/edit.js
@@ -4,7 +4,7 @@ $().ready(function()
{
$('#products0').removeAttr("disabled");
$('#branch0').removeAttr("disabled");
- var products = [];
+ var products = new Array();
var existedBranch = false;
/* Determine whether the products of the same branch are linked. */
diff --git a/module/execution/view/create.html.php b/module/execution/view/create.html.php
index 232c7c1f4a..0790b4f602 100644
--- a/module/execution/view/create.html.php
+++ b/module/execution/view/create.html.php
@@ -135,7 +135,7 @@
id] as $branchID => $branch):?>
- id][$branchID];?>
+ id][$branchID]) ? $productPlans[$product->id][$branchID] : array();?>
id}][$branchID]", $plans, $branches[$product->id][$branchID]->plan, "class='form-control chosen'");?>
diff --git a/module/execution/view/edit.html.php b/module/execution/view/edit.html.php
index fc6263e772..7328dee226 100644
--- a/module/execution/view/edit.html.php
+++ b/module/execution/view/edit.html.php
@@ -151,7 +151,7 @@
id] as $branchID => $branch):?>
- id][$branchID];?>
+ id][$branchID]) ? $productPlans[$product->id][$branchID] : array();?>
id}][{$branchID}]", $plans, $branches[$product->id][$branchID]->plan, "class='form-control chosen'");?>
diff --git a/module/project/js/create.js b/module/project/js/create.js
index a345bde136..a4aedf2d0d 100644
--- a/module/project/js/create.js
+++ b/module/project/js/create.js
@@ -28,7 +28,7 @@ $(function()
$('#submit').click(function()
{
- var products = [];
+ var products = new Array();
var existedBranch = false;
/* Determine whether the products of the same branch are linked. */
diff --git a/module/project/js/edit.js b/module/project/js/edit.js
index b0da7af1da..5b143b401c 100644
--- a/module/project/js/edit.js
+++ b/module/project/js/edit.js
@@ -96,7 +96,7 @@ $(function()
$('#submit').click(function()
{
- var products = [];
+ var products = new Array();
var existedBranch = false;
/* Determine whether the products of the same branch are linked. */
diff --git a/module/project/view/edit.html.php b/module/project/view/edit.html.php
index 4e151254ed..4e1d96f647 100644
--- a/module/project/view/edit.html.php
+++ b/module/project/view/edit.html.php
@@ -149,7 +149,7 @@
id] as $branchID => $branch):?>
- id][$branchID];?>
+ id][$branchID]) ? $productPlans[$product->id][$branchID] : array();?>
id}][{$branchID}]", $plans, $branches[$product->id][$branchID]->plan, "class='form-control chosen'");?>
From 36b8752cddbcede95985dcc9cd6f3451b99d46a4 Mon Sep 17 00:00:00 2001
From: xieqiyu
Date: Wed, 10 Nov 2021 10:03:10 +0800
Subject: [PATCH 18/28] * Fix a bug.
---
module/branch/view/manage.html.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/module/branch/view/manage.html.php b/module/branch/view/manage.html.php
index 28ec424d09..c3e24c3efa 100644
--- a/module/branch/view/manage.html.php
+++ b/module/branch/view/manage.html.php
@@ -14,7 +14,7 @@
-
+
From 820fbef7b44fe29d38f8e981cedcdc0cb50924ff Mon Sep 17 00:00:00 2001
From: xieqiyu
Date: Wed, 10 Nov 2021 10:09:46 +0800
Subject: [PATCH 19/28] * Hidden merge button.
---
module/branch/view/manage.html.php | 3 ---
1 file changed, 3 deletions(-)
diff --git a/module/branch/view/manage.html.php b/module/branch/view/manage.html.php
index c3e24c3efa..0adc366538 100644
--- a/module/branch/view/manage.html.php
+++ b/module/branch/view/manage.html.php
@@ -128,9 +128,6 @@
?>
-
- branch->merge, '', 'btn');?>
-
show('right', 'pagerjs');?>
From 0ac42fe56b7cfa94c3c8338fe3228b5706b333ff Mon Sep 17 00:00:00 2001
From: tianshujie
Date: Wed, 10 Nov 2021 10:49:53 +0800
Subject: [PATCH 20/28] * Modify variable value.
---
module/execution/view/manageproducts.html.php | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/module/execution/view/manageproducts.html.php b/module/execution/view/manageproducts.html.php
index 100cc06433..2e77fe9a56 100644
--- a/module/execution/view/manageproducts.html.php
+++ b/module/execution/view/manageproducts.html.php
@@ -23,20 +23,20 @@
execution->linkedProducts;?>
- grade == 2 ? "disabled='disabled'" : '';?>
+ grade == 2 ? "disabled='disabled'" : '';?>
$productName):?>
-
+
execution->notAllowRemoveProducts : $productName;?>
'>
- ";?>
+ ";?>
-
+
From b185ef3ba95b76f0ec370fc03abcdf741c466ea9 Mon Sep 17 00:00:00 2001
From: xieqiyu
Date: Wed, 10 Nov 2021 10:51:09 +0800
Subject: [PATCH 21/28] * Batch edit one branch error.
---
module/branch/model.php | 29 +++++++++--------------------
1 file changed, 9 insertions(+), 20 deletions(-)
diff --git a/module/branch/model.php b/module/branch/model.php
index 6d336a34a0..ef413051c7 100644
--- a/module/branch/model.php
+++ b/module/branch/model.php
@@ -201,33 +201,20 @@ class branchModel extends model
if($branchID == BRANCH_MAIN)
{
$newMainBranch = new stdClass();
- if($data->default == BRANCH_MAIN)
- {
- $this->dao->update(TABLE_BRANCH)
- ->set('default')->eq(0)
- ->where('product')->eq($productID)
- ->exec();
-
- if(dao::isError()) die(js::error('branch#' . $branchID . dao::getError(true)));
-
- $newMainBranch->default = 1;
- }
- else
- {
- $newMainBranch->default = 0;
- }
+ $newMainBranch->default = (isset($data->default) and $data->default == BRANCH_MAIN) ? 1 : 0;
$changes[$branchID] = common::createChanges($oldBranchList[BRANCH_MAIN], $newMainBranch);
}
else
{
$branch = new stdclass();
- $branch->name = $data->name[$branchID];
- $branch->desc = $data->desc[$branchID];
- $branch->status = $data->status[$branchID];
- $branch->default = $branchID == $data->default ? 1 : 0;
+ $branch->name = $data->name[$branchID];
+ $branch->desc = $data->desc[$branchID];
+ $branch->status = $data->status[$branchID];
+ $branch->default = (isset($data->default) and $branchID == $data->default) ? 1 : 0;
+ $branch->closedDate = $branch->status == 'closed' ? helper::today() : '';
- $this->dao->update(TABLE_BRANCH)->data($branch)
+ $this->dao->update(TABLE_BRANCH)->data($branch, 'default')
->batchCheck($this->config->branch->create->requiredFields, 'notempty')
->where('id')->eq($branchID)
->exec();
@@ -238,6 +225,8 @@ class branchModel extends model
}
}
+ if(isset($data->default)) $this->setDefault($productID, $data->default);
+
return $changes;
}
From fe315477ea5f3a5bb493bcc82456ccc269dc6907 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E7=8E=89=E6=98=A5?= <563917701@qq.com>
Date: Wed, 10 Nov 2021 02:53:53 +0000
Subject: [PATCH 22/28] Update manageproducts.html.php
---
module/execution/view/manageproducts.html.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/module/execution/view/manageproducts.html.php b/module/execution/view/manageproducts.html.php
index 2e77fe9a56..149f5b10f3 100644
--- a/module/execution/view/manageproducts.html.php
+++ b/module/execution/view/manageproducts.html.php
@@ -27,9 +27,9 @@
$productName):?>
-
- execution->notAllowRemoveProducts : $productName;?>
-
+
+ execution->notAllowRemoveProducts : $productName;?>
+
'>
From 7247a7d4b535768d478fb76a4a416d9040a12a33 Mon Sep 17 00:00:00 2001
From: mayue
Date: Wed, 10 Nov 2021 11:13:37 +0800
Subject: [PATCH 23/28] * Finish task #43892.
---
module/common/view/datatable.fix.html.php | 21 +++++++++++++++------
module/datatable/control.php | 1 +
module/datatable/lang/en.php | 4 ++++
module/datatable/lang/zh-cn.php | 4 ++++
module/story/model.php | 2 +-
5 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/module/common/view/datatable.fix.html.php b/module/common/view/datatable.fix.html.php
index fbb3031a4e..14cd957edc 100644
--- a/module/common/view/datatable.fix.html.php
+++ b/module/common/view/datatable.fix.html.php
@@ -6,7 +6,7 @@
$(function()
{
- $('#sidebar .cell .text-center:last').append("datatable->moduleSetting?> ");
+ $('#sidebar .cell .text-center:last').append("moduleName=='product' ? $lang->datatable->listSetting : $lang->datatable->moduleSetting?> ");
var addSettingButton = function()
@@ -36,10 +36,12 @@ $(function()
$('#setShowModule').click(function()
{
if('app->user->account?>' == 'guest') return;
- datatableId = '';
- var value = $('#showModuleModal input[name="showModule"]:checked').val();
- var allModule = $('#showModuleModal input[name="showAllModule"]:checked').val();
- if(typeof allModule === 'undefined') allModule = false;
+ datatableId = '';
+ var value = $('#showModuleModal input[name="showModule"]:checked').val();
+ var allModule = $('#showModuleModal input[name="showAllModule"]:checked').val();
+ var showBranch = $('#showModuleModal input[name="showBranch"]:checked').val();
+ if(typeof allModule === 'undefined') allModule = false;
+ if(typeof showBranch === 'undefined') showBranch = false;
$.ajax(
{
type: "POST",
@@ -50,6 +52,7 @@ $(function()
name: 'showModule',
value: value,
allModule: allModule,
+ showBranch: showBranch,
},
success:function(){window.location.reload();},
url: 'createLink('datatable', 'ajaxSave')?>'
@@ -80,7 +83,7 @@ $(function()
+ moduleName == 'product' && $app->methodName == 'browse'):?>
+
+ | datatable->showBranch;?> |
+ datatable->showBranchList, isset($config->product->browse->showBranch) ? $config->product->browse->showBranch : 1);?> |
+
+
|
diff --git a/module/datatable/control.php b/module/datatable/control.php
index 1c2ef4cc0e..76c526121f 100644
--- a/module/datatable/control.php
+++ b/module/datatable/control.php
@@ -38,6 +38,7 @@ class datatable extends control
$name = 'datatable.' . $this->post->target . '.' . $this->post->name;
$this->loadModel('setting')->setItem($account . '.' . $name, $this->post->value);
if($this->post->allModule !== false) $this->setting->setItem("$account.execution.task.allModule", $this->post->allModule);
+ if($this->post->showBranch !== false) $this->setting->setItem("$account.product.browse.showBranch", $this->post->showBranch);
if($this->post->global) $this->setting->setItem('system.' . $name, $this->post->value);
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => 'dao error.'));
diff --git a/module/datatable/lang/en.php b/module/datatable/lang/en.php
index a2253f5f34..93d550dbd4 100644
--- a/module/datatable/lang/en.php
+++ b/module/datatable/lang/en.php
@@ -19,10 +19,14 @@ $lang->datatable->branch = 'Branch';
$lang->datatable->platform = 'Platform';
$lang->datatable->moduleSetting = 'Set Module';
+$lang->datatable->listSetting = 'Set list';
$lang->datatable->showModule = 'Show modules in the list';
+$lang->datatable->showBranch = 'Show branches in the list';
$lang->datatable->showAllModule = 'Show product modules';
$lang->datatable->showModuleList[] = 'N/A';
$lang->datatable->showModuleList['base'] = 'Base Node';
$lang->datatable->showModuleList['end'] = 'End Node';
$lang->datatable->showAllModuleList[0] = 'Hide';
$lang->datatable->showAllModuleList[1] = 'Show';
+$lang->datatable->showBranchList[0] = 'Hide';
+$lang->datatable->showBranchList[1] = 'Show';
diff --git a/module/datatable/lang/zh-cn.php b/module/datatable/lang/zh-cn.php
index 6b7a4573c8..81cd44b83c 100644
--- a/module/datatable/lang/zh-cn.php
+++ b/module/datatable/lang/zh-cn.php
@@ -19,10 +19,14 @@ $lang->datatable->branch = '分支';
$lang->datatable->platform = '平台';
$lang->datatable->moduleSetting = '模块设置';
+$lang->datatable->listSetting = '列表设置';
$lang->datatable->showModule = '列表页是否显示模块名';
+$lang->datatable->showBranch = '列表页是否显示分支名';
$lang->datatable->showAllModule = '是否显示完整产品模块';
$lang->datatable->showModuleList[] = '不显示';
$lang->datatable->showModuleList['base'] = '只显示一级模块';
$lang->datatable->showModuleList['end'] = '只显示最后一级模块';
$lang->datatable->showAllModuleList[0] = '不显示';
$lang->datatable->showAllModuleList[1] = '显示';
+$lang->datatable->showBranchList[0] = '不显示';
+$lang->datatable->showBranchList[1] = '显示';
diff --git a/module/story/model.php b/module/story/model.php
index 186f2642d6..9cf323eb29 100644
--- a/module/story/model.php
+++ b/module/story/model.php
@@ -3663,7 +3663,7 @@ class storyModel extends model
case 'title':
if($storyType == 'requirement') echo 'SR ';
if($story->parent > 0 and isset($story->parentName)) $story->title = "{$story->parentName} / {$story->title}";
- if($story->branch and isset($branches[$story->branch])) echo "{$branches[$story->branch]} ";
+ if($story->branch and isset($branches[$story->branch]) and !empty($this->config->product->browse->showBranch)) echo "{$branches[$story->branch]} ";
if($story->module and isset($modulePairs[$story->module])) echo "{$modulePairs[$story->module]} ";
if($story->parent > 0) echo '' . $this->lang->story->childrenAB . ' ';
echo $canView ? html::a($storyLink, $story->title, '', "style='color: $story->color' data-app='$tab'") : "{$story->title}";
From a76e32591e86b47323cebfa13dbb1944646264be Mon Sep 17 00:00:00 2001
From: liumengyi
Date: Wed, 10 Nov 2021 11:30:04 +0800
Subject: [PATCH 24/28] * Finish task #43909.
---
module/report/model.php | 37 +++++++++---------
module/report/view/workload.html.php | 58 +++++++++++++---------------
2 files changed, 45 insertions(+), 50 deletions(-)
diff --git a/module/report/model.php b/module/report/model.php
index 74c6913565..7f184902f3 100644
--- a/module/report/model.php
+++ b/module/report/model.php
@@ -296,25 +296,25 @@ class reportModel extends model
->andWhere("t1.account NOT IN(SELECT `assignedTo` FROM " . TABLE_TASK . " WHERE `execution` = t1.`root` AND `status` NOT IN('cancel, closed, done, pause') AND assignedTo != '' GROUP BY assignedTo)")
->fetchGroup('account', 'name');
- $workload = array();
+ $workload = array();
if(!empty($members))
{
foreach($members as $member => $executions)
{
+ $project = array();
if(!empty($executions))
{
foreach($executions as $name => $execution)
{
- $workload[$member]['task']['project'][$execution->projectname]['project'] = $execution->projectname;
- $workload[$member]['task']['project'][$execution->projectname]['projectID'] = $execution->project;
- $workload[$member]['task']['project'][$execution->projectname]['execution'][$name]['name'] = $name;
- $workload[$member]['task']['project'][$execution->projectname]['execution'][$name]['executionID'] = $execution->root;
- $workload[$member]['task']['project'][$execution->projectname]['execution'][$name]['count'] = 0;
- $workload[$member]['task']['project'][$execution->projectname]['execution'][$name]['manhour'] = 0;
- $workload[$member]['total']['count'] = 0;
- $workload[$member]['total']['manhour'] = 0;
+ $project[$execution->projectname]['projectID'] = $execution->project;
+ $project[$execution->projectname]['execution'][$name]['executionID'] = $execution->root;
+ $project[$execution->projectname]['execution'][$name]['count'] = 0;
+ $project[$execution->projectname]['execution'][$name]['manhour'] = 0;
+ $workload[$member]['total']['count'] = 0;
+ $workload[$member]['total']['manhour'] = 0;
}
}
+ $workload[$member]['task']['project'] = $project;
}
}
return $workload;
@@ -376,20 +376,21 @@ class reportModel extends model
{
if($user)
{
+ $project = array();
foreach($userTasks as $task)
{
if(isset($parents[$task->id])) continue;
- $workload[$user]['task']['project'][$task->projectname]['projectID'] = isset($workload[$user]['task']['project'][$task->projectname]['projectID']) ? $workload[$user]['task']['project'][$task->projectname]['projectID'] : $task->project;
- $workload[$user]['task']['project'][$task->projectname]['project'] = isset($workload[$user]['task']['project'][$task->projectname]['project']) ? $workload[$user]['task']['project'][$task->projectname]['project'] : $task->projectname;
- $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['count'] = isset($workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['count']) ? $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['count'] + 1 : 1;
- $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['manhour'] = isset($workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['manhour']) ? $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['manhour'] + $task->left : $task->left;
- $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['executionID'] = $task->execution;
- $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['name'] = $task->executionName;
- $workload[$user]['total']['count'] = isset($workload[$user]['total']['count']) ? $workload[$user]['total']['count'] + 1 : 1;
- $workload[$user]['total']['manhour'] = isset($workload[$user]['total']['manhour']) ? $workload[$user]['total']['manhour'] + $task->left : $task->left;
+
+ $project[$task->projectname]['projectID'] = isset($project[$task->projectname]['projectID']) ? $project[$task->projectname]['projectID'] : $task->project;
+ $project[$task->projectname]['execution'][$task->executionName]['executionID'] = isset($project[$task->projectname]['execution'][$task->executionName]['executionID']) ? $project[$task->projectname]['execution'][$task->executionName]['executionID'] : $task->execution;
+ $project[$task->projectname]['execution'][$task->executionName]['count'] = isset($project[$task->projectname]['execution'][$task->executionName]['count']) ? $project[$task->projectname]['execution'][$task->executionName]['count'] + 1 : 1;
+ $project[$task->projectname]['execution'][$task->executionName]['manhour'] = isset($project[$task->projectname]['execution'][$task->executionName]['manhour']) ? $project[$task->projectname]['execution'][$task->executionName]['manhour'] + $task->left : $task->left;
+ $workload[$user]['total']['count'] = isset($workload[$user]['total']['count']) ? $workload[$user]['total']['count'] + 1 : 1;
+ $workload[$user]['total']['manhour'] = isset($workload[$user]['total']['manhour']) ? $workload[$user]['total']['manhour'] + $task->left : $task->left;
}
+ $workload[$user]['task']['project'] = $project;
}
- }
+ }
unset($workload['closed']);
return $workload;
}
diff --git a/module/report/view/workload.html.php b/module/report/view/workload.html.php
index d839a1cb61..2d01a8c7f6 100644
--- a/module/report/view/workload.html.php
+++ b/module/report/view/workload.html.php
@@ -82,38 +82,32 @@
$load):?>
-
-
-
- $info):?>
- $execinfo):?>
-
-
-
- |
- $info):?>
-
-
-
-
- $execinfo):?>
- ";?>
-
- createLink('project', 'view', "projectID={$info['projectID']}"), $info['project']);?> |
-
- createLink('execution', 'view', "executionID={$execinfo['executionID']}"), $execinfo['name']);?> |
- |
- |
-
- |
- |
- |
-
- "; $idprojectname ++; $idusername ++;?>
-
-
-
-
+
+
+
+ $info) foreach($info['execution'] as $exec => $execinfo) $countusername ++;?>
+ |
+ $info):?>
+
+
+ $execinfo):?>
+ ";?>
+
+ createLink('project', 'view', "projectID={$info['projectID']}"), $project);?> |
+
+ createLink('execution', 'view', "executionID={$execinfo['executionID']}"), $exec);?> |
+ |
+ |
+
+ |
+ |
+ |
+
+ "; $idprojectname ++; $idusername ++;?>
+
+
+
+
From 089238bd79e1415b5b4a2950e847c270d0041b1c Mon Sep 17 00:00:00 2001
From: xieqiyu
Date: Wed, 10 Nov 2021 12:26:55 +0800
Subject: [PATCH 25/28] * Modify review questions.
---
module/action/model.php | 2 +-
module/branch/control.php | 3 ++-
module/branch/model.php | 6 +++---
module/branch/view/manage.html.php | 1 -
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/module/action/model.php b/module/action/model.php
index 71a25eefc0..1f4ad3190d 100755
--- a/module/action/model.php
+++ b/module/action/model.php
@@ -1069,7 +1069,7 @@ class actionModel extends model
{
$this->app->loadLang('branch');
$objectName = $this->dao->select("id,name")->from(TABLE_BRANCH)->where('id')->in($objectIdList)->fetchPairs();
- if(in_array(0, $objectIdList)) $objectName[0] = $this->lang->branch->main;
+ if(in_array(BRANCH_MAIN, $objectIdList)) $objectName[BRANCH_MAIN] = $this->lang->branch->main;
}
else
{
diff --git a/module/branch/control.php b/module/branch/control.php
index b2e214cbe6..8580913a29 100644
--- a/module/branch/control.php
+++ b/module/branch/control.php
@@ -115,7 +115,8 @@ class branch extends control
}
$branchList = $this->branch->getList($productID, 'all');
- $branchIDList = $this->post->branchIDList ? $this->post->branchIDList : die(js::locate($this->session->branchManage, 'parent'));
+ $branchIDList = $this->post->branchIDList;
+ if(empty($branchIDList)) die(js::locate($this->session->branchManage, 'parent'));
foreach($branchList as $branch)
{
diff --git a/module/branch/model.php b/module/branch/model.php
index ef413051c7..a2c11ebd2c 100644
--- a/module/branch/model.php
+++ b/module/branch/model.php
@@ -242,7 +242,7 @@ class branchModel extends model
$this->dao->update(TABLE_BRANCH)
->set('status')->eq('closed')
->set('closedDate')->eq(helper::today())
- ->set('default')->eq(0)
+ ->set('`default`')->eq('0')
->where('id')->eq($branchID)
->exec();
}
@@ -429,8 +429,8 @@ class branchModel extends model
->andWhere('`default`')->eq('1')
->fetch('id');
- $this->dao->update(TABLE_BRANCH)->set('`default`')->eq('1')->where('id')->eq($branchID)->exec();
-
if(!empty($defaultBranch)) $this->dao->update(TABLE_BRANCH)->set('`default`')->eq('0')->where('id')->eq($defaultBranch)->exec();
+
+ $this->dao->update(TABLE_BRANCH)->set('`default`')->eq('1')->where('id')->eq($branchID)->exec();
}
}
diff --git a/module/branch/view/manage.html.php b/module/branch/view/manage.html.php
index 0adc366538..18027301b7 100644
--- a/module/branch/view/manage.html.php
+++ b/module/branch/view/manage.html.php
@@ -85,7 +85,6 @@
}
elseif($branch->status == 'active')
{
-
$setDefaultLink = helper::createLink('branch', 'setDefault', "productID=$productID&branchID=$branch->id", '', true);
$setDefaultHtml = html::a($setDefaultLink, " {$lang->branch->setDefault}", '', "class='iframe btn btn-icon-left btn-sm setDefault hidden'");
From 651af219585a972b58046fd58b03bd6ca21aef76 Mon Sep 17 00:00:00 2001
From: liumengyi
Date: Wed, 10 Nov 2021 13:09:09 +0800
Subject: [PATCH 26/28] * Finish task #43909.
---
module/report/model.php | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/module/report/model.php b/module/report/model.php
index 7f184902f3..b2952578a1 100644
--- a/module/report/model.php
+++ b/module/report/model.php
@@ -306,10 +306,11 @@ class reportModel extends model
{
foreach($executions as $name => $execution)
{
- $project[$execution->projectname]['projectID'] = $execution->project;
+ $project[$execution->projectname]['projectID'] = $execution->project;
$project[$execution->projectname]['execution'][$name]['executionID'] = $execution->root;
$project[$execution->projectname]['execution'][$name]['count'] = 0;
$project[$execution->projectname]['execution'][$name]['manhour'] = 0;
+
$workload[$member]['total']['count'] = 0;
$workload[$member]['total']['manhour'] = 0;
}
@@ -381,12 +382,13 @@ class reportModel extends model
{
if(isset($parents[$task->id])) continue;
- $project[$task->projectname]['projectID'] = isset($project[$task->projectname]['projectID']) ? $project[$task->projectname]['projectID'] : $task->project;
+ $project[$task->projectname]['projectID'] = isset($project[$task->projectname]['projectID']) ? $project[$task->projectname]['projectID'] : $task->project;
$project[$task->projectname]['execution'][$task->executionName]['executionID'] = isset($project[$task->projectname]['execution'][$task->executionName]['executionID']) ? $project[$task->projectname]['execution'][$task->executionName]['executionID'] : $task->execution;
$project[$task->projectname]['execution'][$task->executionName]['count'] = isset($project[$task->projectname]['execution'][$task->executionName]['count']) ? $project[$task->projectname]['execution'][$task->executionName]['count'] + 1 : 1;
$project[$task->projectname]['execution'][$task->executionName]['manhour'] = isset($project[$task->projectname]['execution'][$task->executionName]['manhour']) ? $project[$task->projectname]['execution'][$task->executionName]['manhour'] + $task->left : $task->left;
- $workload[$user]['total']['count'] = isset($workload[$user]['total']['count']) ? $workload[$user]['total']['count'] + 1 : 1;
- $workload[$user]['total']['manhour'] = isset($workload[$user]['total']['manhour']) ? $workload[$user]['total']['manhour'] + $task->left : $task->left;
+
+ $workload[$user]['total']['count'] = isset($workload[$user]['total']['count']) ? $workload[$user]['total']['count'] + 1 : 1;
+ $workload[$user]['total']['manhour'] = isset($workload[$user]['total']['manhour']) ? $workload[$user]['total']['manhour'] + $task->left : $task->left;
}
$workload[$user]['task']['project'] = $project;
}
From c29ea5077af4af43f36ea992cf77f285a9636a4b Mon Sep 17 00:00:00 2001
From: tianshujie
Date: Wed, 10 Nov 2021 13:10:11 +0800
Subject: [PATCH 27/28] * Finish task #43901.
---
module/execution/view/manageproducts.html.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/module/execution/view/manageproducts.html.php b/module/execution/view/manageproducts.html.php
index 149f5b10f3..b717155f66 100644
--- a/module/execution/view/manageproducts.html.php
+++ b/module/execution/view/manageproducts.html.php
@@ -39,8 +39,8 @@
-
-
+
+
From d9564d624f63537a801e0d37c9937b1241a557d0 Mon Sep 17 00:00:00 2001
From: xieqiyu
Date: Wed, 10 Nov 2021 13:16:32 +0800
Subject: [PATCH 28/28] * Add comments.
---
module/branch/js/batchedit.js | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/module/branch/js/batchedit.js b/module/branch/js/batchedit.js
index 3867b10a45..e796f8d187 100644
--- a/module/branch/js/batchedit.js
+++ b/module/branch/js/batchedit.js
@@ -1,3 +1,10 @@
+/**
+ * Can set default branch.
+ *
+ * @param obj $obj
+ * @access public
+ * @return void
+ */
function canSetDefaultBranch(obj)
{
if(obj.value == 'active')
|