This commit is contained in:
tianshujie
2022-05-19 17:39:04 +08:00
parent 2f751595cc
commit f652d15c2f
2 changed files with 6 additions and 4 deletions
+2 -2
View File
@@ -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')
{
+4 -2
View File
@@ -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();
}