sprint_194 add project in batchcreate view
This commit is contained in:
@@ -40,12 +40,19 @@ $config->bug->list->exportFields = 'id, product, branch, module, project, execut
|
||||
if($config->systemMode == 'classic') $config->bug->list->exportFields = str_replace(' project,', '', $config->bug->list->exportFields);
|
||||
|
||||
$config->bug->list->customCreateFields = 'execution,noticefeedbackBy,story,task,pri,severity,os,browser,deadline,mailto,keywords';
|
||||
$config->bug->list->customBatchCreateFields = 'execution,steps,type,pri,deadline,severity,os,browser,keywords';
|
||||
$config->bug->list->customBatchEditFields = 'type,severity,pri,productplan,assignedTo,deadline,resolvedBy,resolution,os,browser,keywords';
|
||||
if($config->systemMode == 'new')
|
||||
{
|
||||
$config->bug->list->customBatchCreateFields = 'project,execution,steps,type,pri,deadline,severity,os,browser,keywords';
|
||||
}
|
||||
else
|
||||
{
|
||||
$config->bug->list->customBatchCreateFields = 'execution,steps,type,pri,deadline,severity,os,browser,keywords';
|
||||
}
|
||||
|
||||
$config->bug->custom = new stdclass();
|
||||
$config->bug->custom->createFields = $config->bug->list->customCreateFields;
|
||||
$config->bug->custom->batchCreateFields = 'execution,deadline,steps,type,severity,os,browser,%s';
|
||||
$config->bug->custom->batchCreateFields = 'project,execution,deadline,steps,type,severity,os,browser,%s';
|
||||
$config->bug->custom->batchEditFields = 'type,severity,pri,assignedTo,deadline,status,resolvedBy,resolution';
|
||||
|
||||
$config->bug->editor = new stdclass();
|
||||
|
||||
@@ -822,6 +822,8 @@ class bug extends control
|
||||
$this->view->stories = $stories;
|
||||
$this->view->builds = $builds;
|
||||
$this->view->users = $this->user->getPairs('devfirst|noclosed');
|
||||
$this->view->projects = array('' => '') + $this->product->getProjectPairsByProduct($productID, $branch ? "0,$branch" : 0, 'id_desc', $projectID);
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->executions = array('' => '') + $this->product->getExecutionPairsByProduct($productID, $branch ? "0,$branch" : 0, 'id_desc', $projectID);
|
||||
$this->view->executionID = $executionID;
|
||||
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch === 'all' ? 0 : $branch);
|
||||
|
||||
@@ -47,5 +47,7 @@ html[lang='en'] #deadlineTd .input-group-addon {padding: 5px 18px;}
|
||||
#branch_chosen {min-width: 90px;}
|
||||
#notifyEmailTd .input-group-addon, #deadlineTd .input-group-addon {border-radius: 2px 0px 2px 0px !important;}
|
||||
|
||||
#feedback.input-group + #notifyEmailLabel {position: relative; width: 50%; left: 48%}
|
||||
#executionLabel {position: relative; width: 50%; left: 48%}
|
||||
#feedback.input-group + #notifyEmailLabel {position: relative; width: 50%; left: 48%;}
|
||||
#executionLabel {display: inline; position: relative; width: 50%; left: 37%;}
|
||||
#projectLabel {display: inline;}
|
||||
#openedBuildLabel {display: inline; position: relative; width: 50%; left: 14%;}
|
||||
|
||||
@@ -60,17 +60,25 @@ function setLane(regionID, num)
|
||||
}
|
||||
|
||||
/**
|
||||
* Load execution builds
|
||||
* Load execution builds.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $executionID
|
||||
* @param int $index
|
||||
* @param int $productID
|
||||
* @param int $executionID
|
||||
* @param int $index
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function loadExecutionBuilds(productID, executionID, index)
|
||||
{
|
||||
branch = $('#branches' + index).val();
|
||||
var branch = $('#branches' + index).val();
|
||||
if(executionID == 'ditto')
|
||||
{
|
||||
for(var i = index - 1; i > 0, executionID == 'ditto'; i--)
|
||||
{
|
||||
executionID = $('#executions' + i).val();
|
||||
}
|
||||
}
|
||||
|
||||
if(executionID != 0)
|
||||
{
|
||||
link = createLink('build', 'ajaxGetExecutionBuilds', 'executionID=' + executionID + '&productID=' + productID + "&varName=openedBuilds&build=&branch=" + branch + "&index=" + index);
|
||||
|
||||
+46
-3
@@ -339,6 +339,39 @@ function loadProductExecutions(productID, projectID = 0)
|
||||
projectID != 0 ? loadProjectBuilds(projectID) : loadProductBuilds(productID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load executions of product and project.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $projectID
|
||||
* @param int $num
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function loadProductExecutionsByProject(productID, projectID = 0, num = 0)
|
||||
{
|
||||
var branch = $('#branches' + num).val();
|
||||
if(typeof(branch) == 'undefined') branch = 0;
|
||||
|
||||
if(projectID == 'ditto')
|
||||
{
|
||||
for(var i = num - 1; i > 0, projectID == 'ditto'; i--)
|
||||
{
|
||||
projectID = $('#projects' + i).val();
|
||||
}
|
||||
}
|
||||
|
||||
var link = createLink('product', 'ajaxGetExecutionsByProject', 'productID=' + productID + '&projectID=' + projectID + '&branch=' + branch + '&number=' + num);
|
||||
$.get(link, function(executions)
|
||||
{
|
||||
if(!executions) executions = '<select id="executions' + num + '" name="executions[' + num + ']" class="form-control"></select>';
|
||||
$('#executions' + num).replaceWith(executions);
|
||||
$("#executions" + num + "_chosen").remove();
|
||||
$("#executions" + num).next('.picker').remove();
|
||||
$("#executions" + num).chosen();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Load product plans.
|
||||
*
|
||||
@@ -761,7 +794,7 @@ function notice()
|
||||
function setBranchRelated(branchID, productID, num)
|
||||
{
|
||||
var currentModuleID = config.currentMethod == 'batchedit' ? $('#modules' + num).val() : 0;
|
||||
moduleLink = createLink('tree', 'ajaxGetModules', 'productID=' + productID + '&viewType=bug&branch=' + branchID + '&num=' + num + '¤tModuleID=' + currentModuleID);
|
||||
var moduleLink = createLink('tree', 'ajaxGetModules', 'productID=' + productID + '&viewType=bug&branch=' + branchID + '&num=' + num + '¤tModuleID=' + currentModuleID);
|
||||
$.get(moduleLink, function(modules)
|
||||
{
|
||||
if(!modules) modules = '<select id="modules' + num + '" name="modules[' + num + ']" class="form-control"></select>';
|
||||
@@ -771,7 +804,17 @@ function setBranchRelated(branchID, productID, num)
|
||||
$("#modules" + num).chosen();
|
||||
});
|
||||
|
||||
executionLink = createLink('product', 'ajaxGetExecutions', 'productID=' + productID + '&projectID=0&branch=' + branchID + '&num=' + num);
|
||||
var projectLink = createLink('product', 'ajaxGetProjectsByBranch', 'productID=' + productID + '&branch=' + branchID + '&num=' + num);
|
||||
$.get(projectLink, function(projects)
|
||||
{
|
||||
if(!projects) projects = '<select id="projects' + num + '" name="projects[' + num + ']" class="form-control"></select>';
|
||||
$('#projects' + num).replaceWith(projects);
|
||||
$("#projects" + num + "_chosen").remove();
|
||||
$("#projects" + num).next('.picker').remove();
|
||||
$("#projects" + num).chosen();
|
||||
});
|
||||
|
||||
var executionLink = createLink('product', 'ajaxGetExecutions', 'productID=' + productID + '&projectID=0&branch=' + branchID + '&num=' + num);
|
||||
$.get(executionLink, function(executions)
|
||||
{
|
||||
if(!executions) executions = '<select id="executions' + num + '" name="executions[' + num + ']" class="form-control"></select>';
|
||||
@@ -781,7 +824,7 @@ function setBranchRelated(branchID, productID, num)
|
||||
$("#executions" + num).chosen();
|
||||
});
|
||||
|
||||
buildLink = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + "&varName=openedBuilds&build=&branch=" + branchID + "&index=" + num);
|
||||
var buildLink = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + "&varName=openedBuilds&build=&branch=" + branchID + "&index=" + num);
|
||||
|
||||
/* If the branch of the current row is inconsistent with the one below, clear the module and execution of the nex row. */
|
||||
if(config.currentMethod == 'batchcreate')
|
||||
|
||||
@@ -159,6 +159,7 @@ class bugModel extends model
|
||||
while($module = $stmt->fetch()) $moduleOwners[$module->id] = $module->owner;
|
||||
|
||||
$module = 0;
|
||||
$project = 0;
|
||||
$execution = 0;
|
||||
$type = '';
|
||||
$pri = 0;
|
||||
@@ -167,6 +168,7 @@ class bugModel extends model
|
||||
foreach($data->title as $i => $title)
|
||||
{
|
||||
if($data->modules[$i] != 'ditto') $module = (int)$data->modules[$i];
|
||||
if($data->projects[$i] != 'ditto') $project = (int)$data->projects[$i];
|
||||
if($data->executions[$i] != 'ditto') $execution = (int)$data->executions[$i];
|
||||
if($data->types[$i] != 'ditto') $type = $data->types[$i];
|
||||
if($data->pris[$i] != 'ditto') $pri = $data->pris[$i];
|
||||
@@ -174,6 +176,7 @@ class bugModel extends model
|
||||
if($data->browsers[$i] != 'ditto') $browser = $data->browsers[$i];
|
||||
|
||||
$data->modules[$i] = (int)$module;
|
||||
$data->projects[$i] = (int)$project;
|
||||
$data->executions[$i] = (int)$execution;
|
||||
$data->types[$i] = $type;
|
||||
$data->pris[$i] = $pri;
|
||||
@@ -196,6 +199,7 @@ class bugModel extends model
|
||||
$bug->product = (int)$productID;
|
||||
$bug->branch = isset($data->branches) ? (int)$data->branches[$i] : 0;
|
||||
$bug->module = (int)$data->modules[$i];
|
||||
$bug->project = (int)$data->projects[$i];
|
||||
$bug->execution = (int)$data->executions[$i];
|
||||
$bug->openedBuild = implode(',', $data->openedBuilds[$i]);
|
||||
$bug->color = $data->color[$i];
|
||||
|
||||
@@ -55,6 +55,9 @@ js::set('requiredFields', $config->bug->create->requiredFields);
|
||||
<th class='c-id'><?php echo $lang->idAB;?></th>
|
||||
<th class='c-branch<?php echo zget($visibleFields, $product->type, ' hidden')?>'> <?php echo $lang->product->branch;?></th>
|
||||
<th class='c-module<?php echo zget($requiredFields, 'module', '', ' required');?>'> <?php echo $lang->bug->module;?></th>
|
||||
<?php if($config->systemMode == 'new'):?>
|
||||
<th class='c-project<?php echo zget($visibleFields, 'project', ' hidden') . zget($requiredFields, 'project', '', ' required');?>'><?php echo (isset($project->model) and $project->model == 'kanban') ? $lang->bug->kanban : $lang->bug->project;?></th>
|
||||
<?php endif;?>
|
||||
<th class='c-execution<?php echo zget($visibleFields, 'execution', ' hidden') . zget($requiredFields, 'execution', '', ' required');?>'><?php echo (isset($project->model) and $project->model == 'kanban') ? $lang->bug->kanban : $lang->bug->execution;?></th>
|
||||
<th class='c-build required'><?php echo $lang->bug->openedBuild;?></th>
|
||||
<th class='c-title required'><?php echo $lang->bug->title;?></th>
|
||||
@@ -83,6 +86,7 @@ js::set('requiredFields', $config->bug->create->requiredFields);
|
||||
<tbody>
|
||||
<?php
|
||||
$moduleOptionMenu += array('ditto' => $lang->bug->ditto);
|
||||
$projects += array('ditto' => $lang->bug->ditto);
|
||||
$executions += array('ditto' => $lang->bug->ditto);
|
||||
$lang->bug->typeList += array('ditto' => $lang->bug->ditto);
|
||||
$lang->bug->priList += array('ditto' => $lang->bug->ditto);
|
||||
@@ -94,6 +98,7 @@ js::set('requiredFields', $config->bug->create->requiredFields);
|
||||
<?php foreach($titles as $bugTitle => $fileName):?>
|
||||
<?php
|
||||
$moduleID = $i == 1 ? $moduleID : 'ditto';
|
||||
$projectID = $i == 1 ? $projectID : 'ditto';
|
||||
$executionID = $i == 1 ? $executionID : 'ditto';
|
||||
$type = $i == 1 ? '' : 'ditto';
|
||||
$pri = $i == 1 ? 0 : 'ditto';
|
||||
@@ -104,6 +109,9 @@ js::set('requiredFields', $config->bug->create->requiredFields);
|
||||
<td class='text-center'><?php echo $i;?></td>
|
||||
<td class='<?php echo zget($visibleFields, $product->type, ' hidden')?>' style='overflow:visible'><?php echo html::select("branches[$i]", $branches, $branch, "class='form-control chosen' onchange='setBranchRelated(this.value, $productID, $i)'");?></td>
|
||||
<td><?php echo html::select("modules[$i]", $moduleOptionMenu, $moduleID, "class='form-control chosen'");?></td>
|
||||
<?php if($config->systemMode == 'new'):?>
|
||||
<td class='<?php echo zget($visibleFields, 'project', ' hidden')?>' style='overflow:visible'><?php echo html::select("projects[$i]", $projects, $projectID, "class='form-control chosen' onchange = 'loadProductExecutionsByProject($productID, this.value, $i)'");?></td>
|
||||
<?php endif;?>
|
||||
<td class='<?php echo zget($visibleFields, 'execution', ' hidden')?>' style='overflow:visible'><?php echo html::select("executions[$i]", $executions, $executionID, "class='form-control chosen' onchange='loadExecutionBuilds($productID, this.value, $i)'");?></td>
|
||||
<td id='buildBox<?php echo $i;?>'><?php echo html::select("openedBuilds[$i][]", $builds, 'trunk', "class='form-control chosen' multiple");?></td>
|
||||
<td>
|
||||
@@ -144,6 +152,7 @@ js::set('requiredFields', $config->bug->create->requiredFields);
|
||||
<?php for($i = $nextStart; $i <= $config->bug->batchCreate; $i++):?>
|
||||
<?php
|
||||
$moduleID = $i - $nextStart == 0 ? $moduleID : 'ditto';
|
||||
$projectID = $i - $nextStart == 0 ? $projectID : 'ditto';
|
||||
$executionID = $i - $nextStart == 0 ? $executionID : 'ditto';
|
||||
$type = $i - $nextStart == 0 ? '' : 'ditto';
|
||||
$pri = $i - $nextStart == 0 ? 0 : 'ditto';
|
||||
@@ -154,6 +163,9 @@ js::set('requiredFields', $config->bug->create->requiredFields);
|
||||
<td><?php echo $i;?></td>
|
||||
<td class='<?php echo zget($visibleFields, $product->type, ' hidden')?>' style='overflow:visible'><?php echo html::select("branches[$i]", $branches, $branch, "class='form-control chosen' onchange='setBranchRelated(this.value, $productID, $i)'");?></td>
|
||||
<td><?php echo html::select("modules[$i]", $moduleOptionMenu, $moduleID, "class='form-control chosen'");?></td>
|
||||
<?php if($config->systemMode == 'new'):?>
|
||||
<td class='<?php echo zget($visibleFields, 'project', ' hidden')?>' style='overflow:visible'><?php echo html::select("projects[$i]", $projects, $projectID, "class='form-control chosen' onchange = 'loadProductExecutionsByProject($productID, this.value, $i)'");?></td>
|
||||
<?php endif;?>
|
||||
<td class='<?php echo zget($visibleFields, 'execution', ' hidden')?>' style='overflow:visible'><?php echo html::select("executions[$i]", $executions, $executionID, "class='form-control chosen' onchange='loadExecutionBuilds($productID, this.value, $i)'");?></td>
|
||||
<td id='buildBox<?php echo $i;?>'><?php echo html::select("openedBuilds[$i][]", $builds, '', "class='form-control chosen' multiple");?></td>
|
||||
<td>
|
||||
@@ -207,6 +219,9 @@ js::set('requiredFields', $config->bug->create->requiredFields);
|
||||
<td>%s</td>
|
||||
<td class='<?php echo zget($visibleFields, $product->type, ' hidden')?>' style='overflow:visible'><?php echo html::select("branches[%s]", $branches, $branch, "class='form-control chosen' onchange='setBranchRelated(this.value, $productID, \"%s\")'");?></td>
|
||||
<td><?php echo html::select("modules[%s]", $moduleOptionMenu, $moduleID, "class='form-control'");?></td>
|
||||
<?php if($config->systemMode == 'new'):?>
|
||||
<td class='<?php echo zget($visibleFields, 'project', ' hidden')?>' style='overflow:visible'><?php echo html::select("projects[%s]", $projects, $projectID, "class='form-control chosen' onchange = 'loadProductExecutionsByProject($productID, this.value, \"%s\")'");?></td>
|
||||
<?php endif;?>
|
||||
<td class='<?php echo zget($visibleFields, 'execution', ' hidden')?>' style='overflow:visible'><?php echo html::select("executions[%s]", $executions, $executionID, "class='form-control chosen' onchange='loadExecutionBuilds($productID, this.value, \"%s\")'");?></td>
|
||||
<td id='buildBox%s'><?php echo html::select("openedBuilds[%s][]", $builds, '', "class='form-control chosen' multiple");?></td>
|
||||
<td>
|
||||
|
||||
@@ -963,6 +963,23 @@ class product extends control
|
||||
return print(html::select('project', $projects, $projectID, "class='form-control' onchange='loadProductExecutions({$productID}, this.value)'"));
|
||||
}
|
||||
|
||||
/**
|
||||
* AJAX: get projects of a product in html select.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @param int $number
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxGetProjectsByBranch($productID, $branch = 0, $number = 0)
|
||||
{
|
||||
$projects = array('' => '');
|
||||
$projects += $this->product->getProjectPairsByProduct($productID, $branch);
|
||||
|
||||
return print(html::select('projects' . "[$number]", array('' => '') + $projects, 0, "class='form-control' onchange='loadProductExecutionsByProject($productID, this.value, $number)'"));
|
||||
}
|
||||
|
||||
/**
|
||||
* AJAX: get executions of a product in html select.
|
||||
*
|
||||
@@ -999,6 +1016,22 @@ class product extends control
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* AJAX: get executions of a product in html select.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $projectID
|
||||
* @param int $branch
|
||||
* @param int $number
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxGetExecutionsByProject($productID, $projectID = 0, $branch = 0, $number = 0)
|
||||
{
|
||||
$executions = $this->product->getExecutionPairsByProduct($productID, $branch, 'id_desc', $projectID, '');
|
||||
return print(html::select('executions' . "[$number]", array('' => '') + $executions, 0, "class='form-control' onchange='loadExecutionBuilds($productID, this.value, $number)'"));
|
||||
}
|
||||
|
||||
/**
|
||||
* AJAX: get plans of a product in html select.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user