From ef45d5a9771ecd82aa4ad8a38bab93e6036a0d68 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 20 Feb 2024 10:23:35 +0800 Subject: [PATCH] * Fix bug #42737. --- module/action/control.php | 7 +++++++ module/action/lang/de.php | 1 + module/action/lang/en.php | 1 + module/action/lang/fr.php | 1 + module/action/lang/zh-cn.php | 1 + 5 files changed, 11 insertions(+) diff --git a/module/action/control.php b/module/action/control.php index f11f0df94b..d1817156b8 100755 --- a/module/action/control.php +++ b/module/action/control.php @@ -178,6 +178,13 @@ class action extends control return $this->send(array('result' => 'fail', 'callback' => "zui.Modal.alert({message: '{$this->lang->action->undeleteModuleTip}'}); $.ajaxSubmit({url: '{$url}'});")); } } + elseif($oldAction->objectType == 'task' && $confirmChange == 'no') + { + $task = $this->loadModel('task')->getById($oldAction->objectID); + $isDeleted = $this->dao->select('deleted')->from(TABLE_EXECUTION)->where('id')->eq($task->execution)->fetch(); + $url = $this->createLink('action', 'undelete', "action={$actionID}&browseType={$browseType}&confirmChange=yes"); + if($isDeleted) return $this->send(array('result' => 'fail', 'callback' => "zui.Modal.confirm({message: '{$this->lang->action->undeleteTaskTip}'}).then((res) => {if(res) $.ajaxSubmit({url: '{$url}'});});")); + } $result = $this->action->undelete($actionID); if(true !== $result) return $this->send(array('result' => 'fail', 'load' => array('confirm' => $result))); diff --git a/module/action/lang/de.php b/module/action/lang/de.php index 9d66d3662a..aedd73081a 100644 --- a/module/action/lang/de.php +++ b/module/action/lang/de.php @@ -69,6 +69,7 @@ $lang->action->hasDeletedParent = 'Restoring this phase requires restoring the $lang->action->hasChangedAttr = "After recovery, the phase type will be adjusted to '%s' according to the parent phase type."; $lang->action->whetherToRestore = 'Confirm to restore?'; $lang->action->undeleteModuleTip = 'Once the subdirectory has been restored, its parent directory will also be automatically recovered and synchronized.'; +$lang->action->undeleteTaskTip = 'The execution associated with this task has been removed. If you choose to restore it, the task will no longer be visible. Would you like to proceed with restoring the task?'; $lang->action->hasOtherType = array(); $lang->action->hasOtherType['stage'] = "Only subtypes of {$lang->executionCommon} / Kanban types can be created at this parent stage, so the current stage cannot be restored."; diff --git a/module/action/lang/en.php b/module/action/lang/en.php index 993abf5c26..a6e81fc83f 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -69,6 +69,7 @@ $lang->action->hasDeletedParent = 'Restoring this phase requires restoring the $lang->action->hasChangedAttr = "After recovery, the phase type will be adjusted to '%s' according to the parent phase type."; $lang->action->whetherToRestore = 'Confirm to restore?'; $lang->action->undeleteModuleTip = 'Once the subdirectory has been restored, its parent directory will also be automatically recovered and synchronized.'; +$lang->action->undeleteTaskTip = 'The execution associated with this task has been removed. If you choose to restore it, the task will no longer be visible. Would you like to proceed with restoring the task?'; $lang->action->hasOtherType = array(); $lang->action->hasOtherType['stage'] = "Only subtypes of {$lang->executionCommon} / Kanban types can be created at this parent stage, so the current stage cannot be restored."; diff --git a/module/action/lang/fr.php b/module/action/lang/fr.php index b19fccd492..d610af26aa 100644 --- a/module/action/lang/fr.php +++ b/module/action/lang/fr.php @@ -69,6 +69,7 @@ $lang->action->hasDeletedParent = 'Restoring this phase requires restoring the $lang->action->hasChangedAttr = "After recovery, the phase type will be adjusted to '%s' according to the parent phase type."; $lang->action->whetherToRestore = 'Confirm to restore?'; $lang->action->undeleteModuleTip = 'Once the subdirectory has been restored, its parent directory will also be automatically recovered and synchronized.'; +$lang->action->undeleteTaskTip = 'The execution associated with this task has been removed. If you choose to restore it, the task will no longer be visible. Would you like to proceed with restoring the task?'; $lang->action->hasOtherType = array(); $lang->action->hasOtherType['stage'] = "Only subtypes of {$lang->executionCommon} / Kanban types can be created at this parent stage, so the current stage cannot be restored."; diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index 4e452a885a..742bb97b54 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -69,6 +69,7 @@ $lang->action->hasDeletedParent = '恢复该阶段需要同时恢复已删除 $lang->action->hasChangedAttr = '恢复后阶段类型将根据父阶段类型均调整为“%s”,'; $lang->action->whetherToRestore = '是否恢复?'; $lang->action->undeleteModuleTip = '子目录恢复后,会同步恢复他的上级目录。'; +$lang->action->undeleteTaskTip = '该任务所属执行已删除,还原后不能看到该任务,是否继续还原任务?'; $lang->action->hasOtherType = array(); $lang->action->hasOtherType['stage'] = "当前阶段的父级现在只允许创建{$lang->executionCommon}/看板类型的子级,故无法恢复当前阶段。";