From fd4a36dc8c9405717650e2a6831e5716a180bf15 Mon Sep 17 00:00:00 2001 From: wyd621 Date: Tue, 23 Jul 2013 15:49:47 +0800 Subject: [PATCH 01/17] * finish task #1601. --- module/product/lang/en.php | 2 +- module/product/lang/zh-cn.php | 2 +- module/product/model.php | 13 +++++++++++-- module/productplan/control.php | 1 + module/productplan/view/view.html.php | 4 ++-- module/project/control.php | 1 + module/project/view/story.html.php | 2 +- 7 files changed, 18 insertions(+), 7 deletions(-) diff --git a/module/product/lang/en.php b/module/product/lang/en.php index 59fe8db48a..0553d43a3a 100644 --- a/module/product/lang/en.php +++ b/module/product/lang/en.php @@ -87,5 +87,5 @@ $lang->product->aclList['open'] = 'Default(Having product module prividge, ca $lang->product->aclList['private'] = 'Private(Only project team members can visit)'; $lang->product->aclList['custom'] = 'Whitelist(Project team members and who belongs to the whilelist groups can visit)'; -$lang->product->storySummary = "Total %s stories in this page, estimate %s hours."; +$lang->product->storySummary = "Total %s stories in this page, estimate %s hours, case coverage is %s "; $lang->product->noMatched = 'No matched product including "%s"'; diff --git a/module/product/lang/zh-cn.php b/module/product/lang/zh-cn.php index c39fcffcd9..f2d9e48605 100644 --- a/module/product/lang/zh-cn.php +++ b/module/product/lang/zh-cn.php @@ -87,5 +87,5 @@ $lang->product->aclList['open'] = '默认设置(有产品视图权限,即 $lang->product->aclList['private'] = '私有产品(只有项目团队成员才能访问)'; $lang->product->aclList['custom'] = '自定义白名单(团队成员和白名单的成员可以访问)'; -$lang->product->storySummary = "本页共 %s 个需求,预计 %s 个工时。"; +$lang->product->storySummary = "本页共 %s 个需求,预计 %s 个工时,用例覆盖率%s。"; $lang->product->noMatched = '找不到包含"%s"的产品'; diff --git a/module/product/model.php b/module/product/model.php index 4684fd2657..0420ab3686 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -593,8 +593,17 @@ class productModel extends model public function summary($stories) { $totalEstimate = 0.0; - foreach($stories as $key => $story) $totalEstimate += $story->estimate; - return sprintf($this->lang->product->storySummary, count($stories), $totalEstimate); + $storyIDs = array(); + + foreach($stories as $key => $story) + { + $totalEstimate += $story->estimate; + $storyIDs[] = $story->id; + } + + $cases = $this->dao->select('DISTINCT story')->from(TABLE_CASE)->where('story')->in($storyIDs)->fetchAll(); + + return sprintf($this->lang->product->storySummary, count($stories), $totalEstimate, round(count($cases) / count($stories), 2) * 100 . "%"); } /** diff --git a/module/productplan/control.php b/module/productplan/control.php index cae57c9e62..c03394fcc5 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -145,6 +145,7 @@ class productplan extends control $this->view->position[] = $this->lang->productplan->view; $this->view->planStories= $this->loadModel('story')->getPlanStories($planID); $this->view->products = $products; + $this->view->summary = $this->product->summary($this->view->planStories); $this->view->plan = $plan; $this->view->actions = $this->loadModel('action')->getList('productplan', $planID); $this->view->users = $this->loadModel('user')->getPairs('noletter'); diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index d31d2e7f89..44c854a859 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -103,7 +103,7 @@ -
+
-
product->storySummary, count($planStories), $totalEstimate);?>
+
diff --git a/module/project/control.php b/module/project/control.php index 52e752623c..80cda053a1 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -537,6 +537,7 @@ class project extends control $this->view->position = $position; $this->view->productID = $productID; $this->view->stories = $stories; + $this->view->summary = $this->product->summary($stories); $this->view->orderBy = $orderBy; $this->view->storyTasks = $storyTasks; $this->view->tabID = 'story'; diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php index 409e419ad9..752024e5f4 100644 --- a/module/project/view/story.html.php +++ b/module/project/view/story.html.php @@ -110,7 +110,7 @@ echo html::commonButton($lang->close, "onclick=\"changeAction('projectStoryForm', 'batchClose', '$actionLink')\""); } } - printf($lang->product->storySummary, count($stories), $totalEstimate); + echo $summary; ?>
From abad7c0939f9f799a32629a54688661aa8db7901 Mon Sep 17 00:00:00 2001 From: wyd621 Date: Tue, 23 Jul 2013 16:46:36 +0800 Subject: [PATCH 02/17] * finish task #1595. --- module/build/model.php | 44 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/module/build/model.php b/module/build/model.php index f05ad8c029..29d5f5a1a0 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -122,7 +122,11 @@ class buildModel extends model ->remove('allchecker') ->add('project', (int)$projectID)->get(); $this->dao->insert(TABLE_BUILD)->data($build)->autoCheck()->batchCheck($this->config->build->create->requiredFields, 'notempty')->check('name', 'unique', "product = {$build->product}")->exec(); - if(!dao::isError()) return $this->dao->lastInsertID(); + if(!dao::isError()) + { + $this->updateLinkedBug($build); + return $this->dao->lastInsertID(); + } } /** @@ -149,6 +153,42 @@ class buildModel extends model ->where('id')->eq((int)$buildID) ->check('name','unique', "id != $buildID AND product = {$build->product}") ->exec(); - if(!dao::isError()) return common::createChanges($oldBuild, $build); + if(!dao::isError()) + { + $this->updateLinkedBug($build); + return common::createChanges($oldBuild, $build); + } + } + + /** + * Update linked bug to resolved. + * + * @param object $build + * @access public + * @return void + */ + public function updateLinkedBug($build) + { + $bugs = $this->dao->select('*')->from(TABLE_BUG)->where('id')->in($build->bugs)->fetchAll(); + $now = helper::now(); + + $this->loadModel('action'); + foreach($bugs as $bug) + { + if($bug->status == 'resolved') continue; + + $bug->resolvedBy = $this->app->user->account; + $bug->resolvedDate = $now; + $bug->status = 'resolved'; + $bug->confirmed = 1; + $bug->assignedDate = $now; + $bug->assignedTo = $bug->openedBy; + $bug->lastEditedBy = $this->app->user->account; + $bug->lastEditedDate = $now; + $bug->resolution = 'fixed'; + $bug->resolvedBuild = $build->name; + $this->dao->update(TABLE_BUG)->data($bug)->where('id')->eq($bug->id)->exec(); + $this->action->create('bug', $bug->id, 'Resolved', '', 'fixed'); + } } } From ce358e310c4e4a4645e98ada9cb696c2e479192f Mon Sep 17 00:00:00 2001 From: xia0ta0 Date: Wed, 24 Jul 2013 10:48:14 +0800 Subject: [PATCH 03/17] * compatible with that of model::delete(). --- module/tree/model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/tree/model.php b/module/tree/model.php index b563bb81f6..487f2ab7a7 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -928,10 +928,11 @@ class treeModel extends model * Delete a module. * * @param int $moduleID + * @param null $null compatible with that of model::delete() * @access public * @return void */ - public function delete($moduleID) + public function delete($moduleID, $null = null) { $module = $this->getById($moduleID); $childs = $this->getAllChildId($moduleID); From 922c7edf3f24ccefacfe7e5fea427943d7d5c1fa Mon Sep 17 00:00:00 2001 From: xia0ta0 Date: Wed, 24 Jul 2013 10:49:34 +0800 Subject: [PATCH 04/17] * compatible with that of model::delete(). --- module/group/model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/group/model.php b/module/group/model.php index 29d7b7c0fb..aa02e19f17 100644 --- a/module/group/model.php +++ b/module/group/model.php @@ -182,10 +182,11 @@ class groupModel extends model * Delete a group. * * @param int $groupID + * @param null $null compatible with that of model::delete() * @access public * @return void */ - public function delete($groupID) + public function delete($groupID, $null = null) { $this->dao->delete()->from(TABLE_GROUP)->where('id')->eq($groupID)->exec(); $this->dao->delete()->from(TABLE_USERGROUP)->where('`group`')->eq($groupID)->exec(); From ac1b8095b2697209d2d43bafd6e64d3aac2fabab Mon Sep 17 00:00:00 2001 From: xia0ta0 Date: Wed, 24 Jul 2013 10:50:11 +0800 Subject: [PATCH 05/17] * compatible with that of model::delete(). --- module/dept/model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/dept/model.php b/module/dept/model.php index fb551eeca6..2898370902 100644 --- a/module/dept/model.php +++ b/module/dept/model.php @@ -298,10 +298,11 @@ class deptModel extends model * Delete a department. * * @param int $deptID + * @param null $null compatible with that of model::delete() * @access public * @return void */ - public function delete($deptID) + public function delete($deptID, $null = null) { $this->dao->delete()->from(TABLE_DEPT)->where('id')->eq($deptID)->exec(); } From 901d6f326d954e13e58617cb20fe2b80ba0f3be7 Mon Sep 17 00:00:00 2001 From: azhi Date: Wed, 24 Jul 2013 14:05:30 +0800 Subject: [PATCH 06/17] * finish task#1614. --- module/bug/js/common.js | 3 ++- module/bug/lang/en.php | 4 +++- module/bug/lang/zh-cn.php | 4 +++- module/bug/model.php | 4 ++++ module/bug/view/assignto.html.php | 6 +++--- module/bug/view/confirmbug.html.php | 7 +++---- module/bug/view/create.html.php | 8 ++++---- module/bug/view/edit.html.php | 12 ++++++------ module/story/lang/en.php | 5 ++++- module/story/lang/zh-cn.php | 5 ++++- module/story/model.php | 5 +++++ module/story/view/create.html.php | 4 ++-- module/story/view/edit.html.php | 12 ++++++------ module/story/view/header.html.php | 15 ++++++++++----- module/story/view/review.html.php | 2 +- module/task/js/create.js | 3 ++- module/task/js/edit.js | 3 ++- module/task/lang/en.php | 4 +++- module/task/lang/zh-cn.php | 4 +++- module/task/model.php | 2 ++ module/task/view/create.html.php | 9 ++++----- module/task/view/edit.html.php | 5 ++--- module/user/control.php | 17 ++++++++++++----- www/js/my.full.js | 5 +++-- 24 files changed, 93 insertions(+), 55 deletions(-) diff --git a/module/bug/js/common.js b/module/bug/js/common.js index a32cc168da..0406661ea4 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -17,7 +17,8 @@ $(function() { $("#story").chosen({no_results_text:noResultsMatch}); $("#task").chosen({no_results_text:noResultsMatch}); - $("#mailto").autocomplete(userList, { multiple: true, mustMatch: true}); + $("#mailto").chosen({no_results_text:noResultsMatch}); + $(".chzn-container-multi .chzn-choices li.search-field input").attr('value', mailto); } }); diff --git a/module/bug/lang/en.php b/module/bug/lang/en.php index 09506b40eb..5ba3ad9eb3 100644 --- a/module/bug/lang/en.php +++ b/module/bug/lang/en.php @@ -358,5 +358,7 @@ $lang->bug->action->tostory = array('main' => '$date, To story by $acto $lang->bug->action->totask = array('main' => '$date, To task by $actor, ID is $extra.'); $lang->bug->placeholder = new stdclass(); -$lang->bug->placeholder->mailto = 'you can input the user account to select users to mail to.'; $lang->bug->placeholder->chooseBuilds = 'Choose builds...'; + +$lang->bug->chosen = new stdClass(); +$lang->bug->chosen->mailto = 'Select users to mail...'; diff --git a/module/bug/lang/zh-cn.php b/module/bug/lang/zh-cn.php index d8055a9828..af67720f5e 100644 --- a/module/bug/lang/zh-cn.php +++ b/module/bug/lang/zh-cn.php @@ -358,5 +358,7 @@ $lang->bug->action->tostory = array('main' => '$date, 由 $actorbug->action->totask = array('main' => '$date, 由 $actor 导入为任务,编号为 $extra。'); $lang->bug->placeholder = new stdclass(); -$lang->bug->placeholder->mailto = '输入用户名自动选择'; $lang->bug->placeholder->chooseBuilds = '选择相关版本...'; + +$lang->bug->chosen = new stdClass(); +$lang->bug->chosen->mailto = '输入用户名自动选择...'; diff --git a/module/bug/model.php b/module/bug/model.php index 992c97c30b..85738aa33f 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -51,6 +51,7 @@ class bugModel extends model ->specialChars('title,keyword') ->cleanInt('product, module, severity') ->join('openedBuild', ',') + ->join('mailto', ',') ->remove('files, labels') ->get(); $this->dao->insert(TABLE_BUG)->data($bug)->autoCheck()->batchCheck($this->config->bug->create->requiredFields, 'notempty')->exec(); @@ -208,6 +209,7 @@ class bugModel extends model ->add('lastEditedBy', $this->app->user->account) ->add('lastEditedDate', $now) ->join('openedBuild', ',') + ->join('mailto', ',') ->setIF($this->post->assignedTo != $oldBug->assignedTo, 'assignedDate', $now) ->setIF($this->post->resolvedBy != '' and $this->post->resolvedDate == '', 'resolvedDate', $now) ->setIF($this->post->resolution != '' and $this->post->resolvedDate == '', 'resolvedDate', $now) @@ -332,6 +334,7 @@ class bugModel extends model ->setDefault('lastEditedDate', $now) ->setDefault('assignedDate', $now) ->remove('comment') + ->join('mailto', ',') ->get(); $this->dao->update(TABLE_BUG) @@ -358,6 +361,7 @@ class bugModel extends model ->setDefault('lastEditedBy', $this->app->user->account) ->setDefault('lastEditedDate', $now) ->remove('comment') + ->join('mailto', ',') ->get(); $this->dao->update(TABLE_BUG)->data($bug)->where('id')->eq($bugID)->exec(); diff --git a/module/bug/view/assignto.html.php b/module/bug/view/assignto.html.php index 297b486885..c7bd08f39f 100644 --- a/module/bug/view/assignto.html.php +++ b/module/bug/view/assignto.html.php @@ -13,10 +13,10 @@ bug->placeholder); -js::set('userList', array_keys($users)); js::set('page', 'assignedto'); +js::set('mailto', $lang->bug->chosen->mailto); ?>
@@ -27,7 +27,7 @@ js::set('page', 'assignedto'); - + diff --git a/module/bug/view/confirmbug.html.php b/module/bug/view/confirmbug.html.php index dd46c2ba65..2af3175df6 100755 --- a/module/bug/view/confirmbug.html.php +++ b/module/bug/view/confirmbug.html.php @@ -13,12 +13,11 @@ bug->placeholder); -js::set('userList', array_keys($users)); js::set('page', 'confirmbug'); +js::set('mailto', $lang->bug->chosen->mailto); ?> -
bug->mailto;?>mailto, 'class="text-1"');?>mailto), 'class="text-1" multiple');?>
comment;?>
@@ -28,7 +27,7 @@ js::set('page', 'confirmbug'); - + diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index 8e3dce804a..33895507c3 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -13,12 +13,12 @@ bug->placeholder); -js::set('userList', array_keys($users)); js::set('page', 'create'); +js::set('mailto', $lang->bug->chosen->mailto); ?> @@ -85,8 +85,8 @@ js::set('page', 'create'); diff --git a/module/bug/view/edit.html.php b/module/bug/view/edit.html.php index 488508221b..b996186492 100644 --- a/module/bug/view/edit.html.php +++ b/module/bug/view/edit.html.php @@ -13,7 +13,7 @@ story); js::set('oldTaskID' , $bug->task); js::set('oldOpenedBuild' , $bug->openedBuild); js::set('oldResolvedBuild' , $bug->resolvedBuild); -js::set('userList' , array_keys($users)); +js::set('mailto' , $lang->bug->chosen->mailto); ?> @@ -119,6 +119,10 @@ js::set('userList' , array_keys($users)); + + + +
title;?>
bug->mailto;?>mailto, 'class="text-1"');?>mailto), 'class="text-1" multiple');?>
comment;?>bug->lblMailto;?>
bug->keywords;?> keywords, 'class="text-3"');?>
bug->mailto;?>mailto), 'class="text-3" multiple');?>
@@ -185,10 +189,6 @@ js::set('userList' , array_keys($users));
bug->legendMisc;?> - - - - diff --git a/module/story/lang/en.php b/module/story/lang/en.php index 05ecd81f06..d6c422e334 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -265,4 +265,7 @@ $lang->story->report->storysPerChange->graph->xAxisName = 'Change'; $lang->story->placeholder = new stdclass(); $lang->story->placeholder->estimate = 'Estimate the story point.'; -$lang->story->placeholder->mailto = 'Mail to'; + +$lang->story->chosen = new stdClass(); +$lang->story->chosen->reviewedBy = 'Choose users who review...'; +$lang->story->chosen->mailto = 'Choose users to mail...'; diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 6d7b51a68c..4bb2360781 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -265,4 +265,7 @@ $lang->story->report->storysPerChange->graph->xAxisName = '变更次数'; $lang->story->placeholder = new stdclass(); $lang->story->placeholder->estimate = "完成该需求的工作量"; -$lang->story->placeholder->mailto = '输入用户名自动完成'; + +$lang->story->chosen = new stdClass(); +$lang->story->chosen->reviewedBy = '选择评审人...'; +$lang->story->chosen->mailto = '输入用户名自动完成...'; diff --git a/module/story/model.php b/module/story/model.php index a73f52a634..fa7cbe9aec 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -119,6 +119,7 @@ class storyModel extends model ->setIF($projectID > 0, 'stage', 'projected') ->setIF($bugID > 0, 'fromBug', $bugID) ->remove('files,labels,spec,verify,needNotReview,newStory') + ->join('mailto', ',') ->get(); $this->dao->insert(TABLE_STORY)->data($story)->autoCheck()->batchCheck($this->config->story->create->requiredFields, 'notempty')->exec(); @@ -333,6 +334,8 @@ class storyModel extends model ->setIF($this->post->closedBy != false or $this->post->closedReason != false, 'status', 'closed') ->setIF($this->post->closedReason != false and $this->post->closedBy == false, 'closedBy', $this->app->user->account) ->remove('files,labels,comment') + ->join('reviewedBy', ',') + ->join('mailto', ',') ->get(); $this->dao->update(TABLE_STORY) @@ -459,7 +462,9 @@ class storyModel extends model ->removeIF($this->post->result != 'reject', 'closedReason, duplicateStory, childStories') ->removeIF($this->post->result == 'reject' and $this->post->closedReason != 'duplicate', 'duplicateStory') ->removeIF($this->post->result == 'reject' and $this->post->closedReason != 'subdivided', 'childStories') + ->join('reviewedBy', ',') ->get(); + $this->dao->update(TABLE_STORY)->data($story) ->autoCheck() ->batchCheck($this->config->story->review->requiredFields, 'notempty') diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index 88496a58ab..282833f892 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -60,8 +60,8 @@ diff --git a/module/story/view/edit.html.php b/module/story/view/edit.html.php index 4d038df099..db22fc6e69 100644 --- a/module/story/view/edit.html.php +++ b/module/story/view/edit.html.php @@ -84,6 +84,10 @@ + + + +
bug->mailto;?>mailto, 'class="text-3"');?>
bug->linkBug;?> linkBug, 'class="text-3"');?>story->mailto;?>
story->keywords;?> keywords, 'class=text-1');?>
story->mailto;?>mailto), "class='select-1' multiple");?>
@@ -100,7 +104,7 @@ reviewedBy):?> story->reviewedBy;?> - reviewedBy, 'class="area-1"');?> + reviewedBy), 'class="area-1" multiple');?> status == 'closed'):?> @@ -131,11 +135,7 @@ story->childStories;?> childStories, "class='text-1'");?> - - story->mailto;?> - mailto, "class='area-1'");?> - - +
diff --git a/module/story/view/header.html.php b/module/story/view/header.html.php index 64fce3444f..57a8322bb7 100644 --- a/module/story/view/header.html.php +++ b/module/story/view/header.html.php @@ -1,7 +1,8 @@ - + - +story->chosen->reviewedBy);?> +story->chosen->mailto);?> diff --git a/module/story/view/review.html.php b/module/story/view/review.html.php index 0cafb1cfd2..e910380e00 100644 --- a/module/story/view/review.html.php +++ b/module/story/view/review.html.php @@ -49,7 +49,7 @@ var assignedTo = 'lastEditedBy ? print($story->lastEditedBy) : pri story->reviewedBy;?> - user->account . ', ', 'class=text-1');?> + user->account, "class='text-1' multiple");?> story->comment;?> diff --git a/module/task/js/create.js b/module/task/js/create.js index f0fe84f665..2646f4cd1e 100644 --- a/module/task/js/create.js +++ b/module/task/js/create.js @@ -85,5 +85,6 @@ $(document).ready(function() { setPreview(); $("#story").chosen({no_results_text: noResultsMatch}); - $("#mailto").autocomplete(userList, { multiple: true, mustMatch: true}); + $("#mailto").chosen({no_results_text: noResultsMatch}); + $("#mailto_chzn .chzn-choices li.search-field input").attr('value', mailto); }); diff --git a/module/task/js/edit.js b/module/task/js/edit.js index 141aac0ca2..931ccf6656 100644 --- a/module/task/js/edit.js +++ b/module/task/js/edit.js @@ -1,7 +1,8 @@ $(function() { $("#story").chosen({no_results_text: noResultsMatch}); - $("#mailto").autocomplete(userList, { multiple: true, mustMatch: true}); + $("#mailto").chosen({no_results_text: noResultsMatch}); + $("#mailto_chzn .chzn-choices li.search-field input").attr('value', mailto); $('.iframe').colorbox({width:900, height:500, iframe:true, transition:'none', onCleanup:function(){parent.location.href=parent.location.href;}}); }) diff --git a/module/task/lang/en.php b/module/task/lang/en.php index b875a24e2f..69f62abec4 100644 --- a/module/task/lang/en.php +++ b/module/task/lang/en.php @@ -233,4 +233,6 @@ $lang->task->report->finishedTasksPerDay->graph->rotateNames = '1'; $lang->task->placeholder = new stdclass(); $lang->task->placeholder->estimate = 'The estimated time for this task'; -$lang->task->placeholder->mailto = 'Mail to'; + +$lang->task->chosen = new stdclass(); +$lang->task->chosen->mailto = 'Choose users to mail...'; diff --git a/module/task/lang/zh-cn.php b/module/task/lang/zh-cn.php index c9e66a9198..3fc1d06340 100644 --- a/module/task/lang/zh-cn.php +++ b/module/task/lang/zh-cn.php @@ -233,4 +233,6 @@ $lang->task->report->finishedTasksPerDay->graph->rotateNames = '1'; $lang->task->placeholder = new stdclass(); $lang->task->placeholder->estimate = '对该任务最初的预计'; -$lang->task->placeholder->mailto = '输入用户名进行选择'; + +$lang->task->chosen = new stdclass(); +$lang->task->chosen->mailto = '输入用户名进行选择...'; diff --git a/module/task/model.php b/module/task/model.php index f61cc1a59b..fc538ee2b4 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -41,6 +41,7 @@ class taskModel extends model ->setDefault('openedBy', $this->app->user->account) ->setDefault('openedDate', helper::now()) ->remove('after,files,labels') + ->join('mailto', ',') ->get(); if($assignedTo) $task->assignedDate = helper::now(); @@ -171,6 +172,7 @@ class taskModel extends model ->add('lastEditedBy', $this->app->user->account) ->add('lastEditedDate', $now) ->remove('comment,files,labels') + ->join('mailto', ',') ->get(); $task->statusCustom = strpos(self::CUSTOM_STATUS_ORDER, $task->status) + 1; diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index b199b08b0a..efb79ab61d 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -13,11 +13,10 @@ - -task->placeholder);?> - +task->placeholder);?> +task->chosen->mailto);?> diff --git a/module/task/view/edit.html.php b/module/task/view/edit.html.php index d665ae1519..4aef81e032 100644 --- a/module/task/view/edit.html.php +++ b/module/task/view/edit.html.php @@ -13,12 +13,11 @@ - -story); ?> task->confirmChangeProject); ?> +task->chosen->mailto);?>
TASK #id . $lang->colon . html::input('name', $task->name, 'class="text-1"');?>
@@ -82,7 +81,7 @@
- +
@@ -84,8 +83,8 @@
task->mailto;?> mailto, 'class="text-1"'); - if($contactLists) echo html::select('', $contactLists, '', "onchange=\"setMailto('mailto', this.value)\""); + echo html::select('mailto[]', $users, str_replace(' ', '', $task->mailto), 'class="text-1" multiple'); + if($contactLists) echo html::select('', $contactLists, '', "class='f-right' onchange=\"setMailto('mailto', this.value)\""); ?>
task->mailto;?>mailto, 'class="text-1"');?>mailto), 'class="text-1" multiple');?>
diff --git a/module/user/control.php b/module/user/control.php index 54b05b7fc5..400324b9de 100644 --- a/module/user/control.php +++ b/module/user/control.php @@ -901,12 +901,19 @@ class user extends control */ public function ajaxGetContactUsers($contactListID) { - $list = $this->user->getContactListByID($contactListID); - if($list) + if(!$contactListID) { - $users = str_replace(',', ', ', $list->userList) . ', '; - echo $users; + $users = $this->user->getPairs('nodeleted,devfirst'); + echo html::select('mailto[]', $users, '', "class='text-1' multiple"); + } + else + { + $list = $this->user->getContactListByID($contactListID); + if($list) + { + $users = explode(',', $list->userList); + echo html::select('mailto[]', $users, '', "class='text-1' multiple"); + } } - die(); } } diff --git a/www/js/my.full.js b/www/js/my.full.js index fbdd0a4cf4..08cdd2145c 100644 --- a/www/js/my.full.js +++ b/www/js/my.full.js @@ -483,11 +483,12 @@ function setExport() */ function setMailto(mailto, contactListID) { - if(!contactListID) return; link = createLink('user', 'ajaxGetContactUsers', 'listID=' + contactListID); $.get(link, function(users) { - $('#' + mailto).val(users); + $('#' + mailto).replaceWith(users); + $('#' + mailto + '_chzn').remove(); + $('#' + mailto).chosen({no_results_text: noResultsMatch}); }); } From 0d1a23a5264346d2355b0f62c63ddd7c33577018 Mon Sep 17 00:00:00 2001 From: xia0ta0 Date: Wed, 24 Jul 2013 14:16:23 +0800 Subject: [PATCH 07/17] * code for task#1589. --- module/bug/lang/en.php | 1 + module/bug/lang/zh-cn.php | 1 + module/bug/model.php | 36 ++++++++-- module/productplan/control.php | 95 +++++++++++++++++++++++++ module/productplan/lang/en.php | 7 ++ module/productplan/lang/zh-cn.php | 7 ++ module/productplan/model.php | 32 +++++++++ module/productplan/view/browse.html.php | 1 + www/theme/default/style.css | 2 + 9 files changed, 177 insertions(+), 5 deletions(-) diff --git a/module/bug/lang/en.php b/module/bug/lang/en.php index 09506b40eb..9d53c3a98c 100644 --- a/module/bug/lang/en.php +++ b/module/bug/lang/en.php @@ -25,6 +25,7 @@ $lang->bug->severityAB = 'S'; $lang->bug->pri = 'Priority'; $lang->bug->type = 'Type'; $lang->bug->os = 'OS'; +$lang->bug->plan = 'Plan'; $lang->bug->hardware = 'Hardware'; $lang->bug->browser = 'Browser'; $lang->bug->machine = 'Machine'; diff --git a/module/bug/lang/zh-cn.php b/module/bug/lang/zh-cn.php index d8055a9828..3724a0f68a 100644 --- a/module/bug/lang/zh-cn.php +++ b/module/bug/lang/zh-cn.php @@ -25,6 +25,7 @@ $lang->bug->severityAB = '级别'; $lang->bug->pri = '优先级'; $lang->bug->type = 'Bug类型'; $lang->bug->os = '操作系统'; +$lang->bug->plan = '所属计划'; $lang->bug->hardware = '硬件平台'; $lang->bug->browser = '浏览器'; $lang->bug->machine = '机器硬件'; diff --git a/module/bug/model.php b/module/bug/model.php index 992c97c30b..9a035ad698 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -122,6 +122,29 @@ class bugModel extends model ->orderBy($orderBy)->page($pager)->fetchAll(); } + /** + * Get bug list of a plan. + * + * @param int $planID + * @param string $status + * @param string $orderBy + * @param object $pager + * @access public + * @return void + */ + public function getPlanBugs($planID, $status = 'all', $orderBy = 'id_desc', $pager = null) + { + $bugs = $this->dao->select('*')->from(TABLE_BUG) + ->where('plan')->eq((int)$planID) + ->beginIF($status != 'all')->andWhere('status')->in($status)->fi() + ->andWhere('deleted')->eq(0) + ->orderBy($orderBy)->page($pager)->fetchAll('id'); + + $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'bug'); + + return $bugs; + } + /** * Get info of a bug. * @@ -999,12 +1022,15 @@ class bugModel extends model * @access public * @return array */ - public function getAllBugs($productID, $projects, $orderBy, $pager) + public function getAllBugs($productID, $projects, $orderBy, $pager = null) { - $bugs = $this->dao->select('*')->from(TABLE_BUG)->where('product')->eq($productID) - ->andWhere('project')->in(array_keys($projects)) - ->andWhere('deleted')->eq(0) - ->orderBy($orderBy)->page($pager)->fetchAll(); + $bugs = $this->dao->select('t1.*, t2.title as planTitle') + ->from(TABLE_BUG)->alias('t1') + ->leftJoin(TABLE_PRODUCTPLAN)->alias('t2')->on('t1.plan = t2.id') + ->where('t1.product')->eq($productID) + ->andWhere('t1.project')->in(array_keys($projects)) + ->andWhere('t1.deleted')->eq(0) + ->orderBy($orderBy)->page($pager)->fetchAll(); $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'bug'); diff --git a/module/productplan/control.php b/module/productplan/control.php index c03394fcc5..90742a28fe 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -242,4 +242,99 @@ class productplan extends control } die(js::reload('parent')); } + + /** + * Link bugs. + * + * @param int $planID + * @param string $browseType + * @param int $param + * @access public + * @return void + */ + public function linkBug($planID = 0, $browseType = '', $param = 0) + { + $this->session->set('bugList', $this->app->getURI(true)); + + if(!empty($_POST['bugs'])) $this->productplan->linkBug($planID); + + $this->loadModel('bug'); + $plan = $this->productplan->getByID($planID); + $this->commonAction($plan->product); + $products = $this->product->getPairs(); + $productID = $plan->product; + $queryID = ($browseType == 'bysearch') ? (int)$param : 0; + + /* Build the search form. */ + $this->config->bug->search['actionURL'] = $this->createLink('bug', 'browse', "productID={$plan->product}&browseType=bySearch&queryID=myQueryID"); + $this->config->bug->search['queryID'] = $queryID; + $this->config->bug->search['params']['product']['values'] = array($productID => $products[$productID], 'all' => $this->lang->bug->allProduct); + $this->config->bug->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0); + $this->config->bug->search['params']['project']['values'] = $this->product->getProjectPairs($productID); + $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getProductBuildPairs($productID); + $this->config->bug->search['params']['resolvedBuild']['values'] = $this->build->getProductBuildPairs($productID); + $this->loadModel('search')->setSearchParams($this->config->bug->search); + + if($browseType == 'bySearch') + { + $allBugs = $this->bug->getBySearch($plan->product, $queryID, 'id'); + foreach($allBugs as $key => $bug) + { + if($bug->status != 'active') unset($allBugs[$key]); + } + } + else + { + $projects = $this->loadModel('project')->getPairs(); + $projects[0] = ''; + $allBugs= $this->loadModel('bug')->getAllBugs($this->view->product->id, $projects, 'id_desc'); + } + + $this->view->title = $this->lang->productplan->linkBug; + $this->view->position[] = $this->lang->productplan->linkBug; + $this->view->allBugs = $allBugs; + $this->view->planBugs = $this->bug->getPlanBugs($planID); + $this->view->products = $products; + $this->view->plan = $plan; + $this->view->plans = $this->dao->select('id, end')->from(TABLE_PRODUCTPLAN)->fetchPairs(); + $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->display(); + } + + /** + * Unlink story + * + * @param int $bugID + * @param string $confirm yes|no + * @access public + * @return void + */ + public function unlinkBug($bugID, $confirm = 'no') + { + if($confirm == 'no') + { + die(js::confirm($this->lang->productplan->confirmUnlinkBug, $this->createLink('productplan', 'unlinkbug', "bugID=$bugID&confirm=yes"))); + } + else + { + $this->productplan->unlinkBug($bugID); + die(js::reload('parent')); + } + } + + /** + * Batch unlink story. + * + * @param string $confirm + * @access public + * @return void + */ + public function batchUnlinkBug($confirm = 'no') + { + foreach($this->post->unlinkBugs as $bugID) + { + $this->productplan->unlinkBug($bugID); + } + die(js::reload('parent')); + } } diff --git a/module/productplan/lang/en.php b/module/productplan/lang/en.php index f57ac92cb7..c5d9588d69 100644 --- a/module/productplan/lang/en.php +++ b/module/productplan/lang/en.php @@ -22,8 +22,15 @@ $lang->productplan->batchUnlinkStory = "Batch Remove"; $lang->productplan->linkedStories = 'Stories linked'; $lang->productplan->unlinkedStories = 'Stories unlinked'; +$lang->productplan->linkBug = "Link bug"; +$lang->productplan->unlinkBug = "Remove bug"; +$lang->productplan->batchUnlinkBug = "Batch Remove"; +$lang->productplan->linkedBugs = 'Bugs linked'; +$lang->productplan->unlinkedBugs = 'Bugs unlinked'; + $lang->productplan->confirmDelete = "Are you sure to delete this plan?"; $lang->productplan->confirmUnlinkStory = "Are you sure to remove this story?"; +$lang->productplan->confirmUnlinkBug = "Are you sure to remove this bug?"; $lang->productplan->basicInfo ='Basic Info'; diff --git a/module/productplan/lang/zh-cn.php b/module/productplan/lang/zh-cn.php index 6df2e4af13..918b1e9e1d 100644 --- a/module/productplan/lang/zh-cn.php +++ b/module/productplan/lang/zh-cn.php @@ -22,8 +22,15 @@ $lang->productplan->batchUnlinkStory = "批量移除"; $lang->productplan->linkedStories = '已关联需求列表'; $lang->productplan->unlinkedStories = '未关联需求列表'; +$lang->productplan->linkBug = "关联Bug"; +$lang->productplan->unlinkBug = "移除需求"; +$lang->productplan->batchUnlinkBug = "批量移除"; +$lang->productplan->linkedBugs = '已关联Bug列表'; +$lang->productplan->unlinkedBugs = '未关联Bug列表'; + $lang->productplan->confirmDelete = "您确认删除该计划吗?"; $lang->productplan->confirmUnlinkStory = "您确认移除该需求吗?"; +$lang->productplan->confirmUnlinkBug = "您确认移除该Bug吗?"; $lang->productplan->basicInfo ='基本信息'; diff --git a/module/productplan/model.php b/module/productplan/model.php index 1ffaf6ba4b..8b9d9301b1 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -152,4 +152,36 @@ class productplanModel extends model $this->loadModel('story')->setStage($storyID); $this->loadModel('action')->create('story', $storyID, 'unlinkedfromplan', '', $planID); } + + /** + * Link bugs. + * + * @param int $planID + * @access public + * @return void + */ + public function linkBug($planID) + { + $this->loadModel('story'); + $this->loadModel('action'); + foreach($this->post->bugs as $bugID) + { + $this->dao->update(TABLE_BUG)->set('plan')->eq((int)$planID)->where('id')->eq((int)$bugID)->exec(); + $this->action->create('bug', $bugID, 'linked2plan', '', $planID); + } + } + + /** + * Unlink bug. + * + * @param int $bugID + * @access public + * @return void + */ + public function unlinkBug($bugID) + { + $planID = $this->dao->findByID($bugID)->from(TABLE_BUG)->fields('plan')->fetch('plan'); + $this->dao->update(TABLE_BUG)->set('plan')->eq(0)->where('id')->eq((int)$bugID)->exec(); + $this->loadModel('action')->create('bug', $bugID, 'unlinkedfromplan', '', $bugID); + } } diff --git a/module/productplan/view/browse.html.php b/module/productplan/view/browse.html.php index 82fc6e9e46..7b14b34c88 100644 --- a/module/productplan/view/browse.html.php +++ b/module/productplan/view/browse.html.php @@ -37,6 +37,7 @@ end;?> id", '', 'list'); common::printIcon('productplan', 'linkStory', "planID=$plan->id", '', 'list'); common::printIcon('productplan', 'edit', "planID=$plan->id", '', 'list'); common::printIcon('productplan', 'delete', "planID=$plan->id", '', 'list', '', 'hiddenwin'); diff --git a/www/theme/default/style.css b/www/theme/default/style.css index 5e908462b2..6ffa6c4850 100644 --- a/www/theme/default/style.css +++ b/www/theme/default/style.css @@ -488,6 +488,8 @@ table.tablesorter thead tr .headerSortDown {background-image: url(./images/table .icon-green-productplan-unlinkStory {padding:2px 5px 2px 10px; background:url(images/main/zt-icons.png) -60px 0px;} .icon-green-project-linkStory, .icon-green-productplan-linkStory {padding:2px 3px 2px 10px; background:url(images/main/zt-icons.png) -161px -201px;} +.icon-green-productplan-linkBug {padding:2px 8px; background:url(images/main/zt-icons.png) 0px -282px;} + #featurebar .f-right .icon-green-story-create, .icon-green-story-create {padding:2px 7px 2px 10px; background:url(images/main/zt-icons.png) 0px -202px;} #featurebar .f-right .icon-green-story-batchCreate {padding:2px 7px 2px 10px; background:url(images/main/zt-icons.png) -20px -202px;} From 0e16e462b5a28700bd0ad73303b93d48f00bfec8 Mon Sep 17 00:00:00 2001 From: xia0ta0 Date: Wed, 24 Jul 2013 14:19:24 +0800 Subject: [PATCH 08/17] * code for task#1589. --- module/productplan/view/view.html.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index 44c854a859..9a850d0c4b 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -27,6 +27,7 @@ $browseLink = $this->session->productPlanList ? $this->session->productPlanList : inlink('browse', "planID=$plan->id"); if(!$plan->deleted) { + common::printIcon('productplan', 'linkBug', "planID=$plan->id"); common::printIcon('productplan', 'linkStory',"planID=$plan->id"); common::printIcon('productplan', 'edit', "planID=$plan->id"); common::printIcon('productplan', 'delete', "planID=$plan->id", '', 'button', '', 'hiddenwin'); From a3a214318c2400bbf0d1d8724dea78d1491d55ef Mon Sep 17 00:00:00 2001 From: azhi Date: Wed, 24 Jul 2013 14:41:02 +0800 Subject: [PATCH 09/17] * finish task#1602. --- module/project/css/story.css | 2 ++ module/project/view/story.html.php | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/module/project/css/story.css b/module/project/css/story.css index 5a4b11ebb9..23139c7980 100644 --- a/module/project/css/story.css +++ b/module/project/css/story.css @@ -1,2 +1,4 @@ .icon-green-task-create {padding:2px 7px 2px 10px; background:url(theme/default/images/main/zt-icons.png) -120px -200px;} .icon-green-task-batchCreate {padding:2px 10px 2px 10px; background:url(theme/default/images/main/zt-icons.png) -199px -200px;} + +.icon-green-testcase-create {padding:2px 7px 2px 10px; background:url(theme/default/images/main/zt-icons.png) -80px -322px;} diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php index 752024e5f4..633bc63a15 100644 --- a/module/project/view/story.html.php +++ b/module/project/view/story.html.php @@ -39,13 +39,13 @@ statusAB);?> story->stageAB);?> story->taskCount;?> - actions;?> + actions;?> $story):?> @@ -83,6 +83,8 @@ $lang->task->batchCreate = $lang->project->batchWBS; common::printIcon('task', 'batchCreate', "projectID={$project->id}&story={$story->id}", '', 'list'); + if($productID) common::printIcon('story', 'createCase', "productID=$story->product&moduleID=0&from=¶m=0&storyID=$story->id", '', 'list', 'createCase'); + $lang->project->unlinkStory = $lang->unlink; common::printIcon('project', 'unlinkStory', $param, '', 'list', '', 'hiddenwin'); ?> From f543d606f1ae0ee65523e960d0e9aae252e490f2 Mon Sep 17 00:00:00 2001 From: xia0ta0 Date: Wed, 24 Jul 2013 14:43:35 +0800 Subject: [PATCH 10/17] * fix a bug : printRPN is a static method. --- module/common/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/common/control.php b/module/common/control.php index 8231c4c048..38215f4aec 100644 --- a/module/common/control.php +++ b/module/common/control.php @@ -340,7 +340,7 @@ class common extends control * @access public * @return void */ - public function printRPN($backLink, $preAndNext = '') + static public function printRPN($backLink, $preAndNext = '') { global $lang, $app; if(isonlybody()) return false; From 85fd31912ab0011e16ce72f3288fd8c8598cb4da Mon Sep 17 00:00:00 2001 From: xia0ta0 Date: Wed, 24 Jul 2013 14:48:57 +0800 Subject: [PATCH 11/17] * fix a bug: inlink, not $this->inlink. --- module/common/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/common/control.php b/module/common/control.php index 38215f4aec..0b8e132e1e 100644 --- a/module/common/control.php +++ b/module/common/control.php @@ -364,7 +364,7 @@ class common extends control $title = isset($preAndNext->next->title) ? $preAndNext->next->title : $preAndNext->next->name; $title = '#' . $preAndNext->next->$id . ' ' . $title; echo ""; - echo html::a($this->inLink('view', "ID={$preAndNext->next->$id}"), ' ', '', "id='next' class='icon-next' title='$title'"); + echo html::a(inLink('view', "ID={$preAndNext->next->$id}"), ' ', '', "id='next' class='icon-next' title='$title'"); echo ""; } } From 4206d6b89e93ea7e26084807312340ca0947d186 Mon Sep 17 00:00:00 2001 From: xia0ta0 Date: Wed, 24 Jul 2013 15:02:02 +0800 Subject: [PATCH 12/17] * code for task#1589. --- module/bug/lang/en.php | 8 +- module/bug/lang/zh-cn.php | 8 +- module/productplan/lang/zh-cn.php | 2 +- module/productplan/view/linkbug.html.php | 108 +++++++++++++++++++++++ www/theme/default/style.css | 2 +- 5 files changed, 120 insertions(+), 8 deletions(-) create mode 100644 module/productplan/view/linkbug.html.php diff --git a/module/bug/lang/en.php b/module/bug/lang/en.php index 05a36d7f25..c37a3fbe8a 100644 --- a/module/bug/lang/en.php +++ b/module/bug/lang/en.php @@ -354,9 +354,11 @@ $lang->bug->report->bugHistories->graph->xAxisName = 'Histories'; /* 操作记录。*/ $lang->bug->action = new stdclass(); -$lang->bug->action->resolved = array('main' => '$date, Resolved by $actor, resolution is $extra.', 'extra' => $lang->bug->resolutionList); -$lang->bug->action->tostory = array('main' => '$date, To story by $actor, ID is $extra.'); -$lang->bug->action->totask = array('main' => '$date, To task by $actor, ID is $extra.'); +$lang->bug->action->resolved = array('main' => '$date, Resolved by $actor, resolution is $extra.', 'extra' => $lang->bug->resolutionList); +$lang->bug->action->tostory = array('main' => '$date, To story by $actor, ID is $extra.'); +$lang->bug->action->totask = array('main' => '$date, To task by $actor, ID is $extra.'); +$lang->bug->action->linked2plan = array('main' => '$date, 由 $actor 关联到计划 $extra。'); +$lang->bug->action->unlinkedfromplan = array('main' => '$date, 由 $actor 从计划 $extra 移除。'); $lang->bug->placeholder = new stdclass(); $lang->bug->placeholder->chooseBuilds = 'Choose builds...'; diff --git a/module/bug/lang/zh-cn.php b/module/bug/lang/zh-cn.php index 44c3e4471a..ec1001e77a 100644 --- a/module/bug/lang/zh-cn.php +++ b/module/bug/lang/zh-cn.php @@ -354,9 +354,11 @@ $lang->bug->report->bugHistories->graph->xAxisName = '处理步骤'; /* 操作记录。*/ $lang->bug->action = new stdclass(); -$lang->bug->action->resolved = array('main' => '$date, 由 $actor 解决,方案为 $extra。', 'extra' => $lang->bug->resolutionList); -$lang->bug->action->tostory = array('main' => '$date, 由 $actor 转为需求,编号为 $extra。'); -$lang->bug->action->totask = array('main' => '$date, 由 $actor 导入为任务,编号为 $extra。'); +$lang->bug->action->resolved = array('main' => '$date, 由 $actor 解决,方案为 $extra。', 'extra' => $lang->bug->resolutionList); +$lang->bug->action->tostory = array('main' => '$date, 由 $actor 转为需求,编号为 $extra。'); +$lang->bug->action->totask = array('main' => '$date, 由 $actor 导入为任务,编号为 $extra。'); +$lang->bug->action->linked2plan = array('main' => '$date, 由 $actor 关联到计划 $extra。'); +$lang->bug->action->unlinkedfromplan = array('main' => '$date, 由 $actor 从计划 $extra 移除。'); $lang->bug->placeholder = new stdclass(); $lang->bug->placeholder->chooseBuilds = '选择相关版本...'; diff --git a/module/productplan/lang/zh-cn.php b/module/productplan/lang/zh-cn.php index 918b1e9e1d..155f5246dd 100644 --- a/module/productplan/lang/zh-cn.php +++ b/module/productplan/lang/zh-cn.php @@ -23,7 +23,7 @@ $lang->productplan->linkedStories = '已关联需求列表'; $lang->productplan->unlinkedStories = '未关联需求列表'; $lang->productplan->linkBug = "关联Bug"; -$lang->productplan->unlinkBug = "移除需求"; +$lang->productplan->unlinkBug = "移除Bug"; $lang->productplan->batchUnlinkBug = "批量移除"; $lang->productplan->linkedBugs = '已关联Bug列表'; $lang->productplan->unlinkedBugs = '未关联Bug列表'; diff --git a/module/productplan/view/linkbug.html.php b/module/productplan/view/linkbug.html.php new file mode 100644 index 0000000000..257ca849f5 --- /dev/null +++ b/module/productplan/view/linkbug.html.php @@ -0,0 +1,108 @@ + + * @package productplan + * @version $Id: linkbug.html.php 5096 2013-07-11 07:02:43Z chencongzhi520@gmail.com $ + * @link http://www.zentao.net + */ +?> + + +
+ + + + + + + + + + + + + + + + + id])) continue; + if($bug->plan and helper::diffDate($plans[$bug->plan], helper::today()) > 0) continue; + ?> + + + + + + + + + + + + + + + + +
title .$lang->colon . $lang->productplan->unlinkedBugs;?>
idAB;?> priAB;?> bug->plan;?> bug->title;?> openedByAB;?> assignedToAB;?>statusAB;?>
+ + createLink('bug', 'view', "bugID=$bug->id"), $bug->id);?> + pri;?>'>pri?>planTitle;?>createLink('bug', 'view', "bugID=$bug->id"), $bug->title);?>openedBy];?>assignedTo];?>bug->statusList[$bug->status];?>
+ productplan->linkBug);?> +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
title .$lang->colon . $lang->productplan->linkedBugs;?>
idAB;?> priAB;?> bug->title;?> openedByAB;?> assignedToAB;?>statusAB;?>actions?>
+ + + + createLink('bug', 'view', "bugID=$bug->id"), sprintf("%03d", $bug->id));?> + pri;?>'>pri?>createLink('bug', 'view', "bugID=$bug->id"), $bug->title);?>openedBy];?>assignedTo];?>bug->statusList[$bug->status];?>id", '', 'list', '', 'hiddenwin');?>
+ productplan->batchUnlinkBug); + ?> +
+
+ + diff --git a/www/theme/default/style.css b/www/theme/default/style.css index 6ffa6c4850..1d73d3d4b5 100644 --- a/www/theme/default/style.css +++ b/www/theme/default/style.css @@ -485,7 +485,7 @@ table.tablesorter thead tr .headerSortDown {background-image: url(./images/table .icon-gray-story-createCase {padding:2px 8px; background:url(images/main/zt-icons.png) -120px -221px;} .icon-green-project-unlinkStory {padding:2px 5px 2px 10px; background:url(images/main/zt-icons.png) -60px 0px;} -.icon-green-productplan-unlinkStory {padding:2px 5px 2px 10px; background:url(images/main/zt-icons.png) -60px 0px;} +.icon-green-productplan-unlinkStory, .icon-green-productplan-unlinkBug{padding:2px 5px 2px 10px; background:url(images/main/zt-icons.png) -60px 0px;} .icon-green-project-linkStory, .icon-green-productplan-linkStory {padding:2px 3px 2px 10px; background:url(images/main/zt-icons.png) -161px -201px;} .icon-green-productplan-linkBug {padding:2px 8px; background:url(images/main/zt-icons.png) 0px -282px;} From edbced0619dd572c4c6a110e497378266b51d0fe Mon Sep 17 00:00:00 2001 From: xia0ta0 Date: Wed, 24 Jul 2013 15:04:49 +0800 Subject: [PATCH 13/17] * fix a bug. --- module/productplan/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/productplan/model.php b/module/productplan/model.php index 8b9d9301b1..438e6b32e9 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -182,6 +182,6 @@ class productplanModel extends model { $planID = $this->dao->findByID($bugID)->from(TABLE_BUG)->fields('plan')->fetch('plan'); $this->dao->update(TABLE_BUG)->set('plan')->eq(0)->where('id')->eq((int)$bugID)->exec(); - $this->loadModel('action')->create('bug', $bugID, 'unlinkedfromplan', '', $bugID); + $this->loadModel('action')->create('bug', $bugID, 'unlinkedfromplan', '', $planID); } } From a87d5832e227256386e02fc89237ee7ac8dda7c2 Mon Sep 17 00:00:00 2001 From: azhi Date: Wed, 24 Jul 2013 15:15:44 +0800 Subject: [PATCH 14/17] * finish task#1604. --- module/project/css/story.css | 2 +- module/project/view/story.html.php | 3 ++- module/testcase/control.php | 8 ++++---- module/testcase/model.php | 8 +++++--- module/testcase/view/batchcreate.html.php | 11 +++++------ 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/module/project/css/story.css b/module/project/css/story.css index 23139c7980..c6bee2c15d 100644 --- a/module/project/css/story.css +++ b/module/project/css/story.css @@ -1,4 +1,4 @@ .icon-green-task-create {padding:2px 7px 2px 10px; background:url(theme/default/images/main/zt-icons.png) -120px -200px;} .icon-green-task-batchCreate {padding:2px 10px 2px 10px; background:url(theme/default/images/main/zt-icons.png) -199px -200px;} -.icon-green-testcase-create {padding:2px 7px 2px 10px; background:url(theme/default/images/main/zt-icons.png) -80px -322px;} +.icon-green-testcase-batchCreate {padding:2px 7px 2px 10px; background:url(theme/default/images/main/zt-icons.png) -80px -322px;} diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php index 633bc63a15..20699f4cdc 100644 --- a/module/project/view/story.html.php +++ b/module/project/view/story.html.php @@ -83,7 +83,8 @@ $lang->task->batchCreate = $lang->project->batchWBS; common::printIcon('task', 'batchCreate', "projectID={$project->id}&story={$story->id}", '', 'list'); - if($productID) common::printIcon('story', 'createCase', "productID=$story->product&moduleID=0&from=¶m=0&storyID=$story->id", '', 'list', 'createCase'); + $lang->testcase->batchCreate = $lang->testcase->create; + if($productID) common::printIcon('testcase', 'batchCreate', "productID=$story->product&moduleID=0&storyID=$story->id", '', 'list'); $lang->project->unlinkStory = $lang->unlink; common::printIcon('project', 'unlinkStory', $param, '', 'list', '', 'hiddenwin'); diff --git a/module/testcase/control.php b/module/testcase/control.php index 905e399212..9c48fb1c86 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -277,16 +277,16 @@ class testcase extends control * * @param int $productID * @param int $moduleID - * @param int $testcaseID + * @param int $storyID * @access public * @return void */ - public function batchCreate($productID, $moduleID = 0) + public function batchCreate($productID, $moduleID = 0, $storyID = 0) { $this->loadModel('story'); if(!empty($_POST)) { - $caseID = $this->testcase->batchCreate($productID); + $caseID = $this->testcase->batchCreate($productID, $storyID); if(dao::isError()) die(js::error(dao::getError())); die(js::locate($this->createLink('testcase', 'browse', "productID=$productID&browseType=byModule¶m=$moduleID"), 'parent')); } @@ -310,10 +310,10 @@ class testcase extends control $this->view->title = $title; $this->view->position = $position; $this->view->productID = $productID; + $this->view->story = $storyID ? $this->story->getByID($storyID) : ''; $this->view->productName = $this->products[$productID]; $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0); $this->view->currentModuleID = $currentModuleID; - $this->view->stories = $this->story->getProductStoryPairs($productID); $this->view->type = $type; $this->view->title = $title; diff --git a/module/testcase/model.php b/module/testcase/model.php index f1c77ba09c..c0240b6836 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -73,12 +73,14 @@ class testcaseModel extends model } /** - * Create a batch case. + * Batch create cases. * + * @param int $productID + * @param int $storyID * @access public * @return void */ - function batchCreate($productID) + function batchCreate($productID, $storyID) { $now = helper::now(); $cases = fixer::input('post')->get(); @@ -90,7 +92,7 @@ class testcaseModel extends model $data[$i]->product = $productID; $data[$i]->module = $cases->module[$i] == 'same' ? ($i == 0 ? 0 : $data[$i-1]->module) : $cases->module[$i]; $data[$i]->type = $cases->type[$i] == 'same' ? ($i == 0 ? '' : $data[$i-1]->type) : $cases->type[$i]; - $data[$i]->story = $cases->story[$i] == 'same' ? ($i == 0 ? 0 : $data[$i-1]->story) : $cases->story[$i]; + $data[$i]->story = $storyID ? $storyID : ($cases->story[$i] == 'same' ? ($i == 0 ? 0 : $data[$i-1]->story) : $cases->story[$i]); $data[$i]->title = htmlspecialchars($cases->title[$i]); $data[$i]->openedBy = $this->app->user->account; $data[$i]->openedDate = $now; diff --git a/module/testcase/view/batchcreate.html.php b/module/testcase/view/batchcreate.html.php index 65aff6f447..c55cd13edb 100644 --- a/module/testcase/view/batchcreate.html.php +++ b/module/testcase/view/batchcreate.html.php @@ -16,28 +16,27 @@
- + - - + {$lang->testcase->story}";?> + testcase->batchCreate; $i++):?> testcase->same; if($i != 0) $currentModuleID = 'same';?> testcase->typeList['same'] = $lang->testcase->same; $type = ($i == 0 ? 'feature' : 'same');?> - testcase->same; $story = $i == 0 ? '' : 'same';?> - + - +
testcase->batchCreate;?>testcase->batchCreate; if($story) echo "{$lang->colon}STORY#{$story->id} $story->title";?>
idAB;?> testcase->module;?> testcase->type;?>testcase->story;?>testcase->title;?>testcase->title;?>
testcase->typeList, $type, "class=select-1");?>
' class='a-center'>
From 44be4dc462ccc2ceb7487aae06af38989a09b6f3 Mon Sep 17 00:00:00 2001 From: azhi Date: Wed, 24 Jul 2013 15:21:04 +0800 Subject: [PATCH 15/17] * code for task#1604. --- module/project/view/story.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php index 20699f4cdc..d7829fa23c 100644 --- a/module/project/view/story.html.php +++ b/module/project/view/story.html.php @@ -39,7 +39,7 @@ statusAB);?> story->stageAB);?> story->taskCount;?> - actions;?> + actions;?> From 2d4a058478fc897fb49a2dccd3cf3cdf71728105 Mon Sep 17 00:00:00 2001 From: xia0ta0 Date: Wed, 24 Jul 2013 15:37:07 +0800 Subject: [PATCH 16/17] * inLink has been changed to static function. --- module/action/view/trash.html.php | 4 ++-- module/admin/view/cleardata.html.php | 2 +- module/bug/view/batchedit.html.php | 2 +- module/bug/view/browse.custom.html.php | 2 +- module/bug/view/browse.html.php | 2 +- module/common/control.php | 2 +- module/mail/view/test.html.php | 2 +- module/product/view/batchedit.html.php | 2 +- module/product/view/index.html.php | 2 +- module/productplan/view/linkbug.html.php | 2 +- module/productplan/view/linkstory.html.php | 2 +- module/productplan/view/view.html.php | 2 +- module/project/view/batchedit.html.php | 2 +- module/project/view/index.html.php | 2 +- module/story/view/batchclose.html.php | 2 +- module/story/view/batchedit.html.php | 2 +- module/task/view/batchedit.html.php | 2 +- module/testcase/view/batchedit.html.php | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/module/action/view/trash.html.php b/module/action/view/trash.html.php index d3b693c0ce..f0df5425fd 100644 --- a/module/action/view/trash.html.php +++ b/module/action/view/trash.html.php @@ -14,8 +14,8 @@ recTotal}&recPerPage={$pager->recPerPage}"; ?> diff --git a/module/admin/view/cleardata.html.php b/module/admin/view/cleardata.html.php index 08b3fc45c2..2d9bfcab6c 100755 --- a/module/admin/view/cleardata.html.php +++ b/module/admin/view/cleardata.html.php @@ -11,7 +11,7 @@ */ ?> -'> +'>
- inLink('trash', "type=all"), $lang->goback);?> - inLink('trash', "type=hidden"), $lang->action->dynamic->hidden);?> + goback);?> + action->dynamic->hidden);?>
diff --git a/module/bug/view/batchedit.html.php b/module/bug/view/batchedit.html.php index a38e5f45fe..b85b79f713 100644 --- a/module/bug/view/batchedit.html.php +++ b/module/bug/view/batchedit.html.php @@ -11,7 +11,7 @@ */ ?> -"> +">
admin->clearData;?>
admin->clearDataDesc);?>
diff --git a/module/bug/view/browse.custom.html.php b/module/bug/view/browse.custom.html.php index aa66cc2739..b1f3177b41 100644 --- a/module/bug/view/browse.custom.html.php +++ b/module/bug/view/browse.custom.html.php @@ -11,7 +11,7 @@ diff --git a/module/bug/view/browse.html.php b/module/bug/view/browse.html.php index 500ad0c40b..52a45dfa96 100644 --- a/module/bug/view/browse.html.php +++ b/module/bug/view/browse.html.php @@ -64,7 +64,7 @@ js::set('customed', $customed); } ?> -'> +'>
bug->common . $lang->colon . $lang->bug->batchEdit;?>
- '> + '>
diff --git a/module/product/view/batchedit.html.php b/module/product/view/batchedit.html.php index 7f9861238d..15798bc5f6 100755 --- a/module/product/view/batchedit.html.php +++ b/module/product/view/batchedit.html.php @@ -11,7 +11,7 @@ ?> -'> +'>
diff --git a/module/common/control.php b/module/common/control.php index 0b8e132e1e..82baa17b2f 100644 --- a/module/common/control.php +++ b/module/common/control.php @@ -355,7 +355,7 @@ class common extends control $title = isset($preAndNext->pre->title) ? $preAndNext->pre->title : $preAndNext->pre->name; $title = '#' . $preAndNext->pre->$id . ' ' . $title; echo ""; - echo html::a($this->inLink('view', "ID={$preAndNext->pre->$id}"), ' ', '', "id='pre' class='icon-pre' title='{$title}'"); + echo html::a(inLink('view', "ID={$preAndNext->pre->$id}"), ' ', '', "id='pre' class='icon-pre' title='{$title}'"); echo ""; } if(isset($preAndNext->next) and $preAndNext->next) diff --git a/module/mail/view/test.html.php b/module/mail/view/test.html.php index 3bc0729061..710bf0dd17 100755 --- a/module/mail/view/test.html.php +++ b/module/mail/view/test.html.php @@ -28,7 +28,7 @@ if(isset($error)) user->account); echo html::submitButton($lang->mail->test); - echo html::linkButton($lang->mail->edit, $this->inLink('edit')); + echo html::linkButton($lang->mail->edit, inLink('edit')); ?>
diff --git a/module/product/view/index.html.php b/module/product/view/index.html.php index 2033bbf72b..c4b0aa20e6 100644 --- a/module/product/view/index.html.php +++ b/module/product/view/index.html.php @@ -26,7 +26,7 @@
idAB;?>
-'> +'> diff --git a/module/productplan/view/linkbug.html.php b/module/productplan/view/linkbug.html.php index 257ca849f5..5d78ca6c7e 100644 --- a/module/productplan/view/linkbug.html.php +++ b/module/productplan/view/linkbug.html.php @@ -57,7 +57,7 @@
idAB;?>
-
+ diff --git a/module/productplan/view/linkstory.html.php b/module/productplan/view/linkstory.html.php index 349c828a20..18e440f846 100644 --- a/module/productplan/view/linkstory.html.php +++ b/module/productplan/view/linkstory.html.php @@ -61,7 +61,7 @@
title .$lang->colon . $lang->productplan->linkedBugs;?>
-
+ diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index 9a850d0c4b..05edbb6f15 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -13,7 +13,7 @@
deleted) echo "class='deleted'";?>>PLAN #id . ' ' . $plan->title;?>
- +
title .$lang->colon . $lang->productplan->linkedStories;?>
diff --git a/module/project/view/batchedit.html.php b/module/project/view/batchedit.html.php index 2a1bc5f6a4..267d457276 100755 --- a/module/project/view/batchedit.html.php +++ b/module/project/view/batchedit.html.php @@ -12,7 +12,7 @@ -'> +'> diff --git a/module/project/view/index.html.php b/module/project/view/index.html.php index ef6350d77c..115b822294 100644 --- a/module/project/view/index.html.php +++ b/module/project/view/index.html.php @@ -19,7 +19,7 @@ id"), $lang->project->statusList['suspended']);?> id"), $lang->project->statusList['done']);?> -'> +'>
idAB;?>
diff --git a/module/story/view/batchclose.html.php b/module/story/view/batchclose.html.php index 4888406f69..7f2bfefef3 100755 --- a/module/story/view/batchclose.html.php +++ b/module/story/view/batchclose.html.php @@ -12,7 +12,7 @@ ?> -"> +">
idAB;?>
diff --git a/module/story/view/batchedit.html.php b/module/story/view/batchedit.html.php index fb0191e6ea..c2106ec7d3 100644 --- a/module/story/view/batchedit.html.php +++ b/module/story/view/batchedit.html.php @@ -11,7 +11,7 @@ */ ?> -"> +">
story->common . $lang->colon . $lang->story->batchClose;?>
diff --git a/module/task/view/batchedit.html.php b/module/task/view/batchedit.html.php index 8a55ab787a..3d3b8eb054 100755 --- a/module/task/view/batchedit.html.php +++ b/module/task/view/batchedit.html.php @@ -11,7 +11,7 @@ */ ?> -"> +">
story->common . $lang->colon . $lang->story->batchEdit;?>
diff --git a/module/testcase/view/batchedit.html.php b/module/testcase/view/batchedit.html.php index 422c7d464d..bc69532211 100644 --- a/module/testcase/view/batchedit.html.php +++ b/module/testcase/view/batchedit.html.php @@ -11,7 +11,7 @@ */ ?> - +
task->common . $lang->colon . $lang->task->batchEdit;?>
From c5e604816da75af7572247215b0effe6af6717db Mon Sep 17 00:00:00 2001 From: azhi Date: Wed, 24 Jul 2013 16:03:15 +0800 Subject: [PATCH 17/17] * finish task#1441. --- module/testtask/view/runcase.html.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/module/testtask/view/runcase.html.php b/module/testtask/view/runcase.html.php index e9e1b48c51..06d437630a 100644 --- a/module/testtask/view/runcase.html.php +++ b/module/testtask/view/runcase.html.php @@ -58,5 +58,11 @@
testcase->common . $lang->colon . $lang->testcase->batchEdit;?>
-case; include './results.html.php'; ?> +case; include './results.html.php'; +$results = ob_get_contents(); +ob_clean(); +echo preg_replace("/

[\s\S]*<\/h1>|
[\s\S]*<\/fieldset>/", "", $results); +?>