diff --git a/module/execution/control.php b/module/execution/control.php index 6d37712eb2..cb8958f3a0 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2208,7 +2208,7 @@ class execution extends control $position[] = html::a($browseExecutionLink, $execution->name); $position[] = $this->lang->execution->manageProducts; - $allProducts = $this->product->getProductPairsByProject($execution->project); + $allProducts = $this->config->systemMode == 'classic' ? $this->product->getPairs('noclosed') : $this->product->getProductPairsByProject($execution->project); $linkedProducts = $this->execution->getProducts($execution->id); $linkedBranches = array(); diff --git a/module/product/model.php b/module/product/model.php index 7056487406..d8cbd1a802 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -305,7 +305,7 @@ class productModel extends model */ public function getProductPairsByProject($projectID = 0, $status = 'all') { - $products = (empty($projectID) or $this->config->systemMode == 'classic') ? $this->getList() : $this->getProducts($projectID, $status); + $products = empty($projectID) ? $this->getList() : $this->getProducts($projectID, $status); $pairs = array(); if(!empty($products)) { diff --git a/module/upgrade/js/mergeprogram.js b/module/upgrade/js/mergeprogram.js index f8da5642e8..bca3b659dc 100644 --- a/module/upgrade/js/mergeprogram.js +++ b/module/upgrade/js/mergeprogram.js @@ -8,7 +8,7 @@ $(function() { $('[data-id=' + e.id + ']').prop('checked', true); - var lineID = $('.nav li.active').attr('lineid'); + var lineID = $('.nav li.currentPage').attr('lineid'); var checkedLines = true; var checkedProduct = true; var checkedProject = true; @@ -19,7 +19,7 @@ $(function() { if($('.nav li.currentPage').find('[id^=productLines]').prop('checked')) { - var lineID = $('.nav li.active').attr('lineid'); + var lineID = $('.nav li.currentPage').attr('lineid'); $('#checkAllProducts').prop('checked', true); $('#checkAllProjects').prop('checked', true); $("[id^='products\[" + lineID + "\]']").prop('checked', true); @@ -118,6 +118,7 @@ $(function() $('[name^=products]').prop('checked', true); $('[name^=sprints]').prop('checked', true); $('.main-row .side-col .nav li').addClass('active'); + $('#programName').val($('.main-row .side-col .nav li.currentPage div a').text()); } else { @@ -127,6 +128,7 @@ $(function() $('[name^=products]').prop('checked', false); $('[name^=sprints]').prop('checked', false); $('.main-row .side-col .nav li').removeClass('active'); + $('#programName').val(''); } /* If the project is checked, the relevant form will be displayed according to the selected mode. */ @@ -136,13 +138,14 @@ $(function() /* Select all product events. */ $('#checkAllProducts').click(function() { - var lineID = $('li.active').attr('lineid'); + var lineID = $('li.currentPage').attr('lineid'); if($(this).is(':checked')) { $("[id^='productLines\[" + lineID + "\]']").prop('checked', true); $('#checkAllProjects').prop('checked', true); $('[name^=products]').prop('checked', true); $('[name^=sprints]').prop('checked', true); + $('#programName').val($('.main-row .side-col .nav li.currentPage div a').text()); } else { @@ -150,6 +153,7 @@ $(function() $('#checkAllProjects').prop('checked', false); $('[name^=products]').prop('checked', false); $('[name^=sprints]').prop('checked', false); + $('#programName').val(''); } hiddenProject(); }) @@ -157,13 +161,14 @@ $(function() /* Select all project events. */ $('#checkAllProjects').click(function() { - var lineID = $('li.active').attr('lineid'); + var lineID = $('li.currentPage').attr('lineid'); if($(this).is(':checked')) { $("[id^='productLines\[" + lineID + "\]']").prop('checked', true); $('#checkAllProducts').prop('checked', true); $('[name^=products]').prop('checked', true); $('[name^=sprints]').prop('checked', true); + $('#programName').val($('.main-row .side-col .nav li.currentPage div a').text()); } else { @@ -171,6 +176,7 @@ $(function() $('#checkAllProducts').prop('checked', false); $('[name^=products]').prop('checked', false); $('[name^=sprints]').prop('checked', false); + $('#programName').val(''); } hiddenProject(); }) @@ -266,11 +272,12 @@ $(function() } var currentLine = $(this).closest('li').attr('lineid'); - $(this).closest('ul').find('li').removeClass('currentPage'); - $(this).closest('li').addClass('currentPage'); /* Active current li and remove active before li. */ $(this).closest('li').addClass('active'); + $(this).closest('ul').find('li').removeClass('currentPage'); + $(this).closest('li').addClass('currentPage'); + $('[id^=productLines]').each(function() { var lineID = $(this).val();