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 @@ -
-
- - - - - -
- testcase->selectProduct;?> - -
-
-
- createLink('testcase', 'browse', "productId=$productID"), $lang->testcase->allCases);?> - createLink('tree', 'browse', "productID=$productID&view=case"), $lang->tree->manageCase);?> -
-
+ +
+
+
+ " . $lang->testcase->moduleCases . " "; + echo "" . html::a($this->createLink('testcase', 'browse', "productid=$productID&type=all¶m=0"), $lang->testcase->allCases) . ""; + ?> +
+
+ testcase->create); ?> +
+
+
+ +
' id='mainbox'> +
' id='treebox'> +
+
+ +
+ tree->manage);?> +
+
-
-
-
    - $productName"; - echo "
  • " . html::a($this->createLink('testcase', 'browse', "productid=$productID&type=byModule¶m=$currentModuleID"), $currentModuleName) . "
  • "; - //echo "
  • " . html::a($this->createLink('testcase', 'browse', "productid=$productID&type=assignToMe"), $lang->testcase->assignToMe) . "
  • "; - //echo "
  • " . html::a($this->createLink('testcase', 'browse', "productid=$productID&type=openedByMe"), $lang->testcase->openedByMe) . "
  • "; - //echo "
  • " . html::a($this->createLink('testcase', 'browse', "productid=$productID&type=resolvedByMe"), $lang->testcase->resolvedByMe) . "
  • "; - //echo "
  • " . html::a($this->createLink('testcase', 'browse', "productid=$productID&type=assignToNull"), $lang->testcase->assignToNull) . "
  • "; - //echo "
  • " . html::a($this->createLink('testcase', 'browse', "productid=$productID&type=longLifeBugs"), $lang->testcase->longLifeBugs) . "
  • "; - //echo "
  • " . html::a($this->createLink('testcase', 'browse', "productid=$productID&type=postponedBugs"), $lang->testcase->postponedBugs) . "
  • "; - echo << -$("#{$type}Tab").addClass('active'); - -EOT; - ?> -
-
- createLink('testcase', 'create', "productID=$productID&moduleID=$currentModuleID"), $lang->testcase->create);?> -
-
- +
- - - - - - + + + + + + + @@ -98,4 +86,8 @@ EOT; + diff --git a/module/testcase/view/create.html.php b/module/testcase/view/create.html.php index fd175b064a..fbdd55fa2f 100644 --- a/module/testcase/view/create.html.php +++ b/module/testcase/view/create.html.php @@ -47,9 +47,9 @@ function loadStory(productID) } -
+
-
testcase->id;?>testcase->pri;?>testcase->title;?>testcase->type;?>testcase->openedBy;?>testcase->status;?>testcase->id);?>testcase->pri);?>testcase->title);?>testcase->type);?>testcase->openedBy);?>testcase->status);?>
+
@@ -78,7 +78,7 @@ function loadStory(productID) - +
testcase->create;?>
testcase->labProductAndModule;?>
diff --git a/module/testcase/view/view.html.php b/module/testcase/view/view.html.php index ff3cc8d941..a5d0a378a4 100644 --- a/module/testcase/view/view.html.php +++ b/module/testcase/view/view.html.php @@ -28,131 +28,122 @@
CASE #id . $lang->colon . $case->title;?>
- createLink('testcase', 'edit', "caseID=$case->id"), $lang->testcase->buttonEdit); - if(common::hasPriv('testcase', 'browse')) echo html::a($this->createLink('testcase', 'browse', "productID=$case->product"), $lang->testcase->buttonToList); - ?> -
-
-
- -
-
- -
-
- testcase->legendBasicInfo;?> - - - - - - - - - - - - - - - - - - - - - - -
testcase->labProductAndModule;?> - arrow; - foreach($modulePath as $key => $module) - { - echo $module->name; - if(isset($modulePath[$key + 1])) echo $lang->arrow; - } - ?> -
testcase->type;?>testcase->typeList[$case->type];?>
testcase->pri;?>pri;?>
testcase->status;?>testcase->statusList[$case->status];?>
testcase->story;?> - storyTitle)) echo html::a($this->createLink('story', 'view', "storyID=$case->story"), "#$case->story:$case->storyTitle"); - ?> -
-
- - - -
- -
-
- testcase->legendOpenInfo;?> - - - - - - - - - -
testcase->openedBy;?>openedBy;?>
testcase->openedDate;?>openedDate;?>
-
- -
- testcase->legendLastInfo;?> - - - - - - - - - -
testcase->lastEditedBy;?>lastEditedBy;?>
testcase->lastEditedDate;?>lastEditedDate;?>
-
- - - -
-
-
- -
-
- testcase->legendAction;?> -
createLink('testcase', 'edit', "caseID=$case->id"), $lang->testcase->buttonEdit); - if(common::hasPriv('testcase', 'browse')) echo html::a($this->createLink('testcase', 'browse', "productID=$case->product"), $lang->testcase->buttonToList); + common::printLink('testcase', 'edit', "caseID=$case->id", $lang->testcase->buttonEdit); + common::printLink('testcase', 'browse', "productID=$case->product", $lang->testcase->buttonToList); ?>
-
+
+
-
- testcase->legendSteps;?> -
- steps);?> +
+
+
+
+ testcase->legendSteps;?> +
+ steps);?> +
+
+ +
+ testcase->legendAction;?> +
+ id", $lang->testcase->buttonEdit); + common::printLink('testcase', 'browse', "productID=$case->product", $lang->testcase->buttonToList); + ?> +
+
-
- +
+
+
+ testcase->legendBasicInfo;?> + + + + + + + + + + + + + + + + + + + + + + +
testcase->labProductAndModule;?> + arrow; + foreach($modulePath as $key => $module) + { + echo $module->name; + if(isset($modulePath[$key + 1])) echo $lang->arrow; + } + ?> +
testcase->type;?>testcase->typeList[$case->type];?>
testcase->pri;?>pri;?>
testcase->status;?>testcase->statusList[$case->status];?>
testcase->story;?> + storyTitle)) echo html::a($this->createLink('story', 'view', "storyID=$case->story"), "#$case->story:$case->storyTitle"); + ?> +
+
+ +
+ testcase->legendOpenInfo;?> + + + + + + + + + +
testcase->openedBy;?>openedBy;?>
testcase->openedDate;?>openedDate;?>
+
+ +
+ testcase->legendLastInfo;?> + + + + + + + + + +
testcase->lastEditedBy;?>lastEditedBy;?>
testcase->lastEditedDate;?>lastEditedDate;?>
+
+ + +
diff --git a/www/js/my.js b/www/js/my.js index 2dc72756d0..8e0c2bb5b1 100644 --- a/www/js/my.js +++ b/www/js/my.js @@ -61,9 +61,20 @@ function setNowrapObjTitle() } /* 选择产品。*/ -function switchProduct(productID) +function switchProduct(productID, type) { - link = createLink('product', 'browse', 'productID=' + productID); + if(type == 'product') + { + link = createLink('product', 'browse', 'productID=' + productID); + } + else if(type == 'bug') + { + link = createLink('bug', 'browse', 'productID=' + productID + '&type=byModule¶m=0'); + } + else if(type == 'case') + { + link = createLink('testcase', 'browse', 'productID=' + productID + '&type=byModule¶m=0'); + } location.href=link; } diff --git a/www/theme/default/style.css b/www/theme/default/style.css index b3df9f0e7c..c776a8f2a0 100644 --- a/www/theme/default/style.css +++ b/www/theme/default/style.css @@ -22,10 +22,10 @@ */ /*-----------------------FIELDSET SETTING----------------------------*/ -fieldset {border:1px solid #e4e4e4; padding:8px; margin-bottom:5px} +fieldset {border:1px solid #e4e4e4; padding:1px 10px 1px 10px; margin-bottom:5px} legend {font-weight:bold; color:darkgreen} -fieldset .table-1 {margin:0} -fieldset tr, fieldset td, fieldset th {border:none; padding:2px 2px 2px 10px} +fieldset .table-1 {margin:0;} +fieldset tr, fieldset td, fieldset th {border:none; padding:2px} del{background:#fcc} ins{background:#cfc; text-decoration:none}