From 8d17a390c0c5ebc1cdca370a6a465c539570cbf0 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Tue, 22 Mar 2022 09:23:21 +0000 Subject: [PATCH] * Fix bug #15517. --- module/action/lang/en.php | 17 +++++++++-------- module/action/lang/zh-cn.php | 17 +++++++++-------- module/action/model.php | 3 +++ 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/module/action/lang/en.php b/module/action/lang/en.php index 8849e59bd2..a080f89426 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -46,14 +46,15 @@ $lang->action->comment = 'Comment'; $lang->action->undeleteAction = 'Reset Data'; $lang->action->hideOneAction = 'Hide Data'; -$lang->action->trashTips = 'Note: Delete in ZenTao is logic.'; -$lang->action->textDiff = 'Text Format'; -$lang->action->original = 'Original Format'; -$lang->action->confirmHideAll = 'Do you want to hide all the records?'; -$lang->action->needEdit = '%s that you want to restore. Please edit it.'; -$lang->action->historyEdit = 'The history EditBy cannot be empty.'; -$lang->action->noDynamic = 'No dynamics. '; -$lang->action->undeletedTips = 'This data did not participate in the merging process during the version upgrade process, so restore is not supported.'; +$lang->action->trashTips = 'Note: Delete in ZenTao is logic.'; +$lang->action->textDiff = 'Text Format'; +$lang->action->original = 'Original Format'; +$lang->action->confirmHideAll = 'Do you want to hide all the records?'; +$lang->action->needEdit = '%s that you want to restore. Please edit it.'; +$lang->action->historyEdit = 'The history EditBy cannot be empty.'; +$lang->action->noDynamic = 'No dynamics. '; +$lang->action->undeletedTips = 'This data did not participate in the merging process during the version upgrade process, so restore is not supported.'; +$lang->action->executionNoProject = 'The execution does not belong to a project,please restore the project first'; $lang->action->history = new stdclass(); $lang->action->history->action = 'Link'; diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index 0574c838fd..5867b2d16a 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -46,14 +46,15 @@ $lang->action->comment = '备注'; $lang->action->undeleteAction = '还原数据'; $lang->action->hideOneAction = '隐藏数据'; -$lang->action->trashTips = '提示:为了保证系统的完整性,禅道系统的删除都是标记删除。'; -$lang->action->textDiff = '文本格式'; -$lang->action->original = '原始格式'; -$lang->action->confirmHideAll = '您确定要全部隐藏这些记录吗?'; -$lang->action->needEdit = '要还原%s的名称或代号已经存在,请编辑更改。'; -$lang->action->historyEdit = '历史记录编辑不能为空。'; -$lang->action->noDynamic = '暂时没有动态。'; -$lang->action->undeletedTips = '该数据在版本升级过程中未参与数据归并流程,不支持还原。'; +$lang->action->trashTips = '提示:为了保证系统的完整性,禅道系统的删除都是标记删除。'; +$lang->action->textDiff = '文本格式'; +$lang->action->original = '原始格式'; +$lang->action->confirmHideAll = '您确定要全部隐藏这些记录吗?'; +$lang->action->needEdit = '要还原%s的名称或代号已经存在,请编辑更改。'; +$lang->action->historyEdit = '历史记录编辑不能为空。'; +$lang->action->noDynamic = '暂时没有动态。'; +$lang->action->undeletedTips = '该数据在版本升级过程中未参与数据归并流程,不支持还原。'; +$lang->action->executionNoProject = '该执行没有所属的项目,请先还原项目再还原执行'; $lang->action->history = new stdclass(); $lang->action->history->action = '关联日志'; diff --git a/module/action/model.php b/module/action/model.php index 8edf3b4ba0..436fec69bc 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1511,6 +1511,9 @@ class actionModel extends model { $execution = $this->dao->select('*')->from(TABLE_EXECUTION)->where('id')->eq($action->objectID)->fetch(); if($execution->deleted and empty($execution->project)) return print(js::error($this->lang->action->undeletedTips)); + + $projectCount = $this->dao->select('count(*) as count')->from(TABLE_PROJECT)->where('id')->eq($execution->project)->andWhere('deleted')->eq('0')->fetch('count'); + if((int)$projectCount == 0) return print(js::error($this->lang->action->executionNoProject)); } if($action->objectType == 'product')