* [bug#59858] Close not done tasks when batch close task.

This commit is contained in:
xieqiyu
2025-02-26 16:33:34 +08:00
committed by 代婷婷
parent 3aa048d7b7
commit 025bb05eb4
3 changed files with 26 additions and 7 deletions
+23
View File
@@ -16,6 +16,29 @@ $(document).off('click','.batch-btn').on('click', '.batch-btn', function()
{
$.ajaxSubmit({url, data: form}).then();
}
else if($(this).hasClass('ajax-batch-close'))
{
$.ajaxSubmit({
url,
data: form,
onComplete: function(message)
{
if(message.result == 'confirmSkipTask')
{
const skipTasks = message.skipTasks;
zui.Modal.confirm(skipTaskTip.replace('%s', Object.keys(skipTasks).join(','))).then((res) =>
{
if(res)
{
const newForm = new FormData();
Object.keys(skipTasks).forEach((id) => newForm.append('taskIdList[]', id));
$.ajaxSubmit({url: $.createLink('task', 'batchClose', 'confirm=yes'), data: newForm}).then();
}
})
}
}
}).then();
}
else
{
postAndLoadPage(url, form);
+2 -1
View File
@@ -263,7 +263,7 @@ if($canBatchAction)
$batchCancelClass = $config->edition == 'open' ? 'ajax-btn' : 'ajax-cancel-btn';
$batchItems = array
(
array('text' => $lang->close, 'innerClass' => 'batch-btn ajax-btn not-open-url', 'disabled' => !$canBatchClose, 'data-url' => createLink('task', 'batchClose')),
array('text' => $lang->close, 'innerClass' => 'batch-btn ajax-batch-close not-open-url', 'disabled' => !$canBatchClose, 'data-url' => createLink('task', 'batchClose')),
array('text' => $lang->task->cancel, 'innerClass' => "batch-btn $batchCancelClass not-open-url", 'disabled' => !$canBatchCancel, 'data-url' => createLink('task', 'batchCancel'))
);
}
@@ -312,6 +312,7 @@ jsVar('todayLabel', $lang->today);
jsVar('yesterdayLabel', $lang->yesterday);
jsVar('teamLang', $lang->task->team);
jsVar('delayWarning', $lang->task->delayWarning);
jsVar('skipTaskTip', $lang->task->error->skipClose);
if($viewType == 'tiled') $cols['name']['nestedToggle'] = false;
dtable
+1 -6
View File
@@ -1880,12 +1880,7 @@ class taskZen extends task
*/
protected function responseAfterBatchClose(array $skipTasks, string $confirm): array
{
if(!empty($skipTasks) && $confirm == 'no')
{
$skipTasks = implode(',', $skipTasks);
$confirmURL = $this->createLink('task', 'batchClose', "confirm=yes");
return array('result' => 'success', 'load' => array('confirm' => sprintf($this->lang->task->error->skipClose, $skipTasks), 'confirmed' => $confirmURL));
}
if(!empty($skipTasks) && $confirm == 'no') return array('result' => 'confirmSkipTask', 'skipTasks' => $skipTasks);
return array('result' => 'success', 'load' => true);
}