This commit is contained in:
daitingting
2018-05-03 16:45:11 +08:00
6 changed files with 48 additions and 24 deletions
+7 -3
View File
@@ -1,3 +1,7 @@
.mw-220px {max-width: 220px!important}
#interval{margin-right:10px;}
.canvas-wrapper {padding: 15px; border: 1px solid #ddd;}
.main-content > h2 {font-size: 18px;}
#burnWrapper {max-width: 1200px; margin: 0 auto; padding: 25px 100px 10px; position: relative;}
#burnYUnit {position: absolute; color: #CBD0DB; top: 0; left: 90px;}
#burnLegend {position: absolute; right: 0; width: 80px; height: 60px; top: 50%; margin-top: -30px; line-height: 30px; color: #838A9D; font-size: 12px;}
#burnLegend > div {position: relative; padding-left: 30px;}
#burnLegend > div:before {content: ' '; display: block; position: absolute; width: 20px; left: 0; top: 13px; height: 3px; background: #EEEEEE;}
#burnLegend > div.line-real:before {background: #006AF1;}
-3
View File
@@ -1,9 +1,6 @@
$(function()
{
initBurnChar();
$('#burnTab').addClass('active');
$('#interval').change(function()
{
location.href = createLink('project', 'burn', 'projectID=' + projectID + '&type=' + type + '&interval=' + $(this).val());
+1 -1
View File
@@ -199,7 +199,7 @@ $lang->project->timeSummary = '<div class="table-col"><div class="clearfix s
$lang->project->groupSummaryAB = "<div>Tasks <strong>%s</strong></div><div><span class='text-muted'>Wait</span> %s &nbsp; <span class='text-muted'>Doing</span> %s</div><div>Est. <strong>%s</strong></div><div><span class='text-muted'>Cost</span> %s &nbsp; <span class='text-muted'>Left</span> %s</div>";
$lang->project->wbs = "Decompose Task";
$lang->project->batchWBS = "Batch Decompose";
$lang->project->howToUpdateBurn = "<a href='http://api.zentao.pm/goto.php?item=burndown&lang=zh-cn' target='_blank' title='How to Update the Burndown Chart?' class='btn btn-link'>Help</a>";
$lang->project->howToUpdateBurn = "<a href='http://api.zentao.pm/goto.php?item=burndown&lang=zh-cn' target='_blank' title='How to Update the Burndown Chart?' class='btn btn-link'>Help <i class='icon icon-help'></i></a>";
$lang->project->whyNoStories = "No Story can be linked. Please check whether there is Story in {$lang->projectCommon} linked {$lang->productCommon} and make sure it has been reviewed.";
$lang->project->productStories = "{$lang->projectCommon} linked story is the subeset of {$lang->productCommon}, which can only be linked after review. Please <a href='%s'> Link Story</a>。";
$lang->project->doneProjects = 'Done';
+1 -1
View File
@@ -205,7 +205,7 @@ $lang->project->timeSummary = '<div class="table-col"><div class="clearfix s
$lang->project->groupSummaryAB = "<div>总任务 <strong>%s</strong></div><div><span class='text-muted'>未开始</span> %s &nbsp; <span class='text-muted'>进行中</span> %s</div><div>总预计 <strong>%s</strong></div><div><span class='text-muted'>已消耗</span> %s &nbsp; <span class='text-muted'>剩余</span> %s</div>";
$lang->project->wbs = "分解任务";
$lang->project->batchWBS = "批量分解";
$lang->project->howToUpdateBurn = "<a href='http://api.zentao.net/goto.php?item=burndown&lang=zh-cn' target='_blank' title='如何更新燃尽图?' class='btn btn-link'>帮助</a>";
$lang->project->howToUpdateBurn = "<a href='http://api.zentao.net/goto.php?item=burndown&lang=zh-cn' target='_blank' title='如何更新燃尽图?' class='btn btn-link'>帮助 <i class='icon icon-help'></i></a>";
$lang->project->whyNoStories = "看起来没有需求可以关联。请检查下{$lang->projectCommon}关联的{$lang->productCommon}中有没有需求,而且要确保它们已经审核通过。";
$lang->project->productStories = "{$lang->projectCommon}关联的需求是{$lang->productCommon}需求的子集,并且只有评审通过的需求才能关联。请<a href='%s'>关联需求</a>。";
$lang->project->doneProjects = '已结束';
+1 -1
View File
@@ -2457,7 +2457,7 @@ class projectModel extends model
$days = count($dateList) - 1;
$rate = $firstTime / $days;
$baselineJSON = '[';
foreach($dateList as $i => $date) $baselineJSON .= ($days - $i) * $rate . ',';
foreach($dateList as $i => $date) $baselineJSON .= round(($days - $i) * $rate, 1) . ',';
$baselineJSON = rtrim($baselineJSON, ',') . ']';
$chartData['labels'] = $this->report->convertFormat($dateList, 'j/n');
+38 -15
View File
@@ -18,7 +18,8 @@
<div class='btn-toolbar pull-left'>
<?php
$weekend = ($type == 'noweekend') ? 'withweekend' : "noweekend";
common::printLink('project', 'computeBurn', 'reload=yes', $lang->project->computeBurn, 'hiddenwin', "title='{$lang->project->computeBurn}{$lang->project->burn}' class='btn btn-primary' id='computeBurn'");
common::printLink('project', 'computeBurn', 'reload=yes', '<i class="icon icon-refresh"></i> ' . $lang->project->computeBurn, 'hiddenwin', "title='{$lang->project->computeBurn}{$lang->project->burn}' class='btn btn-primary' id='computeBurn'");
echo '<div class="space"></div>';
echo html::a($this->createLink('project', 'burn', "projectID=$projectID&type=$weekend&interval=$interval"), $lang->project->$weekend, '', "class='btn btn-link'");
common::printLink('project', 'fixFirst', "project=$project->id", $lang->project->fixFirst, '', "class='btn btn-link iframe' data-width='600'");
echo $lang->project->howToUpdateBurn;
@@ -30,9 +31,18 @@
<?php endif;?>
</div>
</div>
<div id='mainContent' class='main-content text-center bd-0'>
<h1><?php echo $projectName . ' ' . $this->lang->project->burn;?></h1>
<div class='canvas-wrapper'><div class='chart-canvas'><canvas id='burnChart' width='800' height='400' data-bezier-curve='false' data-responsive='true'></canvas></div></div>
<div id='mainContent' class='main-content'>
<h2 class='text-center'><?php echo $projectName . ' ' . $this->lang->project->burn;?></h2>
<div id="burnWrapper">
<div id="burnChart">
<canvas id="burnCanvas"></canvas>
</div>
<div id="burnYUnit"><?php echo "({$lang->project->workHour})";?></div>
<div id="burnLegend">
<div class="line-ref"><?php echo $lang->project->charts->burn->graph->reference;?></div>
<div class="line-real"><?php echo $lang->project->charts->burn->graph->actuality;?></div>
</div>
</div>
</div>
<script>
function initBurnChar()
@@ -43,28 +53,41 @@ function initBurnChar()
datasets: [
{
label: "<?php echo $lang->project->baseline;?>",
color: "#CCC",
showTooltips: false,
color: "#F1F1F1",
pointColor: '#D8D8D8',
pointStrokeColor: '#D8D8D8',
pointHighlightStroke: '#D8D8D8',
fillColor: 'transparent',
pointHighlightFill: '#fff',
data: <?php echo $chartData['baseLine']?>
},
{
label: "<?php echo $lang->project->Left?>",
color: "#0033CC",
pointStrokeColor: '#0033CC',
pointHighlightStroke: '0033CC',
color: "#006AF1",
pointStrokeColor: '#006AF1',
pointHighlightStroke: '#006AF1',
pointColor: '#006AF1',
fillColor: 'rgba(0,106,241, .07)',
pointHighlightFill: '#fff',
data: <?php echo $chartData['burnLine']?>
}]
};
var burnChart = $("#burnChart").lineChart(data,
var burnChart = $("#burnCanvas").lineChart(data,
{
animation: !($.zui.browser && $.zui.browser.ie === 8),
pointDotStrokeWidth: 0,
pointDotRadius: 1,
datasetFill: false,
pointDotStrokeWidth: 2,
pointDotRadius: 3,
datasetStrokeWidth: 3,
datasetFill: true,
datasetStroke: true,
scaleShowBeyondLine: false,
multiTooltipTemplate: "<%= value %>h"
responsive: true,
bezierCurve: false,
scaleFontColor: '#838A9D',
tooltipXPadding: 10,
tooltipYPadding: 10,
multiTooltipTitleTemplate: '<%= label %> <?php echo $lang->project->workHour;?> /h',
multiTooltipTemplate: "<%if (datasetLabel){%><%=datasetLabel%>: <%}%><%= value %>",
});
}
</script>