* Fix bug#41733.

This commit is contained in:
xieqiyu
2024-01-04 20:21:57 +08:00
parent 9982426a88
commit 32f10235c0
3 changed files with 25 additions and 6 deletions
+2 -2
View File
@@ -190,14 +190,14 @@ foreach($stories as $story)
{
$story->rawModule = $story->module;
$options['branches'] = zget($branchOptions, $story->product, array());
$data[] = $this->story->formatStoryForList($story, $options);
$data[] = $this->story->formatStoryForList($story, $options, $storyType);
if(!isset($story->children)) continue;
/* Children. */
foreach($story->children as $key => $child)
{
$child->rawModule = $child->module;
$data[] = $this->story->formatStoryForList($child, $options);
$data[] = $this->story->formatStoryForList($child, $options, $storyType);
}
}
+3 -2
View File
@@ -4373,12 +4373,13 @@ class storyModel extends model
*
* @param object $story
* @param array $options
* @param string $storyType sting|requirement
* @access public
* @return object
*/
public function formatStoryForList(object $story, array $options = array()): object
public function formatStoryForList(object $story, array $options = array(), string $storyType = 'story'): object
{
$story->actions = $this->buildActionButtonList($story, 'browse', zget($options, 'execution', null));
$story->actions = $this->buildActionButtonList($story, 'browse', zget($options, 'execution', null), $storyType);
$story->estimate = $story->estimate . $this->config->hourUnit;
$story->taskCount = zget(zget($options, 'storyTasks', array()), $story->id, 0);
+20 -2
View File
@@ -1578,6 +1578,15 @@ class storyTao extends storyModel
$tutorialMode = commonModel::isTutorialMode();
if($storyType == 'requirement')
{
$this->lang->story->changeTip = str_replace($this->lang->SRCommon, $this->lang->URCommon, $this->lang->story->changeTip);
$this->lang->story->reviewTip['active'] = str_replace($this->lang->SRCommon, $this->lang->URCommon, $this->lang->story->reviewTip['active']);
$this->lang->story->reviewTip['notReviewer'] = str_replace($this->lang->SRCommon, $this->lang->URCommon, $this->lang->story->reviewTip['notReviewer']);
$this->lang->story->recallTip['actived'] = str_replace($this->lang->SRCommon, $this->lang->URCommon, $this->lang->story->recallTip['actived']);
$this->lang->story->subDivideTip['notWait'] = str_replace($this->lang->SRCommon, $this->lang->URCommon, $this->lang->story->subDivideTip['notWait']);
}
static $taskGroups = array();
$actSubmitreview = array();
@@ -1620,9 +1629,18 @@ class storyTao extends storyModel
$title = $this->lang->story->review;
if(!$canReview && $story->status != 'closed')
{
if($story->status == 'active') $title = $this->lang->story->reviewTip['active'];
if($storyReviewer && in_array($this->app->user->account, $storyReviewer)) $title = $this->lang->story->reviewTip['reviewed'];
if($storyReviewer && !in_array($this->app->user->account, $storyReviewer)) $title = $this->lang->story->reviewTip['notReviewer'];
if($story->status == 'active')
{
if($storyReviewer && in_array($this->app->user->account, $storyReviewer))
{
$title = $this->lang->story->reviewTip['reviewed'];
}
else
{
$title = $this->lang->story->reviewTip['active'];
}
}
}
$actReview = array('name' => 'review', 'url' => $canReview ? $reviewLink : null, 'hint' => $title, 'disabled' => !$canReview);