From 378c8309f502cead9fcabc137eacd57db06b33aa Mon Sep 17 00:00:00 2001 From: daitingting Date: Wed, 19 Oct 2022 06:12:05 +0000 Subject: [PATCH] * Finish task #71571. --- module/project/js/manageproducts.js | 23 +++++++++++++++++++++ module/project/view/manageproducts.html.php | 20 +++++++++--------- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/module/project/js/manageproducts.js b/module/project/js/manageproducts.js index a5bc8d8c00..5fb05d3dfc 100644 --- a/module/project/js/manageproducts.js +++ b/module/project/js/manageproducts.js @@ -10,6 +10,29 @@ $(function() { var $cb = $(this); $cb.closest('.product').toggleClass('checked', $cb.prop('checked')); + + var productID = String($cb.val()); + if($.inArray(productID, unmodifiableProducts) != -1) + { + var $branch = $cb.closest('.product').find('[name^=branch]'); + if($branch) + { + var branchID = String($branch.val()); + + console.log(productID); + console.log(unmodifiableMainBranches); + console.log($.inArray(productID, unmodifiableMainBranches)); + + if((branchID == BRANCH_MAIN && unmodifiableMainBranches[productID]) || (branchID != BRANCH_MAIN && $.inArray(branchID, unmodifiableBranches) != -1)) + { + bootbox.alert(unLinkProductTip.replace("%s", branchGroups[productID][branchID])); + } + } + else + { + bootbox.alert(unLinkProductTip.replace("%s", allProducts[productID])); + } + } }); $("select[id^=branch]").change(function() diff --git a/module/project/view/manageproducts.html.php b/module/project/view/manageproducts.html.php index e894e83887..0d47f06f8e 100644 --- a/module/project/view/manageproducts.html.php +++ b/module/project/view/manageproducts.html.php @@ -11,6 +11,13 @@ */ ?> + + + + + + +project->unLinkProductTip);?>