From ba385e147763b91cc94f847fa3247d13b48f111e Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 8 Dec 2014 07:20:09 +0000 Subject: [PATCH] * finish task #2151. --- module/bug/model.php | 2 +- module/build/control.php | 252 +++++++++++++++++++++++---- module/build/lang/en.php | 6 +- module/build/lang/zh-cn.php | 4 + module/build/model.php | 113 ++++++++++-- module/build/view/create.html.php | 55 ------ module/build/view/edit.html.php | 55 ------ module/build/view/linkbug.html.php | 124 +++++++++++++ module/build/view/linkstory.html.php | 128 ++++++++++++++ module/build/view/view.html.php | 81 +++++++-- 10 files changed, 640 insertions(+), 180 deletions(-) create mode 100644 module/build/view/linkbug.html.php create mode 100644 module/build/view/linkstory.html.php diff --git a/module/bug/model.php b/module/bug/model.php index f8039c5c4d..ba04881732 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1442,7 +1442,7 @@ class bugModel extends model * @access public * @return array */ - public function getBySearch($productID, $projects, $queryID, $orderBy, $pager) + public function getBySearch($productID, $projects, $queryID, $orderBy, $pager = null) { if($queryID) { diff --git a/module/build/control.php b/module/build/control.php index eca5f7dc8e..37dfece269 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -25,13 +25,10 @@ class build extends control $buildID = $this->build->create($projectID); if(dao::isError()) die(js::error(dao::getError())); $this->loadModel('action')->create('build', $buildID, 'opened'); - die(js::locate($this->createLink('project', 'build', "project=$projectID"), 'parent')); + die(js::locate($this->createLink('build', 'view', "buildID=$buildID"), 'parent')); } /* Load these models. */ - $this->loadModel('story'); - $this->loadModel('bug'); - $this->loadModel('task'); $this->loadModel('project'); $this->loadModel('user'); @@ -39,23 +36,7 @@ class build extends control $this->project->setMenu($this->project->getPairs(), $projectID); /* Get stories and bugs. */ - $orderBy = 'status_asc, stage_asc, id_desc'; - $stories = $this->story->getProjectStories($projectID, $orderBy); - $projectBugs = $this->bug->getProjectBugs($projectID); - $bugs = array(); - foreach($projectBugs as $key => $bug) - { - if($bug->status == 'resolved') - { - $bugs[$key] = $bug; - unset($projectBugs[$key]); - } - else if($bug->status == 'closed') - { - unset($projectBugs[$key]); - } - } - $bugs += $projectBugs; + $orderBy = 'status_asc, stage_asc, id_desc'; /* Assign. */ $project = $this->loadModel('project')->getById($projectID); @@ -66,8 +47,6 @@ class build extends control $this->view->projectID = $projectID; $this->view->lastBuild = $this->build->getLast($projectID); $this->view->users = $this->user->getPairs('nodeleted'); - $this->view->stories = $stories; - $this->view->bugs = $bugs; $this->view->orderBy = $orderBy; $this->display(); } @@ -97,8 +76,6 @@ class build extends control die(js::locate(inlink('view', "buildID=$buildID"), 'parent')); } - $this->loadModel('story'); - $this->loadModel('bug'); $this->loadModel('project'); /* Set menu. */ @@ -107,8 +84,6 @@ class build extends control /* Get stories and bugs. */ $orderBy = 'status_asc, stage_asc, id_desc'; - $stories = $this->story->getProjectStories($build->project, $orderBy); - $bugs = $this->bug->getProjectBugs($build->project); /* Assign. */ $project = $this->loadModel('project')->getById($build->project); @@ -118,8 +93,6 @@ class build extends control $this->view->products = $this->project->getProducts($build->project); $this->view->build = $build; $this->view->users = $this->loadModel('user')->getPairs('nodeleted', $build->builder); - $this->view->stories = $stories; - $this->view->bugs = $bugs; $this->view->orderBy = $orderBy; $this->display(); } @@ -150,15 +123,16 @@ class build extends control /* Assign. */ $projects = $this->project->getPairs(); - $this->view->title = "BUILD #$build->id $build->name - " . $projects[$build->project]; - $this->view->position[] = html::a($this->createLink('project', 'task', "projectID=$build->project"), $projects[$build->project]); - $this->view->position[] = $this->lang->build->view; - $this->view->products = $this->project->getProducts($build->project); - $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->build = $build; - $this->view->stories = $stories; - $this->view->bugs = $bugs; - $this->view->actions = $this->loadModel('action')->getList('build', $buildID); + $this->view->title = "BUILD #$build->id $build->name - " . $projects[$build->project]; + $this->view->position[] = html::a($this->createLink('project', 'task', "projectID=$build->project"), $projects[$build->project]); + $this->view->position[] = $this->lang->build->view; + $this->view->products = $this->project->getProducts($build->project); + $this->view->generatedBugs = $this->bug->getProjectBugs($build->project, 'id_desc', null, $build->id); + $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->view->build = $build; + $this->view->stories = $stories; + $this->view->bugs = $bugs; + $this->view->actions = $this->loadModel('action')->getList('build', $buildID); $this->display(); } @@ -245,4 +219,206 @@ class build extends control if($varName == 'resolvedBuild') die(html::select($varName, $this->build->getProjectBuildPairs($projectID, $productID, 'noempty'), $build, "class='form-control'")); if($varName == 'testTaskBuild') die(html::select('build', $this->build->getProjectBuildPairs($projectID, $productID, 'noempty'), $build, "class='form-control'")); } + + /** + * Link stories + * + * @param int $buildID + * @param string $browseType + * @param int $param + * @access public + * @return void + */ + public function linkStory($buildID = 0, $browseType = '', $param = 0) + { + $this->session->set('storyList', $this->app->getURI(true)); + + if(!empty($_POST['stories'])) $this->build->linkStory($buildID); + + $build = $this->build->getById($buildID); + $this->loadModel('project')->setMenu($this->project->getPairs(), $build->project); + $this->loadModel('story'); + $this->loadModel('tree'); + $this->loadModel('product'); + + /* Build search form. */ + $queryID = ($browseType == 'bySearch') ? (int)$param : 0; + unset($this->config->product->search['fields']['product']); + unset($this->config->product->search['fields']['project']); + $this->config->product->search['actionURL'] = $this->createLink('build', 'linkStory', "planID=$buildID&browseType=bySearch&queryID=myQueryID"); + $this->config->product->search['queryID'] = $queryID; + $this->config->product->search['params']['plan']['values'] = $this->loadModel('productplan')->getForProducts(array($build->product => $build->product)); + $this->config->product->search['params']['module']['values'] = $this->tree->getOptionMenu($build->product, $viewType = 'story', $startModuleID = 0); + $this->config->product->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $this->lang->story->statusList); + $this->loadModel('search')->setSearchParams($this->config->product->search); + + if($browseType == 'bySearch') + { + $allStories = $this->story->getBySearch($build->product, $queryID, 'id', null, $build->project); + } + else + { + $allStories = $this->story->getProjectStories($build->project); + } + + $this->view->title = $build->name . $this->lang->colon . $this->lang->build->linkStory; + $this->view->position[] = html::a($this->createLink('build', 'view', "buildID=$build->id"), $build->name); + $this->view->position[] = $this->lang->build->linkStory; + $this->view->allStories = $allStories; + $this->view->build = $build; + $this->view->buildStories = empty($build->stories) ? array() : $this->story->getByList($build->stories); + $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->display(); + } + + /** + * Unlink story + * + * @param int $storyID + * @param string $confirm yes|no + * @access public + * @return void + */ + public function unlinkStory($buildID, $storyID) + { + $this->build->unlinkStory($buildID, $storyID); + + /* if ajax request, send result. */ + if($this->server->ajax) + { + if(dao::isError()) + { + $response['result'] = 'fail'; + $response['message'] = dao::getError(); + } + else + { + $response['result'] = 'success'; + $response['message'] = ''; + } + $this->send($response); + } + die(js::reload('parent')); + } + + /** + * Batch unlink story. + * + * @param string $confirm + * @access public + * @return void + */ + public function batchUnlinkStory($buildID) + { + $this->build->batchUnlinkStory($buildID); + die(js::reload('parent')); + } + + /** + * Link bugs. + * + * @param int $buildID + * @param string $browseType + * @param int $param + * @access public + * @return void + */ + public function linkBug($buildID = 0, $browseType = '', $param = 0) + { + $this->session->set('bugList', $this->app->getURI(true)); + + if(!empty($_POST['bugs'])) $this->build->linkBug($buildID); + + /* Set menu. */ + $build = $this->build->getByID($buildID); + $this->loadModel('project')->setMenu($this->project->getPairs(), $build->project); + + $queryID = ($browseType == 'bysearch') ? (int)$param : 0; + + /* Build the search form. */ + $this->loadModel('bug'); + $this->config->bug->search['actionURL'] = $this->createLink('build', 'linkBug', "planID=$buildID&browseType=bySearch&queryID=myQueryID"); + $this->config->bug->search['queryID'] = $queryID; + $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getForProducts(array($build->product => $build->product)); + $this->config->bug->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($build->product, $viewType = 'bug', $startModuleID = 0); + $this->config->bug->search['params']['project']['values'] = $this->loadModel('product')->getProjectPairs($build->product); + $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getProductBuildPairs($build->product); + $this->config->bug->search['params']['resolvedBuild']['values'] = $this->build->getProductBuildPairs($build->product); + $this->loadModel('search')->setSearchParams($this->config->bug->search); + + if($browseType == 'bySearch') + { + $allBugs = $this->bug->getBySearch($build->product, array($build->project), $queryID, 'id_desc'); + } + else + { + $projectBugs = $this->bug->getProjectBugs($build->project); + $allBugs = array(); + foreach($projectBugs as $key => $bug) + { + if($bug->status == 'resolved') + { + $allBugs[$key] = $bug; + unset($projectBugs[$key]); + } + elseif($bug->status == 'closed') + { + unset($projectBugs[$key]); + } + } + $allBugs += $projectBugs; + } + + $this->view->title = $build->name . $this->lang->colon . $this->lang->productplan->linkBug; + $this->view->position[] = html::a($this->createLink('build', 'view', "buildID=$build->id"), $build->name); + $this->view->position[] = $this->lang->build->linkBug; + $this->view->allBugs = $allBugs; + $this->view->buildBugs = empty($build->bugs) ? array() : $this->bug->getByList($build->bugs); + $this->view->build = $build; + $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->display(); + } + + /** + * Unlink story + * + * @param int $buildID + * @param int $bugID + * @access public + * @return void + */ + public function unlinkBug($buildID, $bugID) + { + $this->build->unlinkBug($buildID, $bugID); + + /* if ajax request, send result. */ + if($this->server->ajax) + { + if(dao::isError()) + { + $response['result'] = 'fail'; + $response['message'] = dao::getError(); + } + else + { + $response['result'] = 'success'; + $response['message'] = ''; + } + $this->send($response); + } + die(js::reload('parent')); + } + + /** + * Batch unlink story. + * + * @param int $buildID + * @access public + * @return void + */ + public function batchUnlinkBug($buildID) + { + $this->build->batchUnlinkBug($buildID); + die(js::reload('parent')); + } } diff --git a/module/build/lang/en.php b/module/build/lang/en.php index 0d6244af80..d3c3ce9a19 100644 --- a/module/build/lang/en.php +++ b/module/build/lang/en.php @@ -12,6 +12,8 @@ $lang->build->common = 'Build'; $lang->build->create = "Create"; $lang->build->edit = "Edit"; +$lang->build->linkStory = "Link story"; +$lang->build->linkBug = "Link Bug"; $lang->build->delete = "Delete"; $lang->build->deleted = "Deleted"; $lang->build->view = "Info"; @@ -38,9 +40,11 @@ $lang->build->linkStories = 'Stories'; $lang->build->linkBugs = 'Bugs'; $lang->build->stories = 'Linked stories'; $lang->build->bugs = 'Linked bugs'; +$lang->build->generatedBugs = 'Generated bug'; $lang->build->finishStories = 'The total demand for a complete %s'; -$lang->build->resolvedBugs = 'The total solution of bug%s'; +$lang->build->resolvedBugs = 'The total solution of bug %s'; +$lang->build->createdBugs = 'The total generated of bug %s'; $lang->build->placeholder = new stdclass(); $lang->build->placeholder->scmPath = 'Software source code repository, such as Subversion or Git'; diff --git a/module/build/lang/zh-cn.php b/module/build/lang/zh-cn.php index e2bfc28c2f..183aa39fcb 100644 --- a/module/build/lang/zh-cn.php +++ b/module/build/lang/zh-cn.php @@ -12,6 +12,8 @@ $lang->build->common = "Build"; $lang->build->create = "创建版本"; $lang->build->edit = "编辑版本"; +$lang->build->linkStory = "关联需求"; +$lang->build->linkBug = "关联Bug"; $lang->build->delete = "删除版本"; $lang->build->deleted = "已删除"; $lang->build->view = "版本详情"; @@ -38,9 +40,11 @@ $lang->build->linkStories = '相关需求'; $lang->build->linkBugs = '相关Bug'; $lang->build->stories = '已关联需求'; $lang->build->bugs = '已关联Bug'; +$lang->build->generatedBugs = '产生的Bug'; $lang->build->finishStories = '本次共完成需求%s个'; $lang->build->resolvedBugs = '本次共解决Bug%s个'; +$lang->build->createdBugs = '本次共产生Bug%s个'; $lang->build->placeholder = new stdclass(); $lang->build->placeholder->scmPath = ' 软件源代码库,如Subversion、Git库地址'; diff --git a/module/build/model.php b/module/build/model.php index 0ca023b155..070e6a0dc0 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -154,8 +154,6 @@ class buildModel extends model $build = fixer::input('post') ->setDefault('product', 0) - ->join('stories', ',') - ->join('bugs', ',') ->add('project', (int)$projectID) ->stripTags($this->config->build->editor->create['id'], $this->config->allowedTags) ->remove('resolvedBy,allchecker,files,labels') @@ -166,7 +164,6 @@ class buildModel extends model { $buildID = $this->dao->lastInsertID(); $this->loadModel('file')->saveUpload('build', $buildID); - $this->updateLinkedBug($build); return $buildID; } } @@ -182,10 +179,6 @@ class buildModel extends model { $oldBuild = $this->getByID($buildID); $build = fixer::input('post') - ->setDefault('stories', '') - ->setDefault('bugs', '') - ->join('stories', ',') - ->join('bugs', ',') ->stripTags($this->config->build->editor->edit['id'], $this->config->allowedTags) ->remove('allchecker,resolvedBy,files,labels') ->get(); @@ -196,11 +189,7 @@ class buildModel extends model ->where('id')->eq((int)$buildID) ->check('name','unique', "id != $buildID AND product = {$build->product}") ->exec(); - if(!dao::isError()) - { - $this->updateLinkedBug($build); - return common::createChanges($oldBuild, $build); - } + if(!dao::isError()) return common::createChanges($oldBuild, $build); } /** @@ -244,4 +233,104 @@ class buildModel extends model $this->action->create('bug', $bug->id, 'Resolved', '', 'fixed', $bug->resolvedBy); } } + + /** + * Link stories + * + * @param int $buildID + * @access public + * @return void + */ + public function linkStory($buildID) + { + $build = $this->getByID($buildID); + + $build->stories .= ',' . join(',', $this->post->stories); + $this->dao->update(TABLE_BUILD)->set('stories')->eq($build->stories)->where('id')->eq((int)$buildID)->exec(); + } + + /** + * Unlink story + * + * @param int $buildID + * @param int $storyID + * @access public + * @return void + */ + public function unlinkStory($buildID, $storyID) + { + $build = $this->getByID($buildID); + $build->stories = trim(str_replace(",$storyID,", ',', ",$build->stories,"), ','); + $this->dao->update(TABLE_BUILD)->set('stories')->eq($build->stories)->where('id')->eq((int)$buildID)->exec(); + } + + /** + * Batch unlink story. + * + * @param int $buildID + * @access public + * @return void + */ + public function batchUnlinkStory($buildID) + { + $storyList = $this->post->unlinkStories; + if(empty($storyList)) return true; + + $build = $this->getByID($buildID); + $build->stories = ",$build->stories,"; + foreach($storyList as $storyID) $build->stories = str_replace(",$storyID,", ',', $build->stories); + $build->stories = trim($build->stories, ','); + $this->dao->update(TABLE_BUILD)->set('stories')->eq($build->stories)->where('id')->eq((int)$buildID)->exec(); + } + + /** + * Link bugs. + * + * @param int $buildID + * @access public + * @return void + */ + public function linkBug($buildID) + { + $build = $this->getByID($buildID); + + $build->bugs .= ',' . join(',', $this->post->bugs); + $this->updateLinkedBug($build); + $this->dao->update(TABLE_BUILD)->set('bugs')->eq($build->bugs)->where('id')->eq((int)$buildID)->exec(); + } + + /** + * Unlink bug. + * + * @param int $buildID + * @param int $bugID + * @access public + * @return void + */ + public function unlinkBug($buildID, $bugID) + { + $build = $this->getByID($buildID); + $build->bugs = trim(str_replace(",$bugID,", ',', ",$build->bugs,"), ','); + $this->dao->update(TABLE_BUILD)->set('bugs')->eq($build->bugs)->where('id')->eq((int)$buildID)->exec(); + } + + /** + * Batch unlink bug. + * + * @param int $buildID + * @access public + * @return void + */ + public function batchUnlinkBug($buildID) + { + + $bugList = $this->post->unlinkBugs; + if(empty($bugList)) return true; + + $build = $this->getByID($buildID); + $build->bugs = ",$build->bugs,"; + foreach($bugList as $bugID) $build->bugs = str_replace(",$bugID,", ',', $build->bugs); + $build->bugs = trim($build->bugs, ','); + $this->dao->update(TABLE_BUILD)->set('bugs')->eq($build->bugs)->where('id')->eq((int)$buildID)->exec(); + } } diff --git a/module/build/view/create.html.php b/module/build/view/create.html.php index 0862f2fd2c..4f23bb974d 100644 --- a/module/build/view/create.html.php +++ b/module/build/view/create.html.php @@ -57,61 +57,6 @@ build->files;?> fetch('file', 'buildForm', array('fileCount' => 1));?> - - build->linkStoriesAndBugs;?> - -
-
-
-
icons['story']) . ' ' . $lang->build->linkStories;?>
- - - - - - - - - - $story):?> - createLink('story', 'view', "storyID=$story->id", '', true);?> - - - - - - - -
idAB;?>story->title;?>statusAB;?>story->stageAB;?>
stage == 'developed' or $story->status == 'closed') echo 'checked';?>> id);?>title, '', "class='preview iframe'");?>story->statusList[$story->status];?>story->stageList[$story->stage];?>
-
-
-
-
-
icons['bug']) . ' ' . $lang->build->linkBugs;?>
- - - - - - - - - - - createLink('bug', 'view', "bugID=$bug->id", '', true);?> - - - - - - - -
idAB;?>bug->title;?>bug->status;?>bug->resolvedBy;?>
status == 'resolved' or $bug->status == 'closed') echo "checked";?>> id);?>title, '', "class='preview iframe'");?>>bug->statusList[$bug->status];?>status == 'resolved' or $bug->status == 'closed') ? substr($users[$bug->resolvedBy], 2) : html::select('resolvedBy[]', $users, $this->app->user->account, "class='w-70px'");?>
-
-
-
- - build->desc;?> diff --git a/module/build/view/edit.html.php b/module/build/view/edit.html.php index e6941f90dc..d85fe82b11 100644 --- a/module/build/view/edit.html.php +++ b/module/build/view/edit.html.php @@ -51,61 +51,6 @@ build->files;?> fetch('file', 'buildForm', array('fileCount' => 1));?> - - build->linkStoriesAndBugs;?> - -
-
-
-
icons['story']) . ' ' . $lang->build->linkStories;?>
- - - - - - - - - - $story):?> - createLink('story', 'view', "storyID=$story->id", '', true);?> - - - - - - - -
idAB;?>story->title;?>statusAB;?>story->stageAB;?>
stories . ',', ',' . $story->id . ',') !== false) echo 'checked';?>> id);?>title, '', "class='preview iframe'");?>story->statusList[$story->status];?>story->stageList[$story->stage];?>
-
-
-
-
-
icons['bug']) . ' ' . $lang->build->linkBugs;?>
- - - - - - - - - - - createLink('bug', 'view', "bugID=$bug->id", '', true);?> - - - - - - - -
idAB;?>bug->title;?>bug->status;?>bug->resolvedBy;?>
bugs . ',', ',' . $bug->id . ',') !== false) echo 'checked';?>> id);?>title, '', "class='preview iframe'");?>bug->statusList[$bug->status];?>status == 'resolved' or $bug->status == 'closed') ? substr($users[$bug->resolvedBy], 2) : html::select('resolvedBy[]', $users, $this->app->user->account, "class='w-70px'");?>
-
-
-
- - build->desc;?> desc), "rows='10' class='form-control'");?> diff --git a/module/build/view/linkbug.html.php b/module/build/view/linkbug.html.php new file mode 100644 index 0000000000..6435a2641d --- /dev/null +++ b/module/build/view/linkbug.html.php @@ -0,0 +1,124 @@ + + * @package build + * @version $Id: linkbug.html.php 5096 2013-07-11 07:02:43Z chencongzhi520@gmail.com $ + * @link http://www.zentao.net + */ +?> + + +productplan->confirmUnlinkBug)?> +
+
+ icons['build']);?> id;?> + createLink('build', 'view', 'buildID=' . $build->id), $build->name, '_blank');?> + productplan->linkBug;?> icons['link']);?> +
+
+
+
+
+
+ + + + + + + + + + + + + + + bugs},", ",$bug->id,") !== false) continue;?> + + + + + + + + + + + + + + + +
 productplan->unlinkedBugs;?>
idAB;?> priAB;?> bug->title;?> openedByAB;?> bug->resolvedBy;?> statusAB;?>
+ status == 'resolved' or $bug->status == 'closed') echo "checked";?> /> + createLink('bug', 'view', "bugID=$bug->id"), $bug->id);?> + bug->priList, $bug->pri, $bug->pri);?>'>bug->priList, $bug->pri, $bug->pri)?>createLink('bug', 'view', "bugID=$bug->id"), $bug->title);?>openedBy];?>status == 'resolved' or $bug->status == 'closed') ? substr($users[$bug->resolvedBy], 2) : html::select("resolvedBy[{$bug->id}]", $users, $this->app->user->account, "class='form-control chosen'");?>bug->statusList[$bug->status];?>
+
" . html::selectAll('unlinkedBugsForm') . html::selectReverse('unlinkedBugsForm') . '
' . html::submitButton($lang->productplan->linkBug) . '';?> +
+
+
+
id");?>" id='linkedBugsForm'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 productplan->linkedBugs;?> ()
idAB;?> priAB;?> bug->title;?> openedByAB;?> assignedToAB;?> bug->resolvedBy;?>statusAB;?>actions?>
+ + + + createLink('bug', 'view', "bugID=$bug->id"), sprintf("%03d", $bug->id));?> + bug->priList, $bug->pri, $bug->pri);?>'>bug->priList, $bug->pri, $bug->pri);?>createLink('bug', 'view', "bugID=$bug->id"), $bug->title);?>openedBy];?>assignedTo];?>resolvedBy];?>bug->statusList[$bug->status];?> + createLink('build', 'unlinkBug', "buildID=$build->id&bugID=$bug->id"); + echo html::a("javascript:ajaxDelete(\"$unlinkURL\",\"bugList\",confirmUnlinkBug)", "", '', "title='{$lang->productplan->unlinkBug}' class='btn-icon'"); + } + ?> +
+
" . html::selectButton('linkedBugsForm') . '
'; + echo html::submitButton($lang->productplan->batchUnlink) . ''; + ?> +
+
+
+ + diff --git a/module/build/view/linkstory.html.php b/module/build/view/linkstory.html.php new file mode 100644 index 0000000000..f46e1c6f43 --- /dev/null +++ b/module/build/view/linkstory.html.php @@ -0,0 +1,128 @@ + + * @package build + * @version $Id: linkstory.html.php 5096 2013-07-11 07:02:43Z chencongzhi520@gmail.com $ + * @link http://www.zentao.net + */ +?> + + +productplan->confirmUnlinkStory)?> +
+
+ icons['build']);?> id;?> + createLink('build', 'view', 'build=' . $build->id), $build->name, '_blank');?> + build->linkStory;?> icons['link']);?> +
+
+
+
+
+ + + + + + + + + + + + + + + + + stories},", ",{$story->id},") !== false) continue; ?> + + + + + + + + + + + + + + + + + +
 productplan->unlinkedStories;?>
idAB;?> priAB;?> story->title;?> openedByAB;?> assignedToAB;?> story->estimateAB;?>statusAB;?> story->stageAB;?>
+ stage == 'developed' or $story->status == 'closed') echo 'checked';?> /> + createLink('story', 'view', "storyID=$story->id"), $story->id);?> + story->priList, $story->pri, $story->pri);?>'>story->priList, $story->pri, $story->pri)?>createLink('story', 'view', "storyID=$story->id"), $story->title);?>openedBy];?>assignedTo];?>estimate;?>story->statusList[$story->status];?>story->stageList[$story->stage];?>
+
" . html::selectAll('unlinkedStoriesForm') . html::selectReverse('unlinkedStoriesForm') . '
' . html::submitButton($lang->story->linkStory) . '';?> +
+
+
+
id");?>" id='linkedStoriesForm'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 productplan->linkedStories;?> ()
idAB;?> priAB;?> story->title;?> openedByAB;?> assignedToAB;?> story->estimateAB;?>statusAB;?> story->stageAB;?>actions?>
+ + + + createLink('story', 'view', "storyID=$story->id"), sprintf("%03d", $story->id));?> + story->priList, $story->pri, $story->pri);?>'>story->priList, $story->pri, $story->pri);?>createLink('story', 'view', "storyID=$story->id"), $story->title);?>openedBy];?>assignedTo];?>estimate;?>story->statusList[$story->status];?>story->stageList[$story->stage];?> + createLink('build', 'unlinkStory', "build=$build->id&storyID=$story->id"); + echo html::a("javascript:ajaxDelete(\"$unlinkURL\",\"storyList\",confirmUnlinkStory)", '', '', "title='{$lang->productplan->unlinkStory}' class='btn-icon'"); + } + ?> +
+
" . html::selectButton('linkedStoriesForm') . '
' . html::submitButton($lang->productplan->batchUnlink) . ''; + ?> +
+
+
+ + diff --git a/module/build/view/view.html.php b/module/build/view/view.html.php index 9086197c82..c6dd7ddf5e 100644 --- a/module/build/view/view.html.php +++ b/module/build/view/view.html.php @@ -19,32 +19,33 @@ build->deleted;?> +
+ session->buildList ? $this->session->buildList : $this->createLink('project', 'build', "projectID=$build->project"); + if(!$build->deleted) + { + echo "
"; + common::printIcon('build', 'linkStory',"buildID=$build->id", '', 'button', $lang->icons['link']); + common::printIcon('build', 'linkBug', "buildID=$build->id", '', 'button', $lang->icons['bug']); + echo '
'; + echo "
"; + common::printIcon('build', 'edit', "buildID=$build->id"); + common::printIcon('build', 'delete', "buildID=$build->id", '', 'button', '', 'hiddenwin'); + echo '
'; + } + echo common::printRPN($browseLink); + ?> +
-
- build->desc;?> -
desc;?>
-
- fetch('file', 'printFiles', array('files' => $build->files, 'fieldset' => 'true'));?> - -
- session->buildList ? $this->session->buildList : $this->createLink('project', 'build', "projectID=$build->project"); - if(!$build->deleted) - { - common::printIcon('build', 'edit', "buildID=$build->id"); - common::printIcon('build', 'delete', "buildID=$build->id", '', 'button', '', 'hiddenwin'); - } - echo common::printRPN($browseLink); - ?> -
- +
@@ -119,12 +120,55 @@
+
+ + + + + + + + + + + + + + + createLink('bug', 'view', "bugID=$bug->id", '', true);?> + + + + + + + + + + + + + + + + +
idAB;?>bug->severityAB;?>bug->title;?>bug->status;?>openedByAB;?>bug->openedDateAB;?>bug->resolvedByAB;?>bug->resolvedDateAB;?>
id);?>severity;?>title, '', "class='preview'");?>bug->statusList[$bug->status];?>openedBy];?>openedDate, 5, 11)?>resolvedBy];?>resolvedDate, 5, 11)?>
+
+
build->createdBugs, $countNewBugs);?>
+
+
+
+
+ build->desc;?> +
desc;?>
+
+ fetch('file', 'printFiles', array('files' => $build->files, 'fieldset' => 'true'));?>
build->basicInfo?> @@ -154,6 +198,7 @@
+