From fb6de8f7e665d05a12a057ea06e4aec8091f6389 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:27:36 +0800 Subject: [PATCH] *Optimize the code. --- module/productplan/control.php | 16 ++++++++-------- module/productplan/view/create.html.php | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/module/productplan/control.php b/module/productplan/control.php index 571973c009..bad56e3b39 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -91,23 +91,23 @@ class productplan extends control if($parent) $this->view->parentPlan = $this->productplan->getById($parent); $branchesPair = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($productID, 'active'); - /*get default branch*/ + /*Get default branch.*/ $branchesList = $this->loadModel('branch')->getList($productID); foreach($branchesList as $branchList) { - if($branchList->default) $default = $branchList->id; + if($branchList->default) $defaultBranch = $branchList->id; } $this->view->title = $this->view->product->name . $this->lang->colon . $this->lang->productplan->create; $this->view->position[] = $this->lang->productplan->common; $this->view->position[] = $this->lang->productplan->create; - $this->view->productID = $productID; - $this->view->lastPlan = $lastPlan; - $this->view->branch = $branchID; - $this->view->branches = $branchesPair; - $this->view->default = $default; - $this->view->parent = $parent; + $this->view->productID = $productID; + $this->view->lastPlan = $lastPlan; + $this->view->branch = $branchID; + $this->view->branches = $branchesPair; + $this->view->defaultBranch = $defaultBranch; + $this->view->parent = $parent; $this->display(); } diff --git a/module/productplan/view/create.html.php b/module/productplan/view/create.html.php index f779e29e36..9bc121ac68 100644 --- a/module/productplan/view/create.html.php +++ b/module/productplan/view/create.html.php @@ -40,7 +40,7 @@ type != 'normal'):?> product->branch;?> - +