diff --git a/api/v1/entries/builds.php b/api/v1/entries/builds.php
index fff692e506..46cbba813b 100644
--- a/api/v1/entries/builds.php
+++ b/api/v1/entries/builds.php
@@ -59,7 +59,7 @@ class buildsEntry extends entry
$control = $this->loadController('build', 'create');
$this->requireFields('execution,product,name,builder,date');
- $control->create(0,0,$projectID);
+ $control->create(0, 0, $projectID);
$data = $this->getData();
if(isset($data->result) and $data->result == 'fail') return $this->sendError(400, $data->message);
diff --git a/api/v1/entries/productplanlinkbug.php b/api/v1/entries/productplanlinkbugs.php
similarity index 94%
rename from api/v1/entries/productplanlinkbug.php
rename to api/v1/entries/productplanlinkbugs.php
index b553a092b4..33f6f7812d 100644
--- a/api/v1/entries/productplanlinkbug.php
+++ b/api/v1/entries/productplanlinkbugs.php
@@ -1,6 +1,6 @@
getInfo($this->param('fields', ''));
+ if(!is_numeric($userID))
+ {
+ $user = $this->loadModel('user')->getById($userID, 'account');
+ if(!$user) return $this->send404();
+ $userID = $user->id;
+ }
+
/* Get user by id. */
$control = $this->loadController('user', 'profile');
$control->profile($userID);
@@ -349,17 +356,25 @@ class userEntry extends Entry
/**
* PUT method.
*
- * @param int $userID
+ * @param int|string $userID
* @access public
* @return void
*/
public function put($userID)
{
+ if(!is_numeric($userID))
+ {
+ $user = $this->loadModel('user')->getById($userID, 'account');
+ if(!$user) return $this->send404();
+ $userID = $user->id;
+ }
+
$oldUser = $this->loadModel('user')->getByID($userID, 'id');
/* Set $_POST variables. */
$fields = 'dept,realname,email,commiter,gender';
$this->batchSetPost($fields, $oldUser);
+ $this->setPost('account', $oldUser->account);
if($this->request('gender') and !in_array($this->request('gender'), array('f', 'm'))) return $this->sendError(400, "The value of gendar must be 'f' or 'm'");
@@ -380,12 +395,19 @@ class userEntry extends Entry
/**
* DELETE method.
*
- * @param int $userID
+ * @param int|string $userID
* @access public
* @return void
*/
public function delete($userID)
{
+ if(!is_numeric($userID))
+ {
+ $user = $this->loadModel('user')->getById($userID, 'account');
+ if(!$user) return $this->send404();
+ $userID = $user->id;
+ }
+
$this->setPost('verifyPassword', md5($this->app->user->password . $this->app->session->rand));
$control = $this->loadController('user', 'delete');
diff --git a/config/routes.php b/config/routes.php
index 0141f6f578..2b5be5154b 100644
--- a/config/routes.php
+++ b/config/routes.php
@@ -24,13 +24,13 @@ $routes['/products/:id'] = 'product';
$routes['/productlines'] = 'productLines';
$routes['/productlines/:id'] = 'productLine';
-$routes['/productplans'] = 'productPlans';
-$routes['/products/:id/plans'] = 'productPlans';
-$routes['/productplans/:id'] = 'productPlan';
-$routes['/productplans/:id/linkstory'] = 'productPlanLinkStory';
-$routes['/productplans/:id/unlinkstory'] = 'productPlanUnlinkStory';
-$routes['/productplans/:id/linkbug'] = 'productPlanLinkBug';
-$routes['/productplans/:id/unlinkbug'] = 'productPlanUnlinkBug';
+$routes['/productplans'] = 'productPlans';
+$routes['/products/:id/plans'] = 'productPlans';
+$routes['/productplans/:id'] = 'productPlan';
+$routes['/productplans/:id/linkstories'] = 'productPlanLinkStories';
+$routes['/productplans/:id/unlinkstories'] = 'productPlanUnlinkStories';
+$routes['/productplans/:id/linkbugs'] = 'productPlanLinkBugs';
+$routes['/productplans/:id/unlinkbugs'] = 'productPlanUnlinkBugs';
$routes['/releases'] = 'releases';
$routes['/products/:id/releases'] = 'releases';
diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php
index bca8d23892..216fbacdf6 100644
--- a/module/bug/view/view.html.php
+++ b/module/bug/view/view.html.php
@@ -153,7 +153,7 @@
foreach($modulePath as $key => $module)
{
$moduleTitle .= $module->name;
- if(!common::printLink('bug', 'browse', "productID=$bug->product&branch=$module->branch&browseType=byModule¶m=$module->id", $module->name)) echo $module->name;
+ if(!common::printLink('bug', 'browse', "productID=$bug->product&branch=$module->branch&browseType=byModule¶m=$module->id", $module->name, '', "data-app='qa'")) echo $module->name;
if(isset($modulePath[$key + 1]))
{
$moduleTitle .= '/';
diff --git a/module/execution/model.php b/module/execution/model.php
index d59a6b7c6e..1d2c4dcfb2 100644
--- a/module/execution/model.php
+++ b/module/execution/model.php
@@ -73,7 +73,7 @@ class executionModel extends model
/* Unset story, bug, build and testtask if type is ops. */
$execution = $this->getByID($executionID);
- if($execution and $execution->type == 'stage')
+ if($execution and $execution->type == 'stage' and $this->config->systemMode == 'new')
{
global $lang;
$this->app->loadLang('project');
diff --git a/module/product/model.php b/module/product/model.php
index 535c652d4e..6e0c1a4b16 100644
--- a/module/product/model.php
+++ b/module/product/model.php
@@ -161,6 +161,7 @@ class productModel extends model
if($this->cookie->preProductID != $this->session->product)
{
+ $this->cookie->set('preBranch', 0);
setcookie('preBranch', 0, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
}
return $this->session->product;
diff --git a/module/project/view/bug.html.php b/module/project/view/bug.html.php
index 2fcba6a8c8..d4d985bfc6 100644
--- a/module/project/view/bug.html.php
+++ b/module/project/view/bug.html.php
@@ -18,6 +18,7 @@
product->getProductPairsByProject($project->id)) : $productID;
$buildName = $build ? " Build:{$build->name}" : '';
echo html::a($this->inlink('bug', "projectID={$project->id}&productID={$productID}&orderBy=status,id_desc&build=$buildID&type=all"), "{$lang->bug->allBugs}" . ($type == 'all' ? " {$pager->recTotal}$buildName" : ''), '', "id='allTab' class='btn btn-link" . ('all' == $type ? ' btn-active-text' : '') . "'");
echo html::a($this->inlink('bug', "projectID={$project->id}&productID={$productID}&orderBy=status,id_desc&build=$buildID&type=unresolved"), "{$lang->bug->unResolved}" . ($type == 'unresolved' ? " {$pager->recTotal}$buildName" : ''), '', "id='unresolvedTab' class='btn btn-link" . ('unresolved' == $type ? ' btn-active-text' : '') . "'");
diff --git a/module/qa/model.php b/module/qa/model.php
index fa41835710..c128e4d35f 100644
--- a/module/qa/model.php
+++ b/module/qa/model.php
@@ -32,7 +32,10 @@ class qaModel extends model
$branch = ($this->cookie->preBranch !== '' and $branch === '') ? $this->cookie->preBranch : $branch;
setcookie('preBranch', $branch, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
- if(!in_array($this->app->rawModule, $this->config->qa->noDropMenuModule)) $this->lang->switcherMenu = $this->loadModel('product')->getSwitcher($productID, $extra, $branch);
+ $product = $this->loadModel('product')->getById($productID);
+ if($product->type != 'normal') $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]);
+
+ if(!in_array($this->app->rawModule, $this->config->qa->noDropMenuModule)) $this->lang->switcherMenu = $this->product->getSwitcher($productID, $extra, $branch);
if($this->app->rawModule == 'product' and $this->app->rawMethod == 'showerrornone') $this->lang->switcherMenu = '';
common::setMenuVars('qa', $productID);
}
diff --git a/module/testcase/control.php b/module/testcase/control.php
index e9c4568599..2d4ef3170f 100644
--- a/module/testcase/control.php
+++ b/module/testcase/control.php
@@ -1839,7 +1839,8 @@ class testcase extends control
$caseLang = $this->lang->testcase;
$caseConfig = $this->config->testcase;
- $modules = $this->loadModel('tree')->getOptionMenu($productID, 'case', 0, $branch);
+ $branches = $this->loadModel('branch')->getPairs($productID);
+ $modules = $this->loadModel('tree')->getOptionMenu($productID, 'case', 0, empty(array_keys($branches)) ? 0 : array_keys($branches));
$stories = $this->loadModel('story')->getProductStoryPairs($productID, $branch);
$fields = $this->testcase->getImportFields($productID);
$fields = array_flip($fields);
@@ -2020,7 +2021,7 @@ class testcase extends control
$this->view->caseData = $caseData;
$this->view->stepData = $stepData;
$this->view->productID = $productID;
- $this->view->branches = $this->loadModel('branch')->getPairs($productID);
+ $this->view->branches = $branches;
$this->view->isEndPage = $pagerID >= $allPager;
$this->view->allCount = $allCount;
$this->view->allPager = $allPager;
diff --git a/module/testcase/view/showimport.html.php b/module/testcase/view/showimport.html.php
index 0b6cbc545a..79c721e73e 100644
--- a/module/testcase/view/showimport.html.php
+++ b/module/testcase/view/showimport.html.php
@@ -81,7 +81,8 @@ $(function()
title, ENT_QUOTES), "class='form-control'")?> |
- module) ? $case->module : ((!empty($case->id) and isset($cases[$case->id])) ? $cases[$case->id]->module : ''), "class='form-control chosen moduleChange'")?>
+ branch) and $case->branch != 0) ? $modules[BRANCH_MAIN] + $modules[$case->branch] : $modules;?>
+ module) ? $case->module : ((!empty($case->id) and isset($cases[$case->id])) ? $cases[$case->id]->module : ''), "class='form-control chosen moduleChange'")?>
|
story) ? $case->story : ((!empty($case->id) and isset($cases[$case->id])) ? $cases[$case->id]->story : '');?>
|