diff --git a/module/productplan/control.php b/module/productplan/control.php index 8dfb9db960..571973c009 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -89,6 +89,14 @@ class productplan extends control } $this->view->begin = $lastPlan ? $begin : date('Y-m-d'); if($parent) $this->view->parentPlan = $this->productplan->getById($parent); + $branchesPair = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($productID, 'active'); + + /*get default branch*/ + $branchesList = $this->loadModel('branch')->getList($productID); + foreach($branchesList as $branchList) + { + if($branchList->default) $default = $branchList->id; + } $this->view->title = $this->view->product->name . $this->lang->colon . $this->lang->productplan->create; $this->view->position[] = $this->lang->productplan->common; @@ -97,7 +105,8 @@ class productplan extends control $this->view->productID = $productID; $this->view->lastPlan = $lastPlan; $this->view->branch = $branchID; - $this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($productID, 'active'); + $this->view->branches = $branchesPair; + $this->view->default = $default; $this->view->parent = $parent; $this->display(); } diff --git a/module/productplan/view/create.html.php b/module/productplan/view/create.html.php index 7cb4809c12..f779e29e36 100644 --- a/module/productplan/view/create.html.php +++ b/module/productplan/view/create.html.php @@ -22,7 +22,7 @@