From 0816a49ce2b5676120a60ddbf3fb8166c27923a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=8D=8E=E4=BC=9F?= Date: Tue, 22 Mar 2022 15:18:08 +0800 Subject: [PATCH] *Fix bug#17397 --- module/productplan/control.php | 11 ++++++++++- module/productplan/view/create.html.php | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) 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 @@

productplan->createChildren : $lang->productplan->create;?>

- +
@@ -40,7 +40,7 @@ type != 'normal'):?> - +
product->branch;?>