* Finish task #78676.

This commit is contained in:
Yagami
2022-12-08 13:15:48 +08:00
parent e259eaea2b
commit fd0b180d71
5 changed files with 35 additions and 32 deletions
+14 -2
View File
@@ -1578,7 +1578,13 @@ class productModel extends model
if($plan->parent > 0 and isset($parents[$plan->parent])) $plan->title = $parents[$plan->parent] . ' / ' . $plan->title;
$year = substr($plan->end, 0, 4);
$roadmap[$year][$plan->branch][] = $plan;
$branchIdList = explode(',', trim($plan->branch, ','));
$branchIdList = array_unique($branchIdList);
foreach($branchIdList as $branchID)
{
if($branchID === '') continue;
$roadmap[$year][$branchID][] = $plan;
}
$total++;
if($count > 0 and $total >= $count) return $this->processRoadmap($roadmap);
@@ -1595,7 +1601,13 @@ class productModel extends model
foreach($releases as $release)
{
$year = substr($release->date, 0, 4);
$roadmap[$year][$release->branch][] = $release;
$branchIdList = explode(',', trim($release->branch, ','));
$branchIdList = array_unique($branchIdList);
foreach($branchIdList as $branchID)
{
if($branchID === '') continue;
$roadmap[$year][$branchID][] = $release;
}
$total++;
if($count > 0 and $total >= $count) return $this->processRoadmap($roadmap);
+3 -14
View File
@@ -35,20 +35,9 @@ class projectreleaseModel extends model
$release->branch = trim($release->branch, ',');
$release->build = trim($release->build, ',');
$builds = $this->dao->select('id, branch, filePath, scmPath, name, execution, project')->from(TABLE_BUILD)->where('id')->in($release->build)->fetchAll();
/* Get release's branches by build. */
$branches = array();
if($release->productType != 'normal')
{
foreach($builds as $build)
{
$branchIdList = explode(',', $build->branch);
foreach($branchIdList as $branchID) $branches[$branchID] = $branchID;
}
}
$release->branches = $branches;
$release->branches = array();
$branchIdList = explode(',', $release->branch);
foreach($branchIdList as $branchID) $release->branches[$branchID] = $branchID;
$this->loadModel('file');
$release = $this->file->replaceImgURL($release, 'desc');
+7 -1
View File
@@ -377,7 +377,13 @@
<tr>
<th><?php echo $lang->release->branch;?></th>
<td>
<?php foreach($release->branches as $branchID) echo zget($branches, $branchID, '') . ' ';?>
<?php
foreach($release->branches as $branchID)
{
echo zget($branches, $branchID, '');
if($branchID != end($release->branches)) echo ', ';
}
?>
</td>
</tr>
<?php endif;?>
+4 -14
View File
@@ -31,21 +31,11 @@ class releaseModel extends model
->fetch();
if(!$release) return false;
$builds = $this->dao->select('id, branch, filePath, scmPath, name, execution, project')->from(TABLE_BUILD)->where('id')->in($release->build)->fetchAll();
$release->builds = $this->dao->select('id, branch, filePath, scmPath, name, execution, project')->from(TABLE_BUILD)->where('id')->in($release->build)->fetchAll();
/* Get release's branches by build. */
$branches = array();
if($release->productType != 'normal')
{
foreach($builds as $build)
{
$branchIdList = explode(',', $build->branch);
foreach($branchIdList as $branchID) $branches[$branchID] = $branchID;
}
}
$release->builds = $builds;
$release->branches = $branches;
$release->branches = array();
$branchIdList = explode(',', trim($release->branch, ','));
foreach($branchIdList as $branchID) $release->branches[$branchID] = $branchID;
$this->loadModel('file');
$release = $this->file->replaceImgURL($release, 'desc');
+7 -1
View File
@@ -382,7 +382,13 @@
<tr>
<th><?php echo $lang->release->branch;?></th>
<td>
<?php foreach($release->branches as $branchID) echo zget($branches, $branchID, '') . ' ';?>
<?php
foreach($release->branches as $branchID)
{
echo zget($branches, $branchID, '');
if($branchID != end($release->branches)) echo ', ';
}
?>
</td>
</tr>
<?php endif;?>