diff --git a/module/execution/control.php b/module/execution/control.php index ef26f905ad..0050be1d43 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1594,9 +1594,16 @@ class execution extends control $newPlans = array(); if(isset($_POST['plans'])) { + foreach($_POST['plans'] as $plans) { - foreach($plans as $planID) $newPlans[$planID] = $planID; + foreach($plans as $planList) + { + foreach($planList as $planID) + { + $newPlans[$planID] = $planID; + } + } } } diff --git a/module/execution/js/common.js b/module/execution/js/common.js index 250b57fc8b..9a831597b7 100644 --- a/module/execution/js/common.js +++ b/module/execution/js/common.js @@ -184,12 +184,12 @@ function loadPlans(product, branchID) var branchID = typeof(branchID) == 'undefined' ? 0 : branchID; var index = $(product).attr('id').replace('products', ''); - $.get(createLink('product', 'ajaxGetPlans', "productID=" + productID + '&branch=0,' + branchID + '&planID=0&fieldID&needCreate=&expired=noclosed,' + (config.currentMethod == 'create' ? 'unexpired' : '') + '¶m=skipParent'), function(data) + $.get(createLink('product', 'ajaxGetPlans', "productID=" + productID + '&branch=0,' + branchID + '&planID=0&fieldID&needCreate=&expired=noclosed,unexpired¶m=skipParent,multiple'), function(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(); + $("div#plan" + index).html(data).find('select').attr('name', 'plans[' + productID + '][' + branchID + '][]').attr('id', 'plans' + productID).chosen(); adjustPlanBoxMargin(); } diff --git a/module/execution/model.php b/module/execution/model.php index bb760866c5..fbd5818e4e 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -2023,7 +2023,7 @@ class executionModel extends model $data->project = $executionID; $data->product = $productID; $data->branch = $branch; - $data->plan = isset($plans[$productID][$branch]) ? $plans[$productID][$branch] : $oldPlan; + $data->plan = isset($plans[$productID][$branch]) ? implode(',', $plans[$productID][$branch]) : $oldPlan; $this->dao->insert(TABLE_PROJECTPRODUCT)->data($data)->exec(); $existedProducts[$productID][$branch] = true; } diff --git a/module/execution/view/create.html.php b/module/execution/view/create.html.php index ad142d687e..a38a8e0500 100644 --- a/module/execution/view/create.html.php +++ b/module/execution/view/create.html.php @@ -159,19 +159,19 @@