diff --git a/module/project/js/create.js b/module/project/js/create.js index 7492954abd..36d67fc765 100644 --- a/module/project/js/create.js +++ b/module/project/js/create.js @@ -265,19 +265,16 @@ function loadPlans(product, branchID) var branchID = typeof(branchID) == 'undefined' ? 0 : branchID; var index = $(product).attr('id').replace('products', ''); - if(productID != 0) + $.get(createLink('product', 'ajaxGetPlans', "productID=" + productID + '&branch=0,' + branchID + '&planID=0&fieldID&needCreate=&expired=unexpired,noclosed¶m=skipParent,multiple'), function(data) { - $.get(createLink('product', 'ajaxGetPlans', "productID=" + productID + '&branch=0,' + branchID + '&planID=0&fieldID&needCreate=&expired=unexpired,noclosed¶m=skipParent,multiple'), function(data) + if(data) { - if(data) - { - if($("div#plan" + index).size() == 0) $("#plansBox .row").append('
'); - $("div#plan" + index).html(data).find('select').attr('name', 'plans[' + productID + '][' + branchID + '][]').attr('id', 'plans' + productID).chosen(); + if($("div#plan" + index).size() == 0) $("#plansBox .row").append('
'); + $("div#plan" + index).html(data).find('select').attr('name', 'plans[' + productID + '][' + branchID + '][]').attr('id', 'plans' + productID).chosen(); - adjustPlanBoxMargin(); - } - }); - } + adjustPlanBoxMargin(); + } + }); } /**