* Return json data for ajaxForm.

This commit is contained in:
daitingting
2018-04-17 15:41:53 +08:00
parent 3c6d4425c4
commit e0d5829bd2
2 changed files with 6 additions and 9 deletions
+4 -7
View File
@@ -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));
+2 -2
View File
@@ -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);