diff --git a/module/productplan/control.php b/module/productplan/control.php index 2dedca2b60..f8ea7be8e1 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -38,13 +38,13 @@ class productplan extends control /** * Create a plan. * - * @param string $product - * @param int $branch + * @param string $productID + * @param int $branchID * * @access public * @return void */ - public function create($product = '', $branch = 0, $parent = 0) + public function create($productID = '', $branchID = 0, $parent = 0) { if(!empty($_POST)) { @@ -55,11 +55,14 @@ class productplan extends control $this->executeHooks($planID); if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => 'parent.refreshPlan()')); - $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('productplan', 'browse', "productID=$product&branch=$branch"))); + $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('productplan', 'browse', "productID=$productID&branch=$branchID"))); } - $this->commonAction($product, $branch); - $lastPlan = $this->productplan->getLast($product, $branch, $parent); + $this->commonAction($productID, $branchID); + $lastPlan = $this->productplan->getLast($productID, $branchID, $parent); + + if($productID) commonModel::setAppObjectID('product', $productID); + if($lastPlan) { $timestamp = strtotime($lastPlan->end); @@ -77,7 +80,7 @@ class productplan extends control $this->view->position[] = $this->lang->productplan->create; $this->view->lastPlan = $lastPlan; - $this->view->branch = $branch; + $this->view->branch = $branchID; $this->view->parent = $parent; $this->display(); } diff --git a/module/release/control.php b/module/release/control.php index 32c1ca9d64..1596f190ff 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -81,6 +81,8 @@ class release extends control foreach($releaseBuilds as $build) unset($builds[$build]); unset($builds['trunk']); + commonModel::setAppObjectID('product', $productID); + $this->commonAction($productID, $branch); $this->view->title = $this->view->product->name . $this->lang->colon . $this->lang->release->create; $this->view->position[] = $this->lang->release->create;