* Adjust for batch unlink story page.

This commit is contained in:
wangyidong
2023-07-11 15:14:07 +08:00
parent fda5bae1ad
commit 9c2adf7a54
15 changed files with 130 additions and 65 deletions
+6 -20
View File
@@ -3402,6 +3402,8 @@ class execution extends control
{
$execution = $this->execution->getByID($executionID);
$this->execution->unlinkStory($executionID, $storyID, $laneID, $columnID);
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
if($execution->type == 'kanban')
{
/* Fix bug #29171. */
@@ -3410,22 +3412,6 @@ class execution extends control
if(empty($executionStories)) $this->execution->unlinkStory($execution->parent, $storyID, $laneID, $columnID);
}
/* if kanban then reload and if ajax request then send result. */
if(helper::isAjaxRequest())
{
if(dao::isError())
{
$response['result'] = 'fail';
$response['message'] = dao::getError();
}
else
{
$response['result'] = 'success';
$response['message'] = '';
}
return $this->send($response);
}
$execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all';
$execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default';
if($this->app->tab == 'execution' and $execution->type == 'kanban')
@@ -3433,7 +3419,7 @@ class execution extends control
$rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : '';
$kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $execLaneType, 'id_desc', 0, $execGroupBy, $rdSearchValue);
$kanbanData = json_encode($kanbanData);
return print(js::closeModal('parent', '', "parent.updateKanban($kanbanData)"));
return $this->send(array('result' => 'success', 'closeModal' => true, 'callback' => "updateKanban($kanbanData)"));
}
elseif($from == 'taskkanban')
{
@@ -3442,10 +3428,10 @@ class execution extends control
$kanbanType = $execLaneType == 'all' ? 'story' : key($kanbanData);
$kanbanData = $kanbanData[$kanbanType];
$kanbanData = json_encode($kanbanData);
return print(js::closeModal('parent', '', "parent.updateKanban(\"story\", $kanbanData)"));
return $this->send(array('result' => 'success', 'closeModal' => true, 'callback' => "updateKanban(\"story\", $kanbanData)"));
}
return print(js::reload('parent'));
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'load' => true));
}
}
@@ -3474,7 +3460,7 @@ class execution extends control
}
}
if(!dao::isError()) $this->loadModel('score')->create('ajax', 'batchOther');
return print(js::locate($this->createLink('execution', 'story', "executionID=$executionID")));
return $this->send(array('result' => 'success', 'load' => $this->createLink('execution', 'story', "executionID=$executionID")));
}
/**