From c1337e49da2eca38d1d34262ee01e5184f07f513 Mon Sep 17 00:00:00 2001 From: ChuJilu Date: Wed, 5 Nov 2014 17:23:04 +0800 Subject: [PATCH] * finish task #2107. --- module/bug/control.php | 6 +++++- module/bug/view/browse.html.php | 15 +++++++++++++++ module/project/control.php | 1 + module/project/view/bug.html.php | 2 +- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 448a6aba0d..06e2a9df25 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -136,6 +136,8 @@ class bug extends control $bug->openedBuild = rtrim($openedBuild, ','); $bug->resolvedBuild = isset($builds[$bug->resolvedBuild]) ? $builds[$bug->resolvedBuild] : $bug->resolvedBuild; } + + $memberPairs = $this->user->getPairs('noletter'); $title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->common; $position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); @@ -154,6 +156,7 @@ class bug extends control $this->view->param = $param; $this->view->orderBy = $orderBy; $this->view->moduleID = $moduleID; + $this->view->memberPairs = $memberPairs; $this->display(); } @@ -680,7 +683,7 @@ class bug extends control * @access public * @return void */ - public function batchAssignTo($projectID) + public function batchAssignTo($projectID, $type = 'project') { if(!empty($_POST) && isset($_POST['bugIDList'])) { @@ -696,6 +699,7 @@ class bug extends control $this->sendmail($bugID, $actionID); } } + if($type == 'product') die(js::locate($this->createLink('bug', 'browse', "productID=$projectID"))); die(js::locate($this->createLink('project', 'bug', "projectID=$projectID"))); } diff --git a/module/bug/view/browse.html.php b/module/bug/view/browse.html.php index 6c9d4c9ee1..8f8ed62caf 100644 --- a/module/bug/view/browse.html.php +++ b/module/bug/view/browse.html.php @@ -229,6 +229,21 @@ js::set('moduleID', $moduleID); ?> + createLink('bug', 'batchAssignTo', "productID={$productID}&type=product"); + echo "
"; + echo html::select('assignedTo', $memberPairs, '', 'class="form-control chosen"'); + echo ""; + echo html::a("javascript:setFormAction(\"$actionLink\")", $lang->bug->assignTo); + echo '
'; + } + } + ?>
show();?>
diff --git a/module/project/control.php b/module/project/control.php index 953a7872d7..b25f6329e4 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -606,6 +606,7 @@ class project extends control /* team member pairs. */ $memberPairs = array(); + $memberPairs['0'] = ''; foreach($this->view->teamMembers as $key => $member) { $memberPairs[$key] = $member->realname; diff --git a/module/project/view/bug.html.php b/module/project/view/bug.html.php index 4f0e8f8b3b..13aa5c0b3f 100644 --- a/module/project/view/bug.html.php +++ b/module/project/view/bug.html.php @@ -75,7 +75,7 @@ echo "
" . html::selectButton() . '
'; if($canBatchAssignTo) { - $actionLink = $this->createLink('bug', 'batchAssignTo', "projectID=$project->id"); + $actionLink = $this->createLink('bug', 'batchAssignTo', "projectID={$project->id}&type=project"); echo "
"; echo html::select('assignedTo', $memberPairs, '', 'class="form-control chosen"'); echo "";