* add the feature of setmenu.

This commit is contained in:
wangchunsheng
2009-12-18 02:25:35 +00:00
parent 8e5bd73214
commit 8706e8ad0b
2 changed files with 13 additions and 2 deletions

View File

@@ -32,6 +32,7 @@ class tree extends control
parent::__construct();
$this->loadModel('product');
$this->loadModel('bug');
$this->loadModel('testcase');
}
/* 设置当前的产品。*/
@@ -59,6 +60,11 @@ class tree extends control
}
elseif($viewType == 'bug')
{
/* 设置菜单。*/
$this->bug->setMenu($this->product->getPairs(), $productID);
$this->lang->tree->menu = $this->lang->bug->menu;
$this->lang->set('menugroup.tree', 'qa');
$header['title'] = $this->lang->tree->manageBug . $this->lang->colon . $product->name;
$position[] = html::a($this->createLink('bug', 'browse', "product=$productID"), $product->name);
$position[] = $this->lang->tree->manageBug;
@@ -66,6 +72,11 @@ class tree extends control
}
elseif($viewType == 'case')
{
/* 设置菜单。*/
$this->testcase->setMenu($this->product->getPairs(), $productID);
$this->lang->tree->menu = $this->lang->testcase->menu;
$this->lang->set('menugroup.tree', 'qa');
$header['title'] = $this->lang->tree->manageCase . $this->lang->colon . $product->name;
$position[] = html::a($this->createLink('testcase', 'browse', "product=$productID"), $product->name);
$position[] = $this->lang->tree->manageCase;

View File

@@ -155,14 +155,14 @@ class treeModel extends model
/* 生成Bug链接。*/
function createBugLink($module)
{
$linkHtml = html::a(helper::createLink('bug', 'browse', "product={$module->product}&type=byModule&param={$module->id}"), $module->name);
$linkHtml = html::a(helper::createLink('bug', 'browse', "product={$module->product}&type=byModule&param={$module->id}"), $module->name, '_self', "id='module{$module->id}'");
return $linkHtml;
}
/* 生成case链接。*/
function createCaseLink($module)
{
$linkHtml = html::a(helper::createLink('testcase', 'browse', "product={$module->product}&type=byModule&param={$module->id}"), $module->name);
$linkHtml = html::a(helper::createLink('testcase', 'browse', "product={$module->product}&type=byModule&param={$module->id}"), $module->name, '_self', "id='module{$module->id}'");
return $linkHtml;
}