* Finish task #96496.

This commit is contained in:
sunguangming
2023-07-05 10:30:33 +08:00
parent 3917a42d49
commit 91cd3751b8
10 changed files with 144 additions and 1 deletions
+2
View File
@@ -536,6 +536,7 @@ $lang->resource->story->batchToTask = 'batchToTask';
$lang->resource->story->processStoryChange = 'processStoryChange';
$lang->resource->story->linkStories = 'linkStoriesAB';
$lang->resource->story->relieved = 'relievedTwins';
$lang->resource->story->relation = 'relation';
$lang->story->methodOrder[5] = 'create';
$lang->story->methodOrder[10] = 'batchCreate';
@@ -566,6 +567,7 @@ $lang->story->methodOrder[125] = 'batchToTask';
$lang->story->methodOrder[130] = 'processStoryChange';
$lang->story->methodOrder[135] = 'linkStories';
$lang->story->methodOrder[140] = 'relieved';
$lang->story->methodOrder[145] = 'relation';
/* Requirement. */
$lang->resource->requirement = new stdclass();
+8 -1
View File
@@ -136,9 +136,16 @@ $config->story->dtable->fieldList['caseCount']['group'] = 7;
$config->story->dtable->fieldList['URS']['name'] = 'URS';
$config->story->dtable->fieldList['URS']['title'] = 'UR';
$config->story->dtable->fieldList['URS']['width'] = '30';
$config->story->dtable->fieldList['URS']['width'] = '50';
$config->story->dtable->fieldList['URS']['type'] = 'html';
$config->story->dtable->fieldList['URS']['group'] = 6;
$config->story->dtable->fieldList['SRS']['name'] = 'SRS';
$config->story->dtable->fieldList['SRS']['title'] = 'SR';
$config->story->dtable->fieldList['SRS']['width'] = '50';
$config->story->dtable->fieldList['SRS']['type'] = 'html';
$config->story->dtable->fieldList['SRS']['group'] = 6;
$config->story->dtable->fieldList['closedBy']['name'] = 'closedBy';
$config->story->dtable->fieldList['closedBy']['title'] = $lang->story->closedBy;
$config->story->dtable->fieldList['closedBy']['type'] = 'user';
+19
View File
@@ -1649,6 +1649,25 @@ class story extends control
$this->display();
}
/**
* URS of a story.
*
* @param int $storyID
* @param string $storyType
* @access public
* @return void
*/
public function relation($storyID, $storyType = '')
{
$selectFields = array('id', 'pri', 'title', 'plan', 'openedBy', 'assignedTo', 'estimate', 'status');
$this->view->relation = $this->story->getStoryRelation($storyID, $storyType, $selectFields);
$this->view->users = $this->user->getPairs('noletter');
$this->view->storyType = $storyType;
$this->view->story = $this->story->getById($storyID);
$this->display();
}
/**
* If type is linkStories, link related stories else link child stories.
*
+1
View File
@@ -0,0 +1 @@
.table {border: 1px solid #ddd;}
+1
View File
@@ -27,6 +27,7 @@ $lang->story->submitReview = "Submit Review";
$lang->story->recall = 'Revoke';
$lang->story->recallChange = 'Undo Changes';
$lang->story->recallAction = 'Undo';
$lang->story->relation = 'Relations';
$lang->story->needReview = 'Need Review';
$lang->story->batchReview = 'Mehere prüfen';
$lang->story->edit = "Bearbeiten";
+1
View File
@@ -27,6 +27,7 @@ $lang->story->submitReview = "Submit Review";
$lang->story->recall = 'Revoke';
$lang->story->recallChange = 'Undo Changes';
$lang->story->recallAction = 'Undo';
$lang->story->relation = 'Relations';
$lang->story->needReview = 'Need Review';
$lang->story->batchReview = 'Batch Review';
$lang->story->edit = "Edit Story";
+1
View File
@@ -27,6 +27,7 @@ $lang->story->submitReview = "Submit Review";
$lang->story->recall = 'Revoke';
$lang->story->recallChange = 'Undo Changes';
$lang->story->recallAction = 'Undo';
$lang->story->relation = 'Relations';
$lang->story->needReview = 'Validation requise';
$lang->story->batchReview = 'Validation par lot';
$lang->story->edit = "Editer Story";
+1
View File
@@ -27,6 +27,7 @@ $lang->story->submitReview = "提交评审";
$lang->story->recall = '撤销评审';
$lang->story->recallChange = '撤销变更';
$lang->story->recallAction = '撤销';
$lang->story->relation = '查看关联需求';
$lang->story->needReview = '需要评审';
$lang->story->batchReview = '批量评审';
$lang->story->edit = "编辑";
+18
View File
@@ -360,6 +360,17 @@ class storyTao extends storyModel
$parents = $this->dao->select('id,title')->from(TABLE_STORY)->where('id')->in($parents)->andWhere('deleted')->eq(0)->fetchAll('id');
}
$mainID = $type == 'story' ? 'BID' : 'AID';
$countID = $type == 'story' ? 'AID' : 'BID';
$relations = $this->dao->select("$mainID, count($countID) as count")->from(TABLE_RELATION)
->where('AType')->eq('requirement')
->andWhere('BType')->eq('story')
->andWhere('relation')->eq('subdivideinto')
->andWhere('product')->eq($productID)
->groupBy($mainID)
->fetchAll($mainID);
foreach($stories as $story)
{
/* Export story linkstories. */
@@ -372,6 +383,13 @@ class storyTao extends storyModel
$story->planTitle = '';
$storyPlans = explode(',', trim($story->plan, ','));
foreach($storyPlans as $planID) $story->planTitle .= zget($plans, $planID, '') . ' ';
if(isset($relations[$story->id]))
{
$link = helper::createLink('story', 'relation', "storyID=$story->id&storyType=$type");
if($type == 'story') $story->URS = html::a($link, $relations[$story->id]->count, '', "data-toggle='modal'");
if($type == 'requirement') $story->SRS = html::a($link, $relations[$story->id]->count, '', "data-toggle='modal'");
}
}
/* For save session query. */
+92
View File
@@ -0,0 +1,92 @@
<?php
declare(strict_types=1);
/**
* The change view file of story module of ZenTaoPMS.
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
* @author Sun Guangming<sunguangming@easycorp.ltd>
* @package story
* @link https://www.zentao.net
*/
namespace zin;
modalHeader();
$tbody = array();
foreach($relation as $key => $story)
{
$tbody[] = h::tr
(
h::td
(
$story->id
),
h::td
(
$story->title
),
h::td
(
$story->pri
),
h::td
(
zget($users, $story->openedBy)
),
h::td
(
zget($users, $story->assignedTo)
),
h::td
(
$story->estimate
),
h::td
(
zget($lang->story->statusList, $story->status)
)
);
}
h::table
(
setClass('table table-fixed'),
h::tr
(
h::th
(
set::width('60px'),
$lang->story->id
),
h::th
(
$lang->story->title
),
h::th
(
set::width('60px'),
$lang->story->pri
),
h::th
(
set::width('100px'),
$lang->story->openedBy
),
h::th
(
set::width('100px'),
$lang->story->assignedTo
),
h::th
(
set::width('80px'),
$lang->story->estimate
),
h::th
(
set::width('80px'),
$lang->story->status
),
),
$tbody
);