diff --git a/module/bug/config.php b/module/bug/config.php index 7b21db695a..c450bb1715 100644 --- a/module/bug/config.php +++ b/module/bug/config.php @@ -43,7 +43,7 @@ $config->bug->list->customBatchEditFields = 'type,severity,pri,productplan,ass $config->bug->custom = new stdclass(); $config->bug->custom->createFields = $config->bug->list->customCreateFields; $config->bug->custom->batchCreateFields = 'module,project,steps,type,severity,os,browser'; -$config->bug->custom->batchEditFields = 'type,severity,pri,assignedTo,deadline,status,resolvedBy,resolution'; +$config->bug->custom->batchEditFields = 'type,severity,pri,branch,assignedTo,deadline,status,resolvedBy,resolution'; $config->bug->editor = new stdclass(); $config->bug->editor->create = array('id' => 'steps', 'tools' => 'bugTools'); diff --git a/module/bug/control.php b/module/bug/control.php index 01cde93b24..69cf045934 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -615,11 +615,14 @@ class bug extends control } $bugIDList = $this->post->bugIDList ? $this->post->bugIDList : die(js::locate($this->session->bugList, 'parent')); + /* Initialize vars.*/ + $bugs = $this->dao->select('*')->from(TABLE_BUG)->where('id')->in($bugIDList)->fetchAll('id'); /* The bugs of a product. */ if($productID) { $product = $this->product->getByID($productID); + $branchProduct = $product->type == 'normal' ? false : true; /* Set plans. */ $plans = $this->loadModel('productplan')->getPairs($productID, $branch); @@ -630,10 +633,24 @@ class bug extends control $this->view->title = $product->name . $this->lang->colon . "BUG" . $this->lang->bug->batchEdit; $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]); $this->view->plans = $plans; + $this->view->branches = $product->type == 'normal' ? array() : array('' => '', 'ditto' => $this->lang->bug->ditto) + $this->loadModel('branch')->getPairs($product->id); } /* The bugs of my. */ else { + $branchProduct = false; + $productIdList = array(); + foreach($bugs as $bug) $productIdList[$bug->product] = $bug->product; + $products = $this->product->getByIdList($productIdList); + foreach($products as $product) + { + if($product->type != 'normal') + { + $branchProduct = true; + break; + } + } + $this->lang->bug->menu = $this->lang->my->menu; $this->lang->set('menugroup.bug', 'my'); $this->lang->bug->menuOrder = $this->lang->my->menuOrder; @@ -641,8 +658,6 @@ class bug extends control $this->view->position[] = html::a($this->createLink('my', 'bug'), $this->lang->my->bug); $this->view->title = "BUG" . $this->lang->bug->batchEdit; } - /* Initialize vars.*/ - $bugs = $this->dao->select('*')->from(TABLE_BUG)->where('id')->in($bugIDList)->fetchAll('id'); /* Judge whether the editedTasks is too large and set session. */ $countInputVars = count($bugs) * (count(explode(',', $this->config->bug->custom->batchEditFields)) + 2); @@ -663,6 +678,7 @@ class bug extends control $this->view->position[] = $this->lang->bug->batchEdit; $this->view->bugIDList = $bugIDList; $this->view->productID = $productID; + $this->view->branchProduct = $branchProduct; $this->view->severityList = array('ditto' => $this->lang->bug->ditto) + $this->lang->bug->severityList; $this->view->typeList = array('' => '', 'ditto' => $this->lang->bug->ditto) + $this->lang->bug->typeList; $this->view->priList = array('0' => '', 'ditto' => $this->lang->bug->ditto) + $this->lang->bug->priList; diff --git a/module/bug/model.php b/module/bug/model.php index 42b9bda6f6..4a4fd2e217 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -548,6 +548,7 @@ class bugModel extends model if($data->types[$bugID] == 'ditto') $data->types[$bugID] = isset($prev['type']) ? $prev['type'] : ''; if($data->severities[$bugID] == 'ditto') $data->severities[$bugID] = isset($prev['severity']) ? $prev['severity'] : 3; if($data->pris[$bugID] == 'ditto') $data->pris[$bugID] = isset($prev['pri']) ? $prev['pri'] : 0; + if($data->branches[$bugID] == 'ditto') $data->branches[$bugID] = isset($prev['branch']) ? $prev['branch'] : 0; if($data->plans[$bugID] == 'ditto') $data->plans[$bugID] = isset($prev['plan']) ? $prev['plan'] : ''; if($data->assignedTos[$bugID] == 'ditto') $data->assignedTos[$bugID] = isset($prev['assignedTo']) ? $prev['assignedTo'] : ''; if($data->resolvedBys[$bugID] == 'ditto') $data->resolvedBys[$bugID] = isset($prev['resolvedBy']) ? $prev['resolvedBy'] : ''; @@ -558,6 +559,7 @@ class bugModel extends model $prev['type'] = $data->types[$bugID]; $prev['severity'] = $data->severities[$bugID]; $prev['pri'] = $data->pris[$bugID]; + $prev['branch'] = $data->branches[$bugID]; $prev['plan'] = $data->plans[$bugID]; $prev['assignedTo'] = $data->assignedTos[$bugID]; $prev['resolvedBy'] = $data->resolvedBys[$bugID]; @@ -581,6 +583,7 @@ class bugModel extends model $bug->color = $data->colors[$bugID]; $bug->title = $data->titles[$bugID]; $bug->plan = empty($data->plans[$bugID]) ? 0 : $data->plans[$bugID]; + $bug->branch = empty($data->branches[$bugID]) ? 0 : $data->branches[$bugID]; $bug->assignedTo = $data->assignedTos[$bugID]; $bug->deadline = $data->deadlines[$bugID]; $bug->resolvedBy = $data->resolvedBys[$bugID]; diff --git a/module/bug/view/batchedit.html.php b/module/bug/view/batchedit.html.php index 132308131d..fc839a39ab 100644 --- a/module/bug/view/batchedit.html.php +++ b/module/bug/view/batchedit.html.php @@ -42,6 +42,9 @@ $columns = count($visibleFields) + 2;