From db22aaaa3d51c12f87a45dec1e29d53c267a0eec Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 13 Jun 2024 09:07:54 +0800 Subject: [PATCH] * [bug#49218,done,0.1h] check batch action privilege. --- module/task/control.php | 1 + module/task/ui/export.html.php | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/module/task/control.php b/module/task/control.php index c002bf6a7a..86fa61aed1 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -1135,6 +1135,7 @@ class task extends control $this->view->orderBy = $orderBy; $this->view->type = $type; $this->view->executionID = $executionID; + $this->view->execution = $execution; $this->display(); } diff --git a/module/task/ui/export.html.php b/module/task/ui/export.html.php index 08f71ca82f..fa51f8023f 100644 --- a/module/task/ui/export.html.php +++ b/module/task/ui/export.html.php @@ -8,4 +8,12 @@ declare(strict_types=1); * @package task * @link https://www.zentao.net */ +namespace zin; include '../../file/ui/export.html.php'; + +$canBatchEdit = common::hasPriv('task', 'batchEdit', !empty($execution) ? $execution : null); +$canBatchClose = common::hasPriv('task', 'batchClose', !empty($execution) ? $execution : null) && strtolower($type) != 'closed'; +$canBatchCancel = common::hasPriv('task', 'batchCancel', !empty($execution) ? $execution : null) && strtolower($type) != 'cancel'; +$canBatchAssignTo = common::hasPriv('task', 'batchAssignTo', !empty($execution) ? $execution : null); +$canBatchChangeModule = common::hasPriv('task', 'batchChangeModule', !empty($execution) ? $execution : null); +$canBatchAction = in_array(true, array($canBatchEdit, $canBatchClose, $canBatchCancel, $canBatchChangeModule, $canBatchAssignTo));