* Code for task #65983.
This commit is contained in:
@@ -1004,6 +1004,274 @@ class repo extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Link story to commit.
|
||||
*
|
||||
* @param int $repoID
|
||||
* @param string $revision
|
||||
* @param string $browseType
|
||||
* @param int $param
|
||||
* @param string $orderBy
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function linkStory($repoID, $revision, $browseType = '', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 100, $pageID = 1)
|
||||
{
|
||||
if(!empty($_POST['stories']))
|
||||
{
|
||||
$this->repo->link($repoID, $revision, 'story');
|
||||
|
||||
if(dao::isError()) return print(js::error(dao::getError()));
|
||||
return print(js::closeModal('parent', '', "parent[1].getRelation('$revision')"));
|
||||
}
|
||||
|
||||
$this->loadModel('story');
|
||||
$this->app->loadLang('productplan');
|
||||
|
||||
$repo = $this->repo->getRepoByID($repoID);
|
||||
$product = $this->loadModel('product')->getById($repo->product);
|
||||
$modules = $this->loadModel('tree')->getOptionMenu($repo->product, 'story');
|
||||
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
/* Build search form. */
|
||||
unset($this->lang->story->statusList['closed']);
|
||||
$storyStatusList = $this->lang->story->statusList;
|
||||
$queryID = $browseType == 'bySearch' ? (int)$param : 0;
|
||||
|
||||
unset($this->config->product->search['fields']['product']);
|
||||
$this->config->product->search['actionURL'] = $this->createLink('repo', 'linkStory', "repoID=$repoID&revision=$revision&browseType=bySearch&queryID=myQueryID");
|
||||
$this->config->product->search['queryID'] = $queryID;
|
||||
$this->config->product->search['style'] = 'simple';
|
||||
$this->config->product->search['params']['plan']['values'] = $this->loadModel('productplan')->getForProducts(array($repo->product => $repo->product));
|
||||
$this->config->product->search['params']['module']['values'] = $modules;
|
||||
$this->config->product->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $storyStatusList);
|
||||
|
||||
if($product->type == 'normal')
|
||||
{
|
||||
unset($this->config->product->search['fields']['branch']);
|
||||
unset($this->config->product->search['params']['branch']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->config->product->search['fields']['branch'] = $this->lang->product->branch;
|
||||
$this->config->product->search['params']['branch']['values'] = array('' => '') + $this->loadModel('branch')->getPairs($productID, 'noempty');
|
||||
}
|
||||
|
||||
session_start();
|
||||
$this->loadModel('search')->setSearchParams($this->config->product->search);
|
||||
session_write_close();
|
||||
|
||||
$linkedStories = $this->repo->getRelationByCommit($repoID, $revision, 'story');
|
||||
if($browseType == 'bySearch')
|
||||
{
|
||||
$allStories = $this->story->getBySearch($product->id, 0, $queryID, 'id', '', 'story', array_keys($linkedStories), $pager);
|
||||
}
|
||||
else
|
||||
{
|
||||
$allStories = $this->story->getProductStories($product->id, 0, '0', 'draft,active,changed', 'story', 'id_desc', false, array_keys($linkedStories), $pager);
|
||||
}
|
||||
|
||||
$this->view->modules = $modules;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->allStories = $allStories;
|
||||
$this->view->product = $product;
|
||||
$this->view->repoID = $repoID;
|
||||
$this->view->revision = $revision;
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->param = $param;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->pager = $pager;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Link bug to commit.
|
||||
*
|
||||
* @param int $repoID
|
||||
* @param string $revision
|
||||
* @param string $browseType
|
||||
* @param int $param
|
||||
* @param string $orderBy
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function linkBug($repoID, $revision = '', $browseType = '', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 100, $pageID = 1)
|
||||
{
|
||||
if(!empty($_POST['bugs']))
|
||||
{
|
||||
$this->repo->link($repoID, $revision, 'bug');
|
||||
|
||||
if(dao::isError()) return print(js::error(dao::getError()));
|
||||
return print(js::closeModal('parent', '', "parent[1].getRelation('$revision')"));
|
||||
}
|
||||
|
||||
$this->loadModel('bug');
|
||||
$this->app->loadLang('productplan');
|
||||
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
|
||||
|
||||
$repo = $this->repo->getRepoByID($repoID);
|
||||
$product = $this->loadModel('product')->getById($repo->product);
|
||||
$modules = $this->loadModel('tree')->getOptionMenu($product->id, 'bug');
|
||||
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
/* Build search form. */
|
||||
$this->config->bug->search['actionURL'] = $this->createLink('repo', 'linkBug', "repoID=$repoID&revision=$revision&browseType=bySearch&queryID=myQueryID");
|
||||
$this->config->bug->search['queryID'] = $queryID;
|
||||
$this->config->bug->search['style'] = 'simple';
|
||||
$this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getForProducts(array($product->id => $product->id));
|
||||
$this->config->bug->search['params']['module']['values'] = $modules;
|
||||
$this->config->bug->search['params']['execution']['values'] = $this->product->getExecutionPairsByProduct($product->id);
|
||||
$this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs($product->id, $branch = 'all', $params = '');
|
||||
$this->config->bug->search['params']['resolvedBuild']['values'] = $this->loadModel('build')->getBuildPairs($product->id, $branch = 'all', $params = '');
|
||||
|
||||
unset($this->config->bug->search['fields']['product']);
|
||||
if($product->type == 'normal')
|
||||
{
|
||||
unset($this->config->bug->search['fields']['branch']);
|
||||
unset($this->config->bug->search['params']['branch']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->config->bug->search['fields']['branch'] = $this->lang->product->branch;
|
||||
$this->config->bug->search['params']['branch']['values'] = array('' => '') + $this->loadModel('branch')->getPairs($productID, 'noempty');
|
||||
}
|
||||
session_start();
|
||||
$this->loadModel('search')->setSearchParams($this->config->bug->search);
|
||||
session_write_close();
|
||||
|
||||
$linkedBugs = $this->repo->getRelationByCommit($repoID, $revision, 'bug');
|
||||
if($browseType == 'bySearch')
|
||||
{
|
||||
$allBugs = $this->bug->getBySearch($product->id, 0, $queryID, 'id_desc', array_keys($linkedBugs), $pager);
|
||||
}
|
||||
else
|
||||
{
|
||||
$allBugs = $this->bug->getActiveBugs($product->id, 0, '0', array_keys($linkedBugs), $pager);
|
||||
}
|
||||
|
||||
$this->view->modules = $modules;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->allBugs = $allBugs;
|
||||
$this->view->product = $product;
|
||||
$this->view->repoID = $repoID;
|
||||
$this->view->revision = $revision;
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->param = $param;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->pager = $pager;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Link task to commit.
|
||||
*
|
||||
* @param int $repoID
|
||||
* @param string $revision
|
||||
* @param string $browseType
|
||||
* @param int $param
|
||||
* @param string $orderBy
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function linkTask($repoID, $revision = '', $browseType = 'unclosed', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 100, $pageID = 1)
|
||||
{
|
||||
if(!empty($_POST['tasks']))
|
||||
{
|
||||
$this->repo->link($repoID, $revision, 'task');
|
||||
|
||||
if(dao::isError()) return print(js::error(dao::getError()));
|
||||
return print(js::closeModal('parent', '', "parent[1].getRelation('$revision')"));
|
||||
}
|
||||
|
||||
$this->loadModel('execution');
|
||||
$this->loadModel('product');
|
||||
$this->app->loadLang('task');
|
||||
|
||||
/* Set browse type. */
|
||||
$browseType = strtolower($browseType);
|
||||
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
|
||||
|
||||
$repo = $this->repo->getRepoByID($repoID);
|
||||
$product = $this->loadModel('product')->getById($repo->product);
|
||||
$modules = $this->loadModel('tree')->getOptionMenu($product->id, $viewType = 'task');
|
||||
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
/* Build search form. */
|
||||
$this->config->execution->search['actionURL'] = $this->createLink('repo', 'linkTask', "repoID=$repoID&revision=$revision&browseType=bySearch&queryID=myQueryID", '', true);
|
||||
$this->config->execution->search['queryID'] = $queryID;
|
||||
$this->config->execution->search['style'] = 'simple';
|
||||
$this->config->execution->search['params']['module']['values'] = $modules;
|
||||
$this->config->execution->search['params']['execution']['values'] = $this->product->getExecutionPairsByProduct($product->id);
|
||||
|
||||
/* Get executions by product. */
|
||||
$productExecutions = $this->product->getExecutionPairsByProduct($product->id);
|
||||
$productExecutionIDs = array_filter(array_keys($productExecutions));
|
||||
$this->config->execution->search['params']['execution']['values'] = array_filter($productExecutions);
|
||||
|
||||
session_start();
|
||||
$this->loadModel('search')->setSearchParams($this->config->execution->search);
|
||||
session_write_close();
|
||||
|
||||
/* Get tasks by executions. */
|
||||
$allTasks = array();
|
||||
foreach($productExecutionIDs as $productExecutionID)
|
||||
{
|
||||
$tasks = $this->execution->getTasks(0, $productExecutionID, array(), $browseType, $queryID, 0, $orderBy, null);
|
||||
$allTasks = array_merge($tasks, $allTasks);
|
||||
}
|
||||
|
||||
/* Filter linked tasks. */
|
||||
$linkedTasks = $this->repo->getRelationByCommit($repoID, $revision, 'task');
|
||||
$linkedTaskIDs = array_keys($linkedTasks);
|
||||
foreach($allTasks as $key => $task)
|
||||
{
|
||||
if(in_array($task->id, $linkedTaskIDs)) unset($allTasks[$key]);
|
||||
}
|
||||
|
||||
/* Page the records. */
|
||||
$pager->setRecTotal(count($allTasks));
|
||||
$pager->setPageTotal();
|
||||
if($pager->pageID > $pager->pageTotal) $pager->setPageID($pager->pageTotal);
|
||||
$count = 1;
|
||||
$limitMin = ($pager->pageID - 1) * $pager->recPerPage;
|
||||
$limitMax = $pager->pageID * $pager->recPerPage;
|
||||
foreach($allTasks as $key => $task)
|
||||
{
|
||||
if($count <= $limitMin or $count > $limitMax) unset($allTasks[$key]);
|
||||
$count ++;
|
||||
}
|
||||
|
||||
$this->view->modules = $modules;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->allTasks = $allTasks;
|
||||
$this->view->product = $product;
|
||||
$this->view->repoID = $repoID;
|
||||
$this->view->revision = $revision;
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->param = $param;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->pager = $pager;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax sync comment.
|
||||
*
|
||||
|
||||
@@ -132,3 +132,16 @@ $(function()
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
/**
|
||||
* Load link object page.
|
||||
*
|
||||
* @param string $link
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function loadLinkPage(link)
|
||||
{
|
||||
$('#linkObject').attr('href', link);
|
||||
$('#linkObject').click()
|
||||
}
|
||||
|
||||
@@ -41,6 +41,8 @@ $lang->repo->downloadZip = 'Download Zip file';
|
||||
$lang->repo->sshClone = 'Clone with SSH';
|
||||
$lang->repo->httpClone = 'Clone with HTTP';
|
||||
$lang->repo->cloneUrl = 'Clone URL';
|
||||
$lang->repo->linkTask = 'Link Task';
|
||||
$lang->repo->unlinkedTasks = 'Unlinked Tasks';
|
||||
|
||||
$lang->repo->submit = 'Submit';
|
||||
$lang->repo->cancel = 'Cancel';
|
||||
@@ -104,6 +106,9 @@ $lang->repo->job = 'Job';
|
||||
$lang->repo->fileServerUrl = 'File Server Url';
|
||||
$lang->repo->fileServerAccount = 'File Server Account';
|
||||
$lang->repo->fileServerPassword = 'File Server Password';
|
||||
$lang->repo->linkStory = 'Link ' . $lang->SRCommon;
|
||||
$lang->repo->linkBug = 'Link Bug';
|
||||
$lang->repo->linkTask = 'Link Task';
|
||||
|
||||
$lang->repo->title = 'Title';
|
||||
$lang->repo->status = 'Status';
|
||||
|
||||
@@ -41,6 +41,8 @@ $lang->repo->downloadZip = 'Download compressed package';
|
||||
$lang->repo->sshClone = 'Clone with SSH';
|
||||
$lang->repo->httpClone = 'Clone with HTTP';
|
||||
$lang->repo->cloneUrl = 'Clone URL';
|
||||
$lang->repo->linkTask = 'Link Task';
|
||||
$lang->repo->unlinkedTasks = 'Unlinked Tasks';
|
||||
|
||||
$lang->repo->submit = 'Submit';
|
||||
$lang->repo->cancel = 'Cancel';
|
||||
@@ -104,6 +106,9 @@ $lang->repo->job = 'Job';
|
||||
$lang->repo->fileServerUrl = 'File Server Url';
|
||||
$lang->repo->fileServerAccount = 'File Server Account';
|
||||
$lang->repo->fileServerPassword = 'File Server Password';
|
||||
$lang->repo->linkStory = 'Link ' . $lang->SRCommon;
|
||||
$lang->repo->linkBug = 'Link Bug';
|
||||
$lang->repo->linkTask = 'Link Task';
|
||||
|
||||
$lang->repo->title = 'Title';
|
||||
$lang->repo->status = 'Status';
|
||||
|
||||
@@ -41,6 +41,8 @@ $lang->repo->downloadZip = 'Download compressed package';
|
||||
$lang->repo->sshClone = 'Clone with SSH';
|
||||
$lang->repo->httpClone = 'Clone with HTTP';
|
||||
$lang->repo->cloneUrl = 'Clone URL';
|
||||
$lang->repo->linkTask = 'Link Task';
|
||||
$lang->repo->unlinkedTasks = 'Unlinked Tasks';
|
||||
|
||||
$lang->repo->submit = 'Soumettre';
|
||||
$lang->repo->cancel = 'Annuler';
|
||||
@@ -104,6 +106,9 @@ $lang->repo->job = 'Job';
|
||||
$lang->repo->fileServerUrl = 'File Server Url';
|
||||
$lang->repo->fileServerAccount = 'File Server Account';
|
||||
$lang->repo->fileServerPassword = 'File Server Password';
|
||||
$lang->repo->linkStory = 'Link ' . $lang->SRCommon;
|
||||
$lang->repo->linkBug = 'Link Bug';
|
||||
$lang->repo->linkTask = 'Link Task';
|
||||
|
||||
$lang->repo->title = 'Titre';
|
||||
$lang->repo->status = 'Statut';
|
||||
|
||||
@@ -41,6 +41,8 @@ $lang->repo->downloadZip = 'Download compressed package';
|
||||
$lang->repo->sshClone = 'Clone with SSH';
|
||||
$lang->repo->httpClone = 'Clone with HTTP';
|
||||
$lang->repo->cloneUrl = 'Clone URL';
|
||||
$lang->repo->linkTask = 'Link Task';
|
||||
$lang->repo->unlinkedTasks = 'Unlinked Tasks';
|
||||
|
||||
$lang->repo->submit = 'Gửi';
|
||||
$lang->repo->cancel = 'Hủy';
|
||||
@@ -104,6 +106,9 @@ $lang->repo->job = 'Job';
|
||||
$lang->repo->fileServerUrl = 'File Server Url';
|
||||
$lang->repo->fileServerAccount = 'File Server Account';
|
||||
$lang->repo->fileServerPassword = 'File Server Password';
|
||||
$lang->repo->linkStory = 'Link ' . $lang->SRCommon;
|
||||
$lang->repo->linkBug = 'Link Bug';
|
||||
$lang->repo->linkTask = 'Link Task';
|
||||
|
||||
$lang->repo->title = 'Tiêu đề';
|
||||
$lang->repo->status = 'Tình trạng';
|
||||
|
||||
@@ -41,6 +41,8 @@ $lang->repo->downloadZip = '下载压缩包';
|
||||
$lang->repo->sshClone = '使用SSH克隆';
|
||||
$lang->repo->httpClone = '使用HTTP克隆';
|
||||
$lang->repo->cloneUrl = '克隆地址';
|
||||
$lang->repo->linkTask = '关联任务';
|
||||
$lang->repo->unlinkedTasks = '未关联任务';
|
||||
|
||||
$lang->repo->submit = '提交';
|
||||
$lang->repo->cancel = '取消';
|
||||
@@ -104,6 +106,9 @@ $lang->repo->job = '构建任务';
|
||||
$lang->repo->fileServerUrl = '预合并后上传服务器目录';
|
||||
$lang->repo->fileServerAccount = '文件服务器登录用户名';
|
||||
$lang->repo->fileServerPassword = '文件服务器登录密码';
|
||||
$lang->repo->linkStory = '关联' . $lang->SRCommon;
|
||||
$lang->repo->linkBug = '关联Bug';
|
||||
$lang->repo->linkTask = '关联任务';
|
||||
|
||||
$lang->repo->title = '标题';
|
||||
$lang->repo->status = '状态';
|
||||
|
||||
+41
-3
@@ -313,6 +313,40 @@ class repoModel extends model
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create commit link.
|
||||
*
|
||||
* @param int $repoID
|
||||
* @param string $revision
|
||||
* @param string $type
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function link($repoID, $revision, $type = 'story')
|
||||
{
|
||||
$this->loadModel('action');
|
||||
if($type == 'story') $links = $this->post->stories;
|
||||
if($type == 'bug') $links = $this->post->bugs;
|
||||
if($type == 'task') $links = $this->post->tasks;
|
||||
|
||||
$revisionID = $this->dao->select('id')->from(TABLE_REPOHISTORY)->where('repo')->eq($repoID)->andWhere('revision')->eq($revision)->fetch('id');
|
||||
foreach($links as $linkID)
|
||||
{
|
||||
$relation = new stdclass;
|
||||
$relation->AType = 'revision';
|
||||
$relation->AID = $revisionID;
|
||||
$relation->relation = 'commit';
|
||||
$relation->BType = $type;
|
||||
$relation->BID = $linkID;
|
||||
|
||||
$this->dao->replace(TABLE_RELATION)->data($relation)->exec();
|
||||
|
||||
if($type == 'story') $this->action->create('story', $linkID, 'createmr');
|
||||
if($type == 'bug') $this->action->create('bug', $linkID, 'createmr');
|
||||
if($type == 'task') $this->action->create('task', $linkID, 'createmr');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save repo state.
|
||||
*
|
||||
@@ -2593,16 +2627,18 @@ class repoModel extends model
|
||||
*
|
||||
* @param int $repoID
|
||||
* @param string $commit
|
||||
* @param string $type story|bug|task
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getRelationByCommit($repoID, $commit)
|
||||
public function getRelationByCommit($repoID, $commit, $type = '')
|
||||
{
|
||||
$relationList = $this->dao->select('t1.BID as id, t1.BType as type')->from(TABLE_RELATION)->alias('t1')
|
||||
->leftJoin(TABLE_REPOHISTORY)->alias('t2')
|
||||
->on('t1.AID = t2.id')
|
||||
->leftJoin(TABLE_REPOHISTORY)->alias('t2')->on('t1.AID = t2.id')
|
||||
->where('t2.revision')->eq($commit)
|
||||
->andWhere('t2.repo')->eq($repoID)
|
||||
->andWhere('t1.AType')->eq('revision')
|
||||
->beginIF($type)->andWhere('t1.BType')->eq($type)->fi()
|
||||
->fetchAll();
|
||||
|
||||
$storyIDs = array();
|
||||
@@ -2630,6 +2666,8 @@ class repoModel extends model
|
||||
$titleList = array();
|
||||
foreach($relationList as $key => $relation)
|
||||
{
|
||||
if($type) $key = $relation->id;
|
||||
|
||||
$titleList[$key] = array(
|
||||
'id' => $relation->id,
|
||||
'type' => $relation->type,
|
||||
|
||||
@@ -17,8 +17,13 @@ js::set('codeContent', trim($content));
|
||||
js::set('file', $pathInfo);
|
||||
js::set('blames', $blames);
|
||||
js::set('blameTmpl', $lang->repo->blamTmpl);
|
||||
js::set('repoID', $repoID);
|
||||
js::import($jsRoot . '/zui/tabs/tabs.min.js');
|
||||
js::import($jsRoot . 'monaco-editor/min/vs/loader.js');
|
||||
$canLinkStory = common::hasPriv('repo', 'linkStory');
|
||||
$canLinkBug = common::hasPriv('repo', 'linkBug');
|
||||
$canLinkTask = common::hasPriv('repo', 'linkTask');
|
||||
$canUnlinkObject = common::hasPriv('repo', 'unlinkObject');
|
||||
?>
|
||||
<div id="monacoEditor">
|
||||
<div id="codeContainer"></div>
|
||||
@@ -31,13 +36,14 @@ js::import($jsRoot . 'monaco-editor/min/vs/loader.js');
|
||||
<div class="content panel">
|
||||
<div class='btn-toolbar'>
|
||||
<div class="btn btn-left pull-left"><i class="icon icon-chevron-left"></i></div>
|
||||
<?php if(common::hasPriv('repo', 'blame') or common::hasPriv('repo', 'download')):?>
|
||||
<?php if($canLinkStory or $canLinkBug or $canLinkTask or $canUnlinkObject):?>
|
||||
<div class="dropdown pull-right">
|
||||
<button class="btn" type="button" data-toggle="context-dropdown"><i class="icon icon-ellipsis-v icon-rotate-90"></i></button>
|
||||
<ul class="dropdown-menu">
|
||||
<?php
|
||||
if(common::hasPriv('repo', 'blame')) echo '<li>' . html::a($this->repo->createLink('blame', ""), '<i class="icon icon-change"></i> ' . $lang->repo->blame, '', "data-app='{$app->tab}'") . '</li>';
|
||||
if(common::hasPriv('repo', 'download')) echo '<li>' . html::a($this->repo->createLink('download', ""), '<i class="icon icon-download"></i> ' . $lang->repo->download, 'hiddenwin') . '</li>';
|
||||
if($canLinkStory) echo '<li id="linkStory">' . html::a('javascript:;', '<i class="icon icon-lightbulb"></i> ' . $lang->repo->linkStory) . '</li>';
|
||||
if($canLinkBug) echo '<li id="linkBug">' . html::a('javascript:;', '<i class="icon icon-bug"></i> ' . $lang->repo->linkBug) . '</li>';
|
||||
if($canLinkTask) echo '<li id="linkTask">' . html::a('javascript:;', '<i class="icon icon-todo"></i> ' . $lang->repo->linkTask) . '</li>';
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -52,74 +58,87 @@ js::import($jsRoot . 'monaco-editor/min/vs/loader.js');
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function()
|
||||
var codeHeight = $(window).innerHeight() - $('#mainHeader').height() - $('#appsBar').height() - $('#fileTabs .tabs-navbar').height();
|
||||
$('#codeContainer').css('height', codeHeight);
|
||||
|
||||
/**
|
||||
* Get relation by commit.
|
||||
*
|
||||
* @param string $commit
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function getRelation(commit)
|
||||
{
|
||||
var codeHeight = $(window).innerHeight() - $('#mainHeader').height() - $('#appsBar').height() - $('#fileTabs .tabs-navbar').height();
|
||||
$('#codeContainer').css('height', codeHeight);
|
||||
$('#codeContainer').css('height', codeHeight / 5 * 3);
|
||||
$tabs = $('#relationTabs').data('zui.tabs');
|
||||
if($tabs) $tabs.closeAll();
|
||||
|
||||
/**
|
||||
* Get relation by commit.
|
||||
*
|
||||
* @param string $commit
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function getRelation(commit)
|
||||
$.post(createLink('repo', 'ajaxGetCommitRelation', 'revision=' + commit), function(data)
|
||||
{
|
||||
$('#codeContainer').css('height', codeHeight / 5 * 3);
|
||||
$tabs = $('#relationTabs').data('zui.tabs');
|
||||
if($tabs) $tabs.closeAll();
|
||||
|
||||
$.post(createLink('repo', 'ajaxGetCommitRelation', 'commit=' + commit), function(data)
|
||||
var titleList = JSON.parse(data).titleList;
|
||||
var tabs = [];
|
||||
$.each(titleList, function(i, titleObj)
|
||||
{
|
||||
var titleList = JSON.parse(data).titleList;
|
||||
var tabs = [];
|
||||
$.each(titleList, function(i, titleObj)
|
||||
var tab = setTab(titleObj);
|
||||
if($tabs)
|
||||
{
|
||||
var tab = setTab(titleObj);
|
||||
if($tabs)
|
||||
{
|
||||
$tabs.open(tab);
|
||||
}
|
||||
else
|
||||
{
|
||||
tabs.push(tab);
|
||||
}
|
||||
});
|
||||
|
||||
if(titleList.length > 0)
|
||||
$tabs.open(tab);
|
||||
}
|
||||
else
|
||||
{
|
||||
if($tabs)
|
||||
{
|
||||
$tabs.open(setTab(titleList[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#relationTabs').tabs({tabs: tabs});
|
||||
}
|
||||
tabs.push(tab);
|
||||
}
|
||||
});
|
||||
$('#related').show();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set tab data.
|
||||
*
|
||||
* @param object $titleObj
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
function setTab(titleObj)
|
||||
if(titleList.length > 0)
|
||||
{
|
||||
if($tabs)
|
||||
{
|
||||
$tabs.open(setTab(titleList[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#relationTabs').tabs({tabs: tabs});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var linkStory = createLink('repo', 'linkStory', 'repoID=' + repoID + '&commit=' + commit, '', true);
|
||||
var linkBug = createLink('repo', 'linkBug', 'repoID=' + repoID + '&commit=' + commit, '', true);
|
||||
var linkTask = createLink('repo', 'linkTask', 'repoID=' + repoID + '&commit=' + commit, '', true);
|
||||
$('#linkStory a').attr('data-link', linkStory);
|
||||
$('#linkBug a').attr('data-link', linkBug);
|
||||
$('#linkTask a').attr('data-link', linkTask);
|
||||
$('#related').show();
|
||||
|
||||
$('#linkStory a, #linkBug a, #linkTask a').on('click', function()
|
||||
{
|
||||
return {
|
||||
id: titleObj.type + '-' + titleObj.id,
|
||||
title: ' ' + titleObj.title,
|
||||
icon: titleObj.type == 'story' ? 'icon-lightbulb' : (titleObj.type == 'task' ? 'icon-check-sign' : 'icon-bug'),
|
||||
type: 'iframe',
|
||||
url: createLink('repo', 'ajaxGetRelationInfo', 'objectID=' + titleObj.id + '&objectType=' + titleObj.type)
|
||||
};
|
||||
}
|
||||
var link = $(this).data('link');
|
||||
parent.loadLinkPage(link);
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Set tab data.
|
||||
*
|
||||
* @param object $titleObj
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
function setTab(titleObj)
|
||||
{
|
||||
return {
|
||||
id: titleObj.type + '-' + titleObj.id,
|
||||
title: ' ' + titleObj.title,
|
||||
icon: titleObj.type == 'story' ? 'icon-lightbulb' : (titleObj.type == 'task' ? 'icon-check-sign' : 'icon-bug'),
|
||||
type: 'iframe',
|
||||
url: createLink('repo', 'ajaxGetRelationInfo', 'objectID=' + titleObj.id + '&objectType=' + titleObj.type)
|
||||
};
|
||||
}
|
||||
|
||||
$(function()
|
||||
{
|
||||
require.config({
|
||||
paths: {vs: jsRoot + 'monaco-editor/min/vs'},
|
||||
'vs/nls': {
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
/**
|
||||
* The link bug view of productplan module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2021 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package mr
|
||||
* @version $Id: linkbug.html.php$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/sortable.html.php';?>
|
||||
<?php include '../../common/view/tablesorter.html.php';?>
|
||||
<style>
|
||||
#queryBox {padding-top: 25px;}
|
||||
</style>
|
||||
<div id='queryBox' data-module='bug' class='show no-margin'></div>
|
||||
<div id='unlinkBugList'>
|
||||
<form class='main-table table-bug' data-ride='table' method='post' id='unlinkedBugsForm' target='hiddenwin' action='<?php echo $this->createLink('repo', 'linkBug', "repoID=$repoID&revision=$revision&browseType=$browseType¶m=$param&orderBy=$orderBy")?>'>
|
||||
<div class='table-header hl-primary text-primary strong'>
|
||||
<?php echo html::icon('unlink');?> <?php echo $lang->productplan->unlinkedBugs;?>
|
||||
</div>
|
||||
<table class='table tablesorter'>
|
||||
<thead>
|
||||
<tr class='text-center'>
|
||||
<th class='c-id text-left'>
|
||||
<?php if($allBugs):?>
|
||||
<div class="checkbox-primary check-all tablesorter-noSort" title="<?php echo $lang->selectAll?>">
|
||||
<label></label>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php echo $lang->idAB;?>
|
||||
</th>
|
||||
<th class='c-pri' title=<?php echo $lang->pri;?>><?php echo $lang->priAB;?></th>
|
||||
<th class='text-left'><?php echo $lang->bug->title;?></th>
|
||||
<th class='c-user'><?php echo $lang->openedByAB;?></th>
|
||||
<th class='c-user'><?php echo $lang->bug->assignedToAB;?></th>
|
||||
<th class='c-status'><?php echo $lang->bug->status;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class='text-center'>
|
||||
<?php $unlinkedCount = 0;?>
|
||||
<?php foreach($allBugs as $bug):?>
|
||||
<tr>
|
||||
<td class='c-id text-left'>
|
||||
<?php echo html::checkbox('bugs', array($bug->id => sprintf('%03d', $bug->id)));?>
|
||||
</td>
|
||||
<td><span class='label-pri label-pri-<?php echo $bug->pri;?>' title='<?php echo zget($lang->bug->priList, $bug->pri, $bug->pri)?>'><?php echo zget($lang->bug->priList, $bug->pri, $bug->pri)?></span></td>
|
||||
<td class='text-left nobr' title='<?php echo $bug->title?>'><?php echo html::a($this->createLink('bug', 'view', "bugID=$bug->id", '', true), $bug->title, '', "data-toggle='modal' data-type='iframe' data-width='90%'");?></td>
|
||||
<td><?php echo zget($users, $bug->openedBy);?></td>
|
||||
<td><?php echo zget($users, $bug->assignedTo);?></td>
|
||||
<td>
|
||||
<span class='status-bug status-<?php echo $bug->status?>'>
|
||||
<?php echo $this->processStatus('bug', $bug);?>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $unlinkedCount++;?>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class='table-footer'>
|
||||
<?php if($unlinkedCount):?>
|
||||
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
|
||||
<div class="table-actions btn-toolbar">
|
||||
<?php echo html::submitButton($lang->productplan->linkBug, '', 'btn');?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<div class='table-statistic'></div>
|
||||
<?php $pager->show('right', 'pagerjs');?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
$('#unlinkBugList .tablesorter').sortTable();
|
||||
setForm();
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
/**
|
||||
* The link story view of repo module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2022 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author yuchun li
|
||||
* @package repo
|
||||
* @version $Id: linkstory.html.php 5096 2022-07-25 07:02:43Z liycuhun@easycorp.ltd $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/sortable.html.php';?>
|
||||
<?php include '../../common/view/tablesorter.html.php';?>
|
||||
<div class='main-content' id='mainContent'>
|
||||
<div class='main-header'> </div>
|
||||
<div id='queryBox' data-module='story' class='show no-margin'></div>
|
||||
<form class="main-table table-story" data-ride="table" method="post" target='hiddenwin' id='linkStoryForm' action="<?php echo $this->createLink('repo', 'linkStory', "repoID=$repoID&revision=$revision&browseType=$browseType¶m=$param&orderBy=$orderBy")?>">
|
||||
<div class='table-header hl-primary text-primary strong'>
|
||||
<?php echo html::icon('unlink');?> <?php echo $lang->productplan->unlinkedStories;?>
|
||||
</div>
|
||||
<table class='table tablesorter'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='c-id text-left'>
|
||||
<?php if($allStories):?>
|
||||
<div class="checkbox-primary check-all tablesorter-noSort" title="<?php echo $lang->selectAll?>">
|
||||
<label></label>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php echo $lang->idAB;?>
|
||||
</th>
|
||||
<th class='c-pri' title=<?php echo $lang->pri;?>><?php echo $lang->priAB;?></th>
|
||||
<th class='c-plan'><?php echo $lang->story->plan;?></th>
|
||||
<th class='c-module'><?php echo $lang->story->module;?></th>
|
||||
<th class='text-left'><?php echo $lang->story->title;?></th>
|
||||
<th class='c-user'><?php echo $lang->openedByAB;?></th>
|
||||
<th class='c-user'><?php echo $lang->assignedToAB;?></th>
|
||||
<th class='c-number text-right'><?php echo $lang->story->estimateAB;?></th>
|
||||
<th class='c-status'><?php echo $lang->statusAB;?></th>
|
||||
<th class='c-stage'><?php echo $lang->story->stageAB;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $unlinkedCount = 0;?>
|
||||
<?php foreach($allStories as $story):?>
|
||||
<tr>
|
||||
<td class='c-id text-left'>
|
||||
<?php echo html::checkbox('stories', array($story->id => sprintf('%03d', $story->id)));?>
|
||||
</td>
|
||||
<td><span class='label-pri <?php echo 'label-pri-' . $story->pri;?>' title='<?php echo zget($lang->story->priList, $story->pri, $story->pri)?>'><?php echo zget($lang->story->priList, $story->pri, $story->pri)?></span></td>
|
||||
<td><?php echo $story->planTitle;?></td>
|
||||
<td title='<?php echo zget($modules, $story->module, '/')?>' class='text-left'><?php echo zget($modules, $story->module, '/');?></td>
|
||||
<td class='text-left nobr' title='<?php echo $story->title?>'>
|
||||
<?php
|
||||
if($story->parent > 0) echo "<span class='label label-badge label-light' title={$lang->story->children}>{$lang->story->childrenAB}</span>";
|
||||
echo html::a($this->createLink('story', 'view', "storyID=$story->id", '', true), $story->title, '', "data-toggle='modal' data-type='iframe' data-width='90%'");
|
||||
?>
|
||||
</td>
|
||||
<td><?php echo zget($users, $story->openedBy);?></td>
|
||||
<td><?php echo zget($users, $story->assignedTo);?></td>
|
||||
<td class='text-right'title="<?php echo $story->estimate . ' ' . $lang->hourCommon;?>"><?php echo $story->estimate . $config->hourUnit;?></td>
|
||||
<td>
|
||||
<span class='status-story status-<?php echo $story->status?>'>
|
||||
<?php echo $this->processStatus('story', $story);?>
|
||||
</span>
|
||||
</td>
|
||||
<td class='text-center'><?php echo $lang->story->stageList[$story->stage];?></td>
|
||||
</tr>
|
||||
<?php $unlinkedCount++;?>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class='table-footer'>
|
||||
<?php if($unlinkedCount):?>
|
||||
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
|
||||
<div class="table-actions btn-toolbar">
|
||||
<?php echo html::submitButton($lang->productplan->linkStory, '', 'btn');?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<div class='table-statistic'></div>
|
||||
<?php $pager->show('right', 'pagerjs');?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
$('#unlinkStoryList .tablesorter').sortTable();
|
||||
setForm();
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
/**
|
||||
* The link task view of repo module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2022 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Yuchun Li <liyuchun@easycorp.ltd>
|
||||
* @package repo
|
||||
* @version $Id: linktask.html.php$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/sortable.html.php';?>
|
||||
<?php include '../../common/view/tablesorter.html.php';?>
|
||||
<style>
|
||||
#queryBox {padding-top: 25px;}
|
||||
</style>
|
||||
<div id='queryBox' data-module='task' class='show no-margin'></div>
|
||||
<div id='unlinkTaskList'>
|
||||
<form class='main-table table-task' data-ride='table' method='post' id='unlinkedTasksForm' target='hiddenwin' action='<?php echo $this->createLink('repo', 'linkTask', "repoID=$repoID&revision=$revision&browseType=$browseType¶m=$param&orderBy=$orderBy")?>'>
|
||||
<div class='table-header hl-primary text-primary strong'>
|
||||
<?php echo html::icon('unlink');?> <?php echo $lang->repo->unlinkedTasks;?>
|
||||
</div>
|
||||
<table class='table tablesorter'>
|
||||
<thead>
|
||||
<tr class='text-center'>
|
||||
<th class='c-id text-left'>
|
||||
<?php if($allTasks):?>
|
||||
<div class="checkbox-primary check-all tablesorter-noSort" title="<?php echo $lang->selectAll?>">
|
||||
<label></label>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php echo $lang->idAB;?>
|
||||
</th>
|
||||
<th class='c-pri' title=<?php echo $lang->pri;?>><?php echo $lang->priAB;?></th>
|
||||
<th class='text-left'><?php echo $lang->task->name;?></th>
|
||||
<th class='c-user'><?php echo $lang->task->finishedByAB;?></th>
|
||||
<th class='c-user'><?php echo $lang->task->assignedToAB;?></th>
|
||||
<th class='c-status'><?php echo $lang->task->status;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class='text-center'>
|
||||
<?php $unlinkedCount = 0;?>
|
||||
<?php foreach($allTasks as $task):?>
|
||||
<tr>
|
||||
<td class='c-id text-left'>
|
||||
<?php echo html::checkbox('tasks', array($task->id => sprintf('%03d', $task->id)));?>
|
||||
</td>
|
||||
<td><span class='label-pri label-pri-<?php echo $task->pri;?>' title='<?php echo zget($lang->task->priList, $task->pri, $task->pri)?>'><?php echo zget($lang->task->priList, $task->pri, $task->pri)?></span></td>
|
||||
<td class='text-left nobr' title='<?php echo $task->name?>'><?php echo html::a($this->createLink('task', 'view', "taskID=$task->id", '', true), $task->name, '', "data-toggle='modal' data-type='iframe' data-width='90%'");?></td>
|
||||
<td><?php echo zget($users, $task->finishedBy);?></td>
|
||||
<td><?php echo zget($users, $task->assignedTo);?></td>
|
||||
<td>
|
||||
<span class='status-task status-<?php echo $task->status?>'>
|
||||
<?php echo $this->processStatus('task', $task);?>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $unlinkedCount++;?>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class='table-footer'>
|
||||
<?php if($unlinkedCount):?>
|
||||
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
|
||||
<div class="table-actions btn-toolbar">
|
||||
<?php echo html::submitButton($lang->repo->linkTask, '', 'btn');?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<div class='table-statistic'></div>
|
||||
<?php $pager->show('right', 'pagerjs');?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
$('#unlinkTaskList .tablesorter').sortTable();
|
||||
setForm();
|
||||
});
|
||||
</script>
|
||||
@@ -77,4 +77,5 @@ $encodePath = $this->repo->encodePath($entry);
|
||||
<?php if(!isonlybody()):?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<a href='' class='iframe' data-width='90%' id='linkObject'></a>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
Reference in New Issue
Block a user