diff --git a/db/update2.2.sql b/db/update2.2.sql index 08676c9475..fe4520051a 100644 --- a/db/update2.2.sql +++ b/db/update2.2.sql @@ -1,3 +1,5 @@ ALTER TABLE `zt_story` ADD `source` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER `plan` ; ALTER TABLE `zt_bug` ADD `activatedCount` SMALLINT( 6 ) NOT NULL AFTER `status` ; -ALTER TABLE `zt_bug` CHANGE `status` `status` ENUM( 'active', 'reactivated', 'resolved', 'closed' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'active' ; +ALTER TABLE `zt_bug` CHANGE `status` `status` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ; +ALTER TABLE `zt_bug` ADD `confirm` BOOL NOT NULL DEFAULT '0' AFTER `activatedCount` ; +ALTER TABLE `zt_bug` ADD `confirmedBy` VARCHAR( 30 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER `closedDate` , ADD `confirmedDate` DATETIME NOT NULL AFTER `confirmedBy` ; diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index ae472547eb..51ccdf0c1c 100644 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -62,6 +62,7 @@ $lang->action->desc->commented = '$date, 由 $actor 添加备 $lang->action->desc->activated = '$date, 由 $actor 激活。' . "\n"; $lang->action->desc->moved = '$date, 由 $actor 移动,之前为 "$extra"' . "\n"; $lang->action->desc->confirmed = '$date, 由 $actor 确认需求变动,最新版本为#$extra' . "\n"; +$lang->action->desc->bugconfirmed= '$date, 由 $actor 确认Bug' . "\n"; $lang->action->desc->started = '$date, 由 $actor 启动。' . "\n"; $lang->action->desc->canceled = '$date, 由 $actor 取消。' . "\n"; $lang->action->desc->svncommited = '$date, $actor 提交了Subversion,最新版本为#$extra' . "\n"; diff --git a/module/bug/config.php b/module/bug/config.php index 37d55b4212..c0d9dbf3a2 100644 --- a/module/bug/config.php +++ b/module/bug/config.php @@ -14,6 +14,8 @@ $config->bug->search['fields']['project'] = $lang->bug->project; $config->bug->search['fields']['closedBy'] = $lang->bug->closedBy; $config->bug->search['fields']['lastEditedBy'] = $lang->bug->lastEditedByAB; $config->bug->search['fields']['status'] = $lang->bug->status; +$config->bug->search['fields']['activatedCount'] = $lang->bug->activatedCount; +$config->bug->search['fields']['confirm'] = $lang->bug->confirm; $config->bug->search['fields']['severity'] = $lang->bug->severity; $config->bug->search['fields']['pri'] = $lang->bug->pri; $config->bug->search['fields']['type'] = $lang->bug->type; @@ -41,6 +43,8 @@ $config->bug->search['params']['openedBy'] = array('operator' => '=', $config->bug->search['params']['closedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users'); $config->bug->search['params']['lastEditedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users'); $config->bug->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->bug->statusList); +$config->bug->search['params']['activatedCount']= array('operator' => '=', 'control' => 'input', 'values' => ''); +$config->bug->search['params']['confirm'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->bug->confirmList); $config->bug->search['params']['severity'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->bug->severityList); $config->bug->search['params']['pri'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->bug->priList); $config->bug->search['params']['type'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->bug->typeList); @@ -62,7 +66,7 @@ $config->bug->resolve->requiredFields = 'resolution'; $config->bug->list->allFields = 'id, module, project, story, task, title, keywords, severity, pri, type, os, browser, hardware, - found, steps, status, activatedCount, mailto, + found, steps, status, activatedCount, confirm, mailto, openedBy, openedDate, openedBuild, assignedTo, assignedDate, resolvedBy, resolution, resolvedBuild, resolvedDate, @@ -71,11 +75,11 @@ $config->bug->list->allFields = 'id, module, project, story, task, case, lastEditedBy, lastEditedDate'; -$config->bug->list->defaultFields = 'id,severity,pri,title, activatedCount,openedBy,assignedTo,resolvedBy,resolution'; +$config->bug->list->defaultFields = 'id,severity,pri,title,openedBy,assignedTo,resolvedBy,resolution'; $config->bug->list->exportFields = 'id, product, module, project, story, task, title, keywords, severity, pri, type, os, browser, - steps, status, activatedCount, mailto, + steps, status, activatedCount, confirm, mailto, openedBy, openedDate, openedBuild, assignedTo, assignedDate, resolvedBy, resolution, resolvedBuild, resolvedDate, diff --git a/module/bug/control.php b/module/bug/control.php index b9d2a1a099..afb590054e 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -513,6 +513,37 @@ class bug extends control $this->display(); } + /** + * confirm a bug. + * + * @param int $bugID + * @access public + * @return void + */ + public function confirmBug($bugID) + { + if(!empty($_POST)) + { + $this->bug->confirm($bugID); + if(dao::isError()) die(js::error(dao::getError())); + $actionID = $this->action->create('bug', $bugID, 'bugConfirmed', $this->post->comment); + $this->sendmail($bugID, $actionID); + die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent')); + } + + $bug = $this->bug->getById($bugID); + $productID = $bug->product; + $this->bug->setMenu($this->products, $productID); + + $this->view->header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->bug->resolve; + $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); + $this->view->position[] = $this->lang->bug->confirm; + + $this->view->bug = $bug; + $this->view->actions = $this->action->getList('bug', $bugID); + $this->display(); + } + /** * Resolve a bug. * @@ -884,6 +915,7 @@ class bug extends control if(isset($bugLang->priList[$bug->pri])) $bug->pri = $bugLang->priList[$bug->pri]; if(isset($bugLang->typeList[$bug->type])) $bug->type = $bugLang->typeList[$bug->type]; if(isset($bugLang->statusList[$bug->status])) $bug->status = $bugLang->statusList[$bug->status]; + if(isset($bugLang->confirmList[$bug->confirm])) $bug->confirm = $bugLang->confirmList[$bug->confirm]; if(isset($bugLang->resolutionList[$bug->resolution])) $bug->resolution = $bugLang->resolutionList[$bug->resolution]; if(isset($users[$bug->openedBy])) $bug->openedBy = $users[$bug->openedBy]; diff --git a/module/bug/lang/en.php b/module/bug/lang/en.php index 80c6a548ea..63da7fd618 100644 --- a/module/bug/lang/en.php +++ b/module/bug/lang/en.php @@ -10,52 +10,55 @@ * @link http://www.zentao.net */ /* Fieldlist. */ -$lang->bug->common = 'Bug'; -$lang->bug->id = 'ID'; -$lang->bug->product = 'Product'; -$lang->bug->module = 'Module'; -$lang->bug->path = 'Path'; -$lang->bug->project = 'Project'; -$lang->bug->story = 'Story'; -$lang->bug->storyVersion = 'Story Version'; -$lang->bug->task = 'Task'; -$lang->bug->title = 'Title'; -$lang->bug->severity = 'Severity'; -$lang->bug->severityAB = 'S'; -$lang->bug->pri = 'Priority'; -$lang->bug->type = 'Type'; -$lang->bug->os = 'OS'; -$lang->bug->hardware = 'Hardware'; -$lang->bug->browser = 'Browser'; -$lang->bug->machine = 'Machine'; -$lang->bug->found = 'How found'; -$lang->bug->steps = 'Steps'; -$lang->bug->status = 'Status'; -$lang->bug->statusAB = 'Status'; -$lang->bug->mailto = 'Mailto'; -$lang->bug->openedBy = 'Opened By'; -$lang->bug->openedByAB = 'Opened'; -$lang->bug->openedDate = 'Opened date'; -$lang->bug->openedDateAB = 'Date'; -$lang->bug->openedBuild = 'Opened Build'; -$lang->bug->assignedTo = 'Assigned'; -$lang->bug->assignedDate = 'Assigned Date'; -$lang->bug->resolvedBy = 'Resolved By'; -$lang->bug->resolvedByAB = 'Resolve'; -$lang->bug->resolution = 'Resolution'; -$lang->bug->resolutionAB = 'Resolution'; -$lang->bug->resolvedBuild = 'Resolved Build'; -$lang->bug->resolvedDate = 'Resolved Date'; -$lang->bug->resolvedDateAB = 'Date'; -$lang->bug->closedBy = 'Closed By'; -$lang->bug->closedDate = 'Closed Date'; -$lang->bug->duplicateBug = 'Duplicate'; -$lang->bug->lastEditedBy = 'Last Edited By'; -$lang->bug->lastEditedDate = 'Last Edited Date'; -$lang->bug->linkBug = 'Related'; -$lang->bug->case = 'Case'; -$lang->bug->files = 'Files'; -$lang->bug->keywords = 'Keywords'; +$lang->bug->common = 'Bug'; +$lang->bug->id = 'ID'; +$lang->bug->product = 'Product'; +$lang->bug->module = 'Module'; +$lang->bug->path = 'Path'; +$lang->bug->project = 'Project'; +$lang->bug->story = 'Story'; +$lang->bug->storyVersion = 'Story Version'; +$lang->bug->task = 'Task'; +$lang->bug->title = 'Title'; +$lang->bug->severity = 'Severity'; +$lang->bug->severityAB = 'S'; +$lang->bug->pri = 'Priority'; +$lang->bug->type = 'Type'; +$lang->bug->os = 'OS'; +$lang->bug->hardware = 'Hardware'; +$lang->bug->browser = 'Browser'; +$lang->bug->machine = 'Machine'; +$lang->bug->found = 'How found'; +$lang->bug->steps = 'Steps'; +$lang->bug->status = 'Status'; +$lang->bug->statusAB = 'Status'; +$lang->bug->activatedCount = 'Activated count'; +$lang->bug->activatedCountAB = 'Activated count'; +$lang->bug->confirm = 'Confirm'; +$lang->bug->mailto = 'Mailto'; +$lang->bug->openedBy = 'Opened By'; +$lang->bug->openedByAB = 'Opened'; +$lang->bug->openedDate = 'Opened date'; +$lang->bug->openedDateAB = 'Date'; +$lang->bug->openedBuild = 'Opened Build'; +$lang->bug->assignedTo = 'Assigned'; +$lang->bug->assignedDate = 'Assigned Date'; +$lang->bug->resolvedBy = 'Resolved By'; +$lang->bug->resolvedByAB = 'Resolve'; +$lang->bug->resolution = 'Resolution'; +$lang->bug->resolutionAB = 'Resolution'; +$lang->bug->resolvedBuild = 'Resolved Build'; +$lang->bug->resolvedDate = 'Resolved Date'; +$lang->bug->resolvedDateAB = 'Date'; +$lang->bug->closedBy = 'Closed By'; +$lang->bug->closedDate = 'Closed Date'; +$lang->bug->duplicateBug = 'Duplicate'; +$lang->bug->lastEditedBy = 'Last Edited By'; +$lang->bug->lastEditedDate = 'Last Edited Date'; +$lang->bug->linkBug = 'Related'; +$lang->bug->case = 'Case'; +$lang->bug->files = 'Files'; +$lang->bug->keywords = 'Keywords'; $lang->bug->lastEditedByAB = 'Edited'; $lang->bug->lastEditedDateAB = 'Edited Date'; @@ -124,6 +127,7 @@ $lang->bug->legendLife = 'Lifetime'; $lang->bug->legendMisc = 'Misc'; /* Action buttons. */ +$lang->bug->buttonConfirm = 'Confirm'; $lang->bug->buttonCopy = 'Copy'; $lang->bug->buttonEdit = 'Edit'; $lang->bug->buttonActivate = 'Activate'; @@ -207,7 +211,6 @@ $lang->bug->statusList[''] = ''; $lang->bug->statusList['active'] = 'Active'; $lang->bug->statusList['resolved'] = 'Resolved'; $lang->bug->statusList['closed'] = 'Closed'; -$lang->bug->statusList['reactivated'] = 'Reactivated'; $lang->bug->resolutionList[''] = ''; $lang->bug->resolutionList['bydesign'] = 'By design'; @@ -225,19 +228,20 @@ $lang->bug->report->create = 'Create'; $lang->bug->report->selectAll = 'All'; $lang->bug->report->selectReverse = 'Reverse'; -$lang->bug->report->charts['bugsPerProject'] = 'Project bugs'; -$lang->bug->report->charts['bugsPerModule'] = 'Module bugs'; -$lang->bug->report->charts['openedBugsPerDay'] = 'Opened bugs per day'; -$lang->bug->report->charts['resolvedBugsPerDay'] = 'Resolved bugs per day'; -$lang->bug->report->charts['closedBugsPerDay'] = 'Closed bugs per day'; -$lang->bug->report->charts['openedBugsPerUser'] = 'Opened bugs per user'; -$lang->bug->report->charts['resolvedBugsPerUser']= 'Resolved bugs per user'; -$lang->bug->report->charts['closedBugsPerUser'] = 'Closed bugs per user'; -$lang->bug->report->charts['bugsPerSeverity'] = 'Severity'; -$lang->bug->report->charts['bugsPerResolution'] = 'Resolution'; -$lang->bug->report->charts['bugsPerStatus'] = 'Status'; -$lang->bug->report->charts['bugsPerType'] = 'Type'; -$lang->bug->report->charts['bugsPerAssignedTo'] = 'AssignedTo'; +$lang->bug->report->charts['bugsPerProject'] = 'Project bugs'; +$lang->bug->report->charts['bugsPerModule'] = 'Module bugs'; +$lang->bug->report->charts['openedBugsPerDay'] = 'Opened bugs per day'; +$lang->bug->report->charts['resolvedBugsPerDay'] = 'Resolved bugs per day'; +$lang->bug->report->charts['closedBugsPerDay'] = 'Closed bugs per day'; +$lang->bug->report->charts['openedBugsPerUser'] = 'Opened bugs per user'; +$lang->bug->report->charts['resolvedBugsPerUser'] = 'Resolved bugs per user'; +$lang->bug->report->charts['closedBugsPerUser'] = 'Closed bugs per user'; +$lang->bug->report->charts['bugsPerSeverity'] = 'Severity'; +$lang->bug->report->charts['bugsPerResolution'] = 'Resolution'; +$lang->bug->report->charts['bugsPerStatus'] = 'Status'; +$lang->bug->report->charts['bugsPerActivatedCount'] = 'Activated count'; +$lang->bug->report->charts['bugsPerType'] = 'Type'; +$lang->bug->report->charts['bugsPerAssignedTo'] = 'AssignedTo'; //$lang->bug->report->charts['bugLiveDays'] = 'Bug处理时间统计'; //$lang->bug->report->charts['bugHistories'] = 'Bug处理步骤统计'; @@ -276,13 +280,14 @@ $lang->bug->report->openedBugsPerUser->graph->xAxisName = 'User'; $lang->bug->report->resolvedBugsPerUser->graph->xAxisName= 'User'; $lang->bug->report->closedBugsPerUser->graph->xAxisName = 'User'; -$lang->bug->report->bugsPerSeverity->graph->xAxisName = 'Severity'; -$lang->bug->report->bugsPerResolution->graph->xAxisName = 'Resolution'; -$lang->bug->report->bugsPerStatus->graph->xAxisName = 'Status'; -$lang->bug->report->bugsPerType->graph->xAxisName = 'Type'; -$lang->bug->report->bugsPerAssignedTo->graph->xAxisName = 'AssignedTo'; -$lang->bug->report->bugLiveDays->graph->xAxisName = 'Live days'; -$lang->bug->report->bugHistories->graph->xAxisName = 'Histories'; +$lang->bug->report->bugsPerSeverity->graph->xAxisName = 'Severity'; +$lang->bug->report->bugsPerResolution->graph->xAxisName = 'Resolution'; +$lang->bug->report->bugsPerStatus->graph->xAxisName = 'Status'; +$lang->bug->report->bugsPerActivatedCount->graph->xAxisName = 'Activated count'; +$lang->bug->report->bugsPerType->graph->xAxisName = 'Type'; +$lang->bug->report->bugsPerAssignedTo->graph->xAxisName = 'AssignedTo'; +$lang->bug->report->bugLiveDays->graph->xAxisName = 'Live days'; +$lang->bug->report->bugHistories->graph->xAxisName = 'Histories'; /* 操作记录。*/ $lang->bug->action->resolved = array('main' => '$date, Resolved by $actor, resolution is $extra.', 'extra' => $lang->bug->resolutionList); diff --git a/module/bug/lang/zh-cn.php b/module/bug/lang/zh-cn.php index ad9dd68890..67162ead76 100644 --- a/module/bug/lang/zh-cn.php +++ b/module/bug/lang/zh-cn.php @@ -10,52 +10,55 @@ * @link http://www.zentao.net */ /* 字段列表。*/ -$lang->bug->common = '缺陷管理'; -$lang->bug->id = 'Bug编号'; -$lang->bug->product = '所属产品'; -$lang->bug->module = '所属模块'; -$lang->bug->path = '模块路径'; -$lang->bug->project = '所属项目'; -$lang->bug->story = '相关需求'; -$lang->bug->storyVersion = '需求版本'; -$lang->bug->task = '相关任务'; -$lang->bug->title = 'Bug标题'; -$lang->bug->severity = '严重程度'; -$lang->bug->severityAB = '级别'; -$lang->bug->pri = '优先级'; -$lang->bug->type = 'Bug类型'; -$lang->bug->os = '操作系统'; -$lang->bug->hardware = '硬件平台'; -$lang->bug->browser = '浏览器'; -$lang->bug->machine = '机器硬件'; -$lang->bug->found = '如何发现'; -$lang->bug->steps = '重现步骤'; -$lang->bug->status = 'Bug状态'; -$lang->bug->statusAB = '状态'; -$lang->bug->mailto = '抄送给'; -$lang->bug->openedBy = '由谁创建'; -$lang->bug->openedByAB = '创建'; -$lang->bug->openedDate = '创建日期'; -$lang->bug->openedDateAB = '创建日期'; -$lang->bug->openedBuild = '影响版本'; -$lang->bug->assignedTo = '指派给'; -$lang->bug->assignedDate = '指派日期'; -$lang->bug->resolvedBy = '解决者'; -$lang->bug->resolvedByAB = '解决'; -$lang->bug->resolution = '解决方案'; -$lang->bug->resolutionAB = '方案'; -$lang->bug->resolvedBuild = '解决版本'; -$lang->bug->resolvedDate = '解决日期'; -$lang->bug->resolvedDateAB = '解决日期'; -$lang->bug->closedBy = '由谁关闭'; -$lang->bug->closedDate = '关闭日期'; -$lang->bug->duplicateBug = '重复Bug'; -$lang->bug->lastEditedBy = '最后修改者'; -$lang->bug->lastEditedDate = '最后修改日期'; -$lang->bug->linkBug = '相关Bug'; -$lang->bug->case = '相关用例'; -$lang->bug->files = '附件'; -$lang->bug->keywords = '关键词'; +$lang->bug->common = '缺陷管理'; +$lang->bug->id = 'Bug编号'; +$lang->bug->product = '所属产品'; +$lang->bug->module = '所属模块'; +$lang->bug->path = '模块路径'; +$lang->bug->project = '所属项目'; +$lang->bug->story = '相关需求'; +$lang->bug->storyVersion = '需求版本'; +$lang->bug->task = '相关任务'; +$lang->bug->title = 'Bug标题'; +$lang->bug->severity = '严重程度'; +$lang->bug->severityAB = '级别'; +$lang->bug->pri = '优先级'; +$lang->bug->type = 'Bug类型'; +$lang->bug->os = '操作系统'; +$lang->bug->hardware = '硬件平台'; +$lang->bug->browser = '浏览器'; +$lang->bug->machine = '机器硬件'; +$lang->bug->found = '如何发现'; +$lang->bug->steps = '重现步骤'; +$lang->bug->status = 'Bug状态'; +$lang->bug->statusAB = '状态'; +$lang->bug->activatedCount = '激活次数'; +$lang->bug->activatedCountAB = '激活次数'; +$lang->bug->confirm = '确认状态'; +$lang->bug->mailto = '抄送给'; +$lang->bug->openedBy = '由谁创建'; +$lang->bug->openedByAB = '创建'; +$lang->bug->openedDate = '创建日期'; +$lang->bug->openedDateAB = '创建日期'; +$lang->bug->openedBuild = '影响版本'; +$lang->bug->assignedTo = '指派给'; +$lang->bug->assignedDate = '指派日期'; +$lang->bug->resolvedBy = '解决者'; +$lang->bug->resolvedByAB = '解决'; +$lang->bug->resolution = '解决方案'; +$lang->bug->resolutionAB = '方案'; +$lang->bug->resolvedBuild = '解决版本'; +$lang->bug->resolvedDate = '解决日期'; +$lang->bug->resolvedDateAB = '解决日期'; +$lang->bug->closedBy = '由谁关闭'; +$lang->bug->closedDate = '关闭日期'; +$lang->bug->duplicateBug = '重复Bug'; +$lang->bug->lastEditedBy = '最后修改者'; +$lang->bug->lastEditedDate = '最后修改日期'; +$lang->bug->linkBug = '相关Bug'; +$lang->bug->case = '相关用例'; +$lang->bug->files = '附件'; +$lang->bug->keywords = '关键词'; $lang->bug->lastEditedByAB = '修改者'; $lang->bug->lastEditedDateAB = '修改日期'; @@ -124,6 +127,7 @@ $lang->bug->legendLife = 'BUG的一生'; $lang->bug->legendMisc = '其相关他'; /* 功能按钮。*/ +$lang->bug->buttonConfirm = '确认'; $lang->bug->buttonCopy = '复制'; $lang->bug->buttonEdit = '编辑'; $lang->bug->buttonActivate = '激活'; @@ -203,11 +207,13 @@ $lang->bug->typeList['automation'] = '测试脚本'; $lang->bug->typeList['trackthings'] = '事务跟踪'; $lang->bug->typeList['others'] = '其他'; -$lang->bug->statusList[''] = ''; -$lang->bug->statusList['active'] = '激活'; -$lang->bug->statusList['resolved'] = '已解决'; -$lang->bug->statusList['closed'] = '已关闭'; -$lang->bug->statusList['reactivated'] = '重新激活'; +$lang->bug->statusList[''] = ''; +$lang->bug->statusList['active'] = '激活'; +$lang->bug->statusList['resolved'] = '已解决'; +$lang->bug->statusList['closed'] = '已关闭'; + +$lang->bug->confirmList[1] = '已确认'; +$lang->bug->confirmList[0] = '未确认'; $lang->bug->resolutionList[''] = ''; $lang->bug->resolutionList['bydesign'] = '设计如此'; @@ -225,19 +231,20 @@ $lang->bug->report->create = '生成报表'; $lang->bug->report->selectAll = '全选'; $lang->bug->report->selectReverse = '反选'; -$lang->bug->report->charts['bugsPerProject'] = '项目Bug数量'; -$lang->bug->report->charts['bugsPerModule'] = '模块Bug数量'; -$lang->bug->report->charts['openedBugsPerDay'] = '每天新增Bug数'; -$lang->bug->report->charts['resolvedBugsPerDay'] = '每天解决Bug数'; -$lang->bug->report->charts['closedBugsPerDay'] = '每天关闭的Bug数'; -$lang->bug->report->charts['openedBugsPerUser'] = '每人提交的Bug数'; -$lang->bug->report->charts['resolvedBugsPerUser']= '每人解决的Bug数'; -$lang->bug->report->charts['closedBugsPerUser'] = '每人关闭的Bug数'; -$lang->bug->report->charts['bugsPerSeverity'] = 'Bug严重程度统计'; -$lang->bug->report->charts['bugsPerResolution'] = 'Bug解决方案统计'; -$lang->bug->report->charts['bugsPerStatus'] = 'Bug状态统计'; -$lang->bug->report->charts['bugsPerType'] = 'Bug类型统计'; -$lang->bug->report->charts['bugsPerAssignedTo'] = '指派给统计'; +$lang->bug->report->charts['bugsPerProject'] = '项目Bug数量'; +$lang->bug->report->charts['bugsPerModule'] = '模块Bug数量'; +$lang->bug->report->charts['openedBugsPerDay'] = '每天新增Bug数'; +$lang->bug->report->charts['resolvedBugsPerDay'] = '每天解决Bug数'; +$lang->bug->report->charts['closedBugsPerDay'] = '每天关闭的Bug数'; +$lang->bug->report->charts['openedBugsPerUser'] = '每人提交的Bug数'; +$lang->bug->report->charts['resolvedBugsPerUser'] = '每人解决的Bug数'; +$lang->bug->report->charts['closedBugsPerUser'] = '每人关闭的Bug数'; +$lang->bug->report->charts['bugsPerSeverity'] = 'Bug严重程度统计'; +$lang->bug->report->charts['bugsPerResolution'] = 'Bug解决方案统计'; +$lang->bug->report->charts['bugsPerStatus'] = 'Bug状态统计'; +$lang->bug->report->charts['bugsPerActivatedCount'] = 'Bug激活次数统计'; +$lang->bug->report->charts['bugsPerType'] = 'Bug类型统计'; +$lang->bug->report->charts['bugsPerAssignedTo'] = '指派给统计'; //$lang->bug->report->charts['bugLiveDays'] = 'Bug处理时间统计'; //$lang->bug->report->charts['bugHistories'] = 'Bug处理步骤统计'; @@ -276,13 +283,14 @@ $lang->bug->report->openedBugsPerUser->graph->xAxisName = '用户'; $lang->bug->report->resolvedBugsPerUser->graph->xAxisName= '用户'; $lang->bug->report->closedBugsPerUser->graph->xAxisName = '用户'; -$lang->bug->report->bugsPerSeverity->graph->xAxisName = '严重程度'; -$lang->bug->report->bugsPerResolution->graph->xAxisName = '解决方案'; -$lang->bug->report->bugsPerStatus->graph->xAxisName = '状态'; -$lang->bug->report->bugsPerType->graph->xAxisName = '类型'; -$lang->bug->report->bugsPerAssignedTo->graph->xAxisName = '指派给'; -$lang->bug->report->bugLiveDays->graph->xAxisName = '处理时间'; -$lang->bug->report->bugHistories->graph->xAxisName = '处理步骤'; +$lang->bug->report->bugsPerSeverity->graph->xAxisName = '严重程度'; +$lang->bug->report->bugsPerResolution->graph->xAxisName = '解决方案'; +$lang->bug->report->bugsPerStatus->graph->xAxisName = '状态'; +$lang->bug->report->bugsPerActivatedCount->graph->xAxisName = '激活次数'; +$lang->bug->report->bugsPerType->graph->xAxisName = '类型'; +$lang->bug->report->bugsPerAssignedTo->graph->xAxisName = '指派给'; +$lang->bug->report->bugLiveDays->graph->xAxisName = '处理时间'; +$lang->bug->report->bugHistories->graph->xAxisName = '处理步骤'; /* 操作记录。*/ $lang->bug->action->resolved = array('main' => '$date, 由 $actor 解决,方案为 $extra。', 'extra' => $lang->bug->resolutionList); diff --git a/module/bug/model.php b/module/bug/model.php index 9c9e714b29..4ead12474a 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -161,6 +161,19 @@ class bugModel extends model if(!dao::isError()) return common::createChanges($oldBug, $bug); } + /** + * Resolve a bug. + * + * @param int $bugID + * @access public + * @return void + */ + public function confirm($bugID) + { + $now = helper::now(); + $this->dao->update(TABLE_BUG)->set('confirm')->eq(1)->set('confirmedBy')->eq($this->app->user->account)->set('confirmedDate')->eq($now)->where('id')->eq($bugID)->exec(); + } + /** * Resolve a bug. * @@ -176,6 +189,7 @@ class bugModel extends model ->add('resolvedBy', $this->app->user->account) ->add('resolvedDate', $now) ->add('status', 'resolved') + ->add('confirm', 1) ->add('assignedDate', $now) ->add('lastEditedBy', $this->app->user->account) ->add('lastEditedDate', $now) @@ -208,7 +222,7 @@ class bugModel extends model ->setDefault('assignedTo', $oldBug->resolvedBy) ->add('assignedDate', $now) ->add('resolution', '') - ->add('status', 'reactivated') + ->add('status', 'active') ->add('resolvedDate', '0000-00-00') ->add('resolvedBy', '') ->add('resolvedBuild', '') @@ -542,6 +556,20 @@ class bugModel extends model return $datas; } + /** + * Get report data of bugs per status. + * + * @access public + * @return array + */ + public function getDataOfBugsPerActivatedCount() + { + $datas = $this->dao->select('activatedCount AS name, COUNT(*) AS value')->from(TABLE_BUG)->where($this->session->bugReportCondition)->groupBy('name')->orderBy('value DESC')->fetchAll('name'); + if(!$datas) return array(); + foreach($datas as $data) $data->name = $this->lang->bug->report->bugsPerActivatedCount->graph->xAxisName . ':' . $data->name; + return $datas; + } + /** * Get report data of bugs per type. * diff --git a/module/bug/view/browse.custom.html.php b/module/bug/view/browse.custom.html.php index f7ac66a383..19fc5e7d7c 100644 --- a/module/bug/view/browse.custom.html.php +++ b/module/bug/view/browse.custom.html.php @@ -38,7 +38,7 @@ { echo $users[$bug->$fieldName]; } - elseif(preg_match('/^(severity|pri|resolution|os|type|browse|status)$/i', $fieldName)) + elseif(preg_match('/^(severity|pri|resolution|os|type|browse|status|confirm)$/i', $fieldName)) { $key = $fieldName . 'List'; $list = $lang->bug->$key; diff --git a/module/bug/view/browse.html.php b/module/bug/view/browse.html.php index c89f249a25..a29374619e 100644 --- a/module/bug/view/browse.html.php +++ b/module/bug/view/browse.html.php @@ -70,7 +70,7 @@ var customed = ; bug->title);?> cookie->windowWidth >= $this->config->wideSize):?> - bug->statusAB);?> + bug->statusAB);?> @@ -107,7 +107,7 @@ var customed = ; title);?> cookie->windowWidth >= $this->config->wideSize):?> - bug->statusList[$bug->status]?> + bug->statusList[$bug->status];echo '[' . $lang->bug->confirmList[$bug->confirm] . ']';?> diff --git a/module/bug/view/confirmbug.html.php b/module/bug/view/confirmbug.html.php new file mode 100755 index 0000000000..bf0dcc65cd --- /dev/null +++ b/module/bug/view/confirmbug.html.php @@ -0,0 +1,31 @@ + + * @package bug + * @version $Id: resolve.html.php 1914 2011-06-24 10:11:25Z yidong@cnezsoft.com $ + * @link http://www.zentao.net + */ +?> + +
+ + + + + + + + + +
title;?>
comment;?>
+ bug->buttonConfirm);?> + +
+ +
+ diff --git a/module/bug/view/edit.html.php b/module/bug/view/edit.html.php index 40689a088a..a859d1cfcf 100644 --- a/module/bug/view/edit.html.php +++ b/module/bug/view/edit.html.php @@ -97,6 +97,10 @@ userList = "".split(',' bug->status;?> bug->statusList, $bug->status, 'class=select-3');?> + + bug->confirm;?> + bug->confirmList[$bug->confirm];?> + bug->assignedTo;?> assignedTo, 'class=select-3');?> diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php index 9ad02fe38e..87a00b562e 100644 --- a/module/bug/view/view.html.php +++ b/module/bug/view/view.html.php @@ -20,6 +20,7 @@ $copyParams = "productID=$productID&extra=bugID=$bug->id"; if(!$bug->deleted) { + if(!($bug->status == 'active' and $bug->confirm == 0 and common::printLink('bug', 'confirmBug', $params, $lang->bug->buttonConfirm))) echo $lang->bug->buttonConfirm . ' '; common::printLink('bug', 'edit', $params, $lang->bug->buttonEdit); if(!($bug->status == 'active' and common::printLink('bug', 'resolve', $params, $lang->bug->buttonResolve))) echo $lang->bug->buttonResolve . ' '; if(!($bug->status == 'resolved' and common::printLink('bug', 'close', $params, $lang->bug->buttonClose))) echo $lang->bug->buttonClose . ' '; @@ -45,6 +46,7 @@ deleted) { + if(!($bug->status == 'active' and $bug->confirm == 0 and common::printLink('bug', 'confirmBug', $params, $lang->bug->buttonConfirm))) echo $lang->bug->buttonConfirm . ' '; common::printLink('bug', 'edit', $params, $lang->bug->buttonEdit); if(!($bug->status == 'active' and common::printLink('bug', 'resolve', $params, $lang->bug->buttonResolve))) echo $lang->bug->buttonResolve . ' '; if(!($bug->status == 'resolved' and common::printLink('bug', 'close', $params, $lang->bug->buttonClose))) echo $lang->bug->buttonClose . ' '; @@ -93,6 +95,10 @@ bug->status;?> bug->statusList[$bug->status];?> + + bug->confirm;?> + bug->confirmList[$bug->confirm];?> + bug->lblAssignedTo;?> assignedTo) echo $users[$bug->assignedTo] . $lang->at . $bug->assignedDate;?> diff --git a/module/story/lang/en.php b/module/story/lang/en.php index 09ba0e7d4c..30c1061c27 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -104,7 +104,7 @@ $lang->story->reviewResultList['reject'] = 'Reject'; $lang->story->sourceList[''] = ''; $lang->story->sourceList['custom'] = 'Custom'; -$lang->story->sourceList['PO'] = 'PO'; +$lang->story->sourceList['po'] = 'PO'; $lang->story->sourceList['market'] = 'Market'; $lang->story->sourceList['service'] = 'Service'; $lang->story->sourceList['competitor'] = 'Competitor';