From 0ea7ace95af174eedde5545197044c16a0443470 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 11 May 2023 20:06:11 +0800 Subject: [PATCH] * Reduce logical operators in judgments. --- module/task/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/task/model.php b/module/task/model.php index f568dced22..4888bf6b25 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -2998,7 +2998,7 @@ class taskModel extends model $canBatchChangeModule = common::hasPriv('task', 'batchChangeModule', !empty($task) ? $task : null); $canBatchAssignTo = common::hasPriv('task', 'batchAssignTo', !empty($task) ? $task : null); - $canBatchAction = ($canBatchEdit or $canBatchClose or $canBatchCancel or $canBatchChangeModule or $canBatchAssignTo); + $canBatchAction = in_array(true, array($canBatchEdit, $canBatchClose, $canBatchCancel, $canBatchChangeModule, $canBatchAssignTo)); $storyChanged = (!empty($task->storyStatus) and $task->storyStatus == 'active' and $task->latestStoryVersion > $task->storyVersion and !in_array($task->status, array('cancel', 'closed'))); $canView = common::hasPriv('task', 'view'); @@ -3459,7 +3459,7 @@ class taskModel extends model $menu .= $this->buildMenu('task', 'finish', $params, $task, 'browse', '', '', 'iframe', true); $menu .= $this->buildMenu('task', 'close', $params, $task, 'browse', '', '', 'iframe', true); - if(($canStart or $canRestart or $canFinish or $canClose) and ($canRecordEstimate or $canEdit or $canBatchCreate)) + if(in_array(true, array($canStart, $canRestart, $canFinish, $canClose)) and in_array(true, $canRecordEstimate, $canEdit, $canBatchCreate)) { $menu .= "
"; }