* Finish task#1004678

This commit is contained in:
zenggang
2023-08-17 02:19:02 +00:00
parent 6726d09353
commit c4f9bb3413
4 changed files with 90 additions and 1 deletions
+2 -1
View File
@@ -273,7 +273,8 @@ if($config->vision == 'lite')
if($config->inQuickon)
{
$lang->admin->menuList->platform['subMenu']['dashboard'] = array('link' => "{$lang->dashboard}|system|dashboard|");
$dashboard = is_object($lang->dashboard) ? $lang->dashboard->common : $lang->dashboard;
$lang->admin->menuList->platform['subMenu']['dashboard'] = array('link' => "{$dashboard}|system|dashboard|");
$lang->admin->menuList->platform['menuOrder']['5'] = 'dashboard';
$lang->admin->menuList->system['subMenu']['backup'] = array('link' => "{$lang->backup->common}|system|browsebackup|", 'alias' => 'restorebackup');
+28
View File
@@ -1,6 +1,7 @@
<?php
global $lang, $app;
$app->loadLang('sonarqube');
$app->loadLang('bug');
$config->repo->dtable = new stdclass();
@@ -219,3 +220,30 @@ $config->repo->taskDtable->fieldList['status']['statusMap'] = $lang->task->statu
$config->repo->taskDtable->fieldList['status']['sortType'] = true;
$config->repo->taskDtable->fieldList['status']['show'] = true;
$config->repo->taskDtable->fieldList['status']['group'] = 1;
$config->repo->reviewDtable = new stdclass();
$config->repo->reviewDtable->fieldList['id']['title'] = $lang->idAB;
$config->repo->reviewDtable->fieldList['id']['type'] = 'id';
$config->repo->reviewDtable->fieldList['title']['type'] = 'title';
$config->repo->reviewDtable->fieldList['title']['link'] = array('module' => 'bug', 'method' => 'view', 'params' => 'bugID={id}&from=repo');
$config->repo->reviewDtable->fieldList['fileLocation']['title'] = $lang->repo->file . '/' . $lang->repo->location;
$config->repo->reviewDtable->fieldList['fileLocation']['name'] = 'entry';
$config->repo->reviewDtable->fieldList['fileLocation']['width'] = '300';
$config->repo->reviewDtable->fieldList['revisionA']['name'] = 'revisionA';
$config->repo->reviewDtable->fieldList['revisionA']['width'] = '100';
$config->repo->reviewDtable->fieldList['type']['title'] = $lang->repo->type;
$config->repo->reviewDtable->fieldList['type']['name'] = 'repoType';
$config->repo->reviewDtable->fieldList['type']['map'] = $lang->repo->typeList;
$config->repo->reviewDtable->fieldList['status']['map'] = $lang->bug->statusList;
$config->repo->reviewDtable->fieldList['openedBy']['type'] = 'user';
$config->repo->reviewDtable->fieldList['assignedTo']['type'] = 'user';
$config->repo->reviewDtable->fieldList['openedDate']['type'] = 'datetime';
+10
View File
@@ -0,0 +1,10 @@
window.renderRepobugList = function (result, {col, row, value})
{
if(col.name == 'entry')
{
result[0] = {html: '<span class="label primary mr-1">' + row.data.lines + '</span><a href="' + row.data.link + '" data-toggle="modal">' + row.data.entry + '</a>'};
return result;
}
return result;
}
+50
View File
@@ -0,0 +1,50 @@
<?php
declare(strict_types=1);
/**
* The link view file of mr module of ZenTaoPMS.
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
* @author Zeng Gang<zenggang@easycorp.ltd>
* @package mr
* @link https://www.zentao.net
*/
namespace zin;
foreach($bugs as $bug)
{
$bug->revisionA = $repo->SCM != 'Subversion' ? substr(strtr($bug->v2, '*', '-'), 0, 10) : $bug->v2;
$lines = explode(',', trim($bug->lines, ','));
$bug->entry = $repo->name . '/' . $this->repo->decodePath($bug->entry);
if(empty($bug->v1))
{
$revision = $repo->SCM != 'Subversion' ? $this->repo->getGitRevisionName($bug->v2, zget($historys, $bug->v2)) : $bug->v2;
$bug->link = $this->repo->createLink('view', "repoID=$repoID&objectID=0&entry={$bug->entry}&revision={$bug->v2}") . "#L$lines[0]";
}
else
{
$revision = $repo->SCM != 'Subversion' ? substr($bug->v1, 0, 10) : $bug->v1;
$revision .= ' : ';
$revision .= $repo->SCM != 'Subversion' ? substr($bug->v2, 0, 10) : $bug->v2;
if($repo->SCM != 'Subversion') $revision .= ' (' . zget($historys, $bug->v1) . ' : ' . zget($historys, $bug->v2) . ')';
$bug->link = $this->repo->createLink('diff', "repoID=$repoID&objectID=0&entry={$bug->entry}&oldRevision={$bug->v1}&newRevision={$bug->v2}") . "#L$lines[0]";
}
}
$bugs = initTableData($bugs, $config->repo->reviewDtable->fieldList);
featureBar
(
set::linkParams("repoID=$repoID&browseType={key}"),
);
dtable
(
set::userMap($users),
set::cols($config->repo->reviewDtable->fieldList),
set::data($bugs),
set::onRenderCell(jsRaw('window.renderRepobugList')),
set::footPager(usePager()),
);
render();