Merge branch 'master' of http://gitlab.zcorp.cc/easycorp/zentaopms
This commit is contained in:
@@ -206,7 +206,7 @@ class router extends baseRouter
|
||||
if($hourKey == STORYPOINT_KEY) $config->hourUnit = 'sp';
|
||||
if($hourKey == FUNCTIONPOINT_KEY) $config->hourUnit = 'fp';
|
||||
|
||||
$iterationKey = $projectKey;
|
||||
$iterationKey = $projectKey;
|
||||
|
||||
/* Set productCommon, projectCommon and hourCommon. Default english lang. */
|
||||
$lang->productCommon = $this->config->productCommonList[$this->clientLang][PRODUCT_KEY];
|
||||
|
||||
@@ -177,8 +177,7 @@ class html extends baseHTML
|
||||
}
|
||||
}
|
||||
|
||||
$string = '';
|
||||
$string .= "<select name='$name' {$id} $attrib>\n";
|
||||
$string = "<select name='$name' {$id} $attrib>\n";
|
||||
|
||||
/* The options. */
|
||||
if(is_array($selectedItems)) $selectedItems = implode(',', $selectedItems);
|
||||
|
||||
@@ -517,7 +517,7 @@ class gitlab
|
||||
if(!scm::checkRevision($version)) return array();
|
||||
$api = "commits";
|
||||
|
||||
if(empty($count)) $count = 1;
|
||||
if(empty($count)) $count = 100;
|
||||
$params = array();
|
||||
$params['ref_name'] = $branch;
|
||||
$params['per_page'] = $count;
|
||||
@@ -624,6 +624,7 @@ class gitlab
|
||||
if(count($results) < 100) break;
|
||||
}
|
||||
|
||||
$files = array();
|
||||
foreach($allResults as $row)
|
||||
{
|
||||
$file = new stdclass();
|
||||
|
||||
@@ -336,7 +336,7 @@ class backup extends control
|
||||
if($statusFile)
|
||||
{
|
||||
$this->app->loadLang('extension');
|
||||
$this->view->error = sprintf($this->lang->extension->noticeOkFile, preg_replace('/^' . str_replace('/', '\\/', dirname($this->app->getBasePath()) . DS) . '/', '', $statusFile));
|
||||
$this->view->error = sprintf($this->lang->extension->noticeOkFile, str_replace(dirname($this->app->getBasePath()) . DS, '', $statusFile));
|
||||
die($this->display());
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ $lang->typeAB = 'Type';
|
||||
$lang->nameAB = 'Name';
|
||||
|
||||
$lang->common->common = 'Common Module';
|
||||
$lang->my->common = 'Home';
|
||||
$lang->my->common = 'My';
|
||||
$lang->program->common = 'Program';
|
||||
$lang->product->common = 'Product';
|
||||
$lang->project->common = 'Project';
|
||||
@@ -165,7 +165,7 @@ $lang->release->common = 'Release';
|
||||
$lang->message->common = 'Message';
|
||||
$lang->mail->common = 'Mail';
|
||||
|
||||
$lang->my->shortCommon = 'Home';
|
||||
$lang->my->shortCommon = 'My';
|
||||
$lang->testcase->shortCommon = 'Case';
|
||||
$lang->productplan->shortCommon = 'Plan';
|
||||
$lang->score->shortCommon = 'Score';
|
||||
|
||||
@@ -225,8 +225,6 @@ $lang->scrum->menu->settings['subMenu']->group = array('link' => "{$lang->
|
||||
|
||||
/* Execution menu. */
|
||||
$lang->execution->homeMenu = new stdclass();
|
||||
//if($config->systemMode == 'new') $lang->execution->homeMenu->index = "$lang->dashboard|execution|index|";
|
||||
//$lang->execution->homeMenu->list = array('link' => "{$lang->execution->list}|execution|all|", 'alias' => 'create,batchedit');
|
||||
if($config->systemMode == 'new') $lang->execution->homeMenu->executionkanban = array('link' => "{$lang->execution->executionKanban}|execution|executionkanban|");
|
||||
|
||||
$lang->execution->menu = new stdclass();
|
||||
@@ -316,19 +314,17 @@ $lang->qa->dividerMenu = ',bug,testtask,caselib,';
|
||||
|
||||
/* DevOps menu. */
|
||||
$lang->devops->menu = new stdclass();
|
||||
$lang->devops->menu->code = array('link' => "{$lang->repo->common}|repo|browse|repoID=%s", 'alias' => 'diff,view,revision,log,blame,showsynccomment,showsynccommit');
|
||||
$lang->devops->menu->code = array('link' => "{$lang->repo->common}|repo|browse|repoID=%s", 'alias' => 'diff,view,revision,log,blame,showsynccommit');
|
||||
$lang->devops->menu->compile = array('link' => "{$lang->devops->compile}|job|browse", 'subModule' => 'compile,job');
|
||||
$lang->devops->menu->jenkins = array('link' => "Jenkins|jenkins|browse", 'alias' => 'create,edit');
|
||||
$lang->devops->menu->gitlab = array('link' => "Gitlab|gitlab|browse", 'alias' => 'create,edit');
|
||||
$lang->devops->menu->maintain = array('link' => "{$lang->devops->repo}|repo|maintain", 'alias' => 'create,edit');
|
||||
$lang->devops->menu->rules = array('link' => "{$lang->devops->rules}|repo|setrules");
|
||||
|
||||
$lang->devops->menuOrder[5] = 'code';
|
||||
$lang->devops->menuOrder[10] = 'compile';
|
||||
$lang->devops->menuOrder[15] = 'jenkins';
|
||||
$lang->devops->menuOrder[14] = 'gitlab';
|
||||
$lang->devops->menuOrder[20] = 'maintain';
|
||||
$lang->devops->menuOrder[25] = 'rules';
|
||||
$lang->devops->menuOrder[20] = 'jenkins';
|
||||
$lang->devops->menuOrder[25] = 'maintain';
|
||||
$lang->devops->menuOrder[30] = 'rules';
|
||||
|
||||
/* Doc menu.*/
|
||||
$lang->doc->menu = new stdclass();
|
||||
|
||||
@@ -529,7 +529,11 @@ class commonModel extends model
|
||||
{
|
||||
$nav = $lang->mainNav->$openApp;
|
||||
list($title, $currentModule, $currentMethod, $vars) = explode('|', $nav);
|
||||
if($openApp == 'execution') $currentMethod = 'executionKanban';
|
||||
if($openApp == 'execution')
|
||||
{
|
||||
if($config->systemMode == 'new') $currentMethod = 'executionKanban';
|
||||
if($config->systemMode == 'classic') $currentMethod = 'all';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -539,7 +543,7 @@ class commonModel extends model
|
||||
}
|
||||
|
||||
if($config->systemMode == 'classic' and $openApp == 'execution') $icon = zget($lang->navIcons, 'project', '');
|
||||
$link = ($openApp == 'execution' and ($config->systemMode == 'classic')) ? '' : helper::createLink($currentModule, $currentMethod);
|
||||
$link = helper::createLink($currentModule, $currentMethod);
|
||||
$html = $link ? html::a($link, "$icon {$lang->$openApp->common}", '', "class='btn'") : "$icon {$lang->$openApp->common}";
|
||||
|
||||
echo "<div class='btn-group header-btn'>" . $html . '</div>';
|
||||
@@ -2248,7 +2252,7 @@ EOD;
|
||||
curl_setopt($curl, CURLOPT_POST, true);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
|
||||
}
|
||||
|
||||
|
||||
if($options) curl_setopt_array($curl, $options);
|
||||
$response = curl_exec($curl);
|
||||
$errors = curl_error($curl);
|
||||
|
||||
@@ -1411,7 +1411,7 @@ class execution extends control
|
||||
{
|
||||
$projectID = $this->dao->select('project')->from(TABLE_EXECUTION)->where('id')->eq($executionID)->fetch('project');
|
||||
$this->loadModel('productplan')->linkProject($executionID, $_POST['plans'], $oldPlanStories);
|
||||
$this->loadModel('productplan')->linkProject($projectID, $_POST['plans']);
|
||||
$this->productplan->linkProject($projectID, $_POST['plans']);
|
||||
}
|
||||
|
||||
$this->executeHooks($executionID);
|
||||
@@ -1432,7 +1432,7 @@ class execution extends control
|
||||
$position[] = html::a($browseExecutionLink, $execution->name);
|
||||
$position[] = $this->lang->execution->edit;
|
||||
|
||||
$allProducts = array(0 => '');
|
||||
$allProducts = array(0 => '');
|
||||
$executionProsucts = $this->execution->getProducts($execution->project, true, 'noclosed');
|
||||
foreach($executionProsucts as $product) $allProducts[$product->id] = $product->name;
|
||||
|
||||
|
||||
@@ -405,8 +405,9 @@ $lang->execution->featureBar['all']['doing'] = $lang->execution->statusList[
|
||||
$lang->execution->featureBar['all']['suspended'] = $lang->execution->statusList['suspended'];
|
||||
$lang->execution->featureBar['all']['closed'] = $lang->execution->statusList['closed'];
|
||||
|
||||
$lang->execution->myExecutions = 'Ich bin beteiligt.';
|
||||
$lang->execution->doingProject = 'Laufende Projekte';
|
||||
$lang->execution->myExecutions = 'Ich bin beteiligt.';
|
||||
$lang->execution->doingProject = 'Laufende Projekte';
|
||||
|
||||
$lang->execution->kanbanColType['wait'] = $lang->execution->statusList['wait'] . ' ' . $lang->execution->common;
|
||||
$lang->execution->kanbanColType['doing'] = $lang->execution->statusList['doing'] . ' ' . $lang->execution->common;
|
||||
$lang->execution->kanbanColType['suspended'] = $lang->execution->statusList['suspended']. ' ' . $lang->execution->common;
|
||||
|
||||
@@ -405,8 +405,9 @@ $lang->execution->featureBar['all']['doing'] = $lang->execution->statusList[
|
||||
$lang->execution->featureBar['all']['suspended'] = $lang->execution->statusList['suspended'];
|
||||
$lang->execution->featureBar['all']['closed'] = $lang->execution->statusList['closed'];
|
||||
|
||||
$lang->execution->myExecutions = 'Mine';
|
||||
$lang->execution->doingProject = 'Ongoing Projects';
|
||||
$lang->execution->myExecutions = 'Mine';
|
||||
$lang->execution->doingProject = 'Ongoing Projects';
|
||||
|
||||
$lang->execution->kanbanColType['wait'] = $lang->execution->statusList['wait'] . ' ' . $lang->execution->common;
|
||||
$lang->execution->kanbanColType['doing'] = $lang->execution->statusList['doing'] . ' ' . $lang->execution->common;
|
||||
$lang->execution->kanbanColType['suspended'] = $lang->execution->statusList['suspended'] . ' ' . $lang->execution->common;
|
||||
|
||||
@@ -405,8 +405,9 @@ $lang->execution->featureBar['all']['doing'] = $lang->execution->statusList[
|
||||
$lang->execution->featureBar['all']['suspended'] = $lang->execution->statusList['suspended'];
|
||||
$lang->execution->featureBar['all']['closed'] = $lang->execution->statusList['closed'];
|
||||
|
||||
$lang->execution->myExecutions = "J'étais impliqué";
|
||||
$lang->execution->doingProject = 'Projets en cours';
|
||||
$lang->execution->myExecutions = "J'étais impliqué";
|
||||
$lang->execution->doingProject = 'Projets en cours';
|
||||
|
||||
$lang->execution->kanbanColType['wait'] = $lang->execution->statusList['wait'] . ' ' . $lang->execution->common;
|
||||
$lang->execution->kanbanColType['doing'] = $lang->execution->statusList['doing'] . ' ' . $lang->execution->common;
|
||||
$lang->execution->kanbanColType['suspended'] = $lang->execution->statusList['suspended'] . ' ' . $lang->execution->common;
|
||||
|
||||
@@ -406,8 +406,9 @@ $lang->execution->featureBar['all']['doing'] = $lang->execution->statusList[
|
||||
$lang->execution->featureBar['all']['suspended'] = $lang->execution->statusList['suspended'];
|
||||
$lang->execution->featureBar['all']['closed'] = $lang->execution->statusList['closed'];
|
||||
|
||||
$lang->execution->myExecutions = 'Tôi tham gia';
|
||||
$lang->execution->doingProject = 'Hiện trường';
|
||||
$lang->execution->myExecutions = 'Tôi tham gia';
|
||||
$lang->execution->doingProject = 'Hiện trường';
|
||||
|
||||
$lang->execution->kanbanColType['wait'] = $lang->execution->statusList['wait'] . ' ' . $lang->execution->common;
|
||||
$lang->execution->kanbanColType['doing'] = $lang->execution->statusList['doing'] . ' ' . $lang->execution->common;
|
||||
$lang->execution->kanbanColType['suspended'] = $lang->execution->statusList['suspended'] . ' ' . $lang->execution->common;
|
||||
|
||||
@@ -405,8 +405,9 @@ $lang->execution->featureBar['all']['doing'] = $lang->execution->statusList[
|
||||
$lang->execution->featureBar['all']['suspended'] = $lang->execution->statusList['suspended'];
|
||||
$lang->execution->featureBar['all']['closed'] = $lang->execution->statusList['closed'];
|
||||
|
||||
$lang->execution->myExecutions = '我参与的';
|
||||
$lang->execution->doingProject = '进行中的项目';
|
||||
$lang->execution->myExecutions = '我参与的';
|
||||
$lang->execution->doingProject = '进行中的项目';
|
||||
|
||||
$lang->execution->kanbanColType['wait'] = $lang->execution->statusList['wait'] . '的' . $lang->execution->common;
|
||||
$lang->execution->kanbanColType['doing'] = $lang->execution->statusList['doing'] . '的' . $lang->execution->common;
|
||||
$lang->execution->kanbanColType['suspended'] = $lang->execution->statusList['suspended'] . '的' . $lang->execution->common;
|
||||
|
||||
@@ -1575,7 +1575,7 @@ class executionModel extends model
|
||||
* Get products of a execution.
|
||||
*
|
||||
* @param int $executionID
|
||||
* @param bool $withBranch
|
||||
* @param bool $withBranch
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
@@ -1739,13 +1739,13 @@ class executionModel extends model
|
||||
public function updateProducts($executionID, $products = '')
|
||||
{
|
||||
$this->loadModel('user');
|
||||
$products = isset($_POST['products']) ? $_POST['products'] : $products;
|
||||
$oldExecutionProducts = $this->dao->select('*')->from(TABLE_PROJECTPRODUCT)->where('project')->eq((int)$executionID)->fetchGroup('product', 'branch');
|
||||
$products = isset($_POST['products']) ? $_POST['products'] : $products;
|
||||
$oldProdcuts = $this->dao->select('*')->from(TABLE_PROJECTPRODUCT)->where('project')->eq((int)$executionID)->fetchGroup('product', 'branch');
|
||||
$this->dao->delete()->from(TABLE_PROJECTPRODUCT)->where('project')->eq((int)$executionID)->exec();
|
||||
$members = array_keys($this->getTeamMembers($executionID));
|
||||
if(empty($products))
|
||||
{
|
||||
$this->user->updateUserView(array_keys($oldExecutionProducts), 'product', $members);
|
||||
$this->user->updateUserView(array_keys($oldProdcuts), 'product', $members);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1760,10 +1760,10 @@ class executionModel extends model
|
||||
|
||||
$oldPlan = 0;
|
||||
$branch = isset($branches[$i]) ? $branches[$i] : 0;
|
||||
if(isset($oldExecutionProducts[$productID][$branch]))
|
||||
if(isset($oldProdcuts[$productID][$branch]))
|
||||
{
|
||||
$oldExecutionProduct = $oldExecutionProducts[$productID][$branch];
|
||||
$oldPlan = $oldExecutionProduct->plan;
|
||||
$oldProdcuts= $oldProdcuts[$productID][$branch];
|
||||
$oldPlan = $oldProdcuts>plan;
|
||||
}
|
||||
|
||||
$data = new stdclass();
|
||||
@@ -1775,7 +1775,7 @@ class executionModel extends model
|
||||
$existedProducts[$productID] = true;
|
||||
}
|
||||
|
||||
$oldProductKeys = array_keys($oldExecutionProducts);
|
||||
$oldProductKeys = array_keys($oldProdcuts);
|
||||
$needUpdate = array_merge(array_diff($oldProductKeys, $products), array_diff($products, $oldProductKeys));
|
||||
if($needUpdate) $this->user->updateUserView($needUpdate, 'product', $members);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $rowIndex = 0; ?>
|
||||
<?php $rowIndex = 0;?>
|
||||
<?php foreach($kanbanGroup as $projectID => $executionList):?>
|
||||
<tr>
|
||||
<td class='board-project color-<?php echo $rowIndex;?>'>
|
||||
|
||||
@@ -18,22 +18,22 @@
|
||||
<?php if($importable):?>
|
||||
<form method='post' class='load-indicator main-form form-ajax' enctype='multipart/form-data'>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless">
|
||||
<table class="table table-form with-border">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width='60px'><?php echo $lang->gitlab->gitlabIssue;?></th>
|
||||
<th width='30px'><?php echo $lang->gitlab->objectType;?></th>
|
||||
<th width='30px'><?php echo $lang->product->common;?></th>
|
||||
<th width='30px'><?php echo $lang->execution->common;?></th>
|
||||
<th class='w-60px'><?php echo $lang->gitlab->gitlabIssue;?></th>
|
||||
<th class='w-30px'><?php echo $lang->gitlab->objectType;?></th>
|
||||
<th class='w-30px'><?php echo $lang->product->common;?></th>
|
||||
<th class='w-30px'><?php echo $lang->execution->common;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($gitlabIssues as $issue):?>
|
||||
<tr>
|
||||
<td><?php echo "<a href='{$issue->web_url}' target='_blank'>$issue->title</a>";?></td>
|
||||
<td><?php echo html::select("objectTypeList[{$issue->iid}]", $objectTypes, '', "class='form-control select chosen'" );?></td>
|
||||
<td><?php echo html::select("productList[{$issue->iid}]", $products, '', "class='form-control select chosen'" );?></td>
|
||||
<td><?php echo html::select("executionList[{$issue->iid}]", '', '', "class='form-control select chosen'" );?></td>
|
||||
<td><?php echo html::select("objectTypeList[{$issue->iid}]", $objectTypes, '', "class='form-control'" );?></td>
|
||||
<td><?php echo html::select("productList[{$issue->iid}]", $products, '', "class='form-control'" );?></td>
|
||||
<td><?php echo html::select("executionList[{$issue->iid}]", '', '', "class='form-control'" );?></td>
|
||||
<input type='hidden' name='gitlabID' value='<?php echo $gitlabID;?>' />
|
||||
<input type='hidden' name='gitlabProjectID' value='<?php echo $gitlabProjectID;?>'/>
|
||||
</tr>
|
||||
|
||||
@@ -533,7 +533,6 @@ $lang->release->methodOrder[70] = 'changeStatus';
|
||||
|
||||
/* Execution. */
|
||||
$lang->resource->execution = new stdclass();
|
||||
//$lang->resource->execution->index = 'index';
|
||||
$lang->resource->execution->view = 'view';
|
||||
$lang->resource->execution->browse = 'browse';
|
||||
$lang->resource->execution->create = 'createExec';
|
||||
@@ -1133,7 +1132,7 @@ $lang->gitlab->methodOrder[15] = 'edit';
|
||||
$lang->gitlab->methodOrder[20] = 'importIssue';
|
||||
$lang->gitlab->methodOrder[30] = 'delete';
|
||||
$lang->gitlab->methodOrder[35] = 'bindUser';
|
||||
$lang->gitlab->methodOrder[40] = 'bindProduct';
|
||||
$lang->gitlab->methodOrder[40] = 'bindProduct';
|
||||
|
||||
/* Git. */
|
||||
$lang->resource->git = new stdclass();
|
||||
|
||||
@@ -64,15 +64,16 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->install->selectedMode;?></th>
|
||||
<td><?php $systemMode = isset($lang->upgrade->to15Mode['classic']) ? 'classic' : 'new';?>
|
||||
<?php echo html::radio('mode', $lang->upgrade->to15Mode, $systemMode);?>
|
||||
</td>
|
||||
<td>
|
||||
<?php $systemMode = isset($lang->upgrade->to15Mode['classic']) ? 'classic' : 'new';?>
|
||||
<?php echo html::radio('mode', $lang->upgrade->to15Mode, $systemMode);?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td>
|
||||
<div class='text-info'><?php echo $lang->install->selectedModeTips;?></div>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th><td><?php echo html::checkBox('importDemoData', $lang->install->importDemoData);?></td>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
.checkbox-primary + .checkbox-primary {margin: 0px;}
|
||||
.checkbox-primary {margin: 0px; width: 120px; float:left;}
|
||||
.checkbox-primary {margin: 0px; width: 120px; float: left;}
|
||||
.checkbox-primary label {white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
|
||||
div.chosen-container + select + div.chosen-container > .chosen-choices {border-top: 0px;}
|
||||
|
||||
|
||||
@@ -35,7 +35,8 @@
|
||||
#sidebar>.cell {width: 100%;}
|
||||
|
||||
.main-table thead>tr:first-of-type>th {border-left: 1px solid #ddd;}
|
||||
th.table-nest-title .table-nest-toggle {margin-top: 8px; margin-left: 35px;}
|
||||
th.table-nest-title .nest-has-checkbox {margin-top: 8px; margin-left: 35px;}
|
||||
th.table-nest-title .nest-none-checkbox {margin-top: 8px; margin-left: 5px;}
|
||||
th.table-nest-title .header {margin-left: 5px;}
|
||||
th.table-nest-title .sort-up {padding-left: 5px;}
|
||||
th.table-nest-title .sort-down {padding-left: 5px;}
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<tr class="text-center">
|
||||
<th class='table-nest-title text-left' rowspan="2">
|
||||
<?php if($canBatchEdit) echo "<div class='checkbox-primary check-all' title='{$this->lang->selectAll}'><label></label></div>";?>
|
||||
<a class='table-nest-toggle table-nest-toggle-global' data-expand-text='<?php echo $lang->expand; ?>' data-collapse-text='<?php echo $lang->collapse; ?>'></a>
|
||||
<a class='table-nest-toggle table-nest-toggle-global <?php echo $canBatchEdit ? 'nest-has-checkbox' : 'nest-none-checkbox';?>' data-expand-text='<?php echo $lang->expand; ?>' data-collapse-text='<?php echo $lang->collapse; ?>'></a>
|
||||
<?php common::printOrderLink('name', $orderBy, $vars, $lang->product->name);?>
|
||||
</th>
|
||||
<?php if($this->config->URAndSR):?>
|
||||
|
||||
+31
-21
@@ -638,6 +638,7 @@ class repoModel extends model
|
||||
{
|
||||
$commitID = $this->dao->lastInsertID();
|
||||
if($branch) $this->dao->replace(TABLE_REPOBRANCH)->set('repo')->eq($repoID)->set('revision')->eq($commitID)->set('branch')->eq($branch)->exec();
|
||||
$file = array();
|
||||
foreach($logs['files'][$i] as $file)
|
||||
{
|
||||
$parentPath = dirname($file->path);
|
||||
@@ -1741,32 +1742,41 @@ class repoModel extends model
|
||||
return $buildedURL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get gitlab projects.
|
||||
*
|
||||
* @param string $host
|
||||
* @param string $token
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getGitlabProjects($host, $token)
|
||||
{
|
||||
$host = rtrim($host, '/');
|
||||
$host .= '/api/v4/projects';
|
||||
/**
|
||||
* Get gitlab projects.
|
||||
*
|
||||
* @param string $host
|
||||
* @param string $token
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getGitlabProjects($host, $token)
|
||||
{
|
||||
$host = rtrim($host, '/');
|
||||
$host .= '/api/v4/projects';
|
||||
|
||||
$allResults = array();
|
||||
for($page = 1; true; $page ++)
|
||||
{
|
||||
$results = json_decode(common::http($host . "?private_token=$token&simple=true&membership=true&page={$page}&per_page=100"));
|
||||
if(empty($results) or $page > 10) break;
|
||||
$allResults = $allResults + $results;
|
||||
}
|
||||
$allResults = array();
|
||||
for($page = 1; true; $page ++)
|
||||
{
|
||||
$results = json_decode(common::http($host . "?private_token=$token&simple=true&membership=true&page={$page}&per_page=100"));
|
||||
if(empty($results) or $page > 10) break;
|
||||
$allResults = $allResults + $results;
|
||||
}
|
||||
|
||||
return $allResults;
|
||||
}
|
||||
return $allResults;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process gitlab repo.
|
||||
*
|
||||
* @param oobject $repo
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function processGitlab($repo)
|
||||
{
|
||||
return $repo;
|
||||
|
||||
$gitlab = $this->loadModel('gitlab')->getByID($repo->client);
|
||||
if(!$gitlab) return $repo;
|
||||
$repo->gitlab = $gitlab->id;
|
||||
|
||||
@@ -170,7 +170,7 @@ class storyModel extends model
|
||||
{
|
||||
return $this->dao->select('id,title')->from(TABLE_STORY)
|
||||
->where('deleted')->eq(0)
|
||||
->andWhere('status')->ne('draft')
|
||||
->andWhere('status')->notIN('draft,closed')
|
||||
->andWhere('product')->eq($productID)
|
||||
->andWhere('type')->eq('requirement')
|
||||
->fetchPairs();
|
||||
|
||||
+11
-11
@@ -116,7 +116,7 @@ class taskModel extends model
|
||||
->checkIF($task->estimate != '', 'estimate', 'float')
|
||||
->checkIF(!helper::isZeroDate($task->deadline), 'deadline', 'ge', $task->estStarted)
|
||||
->exec();
|
||||
|
||||
|
||||
if(dao::isError()) return false;
|
||||
|
||||
$taskID = $this->dao->lastInsertID();
|
||||
@@ -459,9 +459,9 @@ class taskModel extends model
|
||||
|
||||
/**
|
||||
* Create task from gitlab issue.
|
||||
*
|
||||
* @param object $task
|
||||
* @param int $executionID
|
||||
*
|
||||
* @param object $task
|
||||
* @param int $executionID
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
@@ -474,18 +474,18 @@ class taskModel extends model
|
||||
$task->module = 0;
|
||||
$task->estimate = 0;
|
||||
$task->estStarted = '0000-00-00';
|
||||
$task->left = 1;
|
||||
$task->type = 'devel';
|
||||
$task->left = 1;
|
||||
$task->type = 'devel';
|
||||
|
||||
$this->dao->insert(TABLE_TASK)->data($task, $skip = 'id,product')
|
||||
->autoCheck()
|
||||
->batchCheck($this->config->task->create->requiredFields, 'notempty')
|
||||
->checkIF(!helper::isZeroDate($task->deadline), 'deadline', 'ge', $task->estStarted)
|
||||
->exec();
|
||||
|
||||
|
||||
if(dao::isError()) return false;
|
||||
|
||||
return $this->dao->lastInsertID();
|
||||
|
||||
return $this->dao->lastInsertID();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1297,8 +1297,8 @@ class taskModel extends model
|
||||
if($task->status == 'done') $this->loadModel('score')->create('task', 'finish', $taskID);
|
||||
if($task->status == 'closed') $this->loadModel('score')->create('task', 'close', $taskID);
|
||||
$allChanges[$taskID] = common::createChanges($oldTask, $task);
|
||||
|
||||
/* update task to gitlab issue. */
|
||||
|
||||
/* Update task to gitlab issue. */
|
||||
$this->loadModel('gitlab');
|
||||
$relation = $this->gitlab->getRelationByObject('task', $taskID);
|
||||
if(!empty($relation)) $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $task, $taskID);
|
||||
|
||||
@@ -446,7 +446,7 @@ class testcaseModel extends model
|
||||
->beginIF($auto != 'unit')->andWhere('t1.auto')->ne('unit')->fi()
|
||||
->beginIF($auto == 'unit')->andWhere('t1.auto')->eq('unit')->fi()
|
||||
->orderBy($sort)
|
||||
->page($pager)
|
||||
->page($pager, 't1.id')
|
||||
->fetchAll();
|
||||
}
|
||||
elseif($browseType == 'bysuite')
|
||||
|
||||
@@ -597,6 +597,8 @@ class testtask extends control
|
||||
{
|
||||
$this->loadModel('qa')->setMenu($this->products, $productID, $branchID, $taskID);
|
||||
}
|
||||
unset($this->lang->testtask->report->charts['bugStageGroups']);
|
||||
unset($this->lang->testtask->report->charts['bugHandleGroups']);
|
||||
|
||||
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->common . $this->lang->colon . $this->lang->testtask->reportChart;
|
||||
$this->view->position[] = html::a($this->createLink('testtask', 'cases', "taskID=$taskID"), $this->products[$productID]);
|
||||
|
||||
@@ -2188,6 +2188,7 @@ class testtaskModel extends model
|
||||
$caseStep->type = 'step';
|
||||
$caseStep->desc = '';
|
||||
$caseStep->expect = $step->checkPoints[0]->expect;
|
||||
|
||||
$case->steps[] = $caseStep;
|
||||
}
|
||||
$result->caseResult = $stepStatus;
|
||||
|
||||
@@ -687,7 +687,6 @@ class upgradeModel extends model
|
||||
case '15_0_3':
|
||||
$this->saveLogs('Execute 15_0_3');
|
||||
$this->execSQL($this->getUpgradeFile('15.0.3'));
|
||||
$this->processGitlabRepo();
|
||||
$this->appendExec('15_0_3');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user