Merge branch 'pailei_zhangzilong_49297' into 'pailei'
* Finish task #49297. See merge request easycorp/zentaopms!2029
This commit is contained in:
+13
-1
@@ -753,6 +753,18 @@ class bug extends control
|
||||
|
||||
$projectID = $this->lang->navGroup->bug == 'project' ? $this->session->project : (isset($execution) ? $execution->project : 0);
|
||||
|
||||
/* Get branches. */
|
||||
if($executionID)
|
||||
{
|
||||
$productBranches = $product->type != 'normal' ? $this->execution->getBranchByProduct($productID, $executionID) : array();
|
||||
$branches = isset($productBranches[$productID]) ? $productBranches[$productID] : array();
|
||||
$branch = key($branches);
|
||||
}
|
||||
else
|
||||
{
|
||||
$branches = $product->type != 'normal' ? $this->loadModel('branch')->getPairs($productID, 'active') : array();
|
||||
}
|
||||
|
||||
$this->view->customFields = $customFields;
|
||||
$this->view->showFields = $showFields;
|
||||
|
||||
@@ -771,7 +783,7 @@ class bug extends control
|
||||
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch === 'all' ? 0 : $branch);
|
||||
$this->view->moduleID = $moduleID;
|
||||
$this->view->branch = $branch;
|
||||
$this->view->branches = $this->loadModel('branch')->getPairs($productID, 'active');
|
||||
$this->view->branches = $branches;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -2055,12 +2055,15 @@ class execution extends control
|
||||
$productID = 0;
|
||||
$branchID = 0;
|
||||
$products = $this->loadModel('product')->getProducts($executionID);
|
||||
$productNames = array();
|
||||
if($products)
|
||||
{
|
||||
$productID = key($products);
|
||||
$branches = $this->loadModel('branch')->getPairs($productID, '', $executionID);
|
||||
if($branches) $branchID = key($branches);
|
||||
}
|
||||
foreach($products as $product) $productNames[$product->id] = $product->name;
|
||||
|
||||
|
||||
$plans = $this->execution->getPlans($products, 'skipParent', $executionID);
|
||||
$allPlans = array('' => '');
|
||||
@@ -2073,11 +2076,14 @@ class execution extends control
|
||||
$this->view->users = $users;
|
||||
$this->view->regions = $kanbanData;
|
||||
$this->view->execution = $execution;
|
||||
$this->view->executionID = $executionID;
|
||||
$this->view->userList = $userList;
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->groupBy = $groupBy;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->productNames = $productNames;
|
||||
$this->view->productNum = count($products);
|
||||
$this->view->branchID = $branchID;
|
||||
$this->view->projectID = $this->loadModel('task')->getProjectID($execution->id);
|
||||
$this->view->allPlans = $allPlans;
|
||||
@@ -2130,10 +2136,11 @@ class execution extends control
|
||||
$canBeChanged = common::canModify('execution', $execution);
|
||||
|
||||
/* Get execution's product. */
|
||||
$productID = 0;
|
||||
$products = $this->loadModel('product')->getProducts($executionID);
|
||||
foreach($products as $product) $productNames[$product->id] = $product->name;
|
||||
$productID = 0;
|
||||
$productNames = array();
|
||||
$products = $this->loadModel('product')->getProducts($executionID);
|
||||
if($products) $productID = key($products);
|
||||
foreach($products as $product) $productNames[$product->id] = $product->name;
|
||||
|
||||
$plans = $this->execution->getPlans($products);
|
||||
$allPlans = array('' => '');
|
||||
|
||||
@@ -270,7 +270,11 @@ function createColumnCreateMenu(options)
|
||||
else if(col.type == 'unconfirmed')
|
||||
{
|
||||
if(priv.canCreateBug) items.push({label: bugLang.create, url: $.createLink('bug', 'create', 'productID=0&moduleID=0&extra=laneID=' + laneID + ',columnID=' + col.id + ',executionID=' + executionID, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
|
||||
if(priv.canBatchCreateBug) items.push({label: bugLang.batchCreate, url: $.createLink('bug', 'batchcreate', 'productID=' + productID + '&branch=&executionID=' + executionID + '&module=0&extra=laneID=' + laneID + ',columnID=' + col.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '90%'}});
|
||||
if(priv.canBatchCreateBug)
|
||||
{
|
||||
if(productNum > 1) items.push({label: bugLang.batchCreate, url: '#batchCreateBug', 'attrs' : {'data-toggle': 'modal'}});
|
||||
else items.push({label: bugLang.batchCreate, url: $.createLink('bug', 'batchcreate', 'productID=' + productID + '&branch=&executionID=' + executionID + '&module=0&extra=&laneID=' + laneID + '&columnID=' + col.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '90%'}});
|
||||
}
|
||||
}
|
||||
else if(col.type == 'wait')
|
||||
{
|
||||
@@ -1236,6 +1240,16 @@ $(function()
|
||||
}
|
||||
});
|
||||
|
||||
$('#product').change(function()
|
||||
{
|
||||
var product = $('#product').val();
|
||||
if(product)
|
||||
{
|
||||
var link = createLink('bug', 'batchCreate', 'productID=' + product + '&branch=&executionID=' + executionID, '', true);
|
||||
$('#batchCreateBugButton').attr('href', link);
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '#splitTable .btn-plus', function()
|
||||
{
|
||||
var tr = $(this).closest('tr');
|
||||
|
||||
@@ -805,8 +805,8 @@ function createColumnCreateMenu(options)
|
||||
if(priv.canCreateBug) items.push({label: bugLang.create, url: $.createLink('bug', 'create', 'productID=0&moduleID=0&extra=executionID=' + executionID, '', true), className: 'iframe', attrs: {'data-width': '80%'}});
|
||||
if(priv.canBatchCreateBug)
|
||||
{
|
||||
if(productNum == 1) items.push({label: bugLang.batchCreate, url: $.createLink('bug', 'batchcreate', 'productID=' + productID + '&moduleID=0&executionID=' + executionID, '', true), className: 'iframe', attrs: {'data-width': '90%'}});
|
||||
if(productNum > 1) items.push({label: bugLang.batchCreate, url: '#batchCreateBug', 'attrs' : {'data-toggle': 'modal'}});
|
||||
else items.push({label: bugLang.batchCreate, url: $.createLink('bug', 'batchcreate', 'productID=' + productID + '&moduleID=0&executionID=' + executionID, '', true), className: 'iframe', attrs: {'data-width': '90%'}});
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -43,11 +43,13 @@ js::set('noAssigned', $lang->kanbancard->noAssigned);
|
||||
js::set('users', $users);
|
||||
js::set('entertime', time());
|
||||
js::set('displayCards', $execution->displayCards);
|
||||
js::set('productNum', $productNum);
|
||||
js::set('fluidBoard', $execution->fluidBoard);
|
||||
js::set('colorListLang', $lang->kanbancard->colorList);
|
||||
js::set('colorList', $this->config->kanban->cardColorList);
|
||||
js::set('projectID', $projectID);
|
||||
js::set('vision', $this->config->vision);
|
||||
js::set('branchID', $branchID);
|
||||
|
||||
$canSortRegion = commonModel::hasPriv('kanban', 'sortRegion') && count($regions) > 1;
|
||||
$canEditRegion = commonModel::hasPriv('kanban', 'editRegion');
|
||||
@@ -168,7 +170,13 @@ js::set('hasTaskButton', $hasTaskButton);
|
||||
<?php if($canLinkStoryByPlan) echo '<li>' . html::a('#linkStoryByPlan', $lang->execution->linkStoryByPlan, '', 'data-toggle="modal"') . '</li>';?>
|
||||
<?php if($hasStoryButton and $hasBugButton) echo '<li class="divider"></li>';?>
|
||||
<?php if($canCreateBug) echo '<li>' . html::a(helper::createLink('bug', 'create', "productID=$productID&branch=0&extra=executionID=$execution->id", '', true), $lang->bug->create, '', "class='iframe'") . '</li>';?>
|
||||
<?php if($canBatchCreateBug) echo '<li>' . html::a(helper::createLink('bug', 'batchCreate', "productID=$productID&branch=$branchID&executionID=$execution->id", '', true), $lang->bug->batchCreate, '', "class='iframe'") . '</li>';?>
|
||||
<?php if($canBatchCreateBug)
|
||||
{
|
||||
|
||||
$batchCreateBugLink = '<li>' . html::a(helper::createLink('bug', 'batchCreate', "productID=$productID&branch=$branchID&executionID=$execution->id", '', true), $lang->bug->batchCreate, '', "class='iframe'") . '</li>';
|
||||
if($productNum > 1) $batchCreateBugLink = '<li>' . html::a('#batchCreateBug', $lang->bug->batchCreate, '', "data-toggle='modal'") . '</li>';
|
||||
echo $batchCreateBugLink;
|
||||
}?>
|
||||
<?php if(($hasStoryButton or $hasBugButton) and $hasTaskButton) echo '<li class="divider"></li>';?>
|
||||
<?php if($canCreateTask) echo '<li>' . html::a(helper::createLink('task', 'create', "execution=$execution->id", '', true), $lang->task->create, '', "class='iframe'") . '</li>';?>
|
||||
<?php if($canImportBug) echo '<li>' . html::a(helper::createLink('execution', 'importBug', "executionID=$execution->id", '', true), $lang->execution->importBug, '', "class='iframe'") . '</li>';?>
|
||||
@@ -227,4 +235,20 @@ js::set('hasTaskButton', $hasTaskButton);
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="batchCreateBug">
|
||||
<div class="modal-dialog mw-500px">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="icon icon-close"></i></button>
|
||||
<h4 class="modal-title"><?php echo $lang->bug->product;?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('productName', $productNames, '', "class='form-control chosen' id='product'");?>
|
||||
<span class='input-group-btn'><?php echo html::a(helper::createLink('bug', 'batchCreate', 'productID=' . key($productNames) . '&branch=' . $branchID . '&executionID=' . $executionID, '', true), $lang->bug->batchCreate, '', "id='batchCreateBugButton' class='btn btn-primary iframe' data-dismiss='modal' data-width='90%'");?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
<div class="modal-body">
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('productName', $productNames, '', "class='form-control chosen' id='product'");?>
|
||||
<span class='input-group-btn'><?php echo html::a(helper::createLink('bug', 'batchCreate', 'productID=3&branch=&executionID=', '', true), $lang->bug->batchCreate, '', "id='batchCreateBugButton' class='btn btn-primary iframe'");?></span>
|
||||
<span class='input-group-btn'><?php echo html::a(helper::createLink('bug', 'batchCreate', 'productID=' . key($productNames) . '&branch=&executionID=' . $executionID, '', true), $lang->bug->batchCreate, '', "id='batchCreateBugButton' class='btn btn-primary iframe' data-dismiss='modal' data-width='90%'");?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user