diff --git a/module/product/model.php b/module/product/model.php index b52a5d8feb..ca0becc4bb 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -28,7 +28,7 @@ class productModel extends model /* ÉèÖò˵¥¡£*/ public function setMenu($products, $productID) { - $selectHtml = html::select('productID', $products, $productID, 'onchange="switchProduct(this.value);"'); + $selectHtml = html::select('productID', $products, $productID, "onchange=\"switchProduct(this.value, 'product');\""); common::setMenuVars($this->lang->product->menu, 'list', $selectHtml . $this->lang->arrow); common::setMenuVars($this->lang->product->menu, 'story', $productID); common::setMenuVars($this->lang->product->menu, 'edit', $productID); diff --git a/module/testcase/control.php b/module/testcase/control.php index 543b9293ab..d3bf0c69f9 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -50,22 +50,19 @@ class testcase extends control $productID = (int)$productID; if($productID == 0) $productID = key($this->products); - $currentModuleID = ($type == 'byModule') ? (int)$param : 0; - if($currentModuleID == 0) - { - $currentModuleName = $this->lang->testcase->allCases; - } - else - { - $currentModule = $this->tree->getById($currentModuleID); - $currentModuleName = sprintf($this->lang->testcase->moduleCases, $currentModule->name); - } + /* 设置菜单。*/ + $this->testcase->setMenu($this->products, $productID); - if($type == "byModule") + /* 设置模块ID。*/ + $type = strtolower($type); + $moduleID = ($type == 'bymodule') ? (int)$param : 0; + + /* 如果是按照模块查找,或者列出所有。*/ + if($type == 'bymodule' or $type == 'all') { $this->app->loadClass('pager', $static = true); $pager = pager::init($recTotal, $recPerPage, $pageID); - $childModuleIds = $this->tree->getAllChildId($currentModuleID); + $childModuleIds = $this->tree->getAllChildId($moduleID); $cases = $this->testcase->getModuleCases($productID, $childModuleIds, $orderBy, $pager); } @@ -82,8 +79,11 @@ class testcase extends control $this->assign('cases', $cases); $this->assign('pager', $pager->get()); $this->assign('users', $this->user->getPairs($this->app->company->id, 'noletter')); - $this->assign('currentModuleID', $currentModuleID); - $this->assign('currentModuleName', $currentModuleName); + $this->assign('moduleID', $moduleID); + $this->assign('param', $param); + $this->assign('recTotal', $pager->recTotal); + $this->assign('recPerPage', $pager->recPerPage); + $this->assign('orderBy', $orderBy); $this->display(); } @@ -105,6 +105,9 @@ class testcase extends control $productID = common::saveProductState($productID, key($this->products)); $currentModuleID = (int)$moduleID; + /* 设置菜单。*/ + $this->testcase->setMenu($this->products, $productID); + $header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->create; $position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]); $position[] = $this->lang->testcase->create; @@ -132,6 +135,9 @@ class testcase extends control $position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]); $position[] = $this->lang->testcase->view; + /* 设置菜单。*/ + $this->testcase->setMenu($this->products, $productID); + $users = $this->user->getPairs($this->app->company->id, 'noletter'); $actions = $this->action->getList('case', $caseID); @@ -173,6 +179,9 @@ class testcase extends control $position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]); $position[] = $this->lang->testcase->edit; + /* 设置菜单。*/ + $this->testcase->setMenu($this->products, $productID); + $users = $this->user->getPairs($this->app->company->id); $this->assign('header', $header); $this->assign('position', $position); diff --git a/module/testcase/lang/zh-cn.php b/module/testcase/lang/zh-cn.php index 964cc2c357..9cffdd5eea 100644 --- a/module/testcase/lang/zh-cn.php +++ b/module/testcase/lang/zh-cn.php @@ -21,6 +21,27 @@ * @version $Id$ * @link http://www.zentao.cn */ +$lang->testcase->id = '用例编号'; +$lang->testcase->product = '所属产品'; +$lang->testcase->module = '所属模块'; +$lang->testcase->story = '相关需求'; +$lang->testcase->title = '用例标题'; +$lang->testcase->pri = '优 先 级'; +$lang->testcase->type = '用例类型'; +$lang->testcase->status = '用例状态'; +$lang->testcase->steps = '用例步骤'; +$lang->testcase->frequency = '执行频率'; +$lang->testcase->order = '排序'; +$lang->testcase->openedBy = '由谁创建 '; +$lang->testcase->openedDate = '创建日期'; +$lang->testcase->lastEditedBy = '最后修改者'; +$lang->testcase->lastEditedDate = '最后修改日期'; +$lang->testcase->field1 = '字段一'; +$lang->testcase->field2 = '字段二'; +$lang->testcase->feidl3 = '字段三'; +$lang->testcase->version = '用例版本'; +$lang->case = $lang->testcase; // 用于DAO检查时使用。因为case是系统关键字,所以无法定义该模块为case,只能使用testcase,但表还是使用的case。 + $lang->testcase->common = '用例管理'; $lang->testcase->index = "用例管理首页"; $lang->testcase->create = "创建用例"; @@ -34,7 +55,7 @@ $lang->testcase->byModule = '按模块'; $lang->testcase->assignToMe = '指派给我'; $lang->testcase->openedByMe = '由我创建'; $lang->testcase->allCases = '所有Case'; -$lang->testcase->moduleCases = '%s'; +$lang->testcase->moduleCases = '按模块浏览'; $lang->testcase->labProductAndModule = '产品模块'; $lang->testcase->labTypeAndPri = '类型&优先级'; @@ -56,12 +77,6 @@ $lang->testcase->legendAction = '操作'; $lang->testcase->legendHistory = '历史记录'; $lang->testcase->legendComment = '备注'; -$lang->testcase->buttonEdit = '编辑'; -$lang->testcase->buttonActivate = '激活'; -$lang->testcase->buttonResolve = '解决'; -$lang->testcase->buttonClose = '关闭'; -$lang->testcase->buttonToList = '返回列表'; - $lang->testcase->priList[3] = 3; $lang->testcase->priList[1] = 1; $lang->testcase->priList[2] = 2; @@ -94,30 +109,6 @@ $lang->testcase->typeList['performance'] = '性能测试'; $lang->testcase->statusList['normal'] = '正常'; $lang->testcase->statusList['blocked'] = 'Blocked'; -$lang->testcase->resolutionList->bydesign = 'By Design'; -$lang->testcase->resolutionList->duplicate = 'Duplicate'; -$lang->testcase->resolutionList->external = 'External'; -$lang->testcase->resolutionList->fixed = 'Fixed'; -$lang->testcase->resolutionList->notrepro = 'Not Repro'; -$lang->testcase->resolutionList->postponed = 'Postponed'; -$lang->testcase->resolutionList->willnotfix = "Won not Fix"; -$lang->testcase->id = '用例编号'; -$lang->testcase->product = '所属产品'; -$lang->testcase->module = '所属模块'; -$lang->testcase->story = '相关需求'; -$lang->testcase->title = '用例标题'; -$lang->testcase->pri = '优 先 级'; -$lang->testcase->type = '用例类型'; -$lang->testcase->status = '用例状态'; -$lang->testcase->steps = '用例步骤'; -$lang->testcase->frequency = '执行频率'; -$lang->testcase->order = '排序'; -$lang->testcase->openedBy = '由谁创建 '; -$lang->testcase->openedDate = '创建日期'; -$lang->testcase->lastEditedBy = '最后修改者'; -$lang->testcase->lastEditedDate = '最后修改日期'; -$lang->testcase->field1 = '字段一'; -$lang->testcase->field2 = '字段二'; -$lang->testcase->feidl3 = '字段三'; -$lang->testcase->version = '用例版本'; +$lang->testcase->buttonEdit = '编辑'; +$lang->testcase->buttonToList = '返回'; diff --git a/module/testcase/model.php b/module/testcase/model.php index 258f432a1a..824c41e501 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -25,6 +25,13 @@ lang->testcase->menu, 'product', $selectHtml . $this->lang->arrow); + } + /* 创建一个Case。*/ function create() { diff --git a/module/testcase/view/browse.html.php b/module/testcase/view/browse.html.php index 0bdba71544..7128c12bc2 100644 --- a/module/testcase/view/browse.html.php +++ b/module/testcase/view/browse.html.php @@ -25,63 +25,51 @@ -
|
-
-
- createLink('testcase', 'browse', "productId=$productID"), $lang->testcase->allCases);?>
- createLink('tree', 'browse', "productID=$productID&view=case"), $lang->tree->manageCase);?>
-
- |
-
| testcase->id;?> | -testcase->pri;?> | -testcase->title;?> | -testcase->type;?> | -testcase->openedBy;?> | -testcase->status;?> | + +testcase->id);?> | +testcase->pri);?> | +testcase->title);?> | +testcase->type);?> | +testcase->openedBy);?> | +testcase->status);?> |
|---|---|---|---|---|---|---|---|---|---|---|---|