diff --git a/module/productplan/control.php b/module/productplan/control.php index a1af2406bf..ab9fa46539 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -149,24 +149,7 @@ class productplan extends control */ public function batchEdit($productID, $branch = 0) { - if(isset($_POST['planIDList'])) - { - $this->commonAction($productID, $branch); - $this->view->title = $this->lang->productplan->batchEdit; - $this->view->position[] = html::a(inlink('browse', "productID=$productID&branch=$branch"), $this->lang->productplan->common); - $this->view->position[] = $this->lang->productplan->batchEdit; - - $plans = $this->productplan->getByIDList($this->post->planIDList); - $product = $this->loadModel('product')->getById($productID); - $oldBranch = array(); - foreach($plans as $plan) $oldBranch[$plan->id] = $plan->branch; - - $this->view->plans = $plans; - $this->view->oldBranch = $oldBranch; - $this->view->branchProduct = $product->type == 'normal' ? false : true; - die($this->display()); - } - elseif($_POST) + if(!empty($_POST['title'])) { $changes = $this->productplan->batchUpdate($productID); $this->syncStory($changes); @@ -176,10 +159,26 @@ class productplan extends control $actionID = $this->action->create('productplan', $planID, 'Edited'); $this->action->logHistory($actionID, $change); } + $this->loadModel('score')->create('ajax', 'batchOther'); die(js::locate(inlink('browse', "productID=$productID&branch=$branch"), 'parent')); } - die(js::locate('back')); + + $planIDList = $this->post->planIDList ? $this->post->planIDList : die(js::locate($this->session->productPlanList, 'parent')); + + $this->commonAction($productID, $branch); + + $plans = $this->productplan->getByIDList($planIDList); + $oldBranch = array(); + + foreach($plans as $plan) $oldBranch[$plan->id] = $plan->branch; + + $this->view->title = $this->lang->productplan->batchEdit; + $this->view->plans = $plans; + $this->view->oldBranch = $oldBranch; + $this->view->product = $this->loadModel('product')->getById($productID);; + + $this->display(); } /** diff --git a/module/productplan/view/batchedit.html.php b/module/productplan/view/batchedit.html.php index a9693db645..e4f6bdda05 100644 --- a/module/productplan/view/batchedit.html.php +++ b/module/productplan/view/batchedit.html.php @@ -22,11 +22,10 @@ productplan->id?> - + type != 'normal'):?> productplan->branch;?> productplan->title?> - productplan->desc?> productplan->status?> productplan->begin?> productplan->end?> @@ -42,14 +41,13 @@ begin == '2030-01-01' || $plan->end == '2030-01-01') ? 'checked="checked"' : '';?> id . html::hidden("id[$plan->id]", $plan->id);?> - + type != 'normal'):?> parent == '-1' ? "disabled='disabled'" : '';?> id]", $plan->parent == '-1' ? '' : $branchTagOption, $plan->branch, "onchange='getConflictStories($plan->id, this.value); 'class='form-control chosen' $disabled");?> id]", $plan->title, "class='form-control' required")?> - id]", $plan->desc, "class='form-control' rows='1'")?> parent != -1):?> id]", array_slice($lang->productplan->statusList,($plan->status == 'wait' ? 0 : 1)), $plan->status, "class='form-control chosen' onchange='setPlanStatus($plan->id, this.value)'");?>