* Code for task#53661.

This commit is contained in:
xieqiyu
2022-05-12 08:15:25 +08:00
parent ce7c0afdc1
commit 691de86d4a
3 changed files with 10 additions and 6 deletions
+3 -1
View File
@@ -1163,7 +1163,8 @@ class execution extends control
/* Get date list. */
$executionInfo = $this->execution->getByID($executionID);
$endDate = strpos($type, 'withdelay') !== false ? helper::today() : $executionInfo->end;
$deadline = $execution->status != 'closed' ? helper::today() : substr($execution->closedDate, 0, 10);
$endDate = strpos($type, 'withdelay') !== false ? $deadline : $executionInfo->end;
list($dateList, $interval) = $this->execution->getDateList($executionInfo->begin, $endDate, $type, $interval, 'Y-m-d');
$chartData = $this->execution->buildBurnData($executionID, $dateList, $type, $burnBy);
@@ -1928,6 +1929,7 @@ class execution extends control
if(!empty($_POST))
{
$this->loadModel('action');
$this->execution->computeBurn($executionID);
$changes = $this->execution->close($executionID);
if(dao::isError()) return print(js::error(dao::getError()));
+5 -3
View File
@@ -2785,16 +2785,18 @@ class executionModel extends model
/**
* Compute burn of a execution.
*
* @param int $executionID
* @access public
* @return array
* @return void
*/
public function computeBurn()
public function computeBurn($executionID = 0)
{
$today = helper::today();
$executions = $this->dao->select('id, code')->from(TABLE_EXECUTION)
->where('type')->in('sprint,stage')
->andWhere('lifetime')->ne('ops')
->andWhere('status')->notin('done,closed,suspended')
->beginIF($executionID)->andWhere('id')->eq($executionID)->fi()
->fetchPairs();
if(!$executions) return array();
@@ -3650,7 +3652,7 @@ class executionModel extends model
$chartData['baseLine'] = $baselineJSON;
$execution = $this->getById($executionID);
if($execution->status != 'closed' and helper::today() > $execution->end)
if(($execution->status != 'closed' and helper::today() > $execution->end) or ($execution->status == 'closed' and substr($execution->closedDate, 0, 10) > $execution->end))
{
$delaySets = $this->getBurnDataFlot($executionID, $burnBy, true);
$chartData['delayLine'] = $this->report->createSingleJSON($delaySets, $dateList);
+2 -2
View File
@@ -27,7 +27,7 @@
common::printLink('execution', 'computeBurn', 'reload=yes', '<i class="icon icon-refresh"></i> ' . $lang->execution->computeBurn, 'hiddenwin', "title='{$lang->execution->computeBurn}' class='btn btn-primary' id='computeBurn'");
echo '<div class="space"></div>';
echo html::a('#', $lang->execution->$weekend, '', "class='btn btn-link' id='weekend'");
if($execution->status != 'closed' and helper::today() > $execution->end) echo html::a('#', $lang->execution->$delay, '', "class='btn btn-link' id='delay'");
if(($execution->status != 'closed' and helper::today() > $execution->end) or ($execution->status == 'closed' and substr($execution->closedDate, 0, 10) > $execution->end)) echo html::a('#', $lang->execution->$delay, '', "class='btn btn-link' id='delay'");
if(common::canModify('execution', $execution)) common::printLink('execution', 'fixFirst', "execution=$execution->id", $lang->execution->fixFirst, '', "class='btn btn-link iframe' data-width='700'");
echo $lang->execution->howToUpdateBurn;
?>
@@ -109,7 +109,7 @@ function initBurnChar()
pointColor: 'red',
fillColor: 'rgba(0,106,241, .07)',
pointHighlightFill: '#fff',
data: <?php echo $chartData['delayLine']?>
data: <?php echo isset($chartData['delayLine']) ? $chartData['delayLine'] : '[]';?>
}
if(type.match('withdelay')) data.datasets.push(delaySets);