diff --git a/module/common/model.php b/module/common/model.php index e7651a66ea..91904e7fae 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1191,11 +1191,11 @@ class commonModel extends model if($menuItem->link['module'] == 'execution' and $menuItem->link['method'] == 'more') { $executionID = $menuItem->link['vars']; - commonModel::buildMoreButton((int)$executionID, $printHtml); + $menuHtml .= commonModel::buildMoreButton((int)$executionID, false); } elseif($menuItem->link['module'] == 'app' and $menuItem->link['method'] == 'serverlink') { - commonModel::buildAppButton($printHtml); + $menuHtml .= commonModel::buildAppButton(false); } else { @@ -1811,14 +1811,14 @@ EOF; * @access public * @return bool */ - public static function buildMoreButton(int $executionID, bool $printHtml = true): bool + public static function buildMoreButton(int $executionID, bool $printHtml = true): string { global $lang, $app; - if(commonModel::isTutorialMode()) return false; + if(commonModel::isTutorialMode()) return ''; $object = $app->dbh->query('SELECT project,`type` FROM ' . TABLE_EXECUTION . " WHERE `id` = '$executionID'")->fetch(); - if(empty($object)) return false; + if(empty($object)) return ''; $executionPairs = array(); $userCondition = !$app->user->admin ? " AND `id` " . helper::dbIN($app->user->view->sprints) : ''; @@ -1836,7 +1836,7 @@ EOF; $executionPairs[$execution->id] = $execution->name; } - if(empty($executionPairs)) return false; + if(empty($executionPairs)) return ''; $html = "
  • \n"; if($printHtml) echo $html; - return true; + return $html; } /** @@ -1866,11 +1866,11 @@ EOF; * @access public * @return bool */ - public static function buildAppButton(bool $printHtml = true): bool + public static function buildAppButton(bool $printHtml = true): string { global $app, $config, $lang; - if(commonModel::isTutorialMode()) return false; + if(commonModel::isTutorialMode()) return ''; $condition = ''; if(!$app->user->admin) @@ -1880,11 +1880,11 @@ EOF; { if(commonModel::hasPriv($pipelineType, 'browse')) $types .= "'$pipelineType',"; } - if(empty($types)) return false; + if(empty($types)) return ''; $condition .= ' AND `type` in (' . trim($types, ',') . ')'; } $pipelineList = $app->dbh->query("SELECT `type`,name,url FROM " . TABLE_PIPELINE . " WHERE `deleted` = '0' $condition order by type")->fetchAll(); - if(empty($pipelineList)) return false; + if(empty($pipelineList)) return ''; $appCommon = isset($lang->db->custom['devopsMenu']['menu']['app']) ? $lang->db->custom['devopsMenu']['menu']['app'] : $lang->app->common; $html = "\n"; if($printHtml) echo $html; - return true; + return $html; } /**