From f50715d3f19bd5a9eec4f5034c03a1892e08cb14 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 20 Apr 2018 16:42:25 +0800 Subject: [PATCH 1/8] * adjust for project-linkstory page. --- module/product/js/browse.js | 2 +- module/product/model.php | 2 +- module/project/js/story.js | 16 ++---- module/project/view/linkstory.html.php | 69 ++++++++++++------------ module/project/view/story.html.php | 3 +- module/project/view/storykanban.html.php | 3 ++ 6 files changed, 44 insertions(+), 51 deletions(-) diff --git a/module/product/js/browse.js b/module/product/js/browse.js index 556e60f6c5..98406c3bc8 100644 --- a/module/product/js/browse.js +++ b/module/product/js/browse.js @@ -5,7 +5,7 @@ $(function() 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('click', "#storyList tbody tr, .table-footer .check-all, #storyList thead .check-all", function(){showCheckedSummary();}); $(document).on('change', "#storyList :checkbox", function(){showCheckedSummary();}); $(document).on('click', "#datatable-storyList table tr", function(){showCheckedSummary();}); }) diff --git a/module/product/model.php b/module/product/model.php index fa39f64a5c..55f372d7da 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -894,7 +894,7 @@ class productModel extends model } } - $cases = $this->dao->select('DISTINCT story')->from(TABLE_CASE)->where('story')->in($storyIdList)->fetchAll(); + $cases = $this->dao->select('DISTINCT story')->from(TABLE_CASE)->where('story')->in($storyIdList)->andWhere('deleted')->eq(0)->fetchAll(); $rate = count($stories) == 0 ? 0 : round(count($cases) / count($stories), 2); return sprintf($this->lang->product->storySummary, count($stories), $totalEstimate, $rate * 100 . "%"); diff --git a/module/project/js/story.js b/module/project/js/story.js index d828e0e8f1..b1801313a4 100644 --- a/module/project/js/story.js +++ b/module/project/js/story.js @@ -19,7 +19,7 @@ $(function() $('#module' + moduleID).addClass('active'); $('#product' + productID).addClass('active'); $('#branch' + branchID).addClass('active'); - $(document).on('click', "#storyList tbody tr", function(){showCheckedSummary();}); + $(document).on('click', "#storyList tbody tr, .table-footer .check-all, #storyList thead .check-all", function(){showCheckedSummary();}); $(document).on('change', "#storyList :checkbox", function(){showCheckedSummary();}); $("a[data-toggle='linkStoryByPlan']").click(function(){$('#linkStoryByPlan').modal('show')}) @@ -36,12 +36,8 @@ $(function() function showCheckedSummary() { - var $summary = $('tfoot .table-actions .text:last'); - if(!$summary.hasClass('readed')) - { - taskSummary = $summary.html(); - $summary.addClass('readed'); - } + console.log('test'); + var $summary = $('#main #mainContent form.main-table .table-header .table-statistic'); var checkedTotal = 0; var checkedEstimate = 0; @@ -63,10 +59,6 @@ function showCheckedSummary() 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); + $summary.html(summary); } } diff --git a/module/project/view/linkstory.html.php b/module/project/view/linkstory.html.php index 05d0653d84..080f6a9a47 100644 --- a/module/project/view/linkstory.html.php +++ b/module/project/view/linkstory.html.php @@ -11,20 +11,24 @@ */ ?> - -
-
- icons['story']);?> - icons['link']);?> project->linkStory;?> + -
- +
+
+ +
- + @@ -43,13 +47,16 @@ id])) continue;?> createLink('story', 'view', "storyID=$story->id");?> - - + - + @@ -64,33 +71,23 @@ - - - - -
idAB;?> +
+ +
+ idAB;?> +
priAB;?> story->product;?> story->module;?>
- - id]", $story->product);?> - id));?> +
+
+ + + id]", $story->product);?> + id);?> +
story->priList, $story->pri, $story->pri)?>'>story->priList, $story->pri, $story->pri);?>pri;?>'>story->priList, $story->pri, $story->pri);?> createLink('product', 'browse', "productID=$story->product&branch=$story->branch"), $products[$story->product]->name, '_blank');?> '>module, '')?> title);?>
' class='text-left'> -
- " . $lang->project->whyNoStories . '
'; - } - ?> - -
+
diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php index 7192d8365f..a2097a84d5 100644 --- a/module/project/view/story.html.php +++ b/module/project/view/story.html.php @@ -133,11 +133,12 @@ id);?> +
- story->priList, $story->pri, $story->pri)?>'>story->priList, $story->pri, $story->pri);?> + pri?>'>story->priList, $story->pri, $story->pri);?> product][$story->branch])) echo "" . $branchGroups[$story->product][$story->branch] . '';?> title, null, "style='color: $story->color'");?> diff --git a/module/project/view/storykanban.html.php b/module/project/view/storykanban.html.php index ce2cafdca7..44ff512d6e 100644 --- a/module/project/view/storykanban.html.php +++ b/module/project/view/storykanban.html.php @@ -11,6 +11,9 @@ project->confirmUnlinkStory)?>