diff --git a/db/zentao.sql b/db/zentao.sql
index 3e1fc29691..9457583bc7 100644
--- a/db/zentao.sql
+++ b/db/zentao.sql
@@ -471,23 +471,6 @@ CREATE TABLE IF NOT EXISTS `zt_history` (
PRIMARY KEY (`id`),
KEY `action` (`action`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--- DROP TABLE IF EXISTS `zt_pipeline`;
-CREATE TABLE IF NOT EXISTS `zt_pipeline` (
- `id` smallint(8) unsigned NOT NULL AUTO_INCREMENT,
- `type` char(30) NOT NULL,
- `name` varchar(50) NOT NULL,
- `url` varchar(255) DEFAULT NULL,
- `account` varchar(30) DEFAULT NULL,
- `password` varchar(255) NOT NULL,
- `token` varchar(255) DEFAULT NULL,
- `private` char(32) DEFAULT NULL,
- `createdBy` varchar(30) NOT NULL,
- `createdDate` datetime NOT NULL,
- `editedBy` varchar(30) NOT NULL,
- `editedDate` datetime NOT NULL,
- `deleted` enum('0','1') NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_job`;
CREATE TABLE IF NOT EXISTS `zt_job` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
@@ -495,8 +478,9 @@ CREATE TABLE IF NOT EXISTS `zt_job` (
`repo` mediumint(8) unsigned NOT NULL,
`product` mediumint(8) unsigned NOT NULL,
`frame` varchar(20) NOT NULL,
- `jkHost` mediumint(8) unsigned NOT NULL,
- `jkJob` varchar(500) NOT NULL,
+ `engine` varchar(20) NOT NULL,
+ `server` mediumint(8) unsigned NOT NULL,
+ `pipeline` varchar(500) NOT NULL,
`triggerType` varchar(255) NOT NULL,
`svnDir` varchar(255) NOT NULL,
`atDay` varchar(255) DEFAULT NULL,
@@ -588,6 +572,23 @@ CREATE TABLE IF NOT EXISTS `zt_oauth` (
KEY `providerType` (`providerType`),
KEY `providerID` (`providerID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+-- DROP TABLE IF EXISTS `zt_pipeline`;
+CREATE TABLE IF NOT EXISTS `zt_pipeline` (
+ `id` smallint(8) unsigned NOT NULL AUTO_INCREMENT,
+ `type` char(30) NOT NULL,
+ `name` varchar(50) NOT NULL,
+ `url` varchar(255) DEFAULT NULL,
+ `account` varchar(30) DEFAULT NULL,
+ `password` varchar(255) NOT NULL,
+ `token` varchar(255) DEFAULT NULL,
+ `private` char(32) DEFAULT NULL,
+ `createdBy` varchar(30) NOT NULL,
+ `createdDate` datetime NOT NULL,
+ `editedBy` varchar(30) NOT NULL,
+ `editedDate` datetime NOT NULL,
+ `deleted` enum('0','1') NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_planstory`;
CREATE TABLE IF NOT EXISTS `zt_planstory` (
`plan` mediumint(8) unsigned NOT NULL,
diff --git a/doc/CHANGELOG b/doc/CHANGELOG
index d702101a98..2bd53acec8 100644
--- a/doc/CHANGELOG
+++ b/doc/CHANGELOG
@@ -1,4 +1,5 @@
2021-07-20 15.2
+完成的需求
27297 调整产品下拉菜单信息展现方式
27298 调整执行下拉菜单信息展现方式
27300 调整测试中产品下拉菜单信息展现方式
diff --git a/module/ci/control.php b/module/ci/control.php
index dd9a637b0c..1ead086056 100644
--- a/module/ci/control.php
+++ b/module/ci/control.php
@@ -102,9 +102,9 @@ class ci extends control
$jobID = 0;
if($compileID)
{
- $compile = $this->dao->select('t1.*, t2.jkJob,t2.product,t2.frame,t3.name as jenkinsName,t3.url,t3.account,t3.token,t3.password')->from(TABLE_COMPILE)->alias('t1')
+ $compile = $this->dao->select('t1.*, t2.pipeline,t2.product,t2.frame,t3.name as jenkinsName,t3.url,t3.account,t3.token,t3.password')->from(TABLE_COMPILE)->alias('t1')
->leftJoin(TABLE_JOB)->alias('t2')->on('t1.job=t2.id')
- ->leftJoin(TABLE_PIPELINE)->alias('t3')->on('t2.jkHost=t3.id')
+ ->leftJoin(TABLE_PIPELINE)->alias('t3')->on('t2.server=t3.id')
->where('t1.id')->eq($compileID)
->fetch();
diff --git a/module/ci/model.php b/module/ci/model.php
index e2323dc447..45e9cee5ad 100644
--- a/module/ci/model.php
+++ b/module/ci/model.php
@@ -28,10 +28,10 @@ class ciModel extends model
*/
public function checkCompileStatus()
{
- $compiles = $this->dao->select('t1.*, t2.jkJob, t3.name as jenkinsName,t3.url,t3.account,t3.token,t3.password')
+ $compiles = $this->dao->select('t1.*, t2.pipeline, t3.name as jenkinsName,t3.url,t3.account,t3.token,t3.password')
->from(TABLE_COMPILE)->alias('t1')
->leftJoin(TABLE_JOB)->alias('t2')->on('t1.job=t2.id')
- ->leftJoin(TABLE_PIPELINE)->alias('t3')->on('t2.jkHost=t3.id')
+ ->leftJoin(TABLE_PIPELINE)->alias('t3')->on('t2.server=t3.id')
->where('t1.status')->ne('success')
->andWhere('t1.status')->ne('failure')
->andWhere('t1.status')->ne('create_fail')
diff --git a/module/compile/model.php b/module/compile/model.php
index f9f1646335..b03b2b7036 100644
--- a/module/compile/model.php
+++ b/module/compile/model.php
@@ -34,10 +34,10 @@ class compileModel extends model
*/
public function getList($jobID, $orderBy = 'id_desc', $pager = null)
{
- return $this->dao->select('t1.id, t1.name, t1.job, t1.status, t1.createdDate,t1.testtask, t2.jkJob,t2.triggerType,t2.comment,t2.atDay,t2.atTime, t3.name as repoName, t4.name as jenkinsName')->from(TABLE_COMPILE)->alias('t1')
+ return $this->dao->select('t1.id, t1.name, t1.job, t1.status, t1.createdDate,t1.testtask, t2.pipeline,t2.triggerType,t2.comment,t2.atDay,t2.atTime, t3.name as repoName, t4.name as jenkinsName')->from(TABLE_COMPILE)->alias('t1')
->leftJoin(TABLE_JOB)->alias('t2')->on('t1.job=t2.id')
->leftJoin(TABLE_REPO)->alias('t3')->on('t2.repo=t3.id')
- ->leftJoin(TABLE_PIPELINE)->alias('t4')->on('t2.jkHost=t4.id')
+ ->leftJoin(TABLE_PIPELINE)->alias('t4')->on('t2.server=t4.id')
->where('t1.deleted')->eq('0')
->andWhere('t1.job')->ne('0')
->beginIF(!empty($jobID))->andWhere('t1.job')->eq($jobID)->fi()
@@ -84,7 +84,7 @@ class compileModel extends model
$url = new stdclass();
$url->userPWD = "$jenkinsUser:$jenkinsPassword";
- $url->url = sprintf('%s/job/%s/buildWithParameters/api/json', $jenkinsServer, $jenkins->jkJob);
+ $url->url = sprintf('%s/job/%s/buildWithParameters/api/json', $jenkinsServer, $jenkins->pipeline);
return $url;
}
@@ -121,9 +121,9 @@ class compileModel extends model
*/
public function exec($compile)
{
- $job = $this->dao->select('t1.id,t1.name,t1.repo,t1.jkJob,t2.name as jenkinsName,t2.url,t2.account,t2.token,t2.password')
+ $job = $this->dao->select('t1.id,t1.name,t1.repo,t1.pipeline,t2.name as jenkinsName,t2.url,t2.account,t2.token,t2.password')
->from(TABLE_JOB)->alias('t1')
- ->leftJoin(TABLE_PIPELINE)->alias('t2')->on('t1.jkHost=t2.id')
+ ->leftJoin(TABLE_PIPELINE)->alias('t2')->on('t1.server=t2.id')
->where('t1.id')->eq($compile->job)
->fetch();
diff --git a/module/compile/view/browse.html.php b/module/compile/view/browse.html.php
index 899ad70a6c..0f8820e775 100644
--- a/module/compile/view/browse.html.php
+++ b/module/compile/view/browse.html.php
@@ -42,7 +42,7 @@
|
createLink('job', 'view', "jobID={$build->job}&compileID={$build->id}", 'html', true), $build->name, '', "class='iframe' data-width='90%'") : $build->name;?> |
repoName;?> |
- jkJob) . '@' . $build->jenkinsName;?>
+ pipeline) . '@' . $build->jenkinsName;?>
|
loadModel('job')->getTriggerConfig($build);?>
|
diff --git a/module/execution/control.php b/module/execution/control.php
index b5a72a88ca..5f50f66ce3 100644
--- a/module/execution/control.php
+++ b/module/execution/control.php
@@ -2985,7 +2985,7 @@ class execution extends control
$this->loadModel('project');
$project = $this->project->getByID($this->session->project);
- if($project->model == 'waterfall') $this->lang->executionCommon = $this->lang->project->stage;
+ if(!empty($project->model) and $project->model == 'waterfall') $this->lang->executionCommon = $this->lang->project->stage;
$this->view->fileName = (in_array($status, array('all', 'undone')) ? $this->lang->execution->$status : $this->lang->execution->statusList[$status]) . $this->lang->executionCommon;
diff --git a/module/job/config.php b/module/job/config.php
index fbca68a83a..75baa8009d 100644
--- a/module/job/config.php
+++ b/module/job/config.php
@@ -2,5 +2,5 @@
$config->job = new stdclass();
$config->job->create = new stdclass();
$config->job->edit = new stdclass();
-$config->job->create->requiredFields = 'name,repo,jkHost,jkJob,triggerType';
-$config->job->edit->requiredFields = 'name,repo,jkHost,jkJob,triggerType';
+$config->job->create->requiredFields = 'name,repo,server,pipeline,triggerType';
+$config->job->edit->requiredFields = 'name,repo,server,pipeline,triggerType';
diff --git a/module/job/control.php b/module/job/control.php
index 5151d7eb4e..5baf3183da 100644
--- a/module/job/control.php
+++ b/module/job/control.php
@@ -86,7 +86,7 @@ class job extends control
$this->view->repoPairs = $repoPairs;
$this->view->repoTypes = $repoTypes;
$this->view->products = array(0 => '') + $this->loadModel('product')->getProductPairsByProject($this->projectID);
- $this->view->jkHostList = $this->loadModel('jenkins')->getPairs();
+ $this->view->serverList = $this->loadModel('jenkins')->getPairs();
$this->display();
}
@@ -129,8 +129,8 @@ class job extends control
$this->view->repoType = zget($repoTypes, $job->repo, 'Git');
$this->view->job = $job;
$this->view->products = array(0 => '') + $this->loadModel('product')->getProductPairsByProject($this->projectID);
- $this->view->jkHostList = $this->loadModel('jenkins')->getPairs();
- $this->view->jkJobs = $this->jenkins->getTasks($job->jkHost);
+ $this->view->serverList = $this->loadModel('jenkins')->getPairs();
+ $this->view->pipelines = $this->jenkins->getTasks($job->server);
$this->display();
}
@@ -226,7 +226,7 @@ class job extends control
$this->view->job = $job;
$this->view->compile = $compile;
$this->view->repo = $this->loadModel('repo')->getRepoByID($job->repo);
- $this->view->jenkins = $this->loadModel('jenkins')->getById($job->jkHost);
+ $this->view->jenkins = $this->loadModel('jenkins')->getById($job->server);
$this->view->product = $this->loadModel('product')->getById($job->product);
$this->display();
}
diff --git a/module/job/css/create.css b/module/job/css/create.css
index cbbff7de9e..2eaabdfeb4 100644
--- a/module/job/css/create.css
+++ b/module/job/css/create.css
@@ -2,7 +2,7 @@
.only-pick-time thead th, .only-pick-time tfoot th {color: transparent !important;}
.checkbox-primary.checkbox-inline {display: inline-block !important;}
.checkbox-primary.checkbox-inline label {padding-left: 5px !important;}
-#jkHost_chosen .chosen-single {border-right: 0px;}
-#jkJobBox {width: 385px;}
+#server_chosen .chosen-single {border-right: 0px;}
+#pipelineBox {width: 385px;}
#svnDirBox .input-group {width: unset !important;}
#paramDiv .input-group {padding: 3px;}
diff --git a/module/job/css/edit.css b/module/job/css/edit.css
index cbbff7de9e..2eaabdfeb4 100644
--- a/module/job/css/edit.css
+++ b/module/job/css/edit.css
@@ -2,7 +2,7 @@
.only-pick-time thead th, .only-pick-time tfoot th {color: transparent !important;}
.checkbox-primary.checkbox-inline {display: inline-block !important;}
.checkbox-primary.checkbox-inline label {padding-left: 5px !important;}
-#jkHost_chosen .chosen-single {border-right: 0px;}
-#jkJobBox {width: 385px;}
+#server_chosen .chosen-single {border-right: 0px;}
+#pipelineBox {width: 385px;}
#svnDirBox .input-group {width: unset !important;}
#paramDiv .input-group {padding: 3px;}
diff --git a/module/job/js/create.js b/module/job/js/create.js
index 20d93c09ed..517b7eab3a 100644
--- a/module/job/js/create.js
+++ b/module/job/js/create.js
@@ -82,25 +82,25 @@ $('#triggerType').change(function()
}
});
-$('#jkHost').change(function()
+$('#server').change(function()
{
var jenkinsID = $(this).val();
- $('#jkJobBox #jkJob').remove();
- $('#jkJobBox #jkJob_chosen').remove();
- $('#jkJobBox .input-group').append("");
+ $('#pipelineBox #pipeline').remove();
+ $('#pipelineBox #pipeline_chosen').remove();
+ $('#pipelineBox .input-group').append("");
$.getJSON(createLink('jenkins', 'ajaxGetTasks', 'jenkinsID=' + jenkinsID), function(tasks)
{
- html = "