From bacb8a5e1f97d6ef8201a4eb5afed9f29f66b9bf Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Wed, 19 May 2021 10:19:46 +0800 Subject: [PATCH] * Change the review button of story review. --- module/story/model.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module/story/model.php b/module/story/model.php index cd966a486b..8c89a4a13b 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -3210,8 +3210,11 @@ class storyModel extends model if($story->parent < 0 and $action != 'edit' and $action != 'batchcreate') return false; + global $config, $app, $dao; + $reviewers = $dao->select('reviewer')->from(TABLE_STORYREVIEW)->where('story')->eq($story->id)->andWhere('version')->eq($story->version)->andWhere('result')->ne('pass')->fetchAll('reviewer'); + if($action == 'change') return $story->status != 'closed'; - if($action == 'review') return $story->status == 'draft' or $story->status == 'changed'; + if($action == 'review') return in_array($app->user->account, array_keys($reviewers)) and ($story->status == 'draft' or $story->status == 'changed'); if($action == 'close') return $story->status != 'closed'; if($action == 'activate') return $story->status == 'closed'; if($action == 'assignto') return $story->status != 'closed';