* Add product menu for execution-bug.

This commit is contained in:
zhouxin
2023-10-25 13:48:08 +08:00
parent 1c00a61424
commit 9b7fe73bf8
4 changed files with 85 additions and 5 deletions
+1 -1
View File
@@ -663,5 +663,5 @@ $config->hasDropmenuApps = array('program', 'project', 'product', 'executio
$config->hasBranchMenuModules = array('product', 'story', 'release', 'bug', 'testcase', 'testtask');
$config->excludeDropmenuList = array('program-browse', 'program-productview', 'product-all', 'product-index', 'execution-all', 'project-browse', 'project-batchedit', 'product-batchedit', 'admin-index', 'product-create', 'project-create', 'execution-create', 'program-create', 'execution-batchedit');
$config->hasSwitcherModules = array('design');
$config->hasSwitcherMethods = array('project-bug', 'project-testcase');
$config->hasSwitcherMethods = array('project-bug', 'project-testcase', 'execution-bug');
$config->excludeSwitcherList = array();
+22 -3
View File
@@ -518,9 +518,11 @@ class execution extends control
$bugs = $this->bug->processBuildForBugs($bugs);
$this->executionZen->assignBugVars($execution, $project, $productID, $branch, $products, $orderBy, $type, $param, $build, $bugs, $pager);
$this->view->showBranch = $showBranch;
$this->view->productOption = $productOption;
$this->view->branchOption = $branchOption;
$this->view->showBranch = $showBranch;
$this->view->productOption = $productOption;
$this->view->branchOption = $branchOption;
$this->view->switcherParams = "executionID={$executionID}&productID={$productID}&currentMethod=bug";
$this->view->switcherText = isset($products[$productID]) ? $products[$productID]->name : $this->lang->product->all;
$this->display();
}
@@ -3101,4 +3103,21 @@ class execution extends control
$this->display();
}
/**
* Ajax get product drop menu.
*
* @param int $executionID
* @param int $productID
* @access public
* @return void
*/
public function ajaxSwitcherMenu(int $executionID, int $productID, string $currentMethod = '')
{
$this->view->link = helper::createLink('execution', $currentMethod, "executionID=$executionID&productID={id}");
$this->view->productID = $productID;
$this->view->products = $this->loadModel('product')->getProducts($executionID);
$this->view->executionID = $executionID;
$this->display();
}
}
@@ -0,0 +1,61 @@
<?php
declare(strict_types=1);
/**
* The ajaxSwithcherMenu view file of execution module of ZenTaoPMS.
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
* @author zhouxin<zhouxin@easycorp.ltd>
* @package execution
* @link https://www.zentao.net
*/
namespace zin;
/**
* 定义每个分组下的选项数据列表。
* Define the grouped data list.
*/
$defaultItem = array();
$defaultItem['id'] = 0;
$defaultItem['text'] = $lang->product->all;
$defaultItem['active'] = $productID == 0;
$defaultItem['type'] = 'product';
$data = array('normal' => array($defaultItem), 'closed' => array());
foreach($products as $product)
{
$item = array();
$item['id'] = $product->id;
$item['text'] = $product->name;
$item['active'] = $productID == $product->id;
$item['type'] = 'product';
$item['keys'] = zget(common::convert2Pinyin(array($product->name)), $product->name, '');
if($product->status == 'closed')
{
$data['closed'][] = $item;
}
else
{
$data['normal'][] = $item;
}
}
/**
* 定义每个分组名称信息,包括可展开的已关闭分组。
* Define every group name, include expanded group.
*/
$tabs = array();
$tabs[] = array('name' => 'closed', 'text' => $lang->product->closedProduct);
$tabs[] = array('name' => 'normal', 'text' => '');
$json = array();
$json['data'] = $data;
$json['tabs'] = $tabs;
$json['searchHint'] = $lang->searchAB;
$json['expandName'] = 'closed';
$json['itemType'] = 'product';
$json['link'] = array('product' => sprintf($link, '{id}'));
renderJson($json);
+1 -1
View File
@@ -40,7 +40,7 @@ featureBar
to::before($branchDropdown),
set::current($type),
set::linkParams("executionID={$execution->id}&productID={$productID}&branch={$branchID}&orderBy={$orderBy}&build={$buildID}&type={key}&param=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"),
li(searchToggle(set::module('executionBug')))
li(searchToggle(set::module('executionBug'), set::open($type == 'bysearch')))
);
/* zin: Define the toolbar on main menu. */