* Add label for the release in the builds.
This commit is contained in:
@@ -468,8 +468,7 @@ class bug extends control
|
||||
$this->view->users = $users;
|
||||
$this->view->assignedTo = isset($users[$oldBug->openedBy]) ? $oldBug->openedBy : $this->bug->getModuleOwner($oldBug->module, $oldBug->product);
|
||||
$this->view->executions = $this->loadModel('product')->getExecutionPairsByProduct($oldBug->product, $oldBug->branch ? "0,{$oldBug->branch}" : '0', (int)$oldBug->project, 'stagefilter');
|
||||
$this->view->builds = $builds;
|
||||
$this->view->releases = $this->build->getRelatedReleases(array($oldBug->product));
|
||||
$this->view->builds = $this->bugZen->addReleaseLabelForBuilds($oldBug->product, $builds);
|
||||
$this->view->actions = $this->loadModel('action')->getList('bug', $bugID);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -16,19 +16,6 @@ jsVar('page', 'resolve');
|
||||
jsVar('released', $lang->build->released);
|
||||
jsVar('requiredFields', $config->bug->resolve->requiredFields);
|
||||
|
||||
$buildItems = array();
|
||||
foreach($builds as $buildID => $buildName)
|
||||
{
|
||||
$buildItem = array('value' => $buildID, 'text' => $buildName);
|
||||
if(isset($releases[$buildID])) $buildItem['content'] = array('html' => "<div class='flex clip'>{$buildName}</div><label class='label bg-primary-50 text-primary ml-1 flex-none'>{$lang->release->common}</label>", 'class' => 'w-full flex nowrap');
|
||||
$buildItems[$buildID] = $buildItem;
|
||||
}
|
||||
foreach($releases as $releaseID => $release)
|
||||
{
|
||||
if(isset($buildItems[$release->shadow])) $buildItems[$release->shadow]['content'] = array('html' => "<div class='flex clip'>{$buildItems[$release->shadow]['text']}</div><label class='label bg-primary-50 text-primary ml-1 flex-none'>{$lang->release->common}</label>", 'class' => 'w-full flex nowrap');
|
||||
}
|
||||
var_dump($buildItems);
|
||||
|
||||
$createBuild = '';
|
||||
if(common::hasPriv('build', 'create'))
|
||||
{
|
||||
@@ -107,7 +94,7 @@ formPanel
|
||||
(
|
||||
set::name('resolvedBuild'),
|
||||
set::value(''),
|
||||
set::items(array_values($buildItems))
|
||||
set::items($builds)
|
||||
)
|
||||
),
|
||||
formGroup
|
||||
|
||||
+33
-1
@@ -988,6 +988,7 @@ class bugZen extends bug
|
||||
{
|
||||
$builds = $this->build->getBuildPairs(array($productID), $branch, 'noempty,noterminate,nodone,withbranch,noreleased');
|
||||
}
|
||||
$builds = $this->addReleaseLabelForBuilds($productID, $builds);
|
||||
|
||||
return $this->updateBug($bug, array('builds' => $builds));
|
||||
}
|
||||
@@ -1205,10 +1206,13 @@ class bugZen extends bug
|
||||
$cases = $this->loadmodel('testcase')->getPairsByProduct($bug->product, array(0, $bug->branch), $case->title, $this->config->maxCount);
|
||||
}
|
||||
|
||||
$resolvedBuilds = $this->build->getBuildPairs(array($bug->product), $bug->branch, 'noempty');
|
||||
$resolvedBuilds = $this->addReleaseLabelForBuilds($bug->product, $resolvedBuilds);
|
||||
|
||||
$this->config->moreLinks['case'] = inlink('ajaxGetProductCases', "bugID={$bug->id}");
|
||||
|
||||
$this->view->openedBuilds = $openedBuilds;
|
||||
$this->view->resolvedBuilds = $this->build->getBuildPairs(array($bug->product), $bug->branch, 'noempty');
|
||||
$this->view->resolvedBuilds = $resolvedBuilds;
|
||||
$this->view->plans = $this->loadModel('productplan')->getPairs($bug->product, $bug->branch, '', true);
|
||||
$this->view->stories = $bug->execution ? $this->story->getExecutionStoryPairs($bug->execution) : $this->story->getProductStoryPairs($bug->product, $bug->branch, 0, 'all', 'id_desc', 0, 'full', 'story', false);
|
||||
$this->view->tasks = $this->task->getExecutionTaskPairs($bug->execution);
|
||||
@@ -2390,4 +2394,32 @@ class bugZen extends bug
|
||||
|
||||
return $chartOption;
|
||||
}
|
||||
|
||||
/**
|
||||
* 给版本中的发布增加标识。
|
||||
* Add label for the release in the builds.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param array $builds
|
||||
* @access protected
|
||||
* @return array
|
||||
*/
|
||||
protected function addReleaseLabelForBuilds(int $productID, array $builds): array
|
||||
{
|
||||
$releases = $this->loadModel('build')->getRelatedReleases(array($productID));
|
||||
|
||||
$buildItems = array();
|
||||
foreach($builds as $buildID => $buildName)
|
||||
{
|
||||
$buildItem = array('value' => $buildID, 'text' => $buildName);
|
||||
if(isset($releases[$buildID])) $buildItem['content'] = array('html' => "<div class='flex clip'>{$buildName}</div><label class='label bg-primary-50 text-primary ml-1 flex-none'>{$this->lang->release->common}</label>", 'class' => 'w-full flex nowrap');
|
||||
$buildItems[$buildID] = $buildItem;
|
||||
}
|
||||
foreach($releases as $release)
|
||||
{
|
||||
if(isset($buildItems[$release->shadow])) $buildItems[$release->shadow]['content'] = array('html' => "<div class='flex clip'>{$buildItems[$release->shadow]['text']}</div><label class='label bg-primary-50 text-primary ml-1 flex-none'>{$this->lang->release->common}</label>", 'class' => 'w-full flex nowrap');
|
||||
}
|
||||
|
||||
return array_values($buildItems);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user