From fc00015a6d51468bd1c822d3c091e560578efc36 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Mon, 18 Jul 2022 14:08:56 +0800 Subject: [PATCH 1/5] * Finish task #61174, #61175. --- module/build/model.php | 17 +++++++++++++++++ module/release/model.php | 17 +++++++++++++++++ module/story/control.php | 2 ++ module/story/css/view.css | 1 + module/story/css/view.de.css | 1 + module/story/css/view.en.css | 1 + module/story/css/view.fr.css | 1 + module/story/lang/de.php | 2 ++ module/story/lang/en.php | 2 ++ module/story/lang/fr.php | 2 ++ module/story/lang/zh-cn.php | 2 ++ module/story/view/view.html.php | 34 +++++++++++++++++++++++++++++++-- 12 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 module/story/css/view.de.css create mode 100644 module/story/css/view.fr.css diff --git a/module/build/model.php b/module/build/model.php index dab588ecb5..3a51289f0b 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -178,6 +178,23 @@ class buildModel extends model return $this->getExecutionBuilds($executionID, 'bysearch', $buildQuery); } + /** + * Get story builds. + * + * @param int $storyID + * @access public + * @return array + */ + public function getStoryBuilds($storyID) + { + return $this->dao->select('*')->from(TABLE_BUILD) + ->where('deleted')->eq(0) + ->andWhere('stories', true)->like("%,$storyID,%") + ->orWhere('stories')->like("%,$storyID")->markRight(1) + ->orderBy('id_desc') + ->fetchAll('id'); + } + /** * Get builds in pairs. * diff --git a/module/release/model.php b/module/release/model.php index 583f3c953d..5a5653aaee 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -103,6 +103,23 @@ class releaseModel extends model return array_keys($releases); } + /** + * Get story releases. + * + * @param int $storyID + * @access public + * @return array + */ + public function getStoryReleases($storyID) + { + return $this->dao->select('*')->from(TABLE_RELEASE) + ->where('deleted')->eq(0) + ->andWhere('stories', true)->like("%,$storyID,%") + ->orWhere('stories')->like("%,$storyID")->markRight(1) + ->orderBy('id_desc') + ->fetchAll('id'); + } + /** * Create a release. * diff --git a/module/story/control.php b/module/story/control.php index 1f55ce3d71..5725bf7703 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1282,6 +1282,8 @@ class story extends control $this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('story', $storyID); $this->view->from = $from; $this->view->param = $param; + $this->view->builds = $this->loadModel('build')->getStoryBuilds($storyID); + $this->view->releases = $this->loadModel('release')->getStoryReleases($storyID); $this->display(); } diff --git a/module/story/css/view.css b/module/story/css/view.css index 191a5b1f34..47978e40e2 100644 --- a/module/story/css/view.css +++ b/module/story/css/view.css @@ -3,3 +3,4 @@ #legendStories ul li {padding: 10px 0 0 12px; line-height: 20px;} .main-actions .btn-toolbar .btn {padding-right: 6px; padding-left: 6px;} .btn-edit-comment {z-index: 100;} +#legendRelated .table-data tbody>tr>th {width: 90px;} diff --git a/module/story/css/view.de.css b/module/story/css/view.de.css new file mode 100644 index 0000000000..921999def9 --- /dev/null +++ b/module/story/css/view.de.css @@ -0,0 +1 @@ +#legendRelated .table-data tbody>tr>th {width: 125px;} diff --git a/module/story/css/view.en.css b/module/story/css/view.en.css index 1c5a496e3c..4612db2f47 100644 --- a/module/story/css/view.en.css +++ b/module/story/css/view.en.css @@ -1,2 +1,3 @@ #legendLifeTime .thWidth {width: 100px !important;} #legendRelated .thWidth {width: 110px !important;} +#legendRelated .table-data tbody>tr>th {width: 105px;} diff --git a/module/story/css/view.fr.css b/module/story/css/view.fr.css new file mode 100644 index 0000000000..9d1a837d3b --- /dev/null +++ b/module/story/css/view.fr.css @@ -0,0 +1 @@ +#legendRelated .table-data tbody>tr>th {width: 95px;} diff --git a/module/story/lang/de.php b/module/story/lang/de.php index 78ed708a0f..b579fc27de 100644 --- a/module/story/lang/de.php +++ b/module/story/lang/de.php @@ -247,6 +247,8 @@ $lang->story->legendBugs = 'Verküpfte Bugs'; $lang->story->legendFromBug = 'Verküpfte Formular Bugs'; $lang->story->legendCases = 'Verküpfte Fälle'; $lang->story->legendLinkStories = 'Verküpfte Storys'; +$lang->story->legendBuilds = 'Verkü pfte Builds'; +$lang->story->legendReleases = 'Verkü pfte Releases'; $lang->story->legendChildStories = 'Story auteien'; $lang->story->legendSpec = 'Beschreibung'; $lang->story->legendVerify = 'Akzeptanz'; diff --git a/module/story/lang/en.php b/module/story/lang/en.php index 0261736f59..994cb0b7ec 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -247,6 +247,8 @@ $lang->story->legendBugs = 'Linked Bugs'; $lang->story->legendFromBug = 'From Bug'; $lang->story->legendCases = 'Linked Cases'; $lang->story->legendLinkStories = 'Linked Stories'; +$lang->story->legendBuilds = 'Linked Builds'; +$lang->story->legendReleases = 'Linked Releases'; $lang->story->legendChildStories = 'Child Stories'; $lang->story->legendSpec = 'Description'; $lang->story->legendVerify = 'Acceptance'; diff --git a/module/story/lang/fr.php b/module/story/lang/fr.php index 47ef083382..aa505299e5 100644 --- a/module/story/lang/fr.php +++ b/module/story/lang/fr.php @@ -246,6 +246,8 @@ $lang->story->legendProjectAndTask = $lang->executionCommon . ' et Tâches'; $lang->story->legendBugs = 'Bugs Liés'; $lang->story->legendFromBug = 'du Bug'; $lang->story->legendCases = 'CasTests Liés'; +$lang->story->legendBuilds = 'Builds Lié s'; +$lang->story->legendReleases = 'Releases Lié s'; $lang->story->legendLinkStories = 'Stories Liées'; $lang->story->legendChildStories = 'Sous-Stories'; $lang->story->legendSpec = 'Description'; diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index a55f5559d7..ea6b15b89b 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -246,6 +246,8 @@ $lang->story->legendProjectAndTask = $lang->executionCommon . '任务'; $lang->story->legendBugs = '相关Bug'; $lang->story->legendFromBug = '来源Bug'; $lang->story->legendCases = '相关用例'; +$lang->story->legendBuilds = '相关版本'; +$lang->story->legendReleases = '相关发布'; $lang->story->legendLinkStories = "相关{$lang->SRCommon}"; $lang->story->legendChildStories = "细分{$lang->SRCommon}"; $lang->story->legendSpec = "需求描述"; diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index 662f6a7f53..8beb4ef2d2 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -456,7 +456,7 @@ - story->legendFromBug;?> + story->legendFromBug;?>
' id='stories'> - +
id}, \"story\")", ' ' . $lang->release->linkStory, '', "class='btn btn-primary'");?>
@@ -146,7 +146,7 @@
' id='bugs'> - +
id}, \"bug\")", ' ' . $lang->release->linkBug, '', "class='btn btn-primary'");?>
@@ -236,7 +236,7 @@
' id='leftBugs'> - +
id}, \"leftBug\")", ' ' . $lang->release->linkBug, '', "class='btn btn-primary'");?>
diff --git a/module/release/view/view.html.php b/module/release/view/view.html.php index 2b753f8408..4d2c773382 100644 --- a/module/release/view/view.html.php +++ b/module/release/view/view.html.php @@ -50,7 +50,7 @@
' id='stories'> - +
id}, \"story\")", ' ' . $lang->release->linkStory, '', "class='btn btn-primary'");?>
@@ -148,7 +148,7 @@
' id='bugs'> - +
id}, \"bug\")", ' ' . $lang->release->linkBug, '', "class='btn btn-primary'");?>
@@ -238,7 +238,7 @@
' id='leftBugs'> - +
id}, \"leftBug\")", ' ' . $lang->release->linkBug, '', "class='btn btn-primary'");?>
From b58bc836166cd33fb0d3941ecadecd4e7c53e2f8 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 19 Jul 2022 15:32:13 +0800 Subject: [PATCH 5/5] * Optimize for task #61174, #61175. --- module/build/model.php | 3 +-- module/release/model.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/module/build/model.php b/module/build/model.php index 3a51289f0b..241e46c134 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -189,8 +189,7 @@ class buildModel extends model { return $this->dao->select('*')->from(TABLE_BUILD) ->where('deleted')->eq(0) - ->andWhere('stories', true)->like("%,$storyID,%") - ->orWhere('stories')->like("%,$storyID")->markRight(1) + ->andWhere("CONCAT(stories, ',')")->like("%,$storyID,%") ->orderBy('id_desc') ->fetchAll('id'); } diff --git a/module/release/model.php b/module/release/model.php index 5a5653aaee..3e3695d16f 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -114,8 +114,7 @@ class releaseModel extends model { return $this->dao->select('*')->from(TABLE_RELEASE) ->where('deleted')->eq(0) - ->andWhere('stories', true)->like("%,$storyID,%") - ->orWhere('stories')->like("%,$storyID")->markRight(1) + ->andWhere("CONCAT(stories, ',')")->like("%,$storyID,%") ->orderBy('id_desc') ->fetchAll('id'); }