diff --git a/module/execution/control.php b/module/execution/control.php index 060128b0f2..44c81b6cd1 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1163,7 +1163,7 @@ class execution extends control /* Get date list. */ $executionInfo = $this->execution->getByID($executionID); - $deadline = $execution->status != 'closed' ? helper::today() : substr($execution->closedDate, 0, 10); + $deadline = strpos('closed,suspended', $execution->status) === false ? helper::today() : ($execution->status == 'closed' ? substr($execution->closedDate, 0, 10) : $execution->suspendedDate); $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); diff --git a/module/execution/model.php b/module/execution/model.php index 37e7304e64..25be47604a 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -827,6 +827,7 @@ class executionModel extends model ->setDefault('status', 'suspended') ->setDefault('lastEditedBy', $this->app->user->account) ->setDefault('lastEditedDate', $now) + ->setDefault('suspendedDate', helper::today()) ->remove('comment')->get(); $this->dao->update(TABLE_EXECUTION)->data($execution) @@ -3654,7 +3655,9 @@ class executionModel extends model $chartData['baseLine'] = $baselineJSON; $execution = $this->getById($executionID); - if(($execution->status != 'closed' and helper::today() > $execution->end) or ($execution->status == 'closed' and substr($execution->closedDate, 0, 10) > $execution->end)) + if((strpos('closed,suspended', $execution->status) === false and helper::today() > $execution->end) + or ($execution->status == 'closed' and substr($execution->closedDate, 0, 10) > $execution->end) + or ($execution->status == 'suspended' and $execution->suspendedDate > $execution->end)) { $delaySets = $this->getBurnDataFlot($executionID, $burnBy, true); $chartData['delayLine'] = $this->report->createSingleJSON($delaySets, $dateList); diff --git a/module/execution/view/burn.html.php b/module/execution/view/burn.html.php index 6374ef4835..b1f9af0f86 100644 --- a/module/execution/view/burn.html.php +++ b/module/execution/view/burn.html.php @@ -24,10 +24,17 @@ ' . $lang->execution->computeBurn, 'hiddenwin', "title='{$lang->execution->computeBurn}' class='btn btn-primary' id='computeBurn'"); - echo '
'; + if(strpos('closed,suspended', $execution->status) === false) + { + common::printLink('execution', 'computeBurn', 'reload=yes', ' ' . $lang->execution->computeBurn, 'hiddenwin', "title='{$lang->execution->computeBurn}' class='btn btn-primary' id='computeBurn'"); + echo '
'; + } echo html::a('#', $lang->execution->$weekend, '', "class='btn btn-link' id='weekend'"); - 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((strpos('closed,suspended', $execution->status) === false and helper::today() > $execution->end) + or ($execution->status == 'closed' and substr($execution->closedDate, 0, 10) > $execution->end) + or ($execution->status == 'suspended' and $execution->suspendedDate > $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; ?>