* Return id when create object by API.

This commit is contained in:
holan20180123
2021-05-12 15:44:04 +08:00
parent 53fc060547
commit c5dd642138
4 changed files with 20 additions and 1 deletions
+10
View File
@@ -385,6 +385,9 @@ class bug extends control
$this->executeHooks($bugID);
/* Return bug id when call the API. */
if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $bugID));
/* If link from no head then reload. */
if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
@@ -613,6 +616,13 @@ class bug extends control
{
$actions = $this->bug->batchCreate($productID, $branch);
/* Return bug id list when call the API. */
if($this->viewType == 'json')
{
$bugIDList = array_keys($actions);
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $bugIDList));
}
setcookie('bugModule', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
die(js::locate($this->createLink('bug', 'browse', "productID={$productID}&branch=$branch&browseType=unclosed&param=0&orderBy=id_desc"), 'parent'));
}