* Code for task#53661.
This commit is contained in:
@@ -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()));
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user