Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms
This commit is contained in:
@@ -17,16 +17,18 @@ class projectIssueEntry extends entry
|
||||
if(count($idParams) < 2) $this->sendError(400, 'The id of issue is wrong.');
|
||||
|
||||
$type = $idParams[0];
|
||||
$id = $idParams[1];
|
||||
$id = intval($idParams[1]);
|
||||
|
||||
$issue = new stdclass();
|
||||
$issue = new stdclass();
|
||||
switch($type)
|
||||
{
|
||||
case 'story':
|
||||
$this->app->loadLang('story');
|
||||
$storyStatus = array('' => '', 'draft' => 'wait', 'active' => 'active', 'changed' => 'active', 'closed' => 'closed');
|
||||
$storyStatus = array('' => '', 'draft' => 'opened', 'active' => 'opened', 'changed' => 'opened', 'closed' => 'closed');
|
||||
|
||||
$story = $this->dao->select('*')->from(TABLE_STORY)->where('id')->eq($id)->fetch();
|
||||
if(!$story) $this->send404($issueID);
|
||||
|
||||
$issue->id = $issueID;
|
||||
$issue->title = $story->title;
|
||||
$issue->labels = array($this->app->lang->story->common, zget($this->app->lang->story->categoryList, $story->category));
|
||||
@@ -35,17 +37,20 @@ class projectIssueEntry extends entry
|
||||
$issue->openedDate = $story->openedDate;
|
||||
$issue->openedBy = $story->openedBy;
|
||||
$issue->lastEditedDate = $story->lastEditedDate < '1970-01-01 01:01:01' ? $story->openedDate : $story->lastEditedDate;
|
||||
$issue->lastEditedBy = $story->lastEditedDate < '1970-01-01 01:01:01' ? $story->openedBy : $story->lastEditedBy;
|
||||
$issue->status = $storyStatus[$story->status];
|
||||
$issue->url = $this->createLink('story', 'view', "storyID=$id");
|
||||
|
||||
$storySpec = $this->dao->select('*')->from(TABLE_STORYSPEC)->where('story')->eq($id)->andWhere('version')->eq($story->version)->fetch();
|
||||
$storySpec = $this->dao->select('*')->from(TABLE_STORYSPEC)->where('story')->eq($id)->andWhere('version')->eq($story->version)->fetch();
|
||||
$issue->desc = $storySpec->spec;
|
||||
break;
|
||||
case 'bug':
|
||||
$this->app->loadLang('bug');
|
||||
$bugStatus = array('' => '', 'active' => 'active', 'resolved' => 'done', 'closed' => 'closed');
|
||||
$bugStatus = array('' => '', 'active' => 'opened', 'resolved' => 'opened', 'closed' => 'closed');
|
||||
|
||||
$bug = $this->dao->select('*')->from(TABLE_BUG)->where('id')->eq($id)->fetch();
|
||||
if(!$bug) $this->send404($issueID);
|
||||
|
||||
$issue->id = $issueID;
|
||||
$issue->title = $bug->title;
|
||||
$issue->labels = array($this->app->lang->bug->common, zget($this->app->lang->bug->typeList, $bug->type));
|
||||
@@ -54,15 +59,17 @@ class projectIssueEntry extends entry
|
||||
$issue->openedDate = $bug->openedDate;
|
||||
$issue->openedBy = $bug->openedBy;
|
||||
$issue->lastEditedDate = $bug->lastEditedDate < '1970-01-01 01:01:01' ? $bug->openedDate : $bug->lastEditedDate;
|
||||
$issue->lastEditedBy = $bug->lastEditedDate < '1970-01-01 01:01:01' ? $bug->openedBy : $bug->lastEditedBy;
|
||||
$issue->status = $bugStatus[$bug->status];
|
||||
$issue->url = $this->createLink('bug', 'view', "bugID=$id");
|
||||
$issue->desc = $bug->steps;
|
||||
break;
|
||||
case 'task':
|
||||
$this->app->loadLang('task');
|
||||
$taskStatus = array('' => '', 'wait' => 'wait', 'doing' => 'active', 'done' => 'done', 'pause' => 'pause', 'cancel' => 'cancel', 'closed' => 'closed');
|
||||
$taskStatus = array('' => '', 'wait' => 'opened', 'doing' => 'opened', 'done' => 'opened', 'pause' => 'opened', 'cancel' => 'opened', 'closed' => 'closed');
|
||||
|
||||
$task = $this->dao->select('*')->from(TABLE_TASK)->where('id')->eq($id)->fetch();
|
||||
if(!$task) $this->send404($issueID);
|
||||
|
||||
$issue->id = $issueID;
|
||||
$issue->title = $task->name;
|
||||
@@ -72,15 +79,32 @@ class projectIssueEntry extends entry
|
||||
$issue->openedDate = $task->openedDate;
|
||||
$issue->openedBy = $task->openedBy;
|
||||
$issue->lastEditedDate = $task->lastEditedDate < '1970-01-01 01:01:01' ? $task->openedDate : $task->lastEditedDate;
|
||||
$issue->lastEditedBy = $task->lastEditedDate < '1970-01-01 01:01:01' ? $task->openedBy : $task->lastEditedBy;
|
||||
$issue->status = $taskStatus[$task->status];
|
||||
$issue->url = $this->createLink('task', 'view', "taskID=$id");
|
||||
$issue->desc = $task->desc;
|
||||
break;
|
||||
default:
|
||||
$this->send404($issueID);
|
||||
}
|
||||
|
||||
$actions = $this->loadModel('action')->getList($type, $issueID);
|
||||
|
||||
$this->send(200, array('issue' => $this->format($issue, 'openedDate:time,lastEditedDate:time')));
|
||||
}
|
||||
|
||||
/**
|
||||
* Send 404 response.
|
||||
*
|
||||
* @param string $issueID
|
||||
* @access private
|
||||
* @return string
|
||||
*/
|
||||
private function send404($issueID)
|
||||
{
|
||||
$this->sendError(404, 'The issue does not exist.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Create url of issue.
|
||||
*
|
||||
|
||||
@@ -15,59 +15,53 @@ class projectIssuesEntry extends entry
|
||||
|
||||
$taskFields = 'id,status';
|
||||
$taskStatus = array('' => '');
|
||||
$taskStatus['wait'] = 'wait';
|
||||
$taskStatus['active'] = 'doing';
|
||||
$taskStatus['done'] = 'done';
|
||||
$taskStatus['pause'] = 'pause';
|
||||
$taskStatus['cancel'] = 'cancel';
|
||||
$taskStatus['opened'] = 'wait,doing,done,pause';
|
||||
$taskStatus['closed'] = 'closed';
|
||||
|
||||
$storyFields = 'id,status';
|
||||
$storyStatus = array('' => '');
|
||||
$storyStatus['wait'] = 'draft';
|
||||
$storyStatus['active'] = 'active,changed';
|
||||
$storyStatus['done'] = '';
|
||||
$storyStatus['pause'] = '';
|
||||
$storyStatus['cancel'] = '';
|
||||
$storyStatus['opened'] = 'draft,active,changed';
|
||||
$storyStatus['closed'] = 'closed';
|
||||
|
||||
$bugFields = 'id,status';
|
||||
$bugStatus = array('' => '');
|
||||
$bugStatus['wait'] = '';
|
||||
$bugStatus['active'] = 'active';
|
||||
$bugStatus['done'] = 'resolved';
|
||||
$bugStatus['pause'] = '';
|
||||
$bugStatus['cancel'] = '';
|
||||
$bugStatus['opened'] = 'active,resolved';
|
||||
$bugStatus['closed'] = 'closed';
|
||||
|
||||
$productID = (int)$productID;
|
||||
$status = $this->param('status', '');
|
||||
$label = $this->param('label', '');
|
||||
$search = $this->param('search', '');
|
||||
$page = $this->param('page', 0);
|
||||
$page = intval($this->param('page', 1));
|
||||
$limit = $this->param('limit', 20);
|
||||
$order = $this->param('order', 'openedDate_desc');
|
||||
|
||||
$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');
|
||||
|
||||
switch($order)
|
||||
{
|
||||
case 'openedDate':
|
||||
$taskFields .= ',openedDate';
|
||||
$storyFields .= ',openedDate';
|
||||
$bugFields .= ',openedDate';
|
||||
break;
|
||||
case 'title':
|
||||
$taskFields .= ',name as title';
|
||||
$storyFields .= ',title';
|
||||
$bugFields .= ',title';
|
||||
break;
|
||||
case 'lastEditedDate':
|
||||
$taskFields .= ",if(lastEditedDate < '1970-01-01 01-01-01', openedDate, lastEditedDate) as lastEditedDate";
|
||||
$storyFields .= ",if(lastEditedDate < '1970-01-01 01-01-01', openedDate, lastEditedDate) as lastEditedDate";
|
||||
$bugFields .= ",if(lastEditedDate < '1970-01-01 01-01-01', openedDate, lastEditedDate) as lastEditedDate";
|
||||
break;
|
||||
default:
|
||||
$taskFields .= ',openedDate';
|
||||
$storyFields .= ',openedDate';
|
||||
$bugFields .= ',openedDate';
|
||||
|
||||
$order = 'openedDate';
|
||||
$this->sendError(400, 'The order is not supported');
|
||||
}
|
||||
|
||||
$issues = array();
|
||||
@@ -100,10 +94,11 @@ class projectIssuesEntry extends entry
|
||||
}
|
||||
|
||||
array_multisort(array_column($issues, 'order'), $sort == 'asc' ? SORT_ASC : SORT_DESC, $issues);
|
||||
$issues = array_slice($issues, $page * $limit, $limit);
|
||||
$total = count($issues);
|
||||
$issues = $page < 1 ? array() : array_slice($issues, ($page-1) * $limit, $limit);
|
||||
|
||||
$result = $this->processIssues($issues);
|
||||
$this->send(200, array('page' => $page, 'total' => count($issues),'limit' => $limit, 'issues' => $result));
|
||||
$this->send(200, array('page' => $page, 'total' => $total, 'limit' => $limit, 'issues' => $result));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -133,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)
|
||||
@@ -151,7 +146,8 @@ class projectIssuesEntry extends entry
|
||||
$r->openedDate = $task->openedDate;
|
||||
$r->openedBy = $task->openedBy;
|
||||
$r->lastEditedDate = $task->lastEditedDate < '1970-01-01 01:01:01' ? $task->openedDate : $task->lastEditedDate;
|
||||
$r->status = $task->status;
|
||||
$r->lastEditedBy = $task->lastEditedDate < '1970-01-01 01:01:01' ? $task->openedBy : $task->lastEditedBy;
|
||||
$r->status = $issue['status'];
|
||||
$r->url = $this->createLink('task', 'view', "taskID=$task->id");
|
||||
}
|
||||
else if($issue['type'] == 'story')
|
||||
@@ -166,7 +162,8 @@ class projectIssuesEntry extends entry
|
||||
$r->openedDate = $story->openedDate;
|
||||
$r->openedBy = $story->openedBy;
|
||||
$r->lastEditedDate = $story->lastEditedDate < '1970-01-01 01:01:01' ? $story->openedDate : $story->lastEditedDate;
|
||||
$r->status = $story->status;
|
||||
$r->lastEditedBy = $story->lastEditedDate < '1970-01-01 01:01:01' ? $story->openedBy : $story->lastEditedBy;
|
||||
$r->status = $issue['status'];
|
||||
$r->url = $this->createLink('story', 'view', "storyID=$story->id");
|
||||
}
|
||||
else if($issue['type'] == 'bug')
|
||||
@@ -181,7 +178,8 @@ class projectIssuesEntry extends entry
|
||||
$r->openedDate = $bug->openedDate;
|
||||
$r->openedBy = $bug->openedBy;
|
||||
$r->lastEditedDate = $bug->lastEditedDate < '1970-01-01 01:01:01' ? $bug->openedDate : $bug->lastEditedDate;
|
||||
$r->status = $bug->status;
|
||||
$r->lastEditedBy = $bug->lastEditedDate < '1970-01-01 01:01:01' ? $bug->openedBy : $bug->lastEditedBy;
|
||||
$r->status = $issue['status'];
|
||||
$r->url = $this->createLink('bug', 'view', "bugID=$bug->id");
|
||||
}
|
||||
|
||||
@@ -203,7 +201,7 @@ class projectIssuesEntry extends entry
|
||||
{
|
||||
foreach($array as $key => $values)
|
||||
{
|
||||
if($values and strpos($value, $values) !== FALSE) return $key;
|
||||
if($values and strpos($values, $value) !== FALSE) return $key;
|
||||
}
|
||||
|
||||
return '';
|
||||
|
||||
@@ -114,6 +114,7 @@ $filter->svn->cat = new stdclass();
|
||||
$filter->svn->diff = new stdclass();
|
||||
$filter->task->create = new stdclass();
|
||||
$filter->task->export = new stdclass();
|
||||
$filter->execution->story = new stdclass();
|
||||
$filter->testcase->default = new stdclass();
|
||||
$filter->testcase->create = new stdclass();
|
||||
$filter->testcase->browse = new stdclass();
|
||||
|
||||
@@ -169,10 +169,15 @@ class gitlab
|
||||
$list = $this->fetch($api, $params);
|
||||
if(empty($list)) break;
|
||||
|
||||
foreach($list as $branch) $branches[$branch->name] = $branch->name;
|
||||
foreach($list as $branch)
|
||||
{
|
||||
if(!isset($branch->name)) continue;
|
||||
$branches[$branch->name] = $branch->name;
|
||||
}
|
||||
if(count($list) < $params['per_page']) break;
|
||||
}
|
||||
|
||||
if(empty($branches)) $branches['master'] = 'master';
|
||||
asort($branches);
|
||||
return $branches;
|
||||
}
|
||||
|
||||
@@ -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')));
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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,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 = '構建任務';
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
@@ -19,7 +19,11 @@
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if(empty($buildList)):?>
|
||||
<div class="table-empty-tip">
|
||||
<p><span class="text-muted"><?php echo $lang->noData;?></span></p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<div id='mainContent'>
|
||||
<form class='main-table' id='ajaxForm' method='post'>
|
||||
<table id='buildList' class='table has-sort-head table-fixed'>
|
||||
@@ -40,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;?>
|
||||
@@ -67,4 +71,5 @@
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
|
||||
@@ -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.';
|
||||
|
||||
@@ -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跟构建有关联,请取消关联或删除构建。';
|
||||
|
||||
@@ -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跟構建有關聯,請取消關聯或刪除構建。';
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -122,6 +122,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;
|
||||
@@ -129,7 +136,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);
|
||||
|
||||
@@ -272,7 +279,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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -105,10 +116,20 @@ $(document).ready(function()
|
||||
})
|
||||
})
|
||||
|
||||
var scheduleOption = "<option value='schedule'>" + $('#triggerType').find('[value=schedule]').text() + "</option>";
|
||||
$('#engine').change(function()
|
||||
{
|
||||
$('#jenkinsServerTR').toggle($('#engine').val() == 'jenkins');
|
||||
$('#gitlabServerTR').toggle($('#engine').val() == 'gitlab');
|
||||
|
||||
if($(this).val() == 'gitlab')
|
||||
{
|
||||
$('#triggerType').find('[value=schedule]').remove();
|
||||
}
|
||||
else if($('#triggerType').find('[value=schedule]').size() == 0 )
|
||||
{
|
||||
$('#triggerType').append(scheduleOption);
|
||||
}
|
||||
});
|
||||
|
||||
$('#engine').change();
|
||||
|
||||
+22
-1
@@ -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];
|
||||
|
||||
@@ -110,10 +121,20 @@ $(document).ready(function()
|
||||
})
|
||||
})
|
||||
|
||||
var scheduleOption = "<option value='schedule'>" + $('#triggerType').find('[value=schedule]').text() + "</option>";
|
||||
$('#engine').change(function()
|
||||
{
|
||||
{
|
||||
$('#jenkinsServerTR').toggle($('#engine').val() == 'jenkins');
|
||||
$('#gitlabServerTR').toggle($('#engine').val() == 'gitlab');
|
||||
|
||||
if($(this).val() == 'gitlab')
|
||||
{
|
||||
$('#triggerType').find('[value=schedule]').remove();
|
||||
}
|
||||
else if($('#triggerType').find('[value=schedule]').size() == 0 )
|
||||
{
|
||||
$('#triggerType').append(scheduleOption);
|
||||
}
|
||||
});
|
||||
|
||||
$('#engine').change();
|
||||
|
||||
@@ -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.";
|
||||
|
||||
@@ -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设置中指定的值将用作默认值。";
|
||||
|
||||
@@ -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設置中指定的值將用作預設值。";
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -20,6 +20,16 @@
|
||||
<?php if(common::hasPriv('job', 'create')) common::printLink('job', 'create', "", "<i class='icon icon-plus'></i> " . $lang->job->create, '', "class='btn btn-primary'");?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if(empty($jobList)):?>
|
||||
<div class="table-empty-tip">
|
||||
<p>
|
||||
<span class="text-muted"><?php echo $lang->noData;?></span>
|
||||
<?php if(common::hasPriv('job', 'create')):?>
|
||||
<?php echo html::a($this->createLink('job', 'create'), "<i class='icon icon-plus'></i> " . $lang->job->create, '', "class='btn btn-info'");?>
|
||||
<?php endif;?>
|
||||
</p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<div id='mainContent'>
|
||||
<form class='main-table' id='ajaxForm' method='post'>
|
||||
<table id='jobList' class='table has-sort-head table-fixed'>
|
||||
@@ -42,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>
|
||||
@@ -71,4 +81,5 @@
|
||||
<?php endif;?>
|
||||
</form>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -38,11 +38,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="gitlabServerTR">
|
||||
<th></th>
|
||||
<td>
|
||||
<?php echo $lang->job->engineTips->success; ?>
|
||||
<td colspan='2'>
|
||||
<span id="gitlabServerTR"><?php echo $lang->job->engineTips->success;?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -51,7 +48,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>
|
||||
@@ -59,7 +56,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->job->triggerType; ?></th>
|
||||
<td><?php echo html::select('triggerType', $lang->job->triggerTypeList, '', "class='form-control chosen'");?></td>
|
||||
<td><?php echo html::select('triggerType', $lang->job->triggerTypeList, '', "class='form-control'");?></td>
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
<tr id='svnDirBox' class='svn-fields'>
|
||||
@@ -89,12 +86,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>
|
||||
|
||||
@@ -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>
|
||||
@@ -53,7 +53,7 @@
|
||||
<tr>
|
||||
<th><?php echo $lang->job->triggerType;?></th>
|
||||
<?php if($repoType == 'Subversion') $lang->job->triggerTypeList['tag'] = $lang->job->dirChange;?>
|
||||
<td><?php echo html::select('triggerType', $lang->job->triggerTypeList, $job->triggerType, "class='form-control chosen'");?></td>
|
||||
<td><?php echo html::select('triggerType', $lang->job->triggerTypeList, $job->triggerType, "class='form-control'");?></td>
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
<tr id='svnDirBox' class='svn-fields'>
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -17,3 +17,8 @@ $('.ajaxCollect').click(function (event) {
|
||||
}, 'json');
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.ajaxCollect').click(function()
|
||||
{
|
||||
window.location.reload();
|
||||
})
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ $(function()
|
||||
var lastProductSelect = $('#productsBox .input-group:last select:first');
|
||||
if($(lastProductSelect).val() == 0)
|
||||
{
|
||||
var lastProductSelectID = $(lastProductSelect).attr("id");
|
||||
var lastProductSelectID = $(lastProductSelect).attr("id");
|
||||
var lastProductSelectName = $(lastProductSelect).attr("name");
|
||||
$('#' + lastProductSelectID + '_chosen').remove();
|
||||
$(lastProductSelect).replaceWith(data.newProducts);
|
||||
|
||||
+21
-8
@@ -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'");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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: '';}
|
||||
|
||||
@@ -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>';
|
||||
|
||||
@@ -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>,设置版本库定时同步。';
|
||||
|
||||
@@ -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>,設置版本庫定時同步。';
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
<?php
|
||||
foreach($repos as $id => $repoName)
|
||||
{
|
||||
echo "<li>" . html::a($this->createLink('repo', 'browse', "repoID=$id&branchID=&objectID=$objectID"), $repoName, '', "title='{$repoName}' class='text-ellipsis' data-app='{$app->openApp}'") . "</li>";
|
||||
$isSelected = $id == $repoID ? 'class="selected"' : '';
|
||||
echo "<li $isSelected>" . html::a($this->createLink('repo', 'browse', "repoID=$id&branchID=&objectID=$objectID"), $repoName, '', "title='{$repoName}' class='text-ellipsis' data-app='{$app->openApp}'") . "</li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
@@ -29,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>
|
||||
|
||||
@@ -41,7 +41,11 @@
|
||||
$productList = explode(',', str_replace(' ', '', $repo->product));
|
||||
if(isset($productList) and $productList[0])
|
||||
{
|
||||
foreach($productList as $productID) echo ' ' . html::a($this->createLink('product', 'browse', "productID=$productID"), zget($products, $productID, $productID));
|
||||
foreach($productList as $productID)
|
||||
{
|
||||
if(!isset($products[$productID])) continue;
|
||||
echo ' ' . html::a($this->createLink('product', 'browse', "productID=$productID"), zget($products, $productID, $productID));
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
@@ -363,6 +363,7 @@ class storyModel extends model
|
||||
$story->stage = 'projected';
|
||||
$story->openedBy = $this->app->user->account;
|
||||
$story->version = 1;
|
||||
$story->pri = 3;
|
||||
$story->assignedDate = isset($story->assignedTo) ? helper::now() : 0;
|
||||
|
||||
if(isset($story->execution)) unset($story->execution);
|
||||
|
||||
@@ -467,6 +467,7 @@ class taskModel extends model
|
||||
$task->estimate = 0;
|
||||
$task->estStarted = '0000-00-00';
|
||||
$task->left = 1;
|
||||
$task->pri = 3;
|
||||
$task->type = 'devel';
|
||||
|
||||
$this->dao->insert(TABLE_TASK)->data($task, $skip = 'id,product')
|
||||
|
||||
@@ -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':
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user