diff --git a/module/bug/model.php b/module/bug/model.php
index a86dc4f60c..9d2c90a7d7 100644
--- a/module/bug/model.php
+++ b/module/bug/model.php
@@ -2667,7 +2667,7 @@ class bugModel extends model
$assignToLink = helper::createLink('bug', 'assignTo', "bugID=$bug->id", '', true);
$assignToHtml = html::a($assignToLink, " {$assignedToText}", '', "class='$btnClass'");
- echo !common::hasPriv('bug', 'assignTo') ? "{$assignedToText}" : $assignToHtml;
+ echo !common::hasPriv('bug', 'assignTo', $bug) ? "{$assignedToText}" : $assignToHtml;
}
/**
diff --git a/module/common/lang/en.php b/module/common/lang/en.php
index 4454234b3b..346639860e 100644
--- a/module/common/lang/en.php
+++ b/module/common/lang/en.php
@@ -865,3 +865,4 @@ if(isset($config->global->flow) and $config->global->flow == 'onlyTest')
unset($lang->searchObjects['release']);
unset($lang->searchObjects['project']);
unset($lang->searchObjects['productplan']);
+}
diff --git a/module/dept/view/edit.html.php b/module/dept/view/edit.html.php
index 11dae74392..f75b7a2dc9 100644
--- a/module/dept/view/edit.html.php
+++ b/module/dept/view/edit.html.php
@@ -14,7 +14,6 @@
$webRoot = $this->app->getWebRoot();
$jsRoot = $webRoot . "js/";
?>
-
+
diff --git a/module/task/model.php b/module/task/model.php
index a94af1c135..70e5fab50e 100644
--- a/module/task/model.php
+++ b/module/task/model.php
@@ -2646,7 +2646,7 @@ class taskModel extends model
$assignToLink = helper::createLink('task', 'assignTo', "projectID=$task->project&taskID=$task->id", '', true);
$assignToHtml = html::a($assignToLink, " {$assignedToText}", '', "class='$btnClass'");
- echo !common::hasPriv('task', 'assignTo') ? "{$assignedToText}" : $assignToHtml;
+ echo !common::hasPriv('task', 'assignTo', $task) ? "{$assignedToText}" : $assignToHtml;
}
/**
diff --git a/module/testcase/control.php b/module/testcase/control.php
index ce98ec767a..59253bc911 100644
--- a/module/testcase/control.php
+++ b/module/testcase/control.php
@@ -252,15 +252,9 @@ class testcase extends control
}
if(empty($this->products)) $this->locate($this->createLink('product', 'create'));
- /* Set productID and currentModuleID. */
+ /* Set productID and branch. */
$productID = $this->product->saveState($productID, $this->products);
if($branch === '') $branch = (int)$this->cookie->preBranch;
- if($storyID and empty($moduleID))
- {
- $story = $this->loadModel('story')->getByID($storyID);
- $moduleID = $story->module;
- }
- $currentModuleID = (int)$moduleID;
/* Set menu. */
$this->testcase->setMenu($this->products, $productID, $branch);
@@ -319,6 +313,14 @@ class testcase extends control
$position[] = $this->lang->testcase->common;
$position[] = $this->lang->testcase->create;
+ /* Set story and currentModuleID. */
+ if($storyID and empty($moduleID))
+ {
+ $story = $this->loadModel('story')->getByID($storyID);
+ $moduleID = $story->module;
+ }
+ $currentModuleID = (int)$moduleID;
+
/* Get the status of stories are not closed. */
$storyStatus = $this->lang->story->statusList;
$modules = array();
@@ -328,6 +330,7 @@ class testcase extends control
$modules = $this->tree->getAllChildID($modules);
}
$stories = $this->story->getProductStoryPairs($productID, $branch, $modules, array_keys($storyStatus), 'id_desc', 50);
+ if($storyID and !isset($stories[$storyID])) $stories = $this->story->formatStories(array($storyID => $story)) + $stories;//Fix bug #2406.
/* Set custom. */
foreach(explode(',', $this->config->testcase->customCreateFields) as $field) $customFields[$field] = $this->lang->testcase->$field;
@@ -339,7 +342,7 @@ class testcase extends control
$this->view->productID = $productID;
$this->view->productName = $this->products[$productID];
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0, $branch);
- $this->view->currentModuleID = $currentModuleID ? $currentModuleID : (isset($story->module) ? $story->module : 0);
+ $this->view->currentModuleID = $currentModuleID;
$this->view->stories = $stories;
$this->view->caseTitle = $caseTitle;
$this->view->color = $color;
diff --git a/module/tree/view/edit.html.php b/module/tree/view/edit.html.php
index 1bcd06b5c1..abaf173532 100644
--- a/module/tree/view/edit.html.php
+++ b/module/tree/view/edit.html.php
@@ -15,7 +15,6 @@ $webRoot = $this->app->getWebRoot();
$jsRoot = $webRoot . "js/";
js::set('type', $type);
?>
-