@@ -134,7 +135,7 @@ - +
custom->defaultProgram;?>
diff --git a/module/execution/js/edit.js b/module/execution/js/edit.js index c27b7316bb..78d040216c 100644 --- a/module/execution/js/edit.js +++ b/module/execution/js/edit.js @@ -41,7 +41,7 @@ $(function() { var current = $(this).val(); var last = $(this).attr('data-last'); - var lastBranch = $(this).attr('data-lastBranch'); + var lastBranch = $(this).attr('data-lastBranch') !== undefined ? $(this).attr('data-lastBranch') : 0; $(this).attr('data-last', current); @@ -58,7 +58,7 @@ $(function() if(current != last && $.inArray(last, unmodifiableProducts) != -1) { - if(lastBranch) + if(lastBranch != 0) { if($.inArray(lastBranch, unmodifiableBranches) != -1) { diff --git a/module/project/js/edit.js b/module/project/js/edit.js index ae82eacb69..4af7b3cf8e 100644 --- a/module/project/js/edit.js +++ b/module/project/js/edit.js @@ -43,8 +43,8 @@ $(function() $(this).attr('data-last', current); - var $branch = $(this).closest('.has-branch').find("[name^='branch']"); - if($branch !== undefined) + var $branch = $(this).closest('.has-branch').find("[name^='branch']"); + if($branch.length) { var branchID = $branch.val(); $(this).attr('data-lastBranch', branchID); @@ -56,15 +56,9 @@ $(function() if(current != last && $.inArray(last, unmodifiableProducts) != -1) { - if(lastBranch) + if(lastBranch != 0) { - if($.inArray(lastBranch, unmodifiableBranches) != -1) - { - if((lastBranch == 0 && unmodifiableMainBranches[last]) || lastBranch != 0) - { - bootbox.alert(unLinkProductTip.replace("%s", allProducts[last])); - } - } + if($.inArray(lastBranch, unmodifiableBranches) != -1) bootbox.alert(unLinkProductTip.replace("%s", allProducts[last] + branchGroups[last][lastBranch])); } else {