diff --git a/module/bug/control.php b/module/bug/control.php index 95ac916703..d583864396 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -643,6 +643,7 @@ class bug extends control } $bugIDList = $this->post->bugIDList ? $this->post->bugIDList : die(js::locate($this->session->bugList, 'parent')); + $bugIDList = array_unique($bugIDList); /* Initialize vars.*/ $bugs = $this->dao->select('*')->from(TABLE_BUG)->where('id')->in($bugIDList)->fetchAll('id'); @@ -776,6 +777,7 @@ class bug extends control if($this->post->bugIDList) { $bugIDList = $this->post->bugIDList; + $bugIDList = array_unique($bugIDList); unset($_POST['bugIDList']); $allChanges = $this->bug->batchChangeModule($bugIDList, $moduleID); if(dao::isError()) die(js::error(dao::getError())); @@ -802,6 +804,7 @@ class bug extends control if(!empty($_POST) && isset($_POST['bugIDList'])) { $bugIDList = $this->post->bugIDList; + $bugIDList = array_unique($bugIDList); unset($_POST['bugIDList']); foreach($bugIDList as $bugID) { @@ -860,7 +863,8 @@ class bug extends control */ public function batchConfirm() { - $bugIDList = $this->post->bugIDList ? $this->post->bugIDList : die(js::locate($this->session->bugList, 'parent')); + $bugIDList = $this->post->bugIDList ? $this->post->bugIDList : die(js::locate($this->session->bugList, 'parent')); + $bugIDList = array_unique($bugIDList); $this->bug->batchConfirm($bugIDList); if(dao::isError()) die(js::error(dao::getError())); foreach($bugIDList as $bugID) @@ -940,6 +944,7 @@ class bug extends control public function batchResolve($resolution, $resolvedBuild = '') { $bugIDList = $this->post->bugIDList ? $this->post->bugIDList : die(js::locate($this->session->bugList, 'parent')); + $bugIDList = array_unique($bugIDList); $bugIDList = $this->bug->batchResolve($bugIDList, $resolution, $resolvedBuild); if(dao::isError()) die(js::error(dao::getError())); foreach($bugIDList as $bugID) @@ -1116,6 +1121,7 @@ class bug extends control if($this->post->bugIDList) { $bugIDList = $this->post->bugIDList; + $bugIDList = array_unique($bugIDList); /* Reset $_POST. Do not unset that because the function of close need that in model. */ $_POST = array(); @@ -1161,6 +1167,7 @@ class bug extends control } $bugIDList = $this->post->bugIDList ? $this->post->bugIDList : die(js::locate($this->session->bugList, 'parent')); + $bugIDList = array_unique($bugIDList); $bugs = $this->dao->select('id, title, status, resolvedBy, openedBuild')->from(TABLE_BUG)->where('id')->in($bugIDList)->fetchAll('id'); $this->bug->setMenu($this->products, $productID, $branch); diff --git a/module/bug/view/batchedit.html.php b/module/bug/view/batchedit.html.php index fc839a39ab..2791797bac 100644 --- a/module/bug/view/batchedit.html.php +++ b/module/bug/view/batchedit.html.php @@ -57,13 +57,13 @@ $columns = count($visibleFields) + 2; - + $bug):?> product->getByID($bugs[$bugID]->product); + $product = $this->product->getByID($bug->product); - $plans = $this->loadModel('productplan')->getPairs($bugs[$bugID]->product, $branch); + $plans = $this->loadModel('productplan')->getPairs($bug->product, $branch); $plans = array('' => '', 'ditto' => $this->lang->bug->ditto) + $plans; $branches = $product->type == 'normal' ? array('' => '') : $this->loadModel('branch')->getPairs($product->id); @@ -77,43 +77,43 @@ $columns = count($visibleFields) + 2; * Remove designchange, newfeature, trackings from the typeList, because should be tracked in story or task. * These thress types if upgrade from bugfree2.x. */ - if($bugs[$bugID]->type != 'designchange') unset($typeList['designchange']); - if($bugs[$bugID]->type != 'newfeature') unset($typeList['newfeature']); - if($bugs[$bugID]->type != 'trackthings') unset($typeList['trackthings']); + if($bug->type != 'designchange') unset($typeList['designchange']); + if($bug->type != 'newfeature') unset($typeList['newfeature']); + if($bug->type != 'trackthings') unset($typeList['trackthings']); ?> - >type, 'class=form-control');?> - >severity, 'class=form-control');?> - >pri, 'class=form-control');?> - + >type, 'class=form-control');?> + >severity, 'class=form-control');?> + >pri, 'class=form-control');?> +
- color, "data-provide='colorpicker' data-wrapper='input-group-btn fix-border-right' data-pull-menu-right='false' data-btn-tip='{$lang->bug->colorTag}' data-update-text='#titles\\[{$bugID}\\]'");?> - title, 'class=form-control');?> + color, "data-provide='colorpicker' data-wrapper='input-group-btn fix-border-right' data-pull-menu-right='false' data-btn-tip='{$lang->bug->colorTag}' data-update-text='#titles\\[{$bugID}\\]'");?> + title, 'class=form-control');?>
' style='overflow:visible'> id;?> type == 'normal') ? "disabled='disabled'" : '';?> - branch, "class='form-control chosen' $disabled");?> + branch, "class='form-control chosen' $disabled");?> - ' style='overflow:visible'>plan, "class='form-control chosen'");?> - ' style='overflow:visible'>assignedTo, "class='form-control chosen'");?> - ' style='overflow:visible'>deadline, "class='form-control form-date'");?> - >status, 'class=form-control');?> - >os, 'class=form-control');?> - >browser, 'class=form-control');?> - >keywords, 'class=form-control');?> - ' style='overflow:visible'>resolvedBy, "class='form-control chosen'");?> + ' style='overflow:visible'>plan, "class='form-control chosen'");?> + ' style='overflow:visible'>assignedTo, "class='form-control chosen'");?> + ' style='overflow:visible'>deadline, "class='form-control form-date'");?> + >status, 'class=form-control');?> + >os, 'class=form-control');?> + >browser, 'class=form-control');?> + >keywords, 'class=form-control');?> + ' style='overflow:visible'>resolvedBy, "class='form-control chosen'");?> > - diff --git a/module/story/control.php b/module/story/control.php index ca02aed857..f7d6a5b7e4 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -400,6 +400,7 @@ class story extends control } $storyIDList = $this->post->storyIDList ? $this->post->storyIDList : die(js::locate($this->session->storyList, 'parent')); + $storyIDList = array_unique($storyIDList); /* Get edited stories. */ $stories = $this->story->getByList($storyIDList); @@ -720,6 +721,7 @@ class story extends control public function batchReview($result, $reason = '') { $storyIDList = $this->post->storyIDList ? $this->post->storyIDList : die(js::locate($this->session->storyList, 'parent')); + $storyIDList = array_unique($storyIDList); $actions = $this->story->batchReview($storyIDList, $result, $reason); if(dao::isError()) die(js::error(dao::getError())); @@ -796,6 +798,7 @@ class story extends control } $storyIDList = $this->post->storyIDList ? $this->post->storyIDList : die(js::locate($this->session->storyList, 'parent')); + $storyIDList = array_unique($storyIDList); /* Get edited stories. */ $stories = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($storyIDList)->fetchAll('id'); @@ -861,6 +864,7 @@ class story extends control public function batchChangeModule($moduleID) { $storyIDList = !empty($_POST['storyIDList']) ? $this->post->storyIDList : die(js::locate($this->session->storyList, 'parent')); + $storyIDList = array_unique($storyIDList); $allChanges = $this->story->batchChangeModule($storyIDList, $moduleID); if(dao::isError()) die(js::error(dao::getError())); foreach($allChanges as $storyID => $changes) @@ -882,6 +886,7 @@ class story extends control public function batchChangePlan($planID, $oldPlanID = 0) { $storyIDList = !empty($_POST['storyIDList']) ? $this->post->storyIDList : die(js::locate($this->session->storyList, 'parent')); + $storyIDList = array_unique($storyIDList); $allChanges = $this->story->batchChangePlan($storyIDList, $planID, $oldPlanID); if(dao::isError()) die(js::error(dao::getError())); foreach($allChanges as $storyID => $changes) @@ -903,6 +908,7 @@ class story extends control public function batchChangeBranch($branchID) { $storyIDList = !empty($_POST['storyIDList']) ? $this->post->storyIDList : die(js::locate($this->session->storyList, 'parent')); + $storyIDList = array_unique($storyIDList); $allChanges = $this->story->batchChangeBranch($storyIDList, $branchID); if(dao::isError()) die(js::error(dao::getError())); foreach($allChanges as $storyID => $changes) @@ -924,6 +930,7 @@ class story extends control public function batchChangeStage($stage) { $storyIDList = $this->post->storyIDList ? $this->post->storyIDList : die(js::locate($this->session->storyList, 'parent')); + $storyIDList = array_unique($storyIDList); $allChanges = $this->story->batchChangeStage($storyIDList, $stage); if(dao::isError()) die(js::error(dao::getError())); foreach($allChanges as $storyID => $changes) diff --git a/module/task/control.php b/module/task/control.php index 596ea01d78..4a5b9985d1 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -348,6 +348,7 @@ class task extends control } $taskIDList = $this->post->taskIDList ? $this->post->taskIDList : die(js::locate($this->session->taskList, 'parent')); + $taskIDList = array_unique($taskIDList); /* The tasks of project. */ if($projectID) @@ -460,6 +461,7 @@ class task extends control if($this->post->taskIDList) { $taskIDList = $this->post->taskIDList; + $taskIDList = array_unique($taskIDList); unset($_POST['taskIDList']); $allChanges = $this->task->batchChangeModule($taskIDList, $moduleID); if(dao::isError()) die(js::error(dao::getError())); @@ -486,6 +488,7 @@ class task extends control if(!empty($_POST)) { $taskIDList = $this->post->taskIDList; + $taskIDList = array_unique($taskIDList); unset($_POST['taskIDList']); if(!is_array($taskIDList)) die(js::locate($this->createLink('project', 'task', "projectID=$project"), 'parent')); $taskIDList = array_unique($taskIDList); @@ -890,6 +893,7 @@ class task extends control if($this->post->taskIDList) { $taskIDList = $this->post->taskIDList; + $taskIDList = array_unique($taskIDList); unset($_POST['taskIDList']); unset($_POST['assignedTo']); $this->loadModel('action'); @@ -923,6 +927,7 @@ class task extends control if($this->post->taskIDList or $skipTaskIdList) { $taskIDList = $this->post->taskIDList; + $taskIDList = array_unique($taskIDList); if($skipTaskIdList) $taskIDList = $skipTaskIdList; unset($_POST['taskIDList']); unset($_POST['assignedTo']); diff --git a/module/task/model.php b/module/task/model.php index c46556f34d..b3e7d27501 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1909,7 +1909,7 @@ class taskModel extends model break; case 'name': if(!empty($task->product) && isset($branchGroups[$task->product][$task->branch])) echo "" . $branchGroups[$task->product][$task->branch] . ' '; - if($modulePairs and $task->module) echo "" . $modulePairs[$task->module] . ' '; + if($task->module and isset($modulePairs[$task->module])) echo "" . $modulePairs[$task->module] . ' '; if($child) echo ''.$this->lang->task->childrenAB.' '; if(!empty($task->team)) echo ''.$this->lang->task->multipleAB.' '; echo $canView ? html::a($taskLink, $task->name, null, "style='color: $task->color'") : "$task->name"; diff --git a/module/testcase/control.php b/module/testcase/control.php index c6ad633bcb..84f19e59f9 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -651,6 +651,7 @@ class testcase extends control } $caseIDList = $this->post->caseIDList ? $this->post->caseIDList : die(js::locate($this->session->caseList)); + $caseIDList = array_unique($caseIDList); /* Get the edited cases. */ $cases = $this->testcase->getByList($caseIDList); @@ -779,6 +780,7 @@ class testcase extends control public function batchReview($result) { $caseIdList = $this->post->caseIDList ? $this->post->caseIDList : die(js::locate($this->session->caseList, 'parent')); + $caseIDList = array_unique($caseIDList); $actions = $this->testcase->batchReview($caseIdList, $result); if(dao::isError()) die(js::error(dao::getError())); @@ -832,6 +834,7 @@ class testcase extends control public function batchDelete($productID = 0) { $caseIDList = $this->post->caseIDList ? $this->post->caseIDList : die(js::locate($this->session->caseList)); + $caseIDList = array_unique($caseIDList); foreach($caseIDList as $caseID) $this->testcase->delete(TABLE_CASE, $caseID); die(js::locate($this->session->caseList)); @@ -849,6 +852,7 @@ class testcase extends control if($this->post->caseIDList) { $caseIDList = $this->post->caseIDList; + $caseIDList = array_unique($caseIDList); unset($_POST['caseIDList']); $allChanges = $this->testcase->batchChangeModule($caseIDList, $moduleID); if(dao::isError()) die(js::error(dao::getError())); @@ -873,6 +877,7 @@ class testcase extends control public function batchCaseTypeChange($result) { $caseIdList = $this->post->caseIDList ? $this->post->caseIDList : die(js::locate($this->session->caseList, 'parent')); + $caseIDList = array_unique($caseIDList); $this->testcase->batchCaseTypeChange($caseIdList, $result); if(dao::isError()) die(js::error(dao::getError())); @@ -1004,6 +1009,7 @@ class testcase extends control public function batchConfirmStoryChange($productID = 0) { $caseIDList = $this->post->caseIDList ? $this->post->caseIDList : die(js::locate($this->session->caseList)); + $caseIDList = array_unique($caseIDList); foreach($caseIDList as $caseID) $this->confirmStoryChange($caseID,false); die(js::locate($this->session->caseList)); diff --git a/module/testtask/control.php b/module/testtask/control.php index 60e5601185..2c83c01d46 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -877,6 +877,7 @@ class testtask extends control } $caseIDList = $this->post->caseIDList ? $this->post->caseIDList : die(js::locate($url, 'parent')); + $caseIDList = array_unique($caseIDList); /* The case of tasks of qa. */ if($productID)
- resolution, "class=form-control onchange=setDuplicate(this.value,$bugID)");?> + resolution, "class=form-control onchange=setDuplicate(this.value,$bugID)");?> ' resolution != 'duplicate') echo "style='display:none'";?>> + ' resolution != 'duplicate') echo "style='display:none'";?>> bug->duplicateBug}'");?>