Merge branch 'sprint/174_xieqiyu_45079' into 'master'

Finish task #44992, task #44991, task #44990.

See merge request easycorp/zentaopms!687
This commit is contained in:
李玉春
2021-12-01 05:23:04 +00:00
7 changed files with 30 additions and 9 deletions
+3 -1
View File
@@ -204,6 +204,7 @@ function loadProductModules(productID)
branch = $('#branch').val();
if(typeof(branch) == 'undefined') branch = 0;
if(typeof(moduleID) == 'undefined') moduleID = 0;
if(config.currentMethod == 'edit') moduleID = $('#module').val();
link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=bug&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=&needManage=true&extra=&currentModuleID=' + moduleID);
$('#moduleIdBox').load(link, function()
{
@@ -626,7 +627,8 @@ function notice()
*/
function setBranchRelated(branchID, productID, num)
{
moduleLink = createLink('tree', 'ajaxGetModules', 'productID=' + productID + '&viewType=bug&branch=' + branchID + '&num=' + num);
var currentModuleID = config.currentMethod == 'batchedit' ? $('#modules' + num).val() : 0;
moduleLink = createLink('tree', 'ajaxGetModules', 'productID=' + productID + '&viewType=bug&branch=' + branchID + '&num=' + num + '&currentModuleID=' + currentModuleID);
$.get(moduleLink, function(modules)
{
if(!modules) modules = '<select id="modules' + num + '" name="modules[' + num + ']" class="form-control"></select>';
+2 -1
View File
@@ -30,7 +30,8 @@ function loadBranches(product, branch, storyID)
if(typeof(branch) == 'undefined') branch = 0;
if(!branch) branch = 0;
moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + product + '&viewtype=story&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=' + storyID);
var currentModuleID = $('#modules' + storyID).val();
moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + product + '&viewtype=story&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=' + storyID + '&needManage=false&extra=&currentModuleID=' + currentModuleID);
$('#modules' + storyID).parent('td').load(moduleLink, function(){$('#modules' + storyID).chosen();});
planID = $('#plans' + storyID).val();
+9 -1
View File
@@ -1,5 +1,6 @@
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<?php js::set('rawMethod', $this->app->rawMethod);?>
<script>
/**
* Load product.
@@ -90,7 +91,14 @@ function loadProductModules(productID, branch)
{
if(typeof(branch) == 'undefined') branch = $('#branch').val();
if(!branch) branch = 0;
var moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=&needManage=true');
var currentModule = 0;
if(rawMethod == 'edit')
{
currentModule = $('#module').val();
}
var moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=&needManage=true&extra=&currentModuleID=' + currentModule);
var $moduleIDBox = $('#moduleIdBox');
$moduleIDBox.load(moduleLink, function()
{
+1 -1
View File
@@ -96,7 +96,7 @@ class testcase extends control
* @access public
* @return void
*/
public function browse($productID = 0, $branch = '', $browseType = 'all', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1, $projectID = 0)
public function browse($productID = 0, $branch = 'all', $browseType = 'all', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1, $projectID = 0)
{
$this->loadModel('datatable');
+2 -1
View File
@@ -30,7 +30,8 @@ function loadBranches(product, branch, caseID)
if(typeof(branch) == 'undefined') branch = 0;
if(!branch) branch = 0;
moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + product + '&viewtype=case&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=' + caseID);
var currentModuleID = $('#modules' + caseID).val();
moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + product + '&viewtype=case&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=' + caseID + '&needManage=false&extra=&currentModuleID=' + currentModuleID);
$('#modules' + caseID).parent('td').load(moduleLink, function()
{
$("#modules" + caseID).attr('onchange', "loadStories("+ product + ", this.value, " + caseID + ")").chosen();
+2 -1
View File
@@ -84,7 +84,8 @@ function loadProductModules(productID, branch)
{
if(typeof(branch) == 'undefined') branch = $('#branch').val();
if(!branch) branch = 0;
link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=case&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=&needManage=true');
var currentModuleID = config.currentMethod == 'edit' ? $('#module').val() : 0;
link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=case&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=&needManage=true&extra=&currentModuleID=' + currentModuleID);
$('#moduleIdBox').load(link, function()
{
var $inputGroup = $(this);
+11 -3
View File
@@ -466,7 +466,11 @@ class tree extends control
{
$changeFunc = '';
if($viewType == 'task' or $viewType == 'bug' or $viewType == 'case') $changeFunc = "onchange='loadModuleRelated()'";
$field = $fieldID ? "modules[$fieldID]" : 'module';
$field = $fieldID ? "modules[$fieldID]" : 'module';
$currentModule = $this->tree->getById($currentModuleID);
$currentModuleID = (isset($currentModule->branch) and $currentModule->branch == 0) ? $currentModuleID : 0;
$output = html::select("$field", $optionMenu, $currentModuleID, "class='form-control' $changeFunc");
if(count($optionMenu) == 1 and $needManage)
{
@@ -529,16 +533,20 @@ class tree extends control
* @param string $viewType
* @param int $branchID
* @param int $number
* @param int $currentModuleID
* @access public
* @return string the html select string.
*/
public function ajaxGetModules($productID, $viewType = 'story', $branchID, $number)
public function ajaxGetModules($productID, $viewType = 'story', $branchID, $number, $currentModuleID = 0)
{
$currentModule = $this->tree->getById($currentModuleID);
$currentModuleID = (isset($currentModule->branch) and $currentModule->branch == 0) ? $currentModuleID : 0;
$modules = $this->tree->getOptionMenu($productID, $viewType, $startModuleID = 0, $branchID);
$moduleName = $viewType == 'bug' ? "modules[$number]" : "module[$number]";
$modules = empty($modules) ? array('' => '') : $modules;
die(html::select($moduleName, $modules, '', 'class=form-control'));
die(html::select($moduleName, $modules, $currentModuleID, 'class=form-control'));
}
/**