* [perf story #69170] Adjust for batch cancel.
This commit is contained in:
@@ -798,8 +798,8 @@ class task extends control
|
||||
{
|
||||
if(!in_array($task->status, $this->config->task->unfinishedStatus)) continue;
|
||||
|
||||
$task = $this->taskZen->buildTaskForCancel($task);
|
||||
$this->task->cancel($task);
|
||||
$taskData = $this->taskZen->buildTaskForCancel($task);
|
||||
$this->task->cancel($task, $taskData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -840,7 +840,7 @@ class task extends control
|
||||
}
|
||||
|
||||
/* Skip parent task when batch close task. */
|
||||
if($task->parent == '-1')
|
||||
if($task->isParent)
|
||||
{
|
||||
$parentTasks[$taskID] = $taskID;
|
||||
continue;
|
||||
@@ -967,7 +967,7 @@ class task extends control
|
||||
public function delete(int $executionID, int $taskID, string $from = '')
|
||||
{
|
||||
$task = $this->task->getByID($taskID);
|
||||
if($task->parent == '-1') return $this->send(array('result' => 'fail', 'message' => $this->lang->task->cannotDeleteParent));
|
||||
if($task->isParent) return $this->send(array('result' => 'fail', 'message' => $this->lang->task->cannotDeleteParent));
|
||||
|
||||
$this->task->delete(TABLE_TASK, $taskID);
|
||||
if($task->parent > 0)
|
||||
|
||||
@@ -2651,13 +2651,10 @@ class taskModel extends model
|
||||
{
|
||||
foreach($tasks as &$task)
|
||||
{
|
||||
$task = $this->processTask($task);
|
||||
$task = $this->processTask($task, false);
|
||||
if(!empty($task->children))
|
||||
{
|
||||
foreach($task->children as &$child)
|
||||
{
|
||||
$child = $this->processTask($child);
|
||||
}
|
||||
foreach($task->children as &$child) $child = $this->processTask($child, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ if($isMultiple)
|
||||
}
|
||||
|
||||
$leftBox = '';
|
||||
if($task->parent != '-1')
|
||||
if($task->isParent == '0')
|
||||
{
|
||||
$leftBox = formGroup(
|
||||
set::width('1/2'),
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
<?php endif;?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if($task->parent != '-1'):?>
|
||||
<?php if($task->isParent == '0'):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->task->left;?></th>
|
||||
<td>
|
||||
|
||||
Reference in New Issue
Block a user