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 @@