From f9295faec3806322435608440c076d7f1f2b3c15 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Sat, 2 Apr 2022 15:39:03 +0800 Subject: [PATCH 1/2] * Fix bug#19711. --- module/common/model.php | 4 +++- module/execution/view/story.html.php | 12 ++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/module/common/model.php b/module/common/model.php index ae8e9c57c7..7a83472777 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -2404,12 +2404,14 @@ EOD; /* Limited execution. */ $limitedExecution = false; if(!empty($module) && $module == 'task' && !empty($object->execution) or - !empty($module) && $module == 'execution' && !empty($object->id) + !empty($module) && $module == 'execution' && !empty($object->id) or + !empty($module) && $module == 'story' && !empty($object->execution) ) { $objectID = ''; if($module == 'execution' and !empty($object->id)) $objectID = $object->id; if($module == 'task' and !empty($object->execution))$objectID = $object->execution; + if($module == 'story' and !empty($object->execution))$objectID = $object->execution; $limitedExecutions = !empty($_SESSION['limitedExecutions']) ? $_SESSION['limitedExecutions'] : ''; if($objectID and strpos(",{$limitedExecutions},", ",$objectID,") !== false) $limitedExecution = true; diff --git a/module/execution/view/story.html.php b/module/execution/view/story.html.php index 4da719b838..ee36ac2f3c 100644 --- a/module/execution/view/story.html.php +++ b/module/execution/view/story.html.php @@ -179,12 +179,15 @@ execution = $execution->id; + $totalEstimate = 0; $canBatchEdit = common::hasPriv('story', 'batchEdit'); $canBatchClose = common::hasPriv('story', 'batchClose'); $canBatchChangeStage = common::hasPriv('story', 'batchChangeStage'); $canBatchUnlink = common::hasPriv('execution', 'batchUnlinkStory'); - $canBatchToTask = common::hasPriv('story', 'batchToTask'); + $canBatchToTask = common::hasPriv('story', 'batchToTask', $checkObject); $canBatchAction = ($canBeChanged and ($canBatchEdit or $canBatchClose or $canBatchChangeStage or $canBatchUnlink or $canBatchToTask)); ?> id}&orderBy=%s&type=$type¶m=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?> @@ -335,13 +338,14 @@ $actionLink = $this->createLink('story', 'batchEdit', "productID=0&executionID=$execution->id"); echo html::commonButton($lang->edit, "data-form-action='$actionLink' $disabled"); ?> - + + + Date: Sat, 2 Apr 2022 15:44:34 +0800 Subject: [PATCH 2/2] * Fix bug#19711. --- module/common/model.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/module/common/model.php b/module/common/model.php index 7a83472777..801cee3069 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -2403,15 +2403,13 @@ EOD; /* Limited execution. */ $limitedExecution = false; - if(!empty($module) && $module == 'task' && !empty($object->execution) or - !empty($module) && $module == 'execution' && !empty($object->id) or - !empty($module) && $module == 'story' && !empty($object->execution) + if(!empty($module) && in_array($module, array('task', 'story')) && !empty($object->execution) or + !empty($module) && $module == 'execution' && !empty($object->id) ) { $objectID = ''; - if($module == 'execution' and !empty($object->id)) $objectID = $object->id; - if($module == 'task' and !empty($object->execution))$objectID = $object->execution; - if($module == 'story' and !empty($object->execution))$objectID = $object->execution; + if($module == 'execution' and !empty($object->id)) $objectID = $object->id; + if(in_array($module, array('task', 'story')) and !empty($object->execution)) $objectID = $object->execution; $limitedExecutions = !empty($_SESSION['limitedExecutions']) ? $_SESSION['limitedExecutions'] : ''; if($objectID and strpos(",{$limitedExecutions},", ",$objectID,") !== false) $limitedExecution = true;