* Implement the partial refresh function of the task card.

This commit is contained in:
tianshujie
2022-01-20 15:31:10 +08:00
parent 49cf88b669
commit 25ee419afc
4 changed files with 206 additions and 24 deletions
+198 -17
View File
@@ -146,7 +146,20 @@ class task extends control
if($this->viewType == 'json' or (defined('RUN_MODE') && RUN_MODE == 'api')) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $taskID));
/* If link from no head then reload. */
if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
if(isonlybody())
{
if($execution->type == 'kanban')
{
$kanbanData = $this->kanban->getRDKanban($executionID, $this->session->execLaneType ? $this->session->execLaneType : 'all');
$kanbanData = json_encode($kanbanData);
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.updateKanban($kanbanData, 0)"));
}
else
{
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
}
}
/* Locate the browser. */
if($this->app->getViewType() == 'xhtml')
@@ -309,7 +322,20 @@ class task extends control
if($this->viewType == 'json' or (defined('RUN_MODE') && RUN_MODE == 'api')) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $taskIDList));
/* If link from no head then reload. */
if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
if(isonlybody())
{
if($execution->type == 'kanban')
{
$kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $this->session->execLaneType ? $this->session->execLaneType : 'all');
$kanbanData = json_encode($kanbanData);
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.updateKanban($kanbanData, 0)"));
}
else
{
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
}
}
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $taskLink));
}
@@ -424,7 +450,22 @@ class task extends control
}
}
if(isonlybody()) die(js::reload('parent.parent'));
if(isonlybody())
{
$execution = $this->execution->getByID($task->execution);
if($execution->type == 'kanban')
{
$kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all');
$kanbanData = json_encode($kanbanData);
return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)"));
}
else
{
return print(js::reload('parent.parent'));
}
}
if(defined('RUN_MODE') && RUN_MODE == 'api')
{
return $this->send(array('status' => 'success', 'data' => $taskID));
@@ -622,7 +663,22 @@ class task extends control
$this->executeHooks($taskID);
if($this->viewType == 'json' or (defined('RUN_MODE') && RUN_MODE == 'api')) return $this->send(array('result' => 'success'));
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
if(isonlybody())
{
$task = $this->task->getById($taskID);
$execution = $this->execution->getByID($task->execution);
if($execution->type == 'kanban')
{
$kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all');
$kanbanData = json_encode($kanbanData);
return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)"));
}
else
{
return print(js::closeModal('parent.parent', 'this'));
}
}
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
}
@@ -809,6 +865,9 @@ class task extends control
{
$this->commonAction($taskID);
$extra = str_replace(array(',', ' '), array('&', ''), $extra);
parse_str($extra, $output);
$task = $this->task->getById($taskID);
if(!empty($_POST))
@@ -848,7 +907,23 @@ class task extends control
}
if($this->viewType == 'json' or (defined('RUN_MODE') && RUN_MODE == 'api')) return $this->send(array('result' => 'success'));
if(isonlybody()) die(js::closeModal('parent.parent', 'this', "function(){parent.parent.location.reload();}"));
if(isonlybody())
{
$execution = $this->execution->getByID($task->execution);
if($execution->type == 'kanban')
{
$regionID = isset($output['regionID']) ? $output['regionID'] : 0;
$kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', $regionID);
$kanbanData = json_encode($kanbanData);
return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)"));
}
else
{
return print(js::closeModal('parent.parent', 'this', "function(){parent.parent.location.reload();}"));
}
}
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
}
@@ -895,8 +970,22 @@ class task extends control
}
}
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
if(isonlybody())
{
$execution = $this->execution->getByID($task->execution);
if($execution->type == 'kanban')
{
$kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all');
$kanbanData = json_encode($kanbanData);
return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)"));
}
else
{
return print(js::closeModal('parent.parent', 'this'));
}
}
return print(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
}
$this->session->set('estimateList', $this->app->getURI(true), 'execution');
@@ -1019,8 +1108,7 @@ class task extends control
$execution = $this->execution->getByID($task->execution);
if($execution->type == 'kanban')
{
$regionID = isset($output['regionID']) ? $output['regionID'] : 0;
$kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, 'all', 'id_desc', $regionID);
$kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc');
$kanbanData = json_encode($kanbanData);
return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)"));
@@ -1083,6 +1171,9 @@ class task extends control
{
$this->commonAction($taskID);
$extra = str_replace(array(',', ' '), array('&', ''), $extra);
parse_str($extra, $output);
if(!empty($_POST))
{
$this->loadModel('action');
@@ -1097,8 +1188,25 @@ class task extends control
$this->executeHooks($taskID);
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
if(isonlybody())
{
$task = $this->task->getById($taskID);
$execution = $this->execution->getByID($task->execution);
if($execution->type == 'kanban')
{
$regionID = isset($output['regionID']) ? $output['regionID'] : 0;
$kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', $regionID);
$kanbanData = json_encode($kanbanData);
return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)"));
}
else
{
return print(js::closeModal('parent.parent', 'this'));
}
}
return print(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
}
$this->view->title = $this->view->execution->name . $this->lang->colon .$this->lang->task->pause;
@@ -1136,8 +1244,23 @@ class task extends control
$this->executeHooks($taskID);
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
if(isonlybody())
{
$task = $this->task->getById($taskID);
$execution = $this->execution->getByID($task->execution);
if($execution->type == 'kanban')
{
$kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all');
$kanbanData = json_encode($kanbanData);
return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)"));
}
else
{
return print(js::closeModal('parent.parent', 'this'));
}
}
return print(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
}
$this->view->title = $this->view->execution->name . $this->lang->colon .$this->lang->task->restart;
@@ -1161,6 +1284,9 @@ class task extends control
{
$this->commonAction($taskID);
$extra = str_replace(array(',', ' '), array('&', ''), $extra);
parse_str($extra, $output);
if(!empty($_POST))
{
$this->loadModel('action');
@@ -1176,7 +1302,24 @@ class task extends control
$this->executeHooks($taskID);
if(isonlybody()) die(js::closeModal('parent.parent', 'this', "function(){parent.parent.location.reload();}"));
if(isonlybody())
{
$task = $this->task->getById($taskID);
$execution = $this->execution->getByID($task->execution);
if($execution->type == 'kanban')
{
$regionID = isset($output['regionID']) ? $output['regionID'] : 0;
$kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', $regionID);
$kanbanData = json_encode($kanbanData);
return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)"));
}
else
{
return print(js::closeModal('parent.parent', 'this', "function(){parent.parent.location.reload();}"));
}
}
if(defined('RUN_MODE') && RUN_MODE == 'api')
{
return $this->send(array('status' => 'success', 'data' => $taskID));
@@ -1293,6 +1436,9 @@ class task extends control
{
$this->commonAction($taskID);
$extra = str_replace(array(',', ' '), array('&', ''), $extra);
parse_str($extra, $output);
if(!empty($_POST))
{
$this->loadModel('action');
@@ -1307,7 +1453,23 @@ class task extends control
$this->executeHooks($taskID);
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
if(isonlybody())
{
$task = $this->task->getById($taskID);
$execution = $this->execution->getByID($task->execution);
if($execution->type == 'kanban')
{
$regionID = isset($output['regionID']) ? $output['regionID'] : 0;
$kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', $regionID);
$kanbanData = json_encode($kanbanData);
return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)"));
}
else
{
return print(js::closeModal('parent.parent', 'this'));
}
}
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
}
@@ -1330,6 +1492,9 @@ class task extends control
{
$this->commonAction($taskID);
$extra = str_replace(array(',', ' '), array('&', ''), $extra);
parse_str($extra, $output);
if(!empty($_POST))
{
$this->loadModel('action');
@@ -1344,8 +1509,24 @@ class task extends control
$this->executeHooks($taskID);
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
if(isonlybody())
{
$task = $this->task->getById($taskID);
$execution = $this->execution->getByID($task->execution);
if($execution->type == 'kanban')
{
$regionID = isset($output['regionID']) ? $output['regionID'] : 0;
$kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', $regionID);
$kanbanData = json_encode($kanbanData);
return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)"));
}
else
{
return print(js::closeModal('parent.parent', 'this'));
}
}
return print(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
}
if(!empty($this->view->task->team))