*Fix bug#17397

This commit is contained in:
孙华伟
2022-03-22 15:18:08 +08:00
parent 9ab0bd99c8
commit 0816a49ce2
2 changed files with 12 additions and 3 deletions

View File

@@ -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();
}

View File

@@ -22,7 +22,7 @@
<h2> <?php echo $parent ? $lang->productplan->createChildren : $lang->productplan->create;?></h2>
</div>
<form class='load-indicator main-form form-ajax' method='post' target='hiddenwin' id='dataform'>
<table class='table table-form'>
<table class='table table-form'>
<tbody>
<?php if($parent):?>
<tr>
@@ -40,7 +40,7 @@
<?php if($product->type != 'normal'):?>
<tr>
<th><?php echo $lang->product->branch;?></th>
<td><?php echo html::select('branch', $branches, $branch, "class='form-control chosen'");?></td><td></td><td></td>
<td><?php echo html::select('branch', $branches, $default, "class='form-control chosen'");?></td><td></td><td></td>
</tr>
<?php endif;?>
<?php endif;?>