diff --git a/module/product/control.php b/module/product/control.php index 862a0ee779..b227c51da1 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -219,15 +219,12 @@ class product extends control if(!empty($_POST)) { $productID = $this->product->create(); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); $this->loadModel('action')->create('product', $productID, 'opened'); - if(isset($this->config->global->flow) and $this->config->global->flow == 'onlyTest') - { - die(js::locate($this->createLink($this->moduleName, 'build', "productID=$productID"), 'parent')); - } - - die(js::locate($this->createLink($this->moduleName, 'browse', "productID=$productID"), 'parent')); + $locate = $this->createLink($this->moduleName, 'browse', "productID=$productID"); + if(isset($this->config->global->flow) and $this->config->global->flow == 'onlyTest') $locate = $this->createLink($this->moduleName, 'build', "productID=$productID"); + $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locate)); } $this->product->setMenu($this->products, key($this->products)); diff --git a/module/release/control.php b/module/release/control.php index 9a8f99c152..1dd9f415cc 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -60,9 +60,9 @@ class release extends control if(!empty($_POST)) { $releaseID = $this->release->create($productID, $branch); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); $this->loadModel('action')->create('release', $releaseID, 'opened'); - die(js::locate(inlink('view', "releaseID=$releaseID"), 'parent')); + $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "releaseID=$releaseID"))); } $builds = $this->loadModel('build')->getProductBuildPairs($productID, $branch, 'notrunk|withbranch', false);