+ Add branch menu of product.
This commit is contained in:
@@ -20,11 +20,7 @@ class branch extends control
|
||||
*/
|
||||
public function manage($productID)
|
||||
{
|
||||
$this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID);
|
||||
|
||||
$moduleIndex = array_search('branch', $this->lang->noMenuModule);
|
||||
if($moduleIndex !== false) unset($this->lang->noMenuModule[$moduleIndex]);
|
||||
$this->lang->branch->menu = $this->lang->product->setMenu;
|
||||
$this->loadModel('product')->setMenu($productID);
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
@@ -33,8 +29,6 @@ class branch extends control
|
||||
}
|
||||
|
||||
$products = $this->loadModel('product')->getPairs('nocode');
|
||||
$this->product->setMenu($products, $productID);
|
||||
|
||||
$position[] = html::a($this->createLink('product', 'browse', "productID=$productID"), zget($products, $productID));
|
||||
$position[] = $this->lang->branch->manage;
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ $lang->product->menuOrder[65] = 'all';
|
||||
$lang->product->menu->settings['subMenu'] = new stdclass();
|
||||
$lang->product->menu->settings['subMenu']->view = array('link' => "{$lang->overview}|product|view|productID=%s", 'alias' => 'edit');
|
||||
$lang->product->menu->settings['subMenu']->module = array('link' => "{$lang->module}|tree|browse|product=%s&view=story", 'subModule' => 'tree');
|
||||
// $lang->product->menu->settings['subMenu']->branch = array('link' => "@branch@|branch|manage|product=%s", 'subModule' => 'branch');
|
||||
$lang->product->menu->settings['subMenu']->branch = array('link' => "@branch@|branch|manage|product=%s", 'subModule' => 'branch');
|
||||
$lang->product->menu->settings['subMenu']->whitelist = array('link' => "{$lang->whitelist}|product|whitelist|product=%s", 'subModule' => 'personnel');
|
||||
|
||||
$lang->product->dividerMenu = $config->URAndSR ? ',requirement,set,' : ',track,set,';
|
||||
|
||||
@@ -1685,5 +1685,15 @@ class productModel extends model
|
||||
$this->lang->switcherMenu = $this->getSwitcher($productID, $extra, $branch);
|
||||
$params = array('branch' => $branch);
|
||||
common::setMenuVars('product', $productID, $params);
|
||||
|
||||
if($product->type == 'normal')
|
||||
{
|
||||
unset($this->lang->product->menu->settings['subMenu']->branch);
|
||||
}
|
||||
else
|
||||
{
|
||||
$branchLink = $this->lang->product->menu->settings['subMenu']->branch['link'];
|
||||
$this->lang->product->menu->settings['subMenu']->branch['link'] = str_replace('@branch@', $this->lang->product->branchName[$product->type], $branchLink);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user