Merge branch 'liyuchun_59430'

This commit is contained in:
孙广明
2022-07-07 14:01:18 +08:00
26 changed files with 259 additions and 64 deletions
+2
View File
@@ -9,3 +9,5 @@ CREATE TABLE `zt_cfd` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO `zt_cron` (`m`, `h`, `dom`, `mon`, `dow`, `command`, `remark`, `type`, `buildin`, `status`, `lastTime`) VALUES ('30', '23', '*', '*', '*', 'moduleName=execution&methodName=computecfd', '更新累积流图', 'zentao', 1, 'normal', '0000-00-00 00:00:00');
ALTER TABLE `zt_doc` CHANGE `assignedDate` `assignedDate` datetime NOT NULL AFTER `assignedTo`;
+1 -1
View File
@@ -8963,7 +8963,7 @@ ALTER TABLE `zt_doc` ADD `assetLibType` varchar(30) NOT NULL default '' after `a
ALTER TABLE `zt_doc` ADD `from` mediumint(8) unsigned NOT NULL default 0 after `assetLibType`;
ALTER TABLE `zt_doc` ADD `fromVersion` smallint(6) NOT NULL default 1 after `from`;
ALTER TABLE `zt_doc` ADD `assignedTo` varchar(30) NOT NULL after `addedDate`;
ALTER TABLE `zt_doc` ADD `assignedDate` date NOT NULL after `assignedTo`;
ALTER TABLE `zt_doc` ADD `assignedDate` datetime NOT NULL after `assignedTo`;
ALTER TABLE `zt_doc` ADD `approvedDate` date NOT NULL after `assignedDate`;
ALTER TABLE `zt_doc` ADD `status` varchar(30) NOT NULL after `type`;
+19
View File
@@ -579,6 +579,25 @@ class GitRepo
return $logs;
}
/**
* Get clone url.
*
* @access public
* @return string
*/
public function getCloneUrl()
{
$url = new stdclass();
$remote = execCmd(escapeCmd("$this->client remote -v"), 'array');
$pregHttp = '/http(s)?:\/\/(www\.)?[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:\d+)*(\/\w+)*\.git/';
$pregSSH = '/ssh:\/\/git@[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:\d+)*(\/\w+)*\.git/';
if(preg_match($pregHttp, $remote[0], $matches)) $url->http = $matches[0];
if(preg_match($pregSSH, $remote[0], $matches)) $url->ssh = $matches[0];
return $url;
}
/**
* Parse log.
*
+11
View File
@@ -220,6 +220,17 @@ class scm
return $this->engine->getCommits($version, $count, $branch);
}
/**
* Get clone url.
*
* @access public
* @return void
*/
public function getCloneUrl()
{
return $this->engine->getCloneUrl();
}
/**
* Check revision
*
+1 -1
View File
@@ -406,7 +406,7 @@ class actionModel extends model
$name = $this->dao->select('name')->from(TABLE_TESTTASK)->where('id')->eq($action->extra)->fetch('name');
if($name) $action->extra = common::hasPriv('testtask', 'view') ? html::a(helper::createLink('testtask', 'view', "taskID=$action->extra"), $name) : $name;
}
elseif($actionName == 'moved')
elseif($actionName == 'moved' and $action->objectType != 'module')
{
$name = $this->dao->select('name')->from(TABLE_PROJECT)->where('id')->eq($action->extra)->fetch('name');
if($name) $action->extra = common::hasPriv('execution', 'task') ? html::a(helper::createLink('execution', 'task', "executionID=$action->extra"), "#$action->extra " . $name) : "#$action->extra " . $name;
+1 -1
View File
@@ -1802,7 +1802,7 @@ class block extends control
{
$this->app->loadLang('feedback');
$this->view->users = $this->loadModel('user')->getPairs('all,noletter');
$this->view->products = $this->loadModel('product')->getPairs();
$this->view->products = $this->dao->select('id, name')->from(TABLE_PRODUCT)->where('deleted')->eq('0')->fetchPairs('id', 'name');
}
$count[$objectType] = count($objects);
+31 -8
View File
@@ -415,14 +415,26 @@ class bug extends control
$executionID = isset($output['executionID']) ? $output['executionID'] : $this->session->execution;
$executionID = $this->post->execution ? $this->post->execution : $executionID;
$execution = $this->loadModel('execution')->getByID($executionID);
if($this->app->tab == 'execution' and $execution->type == 'kanban')
if($this->app->tab == 'execution')
{
$execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all';
$execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default';
$rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : '';
$kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $execLaneType, 'id_desc', 0, $execGroupBy, $rdSearchValue);
$kanbanData = json_encode($kanbanData);
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.updateKanban($kanbanData, 0)"));
if($execution->type == 'kanban')
{
$kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $execLaneType, 'id_desc', 0, $execGroupBy, $rdSearchValue);
$kanbanData = json_encode($kanbanData);
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.updateKanban($kanbanData, 0)"));
}
else
{
$kanbanData = $this->loadModel('kanban')->getExecutionKanban($executionID, $execLaneType, $execGroupBy, $rdSearchValue);
$kanbanType = $execLaneType == 'all' ? 'bug' : key($kanbanData);
$kanbanData = $kanbanData[$kanbanType];
$kanbanData = json_encode($kanbanData);
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.updateKanban(\"bug\", $kanbanData)"));
}
}
else
{
@@ -712,15 +724,26 @@ class bug extends control
if(isonlybody() and $executionID)
{
$execution = $this->loadModel('execution')->getByID($executionID);
if($execution->type == 'kanban' and $this->app->tab == 'execution')
if($this->app->tab == 'execution')
{
$execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all';
$execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default';
$rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : '';
$kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $execLaneType, 'id_desc', 0, $execGroupBy, $rdSearchValue);
$kanbanData = json_encode($kanbanData);
if($execution->type == 'kanban')
{
$kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $execLaneType, 'id_desc', 0, $execGroupBy, $rdSearchValue);
$kanbanData = json_encode($kanbanData);
return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)"));
return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)"));
}
else
{
$kanbanData = $this->loadModel('kanban')->getExecutionKanban($executionID, $execLaneType, $execGroupBy, $rdSearchValue);
$kanbanType = $execLaneType == 'all' ? 'bug' : key($kanbanData);
$kanbanData = $kanbanData[$kanbanType];
$kanbanData = json_encode($kanbanData);
return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban(\"bug\", $kanbanData)"));
}
}
else
{
+7 -2
View File
@@ -125,7 +125,7 @@ class custom extends control
foreach($postArray->data->keys as $key)
{
if($module == 'testtask' and $field == 'typeList' and empty($key)) continue;
if(in_array($key, $keys)) return $this->send(array('result' => 'fail', 'message' => sprintf($this->lang->custom->notice->repeatKey, $key)));;
if($key && in_array($key, $keys)) return $this->send(array('result' => 'fail', 'message' => sprintf($this->lang->custom->notice->repeatKey, $key)));;
$keys[] = $key;
}
}
@@ -243,9 +243,12 @@ class custom extends control
}
$this->custom->deleteItems("lang=$lang&module=$module&section=$field&vision={$this->config->vision}");
$data = fixer::input('post')->get();
$data = fixer::input('post')->get();
$emptyKey = false;
foreach($data->keys as $index => $key)
{
if(!$key && $emptyKey) continue;
//if(!$system and (!$value or !$key)) continue; //Fix bug #951.
$value = $data->values[$index];
@@ -253,6 +256,8 @@ class custom extends control
if($key and trim($value) === '') return $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->valueEmpty)); // Fix bug #23538.
$this->custom->setItem("{$lang}.{$module}.{$field}.{$key}.{$system}", $value);
if(!$key) $emptyKey = true;
}
}
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
+2 -2
View File
@@ -21,7 +21,7 @@ $itemRow = <<<EOT
<td>
<input type='text' class="form-control" value="" autocomplete="off" name="values[]">
</td>
<td class='c-actions'>
<td class='c-actions text-left'>
<a href="javascript:void(0)" class='btn btn-link' onclick="addItem(this)"><i class='icon-plus'></i></a>
<a href="javascript:void(0)" class='btn btn-link' onclick="delItem(this)"><i class='icon-close'></i></a>
</td>
@@ -249,7 +249,7 @@ EOT;
<?php echo html::input("values[]", isset($dbFields[$key]) ? $dbFields[$key]->value : $value, "class='form-control' " . (empty($key) ? 'readonly' : ''));?>
</td>
<?php if($canAdd):?>
<td class='c-actions'>
<td class='c-actions text-left'>
<a href="javascript:void(0)" onclick="addItem(this)" class='btn btn-link'><i class='icon-plus'></i></a>
<a href="javascript:void(0)" onclick="delItem(this)" class='btn btn-link'><i class='icon-close'></i></a>
</td>
+13
View File
@@ -3181,6 +3181,19 @@ class execution extends control
}
return $this->send($response);
}
$execution = $this->execution->getByID($executionID);
if($this->app->tab == 'execution' and $execution->type == 'kanban')
{
$execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all';
$execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default';
$rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : '';
$kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $execLaneType, 'id_desc', 0, $execGroupBy, $rdSearchValue);
$kanbanData = json_encode($kanbanData);
return print(js::closeModal('parent', '', "parent.updateKanban($kanbanData)"));
}
return print(js::reload('parent'));
}
}
+1 -1
View File
@@ -23,7 +23,7 @@
<div class="side-col" id='sidebar' data-min-width='235'>
<div class="sidebar-toggle"><i class="icon icon-angle-left"></i></div>
<div class='cell'>
<?php if(!$moduleTree):?>
<?php if(empty($moduleTree) or empty($lang->modulePageNav)):?>
<hr class="space">
<div class="text-center text-muted"><?php echo $lang->testcase->noModule;?></div>
<hr class="space">
+19
View File
@@ -2896,4 +2896,23 @@ class gitlabModel extends model
$html .= '</div>';
return $html;
}
/**
* Download zip code.
*
* @param int $gitlabID
* @param int $projectID
* @param string $branch
* @param string $ext tar.gz|tar.bz2|tbz|tbz2|tb2|bz2|tar|zip
* @access public
* @return string
*/
public function downloadCode($gitlabID = 0, $projectID = 0, $branch = '', $ext = 'zip')
{
if(empty($gitlabID) or empty($projectID)) return false;
$url = sprintf($this->getApiRoot($gitlabID), "/projects/$projectID/repository/archive." . $ext);
if($branch) $url .= '&sha=' . $branch;
return $url;
}
}
+1 -1
View File
@@ -19,7 +19,7 @@
<h2><?php echo $lang->gitlab->importIssue;?></h2>
<?php if(!isonlybody() and empty($importable)):?>
<div class='pull-right'>
<?php echo html::linkButton($lang->goback, $this->createLink('repo', 'maintain'), 'self', '', 'btn btn-primary');?>
<?php echo html::backButton($lang->goback, "data-app='{$app->tab}'", 'btn btn-primary');?>
</div>
<?php endif;?>
</div>
+38 -1
View File
@@ -1305,10 +1305,47 @@ class repo extends control
*/
public function downloadCode($repoID = 0, $branch = '')
{
$repo = $this->repo->getRepoByID($repoID);
$savePath = $this->app->getDataRoot() . 'repo';
$fileName = $savePath . DS . $repo->name . '.zip';
if(!is_dir($savePath))
{
if(!is_writable($this->app->getDataRoot())) return print(js::alert(sprintf($this->lang->repo->error->noWritable, dirname($savePath))) . js::close());
mkdir($savePath, 0777, true);
}
$repo = $this->repo->getRepoByID($repoID);
if($repo->SCM == 'Gitlab')
{
return '';
$url = $this->loadModel('gitlab')->downloadCode($repo->gitlab, $repo->project, $branch);
}
elseif($repo->SCM == 'Git')
{
$this->app->loadClass('pclzip', true);
$zip = new pclzip($fileName);
if($zip->create($repo->path, PCLZIP_OPT_REMOVE_PATH, $repo->path) === 0) return print(js::alert($zip->errorInfo()) . js::close());
$url = DS . 'data' . DS . 'repo' . DS . $repo->name . '.zip';
}
else
{
/* Checkout repo. */
chdir($savePath);
$this->scm = $this->app->loadClass('scm');
$this->scm->setEngine($repo);
$this->scm->exec('checkout ' . $repo->path);
/* Get repo name. */
$pathList = explode('/', trim($repo->path, '/'));
$repoDir = end($pathList);
$this->app->loadClass('pclzip', true);
$zip = new pclzip($fileName);
if($zip->create($repoDir, PCLZIP_OPT_REMOVE_PATH, $repoDir) === 0) return print(js::alert($zip->errorInfo()) . js::close());
$url = DS . 'data' . DS . 'repo' . DS . $repo->name . '.zip';
}
$this->locate($url);
}
}
+31 -22
View File
@@ -1,29 +1,17 @@
/**
* Get download.
*
* @access public
* @return void
*/
function getDownload()
{
var content = "<div class='main-col'>";
content += "<div class='center-block'>";
content += "<table class='table table-borderless'>";
if(cloneUrl.ssh)
{
content += "<tr>";
content += "<th>" + lang.sshClone + "</th>";
content += "</tr>";
content += "<tr>";
content += "<td><input type='input' class='form-control' value='" + cloneUrl.ssh + "' readonly></td>";
content += "<td><button type='button' class='btn copy-btn'><i class='icon-common-copy icon-copy' title='" + lang.copy + "'></i></button></td>";
content += "</tr>";
content += "<tr>";
}
if(cloneUrl.http)
{
content += "<th>" + lang.httpClone + "</th>";
content += "</tr>";
content += "<tr>";
content += "<td><input type='input' class='form-control' value='" + cloneUrl.http + "' readonly></td>";
content += "<td><button type='button' class='btn copy-btn'><i class='icon-common-copy icon-copy' title='" + lang.copy + "'></i></button></td>";
content += "</tr>";
}
if(cloneUrl.svn) content += getCloneHtml(lang.cloneUrl, cloneUrl.svn);
if(cloneUrl.ssh) content += getCloneHtml(lang.sshClone, cloneUrl.ssh);
if(cloneUrl.http) content += getCloneHtml(lang.httpClone, cloneUrl.http);
content += "<tr>";
content += "<td><button type='button' class='btn download-btn'><i class='icon-down-circle'></i> <span>" + lang.downloadZip + "</span></button></td>";
@@ -36,6 +24,27 @@ function getDownload()
return content;
}
/**
* Get html of clone button.
*
* @param cloneLang $cloneLang
* @param url $url
* @access public
* @return void
*/
function getCloneHtml(cloneLang, url)
{
var content = '';
content += "<tr>";
content += "<th>" + cloneLang + "</th>";
content += "</tr>";
content += "<tr>";
content += "<td><input type='input' class='form-control' value='" + url + "' readonly></td>";
content += "<td><button type='button' class='btn copy-btn'><i class='icon-common-copy icon-copy' title='" + lang.copy + "'></i></button></td>";
content += "</tr>";
return content;
}
$(function()
{
/* Init popover. */
@@ -89,7 +98,7 @@ $(function()
$('.download-btn').live('click', function()
{
var link = createLink('repo', 'downloadCode', 'repoID=' + repoID);
var link = createLink('repo', 'downloadCode', 'repoID=' + repoID + '&branch=' + branch);
window.open(link);
})
})
+4 -2
View File
@@ -37,8 +37,9 @@ $lang->repo->blameAction = 'Blame';
$lang->repo->reviewAction = 'Review List';
$lang->repo->downloadCode = 'Download Code';
$lang->repo->downloadZip = 'Download Zip file';
$lang->repo->sshClone = 'Clone by SSH';
$lang->repo->httpClone = 'Clone by HTTP';
$lang->repo->sshClone = 'Clone with SSH';
$lang->repo->httpClone = 'Clone with HTTP';
$lang->repo->cloneUrl = 'Clone URL';
$lang->repo->submit = 'Submit';
$lang->repo->cancel = 'Cancel';
@@ -193,6 +194,7 @@ $lang->repo->error->deleted = "Deletion of the repository failed. The curr
$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->error->notFound = "The repository %ss URL %s does not exist. Please confirm if this repository has been deleted from the local server.";
$lang->repo->error->noWritable = '%s is not writable! Please check the privilege, or download will not be done.';
$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>';
$lang->repo->encodingsTips = "The encodings of comments can be comma separated values, e.g. utf-8.";
+4 -2
View File
@@ -37,8 +37,9 @@ $lang->repo->blameAction = 'Blame';
$lang->repo->reviewAction = 'Review List';
$lang->repo->downloadCode = 'Download Code';
$lang->repo->downloadZip = 'Download compressed package';
$lang->repo->sshClone = 'Clone by SSH';
$lang->repo->httpClone = 'Clone by HTTP';
$lang->repo->sshClone = 'Clone with SSH';
$lang->repo->httpClone = 'Clone with HTTP';
$lang->repo->cloneUrl = 'Clone URL';
$lang->repo->submit = 'Submit';
$lang->repo->cancel = 'Cancel';
@@ -193,6 +194,7 @@ $lang->repo->error->deleted = "Deletion of the repository failed. The curr
$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->error->notFound = "The repository %ss URL %s does not exist. Please confirm if this repository has been deleted from the local server.";
$lang->repo->error->noWritable = '%s is not writable! Please check the privilege, or download will not be done.';
$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>';
$lang->repo->encodingsTips = "The encodings of comments can be comma separated values, e.g. utf-8.";
+4 -2
View File
@@ -37,8 +37,9 @@ $lang->repo->blameAction = 'Blâme du Référentiel';
$lang->repo->reviewAction = 'Review List';
$lang->repo->downloadCode = 'Download Code';
$lang->repo->downloadZip = 'Download compressed package';
$lang->repo->sshClone = 'Clone by SSH';
$lang->repo->httpClone = 'Clone by HTTP';
$lang->repo->sshClone = 'Clone with SSH';
$lang->repo->httpClone = 'Clone with HTTP';
$lang->repo->cloneUrl = 'Clone URL';
$lang->repo->submit = 'Soumettre';
$lang->repo->cancel = 'Annuler';
@@ -193,6 +194,7 @@ $lang->repo->error->deleted = "Deletion of the repository failed. The curr
$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->error->notFound = "The repository %ss URL %s does not exist. Please confirm if this repository has been deleted from the local server.";
$lang->repo->error->noWritable = '%s is not writable! Please check the privilege, or download will not be done.';
$lang->repo->syncTips = '<strong>Vous pouvez trouver la référence sur la façon de définir la synchronisation Git à partir de la page se trouvant <a target="_blank" href="https://www.zentao.pm/book/zentaomanual/free-open-source-project-management-software-git-105.html">ici</a>.</strong>';
$lang->repo->encodingsTips = "Les encodages des commentaires de validation peuvent être des valeurs séparées par des virgulesex: utf-8";
+4 -2
View File
@@ -37,8 +37,9 @@ $lang->repo->blameAction = 'Blame';
$lang->repo->reviewAction = 'Review List';
$lang->repo->downloadCode = 'Download Code';
$lang->repo->downloadZip = 'Download compressed package';
$lang->repo->sshClone = 'Clone by SSH';
$lang->repo->httpClone = 'Clone by HTTP';
$lang->repo->sshClone = 'Clone with SSH';
$lang->repo->httpClone = 'Clone with HTTP';
$lang->repo->cloneUrl = 'Clone URL';
$lang->repo->submit = 'Gửi';
$lang->repo->cancel = 'Hủy';
@@ -178,6 +179,7 @@ $lang->repo->error->clientVersion = "Client version is too low, please upgrade o
$lang->repo->error->encoding = "The encoding maybe wrong. Vui lòng 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->clientPath = "The client installation directory cannot have spaces!";
$lang->repo->error->noWritable = '%s is not writable! Please check the privilege, or download will not be done.';
$lang->repo->syncTips = '<strong>Bạn có thể tìm tham khảo làm sao thiết lập đồng bộ Git từ <a target="_blank" href="https://www.zentao.pm/book/zentaomanual/free-open-source-project-management-software-git-105.html">here</a>.</strong>';
$lang->repo->encodingsTips = "The encodings of commit comments, can be comma separated valuesví dụ: utf-8";
+2
View File
@@ -39,6 +39,7 @@ $lang->repo->downloadCode = '下载代码';
$lang->repo->downloadZip = '下载压缩包';
$lang->repo->sshClone = '使用SSH克隆';
$lang->repo->httpClone = '使用HTTP克隆';
$lang->repo->cloneUrl = '克隆地址';
$lang->repo->submit = '提交';
$lang->repo->cancel = '取消';
@@ -193,6 +194,7 @@ $lang->repo->error->deleted = "删除代码库失败,当前代码库有
$lang->repo->error->linkedJob = "删除代码库失败,当前代码库与构建有关联,请取消关联或删除构建。";
$lang->repo->error->clientPath = "客户端安装目录不能有空格!";
$lang->repo->error->notFound = "代码库『%s』路径 %s 不存在,请确认此代码库是否已在本地服务器被删除";
$lang->repo->error->noWritable = '%s 不可写!请检查该目录权限,否则无法下载。';
$lang->repo->syncTips = '请参照<a target="_blank" href="https://www.zentao.net/book/zentaopmshelp/207.html">这里</a>,设置代码库定时同步。';
$lang->repo->encodingsTips = "提交日志的编码,可以用逗号连接起来的多个,比如utf-8。";
+1
View File
@@ -186,6 +186,7 @@ $lang->repo->error->encoding = "編碼可能錯誤,請更換編碼重試
$lang->repo->error->deleted = "刪除版本庫失敗,當前版本庫有提交記錄與設計關聯";
$lang->repo->error->linkedJob = "刪除版本庫失敗,當前版本庫與構建有關聯,請取消關聯或刪除構建。";
$lang->repo->error->clientPath = "客戶端安裝目錄不能有空格!";
$lang->repo->error->noWritable = '%s 不可寫!請檢查該目錄權限,否則無法下載。';
$lang->repo->syncTips = '請參照<a target="_blank" href="https://www.zentao.net/book/zentaopmshelp/207.html">這裡</a>,設置版本庫定時同步。';
$lang->repo->encodingsTips = "提交日誌的編碼,可以用逗號連接起來的多個,比如utf-8。";
+11 -1
View File
@@ -2144,7 +2144,11 @@ class repoModel extends model
if(empty($repo)) return null;
$url = new stdClass();
if($repo->SCM == 'Gitlab')
if($repo->SCM == 'Subversion')
{
$url->svn = $repo->path;
}
elseif($repo->SCM == 'Gitlab')
{
$project = $this->loadModel('gitlab')->apiGetSingleProject($repo->gitlab, $repo->project);
if(isset($project->id))
@@ -2153,6 +2157,12 @@ class repoModel extends model
$url->ssh = $project->ssh_url_to_repo;
}
}
else
{
$this->scm = $this->app->loadClass('scm');
$this->scm->setEngine($repo);
$url = $this->scm->getCloneUrl();
}
return $url;
}
+7 -7
View File
@@ -44,13 +44,13 @@
</thead>
<tbody>
<tr class="text-center">
<td><?php echo $measures['bugs'];?></td>
<td><?php echo $measures['vulnerabilities'];?></td>
<td><?php echo $measures['security_hotspots_reviewed'];?></td>
<td><?php echo $measures['code_smells'];?></td>
<td><?php echo $measures['coverage'];?></td>
<td><?php echo $measures['duplicated_lines_density'];?></td>
<td><?php echo $measures['ncloc'];?></td>
<td><?php echo zget($measures, 'bugs', 0);?></td>
<td><?php echo zget($measures, 'vulnerabilities', 0);?></td>
<td><?php echo zget($measures, 'security_hotspots_reviewed', '0.0%');?></td>
<td><?php echo zget($measures, 'code_smells', 0);?></td>
<td><?php echo zget($measures, 'coverage', '0.0%');?></td>
<td><?php echo zget($measures, 'duplicated_lines_density', '0.0%');?></td>
<td><?php echo zget($measures, 'ncloc', 0);?></td>
</tr>
</tbody>
</table>
+37 -2
View File
@@ -500,7 +500,25 @@ class story extends control
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $stories));
if(isonlybody()) return print(js::closeModal('parent.parent', 'this'));
if(isonlybody())
{
$executionID = $executionID ? $executionID : $this->session->execution;
$execution = $this->execution->getByID($executionID);
if($this->app->tab == 'execution' and $execution->type == 'kanban')
{
$execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all';
$execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default';
$rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : '';
$kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $execLaneType, 'id_desc', 0, $execGroupBy, $rdSearchValue);
$kanbanData = json_encode($kanbanData);
return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)"));
}
else
{
return print(js::reload('parent.parent'));
}
}
if($storyID)
{
@@ -1022,7 +1040,24 @@ class story extends control
$module = $this->app->tab == 'project' ? 'projectstory' : 'story';
if(isonlybody()) return print(js::reload('parent.parent'));
if(isonlybody())
{
$execution = $this->execution->getByID($this->session->execution);
if($this->app->tab == 'execution' and $execution->type == 'kanban')
{
$execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all';
$execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default';
$rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : '';
$kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $execLaneType, 'id_desc', 0, $execGroupBy, $rdSearchValue);
$kanbanData = json_encode($kanbanData);
return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)"));
}
else
{
return print(js::reload('parent.parent'));
}
}
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success'));
return print(js::locate($this->createLink($module, 'view', "storyID=$storyID"), 'parent'));
+5 -6
View File
@@ -4090,15 +4090,14 @@ class storyModel extends model
$group = array();
foreach($relations as $relation) $group[$relation->AID][] = $relation->BID;
foreach($stories as $story)
{
if(!isset($group[$story->id]))
{
unset($stories[$story->id]);
continue;
}
if(!isset($group[$story->id])) continue;
$story->children = $this->getByList($group[$story->id]);
array_map(function($storyID) use(&$stories)
{
unset($stories[$storyID]);
}, $group[$story->id]);
}
}
+2
View File
@@ -95,9 +95,11 @@ if($viewType == 'doc' or $viewType == 'api')
<div class="panel">
<div class="panel-heading">
<div class="panel-title"><?php echo $childTitle;?></div>
<?php if($app->tab == 'product'):?>
<div class="panel-actions btn-toolbar">
<?php echo html::a($this->createLink('tree', 'viewHistory', "productID=$rootID", '', true), $lang->history, '', "class='btn btn-sm btn-primary iframe'");?>
</div>
<?php endif;?>
</div>
<div class="panel-body">
<ul id='modulesTree' data-name='tree-<?php echo $viewType;?>'></ul>