This commit is contained in:
Guan Xiying
2021-08-05 15:48:15 +08:00
41 changed files with 179 additions and 79 deletions
+2 -2
View File
@@ -38,7 +38,7 @@ class projectIssuesEntry extends entry
$orderParams = explode('_', $order);
$order = $orderParams[0];
$sort = (isset($orderParams[1]) and strtolower($orderParams[1]) == 'desc') ? 'desc' : 'asc';
$sort = (isset($orderParams[1]) and strtolower($orderParams[1]) == 'asc') ? 'asc' : 'desc';
if($status == 'all') $status = '';
if(!in_array($status, array('opened', 'closed', ''))) return $this->sendError(400, 'The status is not supported');
@@ -128,7 +128,7 @@ class projectIssuesEntry extends entry
if(!empty($tasks)) $tasks = $this->dao->select('*')->from(TABLE_TASK)->where('id')->in($tasks)->fetchAll('id');
if(!empty($stories)) $stories = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($stories)->fetchAll('id');
if(!empty($bugs)) $bugs = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($bugs)->fetchAll('id');
if(!empty($bugs)) $bugs = $this->dao->select('*')->from(TABLE_BUG)->where('id')->in($bugs)->fetchAll('id');
$result = array();
foreach($issues as $issue)
+1
View File
@@ -123,6 +123,7 @@ class ci extends control
$caseResult = $post->funcResult;
$firstCase = array_shift($caseResult);
$productID = $firstCase->productId;
if(empty($productID) and !empty($firstCase->id)) $productID = $this->dao->select('product')->from(TABLE_CASE)->where('id')->eq((int)$firstCase->id)->fetch('product');
}
if(empty($productID)) die(json_encode(array('result' => 'fail', 'message' => 'productID is not found')));
+3 -2
View File
@@ -1,6 +1,7 @@
<?php
$lang->ci->common = 'CI';
$lang->ci->commitResult = 'Interface: Commit Test Result.';
$lang->ci->common = 'CI';
$lang->ci->commitResult = 'Interface: Commit Test Result.';
$lang->ci->checkCompileStatus = 'Interface: Fetch Test Result.';
$lang->ci->job = 'Job';
$lang->ci->task = 'Task';
+3 -2
View File
@@ -1,6 +1,7 @@
<?php
$lang->ci->common = '持续集成';
$lang->ci->commitResult = '接口:提交测试结果';
$lang->ci->common = '持续集成';
$lang->ci->commitResult = '接口:提交测试结果';
$lang->ci->checkCompileStatus = '接口:获取测试结果';
$lang->ci->job = '构建';
$lang->ci->task = '构建任务';
+3 -2
View File
@@ -1,6 +1,7 @@
<?php
$lang->ci->common = '持續整合';
$lang->ci->commitResult = '介面:提交測試結果';
$lang->ci->common = '持續整合';
$lang->ci->commitResult = '介面:提交測試結果';
$lang->ci->checkCompileStatus = '介面:獲取測試結果';
$lang->ci->job = '構建';
$lang->ci->task = '構建任務';
+1
View File
@@ -1997,6 +1997,7 @@ EOD;
{
$httpType = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') ? 'https' : 'http';
if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') $httpType = 'https';
if(isset($_SERVER['REQUEST_SCHEME']) and strtolower($_SERVER['REQUEST_SCHEME']) == 'https') $httpType = 'https';
$httpHost = $_SERVER['HTTP_HOST'];
return "$httpType://$httpHost";
}
+1 -1
View File
@@ -44,7 +44,7 @@
<?php foreach($buildList as $id => $build):?>
<tr>
<td class='text-center'><?php echo $id;?></td>
<td title='<?php echo $build->name;?>'><?php echo common::hasPriv('job', 'view') ? html::a($this->createLink('job', 'view', "jobID={$build->job}&compileID={$build->id}", 'html', true), $build->name, '', "class='iframe' data-width='90%'") : $build->name;?></td>
<td class='c-name' title='<?php echo $build->name;?>'><?php echo common::hasPriv('job', 'view') ? html::a($this->createLink('job', 'view', "jobID={$build->job}&compileID={$build->id}", 'html', true), $build->name, '', "class='iframe' data-width='90%'") : $build->name;?></td>
<td title='<?php echo $build->engine;?>'><?php echo $build->engine;?></td>
<td title='<?php echo $build->repoName;?>'><?php echo $build->repoName;?></td>
<?php $jenkins = urldecode($build->pipeline) . '@' . $build->jenkinsName;?>
+4 -2
View File
@@ -318,8 +318,9 @@ class doc extends control
{
$this->app->rawMethod = $objectType;
unset($this->lang->doc->menu->product['subMenu']);
if($this->config->systemMode == 'new') unset($this->lang->doc->menu->project['subMenu']);
unset($this->lang->doc->menu->custom['subMenu']);
if($this->config->systemMode == 'new') unset($this->lang->doc->menu->project['subMenu']);
if($this->config->systemMode == 'classic') unset($this->lang->doc->menu->execution['subMenu']);
}
$lib = $this->doc->getLibByID($libID);
@@ -422,8 +423,9 @@ class doc extends control
$this->app->rawMethod = $objectType;
unset($this->lang->doc->menu->product['subMenu']);
if($this->config->systemMode == 'new') unset($this->lang->doc->menu->project['subMenu']);
unset($this->lang->doc->menu->custom['subMenu']);
if($this->config->systemMode == 'new') unset($this->lang->doc->menu->project['subMenu']);
if($this->config->systemMode == 'classic') unset($this->lang->doc->menu->execution['subMenu']);
/* High light menu. */
if(strpos(',product,project,execution,custom,book,', ",$objectType,") !== false)
+4
View File
@@ -1220,6 +1220,10 @@ class execution extends control
if($this->config->systemMode == 'new') $selectedExecutionID = key($this->executions);
$this->execution->setMenu($selectedExecutionID);
}
elseif($this->app->openApp == 'doc')
{
unset($this->lang->doc->menu->execution['subMenu']);
}
$this->app->loadLang('program');
$this->app->loadLang('stage');
+6 -4
View File
@@ -977,9 +977,11 @@ $lang->repo->methodOrder[60] = 'download';
$lang->repo->methodOrder[65] = 'setRules';
$lang->resource->ci = new stdclass();
$lang->resource->ci->commitResult = 'commitResult';
$lang->resource->ci->commitResult = 'commitResult';
$lang->resource->ci->checkCompileStatus = 'checkCompileStatus';
$lang->ci->methodOrder[5] = 'commitResult';
$lang->ci->methodOrder[5] = 'commitResult';
$lang->ci->methodOrder[10] = 'checkCompileStatus';
$lang->resource->compile = new stdclass();
$lang->resource->compile->browse = 'browse';
@@ -1133,7 +1135,7 @@ $lang->resource->gitlab->importIssue = 'importIssue';
$lang->resource->gitlab->delete = 'delete';
$lang->resource->gitlab->bindUser = 'bindUser';
$lang->resource->gitlab->bindProduct = 'bindProduct';
$lang->resource->gitlab->webhook = 'webhook';
//$lang->resource->gitlab->webhook = 'webhook';
$lang->gitlab->methodOrder[5] = 'browse';
$lang->gitlab->methodOrder[10] = 'create';
@@ -1142,7 +1144,7 @@ $lang->gitlab->methodOrder[20] = 'importIssue';
$lang->gitlab->methodOrder[30] = 'delete';
$lang->gitlab->methodOrder[35] = 'bindUser';
$lang->gitlab->methodOrder[40] = 'bindProduct';
$lang->gitlab->methodOrder[45] = 'webhook';
//$lang->gitlab->methodOrder[45] = 'webhook';
/* Git. */
$lang->resource->git = new stdclass();
+3
View File
@@ -111,6 +111,9 @@ class jenkins extends control
{
if($confim != 'yes') die(js::confirm($this->lang->jenkins->confirmDelete, inlink('delete', "id=$id&confirm=yes")));
$jobs = $this->dao->select('*')->from(TABLE_JOB)->where('server')->eq($id)->andWhere('engine')->eq('jenkins')->andWhere('deleted')->eq('0')->fetchAll();
if($jobs) die(js::alert($this->lang->jenkins->error->linkedJob));
$this->jenkins->delete(TABLE_PIPELINE, $id);
die(js::reload('parent'));
}
+3
View File
@@ -20,3 +20,6 @@ $lang->jenkins->lblCreate = 'Create Jenkins Server';
$lang->jenkins->desc = 'Description';
$lang->jenkins->tokenFirst = 'Use token if not empty.';
$lang->jenkins->tips = 'Cancel "Prevent Cross Site Request Forgery exploits" when using password.';
$lang->jenkins->error = new stdclass();
$lang->jenkins->error->linkedJob = 'Failed. This jenkins has associated with the compile.';
+3
View File
@@ -20,3 +20,6 @@ $lang->jenkins->lblCreate = '添加Jenkins服务器';
$lang->jenkins->desc = '描述';
$lang->jenkins->tokenFirst = 'Token不为空时,优先使用Token。';
$lang->jenkins->tips = '使用密码时,请在Jenkins全局安全设置中禁用"防止跨站点请求伪造"选项。';
$lang->jenkins->error = new stdclass();
$lang->jenkins->error->linkedJob = '删除失败,该Jenkins跟构建有关联,请取消关联或删除构建。';
+3
View File
@@ -20,3 +20,6 @@ $lang->jenkins->lblCreate = '添加Jenkins伺服器';
$lang->jenkins->desc = '描述';
$lang->jenkins->tokenFirst = 'Token不為空時,優先使用Token。';
$lang->jenkins->tips = '使用密碼時,請在Jenkins全局安全設置中禁用"防止跨站點請求偽造"選項。';
$lang->jenkins->error = new stdclass();
$lang->jenkins->error->linkedJob = '刪除失敗,該Jenkins跟構建有關聯,請取消關聯或刪除構建。';
+1 -1
View File
@@ -25,7 +25,7 @@
<th class='w-60px'><?php common::printOrderLink('id', $orderBy, $vars, $lang->jenkins->id); ?></th>
<th class='w-200px text-left'><?php common::printOrderLink('name', $orderBy, $vars, $lang->jenkins->name); ?></th>
<th class='text-left'><?php common::printOrderLink('url', $orderBy, $vars, $lang->jenkins->url); ?></th>
<th class='w-100px c-actions-4'><?php echo $lang->actions; ?></th>
<th class='c-actions-2'><?php echo $lang->actions; ?></th>
</tr>
</thead>
<tbody>
+9 -2
View File
@@ -125,6 +125,13 @@ class job extends control
$repoTypes[$repo->id] = $repo->SCM;
}
$products = $this->repo->getProductsByRepo($job->repo);
if(!isset($products[$job->product]))
{
$jobProduct = $this->loadModel('product')->getByID($job->product);
if($jobProduct and $jobProduct->deleted == 0) $products += array($job->product => $jobProduct->name);
}
$this->view->title = $this->lang->ci->job . $this->lang->colon . $this->lang->job->edit;
$this->view->position[] = html::a(inlink('browse'), $this->lang->ci->job);
$this->view->position[] = $this->lang->job->edit;
@@ -132,7 +139,7 @@ class job extends control
$this->view->repoTypes = $repoTypes;
$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->products = array(0 => '') + $products;
$this->view->jenkinsServerList = $this->loadModel('jenkins')->getPairs();
$this->view->pipelines = $this->jenkins->getTasks($job->server);
@@ -275,7 +282,7 @@ class job extends control
$this->view->title = $this->lang->job->runPipeline;
$this->view->refList = $refList;
$this->view->job = $job;
$this->view->pipelineTips = $this->lang->job->pipeline->pipelineTips;
$this->view->pipelineTips = $this->lang->job->pipelineTips;
return $this->display();
}
+11
View File
@@ -3,6 +3,17 @@ $(document).ready(function()
$('#repo').change(function()
{
var repoID = $(this).val();
var link = createLink('repo', 'ajaxLoadPorducts', 'repoID=' + repoID);
$.get(link, function(data)
{
if(data)
{
$('#product').replaceWith(data);
$('#product_chosen').remove();
$('#product').chosen();
}
});
var type = 'Git';
if(typeof(repoTypes[repoID]) != 'undefined') type = repoTypes[repoID];
+11
View File
@@ -3,6 +3,17 @@ $(document).ready(function()
$('#repo').change(function()
{
var repoID = $(this).val();
var link = createLink('repo', 'ajaxLoadPorducts', 'repoID=' + repoID);
$.get(link, function(data)
{
if(data)
{
$('#product').replaceWith(data);
$('#product_chosen').remove();
$('#product').chosen();
}
});
var type = 'Git';
if(typeof(repoTypes[repoID]) != 'undefined') type = repoTypes[repoID];
+6 -7
View File
@@ -25,7 +25,7 @@ $lang->job->jkJob = 'Jenkins Task';
$lang->job->buildSpec = 'Build Target'; // 'pipeline@server'
$lang->job->engine = 'Engine';
$lang->job->server = 'Server';
$lang->job->Pipeline = 'Pipeline';
$lang->job->pipeline = 'Pipeline';
$lang->job->buildType = 'Build Type';
$lang->job->frame = 'Frame';
$lang->job->triggerType = 'Trigger';
@@ -81,9 +81,8 @@ $lang->job->engineTips = new stdclass;
$lang->job->engineTips->success = 'Build engine will use the built pipeline in GitLab.';
$lang->job->engineTips->error = 'No pipeline is currently available in the GitLab project, please go to GitLab configuration first. ';
$lang->job->pipeline = new stdclass;
$lang->job->pipeline->pipelineTips = "Run for branch name or tag";
$lang->job->pipeline->variables = "Variables";
$lang->job->pipeline->variablesKeyPlaceHolder = "Input variable key";
$lang->job->pipeline->variablesValuePlaceHolder = "Input variable value";
$lang->job->pipeline->variablesTips = "Specify variable values to be used in this run. The values specified in CI/CD settings will be used by default.";
$lang->job->pipelineTips = "Run for branch name or tag";
$lang->job->pipelineVariables = "Variables";
$lang->job->pipelineVariablesKeyPlaceHolder = "Input variable key";
$lang->job->pipelineVariablesValuePlaceHolder = "Input variable value";
$lang->job->pipelineVariablesTips = "Specify variable values to be used in this run. The values specified in CI/CD settings will be used by default.";
+6 -7
View File
@@ -25,7 +25,7 @@ $lang->job->jkJob = 'Jenkins任务';
$lang->job->buildSpec = '构建对象'; // 'pipeline@server'
$lang->job->engine = '构建引擎';
$lang->job->server = '服务器';
$lang->job->Pipeline = '流水线';
$lang->job->pipeline = '流水线';
$lang->job->buildType = '构建类型';
$lang->job->frame = '工具/框架';
$lang->job->triggerType = '触发方式';
@@ -81,9 +81,8 @@ $lang->job->engineTips = new stdclass;
$lang->job->engineTips->success = '构建引擎将使用GitLab项目内置的流水线。';
$lang->job->engineTips->error = '当前GitLab项目内没有可用的流水线,请先前往GitLab配置。';
$lang->job->pipeline = new stdclass;
$lang->job->pipeline->pipelineTips = "选择要运行流水线的分支名或标签名";
$lang->job->pipeline->variables = "变量";
$lang->job->pipeline->variablesKeyPlaceHolder = "输入变量的名称";
$lang->job->pipeline->variablesValuePlaceHolder = "输入变量的值";
$lang->job->pipeline->variablesTips = "指定要在此次运行中使用的变量值。CI/CD设置中指定的值将用作默认值。";
$lang->job->pipelineTips = "选择要运行流水线的分支名或标签名";
$lang->job->pipelineVariables = "变量";
$lang->job->pipelineVariablesKeyPlaceHolder = "输入变量的名称";
$lang->job->pipelineVariablesValuePlaceHolder = "输入变量的值";
$lang->job->pipelineVariablesTips = "指定要在此次运行中使用的变量值。CI/CD设置中指定的值将用作默认值。";
+6 -7
View File
@@ -25,7 +25,7 @@ $lang->job->jkJob = 'Jenkins任務';
$lang->job->buildSpec = '構建對象'; // 'pipeline@server'
$lang->job->engine = '構建引擎';
$lang->job->server = '伺服器';
$lang->job->Pipeline = '流水綫';
$lang->job->pipeline = '流水綫';
$lang->job->buildType = '構建類型';
$lang->job->frame = '工具/框架';
$lang->job->triggerType = '觸發方式';
@@ -81,9 +81,8 @@ $lang->job->engineTips = new stdclass;
$lang->job->engineTips->success = '構建引擎將使用GitLab項目內置的流水綫。';
$lang->job->engineTips->error = '當前GitLab項目內沒有可用的流水綫,請先前往GitLab配置。';
$lang->job->pipeline = new stdclass;
$lang->job->pipeline->pipelineTips = "選擇要運行流水綫的分支名或標籤名";
$lang->job->pipeline->variables = "變數";
$lang->job->pipeline->variablesKeyPlaceHolder = "輸入變數的名稱";
$lang->job->pipeline->variablesValuePlaceHolder = "輸入變數的值";
$lang->job->pipeline->variablesTips = "指定要在此次運行中使用的變數值。CI/CD設置中指定的值將用作預設值。";
$lang->job->pipelineTips = "選擇要運行流水綫的分支名或標籤名";
$lang->job->pipelineVariables = "變數";
$lang->job->pipelineVariablesKeyPlaceHolder = "輸入變數的名稱";
$lang->job->pipelineVariablesValuePlaceHolder = "輸入變數的值";
$lang->job->pipelineVariablesTips = "指定要在此次運行中使用的變數值。CI/CD設置中指定的值將用作預設值。";
+6 -5
View File
@@ -122,8 +122,8 @@ class jobModel extends model
if($job->engine == 'jenkins')
{
$job->server = $job->jkServer;
$job->pipeline = $job->jkTask;
$job->server = zget($job, 'jkServer', '');
$job->pipeline = zget($job, 'jkTask', '');
}
if(strtolower($job->engine) == 'gitlab')
@@ -177,7 +177,7 @@ class jobModel extends model
->batchCheckIF(($this->post->repoType == 'Subversion' and $job->triggerType == 'tag'), "svnDir", 'notempty')
->autoCheck()
->exec();
if(dao::isError()) return dao::getError();
if(dao::isError()) return false;
$id = $this->dao->lastInsertId();
if(strtolower($job->engine) == 'jenkins') $this->initJob($id, $job, $this->post->repoType);
@@ -206,8 +206,8 @@ class jobModel extends model
if($job->engine == 'jenkins')
{
$job->server = $job->jkServer;
$job->pipeline = $job->jkTask;
$job->server = zget($job, 'jkServer', '');
$job->pipeline = zget($job, 'jkTask', '');
}
if(strtolower($job->engine) == 'gitlab')
@@ -263,6 +263,7 @@ class jobModel extends model
->autoCheck()
->where('id')->eq($id)
->exec();
if(dao::isError()) return false;
$this->initJob($id, $job, $this->post->repoType);
return true;
+2 -2
View File
@@ -52,13 +52,13 @@
<?php foreach($jobList as $id => $job):?>
<tr class='text-left'>
<td class='text-center'><?php echo $id;?></td>
<td class='text-left' title='<?php echo $job->name;?>'><?php echo common::hasPriv('job', 'view') ? html::a($this->createLink('job', 'view', "jobID={$job->id}", 'html', true), $job->name, '', "class='iframe' data-width='90%'") : $job->name;?></td>
<td class='text-left c-name' title='<?php echo $job->name;?>'><?php echo common::hasPriv('job', 'view') ? html::a($this->createLink('job', 'view', "jobID={$job->id}", 'html', true), $job->name, '', "class='iframe' data-width='90%'") : $job->name;?></td>
<td title='<?php echo $job->repoName;?>'><?php echo $job->repoName;?></td>
<td><?php echo zget($lang->job->engineList, $job->engine);?></td>
<td><?php echo zget($lang->job->frameList, $job->frame);?></td>
<?php if(strtolower($job->engine) == 'gitlab') $job->pipeline = $this->loadModel('gitlab')->getObjectNameForJob($job->server, $job->pipeline);?>
<?php $jenkins = urldecode($job->pipeline) . '@' . $job->jenkinsName;?>
<td title='<?php echo $jenkins;?>'><?php echo $jenkins;?></td>
<td class='c-name' title='<?php echo $jenkins;?>'><?php echo $jenkins;?></td>
<?php $triggerConfig = $this->job->getTriggerConfig($job);?>
<td title='<?php echo $triggerConfig;?>'><?php echo $triggerConfig;?></td>
<td class='text-center'><?php if($job->lastStatus) echo zget($lang->compile->statusList, $job->lastStatus);?></td>
+3 -3
View File
@@ -52,7 +52,7 @@
</tr>
<tr>
<th><?php echo $lang->job->product; ?></th>
<td><?php echo html::select('product', $products, '', "class='form-control chosen'"); ?></td>
<td><?php echo html::select('product', '', '', "class='form-control chosen'"); ?></td>
</tr>
<tr>
<th><?php echo $lang->job->frame; ?></th>
@@ -90,12 +90,12 @@
</tr>
<tr id="jenkinsServerTR">
<th><?php echo $lang->job->jkHost; ?></th>
<td colspan='2'>
<td colspan='2' class='required'>
<div class='table-row'>
<div class='table-col'><?php echo html::select('jkServer', $jenkinsServerList, '', "class='form-control chosen'"); ?></div>
<div class='table-col'>
<div class='input-group'>
<span class='input-group-addon'><?php echo $lang->job->Pipeline; ?></span>
<span class='input-group-addon'><?php echo $lang->job->pipeline; ?></span>
<?php echo html::select('jkTask', array('' => ''), '', "class='form-control chosen'"); ?>
</div>
</div>
+3 -3
View File
@@ -34,7 +34,7 @@
</tr>
<tr>
<th><?php echo $lang->job->engine;?></th>
<td class='required'><?php echo html::select('engine', $lang->job->engineList, $job->engine, "class='form-control chosen'");?>
<td class='required'><?php echo zget($lang->job->engineList, $job->engine, '') . html::hidden('engine', $job->engine);?>
</td>
</tr>
<tr>
@@ -104,12 +104,12 @@
<?php if($job->engine == 'jenkins'):?>
<tr id="jenkinsServerTR">
<th><?php echo $lang->job->server;?></th>
<td colspan='2'>
<td colspan='2' class='required'>
<div class='table-row'>
<div class='table-col'><?php echo html::select('jkServer', $jenkinsServerList, $job->server, "class='form-control chosen'");?></div>
<div class='table-col'>
<div class='input-group'>
<span class='input-group-addon'><?php echo $lang->job->Pipeline;?></span>
<span class='input-group-addon'><?php echo $lang->job->pipeline;?></span>
<?php echo html::select('jkTask', array('' => ''), $job->pipeline, "class='form-control chosen'");?>
</div>
</div>
+4 -4
View File
@@ -8,16 +8,16 @@
<td class='required'><?php echo html::select("ref", $refList, '', "class='form-control chosen'");?></td>
</tr>
<tr>
<td><?php echo $lang->job->pipeline->variables; ?></td>
<td><?php echo $lang->job->pipelineVariables; ?></td>
</tr>
<tr id='insertItemBox' class='row-module'>
<td><?php echo html::input("keys[]", '', "class='form-control' placeholder='{$lang->job->pipeline->variablesKeyPlaceHolder}'");?></td>
<td><?php echo html::input("values[]", '', "class='form-control' placeholder='{$lang->job->pipeline->variablesValuePlaceHolder}'");?></td>
<td><?php echo html::input("keys[]", '', "class='form-control' placeholder='{$lang->job->pipelineVariablesKeyPlaceHolder}'");?></td>
<td><?php echo html::input("values[]", '', "class='form-control' placeholder='{$lang->job->pipelineVariablesValuePlaceHolder}'");?></td>
<td><button type="button" class="btn btn-link btn-icon btn-add" onclick="addVariable(this)"><i class="icon icon-plus"></i></button></td>
<td><button type="button" class="btn btn-link btn-icon btn-delete" onclick="deleteVariable(this)"><i class="icon icon-close"></i></button></td>
</tr>
<tr>
<td><?php echo $lang->job->pipeline->variablesTips; ?></td>
<td><?php echo $lang->job->pipelineVariablesTips; ?></td>
</tr>
<tr>
<td>
+8 -2
View File
@@ -196,10 +196,13 @@ class my extends control
/* Append id for secend sort. */
$sort = $this->loadModel('common')->appendOrder($orderBy);
$stories = $this->loadModel('story')->getUserStories($this->app->user->account, $type, $sort, $pager, 'story');
if(!empty($stories)) $stories = $this->story->mergeReviewer($stories);
/* Assign. */
$this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->story;
$this->view->position[] = $this->lang->my->story;
$this->view->stories = $this->loadModel('story')->getUserStories($this->app->user->account, $type, $sort, $pager, 'story');
$this->view->stories = $stories;
$this->view->users = $this->user->getPairs('noletter');
$this->view->projects = $this->loadModel('project')->getPairsByProgram();
$this->view->type = $type;
@@ -237,10 +240,13 @@ class my extends control
/* Append id for secend sort. */
$sort = $this->loadModel('common')->appendOrder($orderBy);
$stories = $this->loadModel('story')->getUserStories($this->app->user->account, $type, $sort, $pager, 'requirement');
if(!empty($stories)) $stories = $this->story->mergeReviewer($stories);
/* Assign. */
$this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->story;
$this->view->position[] = $this->lang->my->story;
$this->view->stories = $this->loadModel('story')->getUserStories($this->app->user->account, $type, $sort, $pager, 'requirement');
$this->view->stories = $stories;
$this->view->users = $this->user->getPairs('noletter');
$this->view->projects = $this->loadModel('project')->getPairsByProgram();
$this->view->type = $type;
+4 -4
View File
@@ -99,10 +99,10 @@
if($canBeChanged)
{
$vars = "story={$story->id}";
common::printIcon('story', 'change', $vars, $story, 'list', 'alter', '', 'iframe', true);
common::printIcon('story', 'review', $vars, $story, 'list', 'search', '', 'iframe', true);
common::printIcon('story', 'close', $vars, $story, 'list', '', '', 'iframe', true);
common::printIcon('story', 'edit', $vars, $story, 'list', '', '', 'iframe', true, "data-width='95%'");
echo common::buildIconButton('story', 'change', $vars, $story, 'list', 'alter', '', 'iframe', true);
echo common::buildIconButton('story', 'review', $vars, $story, 'list', 'search', '', 'iframe', true);
echo common::buildIconButton('story', 'close', $vars, $story, 'list', '', '', 'iframe', true);
echo common::buildIconButton('story', 'edit', $vars, $story, 'list', '', '', 'iframe', true, "data-width='95%'");
}
?>
</td>
+5 -5
View File
@@ -101,11 +101,11 @@
if($canBeChanged)
{
$vars = "story={$story->id}";
common::printIcon('story', 'change', $vars, $story, 'list', 'alter', '', 'iframe', true);
common::printIcon('story', 'review', $vars, $story, 'list', 'search', '', 'iframe', true);
common::printIcon('story', 'close', $vars, $story, 'list', '', '', 'iframe', true);
common::printIcon('story', 'edit', $vars, $story, 'list', '', '', 'iframe', true, "data-width='95%'");
common::printIcon('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=&param=0&$vars", $story, 'list', 'sitemap', '', 'iframe', true, "data-width='95%'");
echo common::buildIconButton('story', 'change', $vars, $story, 'list', 'alter', '', 'iframe', true);
echo common::buildIconButton('story', 'review', $vars, $story, 'list', 'search', '', 'iframe', true);
echo common::buildIconButton('story', 'close', $vars, $story, 'list', '', '', 'iframe', true);
echo common::buildIconButton('story', 'edit', $vars, $story, 'list', '', '', 'iframe', true, "data-width='95%'");
echo common::buildIconButton('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=&param=0&$vars", $story, 'list', 'sitemap', '', 'iframe', true, "data-width='95%'");
}
?>
</td>
+2
View File
@@ -362,6 +362,8 @@ class product extends control
if($programID) $lines = array('') + $this->product->getLinePairs($programID);
if($this->config->systemMode == 'classic') $lines = array('') + $this->product->getLinePairs();
if($this->app->openApp == 'doc') unset($this->lang->doc->menu->product['subMenu']);
$this->view->title = $this->lang->product->create;
$this->view->position[] = $this->view->title;
$this->view->groups = $this->loadModel('group')->getPairs();
+2
View File
@@ -373,6 +373,8 @@ class project extends control
}
}
if($this->app->openApp == 'doc') unset($this->lang->doc->menu->project['subMenu']);
$this->view->title = $this->lang->project->create;
$this->view->position[] = $this->lang->project->create;
+21 -8
View File
@@ -203,16 +203,16 @@ class repo extends control
*/
public function delete($repoID, $objectID = 0, $confirm = 'no')
{
if($confirm == 'no')
{
die(js::confirm($this->lang->repo->notice->delete, $this->repo->createLink('delete', "repoID=$repoID&objectID=$objectID&confirm=yes")));
}
if($confirm == 'no') die(js::confirm($this->lang->repo->notice->delete, $this->repo->createLink('delete', "repoID=$repoID&objectID=$objectID&confirm=yes")));
$error = '';
$relationID = $this->dao->select('id')->from(TABLE_RELATION)->where('extra')->eq($repoID)->fetch();
if($relationID)
{
die(js::alert($this->lang->repo->error->deleted));
}
if($relationID) $error .= $this->lang->repo->error->deleted;
$jobs = $this->dao->select('*')->from(TABLE_JOB)->where('repo')->eq($repoID)->andWhere('deleted')->eq('0')->fetchAll();
if($jobs) $error .= ($error ? '\n' : '') . $this->lang->repo->error->linkedJob;
if($error) die(js::alert($error));
$this->dao->delete()->from(TABLE_REPO)->where('id')->eq($repoID)->exec();
$this->dao->delete()->from(TABLE_REPOHISTORY)->where('repo')->eq($repoID)->exec();
@@ -1156,4 +1156,17 @@ class repo extends control
die($branchesHtml);
}
/**
* Ajax load product by repoID.
*
* @param int $repoID
* @access public
* @return void
*/
public function ajaxLoadPorducts($repoID)
{
$productPairs = $this->repo->getProductsByRepo($repoID);
echo html::select('product', array('') + $productPairs, key($productPairs), "class='form-control chosen'");
}
}
+1
View File
@@ -2,3 +2,4 @@
#sidebar>.sidebar-toggle>.icon {right: -2px; left: auto;}
.main-row {width: 99%;}
.btn-toolbar > .last-sync-time {display: inline-block; float: left; margin-right: 10px;}
.dropdown-menu>li.selected>a:after {content: '';}
+1
View File
@@ -172,6 +172,7 @@ $lang->repo->error->output = "The command is: %s\nThe error is(%s): %s\n"
$lang->repo->error->clientVersion = "Client version is too low, please upgrade or change SVN client";
$lang->repo->error->encoding = "The encoding might be wrong. Please change the encoding and try again.";
$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->syncTips = '<strong>You may find the reference about how to set Git sync from <a target="_blank" href="https://www.zentao.pm/book/zentaomanual/free-open-source-project-management-software-git-105.html">here</a>.</strong>';
+1
View File
@@ -172,6 +172,7 @@ $lang->repo->error->output = "执行命令:%s\n错误结果(%s): %s\n
$lang->repo->error->clientVersion = "客户端版本过低,请升级或更换SVN客户端";
$lang->repo->error->encoding = "编码可能错误,请更换编码重试。";
$lang->repo->error->deleted = "删除版本库失败,当前版本库有提交记录与设计关联";
$lang->repo->error->linkedJob = "删除版本库失败,当前版本库与构建有关联,请取消关联或删除构建。";
$lang->repo->error->clientPath = "客户端安装目录不能有空格!";
$lang->repo->syncTips = '请参照<a target="_blank" href="https://www.zentao.net/book/zentaopmshelp/207.html">这里</a>,设置版本库定时同步。';
+2 -1
View File
@@ -43,7 +43,7 @@ $lang->repo->line = '行';
$lang->repo->expand = '點擊展開';
$lang->repo->collapse = '點擊摺疊';
$lang->repo->id = '編號';
$lang->repo->id = 'ID';
$lang->repo->SCM = '類型';
$lang->repo->name = '名稱';
$lang->repo->path = '地址';
@@ -172,6 +172,7 @@ $lang->repo->error->output = "執行命令:%s\n錯誤結果(%s): %s\n
$lang->repo->error->clientVersion = "客戶端版本過低,請升級或更換SVN客戶端";
$lang->repo->error->encoding = "編碼可能錯誤,請更換編碼重試。";
$lang->repo->error->deleted = "刪除版本庫失敗,當前版本庫有提交記錄與設計關聯";
$lang->repo->error->linkedJob = "刪除版本庫失敗,當前版本庫與構建有關聯,請取消關聯或刪除構建。";
$lang->repo->error->clientPath = "客戶端安裝目錄不能有空格!";
$lang->repo->syncTips = '請參照<a target="_blank" href="https://www.zentao.net/book/zentaopmshelp/207.html">這裡</a>,設置版本庫定時同步。';
+16
View File
@@ -596,6 +596,22 @@ class repoModel extends model
return $cachePath . '/' . $repoID . '-' . md5("{$this->cookie->repoBranch}-$path-$revision");
}
/**
* Get products by repoID.
*
* @param int $repoID
* @access public
* @return array
*/
public function getProductsByRepo($repoID)
{
$repo = $this->getRepoByID($repoID);
return $this->dao->select('id,name')->from(TABLE_PRODUCT)
->where('id')->in($repo->product)
->andWhere('deleted')->eq(0)
->fetchPairs();
}
/**
* Save commit.
*
+2 -1
View File
@@ -30,8 +30,9 @@
<?php
foreach($branches as $id => $branchName)
{
$isSelected = $id == $branchID ? 'class="selected"' : '';
$base64BranchID = base64_encode($id);
echo "<li>" . html::a($this->createLink('repo', 'browse', "repoID=$repoID&branchID=$base64BranchID&objectID=$objectID"), $branchName, '', "title='{$branchName}' class='text-ellipsis' data-app='{$app->openApp}'") . "</li>";
echo "<li $isSelected>" . html::a($this->createLink('repo', 'browse', "repoID=$repoID&branchID=$base64BranchID&objectID=$objectID"), $branchName, '', "title='{$branchName}' class='text-ellipsis' data-app='{$app->openApp}'") . "</li>";
}
?>
</ul>
+1 -1
View File
@@ -2709,7 +2709,7 @@ class storyModel extends model
->beginIF($type != 'closedBy' and $this->app->moduleName == 'block')->andWhere('t1.status')->ne('closed')->fi()
->beginIF($type != 'all')
->beginIF($type == 'assignedTo')->andWhere('assignedTo')->eq($account)->fi()
->beginIF($type == 'reviewBy')->andWhere('t3.reviewer')->eq($account)->andWhere('t3.result')->eq('')->fi()
->beginIF($type == 'reviewBy')->andWhere('t3.reviewer')->eq($account)->andWhere('t3.result')->eq('')->andWhere('t1.status')->in('draft,changed')->fi()
->beginIF($type == 'openedBy')->andWhere('openedBy')->eq($account)->fi()
->beginIF($type == 'reviewedBy')->andWhere("CONCAT(',', reviewedBy, ',')")->like("%,$account,%")->fi()
->beginIF($type == 'closedBy')->andWhere('closedBy')->eq($account)->fi()
+1 -1
View File
@@ -1476,7 +1476,7 @@ class testcaseModel extends model
break;
case 'title':
if($case->branch) echo "<span class='label label-info label-outline'>{$branches[$case->branch]}</span> ";
if($modulePairs and $case->module) echo "<span class='label label-gray label-badge'>{$modulePairs[$case->module]}</span> ";
if($modulePairs and $case->module and isset($modulePairs[$case->module])) echo "<span class='label label-gray label-badge'>{$modulePairs[$case->module]}</span> ";
echo $canView ? ($fromCaseID ? html::a($caseLink, $case->title, null, "style='color: $case->color' data-app='{$this->app->openApp}'") . html::a(helper::createLink('testcase', 'view', "caseID=$fromCaseID"), "[<i class='icon icon-share' title='{$this->lang->testcase->fromCase}'></i>#$fromCaseID]", '', "data-app='{$this->app->openApp}'") : html::a($caseLink, $case->title, null, "style='color: $case->color' data-app='{$this->app->openApp}'")) : "<span style='color: $case->color'>$case->title</span>";
break;
case 'branch':
+4
View File
@@ -62,6 +62,10 @@ class testtask extends control
if(empty($products) and !helper::isAjaxRequest()) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$openApp&activeMenu=testtask&objectID=$objectID")));
}
else
{
$products = $this->product->getPairs();
}
$this->view->products = $this->products = $products;
}