From 8e5bd732141744d917dfe41fa2b270b0e7b75053 Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Fri, 18 Dec 2009 02:24:28 +0000 Subject: [PATCH] * adjust the UI. --- trunk/module/bug/control.php | 45 ++-- trunk/module/bug/lang/zh-cn.php | 22 +- trunk/module/bug/model.php | 9 +- trunk/module/bug/view/browse.html.php | 135 +++++------ trunk/module/bug/view/view.html.php | 327 ++++++++++++-------------- 5 files changed, 262 insertions(+), 276 deletions(-) diff --git a/trunk/module/bug/control.php b/trunk/module/bug/control.php index 98a34d5297..a171f374c5 100644 --- a/trunk/module/bug/control.php +++ b/trunk/module/bug/control.php @@ -55,25 +55,23 @@ class bug extends control $type = strtolower($type); $this->session->set('bugList', $this->app->getURI(true)); - $productID = common::saveProductState($productID, key($this->products)); - $currentModuleID = ($type == 'bymodule') ? (int)$param : 0; - if($currentModuleID == 0) - { - $currentModuleName = $this->lang->bug->allBugs; - } - else - { - $currentModule = $this->tree->getById($currentModuleID); - $currentModuleName = sprintf($this->lang->bug->moduleBugs, $currentModule->name); - } + $productID = common::saveProductState($productID, key($this->products)); + $moduleID = ($type == 'bymodule') ? (int)$param : 0; + + /* 设置菜单。*/ + $this->bug->setMenu($this->products, $productID); $this->app->loadClass('pager', $static = true); $pager = pager::init($recTotal, $recPerPage, $pageID); $bugs = array(); - if($type == "bymodule") + if($type == 'all') { - $childModuleIds = $this->tree->getAllChildId($currentModuleID); + $bugs = $this->dao->select('*')->from(TABLE_BUG)->where('product')->eq($productID)->orderBy($orderBy)->page($pager)->fetchAll(); + } + elseif($type == "bymodule") + { + $childModuleIds = $this->tree->getAllChildId($moduleID); $bugs = $this->bug->getModuleBugs($productID, $childModuleIds, $orderBy, $pager); } elseif($type == 'assigntome') @@ -125,8 +123,7 @@ class bug extends control $this->assign('pager', $pager->get()); $this->assign('param', $param); $this->assign('orderBy', $orderBy); - $this->assign('currentModuleID', $currentModuleID); - $this->assign('currentModuleName', $currentModuleName); + $this->assign('moduleID', $moduleID); $this->display(); } @@ -148,6 +145,9 @@ class bug extends control $productID = common::saveProductState($productID, key($this->products)); $currentModuleID = (int)$moduleID; + /* 设置菜单。*/ + $this->bug->setMenu($this->products, $productID); + $header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->bug->create; $position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); $position[] = $this->lang->bug->create; @@ -170,6 +170,9 @@ class bug extends control $bug = $this->bug->getById($bugID); $productID = $bug->product; $productName = $this->products[$productID]; + + /* 设置菜单。*/ + $this->bug->setMenu($this->products, $productID); $header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->bug->view; $position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $productName); @@ -218,6 +221,9 @@ class bug extends control $position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); $position[] = $this->lang->bug->edit; + /* 设置菜单。*/ + $this->bug->setMenu($this->products, $productID); + $projects = $this->product->getProjectPairs($bug->product); $stories = $bug->project ? $this->story->getProjectStoryPairs($bug->project) : $this->story->getProductStoryPairs($bug->product); $tasks = $this->task->getProjectTaskPairs($bug->project); @@ -262,6 +268,9 @@ class bug extends control $position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); $position[] = $this->lang->bug->resolve; + /* 设置菜单。*/ + $this->bug->setMenu($this->products, $productID); + $users = $this->user->getPairs($this->app->company->id); $this->assign('header', $header); $this->assign('position', $position); @@ -289,6 +298,9 @@ class bug extends control $productID = $bug->product; $users = $this->user->getPairs($this->app->company->id); + /* 设置菜单。*/ + $this->bug->setMenu($this->products, $productID); + $header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->bug->activate; $position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); $position[] = $this->lang->bug->activate; @@ -317,6 +329,9 @@ class bug extends control $bug = $this->bug->getById($bugID); $productID = $bug->product; + /* 设置菜单。*/ + $this->bug->setMenu($this->products, $productID); + $header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->bug->activate; $position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); $position[] = $this->lang->bug->activate; diff --git a/trunk/module/bug/lang/zh-cn.php b/trunk/module/bug/lang/zh-cn.php index 8bbef96c3f..0becf2b1d7 100644 --- a/trunk/module/bug/lang/zh-cn.php +++ b/trunk/module/bug/lang/zh-cn.php @@ -41,16 +41,19 @@ $lang->bug->assignToNull = '未指派'; $lang->bug->longLifeBugs = '久未处理'; $lang->bug->postponedBugs = '被延期'; $lang->bug->allBugs = '所有Bug'; -$lang->bug->moduleBugs = '%s'; +$lang->bug->moduleBugs = '按模块浏览'; +$lang->bug->byQuery = '搜索'; -$lang->bug->labProductAndModule = '所属产品::模块'; -$lang->bug->labProjectAndTask = '相关项目::任务'; +$lang->bug->labProductAndModule = '产品模块'; +$lang->bug->labProjectAndTask = '项目任务'; $lang->bug->labStory = '相关需求'; $lang->bug->labBuild = '程序编译版本'; -$lang->bug->labTypeAndSeverity = '类型::严重程度'; -$lang->bug->labSystemBrowserAndHardware = '系统::浏览器'; -$lang->bug->labAssignedTo = '指派给'; +$lang->bug->labTypeAndSeverity = '类型/严重程度'; +$lang->bug->labSystemBrowserAndHardware = '系统/浏览器'; +$lang->bug->labAssignedTo = '当前指派'; $lang->bug->labMailto = '抄送给'; +$lang->bug->labLastEdited = '最后修改'; +$lang->bug->labResolved = '由谁解决'; $lang->bug->confirmChangeProduct = '修改产品会导致相应的项目、需求和任务发生变化,确定吗?'; @@ -62,12 +65,13 @@ $lang->bug->legendLinkBugs = '相关Bug'; $lang->bug->legendOpenInfo = '创建信息'; $lang->bug->legendResolveInfo = '解决信息'; $lang->bug->legendCloseInfo = '关闭信息'; -$lang->bug->legendPrjStoryTask= '项目::需求::任务'; +$lang->bug->legendPrjStoryTask= '项目/需求/任务'; $lang->bug->legendCases = '相关用例'; $lang->bug->legendSteps = '重现步骤'; $lang->bug->legendAction = '操作'; $lang->bug->legendHistory = '历史记录'; $lang->bug->legendComment = '备注'; +$lang->bug->legendLife = 'BUG的一生'; $lang->bug->buttonEdit = '编辑'; $lang->bug->buttonActivate = '激活'; @@ -140,12 +144,12 @@ $lang->bug->status = 'Bug状态'; $lang->bug->mailto = '抄送给'; $lang->bug->openedBy = '由谁创建'; $lang->bug->openedDate = '创建日期'; -$lang->bug->openedBuild = '创建Build'; +$lang->bug->openedBuild = '创建版本'; $lang->bug->assignedTo = '指派给'; $lang->bug->assignedDate = '指派日期'; $lang->bug->resolvedBy = '解决者'; $lang->bug->resolution = '解决方案'; -$lang->bug->resolvedBuild = '解决Build'; +$lang->bug->resolvedBuild = '解决版本'; $lang->bug->resolvedDate = '解决日期'; $lang->bug->closedBy = '由谁关闭'; $lang->bug->closedDate = '关闭日期'; diff --git a/trunk/module/bug/model.php b/trunk/module/bug/model.php index fd1ac96adf..85f65f6536 100644 --- a/trunk/module/bug/model.php +++ b/trunk/module/bug/model.php @@ -25,8 +25,15 @@ lang->bug->menu, 'product', $selectHtml . $this->lang->arrow); + } + /* 创建一个Bug。*/ - function create() + public function create() { $now = date('Y-m-d H:i:s'); $bug = fixer::input('post') diff --git a/trunk/module/bug/view/browse.html.php b/trunk/module/bug/view/browse.html.php index 457ffda093..4ca64c246e 100644 --- a/trunk/module/bug/view/browse.html.php +++ b/trunk/module/bug/view/browse.html.php @@ -25,91 +25,80 @@ -
-
- - - - - -
- bug->selectProduct;?> - -
-
-
- createLink('bug', 'browse', "productID=$productID"), $lang->bug->allBugs);?> - createLink('tree', 'browse', "productID=$productID&view=bug"), $lang->tree->manageBug);?> -
-
+ +
+
+
+ " . $lang->bug->moduleBugs . " "; + echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&type=assignToMe¶m=0"), $lang->bug->assignToMe) . ""; + echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&type=openedByMe¶m=0"), $lang->bug->openedByMe) . ""; + echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&type=resolvedByMe¶m=0"), $lang->bug->resolvedByMe) . ""; + echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&type=assignToNull¶m=0"), $lang->bug->assignToNull) . ""; + echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&type=longLifeBugs¶m=0"), $lang->bug->longLifeBugs) . ""; + echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&type=postponedBugs¶m=0"), $lang->bug->postponedBugs) . ""; + echo "{$lang->bug->byQuery} "; + echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&type=all¶m=0"), $lang->bug->allBugs) . ""; + ?> +
+
+ bug->create); ?> +
+
'>
+
+ +
' id='mainbox'> +
' id='treebox'> +
+
+ +
+ createLink('tree', 'browse', "productID=$productID&view=bug"), $lang->tree->manage);?> +
+
+
+
-
-
-
    - $productName"; - echo "
  • " . html::a($this->createLink('bug', 'browse', "productid=$productID&type=byModule¶m=$currentModuleID"), $currentModuleName) . "
  • "; - echo "
  • " . html::a($this->createLink('bug', 'browse', "productid=$productID&type=assignToMe¶m=0"), $lang->bug->assignToMe) . "
  • "; - echo "
  • " . html::a($this->createLink('bug', 'browse', "productid=$productID&type=openedByMe¶m=0"), $lang->bug->openedByMe) . "
  • "; - echo "
  • " . html::a($this->createLink('bug', 'browse', "productid=$productID&type=resolvedByMe¶m=0"), $lang->bug->resolvedByMe) . "
  • "; - echo "
  • " . html::a($this->createLink('bug', 'browse', "productid=$productID&type=assignToNull¶m=0"), $lang->bug->assignToNull) . "
  • "; - echo "
  • " . html::a($this->createLink('bug', 'browse', "productid=$productID&type=longLifeBugs¶m=0"), $lang->bug->longLifeBugs) . "
  • "; - echo "
  • " . html::a($this->createLink('bug', 'browse', "productid=$productID&type=postponedBugs¶m=0"), $lang->bug->postponedBugs) . "
  • "; - echo << -$("#{$type}tab").addClass('active'); - -EOT; - ?> -
- ' . html::a($this->createLink('bug', 'create', "type=product&productID=$productID&moduleID=$currentModuleID"), $lang->bug->create) . '
';?> -
- global->vars = "productID=$productID&type=$type¶m=$param&orderBy=%s&recTotal=$recTotal&recPerPage=$recPerPage"; - $app->global->orderBy = $orderBy; - function printOrderLink($fieldName) - { - global $app, $lang; - if(strpos($app->global->orderBy, $fieldName) !== false) - { - if(stripos($app->global->orderBy, 'desc') !== false) $orderBy = str_replace('desc', 'asc', $app->global->orderBy); - if(stripos($app->global->orderBy, 'asc') !== false) $orderBy = str_replace('asc', 'desc', $app->global->orderBy); - } - else - { - $orderBy = $fieldName . '|' . 'asc'; - } - $link = helper::createLink('bug', 'browse', sprintf($app->global->vars, $orderBy)); - echo html::a($link, $lang->bug->$fieldName); - } - ?> - - + +
- - - - - - - + + + + + + + - + - + @@ -122,4 +111,8 @@ EOT; + diff --git a/trunk/module/bug/view/view.html.php b/trunk/module/bug/view/view.html.php index 36156aa230..c64a9d3ee2 100644 --- a/trunk/module/bug/view/view.html.php +++ b/trunk/module/bug/view/view.html.php @@ -29,197 +29,164 @@
BUG #id . $lang->colon . $bug->title;?>
createLink('bug', 'edit', "bugID=$bug->id"), $lang->bug->buttonEdit); - if(common::hasPriv('bug', 'resolve') and $bug->status == 'active') echo html::a($this->createLink('bug', 'resolve', "bugID=$bug->id"), $lang->bug->buttonResolve); else echo $lang->bug->buttonResolve . ' '; - if(common::hasPriv('bug', 'close') and $bug->status == 'resolved') echo html::a($this->createLink('bug', 'close', "bugID=$bug->id"), $lang->bug->buttonClose); else echo $lang->bug->buttonClose . ' '; - if(common::hasPriv('bug', 'activate') and ($bug->status == 'closed' or $bug->status == 'resolved')) echo html::a($this->createLink('bug', 'activate', "bugID=$bug->id"), $lang->bug->buttonActivate); else echo $lang->bug->buttonActivate . ' '; + common::printLink('bug', 'edit', "bugID=$bug->id", $lang->bug->buttonEdit); + if($bug->status == 'active') common::printLink('bug', 'resolve', "bugID=$bug->id", $lang->bug->buttonResolve); else echo $lang->bug->buttonResolve . ' '; + if($bug->status == 'resolved') common::printLink('bug', 'close', "bugID=$bug->id", $lang->bug->buttonClose); else echo $lang->bug->buttonClose . ' '; + if($bug->status == 'closed' or $bug->status == 'resolved') common::printLink('bug', 'activate', "bugID=$bug->id", $lang->bug->buttonActivate); else echo $lang->bug->buttonActivate . ' '; if(common::hasPriv('bug', 'browse')) echo html::a($this->session->bugList, $lang->bug->buttonToList); ?>
-
-
- -
+
+
+
- bug->legendBasicInfo;?> -
bug->id);?>bug->severity);?>bug->title);?>bug->openedBy);?>bug->assignedTo);?>bug->resolvedBy);?>bug->resolution);?>
createLink('bug', 'view', "bugID=$bug->id"), sprintf('%03d', $bug->id));?>createLink('bug', 'view', "bugID=$bug->id"), sprintf('%03d', $bug->id));?> severity?>title;?>title;?> openedBy];?> assignedTo == $this->app->user->account) echo 'style=color:red';?>>assignedTo];?> resolvedBy];?>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bug->labProductAndModule;?> - arrow; - foreach($modulePath as $key => $module) - { - echo $module->name; - if(isset($modulePath[$key + 1])) echo $lang->arrow; - } - ?> -
bug->type;?>bug->typeList[$bug->type];?>
bug->os;?>bug->osList->{$bug->os};?>
bug->severity;?>severity;?>
bug->status;?>status;?>
bug->assignedTo;?>assignedTo];?>
bug->assignedDate;?>assignedDate;?>
bug->lastEditedBy;?>lastEditedBy];?>
bug->lastEditedDate;?>lastEditedDate;?>
+ bug->legendSteps;?> +
steps);?>
- +
- bug->legendPrjStoryTask;?> - - - - - - - - - - - - - -
bug->project;?>projectName;?>
bug->story;?>storyTitle;?>
bug->task;?>taskName;?>
-
- -
- bug->legendMailto;?> -
mailto); foreach($mailto as $account) echo ' ' . $users[$account]; ?>
-
- -
- bug->legendAttatch;?> -
- files as $file) echo html::a($file->fullPath, $file->title, '_blank'); - ?> + bug->legendAction;?> +
+ createLink('bug', 'edit', "bugID=$bug->id"), $lang->bug->buttonEdit); + if(common::hasPriv('bug', 'resolve') and $bug->status == 'active') echo html::a($this->createLink('bug', 'resolve', "bugID=$bug->id"), $lang->bug->buttonResolve); else echo $lang->bug->buttonResolve . ' '; + if(common::hasPriv('bug', 'close') and $bug->status == 'resolved') echo html::a($this->createLink('bug', 'close', "bugID=$bug->id"), $lang->bug->buttonClose); else echo $lang->bug->buttonClose . ' '; + if(common::hasPriv('bug', 'activate') and ($bug->status == 'closed' or $bug->status == 'resolved')) echo html::a($this->createLink('bug', 'activate', "bugID=$bug->id"), $lang->bug->buttonActivate); else echo $lang->bug->buttonActivate . ' '; + if(common::hasPriv('bug', 'browse')) echo html::a($this->session->bugList, $lang->bug->buttonToList); + ?>
- -
- -
-
- bug->legendOpenInfo;?> - - - - - - - - - - - - - -
bug->openedBy;?>openedBy];?>
bug->openedDate;?>openedDate;?>
bug->openedBuild;?>openedBuild;?>
-
- -
- bug->legendResolveInfo;?> - - - - - - - - - - - - - - - - - -
bug->resolvedBy;?>resolvedBy];?>
bug->resolvedDate;?>resolvedDate;?>
bug->resolvedBuild;?>resolvedBuild;?>
bug->resolution;?> - bug->resolutionList[$bug->resolution]; - if(isset($bug->duplicateBugTitle)) echo " #$bug->duplicateBug:" . html::a($this->createLink('bug', 'view', "bugID=$bug->duplicateBug"), $bug->duplicateBugTitle); - ?> -
-
- -
- bug->legendCloseInfo;?> - - - - - - - - - -
bug->closedBy;?>closedBy];?>
bug->closedDate;?>closedDate;?>
-
- -
- bug->legendLinkBugs;?> -
 
-
- -
- bug->legendCases;?> -
 
-
- -
-
-
- -
-
- bug->legendAction;?> -
- createLink('bug', 'edit', "bugID=$bug->id"), $lang->bug->buttonEdit); - if(common::hasPriv('bug', 'resolve') and $bug->status == 'active') echo html::a($this->createLink('bug', 'resolve', "bugID=$bug->id"), $lang->bug->buttonResolve); else echo $lang->bug->buttonResolve . ' '; - if(common::hasPriv('bug', 'close') and $bug->status == 'resolved') echo html::a($this->createLink('bug', 'close', "bugID=$bug->id"), $lang->bug->buttonClose); else echo $lang->bug->buttonClose . ' '; - if(common::hasPriv('bug', 'activate') and ($bug->status == 'closed' or $bug->status == 'resolved')) echo html::a($this->createLink('bug', 'activate', "bugID=$bug->id"), $lang->bug->buttonActivate); else echo $lang->bug->buttonActivate . ' '; - if(common::hasPriv('bug', 'browse')) echo html::a($this->session->bugList, $lang->bug->buttonToList); - ?>
-
-
- bug->legendSteps;?> -
steps);?>
-
-
+ +
+
+ bug->legendBasicInfo;?> + + + + + + + + + + + + + + + + + + + + + + + + + +
bug->labProductAndModule;?> + arrow; + foreach($modulePath as $key => $module) + { + echo $module->name; + if(isset($modulePath[$key + 1])) echo $lang->arrow; + } + ?> +
bug->type;?>bug->typeList[$bug->type];?>
bug->os;?>bug->osList->{$bug->os};?>
bug->severity;?>severity;?>
bug->status;?>status;?>
bug->labAssignedTo;?>assignedTo) echo $users[$bug->assignedTo] . $lang->at . $bug->assignedDate;?>
+
+ +
+ bug->legendLife;?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bug->openedBy;?> openedBy] . $lang->at . $bug->openedDate;?>
bug->openedBuild;?>openedBuild;?>
bug->labResolved;?>resolvedBy) echo $users[$bug->resolvedBy] . $lang->at . $bug->resolvedDate;?> +
bug->resolvedBuild;?>resolvedBuild;?>
bug->resolution;?> + bug->resolutionList[$bug->resolution]; + if(isset($bug->duplicateBugTitle)) echo " #$bug->duplicateBug:" . html::a($this->createLink('bug', 'view', "bugID=$bug->duplicateBug"), $bug->duplicateBugTitle); + ?> +
bug->closedBy;?>closedBy) echo $users[$bug->closedBy] . $lang->at . $bug->closedDate;?>
bug->labLastEdited;?>lastEditedBy) echo $users[$bug->lastEditedBy] . $lang->at . $bug->lastEditedDate?>
+
+ +
+ bug->legendPrjStoryTask;?> + + + + + + + + + + + + + +
bug->project;?>project) echo html::a($this->createLink('project', 'browse', "projectid=$bug->project"), $bug->projectName);?>
bug->story;?>story) echo html::a($this->createLink('story', 'view', "storyID=$bug->story"), $bug->storyTitle);?>
bug->task;?>task) echo html::a($this->createLink('task', 'view', "taskID=$bug->task"), $bug->taskName);?>
+
+ +
+ bug->legendMailto;?> +
mailto); foreach($mailto as $account) echo ' ' . $users[$account]; ?>
+
+ +
+ bug->legendAttatch;?> +
+ files as $file) echo html::a($file->fullPath, $file->title, '_blank'); + ?> +
+
+ + +
+ bug->legendLinkBugs;?> +
 
+
+ +
+ bug->legendCases;?> +
 
+
+ + +
+
+