* Finish task #59451.

This commit is contained in:
liyuchun
2022-07-05 08:42:48 +00:00
parent 0044a55b76
commit 8a3d924e2b
11 changed files with 74 additions and 14 deletions
+1
View File
@@ -80,6 +80,7 @@ $lang->misc = new stdclass();
$lang->acl = new stdclass();
$lang->curd = new stdclass();
$lang->sonarqube = new stdclass();
$lang->app = new stdclass();
$lang->projectbuild = new stdclass();
$lang->projectrelease = new stdclass();
+2 -1
View File
@@ -84,7 +84,6 @@ $lang->waterfallModel = 'Waterfall';
$lang->scrumModel = 'Scrum';
$lang->all = 'All';
$lang->viewDetails = 'View Details';
$lang->app = 'APP';
$lang->actions = 'Aktionen';
$lang->restore = 'Wiederherstellen';
@@ -197,6 +196,8 @@ $lang->execution->list = "{$lang->executionCommon} List";
$lang->kanban->common = 'Kanban';
$lang->backup->common = 'Backup';
$lang->action->trash = 'Recycle';
$lang->app->common = 'APP';
$lang->app->serverLink = 'Server Link';
$lang->personnel->common = 'Member';
$lang->personnel->invest = 'Investment';
+2 -1
View File
@@ -84,7 +84,6 @@ $lang->waterfallModel = 'Waterfall';
$lang->scrumModel = 'Scrum';
$lang->all = 'All';
$lang->viewDetails = 'View Details';
$lang->app = 'APP';
$lang->actions = 'Action';
$lang->restore = 'Reset';
@@ -197,6 +196,8 @@ $lang->execution->list = "{$lang->executionCommon} List";
$lang->kanban->common = 'Kanban';
$lang->backup->common = 'Backup';
$lang->action->trash = 'Recycle';
$lang->app->common = 'APP';
$lang->app->serverLink = 'Server Link';
$lang->personnel->common = 'Member';
$lang->personnel->invest = 'Investment';
+2 -1
View File
@@ -84,7 +84,6 @@ $lang->waterfallModel = 'Waterfall';
$lang->scrumModel = 'Scrum';
$lang->all = 'All';
$lang->viewDetails = 'View Details';
$lang->app = 'APP';
$lang->actions = 'Action';
$lang->restore = 'Réinitialiser';
@@ -197,6 +196,8 @@ $lang->execution->list = "{$lang->executionCommon} List";
$lang->kanban->common = 'Kanban';
$lang->backup->common = 'Backup';
$lang->action->trash = 'Recycle';
$lang->app->common = 'APP';
$lang->app->serverLink = 'Server Link';
$lang->personnel->common = 'Member';
$lang->personnel->invest = 'Investment';
+7 -6
View File
@@ -393,12 +393,12 @@ $lang->qa->menuOrder[45] = 'automation';
$lang->qa->dividerMenu = ',bug,testtask,caselib,';
/* DevOps menu. */
$lang->devops->menu = new stdclass();
$lang->devops->menu->code = array('link' => "{$lang->repo->common}|repo|browse|repoID=%s", 'alias' => 'diff,view,revision,log,blame,showsynccommit');
$lang->devops->menu->mr = array('link' => "{$lang->devops->mr}|mr|browse|repoID=%s");
$lang->devops->menu->compile = array('link' => "{$lang->devops->compile}|job|browse|repoID=%s", 'subModule' => 'compile,job');
$lang->devops->menu->app = array('link' => "{$lang->app}|devops|app|%s");
$lang->devops->menu->set = array('link' => "{$lang->devops->set}|repo|maintain", 'subModule' => 'gitlab,jenkins,sonarqube', 'alias' => 'setrules,create,edit');
$lang->devops->menu = new stdclass();
$lang->devops->menu->code = array('link' => "{$lang->repo->common}|repo|browse|repoID=%s", 'alias' => 'diff,view,revision,log,blame,showsynccommit');
$lang->devops->menu->mr = array('link' => "{$lang->devops->mr}|mr|browse|repoID=%s");
$lang->devops->menu->compile = array('link' => "{$lang->devops->compile}|job|browse|repoID=%s", 'subModule' => 'compile,job');
$lang->devops->menu->app = array('link' => "{$lang->app->common}|app|serverlink|%s");
$lang->devops->menu->set = array('link' => "{$lang->devops->set}|repo|maintain", 'subModule' => 'gitlab,jenkins,sonarqube', 'alias' => 'setrules,create,edit');
$lang->devops->menuOrder[5] = 'code';
$lang->devops->menuOrder[10] = 'mr';
@@ -650,6 +650,7 @@ $lang->navGroup->compile = 'devops';
$lang->navGroup->ci = 'devops';
$lang->navGroup->svn = 'devops';
$lang->navGroup->git = 'devops';
$lang->navGroup->app = 'devops';
$lang->navGroup->company = 'system';
+4 -3
View File
@@ -65,7 +65,6 @@ $lang->noData = 'Không có dữ liệu.';
$lang->fullscreen = 'Fullscreen';
$lang->retrack = 'Retrack';
$lang->whitelist = 'Lista bianca';
$lang->app = 'APP';
$lang->actions = 'Hành động';
$lang->restore = 'Thiết lập lại';
@@ -125,8 +124,10 @@ $lang->typeAB = 'Loại';
$lang->nameAB = 'Name';
$lang->common = new stdclass();
$lang->common->common = 'Module chung';
$lang->devops->common = 'DevOps';
$lang->common->common = 'Module chung';
$lang->devops->common = 'DevOps';
$lang->app->common = 'APP';
$lang->app->serverLink = 'Server Link';
global $config;
list($programModule, $programMethod) = explode('-', $config->programLink);
+2 -1
View File
@@ -84,7 +84,6 @@ $lang->waterfallModel = '瀑布模型';
$lang->scrumModel = '敏捷模型';
$lang->all = '所有';
$lang->viewDetails = '查看详情';
$lang->app = '应用';
$lang->actions = '操作';
$lang->restore = '恢复默认';
@@ -197,6 +196,8 @@ $lang->execution->list = "{$lang->executionCommon}列表";
$lang->kanban->common = '看板';
$lang->backup->common = '备份';
$lang->action->trash = '回收站';
$lang->app->common = '应用';
$lang->app->serverLink = '服务器链接';
$lang->personnel->common = '人员';
$lang->personnel->invest = '投入人员';
+2 -1
View File
@@ -78,7 +78,6 @@ $lang->globalSetting = '全局設置';
$lang->waterfallModel = '瀑布模型';
$lang->all = '所有';
$lang->viewDetails = '查看詳情';
$lang->app = '應用';
$lang->actions = '操作';
$lang->restore = '恢復預設';
@@ -182,6 +181,8 @@ $lang->stage->common = '階段';
$lang->stage->list = '階段列表';
$lang->execution->list = "{$lang->executionCommon}列表";
$lang->kanban->common = '看板';
$lang->app->common = '應用';
$lang->app->serverLink = '服務器鏈接';
$lang->personnel->common = '人員';
$lang->personnel->invest = '投入人員';
+43
View File
@@ -1104,6 +1104,10 @@ class commonModel extends model
$executionID = $menuItem->link['vars'];
commonModel::buildMoreButton($executionID);
}
elseif($menuItem->link['module'] == 'app' and $menuItem->link['method'] == 'serverlink')
{
commonModel::buildAppButton();
}
else
{
if($menuItem->link)
@@ -1746,6 +1750,45 @@ EOD;
echo $html;
}
/**
* Build devops app button.
*
* @static
* @access public
* @return void
*/
public static function buildAppButton()
{
if(defined('TUTORIAL')) return;
global $app, $config, $lang;
$pipelinePairs = array();
$condition = '';
if(!$app->user->admin)
{
$types = '';
foreach($config->pipelineTypeList as $pipelineType)
{
if(commonModel::hasPriv($pipelineType, 'browse')) $types .= "'$pipelineType',";
}
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;
$html = "<li class='dropdown dropdown-hover'><a href='javascript:;' data-toggle='dropdown'>{$lang->app->common}<span class='caret'></span></a>";
$html .= "<ul class='dropdown-menu'>";
foreach($pipelineList as $pipeline)
{
$html .= "<li style='max-width: 300px;'>" . html::a($pipeline->url, "[{$pipeline->type}] {$pipeline->name}", '', "title='{$pipeline->name}' class='text-ellipsis' style='padding: 2px 10px' target='_blank'") . '</li>';
}
$html .= "</ul></li>\n";
echo $html;
}
/**
* Print link icon.
*
+7
View File
@@ -68,6 +68,7 @@ $lang->moduleOrder[210] = 'dev';
$lang->moduleOrder[215] = 'message';
$lang->moduleOrder[220] = 'gitlab';
$lang->moduleOrder[225] = 'mr';
$lang->moduleOrder[230] = 'app';
$lang->resource = new stdclass();
@@ -1437,6 +1438,12 @@ $lang->mr->methodOrder[85] = 'close';
$lang->mr->methodOrder[90] = 'reopen';
$lang->mr->methodOrder[95] = 'addReview';
/* App. */
$lang->resource->app = new stdclass();
$lang->resource->app->serverlink = 'serverLink';
$lang->app->methodOrder[10] = 'link';
/* Git. */
$lang->resource->git = new stdclass();
$lang->resource->git->diff = 'diff';