@@ -23,7 +27,8 @@
{$pager->recTotal}";?>
createLink('project', 'execution', "status=$key&projectID=$projectID&orderBy=$orderBy&productID=$productID"), $label, '', "class='btn btn-link' id='{$key}Tab'");?>
- $lang->programplan->stageCustom->task), '', $this->cookie->showTask ? 'checked=checked' : '');?>
+ $lang->edit . $lang->executionCommon), '', $this->cookie->editExecution ? 'checked=checked' : '');?>
+ $lang->programplan->stageCustom->task), '', $this->cookie->showTask ? 'checked=checked' : '');?>
" . $lang->export, '', "class='btn btn-link export'")?>
diff --git a/module/story/control.php b/module/story/control.php
index ed68658d98..d9dfd515a9 100644
--- a/module/story/control.php
+++ b/module/story/control.php
@@ -1223,15 +1223,17 @@ class story extends control
$this->story->replaceURLang($story->type);
- $story->files = $this->loadModel('file')->getByObject($story->type, $storyID);
- $product = $this->dao->findById($story->product)->from(TABLE_PRODUCT)->fields('name, id, type, status')->fetch();
- $plan = $this->dao->findById($story->plan)->from(TABLE_PRODUCTPLAN)->fetch('title');
- $bugs = $this->dao->select('id,title,status,pri,severity')->from(TABLE_BUG)->where('story')->eq($storyID)->andWhere('deleted')->eq(0)->fetchAll();
- $fromBug = $this->dao->select('id,title')->from(TABLE_BUG)->where('toStory')->eq($storyID)->fetch();
- $cases = $this->dao->select('id,title,status,pri')->from(TABLE_CASE)->where('story')->eq($storyID)->andWhere('deleted')->eq(0)->fetchAll();
- $linkedMRs = $this->loadModel('mr')->getLinkedMRPairs($storyID, 'story');
- $modulePath = $this->tree->getParents($story->module);
- $storyModule = empty($story->module) ? '' : $this->tree->getById($story->module);
+ $story->files = $this->loadModel('file')->getByObject($story->type, $storyID);
+ $product = $this->dao->findById($story->product)->from(TABLE_PRODUCT)->fields('name, id, type, status')->fetch();
+ $plan = $this->dao->findById($story->plan)->from(TABLE_PRODUCTPLAN)->fetch('title');
+ $bugs = $this->dao->select('id,title,status,pri,severity')->from(TABLE_BUG)->where('story')->eq($storyID)->andWhere('deleted')->eq(0)->fetchAll();
+ $fromBug = $this->dao->select('id,title')->from(TABLE_BUG)->where('toStory')->eq($storyID)->fetch();
+ $cases = $this->dao->select('id,title,status,pri')->from(TABLE_CASE)->where('story')->eq($storyID)->andWhere('deleted')->eq(0)->fetchAll();
+ $linkedMRs = $this->loadModel('mr')->getLinkedMRPairs($storyID, 'story');
+ $modulePath = $this->tree->getParents($story->module);
+ $storyModule = empty($story->module) ? '' : $this->tree->getById($story->module);
+ $linkedStories = isset($story->linkStoryTitles) ? array_keys($story->linkStoryTitles) : array();
+ $storyProducts = $this->dao->select('id,product')->from(TABLE_STORY)->where('id')->in($linkedStories)->fetchPairs();
/* Set the menu. */
$from = $this->app->tab;
@@ -1284,6 +1286,7 @@ class story extends control
$this->view->actions = $this->action->getList('story', $storyID);
$this->view->storyModule = $storyModule;
$this->view->modulePath = $modulePath;
+ $this->view->storyProducts = $storyProducts;
$this->view->version = $version == 0 ? $story->version : $version;
$this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('story', $storyID);
$this->view->from = $from;
@@ -2173,6 +2176,67 @@ class story extends control
$this->display();
}
+ /**
+ * Link related stories.
+ *
+ * @param int $storyID
+ * @param string $browseType
+ * @param string $excludeStories
+ * @param int $param
+ * @param int $recTotal
+ * @param int $recPerPage
+ * @param int $pageID
+ * @access public
+ * @return void
+ */
+ public function linkStories($storyID, $browseType = '', $excludeStories = '', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1)
+ {
+ /* Load pager. */
+ $this->app->loadClass('pager', $static = true);
+ $pager = new pager($recTotal, $recPerPage, $pageID);
+
+ /* Get story, product, products, and queryID. */
+ $story = $this->story->getById($storyID);
+ $products = $this->product->getPairs();
+ $queryID = ($browseType == 'bySearch') ? (int)$param : 0;
+ $type = $story->type == 'story' ? 'linkRelateSR' : 'linkRelateUR';
+
+ /* Build search form. */
+ $actionURL = $this->createLink('story', 'linkStories', "storyID=$storyID&browseType=bySearch&excludeStories=$excludeStories&queryID=myQueryID", '', true);
+ $this->product->buildSearchForm($story->product, $products, $queryID, $actionURL);
+
+ $this->view->story = $story;
+ $this->view->stories2Link = $this->story->getStories2Link($storyID, $type, $browseType, $queryID, $story->type, $pager, $excludeStories);
+ $this->view->products = $products;
+ $this->view->users = $this->loadModel('user')->getPairs('noletter');
+ $this->view->pager = $pager;
+
+ $this->display();
+ }
+
+ /**
+ * Link related requirements.
+ *
+ * @param int $storyID
+ * @param string $browseType
+ * @param string $excludeStories
+ * @param int $param
+ * @param int $recTotal
+ * @param int $recPerPage
+ * @param int $pageID
+ * @access public
+ * @return void
+ */
+ public function linkRequirements($storyID, $browseType = '', $excludeStories = '', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1)
+ {
+ $this->lang->story->title = str_replace($this->lang->SRCommon, $this->lang->URCommon, $this->lang->story->title);
+ $this->config->product->search['fields']['title'] = $this->lang->story->title;
+ unset($this->config->product->search['fields']['plan']);
+ unset($this->config->product->search['fields']['stage']);
+
+ echo $this->fetch('story', 'linkStories', "storyID=$storyID&browseType=$browseType&excludeStories=$excludeStories¶m=$param&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID");
+ }
+
/**
* Process story change.
*
diff --git a/module/story/css/edit.css b/module/story/css/edit.css
index 325971cb2f..b85e9ddc66 100644
--- a/module/story/css/edit.css
+++ b/module/story/css/edit.css
@@ -1 +1,2 @@
#product_chosen .chosen-single{border-right-width:1px}
+.linkStoryTitle {white-space: nowrap; text-overflow: ellipsis;}
diff --git a/module/story/css/edit.zh-cn.css b/module/story/css/edit.zh-cn.css
index 637f071167..b89336d083 100644
--- a/module/story/css/edit.zh-cn.css
+++ b/module/story/css/edit.zh-cn.css
@@ -1,2 +1,2 @@
-.thWidth {width: 80px !important;}
+.thWidth {width: 95px !important;}
.linkThWidth {width: 70px !important;}
diff --git a/module/story/css/linkstories.css b/module/story/css/linkstories.css
new file mode 100644
index 0000000000..1a510d713c
--- /dev/null
+++ b/module/story/css/linkstories.css
@@ -0,0 +1,6 @@
+.main-table {height: 80% !important}
+#mainContent {min-height: 400px;}
+.c-id, .c-status, .c-user {width: 80px;}
+.c-pri {width: 60px;}
+.c-product {width: 150px;}
+.c-title {width: auto;}
diff --git a/module/story/js/edit.js b/module/story/js/edit.js
index f234363a3e..f3b8ffb683 100644
--- a/module/story/js/edit.js
+++ b/module/story/js/edit.js
@@ -32,4 +32,26 @@ $(function()
$('.feedbackBox').addClass('hidden');
}
});
+
+ $('#linkStoriesLink').click(function()
+ {
+ var storyIdList = '';
+ $('#linkStoriesBox input').each(function()
+ {
+ storyIdList += $(this).val() + ',';
+ });
+
+ var link = '';
+ if(storyType == 'story')
+ {
+ link = createLink('story', 'linkStories', 'storyID=' + storyID + '&browseType=&excludeStories=' + storyIdList, '', true);
+ }
+ else
+ {
+ link = createLink('story', 'linkRequirements', 'storyID=' + storyID + '&browseType=&excludeStories=' + storyIdList, '', true);
+ }
+
+ var modalTrigger = new $.zui.ModalTrigger({type: 'iframe', width: '95%', url: link});
+ modalTrigger.show();
+ });
})
diff --git a/module/story/lang/de.php b/module/story/lang/de.php
index 880b0afbc6..5612ad6422 100644
--- a/module/story/lang/de.php
+++ b/module/story/lang/de.php
@@ -52,6 +52,8 @@ $lang->story->bugCountAB = 'B';
$lang->story->caseCountAB = 'C';
$lang->story->linkStory = 'Verküpfen';
$lang->story->unlinkStory = 'Verknüpfung aufheben';
+$lang->story->linkStoriesAB = "Link {$lang->SRCommon}";
+$lang->story->linkRequirementsAB = "Link {$lang->URCommon}";
$lang->story->export = "Daten exportieren";
$lang->story->zeroCase = "Storys ohne Fälle";
$lang->story->zeroTask = "Storys ohne Aufgaben anzeigen";
@@ -86,84 +88,88 @@ $lang->story->batchToTaskTips = "This action will create a task with the same na
$lang->story->successToTask = "Converted to task.";
$lang->story->storyRound = '%s time estimation';
-$lang->story->id = 'ID';
-$lang->story->parent = 'Parent';
-$lang->story->product = $lang->productCommon;
-$lang->story->project = 'Project';
-$lang->story->branch = "Branch/Platform";
-$lang->story->module = 'Module';
-$lang->story->moduleAB = 'Module';
-$lang->story->source = 'Von';
-$lang->story->sourceNote = 'Hinweis';
-$lang->story->fromBug = 'Von Bug';
-$lang->story->title = 'Titel';
-$lang->story->type = "Story/Requirement";
-$lang->story->category = 'Category';
-$lang->story->color = 'Color';
-$lang->story->toBug = 'ToBug';
-$lang->story->spec = 'Beschreibung';
-$lang->story->assign = 'Assign';
-$lang->story->verify = 'Akzeptanz';
-$lang->story->pri = 'Priorität';
-$lang->story->estimate = 'Schätzung(h)';
-$lang->story->estimateAB = 'Schätzung(h)';
-$lang->story->hour = 'Stunde';
-$lang->story->status = 'Status';
-$lang->story->subStatus = 'Sub Status';
-$lang->story->stage = 'Phase';
-$lang->story->stageAB = 'Phase';
-$lang->story->stagedBy = 'SetBy';
-$lang->story->mailto = 'Mail an';
-$lang->story->openedBy = 'Ersteller';
-$lang->story->openedDate = 'Erstellt am';
-$lang->story->assignedTo = 'Zuständiger';
-$lang->story->assignedDate = 'Zugewisen am';
-$lang->story->lastEditedBy = 'Letzte Bearbeitung';
-$lang->story->lastEditedDate = 'Bearbeitet am';
-$lang->story->closedBy = 'Geschlossen von';
-$lang->story->closedDate = 'Geschlossen am';
-$lang->story->closedReason = 'Geschlossen weil';
-$lang->story->rejectedReason = 'Abgelehnt weil';
-$lang->story->reviewedBy = 'Prüfer';
-$lang->story->reviewer = $lang->story->reviewedBy;
-$lang->story->reviewers = 'Reviewers';
-$lang->story->reviewedDate = 'Geprüft am';
-$lang->story->activatedDate = 'Activated Date';
-$lang->story->version = 'Version';
-$lang->story->feedbackBy = 'From Name';
-$lang->story->notifyEmail = 'From Email';
-$lang->story->plan = 'Plan';
-$lang->story->planAB = 'Plan';
-$lang->story->comment = 'Kommentar';
-$lang->story->children = "Child {$lang->SRCommon}";
-$lang->story->childrenAB = "C";
-$lang->story->linkStories = 'Story verknüpfen';
-$lang->story->childStories = 'Story aufteilen';
-$lang->story->duplicateStory = 'Story ID kopieren';
-$lang->story->reviewResult = 'Ergbnis prüfen';
-$lang->story->preVersion = 'Frühere Version';
-$lang->story->keywords = 'Tags';
-$lang->story->newStory = 'Weitere Story';
-$lang->story->colorTag = 'Farb-Tag';
-$lang->story->files = 'Dateien';
-$lang->story->copy = "Story kopieren";
-$lang->story->total = "Total Storys";
-$lang->story->draft = 'Entwurf';
-$lang->story->unclosed = 'Nicht geschlossen';
-$lang->story->deleted = 'Gelöscht';
-$lang->story->released = 'Released Linked Stories';
-$lang->story->URChanged = 'Requirement Changed';
-$lang->story->design = 'Designs';
-$lang->story->case = 'Cases';
-$lang->story->bug = 'Bugs';
-$lang->story->repoCommit = 'Commits';
-$lang->story->noRequirement = 'No Requirements';
-$lang->story->one = 'One';
-$lang->story->field = 'Synchronized fields';
-$lang->story->completeRate = 'Completion Rate';
-$lang->story->reviewed = 'Reviewed';
-$lang->story->toBeReviewed = 'To Be Reviewed';
-$lang->story->linkMR = 'Related MRs';
+$lang->story->id = 'ID';
+$lang->story->parent = 'Parent';
+$lang->story->product = $lang->productCommon;
+$lang->story->project = 'Project';
+$lang->story->branch = "Branch/Platform";
+$lang->story->module = 'Module';
+$lang->story->moduleAB = 'Module';
+$lang->story->source = 'Von';
+$lang->story->sourceNote = 'Hinweis';
+$lang->story->fromBug = 'Von Bug';
+$lang->story->title = 'Titel';
+$lang->story->type = "Story/Requirement";
+$lang->story->category = 'Category';
+$lang->story->color = 'Color';
+$lang->story->toBug = 'ToBug';
+$lang->story->spec = 'Beschreibung';
+$lang->story->assign = 'Assign';
+$lang->story->verify = 'Akzeptanz';
+$lang->story->pri = 'Priorität';
+$lang->story->estimate = 'Schätzung(h)';
+$lang->story->estimateAB = 'Schätzung(h)';
+$lang->story->hour = 'Stunde';
+$lang->story->status = 'Status';
+$lang->story->statusAB = 'Status';
+$lang->story->subStatus = 'Sub Status';
+$lang->story->stage = 'Phase';
+$lang->story->stageAB = 'Phase';
+$lang->story->stagedBy = 'SetBy';
+$lang->story->mailto = 'Mail an';
+$lang->story->openedBy = 'Ersteller';
+$lang->story->openedByAB = 'Created';
+$lang->story->openedDate = 'Erstellt am';
+$lang->story->assignedTo = 'Zuständiger';
+$lang->story->assignedToAB = 'Assign';
+$lang->story->assignedDate = 'Zugewisen am';
+$lang->story->lastEditedBy = 'Letzte Bearbeitung';
+$lang->story->lastEditedDate = 'Bearbeitet am';
+$lang->story->closedBy = 'Geschlossen von';
+$lang->story->closedDate = 'Geschlossen am';
+$lang->story->closedReason = 'Geschlossen weil';
+$lang->story->rejectedReason = 'Abgelehnt weil';
+$lang->story->reviewedBy = 'Prüfer';
+$lang->story->reviewer = $lang->story->reviewedBy;
+$lang->story->reviewers = 'Reviewers';
+$lang->story->reviewedDate = 'Geprüft am';
+$lang->story->activatedDate = 'Activated Date';
+$lang->story->version = 'Version';
+$lang->story->feedbackBy = 'From Name';
+$lang->story->notifyEmail = 'From Email';
+$lang->story->plan = 'Plan';
+$lang->story->planAB = 'Plan';
+$lang->story->comment = 'Kommentar';
+$lang->story->children = "Child {$lang->SRCommon}";
+$lang->story->childrenAB = "C";
+$lang->story->linkStories = 'Story verknüpfen';
+$lang->story->linkRequirements = "Linked {$lang->URCommon}";
+$lang->story->childStories = 'Story aufteilen';
+$lang->story->duplicateStory = 'Story ID kopieren';
+$lang->story->reviewResult = 'Ergbnis prüfen';
+$lang->story->preVersion = 'Frühere Version';
+$lang->story->keywords = 'Tags';
+$lang->story->newStory = 'Weitere Story';
+$lang->story->colorTag = 'Farb-Tag';
+$lang->story->files = 'Dateien';
+$lang->story->copy = "Story kopieren";
+$lang->story->total = "Total Storys";
+$lang->story->draft = 'Entwurf';
+$lang->story->unclosed = 'Nicht geschlossen';
+$lang->story->deleted = 'Gelöscht';
+$lang->story->released = 'Released Linked Stories';
+$lang->story->URChanged = 'Requirement Changed';
+$lang->story->design = 'Designs';
+$lang->story->case = 'Cases';
+$lang->story->bug = 'Bugs';
+$lang->story->repoCommit = 'Commits';
+$lang->story->noRequirement = 'No Requirements';
+$lang->story->one = 'One';
+$lang->story->field = 'Synchronized fields';
+$lang->story->completeRate = 'Completion Rate';
+$lang->story->reviewed = 'Reviewed';
+$lang->story->toBeReviewed = 'To Be Reviewed';
+$lang->story->linkMR = 'Related MRs';
$lang->story->ditto = 'Dito';
$lang->story->dittoNotice = 'Die Story gehört nicht zum Projekt wie die vorherige!';
diff --git a/module/story/lang/en.php b/module/story/lang/en.php
index ea25a9bcf7..8048b2ad27 100644
--- a/module/story/lang/en.php
+++ b/module/story/lang/en.php
@@ -52,6 +52,8 @@ $lang->story->bugCountAB = 'B';
$lang->story->caseCountAB = 'C';
$lang->story->linkStory = 'Link Story';
$lang->story->unlinkStory = 'UnLinked';
+$lang->story->linkStoriesAB = "Link {$lang->SRCommon}";
+$lang->story->linkRequirementsAB = "Link {$lang->URCommon}";
$lang->story->export = "Export Data";
$lang->story->zeroCase = "Stories without cases";
$lang->story->zeroTask = "Only list stories without tasks";
@@ -86,84 +88,88 @@ $lang->story->batchToTaskTips = "This action will create a task with the same na
$lang->story->successToTask = "Converted to task.";
$lang->story->storyRound = '%s time estimation';
-$lang->story->id = 'ID';
-$lang->story->parent = 'Parent';
-$lang->story->product = $lang->productCommon;
-$lang->story->project = 'Project';
-$lang->story->branch = "Branch/Platform";
-$lang->story->module = 'Module';
-$lang->story->moduleAB = 'Module';
-$lang->story->source = 'From';
-$lang->story->sourceNote = 'Note';
-$lang->story->fromBug = 'From Bug';
-$lang->story->title = 'Title';
-$lang->story->type = "Story/Requirement";
-$lang->story->category = 'Category';
-$lang->story->color = 'Color';
-$lang->story->toBug = 'ToBug';
-$lang->story->spec = 'Description';
-$lang->story->assign = 'Assign';
-$lang->story->verify = 'Acceptance';
-$lang->story->pri = 'Priority';
-$lang->story->estimate = "Estimates";
-$lang->story->estimateAB = 'Est.';
-$lang->story->hour = $lang->hourCommon;
-$lang->story->status = 'Status';
-$lang->story->subStatus = 'Sub Status';
-$lang->story->stage = 'Phase';
-$lang->story->stageAB = 'Phase';
-$lang->story->stagedBy = 'SetBy';
-$lang->story->mailto = 'Mailto';
-$lang->story->openedBy = 'Created By';
-$lang->story->openedDate = 'Created Date';
-$lang->story->assignedTo = 'AssignTo';
-$lang->story->assignedDate = 'AssignedDate';
-$lang->story->lastEditedBy = 'EditedBy';
-$lang->story->lastEditedDate = 'EditedDate';
-$lang->story->closedBy = 'ClosedBy';
-$lang->story->closedDate = 'ClosedDate';
-$lang->story->closedReason = 'Reason';
-$lang->story->rejectedReason = 'Reject Reason';
-$lang->story->reviewedBy = 'ReviewedBy';
-$lang->story->reviewer = $lang->story->reviewedBy;
-$lang->story->reviewers = 'Reviewers';
-$lang->story->reviewedDate = 'ReviewedDate';
-$lang->story->activatedDate = 'Activated Date';
-$lang->story->version = 'Version';
-$lang->story->feedbackBy = 'From Name';
-$lang->story->notifyEmail = 'From Email';
-$lang->story->plan = 'Linked Plan';
-$lang->story->planAB = 'Plan';
-$lang->story->comment = 'Comment';
-$lang->story->children = "Child {$lang->SRCommon}";
-$lang->story->childrenAB = "C";
-$lang->story->linkStories = 'Linked Story';
-$lang->story->childStories = 'Decomposed Story';
-$lang->story->duplicateStory = 'Duplicated Story ID';
-$lang->story->reviewResult = 'Review Result';
-$lang->story->preVersion = 'Last Version';
-$lang->story->keywords = 'Tags';
-$lang->story->newStory = 'Continue adding';
-$lang->story->colorTag = 'Color';
-$lang->story->files = 'Files';
-$lang->story->copy = "Copy Story";
-$lang->story->total = "Total Stories";
-$lang->story->draft = 'Draft';
-$lang->story->unclosed = 'Unclosed';
-$lang->story->deleted = 'Deleted';
-$lang->story->released = 'Released Stories';
-$lang->story->URChanged = 'Requirement Changed';
-$lang->story->design = 'Design';
-$lang->story->case = 'Cases';
-$lang->story->bug = 'Bugs';
-$lang->story->repoCommit = 'Commits';
-$lang->story->noRequirement = 'No Requirements';
-$lang->story->one = 'One';
-$lang->story->field = 'Sync Field';
-$lang->story->completeRate = 'Completion Rate';
-$lang->story->reviewed = 'Reviewed';
-$lang->story->toBeReviewed = 'To Be Reviewed';
-$lang->story->linkMR = 'Related MRs';
+$lang->story->id = 'ID';
+$lang->story->parent = 'Parent';
+$lang->story->product = $lang->productCommon;
+$lang->story->project = 'Project';
+$lang->story->branch = "Branch/Platform";
+$lang->story->module = 'Module';
+$lang->story->moduleAB = 'Module';
+$lang->story->source = 'From';
+$lang->story->sourceNote = 'Note';
+$lang->story->fromBug = 'From Bug';
+$lang->story->title = 'Title';
+$lang->story->type = "Story/Requirement";
+$lang->story->category = 'Category';
+$lang->story->color = 'Color';
+$lang->story->toBug = 'ToBug';
+$lang->story->spec = 'Description';
+$lang->story->assign = 'Assign';
+$lang->story->verify = 'Acceptance';
+$lang->story->pri = 'Priority';
+$lang->story->estimate = "Estimates";
+$lang->story->estimateAB = 'Est.';
+$lang->story->hour = $lang->hourCommon;
+$lang->story->status = 'Status';
+$lang->story->statusAB = 'Status';
+$lang->story->subStatus = 'Sub Status';
+$lang->story->stage = 'Phase';
+$lang->story->stageAB = 'Phase';
+$lang->story->stagedBy = 'SetBy';
+$lang->story->mailto = 'Mailto';
+$lang->story->openedBy = 'Created By';
+$lang->story->openedByAB = 'Created';
+$lang->story->openedDate = 'Created Date';
+$lang->story->assignedTo = 'AssignTo';
+$lang->story->assignedToAB = 'Assign';
+$lang->story->assignedDate = 'AssignedDate';
+$lang->story->lastEditedBy = 'EditedBy';
+$lang->story->lastEditedDate = 'EditedDate';
+$lang->story->closedBy = 'ClosedBy';
+$lang->story->closedDate = 'ClosedDate';
+$lang->story->closedReason = 'Reason';
+$lang->story->rejectedReason = 'Reject Reason';
+$lang->story->reviewedBy = 'ReviewedBy';
+$lang->story->reviewer = $lang->story->reviewedBy;
+$lang->story->reviewers = 'Reviewers';
+$lang->story->reviewedDate = 'ReviewedDate';
+$lang->story->activatedDate = 'Activated Date';
+$lang->story->version = 'Version';
+$lang->story->feedbackBy = 'From Name';
+$lang->story->notifyEmail = 'From Email';
+$lang->story->plan = 'Linked Plan';
+$lang->story->planAB = 'Plan';
+$lang->story->comment = 'Comment';
+$lang->story->children = "Child {$lang->SRCommon}";
+$lang->story->childrenAB = "C";
+$lang->story->linkStories = 'Linked Story';
+$lang->story->linkRequirements = "Linked {$lang->URCommon}";
+$lang->story->childStories = 'Decomposed Story';
+$lang->story->duplicateStory = 'Duplicated Story ID';
+$lang->story->reviewResult = 'Review Result';
+$lang->story->preVersion = 'Last Version';
+$lang->story->keywords = 'Tags';
+$lang->story->newStory = 'Continue adding';
+$lang->story->colorTag = 'Color';
+$lang->story->files = 'Files';
+$lang->story->copy = "Copy Story";
+$lang->story->total = "Total Stories";
+$lang->story->draft = 'Draft';
+$lang->story->unclosed = 'Unclosed';
+$lang->story->deleted = 'Deleted';
+$lang->story->released = 'Released Stories';
+$lang->story->URChanged = 'Requirement Changed';
+$lang->story->design = 'Design';
+$lang->story->case = 'Cases';
+$lang->story->bug = 'Bugs';
+$lang->story->repoCommit = 'Commits';
+$lang->story->noRequirement = 'No Requirements';
+$lang->story->one = 'One';
+$lang->story->field = 'Sync Field';
+$lang->story->completeRate = 'Completion Rate';
+$lang->story->reviewed = 'Reviewed';
+$lang->story->toBeReviewed = 'To Be Reviewed';
+$lang->story->linkMR = 'Related MRs';
$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/fr.php b/module/story/lang/fr.php
index aa505299e5..a1c65d585f 100644
--- a/module/story/lang/fr.php
+++ b/module/story/lang/fr.php
@@ -52,6 +52,8 @@ $lang->story->bugCountAB = 'B';
$lang->story->caseCountAB = 'C';
$lang->story->linkStory = 'Lier Story';
$lang->story->unlinkStory = 'Dissocier';
+$lang->story->linkStoriesAB = "Lier {$lang->SRCommon}";
+$lang->story->linkRequirementsAB = "Lier {$lang->URCommon}";
$lang->story->export = "Exporter Données";
$lang->story->zeroCase = "Stories sans CasTests";
$lang->story->zeroTask = "Seulement liste des stories sans tâches";
@@ -86,84 +88,88 @@ $lang->story->batchToTaskTips = "This action will create a task with the same na
$lang->story->successToTask = "Converted to task.";
$lang->story->storyRound = '%s time estimation';
-$lang->story->id = 'ID';
-$lang->story->parent = 'Parent';
-$lang->story->product = $lang->productCommon;
-$lang->story->project = 'Project';
-$lang->story->branch = "Branche/Plateforme";
-$lang->story->module = 'Module';
-$lang->story->moduleAB = 'Module';
-$lang->story->source = 'De';
-$lang->story->sourceNote = 'Note';
-$lang->story->fromBug = 'Depuis Bug';
-$lang->story->title = 'Titre';
-$lang->story->type = "Story/Requirement";
-$lang->story->category = 'Category';
-$lang->story->color = 'Couleur';
-$lang->story->toBug = 'Vers Bug';
-$lang->story->spec = 'Description';
-$lang->story->assign = 'Affecter';
-$lang->story->verify = 'Acceptance';
-$lang->story->pri = 'Priorité';
-$lang->story->estimate = 'Estimation';
-$lang->story->estimateAB = 'Esti.(h)';
-$lang->story->hour = 'Heures';
-$lang->story->status = 'Statut';
-$lang->story->subStatus = 'Sous-statut';
-$lang->story->stage = 'Phase';
-$lang->story->stageAB = 'Phase';
-$lang->story->stagedBy = 'Fixé par';
-$lang->story->mailto = 'Mailto';
-$lang->story->openedBy = 'Créée par';
-$lang->story->openedDate = 'Date Création';
-$lang->story->assignedTo = 'Assignée à';
-$lang->story->assignedDate = 'Date Assignation';
-$lang->story->lastEditedBy = 'Editée par';
-$lang->story->lastEditedDate = 'Date Edition';
-$lang->story->closedBy = 'Fermée par';
-$lang->story->closedDate = 'Date Fermeture';
-$lang->story->closedReason = 'Raison';
-$lang->story->rejectedReason = 'Raison du Rejet';
-$lang->story->reviewedBy = 'Validée par';
-$lang->story->reviewer = $lang->story->reviewedBy;
-$lang->story->reviewers = 'Reviewers';
-$lang->story->reviewedDate = 'Date Validation';
-$lang->story->activatedDate = 'Activated Date';
-$lang->story->version = 'Version';
-$lang->story->feedbackBy = 'From Name';
-$lang->story->notifyEmail = 'From Email';
-$lang->story->plan = 'Intégrée Plans';
-$lang->story->planAB = 'Plan';
-$lang->story->comment = 'Commentaire';
-$lang->story->children = "Enfant {$lang->SRCommon}";
-$lang->story->childrenAB = "C";
-$lang->story->linkStories = 'Stories Liées';
-$lang->story->childStories = 'Stories Décomposées';
-$lang->story->duplicateStory = 'Story ID Dupliquées';
-$lang->story->reviewResult = 'Résultat Validation';
-$lang->story->preVersion = 'Dernière Version';
-$lang->story->keywords = 'Tags';
-$lang->story->newStory = "Continuer d'ajouter";
-$lang->story->colorTag = 'Couleur';
-$lang->story->files = 'Fichiers';
-$lang->story->copy = "Copier Story";
-$lang->story->total = "Stories Total";
-$lang->story->draft = 'Brouillon';
-$lang->story->unclosed = 'Non Fermées';
-$lang->story->deleted = 'Supprimée';
-$lang->story->released = 'Stories Versionnées';
-$lang->story->URChanged = 'Requirement Changed';
-$lang->story->design = 'Designs';
-$lang->story->case = 'Cases';
-$lang->story->bug = 'Bugs';
-$lang->story->repoCommit = 'Commits';
-$lang->story->noRequirement = 'No Requirements';
-$lang->story->one = 'One';
-$lang->story->field = 'Synchronized fields';
-$lang->story->completeRate = 'Completion Rate';
-$lang->story->reviewed = 'Reviewed';
-$lang->story->toBeReviewed = 'To Be Reviewed';
-$lang->story->linkMR = 'Related MRs';
+$lang->story->id = 'ID';
+$lang->story->parent = 'Parent';
+$lang->story->product = $lang->productCommon;
+$lang->story->project = 'Project';
+$lang->story->branch = "Branche/Plateforme";
+$lang->story->module = 'Module';
+$lang->story->moduleAB = 'Module';
+$lang->story->source = 'De';
+$lang->story->sourceNote = 'Note';
+$lang->story->fromBug = 'Depuis Bug';
+$lang->story->title = 'Titre';
+$lang->story->type = "Story/Requirement";
+$lang->story->category = 'Category';
+$lang->story->color = 'Couleur';
+$lang->story->toBug = 'Vers Bug';
+$lang->story->spec = 'Description';
+$lang->story->assign = 'Affecter';
+$lang->story->verify = 'Acceptance';
+$lang->story->pri = 'Priorité';
+$lang->story->estimate = 'Estimation';
+$lang->story->estimateAB = 'Esti.(h)';
+$lang->story->hour = 'Heures';
+$lang->story->status = 'Statut';
+$lang->story->statusAB = 'Statut';
+$lang->story->subStatus = 'Sous-statut';
+$lang->story->stage = 'Phase';
+$lang->story->stageAB = 'Phase';
+$lang->story->stagedBy = 'Fixé par';
+$lang->story->mailto = 'Mailto';
+$lang->story->openedBy = 'Créée par';
+$lang->story->openedByAB = 'Créer';
+$lang->story->openedDate = 'Date Création';
+$lang->story->assignedTo = 'Assignée à';
+$lang->story->assignedToAB = 'Attribuer';
+$lang->story->assignedDate = 'Date Assignation';
+$lang->story->lastEditedBy = 'Editée par';
+$lang->story->lastEditedDate = 'Date Edition';
+$lang->story->closedBy = 'Fermée par';
+$lang->story->closedDate = 'Date Fermeture';
+$lang->story->closedReason = 'Raison';
+$lang->story->rejectedReason = 'Raison du Rejet';
+$lang->story->reviewedBy = 'Validée par';
+$lang->story->reviewer = $lang->story->reviewedBy;
+$lang->story->reviewers = 'Reviewers';
+$lang->story->reviewedDate = 'Date Validation';
+$lang->story->activatedDate = 'Activated Date';
+$lang->story->version = 'Version';
+$lang->story->feedbackBy = 'From Name';
+$lang->story->notifyEmail = 'From Email';
+$lang->story->plan = 'Intégrée Plans';
+$lang->story->planAB = 'Plan';
+$lang->story->comment = 'Commentaire';
+$lang->story->children = "Enfant {$lang->SRCommon}";
+$lang->story->childrenAB = "C";
+$lang->story->linkStories = 'Stories Liées';
+$lang->story->linkRequirements = "{$lang->URCommon} Lié es";
+$lang->story->childStories = 'Stories Décomposées';
+$lang->story->duplicateStory = 'Story ID Dupliquées';
+$lang->story->reviewResult = 'Résultat Validation';
+$lang->story->preVersion = 'Dernière Version';
+$lang->story->keywords = 'Tags';
+$lang->story->newStory = "Continuer d'ajouter";
+$lang->story->colorTag = 'Couleur';
+$lang->story->files = 'Fichiers';
+$lang->story->copy = "Copier Story";
+$lang->story->total = "Stories Total";
+$lang->story->draft = 'Brouillon';
+$lang->story->unclosed = 'Non Fermées';
+$lang->story->deleted = 'Supprimée';
+$lang->story->released = 'Stories Versionnées';
+$lang->story->URChanged = 'Requirement Changed';
+$lang->story->design = 'Designs';
+$lang->story->case = 'Cases';
+$lang->story->bug = 'Bugs';
+$lang->story->repoCommit = 'Commits';
+$lang->story->noRequirement = 'No Requirements';
+$lang->story->one = 'One';
+$lang->story->field = 'Synchronized fields';
+$lang->story->completeRate = 'Completion Rate';
+$lang->story->reviewed = 'Reviewed';
+$lang->story->toBeReviewed = 'To Be Reviewed';
+$lang->story->linkMR = 'Related MRs';
$lang->story->ditto = 'Idem';
$lang->story->dittoNotice = "La story n'est pas associée au même product que la précédente !";
diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php
index ea6b15b89b..79788b4d73 100644
--- a/module/story/lang/zh-cn.php
+++ b/module/story/lang/zh-cn.php
@@ -52,6 +52,8 @@ $lang->story->bugCountAB = 'B';
$lang->story->caseCountAB = 'C';
$lang->story->linkStory = "关联{$lang->SRCommon}";
$lang->story->unlinkStory = "移除相关{$lang->SRCommon}";
+$lang->story->linkStoriesAB = "关联相关{$lang->SRCommon}";
+$lang->story->linkRequirementsAB = "关联相关{$lang->URCommon}";
$lang->story->export = "导出数据";
$lang->story->zeroCase = "零用例{$lang->SRCommon}";
$lang->story->zeroTask = "只列零任务{$lang->SRCommon}";
@@ -86,84 +88,88 @@ $lang->story->batchToTaskTips = "此操作会创建与所选{$lang->SRCommon}同
$lang->story->successToTask = '批量转任务成功';
$lang->story->storyRound = '第 %s 轮估算';
-$lang->story->id = '编号';
-$lang->story->parent = '父需求';
-$lang->story->product = "所属{$lang->productCommon}";
-$lang->story->project = "所属项目";
-$lang->story->branch = "分支/平台";
-$lang->story->module = '所属模块';
-$lang->story->moduleAB = '模块';
-$lang->story->source = "来源";
-$lang->story->sourceNote = '来源备注';
-$lang->story->fromBug = '来源Bug';
-$lang->story->title = "{$lang->SRCommon}名称";
-$lang->story->type = "需求类型";
-$lang->story->category = "类别";
-$lang->story->color = '标题颜色';
-$lang->story->toBug = '转Bug';
-$lang->story->spec = "描述";
-$lang->story->assign = '指派给';
-$lang->story->verify = '验收标准';
-$lang->story->pri = '优先级';
-$lang->story->estimate = "预计{$lang->hourCommon}";
-$lang->story->estimateAB = '预计';
-$lang->story->hour = $lang->hourCommon;
-$lang->story->status = '当前状态';
-$lang->story->subStatus = '子状态';
-$lang->story->stage = '所处阶段';
-$lang->story->stageAB = '阶段';
-$lang->story->stagedBy = '设置阶段者';
-$lang->story->mailto = '抄送给';
-$lang->story->openedBy = '由谁创建';
-$lang->story->openedDate = '创建日期';
-$lang->story->assignedTo = '指派给';
-$lang->story->assignedDate = '指派日期';
-$lang->story->lastEditedBy = '最后修改';
-$lang->story->lastEditedDate = '最后修改日期';
-$lang->story->closedBy = '由谁关闭';
-$lang->story->closedDate = '关闭日期';
-$lang->story->closedReason = '关闭原因';
-$lang->story->rejectedReason = '拒绝原因';
-$lang->story->reviewedBy = '由谁评审';
-$lang->story->reviewer = $lang->story->reviewedBy;
-$lang->story->reviewers = '评审人员';
-$lang->story->reviewedDate = '评审时间';
-$lang->story->activatedDate = '激活日期';
-$lang->story->version = '版本号';
-$lang->story->feedbackBy = '反馈者';
-$lang->story->notifyEmail = '通知邮箱';
-$lang->story->plan = "所属计划";
-$lang->story->planAB = '计划';
-$lang->story->comment = '备注';
-$lang->story->children = "子需求";
-$lang->story->childrenAB = "子";
-$lang->story->linkStories = "相关{$lang->SRCommon}";
-$lang->story->childStories = "细分需求";
-$lang->story->duplicateStory = "重复需求ID";
-$lang->story->reviewResult = '评审意见';
-$lang->story->preVersion = '之前版本';
-$lang->story->keywords = '关键词';
-$lang->story->newStory = "继续添加{$lang->SRCommon}";
-$lang->story->colorTag = '颜色标签';
-$lang->story->files = '附件';
-$lang->story->copy = "复制{$lang->SRCommon}";
-$lang->story->total = "总{$lang->SRCommon}";
-$lang->story->draft = '草稿';
-$lang->story->unclosed = '未关闭';
-$lang->story->deleted = '已删除';
-$lang->story->released = "已发布{$lang->SRCommon}数";
-$lang->story->URChanged = '用需变更';
-$lang->story->design = '相关设计';
-$lang->story->case = '相关用例';
-$lang->story->bug = '相关Bug';
-$lang->story->repoCommit = '相关提交';
-$lang->story->noRequirement = '无需求';
-$lang->story->one = '一个';
-$lang->story->field = '同步的字段';
-$lang->story->completeRate = '完成率';
-$lang->story->reviewed = '已评审';
-$lang->story->toBeReviewed = '待评审';
-$lang->story->linkMR = '相关合并请求';
+$lang->story->id = '编号';
+$lang->story->parent = '父需求';
+$lang->story->product = "所属{$lang->productCommon}";
+$lang->story->project = "所属项目";
+$lang->story->branch = "分支/平台";
+$lang->story->module = '所属模块';
+$lang->story->moduleAB = '模块';
+$lang->story->source = "来源";
+$lang->story->sourceNote = '来源备注';
+$lang->story->fromBug = '来源Bug';
+$lang->story->title = "{$lang->SRCommon}名称";
+$lang->story->type = "需求类型";
+$lang->story->category = "类别";
+$lang->story->color = '标题颜色';
+$lang->story->toBug = '转Bug';
+$lang->story->spec = "描述";
+$lang->story->assign = '指派给';
+$lang->story->verify = '验收标准';
+$lang->story->pri = '优先级';
+$lang->story->estimate = "预计{$lang->hourCommon}";
+$lang->story->estimateAB = '预计';
+$lang->story->hour = $lang->hourCommon;
+$lang->story->status = '当前状态';
+$lang->story->statusAB = '状态';
+$lang->story->subStatus = '子状态';
+$lang->story->stage = '所处阶段';
+$lang->story->stageAB = '阶段';
+$lang->story->stagedBy = '设置阶段者';
+$lang->story->mailto = '抄送给';
+$lang->story->openedBy = '由谁创建';
+$lang->story->openedByAB = '创建';
+$lang->story->openedDate = '创建日期';
+$lang->story->assignedTo = '指派给';
+$lang->story->assignedToAB = '指派';
+$lang->story->assignedDate = '指派日期';
+$lang->story->lastEditedBy = '最后修改';
+$lang->story->lastEditedDate = '最后修改日期';
+$lang->story->closedBy = '由谁关闭';
+$lang->story->closedDate = '关闭日期';
+$lang->story->closedReason = '关闭原因';
+$lang->story->rejectedReason = '拒绝原因';
+$lang->story->reviewedBy = '由谁评审';
+$lang->story->reviewer = $lang->story->reviewedBy;
+$lang->story->reviewers = '评审人员';
+$lang->story->reviewedDate = '评审时间';
+$lang->story->activatedDate = '激活日期';
+$lang->story->version = '版本号';
+$lang->story->feedbackBy = '反馈者';
+$lang->story->notifyEmail = '通知邮箱';
+$lang->story->plan = "所属计划";
+$lang->story->planAB = '计划';
+$lang->story->comment = '备注';
+$lang->story->children = "子需求";
+$lang->story->childrenAB = "子";
+$lang->story->linkStories = "相关{$lang->SRCommon}";
+$lang->story->linkRequirements = "相关{$lang->URCommon}";
+$lang->story->childStories = "细分需求";
+$lang->story->duplicateStory = "重复需求ID";
+$lang->story->reviewResult = '评审意见';
+$lang->story->preVersion = '之前版本';
+$lang->story->keywords = '关键词';
+$lang->story->newStory = "继续添加{$lang->SRCommon}";
+$lang->story->colorTag = '颜色标签';
+$lang->story->files = '附件';
+$lang->story->copy = "复制{$lang->SRCommon}";
+$lang->story->total = "总{$lang->SRCommon}";
+$lang->story->draft = '草稿';
+$lang->story->unclosed = '未关闭';
+$lang->story->deleted = '已删除';
+$lang->story->released = "已发布{$lang->SRCommon}数";
+$lang->story->URChanged = '用需变更';
+$lang->story->design = '相关设计';
+$lang->story->case = '相关用例';
+$lang->story->bug = '相关Bug';
+$lang->story->repoCommit = '相关提交';
+$lang->story->noRequirement = '无需求';
+$lang->story->one = '一个';
+$lang->story->field = '同步的字段';
+$lang->story->completeRate = '完成率';
+$lang->story->reviewed = '已评审';
+$lang->story->toBeReviewed = '待评审';
+$lang->story->linkMR = '相关合并请求';
$lang->story->ditto = '同上';
$lang->story->dittoNotice = "该{$lang->SRCommon}与上一{$lang->SRCommon}不属于同一产品!";
diff --git a/module/story/model.php b/module/story/model.php
index 07bcfb732f..7a6f038151 100644
--- a/module/story/model.php
+++ b/module/story/model.php
@@ -72,6 +72,9 @@ class storyModel extends model
$extraStories = array_unique($extraStories);
if(!empty($extraStories)) $story->extraStories = $this->dao->select('id,title')->from(TABLE_STORY)->where('id')->in($extraStories)->fetchPairs();
+ $linkStoryField = $story->type == 'story' ? 'linkStories' : 'linkRequirements';
+ if($story->{$linkStoryField}) $story->linkStoryTitles = $this->dao->select('id,title')->from(TABLE_STORY)->where('id')->in($story->{$linkStoryField})->fetchPairs();
+
$story->children = array();
if($story->parent == '-1') $story->children = $this->dao->select('*')->from(TABLE_STORY)->where('parent')->eq($storyID)->andWhere('deleted')->eq(0)->fetchAll('id');
@@ -812,10 +815,14 @@ class storyModel extends model
->join('reviewedBy', ',')
->join('mailto', ',')
->join('linkStories', ',')
+ ->join('linkRequirements', ',')
->join('childStories', ',')
->remove('files,labels,comment,contactListMenu,stages,reviewer')
->get();
+ if($oldStory->type == 'story' and !isset($story->linkStories)) $story->linkStories = '';
+ if($oldStory->type == 'requirement' and !isset($story->linkRequirements)) $story->linkRequirements = '';
+
if(isset($story->plan) and is_array($story->plan)) $story->plan = trim(join(',', $story->plan), ',');
if(isset($_POST['branch']) and $_POST['branch'] == 0) $story->branch = 0;
if(!empty($_POST['stages']))
@@ -965,7 +972,7 @@ class storyModel extends model
if(empty($oldStory->plan) or empty($story->plan)) $this->setStage($storyID); // Set new stage for this story.
}
- if($oldStory->stage != $story->stage)
+ if(isset($story->stage) and $oldStory->stage != $story->stage)
{
$executionIdList = $this->dao->select('t1.project')->from(TABLE_PROJECTSTORY)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
@@ -981,6 +988,29 @@ class storyModel extends model
unset($oldStory->parent);
unset($story->parent);
if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $oldStory->feedback) $this->loadModel('feedback')->updateStatus('story', $oldStory->feedback, $story->status, $oldStory->status);
+
+ $linkStoryField = $oldStory->type == 'story' ? 'linkStories' : 'linkRequirements';
+ $linkStories = explode(',', $story->{$linkStoryField});
+ $oldLinkStories = explode(',', $oldStory->{$linkStoryField});
+ $addStories = array_diff($linkStories, $oldLinkStories);
+ $removeStories = array_diff($oldLinkStories, $linkStories);
+ $changeStories = array_merge($addStories, $removeStories);
+ $changeStories = $this->dao->select("id,$linkStoryField")->from(TABLE_STORY)->where('id')->in(array_filter($changeStories))->fetchPairs();
+ foreach($changeStories as $changeStoryID => $changeStory)
+ {
+ if(in_array($changeStoryID, $addStories))
+ {
+ $stories = empty($changeStory) ? $storyID : $changeStory . ',' . $storyID;
+ $this->dao->update(TABLE_STORY)->set($linkStoryField)->eq($stories)->where('id')->eq((int)$changeStoryID)->exec();
+ }
+
+ if(in_array($changeStoryID, $removeStories))
+ {
+ $linkStories = str_replace(",$storyID,", ',', ",$changeStory,");
+ $linkStories = trim($linkStories, ',');
+ $this->dao->update(TABLE_STORY)->set($linkStoryField)->eq(implode(',', $linkStories))->where('id')->eq((int)$changeStoryID)->exec();
+ }
+ }
return common::createChanges($oldStory, $story);
}
}
@@ -2379,39 +2409,49 @@ class storyModel extends model
* Get stories to link.
*
* @param int $storyID
- * @param string $type
+ * @param string $type linkStories|linkRelateSR|linkRelateUR
* @param string $browseType
* @param int $queryID
- * @param varchar $storyType
+ * @param string $storyType
+ * @param object $pager
+ * @param string $excludeStories
* @access public
* @return array
*/
- public function getStories2Link($storyID, $type = 'linkStories', $browseType = 'bySearch', $queryID = 0, $storyType = 'story')
+ public function getStories2Link($storyID, $type = 'linkStories', $browseType = 'bySearch', $queryID = 0, $storyType = 'story', $pager = null, $excludeStories = '')
{
$story = $this->getById($storyID);
- $linkedStories = $this->getRelation($storyID, $story->type);
- $linkedStories = empty($linkedStories) ? array() : $linkedStories;
$tmpStoryType = $storyType == 'story' ? 'requirement' : 'story';
-
- if($browseType == 'bySearch')
+ $stories2Link = array();
+ if($type == 'linkRelateSR' or $type == 'linkRelateUR')
{
- $stories2Link = $this->getBySearch($story->product, $story->branch, $queryID, 'id', '', $tmpStoryType);
- foreach($stories2Link as $key => $story2Link)
- {
- if($story2Link->id == $storyID) unset($stories2Link[$key]);
- if(in_array($story2Link->id, explode(',', $story->$type))) unset($stories2Link[$key]);
- }
+ $tmpStoryType = $story->type;
+ $linkStoryField = $story->type == 'story' ? 'linkStories' : 'linkRequirements';
+ $storyIDList = $story->id . ',' . $excludeStories . ',' . $story->{$linkStoryField};
}
else
{
- $status = $storyType == 'story' ? 'active' : 'all';
- $stories2Link = $this->getProductStories($story->product, $story->branch, 0, $status, $tmpStoryType, $orderBy = 'id_desc');
+ $linkedStories = $this->getRelation($storyID, $story->type);
+ $linkedStories = empty($linkedStories) ? array() : $linkedStories;
+ $storyIDList = array_keys($linkedStories);
}
- foreach($stories2Link as $id => $story)
+ if($browseType == 'bySearch')
{
- if(in_array($story->id, array_keys($linkedStories))) unset($stories2Link[$id]);
- if($storyType == 'story' && $story->status == 'draft') unset($stories2Link[$id]);
+ $stories2Link = $this->getBySearch($story->product, $story->branch, $queryID, 'id_desc', '', $tmpStoryType, $storyIDList, $pager);
+ }
+ elseif($type != 'linkRelateSR' and $type != 'linkRelateUR')
+ {
+ $status = $storyType == 'story' ? 'active' : 'all';
+ $stories2Link = $this->getProductStories($story->product, $story->branch, 0, $status, $tmpStoryType, $orderBy = 'id_desc', true, $storyIDList, $pager);
+ }
+
+ if($type != 'linkRelateSR' and $type != 'linkRelateUR')
+ {
+ foreach($stories2Link as $id => $story)
+ {
+ if($storyType == 'story' and $story->status == 'draft') unset($stories2Link[$id]);
+ }
}
return $stories2Link;
diff --git a/module/story/view/edit.html.php b/module/story/view/edit.html.php
index ced03a5862..c61dda7bed 100644
--- a/module/story/view/edit.html.php
+++ b/module/story/view/edit.html.php
@@ -13,6 +13,7 @@
product);?>
+id);?>
children));?>
story->moveChildrenTips);?>
app->rawModule);?>
@@ -249,11 +250,11 @@
duplicateStory == 0 ? '' : $story->duplicateStory, "class='form-control'");?>
- status == 'closed'):?>
- story->childStories;?>
+ story->linkStory;?>
- createLink('story', 'linkStory', "storyID=$story->id&type=childStories", '', true), $lang->story->linkStory, '', "data-toggle='modal' data-type='iframe' data-width='95%'");?>
+ type == 'story') echo html::a("#", $lang->story->linkStoriesAB, '', "class='text-primary' id='linkStoriesLink'");?>
+ type == 'requirement') echo html::a("#", $lang->story->linkRequirementsAB, '', "class='text-primary' id='linkStoriesLink'");?>
@@ -261,26 +262,22 @@
-
-
childStories)
+ $linkStoryField = $story->type == 'story' ? 'linkStories' : 'linkRequirements';
+ if(isset($story->linkStoryTitles))
{
- $childStories = explode(',', $story->childStories);
- foreach($childStories as $childStoryID)
+ foreach($story->linkStoryTitles as $linkStoryID => $linkStoryTitle)
{
- if(isset($story->extraStories[$childStoryID]))
- {
- echo "
- "; - echo ""; - echo ""; - echo '';
- }
+ echo "
- "; + echo ""; + echo ""; + echo '';
}
}
?>
-
+
+
+type);?>
+
+
diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php
index 90f2d6ed35..07bde22cad 100644
--- a/module/story/view/view.html.php
+++ b/module/story/view/view.html.php
@@ -516,6 +516,27 @@
+
+
+
+
+
+
+'; + } + else + { + echo "
[S] #$linkStoryID $linkStoryTitle
";
+ }
+ }
+ }
+ ?>
+