* Finish task #30261.
This commit is contained in:
@@ -150,11 +150,12 @@ function loadBranches(product)
|
||||
/* When selecting a product, delete a plan that is empty by default. */
|
||||
$("#planDefault").remove();
|
||||
|
||||
var chosenProducts = 0;
|
||||
var chosenProducts = [];
|
||||
$("#productsBox select[name^='products']").each(function()
|
||||
{
|
||||
var $product = $(product);
|
||||
if($(this).val() > 0) chosenProducts ++;
|
||||
var productID = $(this).val();
|
||||
if(productID > 0 && chosenProducts.indexOf(productID) == -1) chosenProducts.push(productID);
|
||||
if($product.val() != 0 && $product.val() == $(this).val() && $product.attr('id') != $(this).attr('id') && !multiBranchProducts[$product.val()])
|
||||
{
|
||||
bootbox.alert(errorSameProducts);
|
||||
@@ -164,7 +165,7 @@ function loadBranches(product)
|
||||
}
|
||||
});
|
||||
|
||||
chosenProducts > 1 ? $('.division').removeClass('hide') : $('.division').addClass('hide');
|
||||
chosenProducts.length > 1 ? $('.division').removeClass('hide') : $('.division').addClass('hide');
|
||||
|
||||
if($('#productsBox .input-group:last select:first').val() != 0)
|
||||
{
|
||||
|
||||
@@ -294,11 +294,12 @@ function loadBranches(product)
|
||||
/* When selecting a product, delete a plan that is empty by default. */
|
||||
$("#planDefault").remove();
|
||||
|
||||
var chosenProducts = 0;
|
||||
var chosenProducts = [];
|
||||
$("#productsBox select[name^='products']").each(function()
|
||||
{
|
||||
var $product = $(product);
|
||||
if($(this).val() > 0) chosenProducts ++;
|
||||
var $product = $(product);
|
||||
var productID = $(this).val();
|
||||
if(productID > 0 && chosenProducts.indexOf(productID) == -1) chosenProducts.push(productID);
|
||||
if($product.val() != 0 && $product.val() == $(this).val() && $product.attr('id') != $(this).attr('id') && !multiBranchProducts[$product.val()])
|
||||
{
|
||||
bootbox.alert(errorSameProducts);
|
||||
@@ -308,7 +309,7 @@ function loadBranches(product)
|
||||
}
|
||||
});
|
||||
|
||||
(chosenProducts > 1 && model == 'waterfall') ? $('.division').removeClass('hide') : $('.division').addClass('hide');
|
||||
(chosenProducts.length > 1 && model == 'waterfall') ? $('.division').removeClass('hide') : $('.division').addClass('hide');
|
||||
|
||||
if($('#productsBox .row .input-group:last select:first').val() != 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user