From 576e3aa4df6d410dbeec0a122deb69345e239aa3 Mon Sep 17 00:00:00 2001 From: wangxuepeng Date: Wed, 10 Jan 2024 16:13:10 +0800 Subject: [PATCH] * Fix bug #43339. --- module/execution/model.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/module/execution/model.php b/module/execution/model.php index 945c6a0340..e63907f7f1 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -3816,7 +3816,12 @@ class executionModel extends model */ public static function isClickable(object $execution, string $action): bool { - if($action == 'createChildStage') return commonModel::hasPriv('programplan', 'create'); + if($action == 'createChildStage') + { + global $dao; + $tasks = $dao->select('id')->from(TABLE_TASK)->where('execution')->eq($execution->rawID)->andWhere('deleted')->eq(0)->fetchPairs(); + return commonModel::hasPriv('programplan', 'create') && empty($tasks); + } if($action == 'createTask') return commonModel::hasPriv('task', 'create') && commonModel::hasPriv('execution', 'create') && empty($execution->isParent); if(!commonModel::hasPriv('execution', $action)) return false;