Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms
This commit is contained in:
@@ -13,7 +13,7 @@ foreach($branches as $branchID => $branch)
|
||||
|
||||
if($branchID == 'all' or empty($branchID) or $statusList[$branchID] == 'active')
|
||||
{
|
||||
$activeBranchesHtml .= html::a($linkHtml, $branch, '', "class='$selected' data-key='{$branchesPinyin[$branch]}' data-app='{$this->app->tab}'");
|
||||
$activeBranchesHtml .= html::a($linkHtml, $branch, '', "class='$selected' data-key='{$branchesPinyin[$branch]}'");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@ if(empty($type)) $type = 'product';
|
||||
echo "<ul class='dropdown-menu 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>' . html::a($this->createLink('tree', 'browse', "rootID=$libID&view=doc¤tModuleID=0&branch=0&from={$this->app->tab}", '', 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>';
|
||||
@@ -112,7 +112,7 @@ if(empty($type)) $type = 'product';
|
||||
}
|
||||
else
|
||||
{
|
||||
common::printLink('tree', 'browse', "rootID=$libID&view=doc", $lang->doc->manageType, '', "class='btn btn-info btn-wide iframe'", '', true);
|
||||
common::printLink('tree', 'browse', "rootID=$libID&view=doc¤tModuleID=0&branch=0&from={$this->app->tab}", $lang->doc->manageType, '', "class='btn btn-info btn-wide iframe'", '', true);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -755,13 +755,22 @@ class execution extends control
|
||||
$users = $this->user->getPairs('noletter');
|
||||
|
||||
/* Build the search form. */
|
||||
$modules = array();
|
||||
$modules = array();
|
||||
$productModules = array();
|
||||
$executionModules = $this->loadModel('tree')->getTaskTreeModules($executionID, true);
|
||||
$products = $this->product->getProducts($executionID);
|
||||
foreach($products as $product)
|
||||
$products = $this->product->getProducts($executionID);
|
||||
if($productID)
|
||||
{
|
||||
$productModules = $this->tree->getOptionMenu($product->id);
|
||||
foreach($productModules as $moduleID => $moduleName)
|
||||
$product = $products[$productID];
|
||||
$productModules = $this->tree->getOptionMenu($productID, 'story', 0, $product->branches);
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($products as $product) $productModules += $this->tree->getOptionMenu($product->id, 'story', 0, $product->branches);
|
||||
}
|
||||
foreach($productModules as $branchID => $moduleList)
|
||||
{
|
||||
foreach($moduleList as $moduleID => $moduleName)
|
||||
{
|
||||
if($moduleID and !isset($executionModules[$moduleID])) continue;
|
||||
$modules[$moduleID] = ((count($products) >= 2 and $moduleID) ? $product->name : '') . $moduleName;
|
||||
|
||||
@@ -727,8 +727,8 @@ class gitlab extends control
|
||||
$projectID = $repo->project;
|
||||
|
||||
$gitlab = $this->gitlab->getByID($gitlabID);
|
||||
$user = $this->gitlab->apiGetCurrentUser($gitlab->url, $gitlab->token);
|
||||
if(!isset($user->is_admin) or !$user->is_admin) die(js::alert($this->lang->gitlab->tokenLimit) . js::locate($this->createLink('gitlab', 'edit', array('gitlabID' => $gitlabID))));
|
||||
if($gitlab) $user = $this->gitlab->apiGetCurrentUser($gitlab->url, $gitlab->token);
|
||||
if(empty($user->is_admin)) die(js::alert($this->lang->gitlab->tokenLimit) . js::locate($this->createLink('gitlab', 'edit', array('gitlabID' => $gitlabID))));
|
||||
|
||||
|
||||
if($_POST)
|
||||
|
||||
@@ -279,7 +279,7 @@ class product extends control
|
||||
$actionURL = $this->createLink($rawModule, $rawMethod, $params . "productID=$productID&branch=$branch&browseType=bySearch&queryID=myQueryID&storyType=$storyType");
|
||||
|
||||
$this->config->product->search['onMenuBar'] = 'yes';
|
||||
$this->product->buildSearchForm($productID, $this->products, $queryID, $actionURL);
|
||||
$this->product->buildSearchForm($productID, $this->products, $queryID, $actionURL, $branch);
|
||||
|
||||
$showModule = !empty($this->config->datatable->productBrowse->showModule) ? $this->config->datatable->productBrowse->showModule : '';
|
||||
|
||||
|
||||
@@ -896,26 +896,63 @@ class productModel extends model
|
||||
* @param array $products
|
||||
* @param int $queryID
|
||||
* @param int $actionURL
|
||||
* @param int $branch
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function buildSearchForm($productID, $products, $queryID, $actionURL)
|
||||
public function buildSearchForm($productID, $products, $queryID, $actionURL, $branch = 0)
|
||||
{
|
||||
$productIdList = ($this->app->tab == 'project' and empty($productID)) ? array_keys($products) : $productID;
|
||||
$branchParam = ($this->app->tab == 'project' and empty($productID)) ? '' : $branch;
|
||||
|
||||
$this->config->product->search['actionURL'] = $actionURL;
|
||||
$this->config->product->search['queryID'] = $queryID;
|
||||
$this->config->product->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairs(($this->app->tab == 'project' and empty($productID)) ? array_keys($products) : $productID);
|
||||
$this->config->product->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairs($productIdList, $branchParam);
|
||||
|
||||
$product = ($this->app->tab == 'project' and empty($productID)) ? $products : array($productID => $products[$productID]);
|
||||
$this->config->product->search['params']['product']['values'] = $product + array('all' => $this->lang->product->allProduct);
|
||||
|
||||
/* Get module of all products.*/
|
||||
$module = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'story', $startModuleID = 0);
|
||||
if(!$productID)
|
||||
/* Get modules. */
|
||||
$this->loadModel('tree');
|
||||
if($this->app->tab == 'project')
|
||||
{
|
||||
$module = array();
|
||||
foreach($products as $id => $product) $module += $this->loadModel('tree')->getOptionMenu($id, $viewType = 'story', $startModuleID = 0);
|
||||
if($productID)
|
||||
{
|
||||
$modules = array();
|
||||
$branchList = $this->loadModel('branch')->getPairs($productID, '', $this->session->project);
|
||||
$branchModuleList = $this->tree->getOptionMenu($productID, 'story', 0, array_keys($branchList));
|
||||
foreach($branchModuleList as $branchID => $branchModules) $modules += $branchModules;
|
||||
}
|
||||
else
|
||||
{
|
||||
$moduleList = array();
|
||||
$modules = array('' => '/');
|
||||
$branchGroup = $this->loadModel('execution')->getBranchByProduct(array_keys($products), $this->session->project);
|
||||
foreach($products as $productID => $productName)
|
||||
{
|
||||
if(isset($branchGroup[$productID]))
|
||||
{
|
||||
$branchModuleList = $this->tree->getOptionMenu($productID, 'story', 0, array_keys($branchGroup[$productID]));
|
||||
foreach($branchModuleList as $branchID => $branchModules) $moduleList += $branchModules;
|
||||
}
|
||||
else
|
||||
{
|
||||
$moduleList = $this->tree->getOptionMenu($productID, 'story', 0, $branch);
|
||||
}
|
||||
|
||||
foreach($moduleList as $moduleID => $moduleName)
|
||||
{
|
||||
if(empty($moduleID)) continue;
|
||||
$modules[$moduleID] = $productName . $moduleName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->config->product->search['params']['module']['values'] = $module;
|
||||
else
|
||||
{
|
||||
$modules = $this->tree->getOptionMenu($productID, 'story', 0, $branch);
|
||||
}
|
||||
$this->config->product->search['params']['module']['values'] = $modules;
|
||||
|
||||
$productInfo = $this->getById($productID);
|
||||
if(!$productID or $productInfo->type == 'normal' or $this->app->tab == 'assetlib')
|
||||
@@ -1946,7 +1983,9 @@ class productModel extends model
|
||||
}
|
||||
elseif(($module == 'testcase' and $method == 'groupCase') or ($module == 'story' and $method == 'zeroCase') and $this->app->tab == 'project')
|
||||
{
|
||||
$link = helper::createLink($module, $method, "productID=%s" . ($branch ? "&branch=%s" : '')) . "#app=project";
|
||||
parse_str($extra, $output);
|
||||
$projectID = isset($output['projectID']) ? $output['projectID'] : 0;
|
||||
$link = helper::createLink($module, $method, "productID=%s&branch=" . ($branch ? "%s" : '') . "&groupBy=&projectID=$projectID") . "#app=project";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -78,10 +78,11 @@ foreach($products as $programID => $programProducts)
|
||||
$selected = $product->id == $productID ? 'selected' : '';
|
||||
$productName = $product->line ? zget($lines, $product->line, '') . ' / ' . $product->name : $product->name;
|
||||
$linkHtml = $this->product->setParamsForLink($module, $link, $projectID, $product->id);
|
||||
$locateTab = ($module == 'testtask' and $method == 'browseUnits' and $app->tab == 'project') ? '' : "data-app='$app->tab'";
|
||||
|
||||
if($product->status == 'normal' and $product->PO == $this->app->user->account)
|
||||
{
|
||||
$myProductsHtml .= '<li>' . html::a($linkHtml, $productName, '', "class='$selected productName' title='{$productName}' data-key='" . zget($productsPinYin, $product->name, '') . "' data-app='$app->tab'") . '</li>';
|
||||
$myProductsHtml .= '<li>' . html::a($linkHtml, $productName, '', "class='$selected productName' title='{$productName}' data-key='" . zget($productsPinYin, $product->name, '') . "' " . $locateTab) . '</li>';
|
||||
|
||||
if($selected == 'selected') $tabActive = 'myProduct';
|
||||
|
||||
|
||||
@@ -169,7 +169,8 @@ class repo extends control
|
||||
|
||||
if(strtolower($repo->SCM) == 'gitlab')
|
||||
{
|
||||
$projects = $this->loadModel('gitlab')->apiGetProjects($repo->gitlab);
|
||||
$gitlabID = isset($repo->gitlab) ? $repo->gitlab : 0;
|
||||
$projects = $this->loadModel('gitlab')->apiGetProjects($gitlabID);
|
||||
$options = array();
|
||||
foreach($projects as $project) $options[$project->id] = $project->name_with_namespace;
|
||||
|
||||
|
||||
@@ -1783,13 +1783,12 @@ class repoModel extends model
|
||||
public function processGitlab($repo)
|
||||
{
|
||||
$gitlab = $this->loadModel('gitlab')->getByID($repo->client); // The $repo->client is gitlabID.
|
||||
if(!$gitlab) return $repo;
|
||||
|
||||
$repo->gitlab = $gitlab->id;
|
||||
$repo->project = $repo->path; // The projectID in gitlab.
|
||||
$repo->path = sprintf($this->config->repo->gitlab->apiPath, $gitlab->url, $repo->path);
|
||||
$repo->client = $gitlab->url;
|
||||
$repo->password = $gitlab->token;
|
||||
$repo->gitlab = $gitlab ? $gitlab->id : 0;
|
||||
$repo->project = $gitlab ? $repo->path : ''; // The projectID in gitlab.
|
||||
$repo->path = $gitlab ? sprintf($this->config->repo->gitlab->apiPath, $gitlab->url, $repo->path) : '';
|
||||
$repo->client = $gitlab ? $gitlab->url : '';
|
||||
$repo->password = $gitlab ? $gitlab->token : '';
|
||||
return $repo;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,10 +53,13 @@
|
||||
<td class='text-left c-actions'>
|
||||
<?php
|
||||
common::printIcon('repo', 'edit', "repoID=$repo->id&objectID=$objectID", '', 'list', 'edit');
|
||||
echo html::a($this->createLink('gitlab', 'createWebhook', "repoID=$repo->id"), '<i class="icon-change"></i>', 'hiddenwin', "title='{$lang->repo->addWebHook}'");
|
||||
if(strtolower($repo->SCM) == "gitlab") common::printIcon('gitlab', 'importIssue', "repo={$repo->id}", '', 'list', 'link');
|
||||
if(strtolower($repo->SCM) == "gitlab") common::printIcon('gitlab', 'manageProjectMembers', "repo={$repo->id}", '', 'list', 'team');
|
||||
if(common::hasPriv('repo', 'delete')) echo html::a($this->createLink('repo', 'delete', "repoID=$repo->id&objectID=$objectID"), '<i class="icon-trash"></i>', 'hiddenwin', "title='{$lang->repo->delete}' class='btn'");
|
||||
if(strtolower($repo->SCM) == "gitlab")
|
||||
{
|
||||
common::printIcon('gitlab', 'createWebhook', "repoID=$repo->id", '', 'list', 'change', 'hiddenwin');
|
||||
common::printIcon('gitlab', 'importIssue', "repo={$repo->id}", '', 'list', 'link');
|
||||
common::printIcon('gitlab', 'manageProjectMembers', "repo={$repo->id}", '', 'list', 'team');
|
||||
}
|
||||
common::printIcon('repo', 'delete', "repoID=$repo->id&objectID=$objectID", '', 'list', 'trash', 'hiddenwin');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -1724,6 +1724,7 @@ class story extends control
|
||||
*/
|
||||
public function zeroCase($productID = 0, $branchID = 0, $orderBy = 'id_desc', $projectID = 0)
|
||||
{
|
||||
$orderBy = empty($orderBy) ? 'id_desc' : $orderBy;
|
||||
$this->session->set('storyList', $this->app->getURI(true) . '#app=' . $this->app->tab, 'product');
|
||||
$this->session->set('caseList', $this->app->getURI(true), $this->app->tab);
|
||||
|
||||
|
||||
@@ -2491,7 +2491,7 @@ class storyModel extends model
|
||||
{
|
||||
$storyQuery = str_replace($allBranch, '1', $storyQuery);
|
||||
}
|
||||
elseif($branch)
|
||||
elseif($branch !== 'all')
|
||||
{
|
||||
if($branch and strpos($storyQuery, '`branch` =') === false) $storyQuery .= " AND `branch` in($branch)";
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class tree extends control
|
||||
{
|
||||
$this->loadModel('product');
|
||||
|
||||
if($this->app->tab == 'product')
|
||||
if($this->app->tab == 'product' and strpos($viewType, 'doc') === false)
|
||||
{
|
||||
$this->product->setMenu($rootID, $branch, 0, '', $viewType);
|
||||
}
|
||||
@@ -38,7 +38,7 @@ class tree extends control
|
||||
$products = $this->product->getPairs('noclosed');
|
||||
$this->loadModel('qa')->setMenu($products, $rootID, $branch, $viewType);
|
||||
}
|
||||
else if($this->app->tab == 'project')
|
||||
else if($this->app->tab == 'project' and strpos($viewType, 'doc') === false)
|
||||
{
|
||||
$this->loadModel('project')->setMenu($this->session->project);
|
||||
|
||||
@@ -166,7 +166,6 @@ class tree extends control
|
||||
|
||||
$products = $this->product->getPairs();
|
||||
$this->product->saveState($productID, $products);
|
||||
$this->product->setMenu($productID, $branch);
|
||||
}
|
||||
elseif($from == 'project')
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user