From f652d15c2f2a16bb51d9ac1123b8dc0b626ffb73 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 19 May 2022 17:39:04 +0800 Subject: [PATCH] * Fix bug #22693. --- module/upgrade/control.php | 4 ++-- module/upgrade/model.php | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/module/upgrade/control.php b/module/upgrade/control.php index 9511021581..c0c7c862ea 100644 --- a/module/upgrade/control.php +++ b/module/upgrade/control.php @@ -298,7 +298,7 @@ class upgrade extends control } /* When upgrading historical data as a project, handle products that are not linked with the project. */ - if(!empty($singleProducts)) $this->upgrade->computeProductAcl($singleProducts, $programID); + if(!empty($singleProducts)) $this->upgrade->computeProductAcl($singleProducts, $programID, $lineID); /* Process unlinked sprint and product. */ foreach($linkedProducts as $productID => $product) @@ -353,7 +353,7 @@ class upgrade extends control } /* When upgrading historical data as a project, handle products that are not linked with the project. */ - if(!empty($singleProducts)) $this->upgrade->computeProductAcl($singleProducts, $programID); + if(!empty($singleProducts)) $this->upgrade->computeProductAcl($singleProducts, $programID, $lineID); } elseif($type == 'sprint') { diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 8af145b95c..81d7a57214 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -4802,7 +4802,7 @@ class upgradeModel extends model $this->dao->update(TABLE_RELEASE)->set('project')->eq($projectID)->where('product')->in($productIdList)->exec(); /* Compute product acl. */ - $this->computeProductAcl($productIdList, $programID); + $this->computeProductAcl($productIdList, $programID, $lineID); /* No project is created when there are no sprints. */ if(!$sprintIdList) return; @@ -4941,10 +4941,11 @@ class upgradeModel extends model * * @param array $productIdList * @param int $programID + * @param int $lineID * @access public * @return void */ - public function computeProductAcl($productIdList = array(), $programID = 0) + public function computeProductAcl($productIdList = array(), $programID = 0, $lineID = 0) { /* Compute product acl. */ $products = $this->dao->select('id,program,acl')->from(TABLE_PRODUCT)->where('id')->in($productIdList)->fetchAll(); @@ -4955,6 +4956,7 @@ class upgradeModel extends model $data = new stdclass(); $data->program = $programID; $data->acl = $product->acl == 'custom' ? 'private' : $product->acl; + $data->line = $lineID; $this->dao->update(TABLE_PRODUCT)->data($data)->where('id')->eq($product->id)->exec(); }