diff --git a/module/programplan/control.php b/module/programplan/control.php
index 8d22fc731c..011e276f7f 100644
--- a/module/programplan/control.php
+++ b/module/programplan/control.php
@@ -74,7 +74,7 @@ class programplan extends control
$this->app->loadLang('stage');
$program = $this->loadModel('project')->getById($programID);
- $stages = $planID ? array() : $this->loadModel('stage')->getStages();
+ $stages = $planID ? array() : $this->loadModel('stage')->getStages('id_asc');
$plans = $this->programplan->getList($programID, $this->productID, $planID);
$title = $this->lang->programplan->create . $this->lang->colon . $program->name;
diff --git a/module/story/control.php b/module/story/control.php
index 593862d253..5e953e7a69 100644
--- a/module/story/control.php
+++ b/module/story/control.php
@@ -752,8 +752,11 @@ class story extends control
$this->view->fromBug = $fromBug;
$this->view->cases = $cases;
$this->view->story = $story;
+ $this->view->track = $this->story->getTrackByID($story->id);
$this->view->users = $users;
+ $this->view->relations = $this->story->getStoryRelation($story->id, $story->type);
$this->view->projects = $this->loadModel('project')->getPairs('nocode');
+ $this->view->program = $this->project->getByID($story->program);
$this->view->actions = $this->action->getList('story', $storyID);
$this->view->storyModule = $storyModule;
$this->view->modulePath = $modulePath;
@@ -1166,6 +1169,26 @@ class story extends control
die(js::locate($this->session->storyList, 'parent'));
}
+ /**
+ * Story track.
+ *
+ * @param int $productID
+ * @access public
+ * @return void
+ */
+ public function track($productID)
+ {
+ $products = $this->loadModel('product')->getPairs($this->session->program);
+ $productID = $this->product->saveState($productID, $products);
+ $this->product->setMenu($products, $productID, 0, 0, '');
+ $tracks = $this->story->getTracks($productID);
+
+ $this->view->tracks = $tracks;
+ $this->view->title = $this->lang->story->track;
+ $this->view->posision[] = $this->lang->story->track;
+ $this->display();
+ }
+
/**
* Tasks of a story.
*
@@ -1260,21 +1283,36 @@ class story extends control
* @access public
* @return void
*/
- public function linkStory($storyID, $type = 'linkStories', $browseType = '', $param = 0)
+ public function linkStory($storyID, $type = 'linkStories', $linkedStoryID = 0, $browseType = '', $queryID = 0)
{
$this->commonAction($storyID);
+ if($type == 'remove')
+ {
+ $result = $this->story->unlinkStory($storyID, $linkedStoryID);
+ die(js::reload('parent'));
+ }
+
+ if($_POST)
+ {
+ $this->story->linkStories($storyID);
+
+ if(dao::isError()) die(js::error(dao::getError()));
+ die(js::closeModal('parent.parent', 'this'));
+ }
+
/* Get story, product, products, and queryID. */
$story = $this->story->getById($storyID);
$products = $this->product->getPairs();
- $queryID = ($browseType == 'bySearch') ? (int)$param : 0;
+ $queryID = 0;
/* Build search form. */
- $actionURL = $this->createLink('story', 'linkStory', "storyID=$storyID&type=$type&browseType=bySearch&queryID=myQueryID", '', true);
+ $actionURL = $this->createLink('story', 'linkStory', "storyID=$storyID&type=$type&linkedStoryID=$linkedStoryID&browseType=bySearch&queryID=myQueryID", '', true);
$this->loadModel('product')->buildSearchForm($story->product, $products, $queryID, $actionURL);
/* Get stories to link. */
- $stories2Link = $this->story->getStories2Link($storyID, $type, $browseType, $queryID);
+ $storyType = $story->type;
+ $stories2Link = $this->story->getStories2Link($storyID, $type, $browseType, $queryID, $storyType);
/* Assign. */
$this->view->title = $this->lang->story->linkStory . "STORY" . $this->lang->colon .$this->lang->story->linkStory;
diff --git a/module/story/css/view.css b/module/story/css/view.css
index 09f389c1f7..1bad5467aa 100644
--- a/module/story/css/view.css
+++ b/module/story/css/view.css
@@ -1,3 +1,4 @@
.side-col .cell{padding:0px;}
.side-col #legendProjectAndTask .list-unstyled{padding:10px; border-top:0px; margin:0px;}
.col-4 .cell .tab-content .text-top{padding-top: 1px}
+#legendStories ul li{padding: 10px 0 0 12px; line-height: 20px}
diff --git a/module/story/js/view.js b/module/story/js/view.js
index c3c455a03e..1de186ae30 100644
--- a/module/story/js/view.js
+++ b/module/story/js/view.js
@@ -8,4 +8,18 @@ $(function()
/* Add for task #5385. */
if(config.onlybody == 'yes') $('.main-actions').css('width', '100%')
+
+ $('#unlinkStory').click(function()
+ {
+ if($('.removeButton').hasClass('hide'))
+ {
+ $('.removeButton').removeClass('hide');
+ $(this).text(cancel);
+ }
+ else
+ {
+ $('.removeButton').addClass('hide');
+ $(this).text(unlink);
+ }
+ })
});
diff --git a/module/story/lang/en.php b/module/story/lang/en.php
index 05c4c84ea6..e7aa3ee3df 100644
--- a/module/story/lang/en.php
+++ b/module/story/lang/en.php
@@ -9,49 +9,56 @@
* @version $Id: en.php 5141 2013-07-15 05:57:15Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
-$lang->story->create = "Create Story";
-$lang->story->batchCreate = "Batch Create";
-$lang->story->change = "Change";
-$lang->story->changeAction = "Change Story";
-$lang->story->changed = 'Change';
-$lang->story->assignTo = 'Assign';
-$lang->story->assignAction = 'Assign Story';
-$lang->story->review = 'Review';
-$lang->story->reviewAction = 'Review Story';
-$lang->story->needReview = 'Need Review';
-$lang->story->batchReview = 'Batch Review';
-$lang->story->edit = "Edit Story";
-$lang->story->batchEdit = "Batch Edit";
-$lang->story->subdivide = 'Decompose';
-$lang->story->subdivideAction = 'Decompose Story';
-$lang->story->splitRequirent = 'Decompose';
-$lang->story->close = 'Close';
-$lang->story->closeAction = 'Close Story';
-$lang->story->batchClose = 'Batch Close';
-$lang->story->activate = 'Activate';
-$lang->story->activateAction = 'Activate Story';
-$lang->story->delete = "Delete";
-$lang->story->deleteAction = "Delete Story";
-$lang->story->view = "Story Detail";
-$lang->story->setting = "Settings";
-$lang->story->tasks = "Linked Tasks";
-$lang->story->bugs = "Linked Bugs";
-$lang->story->cases = "Linked Cases";
-$lang->story->taskCount = 'Tasks';
-$lang->story->bugCount = 'Bugs';
-$lang->story->caseCount = 'Cases';
-$lang->story->taskCountAB = 'T';
-$lang->story->bugCountAB = 'B';
-$lang->story->caseCountAB = 'C';
-$lang->story->linkStory = 'Link Story';
-$lang->story->unlinkStory = 'UnLinked';
-$lang->story->export = "Export Data";
-$lang->story->exportAction = "Export Story";
-$lang->story->zeroCase = "Stories without cases";
-$lang->story->zeroTask = "Only list stories without tasks";
-$lang->story->reportChart = "Report";
-$lang->story->reportAction = "Story Report";
-$lang->story->copyTitle = "Copy Title";
+$lang->story->create = "Create Story";
+$lang->story->createStory = 'Create Story';
+$lang->story->createRequirement = 'Create Requirement';
+$lang->story->requirement = 'Requirement';
+$lang->story->story = 'Story';
+$lang->story->batchCreate = "Batch Create";
+$lang->story->change = "Change";
+$lang->story->changeAction = "Change Story";
+$lang->story->changed = 'Change';
+$lang->story->assignTo = 'Assign';
+$lang->story->assignAction = 'Assign Story';
+$lang->story->review = 'Review';
+$lang->story->reviewAction = 'Review Story';
+$lang->story->needReview = 'Need Review';
+$lang->story->batchReview = 'Batch Review';
+$lang->story->edit = "Edit Story";
+$lang->story->batchEdit = "Batch Edit";
+$lang->story->subdivide = 'Decompose';
+$lang->story->link = 'Link';
+$lang->story->unlink = 'Unlink';
+$lang->story->track = 'Track';
+$lang->story->subdivideAction = 'Decompose Story';
+$lang->story->splitRequirent = 'Decompose';
+$lang->story->close = 'Close';
+$lang->story->closeAction = 'Close Story';
+$lang->story->batchClose = 'Batch Close';
+$lang->story->activate = 'Activate';
+$lang->story->activateAction = 'Activate Story';
+$lang->story->delete = "Delete";
+$lang->story->deleteAction = "Delete Story";
+$lang->story->view = "Story Detail";
+$lang->story->setting = "Settings";
+$lang->story->tasks = "Linked Tasks";
+$lang->story->bugs = "Linked Bugs";
+$lang->story->cases = "Linked Cases";
+$lang->story->taskCount = 'Tasks';
+$lang->story->bugCount = 'Bugs';
+$lang->story->caseCount = 'Cases';
+$lang->story->taskCountAB = 'T';
+$lang->story->bugCountAB = 'B';
+$lang->story->caseCountAB = 'C';
+$lang->story->linkStory = 'Link Story';
+$lang->story->unlinkStory = 'UnLinked';
+$lang->story->export = "Export Data";
+$lang->story->exportAction = "Export Story";
+$lang->story->zeroCase = "Stories without cases";
+$lang->story->zeroTask = "Only list stories without tasks";
+$lang->story->reportChart = "Report";
+$lang->story->reportAction = "Story Report";
+$lang->story->copyTitle = "Copy Title";
$lang->story->batchChangePlan = "Batch Change Plans";
$lang->story->batchChangeBranch = "Batch Change Branches";
$lang->story->batchChangeStage = "Batch Change Phases";
@@ -120,6 +127,11 @@ $lang->story->allStories = 'All Stories';
$lang->story->unclosed = 'Unclosed';
$lang->story->deleted = 'Deleted';
$lang->story->released = 'Released Stories';
+$lang->story->design = 'Designs';
+$lang->story->case = 'Cases';
+$lang->story->bug = 'Bugs';
+$lang->story->repoCommit = 'Commits';
+$lang->story->noRequirement = 'No Requirements';
$lang->story->ditto = 'Ditto';
$lang->story->dittoNotice = 'This story is not linked to the same product as the last one is!';
diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php
index 4ab3c6d041..9aadb39595 100644
--- a/module/story/lang/zh-cn.php
+++ b/module/story/lang/zh-cn.php
@@ -12,6 +12,8 @@
$lang->story->create = "提{$lang->storyCommon}";
$lang->story->createStory = '添加软需';
$lang->story->createRequirement = '添加用需';
+$lang->story->requirement = '用户需求';
+$lang->story->story = '软件需求';
$lang->story->batchCreate = "批量创建";
$lang->story->change = "变更";
$lang->story->changeAction = "变更{$lang->storyCommon}";
@@ -25,6 +27,9 @@ $lang->story->batchReview = '批量评审';
$lang->story->edit = "编辑";
$lang->story->batchEdit = "批量编辑";
$lang->story->subdivide = '细分';
+$lang->story->link = '关联';
+$lang->story->unlink = '移除';
+$lang->story->track = '跟踪矩阵';
$lang->story->subdivideAction = "细分{$lang->storyCommon}";
$lang->story->splitRequirent = '拆分';
$lang->story->close = '关闭';
@@ -122,6 +127,11 @@ $lang->story->allStories = "所有{$lang->storyCommon}";
$lang->story->unclosed = '未关闭';
$lang->story->deleted = '已删除';
$lang->story->released = "已发布{$lang->storyCommon}数";
+$lang->story->design = '相关设计';
+$lang->story->case = '相关用例';
+$lang->story->bug = '相关Bug';
+$lang->story->repoCommit = '相关提交';
+$lang->story->noRequirement = '无需求';
$lang->story->ditto = '同上';
$lang->story->dittoNotice = "该{$lang->storyCommon}与上一{$lang->storyCommon}不属于同一产品!";
diff --git a/module/story/model.php b/module/story/model.php
index 92750560fb..b3ce037e8f 100644
--- a/module/story/model.php
+++ b/module/story/model.php
@@ -1572,30 +1572,43 @@ class storyModel extends model
/**
* Get stories to link.
*
- * @param int $storyID
- * @param string $type
- * @param string $browseType
- * @param int $queryID
+ * @param int $storyID
+ * @param string $type
+ * @param string $browseType
+ * @param int $queryID
+ * @param varchar $storyType
* @access public
* @return array
*/
- public function getStories2Link($storyID, $type = 'linkStories', $browseType = 'bySearch', $queryID = 0)
+ public function getStories2Link($storyID, $type = 'linkStories', $browseType = 'bySearch', $queryID = 0, $storyType = 'story')
{
+ $story = $this->getById($storyID);
+ $linkedStories = $this->getRelation($storyID, $story->type);
+ $linkedStories = empty($linkedStories) ? array() : $linkedStories;
+ $tmpStoryType = $storyType == 'story' ? 'requirement' : 'story';
+
if($browseType == 'bySearch')
- {
- $story = $this->getById($storyID);
- $stories2Link = $this->getBySearch($story->product, $queryID, 'id', null, '', $story->branch);
+ {
+ $stories2Link = $this->getBySearch($story->product, $queryID, 'id', null, '', $story->branch, $tmpStoryType);
foreach($stories2Link as $key => $story2Link)
- {
+ {
if($story2Link->id == $storyID) unset($stories2Link[$key]);
if(in_array($story2Link->id, explode(',', $story->$type))) unset($stories2Link[$key]);
- }
- return $stories2Link;
- }
+ }
+ }
else
- {
- return array();
- }
+ {
+ $status = $storyType == 'story' ? 'active' : 'all';
+ $stories2Link = $this->getProductStories($story->product, $story->branch, 0, $status, $tmpStoryType, $orderBy = 'id_desc');
+ }
+
+ foreach($stories2Link as $id => $story)
+ {
+ if(in_array($story->id, array_keys($linkedStories))) unset($stories2Link[$id]);
+ if($storyType == 'story' && $story->status == 'draft') unset($stories2Link[$id]);
+ }
+
+ return $stories2Link;
}
/**
@@ -3135,4 +3148,244 @@ class storyModel extends model
return array($toList, $ccList);
}
+
+ /**
+ * Get tracks.
+ *
+ * @param int $productID
+ * @access public
+ * @return bool|array
+ */
+ public function getTracks($productID)
+ {
+ $requirements = $this->getProductStories($productID, 0, 0, 'all', 'requirement', 'id_desc');
+
+ foreach($requirements as $requirement)
+ {
+ $stories = $this->getRelation($requirement->id, 'requirement');
+ $stories = empty($stories) ? array() : $stories;
+ foreach($stories as $id => $title)
+ {
+ $stories[$id] = new stdclass();
+ $stories[$id]->title = $title;
+ $stories[$id]->case = $this->loadModel('testcase')->getStoryCases($id);
+ $stories[$id]->bug = $this->loadModel('bug')->getStoryBugs($id);
+ $stories[$id]->design = $this->dao->select('id, name')->from(TABLE_DESIGN)->where('story')->eq($id)->fetchAll('id');
+ $stories[$id]->revision = $this->dao->select('BID, extra')->from(TABLE_RELATION)->where('AType')->eq('design')->andWhere('BType')->eq('commit')->andWhere('AID')->in(array_keys($stories[$id]->design))->fetchPairs();
+ }
+
+ $requirement->track = $stories;
+ }
+
+ /* Get no requirements story. */
+ $stories = $this->getProductStories($productID, 0, 0, 'all', 'story', 'id_desc');
+ foreach($stories as $id => $story)
+ {
+ $counts = $this->getStoryRelationCounts($story->id, 'story');
+ if($counts != 0)
+ {
+ unset($stories[$id]);
+ continue;
+ }
+ $title = $stories[$id]->title;
+ $stories[$id] = new stdclass();
+ $stories[$id]->title = $title;
+ $stories[$id]->case = $this->loadModel('testcase')->getStoryCases($id);
+ $stories[$id]->bug = $this->loadModel('bug')->getStoryBugs($id);
+ $stories[$id]->design = $this->dao->select('id, name')->from(TABLE_DESIGN)->where('story')->eq($id)->fetchAll('id');
+ $stories[$id]->revision = $this->dao->select('BID, extra')->from(TABLE_RELATION)->where('AType')->eq('design')->andWhere('BType')->eq('commit')->andWhere('AID')->in(array_keys($stories[$id]->design))->fetchPairs();
+ }
+ $requirements['noRequirement'] = $stories;
+
+ return $requirements;
+ }
+
+ /**
+ * Get track by id.
+ *
+ * @param int $storyID
+ * @access public
+ * @return bool|array
+ */
+ public function getTrackByID($storyID)
+ {
+ $requirement = $this->getByID($storyID);
+
+ $stories = $this->getRelation($requirement->id, 'requirement');
+ $track = array();
+ $stories = empty($stories) ? array() : $stories;
+ foreach($stories as $id => $title)
+ {
+ $track[$id] = new stdclass();
+ $track[$id]->title = $title;
+ $track[$id]->case = $this->loadModel('testcase')->getStoryCases($id);
+ $track[$id]->bug = $this->loadModel('bug')->getStoryBugs($id);
+ $track[$id]->design = $this->dao->select('id, name')->from(TABLE_DESIGN)->where('story')->eq($id)->fetchAll('id');
+ $track[$id]->story = $this->getByID($id);
+ $track[$id]->revision = $this->dao->select('BID, extra')->from(TABLE_RELATION)->where('AType')->eq('design')->andWhere('BType')->eq('commit')->andWhere('AID')->in(array_keys($track[$id]->design))->fetchPairs();
+ }
+
+ return $track;
+ }
+
+ /**
+ * Obtain the direct relationship between UR and SR.
+ *
+ * @param int $storyID
+ * @param string $storyType
+ * @param string $storyType
+ * @access public
+ * @return int
+ */
+ public function getStoryRelation($storyID, $storyType, $fields = array())
+ {
+ $conditionField = ($storyType == 'story') ? 'BID' : 'AID';
+ $storyType = ($storyType == 'story') ? 'AID' : 'BID';
+
+ $relations = $this->dao->select($storyType)->from(TABLE_RELATION)
+ ->where('AType')->eq('requirement')
+ ->andWhere('BType')->eq('story')
+ ->andWhere('relation')->eq('subdivideinto')
+ ->andWhere($conditionField)->eq($storyID)
+ ->fetchAll($storyType);
+
+ if(empty($relations)) return array();
+
+ $fields = empty($fields) ? '*' : implode(',', $fields);
+ $story = $this->dao->select($fields)->from(TABLE_STORY)
+ ->where('id')->in(array_keys($relations))
+ ->andWhere('deleted')->eq(0)
+ ->orderBy('id_desc')
+ ->fetchAll();
+
+ return $story;
+ }
+
+ /**
+ * Link stories.
+ *
+ * @param int $storyID
+ * @access public
+ * @return void
+ */
+ public function linkStories($storyID)
+ {
+ $story = $this->getByID($storyID);
+ $stories = $this->post->stories;
+ $isStory = ($story->type == 'story');
+
+ foreach($stories as $id)
+ {
+ $requirement = $this->getByID($id);
+ $data = new stdclass();
+ $data->program = $this->session->program;
+ $data->product = $this->session->product;
+ $data->AType = 'requirement';
+ $data->BType = 'story';
+ $data->relation = 'subdivideinto';
+ $data->AID = $isStory ? $id : $storyID;
+ $data->BID = $isStory ? $storyID : $id;
+ $data->AVersion = $isStory ? $requirement->version : $story->version;
+ $data->BVersion = $isStory ? $story->version : $requirement->version;
+
+ $this->dao->insert(TABLE_RELATION)->data($data)->autoCheck()->exec();
+
+ $data->AType = 'story';
+ $data->BType = 'requirement';
+ $data->relation = 'subdividedfrom';
+ $data->AID = $isStory ? $storyID : $id;
+ $data->BID = $isStory ? $id : $storyID;
+ $data->AVersion = $isStory ? $story->version : $requirement->version;
+ $data->BVersion = $isStory ? $requirement->version : $story->version;
+
+ $this->dao->insert(TABLE_RELATION)->data($data)->autoCheck()->exec();
+ }
+ }
+
+ /**
+ * Unlink story.
+ *
+ * @param int $storyID
+ * @param int $linkedStoryID
+ * @access public
+ * @return void
+ */
+ public function unlinkStory($storyID, $linkedStoryID)
+ {
+ $idList = "$storyID,$linkedStoryID";
+
+ $this->dao->delete()->from(TABLE_RELATION)
+ ->where('AType')->in('story,requirement')
+ ->andWhere('BType')->in('story,requirement')
+ ->andWhere('relation')->in('subdivideinto,subdividedfrom')
+ ->andWhere('AID')->in($idList)
+ ->andWhere('BID')->in($idList)
+ ->exec();
+
+ return !dao::isError();
+ }
+
+ /**
+ * Get story relations.
+ *
+ * @param int $storyID
+ * @param varchar $storyType
+ * @access public
+ * @return int
+ */
+ public function getRelation($storyID, $storyType, $extraField = array())
+ {
+ $BType = $storyType == 'story' ? 'requirement' : 'story';
+ $relation = $storyType == 'story' ? 'subdividedfrom' : 'subdivideinto';
+
+ $relations = $this->dao->select('BID')->from(TABLE_RELATION)
+ ->where('AType')->eq($storyType)
+ ->andWhere('BType')->eq($BType)
+ ->andWhere('relation')->eq($relation)
+ ->andWhere('AID')->eq($storyID)
+ ->fetchPairs();
+
+ if(!empty($relations))
+ {
+ if(empty($extraField))
+ {
+ return $this->dao->select('id, title')
+ ->from(TABLE_STORY)
+ ->where('deleted')->eq(0)
+ ->andWhere('id')->in($relations)
+ ->fetchPairs();
+ }
+ else
+ {
+ return $this->dao->select(implode($extraField, ','))
+ ->from(TABLE_STORY)
+ ->where('deleted')->eq(0)
+ ->andWhere('id')->in($relations)
+ ->fetchAll('id');
+ }
+ }
+ }
+
+ /**
+ * Get software requirements associated with user needs.
+ *
+ * @param array $storyID
+ * @param string $storyType
+ * @access public
+ * @return int
+ */
+ public function getStoryRelationCounts($storyID, $storyType = '')
+ {
+ $selectField = ($storyType == 'story') ? 'AID' : 'BID';
+ $conditionField = ($storyType == 'story') ? 'BID' : 'AID';
+
+ $relations = $this->dao->select('count('. $selectField .') as id')->from(TABLE_RELATION)
+ ->where('AType')->eq('requirement')
+ ->andWhere('BType')->eq('story')
+ ->andWhere('relation')->eq('subdivideinto')
+ ->andWhere($conditionField)->eq($storyID)
+ ->fetch('id');
+
+ return $relations;
+ }
}
diff --git a/module/story/view/edit.html.php b/module/story/view/edit.html.php
index c0e4e5980b..6c03da8ede 100644
--- a/module/story/view/edit.html.php
+++ b/module/story/view/edit.html.php
@@ -219,34 +219,6 @@
duplicateStory, "class='form-control'");?>
-
- story->linkStories;?>
- createLink('story', 'linkStory', "storyID=$story->id&type=linkStories", '', true), $lang->story->linkStory, '', "data-toggle='modal' data-type='iframe' data-width='95%'");?>
-
-
-
-
-
-
status == 'closed'):?>
story->childStories;?>
diff --git a/module/story/view/linkstory.html.php b/module/story/view/linkstory.html.php
index a90f3e6601..89d5b067b9 100644
--- a/module/story/view/linkstory.html.php
+++ b/module/story/view/linkstory.html.php
@@ -36,11 +36,11 @@
idAB;?>
priAB;?>
- story->product;?>
story->title;?>
- story->plan;?>
story->status;?>
+ type == 'requirement'):?>
story->stage;?>
+
openedByAB;?>
story->estimateAB;?>
@@ -58,11 +58,11 @@
id));?>
pri?>' title='story->priList, $story2Link->pri, $story2Link->pri);?>'>story->priList, $story2Link->pri, $story2Link->pri);?>
- createLink('product', 'browse', "productID=$story2Link->product&branch=$story2Link->branch"), $products[$story2Link->product], '_blank');?>
title, '_blank');?>
- planTitle;?>
processStatus('story', $story2Link);?>
+ type == 'requirement'):?>
story->stageList, $story2Link->stage);?>
+
openedBy);?>
estimate;?>
@@ -87,20 +87,6 @@ $(function()
$('#linkStoryForm').table();
setTimeout(function(){$('#linkStoryForm .table-footer').removeClass('fixed-footer');}, 100);
-
- $('#submit').click(function(){
- var output = '';
- $('#linkStoryForm').find('tr.checked').each(function(){
- var storyID = $(this).find('td.c-id').find('div.checkbox-primary input').attr('value');
- var storyName = "#" + storyID + ' ' + $(this).find('td').eq(3).attr('title');
- var checkbox = " ";
-
- output += checkbox;
- });
- $.closeModal();
- parent.$('#' + linkType + 'Box').html(output);
- return false;
- });
});
diff --git a/module/story/view/track.html.php b/module/story/view/track.html.php
new file mode 100644
index 0000000000..7b2deee001
--- /dev/null
+++ b/module/story/view/track.html.php
@@ -0,0 +1,86 @@
+
+
+
+
+ type == 'requirement'):?>
+
+ -
- linkStories)
- {
- $linkStories = explode(',', $story->linkStories);
- foreach($linkStories as $linkStoryID)
- {
- if(isset($story->extraStories[$linkStoryID]))
- {
- echo "
- "; - echo ""; - echo ""; - echo '';
- }
- }
- }
- ?>
-
-
+
+
diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php
index e93fc565ec..ecac3587f9 100644
--- a/module/story/view/view.html.php
+++ b/module/story/view/view.html.php
@@ -62,6 +62,56 @@
+
+
+
+
+
+ + noData;?> +
+
+
+
+
+
+
+ | story->requirement;?> | +story->story;?> | +story->design;?> | +story->case;?> | +story->repoCommit;?> | +story->bug;?> | +|||||
|---|---|---|---|---|---|---|---|---|---|---|
| class='requirement'> + story->noRequirement : html::a($this->createLink('story', 'view', "storyID=$requirement->id"), $requirement->title, '', "title=$requirement->title");?> + + story->statusList, $requirement->status);?> + + | + + + $story):?> + ';?> +createLink('story', 'view', "storyID=$storyID"), $story->title, '',"title='$story->title'");?> | +
+ design as $designID => $design):?>
+ createLink('design', 'view', "designID=$designID"), $design->name, '', "title='$design->name'") . ' ';?> + + |
+
+ case as $caseID => $case):?>
+ createLink('testcase', 'view', "caseID=$caseID"), $case->title, '', "title='$case->title'") . ' ';?> + + |
+
+ revision as $revision => $repoID):?>
+ createLink('design', 'revision', "repoID=$revision"), '#'. $revision) . ' '; + ?> + + |
+
+ bug as $bugID => $bug):?>
+ createLink('bug', 'view', "bugID=$bugID"), $bug->title, '', "title='$bug->title'") . ' ';?> + + |
+ ';?>
+
+
+
+ + | + | + | + | + + |
story->legendVerify;?>
verify;?>
+
+
+
fetch('file', 'printFiles', array('files' => $story->files, 'fieldset' => 'true'));?>
createLink('action', 'comment', "objectType=story&objectID=$story->id");?>
children)):?>
@@ -334,12 +384,34 @@
story->track;?>
+
+
+
+
+
+ | story->story;?> | +story->design;?> | +story->case;?> | +story->repoCommit;?> | +story->bug;?> | +
|---|---|---|---|---|
| createLink('story', 'view', "storyID=$storyID"), $storyInfo->title, '', "title='$storyInfo->title'");?> + | +
+ design as $designID => $design):?>
+ createLink('design', 'view', "designID=$designID"), $design->name, '', "title='$design->name'") . ' ';?> + + |
+
+ case as $caseID => $case):?>
+ createLink('testcase', 'view', "caseID=$caseID"), $case->title, '', "title='$case->title'") . ' ';?> + + |
+
+ revision as $revision => $repoID):?>
+ createLink('design', 'revision', "repoID=$revision"), '#'. $revision) . ' '; + ?> + + |
+
+ bug as $bugID => $bug):?>
+ createLink('bug', 'view', "bugID=$bugID"), $bug->title, '', "title='$bug->title'") . ' ';?> + + |
+
-
global->flow == 'onlyStory'):?>
- story->legendRelated;?> + template == 'cmmi'):?> +
- type == 'story' ? $lang->story->requirement : $lang->story->story;?> +
- story->legendProjectAndTask;?> +
- story->legendRelated;?>
- story->legendProjectAndTask;?>
- story->legendRelated;?>
+ template == 'cmmi'):?>
+
+
+
global->flow != 'onlyStory'):?>
-
+ id] = $item->title;
+ foreach($relation as $id => $title)
+ {
+ echo "
- " . html::a($this->createLink('story', 'view', "id=$id", '', true), "#$id $title", '', "class='iframe' data-width='80%'"); + echo html::a($this->createLink('story', 'linkStory', "storyID=$story->id&type=remove&linkedID=$id"), '', 'hiddenwin', "class='deleter hide removeButton'"); + } + ?> + type == 'story') ? $lang->story->requirement : $lang->story->story;?> +
- createLink('story', 'linkStory', "storyID=$story->id", '', true), $lang->story->link . $linkLang, '', "class='btn btn-info iframe' data-width='95%' id='linkButton'");?> + story->unlink . $linkLang, '', "class='btn btn-info' id='unlinkStory'");?> +
-
@@ -454,6 +526,8 @@ js::set('productID', $story->product);
js::set('branch', $story->branch);
js::set('moduleID', $story->module);
js::set('storyType', $story->type);
+js::set('unlink', $lang->story->unlink);
+js::set('cancel', $lang->cancel);
?>