Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
ALTER TABLE `zt_job`
|
||||
ADD `engine` varchar(20) NOT NULL AFTER `frame`,
|
||||
CHANGE `jkHost` `server` mediumint(0) UNSIGNED NOT NULL AFTER `frame`,
|
||||
CHANGE `jkJob` `pipeline` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER `server`;
|
||||
|
||||
@@ -3,11 +3,12 @@ $lang->compile->common = '构建';
|
||||
$lang->compile->browse = '构建历史';
|
||||
$lang->compile->logs = '构建日志';
|
||||
|
||||
$lang->compile->id = 'ID';
|
||||
$lang->compile->name = '构建名称';
|
||||
$lang->compile->status = '构建状态';
|
||||
$lang->compile->time = '构建时间';
|
||||
$lang->compile->result = '构建结果';
|
||||
$lang->compile->id = 'ID';
|
||||
$lang->compile->name = '构建名称';
|
||||
$lang->compile->buildType = '构建引擎';
|
||||
$lang->compile->status = '构建状态';
|
||||
$lang->compile->time = '构建时间';
|
||||
$lang->compile->result = '构建结果';
|
||||
|
||||
$lang->compile->statusList['success'] = '成功';
|
||||
$lang->compile->statusList['failure'] = '失败';
|
||||
|
||||
@@ -34,7 +34,7 @@ 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.pipeline,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, t2.engine, 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.server=t4.id')
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
<?php $vars = "jobID={$jobID}&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
|
||||
<th class='w-60px'><?php common::printOrderLink('id', $orderBy, $vars, $lang->compile->id);?></th>
|
||||
<th class='text-left'><?php common::printOrderLink('name', $orderBy, $vars, $lang->compile->name);?></th>
|
||||
<th class='w-150px text-left'><?php echo $lang->compile->buildType;?></th>
|
||||
<th class='w-150px text-left'><?php echo $lang->job->repo;?></th>
|
||||
<th class='w-250px text-left'><?php echo $lang->job->jenkins;?></th>
|
||||
<th class='text-left'><?php echo $lang->job->triggerType;?></th>
|
||||
<th class='w-80px text-center'><?php common::printOrderLink('status', $orderBy, $vars, $lang->compile->status);?></th>
|
||||
<th class='w-130px text-center'><?php common::printOrderLink('createdDate', $orderBy, $vars, $lang->compile->time);?></th>
|
||||
@@ -41,9 +41,9 @@
|
||||
<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 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;?>
|
||||
<td title='<?php echo $jenkins; ?>'><?php echo $jenkins; ?></td>
|
||||
<?php $triggerConfig = $this->loadModel('job')->getTriggerConfig($build);?>
|
||||
<td title='<?php echo $triggerConfig;?>'><?php echo $triggerConfig;?></td>
|
||||
<?php $buildStatus = zget($lang->compile->statusList, $build->status);?>
|
||||
|
||||
@@ -18,9 +18,14 @@
|
||||
#sidebar {width: 275px;}
|
||||
#sidebar>.cell {width: 100%;}
|
||||
#sidebar>.sidebar-toggle {left: 3px; right: auto;}
|
||||
#title {font-size: 15px; font-weight: 600;}
|
||||
#project, #product, #custom, #book {min-height: 160px;}
|
||||
#title .menu-title {font-size: 15px; font-weight: 600; position: relative; padding: 2px 0 2px 15px;list-style: none;}
|
||||
#title .dropdown-menu-book {left: -67px; top: 38px;}
|
||||
#title .dropdown-menu-doc {left: -80px; top: 38px;}
|
||||
.hide-sidebar #sidebar>.cell {left: -270px;}
|
||||
.hide-sidebar #sidebar>.sidebar-toggle>.icon:before {content: "\e314";}
|
||||
.detail.empty {line-height: 200px;}
|
||||
.main-col+.side-col {padding-left: 16px;}
|
||||
.main-col iframe {min-height: 380px;}
|
||||
.menu-actions {position: absolute; top: 0; right: 0; padding: 7px 8px;}
|
||||
.menu-actions i {font-size: 15px; color: #8c8c8c;}
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
$(function()
|
||||
{
|
||||
if($.cookie('isFullScreen') == 1) fullScreen();
|
||||
})
|
||||
|
||||
/**
|
||||
* Ajax delete doc.
|
||||
*
|
||||
@@ -45,25 +50,32 @@ function fullScreen()
|
||||
{
|
||||
$('#content .actions').addClass('hidden');
|
||||
requestMethod.call(element);
|
||||
$.cookie('isFullScreen', 1);
|
||||
}
|
||||
}
|
||||
|
||||
function exitFullScreen()
|
||||
{
|
||||
$('#content .actions').removeClass('hidden');
|
||||
$.cookie('isFullScreen', 0);
|
||||
}
|
||||
|
||||
document.addEventListener("fullscreenchange", function (e)
|
||||
{
|
||||
if(!document.fullscreenElement) $('#content .actions').removeClass('hidden');
|
||||
if(!document.fullscreenElement) exitFullScreen();
|
||||
})
|
||||
|
||||
document.addEventListener("webkitfullscreenchange", function (e)
|
||||
{
|
||||
if(!document.webkitFullscreenElement) $('#content .actions').removeClass('hidden');
|
||||
if(!document.webkitFullscreenElement) exitFullScreen();
|
||||
})
|
||||
|
||||
document.addEventListener("mozfullscreenchange", function (e)
|
||||
{
|
||||
if(!document.mozFullScreenElement) $('#content .actions').removeClass('hidden');
|
||||
if(!document.mozFullScreenElement) exitFullScreen();
|
||||
})
|
||||
|
||||
document.addEventListener("msfullscreenChange", function (e)
|
||||
{
|
||||
if(!document.msfullscreenElement) $('#content .actions').removeClass('hidden');
|
||||
if(!document.msfullscreenElement) exitFullScreen();
|
||||
})
|
||||
|
||||
+31
-8
@@ -1823,19 +1823,43 @@ class docModel extends model
|
||||
{
|
||||
if($type != 'custom' and $type != 'book' and empty($objects)) return '';
|
||||
|
||||
$output = '';
|
||||
$output = '';
|
||||
$closedProjectsHtml = '';
|
||||
$clseedProjects = array();
|
||||
$maxHeight = ($type == 'project' and $this->app->openApp == 'doc') ? '260px' : '290px';
|
||||
$class = ($type == 'project' and $this->app->openApp == 'doc') ? 'col-left' : '';
|
||||
|
||||
if($this->app->openApp == 'doc' and $type != 'custom' and $type != 'book')
|
||||
{
|
||||
$output = "<div class='btn-group angle-btn'><div class='btn-group'><button data-toggle='dropdown' type='button' class='btn btn-limit' id='currentItem' title='{$objects[$objectID]}'><span class='text'>{$objects[$objectID]}</span> <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList'>";
|
||||
$output .= '<div class="input-control search-box has-icon-left has-icon-right search-example"><input type="search" class="form-control search-input" /><label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label><a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a></div>';
|
||||
$output .= "<div class='table-col'><div class='list-group'>";
|
||||
$output = "<div class='btn-group angle-btn'><div class='btn-group'><button data-toggle='dropdown' type='button' class='btn btn-limit' id='currentItem' title='{$objects[$objectID]}'><span class='text'>{$objects[$objectID]}</span> <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list load-indicator' data-ride='searchList'>";
|
||||
$output .= '<div class="input-control search-box has-icon-left has-icon-right search-example"><input type="search" class="form-control search-input"/><label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label><a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a></div>';
|
||||
$output .= "<div class='list-group'><div class='table-row'><div class='table-col $class'><div class='list-group' style='max-height: $maxHeight'>";
|
||||
if($type == 'project' and $this->app->openApp == 'doc')
|
||||
{
|
||||
$clseedProjects = $this->dao->select('id,name')->from(TABLE_PROJECT)->where('id')->in(array_keys($objects))->andWhere('status')->eq('closed')->fetchPairs();
|
||||
}
|
||||
|
||||
foreach($objects as $key => $object)
|
||||
{
|
||||
$selected = $key == $objectID ? 'selected' : '';
|
||||
$output .= html::a(inlink('objectLibs', "type=$type&objectID=$key"), $object, '', "class='$selected' data-app='{$this->app->openApp}'");
|
||||
if(isset($clseedProjects[$key]))
|
||||
{
|
||||
$closedProjectsHtml .= html::a(inlink('objectLibs', "type=$type&objectID=$key"), $object, '', "class='$selected' data-app='{$this->app->openApp}'");
|
||||
if($selected == 'selected') $tabActive = 'closed';
|
||||
}
|
||||
else
|
||||
{
|
||||
$output .= html::a(inlink('objectLibs', "type=$type&objectID=$key"), $object, '', "class='$selected' data-app='{$this->app->openApp}'");
|
||||
}
|
||||
}
|
||||
if($type == 'project' and $this->app->openApp == 'doc')
|
||||
{
|
||||
$output .= "</div><div class='col-footer'><a class='pull-right toggle-right-col not-list-item'>{$this->lang->project->doneProjects}<i class='icon icon-angle-right'></i></a></div></div><div class='table-col col-right'> <div class='list-group'>$closedProjectsHtml</div></div></div></div></div></div></div>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$output .= "</div></div></div></div></div></div></div>";
|
||||
}
|
||||
$output .= "</div></div></div></div></div>";
|
||||
}
|
||||
|
||||
if(!empty($libs))
|
||||
@@ -1908,8 +1932,7 @@ class docModel extends model
|
||||
|
||||
if(empty($treeMenu)) return '';
|
||||
|
||||
$menu = "<ul class='tree' id='title'><li>{$this->lang->doc->menuTitle}</li></ul>";
|
||||
$menu .= "<ul id='modules' class='tree' data-ride='tree' data-name='tree-lib'>" . $treeMenu[0] . '</ul>';
|
||||
$menu = "<ul id='modules' class='tree' data-ride='tree' data-name='tree-lib'>" . $treeMenu[0] . '</ul>';
|
||||
return $menu;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,40 @@ $sideWidth = common::checkNotCN() ? '270' : '238';
|
||||
?>
|
||||
<div class="side-col" style="width:<?php echo $sideWidth;?>px" data-min-width="<?php echo $sideWidth;?>">
|
||||
<div class="cell" id="<?php echo $type;?>">
|
||||
<div id='title'>
|
||||
<li class='menu-title'><?php echo $this->lang->doc->menuTitle;?></li>
|
||||
<?php
|
||||
$canEditLib = common::hasPriv('doc', 'editLib');
|
||||
$canManageBook = common::hasPriv('doc', 'manageBook');
|
||||
$canManageMenu = common::hasPriv('tree', 'browse');
|
||||
$canEditLib = common::hasPriv('doc', 'editLib');
|
||||
$canDeleteLib = common::hasPriv('doc', 'deleteLib');
|
||||
if($type != 'book' and ($canManageMenu or $canEditLib or $canDeleteLib))
|
||||
{
|
||||
echo "<div class='menu-actions'>";
|
||||
echo html::a('javascript:;', "<i class='icon icon-ellipsis-v'></i>", '', "data-toggle='dropdown' class='btn btn-link'");
|
||||
echo "<ul class='dropdown-menu dropdown-menu-doc pull-left'>";
|
||||
if($canManageMenu)
|
||||
{
|
||||
echo '<li>' . html::a($this->createLink('tree', 'browse', "rootID=$libID&view=doc", '', true), '<i class="icon-cog-outline"></i> ' . $this->lang->doc->manageType, '', "class='iframe'") . '</li>';
|
||||
echo "<li class='divider'></li>";
|
||||
}
|
||||
if($canEditLib) echo '<li>' . html::a($this->createLink('doc', 'editLib', "rootID=$libID"), '<i class="icon-edit"></i> ' . $lang->doc->editLib, '', "class='iframe'") . '</li>';
|
||||
if($canDeleteLib) echo '<li>' . html::a($this->createLink('doc', 'deleteLib', "rootID=$libID"), '<i class="icon-trash"></i> ' . $lang->doc->deleteLib, 'hiddenwin') . '</li>';
|
||||
echo '</ul></div>';
|
||||
}
|
||||
|
||||
if($type == 'book' and ($canEditLib or $canManageBook))
|
||||
{
|
||||
echo "<div class='menu-actions'>";
|
||||
echo html::a('javascript:;', "<i class='icon icon-ellipsis-v'></i>", '', "data-toggle='dropdown' class='btn btn-link'");
|
||||
echo "<ul class='dropdown-menu dropdown-menu-book pull-left'>";
|
||||
if($canEditLib) echo '<li>' . html::a($this->createLink('doc', 'editLib', "rootID=$libID"), '<i class="icon-edit"></i> ' . $lang->doc->editBook, '', "class='iframe'") . '</li>';
|
||||
if($canManageBook) echo '<li>' . html::a($this->createLink('doc', 'manageBook', "bookID=$libID"), '<i class="icon-cog-outline"></i> ' . $lang->doc->manageBook) . '</li>';
|
||||
echo '</ul></div>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php if(!$moduleTree):?>
|
||||
<hr class="space">
|
||||
<div class="text-center text-muted tips">
|
||||
@@ -28,22 +62,6 @@ $sideWidth = common::checkNotCN() ? '270' : '238';
|
||||
<?php else:?>
|
||||
<?php echo $moduleTree;?>
|
||||
<?php endif;?>
|
||||
<div class="text-center action">
|
||||
<?php
|
||||
if($type == 'book')
|
||||
{
|
||||
common::printLink('doc', 'editLib', "rootID=$libID", $lang->doc->editBook, '', "class='btn btn-info btn-wide iframe'", '', true);
|
||||
common::printLink('doc', 'manageBook', "bookID=$libID", $lang->doc->manageBook, '', "class='btn btn-info btn-wide'");
|
||||
}
|
||||
else
|
||||
{
|
||||
common::printLink('tree', 'browse', "rootID=$libID&view=doc", $lang->doc->manageType, '', "class='btn btn-info btn-wide iframe'", '', true);
|
||||
common::printLink('doc', 'editLib', "rootID=$libID", $lang->doc->editLib, '', "class='btn btn-info btn-wide iframe'", '', true);
|
||||
common::printLink('doc', 'deleteLib', "rootID=$libID", $lang->doc->deleteLib, 'hiddenwin', "class='btn btn-info btn-wide'");
|
||||
}
|
||||
?>
|
||||
<hr class="space-sm" />
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function()
|
||||
|
||||
@@ -0,0 +1,213 @@
|
||||
<?php
|
||||
/**
|
||||
* The model file of pipeline module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Chenqi <chenqi@cnezsoft.com>
|
||||
* @package product
|
||||
* @version $Id: $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
|
||||
class gitlabpipelineModel extends model
|
||||
{
|
||||
/**
|
||||
* Get single pipline by api.
|
||||
*
|
||||
* @param integer $projectID
|
||||
* @param integer $pipelineID
|
||||
* @access public
|
||||
* @return object
|
||||
* @docment https://docs.gitlab.com/ee/api/pipelines.html#get-a-single-pipeline
|
||||
*/
|
||||
|
||||
public function apiGetPiplineByID($projectID, $pipelineID)
|
||||
{
|
||||
//Priv 1
|
||||
$url = sprintf($this->loadModel('gitlab')->getApiRoot($gitlabID), "/projects/{$projectID}/pipelines/{$piplinesID}");
|
||||
return json_decode(commonModel::http($url));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get piplines list by api.
|
||||
*
|
||||
* @param integer $projectID
|
||||
* @access public
|
||||
* @return object
|
||||
* @docment https://docs.gitlab.com/ee/api/pipelines.html#list-project-pipelines
|
||||
*/
|
||||
|
||||
public function apiGetPiplines($projectID)
|
||||
{
|
||||
//Later
|
||||
$url = sprintf($this->loadModel('gitlab')->getApiRoot($gitlabID), "/projects/{$projectID}/pipelines");
|
||||
return json_decode(commonModel::http($url));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a pipeline’s report by api.
|
||||
*
|
||||
* @param integer $projectID
|
||||
* @param integer $pipelineID
|
||||
* @access public
|
||||
* @return object
|
||||
* @docment https://docs.gitlab.com/ee/api/pipelines.html#get-a-pipelines-test-report
|
||||
*/
|
||||
public function apiGetPiplineReport($projectID, $pipelineID)
|
||||
{
|
||||
//Later
|
||||
$url = sprintf($this->loadModel('gitlab')->getApiRoot($gitlabID), "/projects/{$projectID}/pipelines/{$pipelineID}/test_report");
|
||||
return json_decode(commonModel::http($url));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new pipeline by api.
|
||||
*
|
||||
* @param integer $projectID
|
||||
* @param string $reference
|
||||
* @access public
|
||||
* @return object
|
||||
* @docment https://docs.gitlab.com/ee/api/pipelines.html#create-a-new-pipeline
|
||||
*/
|
||||
public function apiCreatePipeline($projectID, $reference)
|
||||
{
|
||||
//Priv 1
|
||||
$url = sprintf($this->loadModel('gitlab')->getApiRoot($gitlabID), "/projects/{$projectID}/pipeline");
|
||||
return json_decode(commonModel::http($url, $reference));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retry jobs in a pipeline by api.
|
||||
*
|
||||
* @param integer $projectID
|
||||
* @param integer $pipelineID
|
||||
* @return object
|
||||
* @docment https://docs.gitlab.com/ee/api/pipelines.html#retry-jobs-in-a-pipeline
|
||||
*/
|
||||
public function apiRetryPipeline($projectID, $pipelineID)
|
||||
{
|
||||
//Priv 2
|
||||
$url = sprintf($this->loadModel('gitlab')->getApiRoot($gitlabID), "/projects/{$projectID}/pipelines/{$piplineID}/retry");
|
||||
return json_decode(commonModel::http($url));
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel a pipeline’s jobs by api.
|
||||
*
|
||||
* @param integer $projectID
|
||||
* @param integer $pipelineID
|
||||
* @return object
|
||||
* @docment https://docs.gitlab.com/ee/api/pipelines.html#cancel-a-pipelines-jobs
|
||||
*/
|
||||
public function apiPipelineCancel($projectID, $piplineID)
|
||||
{
|
||||
//Priv 1
|
||||
$url = sprintf($this->loadModel('gitlab')->getApiRoot($gitlabID), "/projects/{$projectID}/pipelines/{$pipelineID}/cancel");
|
||||
return json_decode(commonModel::http($url));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a pipeline-·· by api.
|
||||
*
|
||||
* @param integer $projectID
|
||||
* @param integer $pipelineID
|
||||
* @return object
|
||||
* @docment https://docs.gitlab.com/ee/api/pipelines.html#delete-a-pipeline
|
||||
*/
|
||||
public function apiDeletePipeline($projectID, $piplineID)
|
||||
{
|
||||
//Later
|
||||
$url = sprintf($this->loadModel('gitlab')->getApiRoot($gitlabID), "/projects/{$projectID}/pipelines/{$piplineID}");
|
||||
return json_decode(commonModel::http($url, null, array(CURLOPT_CUSTOMREQUEST => 'DELETE')));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all pipeline schedules by api.
|
||||
*
|
||||
* @param integer $projectID
|
||||
* @return object
|
||||
* @docment https://docs.gitlab.com/ee/api/pipeline_schedules.html#get-all-pipeline-schedules
|
||||
*/
|
||||
public function apiGetPiplineSchedules($projectID)
|
||||
{
|
||||
//Later
|
||||
$url = sprintf($this->loadModel('gitlab')->getApiRoot($gitlabID), "/projects/{$projectID}/pipeline_schedules");
|
||||
return json_decode(commonModel::http($url));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a pipeline schedule by api.
|
||||
*
|
||||
* @param integer $projectID
|
||||
* @param integer $pipelineScheduleID
|
||||
* @return object
|
||||
* @docment https://docs.gitlab.com/ee/api/pipeline_schedules.html#delete-a-pipeline-schedule
|
||||
*/
|
||||
public function apiDeletePiplineSchedules($projectID, $pipelineScheduleID)
|
||||
{
|
||||
//Later
|
||||
$url = sprintf($this->loadModel('gitlab')->getApiRoot($gitlabID), "/projects/{$projectID}/pipeline_schedules/{$pipelineScheduleID}/play");
|
||||
return json_decode(commonModel::http($url, null, array(CURLOPT_CUSTOMREQUEST => 'DELETE')));
|
||||
}
|
||||
|
||||
/**
|
||||
* Run a scheduled pipeline immediately by api.
|
||||
*
|
||||
* @param integer $projectID
|
||||
* @param integer $pipelineScheduleID
|
||||
* @return object
|
||||
* @docment https://docs.gitlab.com/ee/api/pipeline_schedules.html#run-a-scheduled-pipeline-immediately
|
||||
*/
|
||||
public function apiRunPiplineSchedule()
|
||||
{
|
||||
//Later
|
||||
$url = sprintf($this->loadModel('gitlab')->getApiRoot($gitlabID), "/projects/{$projectID}/jobs/{$jobID}/trace");
|
||||
return json_decode(commonModel::http($url));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a log file by api.
|
||||
*
|
||||
* @param integer $projectID
|
||||
* @param integer $jobID
|
||||
* @return object
|
||||
* @docment https://docs.gitlab.com/ee/api/jobs.html#get-a-log-file
|
||||
*/
|
||||
public function apiPipelineGetlog($projectID, $jobID)
|
||||
{
|
||||
//Priv 2
|
||||
$url = sprintf($this->loadModel('gitlab')->getApiRoot($gitlabID), "/projects/{$projectID}/jobs/{$jobID}/trace");
|
||||
return json_decode(commonModel::http($url));
|
||||
}
|
||||
|
||||
/**
|
||||
* List pipeline jobs by api.
|
||||
*
|
||||
* @param integer $projectID
|
||||
* @param integer $pipelineID
|
||||
* @return object
|
||||
* @docment https://docs.gitlab.com/ee/api/jobs.html#list-pipeline-jobs
|
||||
*/
|
||||
public function apiGetPipelineJobs($projectID, $pipelineID)
|
||||
{
|
||||
//Priv 2
|
||||
$url = sprintf($this->loadModel('gitlab')->getApiRoot($gitlabID), "/projects/{$projectID}/pipelines/{$pipelineID}/jobs");
|
||||
return json_decode(commonModel::http($url));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a single job by api.
|
||||
*
|
||||
* @param integer $projectID
|
||||
* @param integer $jobID
|
||||
* @return object
|
||||
* @docment https://docs.gitlab.com/ee/api/jobs.html#get-a-single-job
|
||||
*/
|
||||
public function apiGetSingleJob($projectID, $jobID)
|
||||
{
|
||||
//Priv 2
|
||||
$url = sprintf($this->loadModel('gitlab')->getApiRoot($gitlabID), "/projects/{$projectID}/jobs/{$jobID}");
|
||||
return json_decode(commonModel::http($url));
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->job->frame; ?></th>
|
||||
<td><?php echo html::select('frame', $lang->job->frameList, '', "class='form-control chosen'"); ?></td>
|
||||
</tr>
|
||||
|
||||
@@ -158,6 +158,9 @@
|
||||
<?php if($type != 'openedBy'): ?>
|
||||
<td class='c-user'><?php echo zget($users, $child->openedBy);?></td>
|
||||
<?php endif;?>
|
||||
<?php if($app->rawMethod == 'work'):?>
|
||||
<td class="text-center <?php echo isset($child->delay) ? 'delayed' : '';?>"><?php if(substr($child->deadline, 0, 4) > 0) echo substr($child->deadline, 5, 6);?></td>
|
||||
<?php endif;?>
|
||||
<?php if($type != 'assignedTo'): ?>
|
||||
<td class="c-assignedTo has-btn"> <?php $this->task->printAssignedHtml($child, $users);?></td>
|
||||
<?php endif;?>
|
||||
|
||||
@@ -1463,6 +1463,15 @@ class productModel extends model
|
||||
->groupBy('product')
|
||||
->fetchPairs();
|
||||
|
||||
$fixedBugs = $this->dao->select('product,count(*) AS count')
|
||||
->from(TABLE_BUG)
|
||||
->where('deleted')->eq(0)
|
||||
->andwhere('status')->eq('closed')
|
||||
->andWhere('product')->in($productKeys)
|
||||
->andWhere('resolution')->eq('fixed')
|
||||
->groupBy('product')
|
||||
->fetchPairs();
|
||||
|
||||
$closedBugs = $this->dao->select('product,count(*) AS count')
|
||||
->from(TABLE_BUG)
|
||||
->where('deleted')->eq(0)
|
||||
@@ -1502,6 +1511,7 @@ class productModel extends model
|
||||
$product->bugs = isset($bugs[$product->id]) ? $bugs[$product->id] : 0;
|
||||
$product->unResolved = isset($unResolved[$product->id]) ? $unResolved[$product->id] : 0;
|
||||
$product->closedBugs = isset($closedBugs[$product->id]) ? $closedBugs[$product->id] : 0;
|
||||
$product->fixedBugs = isset($fixedBugs[$product->id]) ? $fixedBugs[$product->id] : 0;
|
||||
$product->assignToNull = isset($assignToNull[$product->id]) ? $assignToNull[$product->id] : 0;
|
||||
$stats[] = $product;
|
||||
}
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
<?php $recTotalLabel = $browseType == $key ? " <span class='label label-light label-badge'>{$recTotal}</span>" : '';?>
|
||||
<?php echo html::a(inlink("all", "browseType=$key&orderBy=$orderBy"), "<span class='text'>{$label}</span>" . $recTotalLabel, '', "class='btn btn-link' id='{$key}Tab'");?>
|
||||
<?php endforeach;?>
|
||||
<?php common::printLink('product', 'manageLine', '', $lang->product->line, '', 'class="btn btn-link"');?>
|
||||
</div>
|
||||
<div class="btn-toolbar pull-right">
|
||||
<?php common::printLink('product', 'manageLine', '', "<i class='icon-edit'></i> " . $lang->product->line, '', 'class="btn btn-link"');?>
|
||||
<?php common::printLink('product', 'create', '', '<i class="icon icon-plus"></i>' . $lang->product->create, '', 'class="btn btn-primary"');?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -48,24 +48,25 @@
|
||||
<th class="w-300px" colspan="4"><?php echo $lang->story->requirement;?></th>
|
||||
<?php endif;?>
|
||||
<th class="w-300px" colspan="4"><?php echo $lang->story->story;?></th>
|
||||
<th class="w-150px" colspan="2"><?php echo $lang->bug->common;?></th>
|
||||
<th class="w-80px" rowspan="2"><?php echo $lang->product->release;?></th>
|
||||
<th class="w-200px" colspan="3"><?php echo $lang->bug->common;?></th>
|
||||
<th class="w-80px" rowspan="2"><?php echo $lang->product->plan;?></th>
|
||||
<th class="w-80px" rowspan="2"><?php echo $lang->product->release;?></th>
|
||||
<th class='c-actions w-70px' rowspan="2"><?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
<tr class="text-center">
|
||||
<?php if($this->config->URAndSR):?>
|
||||
<th style="border-left: 1px solid #ddd;"><?php echo $lang->story->activate;?></th>
|
||||
<th><?php echo $lang->story->close;?></th>
|
||||
<th><?php echo $lang->story->draft;?></th>
|
||||
<th style="border-left: 1px solid #ddd;"><?php echo $lang->story->draft;?></th>
|
||||
<th><?php echo $lang->story->activate;?></th>
|
||||
<th><?php echo $lang->story->change;?></th>
|
||||
<th><?php echo $lang->story->completeRate;?></th>
|
||||
<?php endif;?>
|
||||
<th style="border-left: 1px solid #ddd;"><?php echo $lang->story->activate;?></th>
|
||||
<th><?php echo $lang->story->close;?></th>
|
||||
<th><?php echo $lang->story->draft;?></th>
|
||||
<th style="border-left: 1px solid #ddd;"><?php echo $lang->story->draft;?></th>
|
||||
<th><?php echo $lang->story->activate;?></th>
|
||||
<th><?php echo $lang->story->change;?></th>
|
||||
<th><?php echo $lang->story->completeRate;?></th>
|
||||
<th style="border-left: 1px solid #ddd;"><?php echo $lang->bug->activate;?></th>
|
||||
<th><?php echo $lang->close;?></th>
|
||||
<th><?php echo $lang->bug->repairRate;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="productTableList">
|
||||
@@ -78,7 +79,7 @@
|
||||
?>
|
||||
<?php if(isset($program['programName']) and $config->systemMode == 'new'):?>
|
||||
<tr <?php echo $trAttrs;?>>
|
||||
<td colspan="<?php echo $this->config->URAndSR ? 14 : 10;?>">
|
||||
<td colspan="<?php echo $this->config->URAndSR ? 15 : 11;?>">
|
||||
<span class="table-nest-icon icon table-nest-toggle"></span>
|
||||
<?php echo $program['programName']?>
|
||||
</td>
|
||||
@@ -104,7 +105,7 @@
|
||||
}
|
||||
?>
|
||||
<tr <?php echo $trAttrs;?>>
|
||||
<td colspan="<?php echo $this->config->URAndSR ? 14 : 10;?>">
|
||||
<td colspan="<?php echo $this->config->URAndSR ? 15 : 11;?>">
|
||||
<span class="table-nest-icon icon table-nest-toggle"></span>
|
||||
<?php echo $line['lineName']?>
|
||||
</td>
|
||||
@@ -149,19 +150,20 @@
|
||||
?>
|
||||
</td>
|
||||
<?php if($this->config->URAndSR):?>
|
||||
<td><?php echo $product->requirements['active'];?></td>
|
||||
<td><?php echo $product->requirements['closed'];?></td>
|
||||
<td><?php echo $product->requirements['draft'];?></td>
|
||||
<td><?php echo $product->requirements['active'];?></td>
|
||||
<td><?php echo $product->requirements['changed'];?></td>
|
||||
<td><?php echo $totalRequirements == 0 ? 0 : round($product->requirements['closed'] / $totalRequirements, 3) * 100;?>%</td>
|
||||
<?php endif;?>
|
||||
<td><?php echo $product->stories['active'];?></td>
|
||||
<td><?php echo $product->stories['closed'];?></td>
|
||||
<td><?php echo $product->stories['draft'];?></td>
|
||||
<td><?php echo $product->stories['active'];?></td>
|
||||
<td><?php echo $product->stories['changed'];?></td>
|
||||
<td><?php echo $totalStories == 0 ? 0 : round($product->stories['closed'] / $totalStories, 3) * 100;?>%</td>
|
||||
<td><?php echo $product->unResolved;?></td>
|
||||
<td><?php echo $product->closedBugs;?></td>
|
||||
<td><?php echo $product->releases;?></td>
|
||||
<td><?php echo ($product->unResolved + $product->fixedBugs) == 0 ? 0 : round($product->fixedBugs / ($product->unResolved + $product->fixedBugs), 3) * 100;?>%</td>
|
||||
<td><?php echo $product->plans;?></td>
|
||||
<td><?php echo $product->releases;?></td>
|
||||
<td class='c-actions sort-handler'>
|
||||
<?php common::printIcon('product', 'edit', "product=$product->id", $product, 'list', 'edit');?>
|
||||
<?php if($canOrder):?>
|
||||
|
||||
@@ -11,12 +11,6 @@
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div class="btn-toolbar pull-left">
|
||||
<?php foreach($lang->product->featureBar['all'] as $key => $label):?>
|
||||
<?php echo html::a(inlink("all", "browseType=$key"), "<span class='text'>{$label}</span>", '', "class='btn btn-link'");?>
|
||||
<?php endforeach;?>
|
||||
<?php common::printLink('product', 'manageLine', '', "<span class='text'>{$lang->product->line}</span>", '', 'class="btn btn-link btn-active-text"');?>
|
||||
</div>
|
||||
<div class="btn-toolbar pull-right">
|
||||
<?php common::printLink('product', 'create', '', '<i class="icon icon-plus"></i>' . $lang->product->create, '', 'class="btn btn-primary"');?>
|
||||
</div>
|
||||
|
||||
@@ -46,8 +46,13 @@
|
||||
|
||||
<tr <?php echo $trAttrs;?>>
|
||||
<td class='c-name text-left <?php if($canOrder) echo 'sort-handler';?>' title='<?php echo $program->name?>'>
|
||||
<?php $class = $program->type == 'program' ? ' table-nest-toggle' : '';?>
|
||||
<span class="table-nest-icon icon icon-<?php echo $program->type;?> <?php echo $class;?>"></span>
|
||||
<?php
|
||||
$icon = '';
|
||||
if($program->type == 'program') $icon = ' icon-program';
|
||||
if($program->type == 'project') $icon = ' icon-common icon-' . (isset($this->config->maxVersion) ? $program->model : $program->type);
|
||||
$class = $program->type == 'program' ? ' table-nest-toggle' : '';
|
||||
?>
|
||||
<span class="table-nest-icon icon <?php echo $class . $icon;?>"></span>
|
||||
<?php if($program->type == 'program'):?>
|
||||
<?php echo html::a($this->createLink('program', 'product', "programID=$program->id"), $program->name);?>
|
||||
<?php else:?>
|
||||
@@ -69,7 +74,11 @@
|
||||
<td class='text-right'><?php echo $program->budget != 0 ? zget($lang->project->currencySymbol, $program->budgetUnit) . ' ' . $programBudget : $lang->project->future;?></td>
|
||||
<td><?php echo $program->begin;?></td>
|
||||
<td><?php echo $program->end == LONG_TIME ? $lang->program->longTime : $program->end;?></td>
|
||||
<td></td>
|
||||
<td>
|
||||
<div class='progress-pie' data-doughnut-size='90' data-color='#00da88' data-value='48' data-width='24' data-height='24' data-back-color='#e8edf3'>
|
||||
<div class='progress-info'><?php echo '48'; ?></div>
|
||||
</div>
|
||||
</td>
|
||||
<td class='c-actions'>
|
||||
<?php if($program->type == 'program'):?>
|
||||
<?php if($program->status == 'wait' || $program->status == 'suspended') common::printIcon('program', 'start', "programID=$program->id", $program, 'list', 'play', '', 'iframe', true, '', $this->lang->program->start);?>
|
||||
@@ -132,7 +141,10 @@
|
||||
#programList > thead > tr > th .table-nest-toggle-global {top: 6px}
|
||||
#programList > thead > tr > th .table-nest-toggle-global:before {color: #a6aab8;}
|
||||
#programTableList > tr:last-child .c-actions .dropdown-menu {top: auto; bottom: 100%; margin-bottom: -5px;}
|
||||
#programTableList .icon-project:before {content: '\e99c'; width: 22px; height: 22px; background: none; color: #16a8f8; top: 0; line-height: 22px; margin-right: 2px; font-size: 14px}
|
||||
#programTableList .icon-common:before {width: 22px; height: 22px; background: none; color: rgb(166, 170, 184); top: 0; line-height: 22px; margin-right: 2px; font-size: 14px}
|
||||
#programTableList .icon-project:before {content: '\e99c';}
|
||||
#programTableList .icon-scrum:before {content: '\e9a2';}
|
||||
#programTableList .icon-waterfall:before {content: '\e9a4';}
|
||||
</style>
|
||||
<?php js::set('originOrders', $originOrders);?>
|
||||
<script>
|
||||
|
||||
Reference in New Issue
Block a user