diff --git a/module/bug/control.php b/module/bug/control.php index 90aea685f7..551a752d3b 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -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; diff --git a/module/bug/view/batchedit.html.php b/module/bug/view/batchedit.html.php index 92b030f31d..f488160779 100644 --- a/module/bug/view/batchedit.html.php +++ b/module/bug/view/batchedit.html.php @@ -101,40 +101,12 @@ product][$bug->branch]) ? $modules[$bug->product][$bug->branch] : array(0 => '/'), $bug->module, "class='form-control picker-select' data-drop-width='auto'");?> ' style='overflow:visible'>plan, "class='form-control picker-select' data-drop-width='auto'");?> - 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']); - } - ?> - ' style='overflow:visible'>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'");?> + ' style='overflow:visible'>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'");?> ' style='overflow:visible'>deadline) ? '' : $bug->deadline, "class='form-control form-date'");?> >bug->osList, $bug->os, 'class="form-control chosen" multiple');?> >bug->browserList, $bug->browser, 'class="form-control chosen" multiple');?> >keywords, 'class=form-control');?> - ' style='overflow:visible'> '', 'ditto' => $this->lang->bug->ditto) + array($bug->resolvedBy => zget($users, $bug->resolvedBy)), $bug->resolvedBy, "class='form-control picker-select' data-drop-width='auto'");?> + ' style='overflow:visible'> '', 'ditto' => $this->lang->bug->ditto) + array($bug->resolvedBy => zget($users, $bug->resolvedBy)) + $limitUsers, $bug->resolvedBy, "class='form-control picker-select' data-drop-width='auto'");?> >