* Modify code logic.
This commit is contained in:
@@ -64,13 +64,13 @@ class branch extends control
|
||||
public function ajaxGetDropMenu($productID, $branch = 0, $module, $method, $extra = '')
|
||||
{
|
||||
$branches = $this->branch->getPairs($productID, 'all');
|
||||
$this->view->link = $this->loadModel('product')->getProductLink($module, $method, $extra, true);
|
||||
$this->view->productID = $productID;
|
||||
$this->view->projectID = $this->session->project;
|
||||
$this->view->module = $module;
|
||||
$this->view->method = $method;
|
||||
$this->view->extra = $extra;
|
||||
|
||||
$this->view->link = $this->loadModel('product')->getProductLink($module, $method, $extra, true);
|
||||
$this->view->productID = $productID;
|
||||
$this->view->projectID = $this->session->project;
|
||||
$this->view->module = $module;
|
||||
$this->view->method = $method;
|
||||
$this->view->extra = $extra;
|
||||
$this->view->branches = $branches;
|
||||
$this->view->currentBranchID = $branch;
|
||||
$this->view->branchesPinyin = common::convert2Pinyin($branches);
|
||||
|
||||
@@ -40,9 +40,6 @@ class branchModel extends model
|
||||
*/
|
||||
public function getPairs($productID, $params = '')
|
||||
{
|
||||
$product = $this->loadModel('product')->getById($productID);
|
||||
if(!$product or $product->type == 'normal') return array();
|
||||
|
||||
$branches = $this->dao->select('*')->from(TABLE_BRANCH)
|
||||
->where('deleted')->eq(0)
|
||||
->beginIF($productID)->andWhere('product')->eq($productID)->fi()
|
||||
@@ -52,6 +49,8 @@ class branchModel extends model
|
||||
|
||||
if(strpos($params, 'noempty') === false)
|
||||
{
|
||||
$product = $this->loadModel('product')->getById($productID);
|
||||
if(!$product or $product->type == 'normal') return array();
|
||||
$branches = array('0' => $this->lang->branch->main) + $branches;
|
||||
}
|
||||
|
||||
|
||||
@@ -413,8 +413,8 @@ class productplan extends control
|
||||
else
|
||||
{
|
||||
$this->config->product->search['fields']['branch'] = $this->lang->product->branch;
|
||||
$branches = array('' => '', '0' => $this->lang->branch->main) + $this->loadModel('branch')->getPairs($plan->product, 'noempty');
|
||||
if($plan->branch) $branches = array('' => '', '0' => $this->lang->branch->main, $plan->branch => $branches[$plan->branch]);
|
||||
$branches = array('' => '', $this->loadModel('branch')->getPairs($plan->product);
|
||||
if($plan->branch) $branches = array('' => '', $plan->branch => $branches[$plan->branch]);
|
||||
$this->config->product->search['params']['branch']['values'] = $branches;
|
||||
}
|
||||
$this->loadModel('search')->setSearchParams($this->config->product->search);
|
||||
@@ -554,8 +554,8 @@ class productplan extends control
|
||||
else
|
||||
{
|
||||
$this->config->bug->search['fields']['branch'] = $this->lang->product->branch;
|
||||
$branches = array('' => '', '0' => $this->lang->branch->main) + $this->loadModel('branch')->getPairs($productID, 'noempty');
|
||||
if($plan->branch) $branches = array('' => '', '0' => $this->lang->branch->main, $plan->branch => $branches[$plan->branch]);
|
||||
$branches = array('' => '') + $this->loadModel('branch')->getPairs($productID);
|
||||
if($plan->branch) $branches = array('' => '', $plan->branch => $branches[$plan->branch]);
|
||||
$this->config->bug->search['params']['branch']['values'] = $branches;
|
||||
}
|
||||
$this->loadModel('search')->setSearchParams($this->config->bug->search);
|
||||
|
||||
@@ -306,7 +306,7 @@ class story extends control
|
||||
$this->view->users = $users;
|
||||
$this->view->moduleID = $moduleID ? $moduleID : (int)$this->cookie->lastStoryModule;
|
||||
$this->view->moduleOptionMenu = $moduleOptionMenu;
|
||||
$this->view->plans = $this->loadModel('productplan')->getPairsForStory($productID, $branch);
|
||||
$this->view->plans = $this->loadModel('productplan')->getPairsForStory($productID, $branch, true);
|
||||
$this->view->planID = $planID;
|
||||
$this->view->source = $source;
|
||||
$this->view->sourceNote = $sourceNote;
|
||||
@@ -626,7 +626,7 @@ class story extends control
|
||||
$this->view->stories = $stories;
|
||||
$this->view->users = $users;
|
||||
$this->view->product = $product;
|
||||
$this->view->plans = $this->loadModel('productplan')->getPairsForStory($story->product, $story->branch);
|
||||
$this->view->plans = $this->loadModel('productplan')->getPairsForStory($story->product, $story->branch, true);
|
||||
$this->view->products = $myProducts + $othersProducts;
|
||||
$this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($story->product);
|
||||
$this->view->reviewers = implode(',', $reviewerList);
|
||||
|
||||
@@ -108,10 +108,7 @@ foreach(explode(',', $showFields) as $field)
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($plans as $branchPlan)
|
||||
{
|
||||
$productPlans += $branchPlan;
|
||||
}
|
||||
foreach($plans as $branchPlan) $productPlans += $branchPlan;
|
||||
}
|
||||
?>
|
||||
<?php if($this->session->currentProductType == 'normal') $productPlans = array('' => '', 'ditto' => $this->lang->story->ditto) + $productPlans;?>
|
||||
|
||||
Reference in New Issue
Block a user