* fix error and adjust build code.
This commit is contained in:
@@ -106,7 +106,8 @@ class build extends control
|
||||
$this->view->position[] = $this->lang->build->edit;
|
||||
$this->view->productGroups = $productGroups;
|
||||
$this->view->products = $products;
|
||||
$this->view->branches = $build->productType == 'normal' ? array() : $this->loadModel('branch')->getPairs($build->product);
|
||||
$this->view->product = isset($productGroups[$build->product]) ? $productGroups[$build->product] : '';
|
||||
$this->view->branches = (isset($productGroups[$build->product]) and $productGroups[$build->product]->type == 'normal') ? array() : $this->loadModel('branch')->getPairs($build->product);
|
||||
$this->view->build = $build;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('nodeleted', $build->builder);
|
||||
$this->view->orderBy = $orderBy;
|
||||
|
||||
@@ -28,7 +28,13 @@
|
||||
<td class='w-p25-f'>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('product', $products, $build->product, "onchange='loadBranches(this.value);' class='form-control chosen'");?>
|
||||
<?php if($build->productType != 'normal') echo html::select('branch', $branches, $build->branch, "class='form-control' style='width:100px'");?>
|
||||
<?php
|
||||
if($build->productType != 'normal')
|
||||
{
|
||||
if($product->branch) $branches = array($product->branch => $branches[$product->branch]);
|
||||
echo html::select('branch', $branches, $build->branch, "class='form-control' style='width:100px'");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</td><td></td>
|
||||
</tr>
|
||||
|
||||
@@ -1134,7 +1134,7 @@ class storyModel extends model
|
||||
*/
|
||||
public function getByField($productID, $branch, $fieldName, $fieldValue, $orderBy, $pager, $operator = 'equal')
|
||||
{
|
||||
if(!$this->loadModel('common')->checkField(TABLE_STORY, $type)) return array();
|
||||
if(!$this->loadModel('common')->checkField(TABLE_STORY, $fieldName)) return array();
|
||||
$stories = $this->dao->select('*')->from(TABLE_STORY)
|
||||
->where('product')->in($productID)
|
||||
->andWhere('deleted')->eq(0)
|
||||
|
||||
Reference in New Issue
Block a user