From cebd16d8ea4fdcf810f8ca86c4105f2444b5e6f5 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 25 Aug 2022 13:35:56 +0800 Subject: [PATCH] * Fix bug#26859. --- module/story/model.php | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/module/story/model.php b/module/story/model.php index 2ffa1e3596..71c9352f68 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -4214,7 +4214,7 @@ class storyModel extends model if(strpos('draft,changing', $story->status) !== false) { - $menu .= $this->buildMenu('story', 'submitReview', "storyID=$story->id&storyType=$story->type", $story, $type, 'sub-review', '', 'iframe', true, "data-width='50%'"); + $menu .= $this->buildMenu('story', 'submitReview', "storyID=$story->id&storyType=$story->type", $story, $type, 'confirm', '', 'iframe', true, "data-width='50%'"); } else { @@ -4291,7 +4291,7 @@ class storyModel extends model if($type == 'view') { $menu .= $this->buildMenu('story', 'change', $params . "&from=&storyType=$story->type", $story, $type, 'alter', '', 'showinonlybody'); - if(strpos('draft,changing', $story->status) !== false) $menu .= $this->buildMenu('story', 'submitReview', $params . "&storyType=$story->type", $story, $type, 'sub-review', '', 'showinonlybody iframe', true, "data-width='50%'"); + if(strpos('draft,changing', $story->status) !== false) $menu .= $this->buildMenu('story', 'submitReview', $params . "&storyType=$story->type", $story, $type, 'confirm', '', 'showinonlybody iframe', true, "data-width='50%'"); $title = $story->status == 'changing' ? $this->lang->story->recallChange : $this->lang->story->recall; $menu .= $this->buildMenu('story', 'recall', $params . "&from=view&confirm=no&storyType=$story->type", $story, $type, 'undo', 'hiddenwin', 'showinonlybody', false, '', $title); @@ -4355,17 +4355,25 @@ class storyModel extends model $story->reviewer = isset($story->reviewer) ? $story->reviewer : array(); $story->notReview = isset($story->notReview) ? $story->notReview : array(); - if(common::hasPriv('story', 'review')) + if(strpos('draft,changing', $story->status) !== false) { - $reviewDisabled = in_array($this->app->user->account, $story->notReview) and ($story->status == 'draft' or $story->status == 'changing') ? '' : 'disabled'; - $story->from = 'execution'; - $menu .= common::printIcon('story', 'review', "story={$story->id}&from=story", $story, 'list', 'search', '', $reviewDisabled, false, "data-group=execution"); + if(common::hasPriv('story', 'submitReview')) $menu .= common::printIcon('story', 'submitReview', "storyID=$story->id&from=story", $story, 'list', 'confirm', '', 'iframe', true, "data-width='50%'"); + } + else + { + if(common::hasPriv('story', 'review')) + { + $reviewDisabled = in_array($this->app->user->account, $story->notReview) and ($story->status == 'draft' or $story->status == 'changing') ? '' : 'disabled'; + $story->from = 'execution'; + $menu .= common::printIcon('story', 'review', "story={$story->id}&from=story", $story, 'list', 'search', '', $reviewDisabled, false, "data-group=execution"); + } } if(common::hasPriv('story', 'recall')) { $recallDisabled = empty($story->reviewedBy) and strpos('draft,changing', $story->status) !== false and !empty($story->reviewer) ? '' : 'disabled'; - $menu .= common::printIcon('story', 'recall', "story={$story->id}", $story, 'list', 'undo', 'hiddenwin', $recallDisabled, '', '', $this->lang->story->recall); + $title = $story->status == 'changing' ? $this->lang->story->recallChange : $this->lang->story->recall; + $menu .= common::printIcon('story', 'recall', "story={$story->id}", $story, 'list', 'undo', 'hiddenwin', $recallDisabled, '', '', $title); } $this->lang->task->create = $this->lang->execution->wbs;