From 8d1cd7be07a7b213a4292dc5bc56ac500f6b81c0 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Wed, 20 Dec 2023 10:56:19 +0800 Subject: [PATCH] * Fix bug #42005 for task repeat. --- module/repo/control.php | 2 +- module/repo/zen.php | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/module/repo/control.php b/module/repo/control.php index e92dd2e367..82423fb72e 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -1091,7 +1091,7 @@ class repo extends control $this->view->modules = $modules; $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->allTasks = $this->repoZen->getLinkTasks($repoID, $revision, $browseType, $product, $orderBy, $pager, $queryID, $productExecutionIDs); + $this->view->allTasks = $this->repoZen->getLinkTasks($repoID, $revision, $browseType, $orderBy, $pager, $queryID, $productExecutionIDs); $this->view->product = $product; $this->view->repoID = $repoID; $this->view->revision = $revision; diff --git a/module/repo/zen.php b/module/repo/zen.php index f5302a335f..864d231220 100644 --- a/module/repo/zen.php +++ b/module/repo/zen.php @@ -1133,7 +1133,6 @@ class repoZen extends repo * @param int $repoID * @param string $revision * @param string $browseType - * @param object $product * @param string $orderBy * @param object $pager * @param int $queryID @@ -1141,13 +1140,20 @@ class repoZen extends repo * @access protected * @return array */ - protected function getLinkTasks(int $repoID, string $revision, string $browseType, object $product, string $orderBy, object $pager, int $queryID, array $productExecutionIDs): array + protected function getLinkTasks(int $repoID, string $revision, string $browseType, string $orderBy, object $pager, int $queryID, array $productExecutionIDs): array { $allTasks = array(); - foreach($productExecutionIDs as $productExecutionID) + if($browseType == 'bysearch') { - $tasks = $this->loadModel('execution')->getTasks(0, $productExecutionID, array(), $browseType, $queryID, 0, $orderBy, null); - $allTasks = array_merge($tasks, $allTasks); + $allTasks = $this->loadModel('execution')->getTasks(0, 0, array(), $browseType, $queryID, 0, $orderBy, null); + } + else + { + foreach($productExecutionIDs as $productExecutionID) + { + $tasks = $this->loadModel('execution')->getTasks(0, $productExecutionID, array(), $browseType, $queryID, 0, $orderBy, null); + $allTasks = array_merge($tasks, $allTasks); + } } /* Filter linked tasks. */