* finish task 3463.

This commit is contained in:
wangyidong
2017-12-18 10:01:08 +08:00
parent 6cd9793d00
commit a68fe9adcd
10 changed files with 149 additions and 14 deletions
+41
View File
@@ -25,8 +25,49 @@ $(function()
setTimeout(function(){fixedTheadOfList('#storyList')}, 100);
if($('#storyList thead th.w-title').width() < 150) $('#storyList thead th.w-title').width(150);
$(document).on('click', "#storyList tbody tr", function(){showCheckedSummary();});
$(document).on('change', "#storyList :checkbox", function(){showCheckedSummary();});
$(document).on('click', "#datatable-storyList table tr", function(){showCheckedSummary();});
})
function showCheckedSummary()
{
var $summary = $('tfoot .table-actions .text:last');
if(!$summary.hasClass('readed'))
{
taskSummary = $summary.html();
$summary.addClass('readed');
}
var checkedTotal = 0;
var checkedEstimate = 0;
var checkedCase = 0;
$('[name^="storyIDList"]').each(function()
{
if($(this).prop('checked'))
{
checkedTotal += 1;
var taskID = $(this).val();
$tr = $("#storyList tbody tr[data-id='" + taskID + "']");
checkedEstimate += Number($tr.data('estimate'));
if(Number($tr.data('cases')) > 0) checkedCase += 1;
}
});
if(checkedTotal > 0)
{
rate = Math.round(checkedCase / checkedTotal * 10000) / 100 + '' + '%';
summary = checkedSummary.replace('%total%', checkedTotal)
.replace('%estimate%', checkedEstimate)
.replace('%rate%', rate)
$('tfoot .table-actions .text:last').html(summary);
}
else
{
$('tfoot .table-actions .text:last').html(taskSummary);
}
}
function setQueryBar(queryID, title)
{
$('#bysearchTab').before("<li id='QUERY" + queryID + "Tab' class='active'><a href='" + createLink('product', 'browse', "productID=" + productID + "&branch=" + branch + "&browseType=bysearch&param=" + queryID) + "'>" + title + "</a></li>");
+3 -2
View File
@@ -109,8 +109,9 @@ $lang->product->aclList['open'] = "Default (User with {$lang->productCommon}
$lang->product->aclList['private'] = "Private {$lang->productCommon} ({$lang->projectCommon} team members only)";
$lang->product->aclList['custom'] = 'Custom (Team members and Whitelist members have access to it.)';
$lang->product->storySummary = " <strong>%s</strong> Story(ies), <strong>%s</strong> hour(s) estimated, case coverage is <strong>%s</strong> on this page.";
$lang->product->noMatched = '"%s" cannot be found.' . $lang->productCommon;
$lang->product->storySummary = " <strong>%s</strong> Story(ies), <strong>%s</strong> hour(s) estimated, case coverage is <strong>%s</strong> on this page.";
$lang->product->checkedSummary = " <strong>%total%</strong> Checked, <strong>%estimate%</strong> hour(s) estimated, case coverage is <strong>%rate%</strong>.";
$lang->product->noMatched = '"%s" cannot be found.' . $lang->productCommon;
$lang->product->mySelects['assignedtome'] = $lang->product->assignedToMe;
$lang->product->mySelects['openedbyme'] = $lang->product->openedByMe;
+3 -2
View File
@@ -108,8 +108,9 @@ $lang->product->aclList['open'] = "默认设置(有{$lang->productCommon}视
$lang->product->aclList['private'] = "私有{$lang->productCommon}(只有{$lang->productCommon}相关负责人和{$lang->projectCommon}团队成员才能访问)";
$lang->product->aclList['custom'] = '自定义白名单(团队成员和白名单的成员可以访问)';
$lang->product->storySummary = "本页共 <strong>%s</strong> 个需求,预计 <strong>%s</strong> 个工时,用例覆盖率<strong>%s</strong>。";
$lang->product->noMatched = '找不到包含"%s"的' . $lang->productCommon;
$lang->product->storySummary = "本页共 <strong>%s</strong> 个需求,预计 <strong>%s</strong> 个工时,用例覆盖率<strong>%s</strong>。";
$lang->product->checkedSummary = "选中 <strong>%total%</strong> 个需求,预计 <strong>%estimate%</strong> 个工时,用例覆盖率<strong>%rate%</strong>。";
$lang->product->noMatched = '找不到包含"%s"的' . $lang->productCommon;
$lang->product->featureBar['browse']['unclosed'] = $lang->product->unclosed;
$lang->product->featureBar['browse']['unplan'] = $lang->product->unplan;
+2 -1
View File
@@ -141,7 +141,7 @@
</thead>
<tbody>
<?php foreach($stories as $story):?>
<tr class='text-center' data-id='<?php echo $story->id?>'>
<tr class='text-center' data-id='<?php echo $story->id?>' data-estimate='<?php echo $story->estimate?>' data-cases='<?php echo zget($storyCases, $story->id, 0);?>'>
<?php foreach($setting as $key => $value) $this->story->printCell($value, $story, $users, $branches, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table');?>
</tr>
<?php endforeach;?>
@@ -323,6 +323,7 @@
</table>
</form>
</div>
<?php js::set('checkedSummary', $lang->product->checkedSummary);?>
<script language='javascript'>
var moduleID = <?php echo $moduleID?>;
$('#module<?php echo $moduleID;?>').addClass('active');
+39
View File
@@ -21,4 +21,43 @@ $(function()
$('#module' + moduleID).addClass('active');
$('#product' + productID).addClass('active');
$(document).on('click', "#storyList tbody tr", function(){showCheckedSummary();});
$(document).on('change', "#storyList :checkbox", function(){showCheckedSummary();});
});
function showCheckedSummary()
{
var $summary = $('tfoot .table-actions .text:last');
if(!$summary.hasClass('readed'))
{
taskSummary = $summary.html();
$summary.addClass('readed');
}
var checkedTotal = 0;
var checkedEstimate = 0;
var checkedCase = 0;
$('[name^="storyIDList"]').each(function()
{
if($(this).prop('checked'))
{
checkedTotal += 1;
var taskID = $(this).val();
$tr = $("#storyList tbody tr[data-id='" + taskID + "']");
checkedEstimate += Number($tr.data('estimate'));
if(Number($tr.data('cases')) > 0) checkedCase += 1;
}
});
if(checkedTotal > 0)
{
rate = Math.round(checkedCase / checkedTotal * 10000) / 100 + '' + '%';
summary = checkedSummary.replace('%total%', checkedTotal)
.replace('%estimate%', checkedEstimate)
.replace('%rate%', rate)
$('tfoot .table-actions .text:last').html(summary);
}
else
{
$('tfoot .table-actions .text:last').html(taskSummary);
}
}
+48
View File
@@ -22,6 +22,10 @@ $(function()
});
if($('#taskList thead th.w-name').width() < 150) $('#taskList thead th.w-name').width(150);
$(document).on('click', "#taskList tbody tr", function(){showCheckedSummary();});
$(document).on('change', "#taskList :checkbox", function(){showCheckedSummary();});
$(document).on('click', "#datatable-taskList table tr", function(){showCheckedSummary();});
});
function setQueryBar(queryID, title)
@@ -30,5 +34,49 @@ function setQueryBar(queryID, title)
$tagTab.before("<li id='QUERY" + queryID + "Tab' class='active'><a href='" + createLink('project', 'task', "projectID=" + projectID + "&browseType=bysearch&param=" + queryID) + "'>" + title + "</a></li>");
}
function showCheckedSummary()
{
var $summary = $('tfoot .table-actions .text:last');
if(!$summary.hasClass('readed'))
{
taskSummary = $summary.html();
$summary.addClass('readed');
}
var checkedTotal = 0;
var checkedWait = 0;
var checkedDoing = 0;
var checkedEstimate = 0;
var checkedConsumed = 0;
var checkedLeft = 0;
$('[name^="taskIDList"]').each(function()
{
if($(this).prop('checked'))
{
checkedTotal += 1;
var taskID = $(this).val();
$tr = $("#taskList tbody tr[data-id='" + taskID + "']");
if($tr.data('status') == 'wait') checkedWait += 1;
if($tr.data('status') == 'doing') checkedDoing += 1;
checkedEstimate += Number($tr.data('estimate'));
checkedConsumed += Number($tr.data('consumed'));
checkedLeft += Number($tr.data('left'));
}
});
if(checkedTotal > 0)
{
summary = checkedSummary.replace('%total%', checkedTotal).replace('%wait%', checkedWait)
.replace('%doing%', checkedDoing)
.replace('%estimate%', checkedEstimate)
.replace('%consumed%', checkedConsumed)
.replace('%left%', checkedLeft);
$('tfoot .table-actions .text:last').html(summary);
}
else
{
$('tfoot .table-actions .text:last').html(taskSummary);
}
}
$('#module' + moduleID).addClass('active');
$('#product' + productID).addClass('active');
+1
View File
@@ -180,6 +180,7 @@ $lang->project->beginAndEnd = 'Time Frame';
$lang->project->lblStats = 'Hour Report';
$lang->project->stats = '<strong>%s</strong> Hour(s) available, <strong>%s</strong> Hour(s) Estimated, <strong>%s</strong> Hour(s) Consumed, <strong>%s</strong> Hour(s) Remained.';
$lang->project->taskSummary = " <strong>%s</strong> Tasks on this page, <strong>%s</strong> Wait, <strong>%s</strong> Doing. <strong>%s</strong> Hour(s) Estimated, <strong>%s</strong> Hour(s) Consumed, <strong>%s</strong> Hour(s) Remained.";
$lang->project->checkedSummary = " <strong>%total%</strong> Checked, <strong>%wait%</strong> Wait, <strong>%doing%</strong> Doing, <strong>%estimate%</strong> Hour(s) Estimated, <strong>%consumed%</strong> Hour(s) Consumed, <strong>%left%</strong> Hour(s) Remained.";
$lang->project->memberHours = "%s has <strong>%s</strong> Hour(s) available ";
$lang->project->groupSummary = "<strong>%s</strong> Tasks in this group, Wait <strong>%s</strong>, Doing <strong>%s</strong>. <strong>%s</strong> Hour(s) Estimated , <strong>%s</strong> Hour(s) Consumed, <strong>%s</strong> Hour(s) Remained.";
$lang->project->groupSummaryAB = "Total Tasks <strong>%s</strong>, Wait <strong>%s</strong>, Doing <strong>%s</strong>.<br /> <strong>%s</strong> Hour(s) Estimated, <strong>%s</strong> Hour(s) Consumed,<strong>%s</strong> Hour(s) Remained.";
+1
View File
@@ -180,6 +180,7 @@ $lang->project->beginAndEnd = '起止时间';
$lang->project->lblStats = '工时统计';
$lang->project->stats = '可用工时<strong>%s</strong>工时,总共预计<strong>%s</strong>工时,已经消耗<strong>%s</strong>工时,预计剩余<strong>%s</strong>工时';
$lang->project->taskSummary = "本页共 <strong>%s</strong> 个任务,未开始 <strong>%s</strong>,进行中 <strong>%s</strong>,总预计<strong>%s</strong>工时,已消耗<strong>%s</strong>工时,剩余<strong>%s</strong>工时。";
$lang->project->checkedSummary = "选中 <strong>%total%</strong> 个任务,未开始 <strong>%wait%</strong>,进行中 <strong>%doing%</strong>,总预计<strong>%estimate%</strong>工时,已消耗<strong>%consumed%</strong>工时,剩余<strong>%left%</strong>工时。";
$lang->project->memberHours = "%s共有 <strong>%s</strong> 个可用工时,";
$lang->project->groupSummary = "本组共 <strong>%s</strong> 个任务,未开始 <strong>%s</strong>,进行中 <strong>%s</strong>,总预计<strong>%s</strong>工时,已消耗<strong>%s</strong>工时,剩余<strong>%s</strong>工时。";
$lang->project->groupSummaryAB = "总任务<strong>%s</strong> ,未开始<strong>%s</strong>,进行中<strong>%s</strong>。<br />总预计<strong>%s</strong>,已消耗<strong>%s</strong>,剩余<strong>%s</strong>。";
+2 -1
View File
@@ -105,7 +105,7 @@
$storyLink = $this->createLink('story', 'view', "storyID=$story->id&version=$story->version&from=project&param=$project->id");
$totalEstimate += $story->estimate;
?>
<tr class='text-center' id="story<?php echo $story->id;?>" data-id='<?php echo $story->id;?>' data-order='<?php echo $story->order ?>'>
<tr class='text-center' id="story<?php echo $story->id;?>" data-id='<?php echo $story->id;?>' data-order='<?php echo $story->order ?>' data-estimate='<?php echo $story->estimate?>' data-cases='<?php echo zget($storyCases, $story->id, 0)?>'>
<td class='cell-id'>
<?php if($canBatchEdit or $canBatchClose):?>
<input type='checkbox' name='storyIDList[<?php echo $story->id;?>]' value='<?php echo $story->id;?>' />
@@ -232,6 +232,7 @@
</table>
</form>
</div>
<?php js::set('checkedSummary', $lang->product->checkedSummary);?>
<?php js::set('projectID', $project->id);?>
<?php js::set('orderBy', $orderBy)?>
<?php include '../../common/view/footer.html.php';?>
+9 -8
View File
@@ -51,13 +51,13 @@ js::set('browseType', $browseType);
$customFields = $this->datatable->getSetting('project');
if($project->type == 'ops')
{
foreach($customFields as $id => $customField)
{
if($customField->id == 'story') unset($customFields[$id]);
}
foreach($customFields as $id => $customField)
{
if($customField->id == 'story') unset($customFields[$id]);
}
}
$widths = $this->datatable->setFixedFieldWidth($customFields);
$columns = 0;
$widths = $this->datatable->setFixedFieldWidth($customFields);
$columns = 0;
?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed <?php echo ($useDatatable ? 'datatable' : 'table-selectable');?> table-selectable' id='taskList' data-checkable='true' data-fixed-left-width='<?php echo $widths['leftWidth']?>' data-fixed-right-width='<?php echo $widths['rightWidth']?>' data-custom-menu='true' data-checkbox-name='taskIDList[]'>
<thead>
@@ -76,14 +76,14 @@ js::set('browseType', $browseType);
</thead>
<tbody>
<?php foreach($tasks as $task):?>
<tr class='text-center' data-id='<?php echo $task->id;?>'>
<tr class='text-center' data-id='<?php echo $task->id;?>' data-status='<?php echo $task->status?>' data-estimate='<?php echo $task->estimate?>' data-consumed='<?php echo $task->consumed?>' data-left='<?php echo $task->left?>'>
<?php foreach($customFields as $field) $this->task->printCell($field, $task, $users, $browseType, $branchGroups, $modulePairs, $useDatatable ? 'datatable' : 'table');?>
</tr>
<?php if(!empty($task->children)):?>
<?php foreach($task->children as $key => $child):?>
<?php $class = $key == 0 ? ' table-child-top' : '';?>
<?php $class .= ($key + 1 == count($task->children)) ? ' table-child-bottom' : '';?>
<tr class='text-center table-children<?php echo $class;?> parent-<?php echo $task->id;?>' data-id='<?php echo $child->id?>'>
<tr class='text-center table-children<?php echo $class;?> parent-<?php echo $task->id;?>' data-id='<?php echo $child->id?>' data-status='<?php echo $task->status?>' data-estimate='<?php echo $task->estimate?>' data-consumed='<?php echo $task->consumed?>' data-left='<?php echo $task->left?>'>
<?php foreach($customFields as $field) $this->task->printCell($field, $child, $users, $browseType, $branchGroups, $modulePairs, $useDatatable ? 'datatable' : 'table', true);?>
</tr>
<?php endforeach;?>
@@ -173,6 +173,7 @@ js::set('browseType', $browseType);
</table>
</form>
</div>
<?php js::set('checkedSummary', $lang->project->checkedSummary);?>
<?php js::set('replaceID', 'taskList')?>
<script>
$('#project<?php echo $projectID;?>').addClass('active')