From 7d40bdf1d3b86b2641e764ebf55fca983aa58cfd Mon Sep 17 00:00:00 2001 From: liyuchun Date: Mon, 14 Mar 2022 15:53:33 +0800 Subject: [PATCH 1/3] * Finish task #50709. --- module/repo/control.php | 5 +++++ module/repo/lang/en.php | 1 + module/repo/lang/zh-cn.php | 1 + module/sonarqube/control.php | 4 ++-- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/module/repo/control.php b/module/repo/control.php index 7361fcf4b8..eea164d492 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -374,6 +374,11 @@ class repo extends control /* Get repo and synchronous commit. */ $repo = $this->repo->getRepoByID($repoID); + if($repo->SCM == 'Git' and !is_dir($repo->path)) + { + $error = sprintf($this->lang->repo->error->notFound, $repo->name, $repo->path); + return print(js::error($error) . js::locate($this->repo->createLink('maintain'))); + } if(!$repo->synced) $this->locate($this->repo->createLink('showSyncCommit', "repoID=$repoID")); /* Set branch for git. */ diff --git a/module/repo/lang/en.php b/module/repo/lang/en.php index 0d698011c0..8f0e1cb6bf 100644 --- a/module/repo/lang/en.php +++ b/module/repo/lang/en.php @@ -185,6 +185,7 @@ $lang->repo->error->encoding = "The encoding might be wrong. Please change $lang->repo->error->deleted = "Deletion of the repository failed. The current repository has a commit record associated with the design."; $lang->repo->error->linkedJob = "Deletion of the repository failed. The current repository has associated with the Compile."; $lang->repo->error->clientPath = "The client installation directory cannot have spaces!"; +$lang->repo->error->notFound = "The repository %s’s URL %s does not exist. Please confirm if this repository has been deleted from the local server."; $lang->repo->syncTips = 'You may find the reference about how to set Git sync from here.'; $lang->repo->encodingsTips = "The encodings of comments can be comma separated values, e.g. utf-8."; diff --git a/module/repo/lang/zh-cn.php b/module/repo/lang/zh-cn.php index c3690fd63a..4ee9a879af 100644 --- a/module/repo/lang/zh-cn.php +++ b/module/repo/lang/zh-cn.php @@ -185,6 +185,7 @@ $lang->repo->error->encoding = "编码可能错误,请更换编码重试 $lang->repo->error->deleted = "删除版本库失败,当前版本库有提交记录与设计关联"; $lang->repo->error->linkedJob = "删除版本库失败,当前版本库与构建有关联,请取消关联或删除构建。"; $lang->repo->error->clientPath = "客户端安装目录不能有空格!"; +$lang->repo->error->notFound = "版本库『%s』路径 %s 不存在,请确认此版本库是否已在本地服务器被删除"; $lang->repo->syncTips = '请参照这里,设置版本库定时同步。'; $lang->repo->encodingsTips = "提交日志的编码,可以用逗号连接起来的多个,比如utf-8。"; diff --git a/module/sonarqube/control.php b/module/sonarqube/control.php index 02f617ed4e..b40685e53c 100644 --- a/module/sonarqube/control.php +++ b/module/sonarqube/control.php @@ -359,11 +359,11 @@ class sonarqube extends control if($search == true) $keyword = $this->session->sonarqubeIssueKeyword; } + ini_set('memory_limit', '256M'); + $cacheFile = $this->sonarqube->getCacheFile($sonarqubeID, $projectKey); if(!$cacheFile or !file_exists($cacheFile) or (time() - filemtime($cacheFile)) / 60 > $this->config->sonarqube->cacheTime) { - ini_set('memory_limit', '256M'); - $sonarqubeIssueList = $this->sonarqube->apiGetIssues($sonarqubeID, $projectKey); foreach($sonarqubeIssueList as $key => $sonarqubeIssue) { From 15e03af0776f9fa6c086c239744313e012f0df57 Mon Sep 17 00:00:00 2001 From: liyuchun Date: Wed, 16 Mar 2022 13:36:28 +0800 Subject: [PATCH 2/3] * Fix bug #20833. --- module/gitlab/view/browsegroup.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/gitlab/view/browsegroup.html.php b/module/gitlab/view/browsegroup.html.php index a07c1f50cb..1455f6a881 100644 --- a/module/gitlab/view/browsegroup.html.php +++ b/module/gitlab/view/browsegroup.html.php @@ -48,7 +48,7 @@ id;?> name))); ?> - + $gitlabGroup->avatar_url, 'account' => $groupName), 20); ?> name;?> url . '/' . $gitlabGroup->path, $gitlabGroup->path, '_target');?> From 56c0ef9064f17a1d431dc13abfa57ca99c636c00 Mon Sep 17 00:00:00 2001 From: zhujinyong Date: Wed, 16 Mar 2022 13:38:33 +0800 Subject: [PATCH 3/3] * Fix sql. --- db/standard/zentao16.5.beta1.sql | 1 + db/zentao.sql | 1 + 2 files changed, 2 insertions(+) diff --git a/db/standard/zentao16.5.beta1.sql b/db/standard/zentao16.5.beta1.sql index 1fcd1c1952..bf8f62cff0 100644 --- a/db/standard/zentao16.5.beta1.sql +++ b/db/standard/zentao16.5.beta1.sql @@ -2242,6 +2242,7 @@ CREATE TABLE `zt_review` ( `title` varchar(255) NOT NULL, `object` mediumint(8) NOT NULL, `template` mediumint(8) NOT NULL, + `doc` mediumint(8) DEFAULT NULL, `status` char(30) NOT NULL, `reviewedBy` varchar(255) NOT NULL, `auditedBy` varchar(255) NOT NULL, diff --git a/db/zentao.sql b/db/zentao.sql index e24d955539..62b10d5cf7 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -9310,6 +9310,7 @@ CREATE TABLE IF NOT EXISTS `zt_review` ( `title` varchar(255) NOT NULL, `object` mediumint(8) NOT NULL, `template` mediumint(8) NOT NULL, + `doc` mediumint(8) DEFAULT NULL, `status` char(30) NOT NULL, `reviewedBy` varchar(255) NOT NULL, `auditedBy` varchar(255) NOT NULL,