* Optimize default load 50 limit users on batchedit bug page.
This commit is contained in:
+11
-7
@@ -1418,6 +1418,8 @@ class bug extends control
|
||||
|
||||
/* Set users. */
|
||||
$users = $this->loadModel('user')->getPairs();
|
||||
$limitUsers = $users;
|
||||
if(count($users) > $this->config->batchMaxCount) $limitUsers = array_slice($users, 0 , $this->config->batchMaxCount);
|
||||
|
||||
$branchIdList = array();
|
||||
$projectIdList = array();
|
||||
@@ -1448,32 +1450,33 @@ class bug extends control
|
||||
{
|
||||
if($bug->execution)
|
||||
{
|
||||
$bug->assignedToList = array('' => '', 'ditto' => $this->lang->bug->ditto) + $executionMembers[$bug->execution];
|
||||
$bug->assignedToList = $executionMembers[$bug->execution];
|
||||
}
|
||||
elseif($bug->project)
|
||||
{
|
||||
$bug->assignedToList = array('' => '', 'ditto' => $this->lang->bug->ditto) + $projectMembers[$bug->project];
|
||||
$bug->assignedToList = $projectMembers[$bug->project];
|
||||
}
|
||||
else
|
||||
{
|
||||
$bug->assignedToList = $productMembers[$bug->product][$bug->branch];
|
||||
if(empty($bug->assignedToList))
|
||||
{
|
||||
$bug->assignedToList = $users;
|
||||
$this->config->moreLinks["assignedTos[$bug->id]"] = helper::createLink('user', 'ajaxGetMore');
|
||||
$bug->assignedToList = $limitUsers;
|
||||
if(count($users) > $this->config->batchMaxCount) $this->config->moreLinks["assignedTos[$bug->id]"] = helper::createLink('user', 'ajaxGetMore');
|
||||
unset($bug->assignedToList['closed']);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$bug->assignedToList = $users;
|
||||
$this->config->moreLinks["assignedTos[$bug->id]"] = helper::createLink('user', 'ajaxGetMore');
|
||||
$bug->assignedToList = $limitUsers;
|
||||
if(count($users) > $this->config->batchMaxCount) $this->config->moreLinks["assignedTos[$bug->id]"] = helper::createLink('user', 'ajaxGetMore');
|
||||
unset($bug->assignedToList['closed']);
|
||||
}
|
||||
$bug->assignedToList = array('' => '', 'ditto' => $this->lang->bug->ditto) + array($bug->assignedTo => zget($users, $bug->assignedTo)) + $bug->assignedToList;
|
||||
|
||||
$this->config->moreLinks["duplicateBugs[{$bug->id}]"] = inlink('ajaxGetProductBugs', "productID={$bug->product}&bugID={$bug->id}&type=json");
|
||||
$this->config->moreLinks["resolvedBys[$bug->id]"] = helper::createLink('user', 'ajaxGetMore');
|
||||
if(count($users) > $this->config->batchMaxCount) $this->config->moreLinks["resolvedBys[$bug->id]"] = helper::createLink('user', 'ajaxGetMore');
|
||||
}
|
||||
|
||||
/* Get assigned to member. */
|
||||
@@ -1547,6 +1550,7 @@ class bug extends control
|
||||
$this->view->bugs = $bugs;
|
||||
$this->view->branch = $branch;
|
||||
$this->view->users = $users;
|
||||
$this->view->limitUsers = $limitUsers;
|
||||
$this->view->modules = $modules;
|
||||
$this->view->branchTagOption = $branchTagOption;
|
||||
$this->view->productBugList = $productBugList;
|
||||
|
||||
@@ -101,40 +101,12 @@
|
||||
<?php endif;?>
|
||||
<td><?php echo html::select("modules[$bugID]", isset($modules[$bug->product][$bug->branch]) ? $modules[$bug->product][$bug->branch] : array(0 => '/'), $bug->module, "class='form-control picker-select' data-drop-width='auto'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'productplan', ' hidden')?>' style='overflow:visible'><?php echo html::select("plans[$bugID]", $plans, $bug->plan, "class='form-control picker-select' data-drop-width='auto'");?></td>
|
||||
<?php
|
||||
$assignedToList = array();
|
||||
if($app->tab == 'project' or $app->tab == 'execution')
|
||||
{
|
||||
if($bug->execution)
|
||||
{
|
||||
$assignedToList = array('' => '', 'ditto' => $this->lang->bug->ditto) + $executionMembers[$bug->execution];
|
||||
}
|
||||
elseif($bug->project)
|
||||
{
|
||||
$assignedToList = array('' => '', 'ditto' => $this->lang->bug->ditto) + $projectMembers[$bug->project];
|
||||
}
|
||||
else
|
||||
{
|
||||
$assignedToList = $productMembers[$bug->product][$bug->branch];
|
||||
if(empty($assignedToList))
|
||||
{
|
||||
$assignedToList = $users;
|
||||
unset($assignedToList['closed']);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$assignedToList = $users;
|
||||
unset($assignedToList['closed']);
|
||||
}
|
||||
?>
|
||||
<td class='<?php echo zget($visibleFields, 'assignedTo', ' hidden')?>' style='overflow:visible'><?php echo $bug->status == 'closed' ? html::input("assignedTos[$bugID]", ucfirst($bug->assignedTo), 'class=form-control disabled') : html::select("assignedTos[$bugID]", array('' => '', 'ditto' => $this->lang->bug->ditto) + array($bug->assignedTo => zget($bug->assignedToList, $bug->assignedTo)), $bug->assignedTo, "class='form-control picker-select' data-drop-width='135px'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'assignedTo', ' hidden')?>' style='overflow:visible'><?php echo $bug->status == 'closed' ? html::input("assignedTos[$bugID]", ucfirst($bug->assignedTo), 'class=form-control disabled') : html::select("assignedTos[$bugID]", $bug->assignedToList, $bug->assignedTo, "class='form-control picker-select' data-drop-width='135px'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'deadline', ' hidden')?>' style='overflow:visible'><?php echo html::input("deadlines[$bugID]", helper::isZeroDate($bug->deadline) ? '' : $bug->deadline, "class='form-control form-date'");?></td>
|
||||
<td <?php echo zget($visibleFields, 'os', "class='hidden'")?>><?php echo html::select("os[$bugID][]", $lang->bug->osList, $bug->os, 'class="form-control chosen" multiple');?></td>
|
||||
<td <?php echo zget($visibleFields, 'browser', "class='hidden'")?>><?php echo html::select("browsers[$bugID][]", $lang->bug->browserList, $bug->browser, 'class="form-control chosen" multiple');?></td>
|
||||
<td <?php echo zget($visibleFields, 'keywords', "class='hidden'")?>><?php echo html::input("keywords[$bugID]", $bug->keywords, 'class=form-control');?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'resolvedBy', ' hidden')?>' style='overflow:visible'><?php echo html::select("resolvedBys[$bugID]", array('' => '', 'ditto' => $this->lang->bug->ditto) + array($bug->resolvedBy => zget($users, $bug->resolvedBy)), $bug->resolvedBy, "class='form-control picker-select' data-drop-width='auto'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'resolvedBy', ' hidden')?>' style='overflow:visible'><?php echo html::select("resolvedBys[$bugID]", array('' => '', 'ditto' => $this->lang->bug->ditto) + array($bug->resolvedBy => zget($users, $bug->resolvedBy)) + $limitUsers, $bug->resolvedBy, "class='form-control picker-select' data-drop-width='auto'");?></td>
|
||||
<td <?php echo zget($visibleFields, 'resolution', "class='hidden'")?>>
|
||||
<table class='table-borderless table no-margin table-form'>
|
||||
<tr>
|
||||
|
||||
Reference in New Issue
Block a user