From 5cc62568c31443d2f70d3ade85139bb5980cf85b Mon Sep 17 00:00:00 2001 From: daitingting Date: Wed, 7 Jan 2026 16:22:32 +0800 Subject: [PATCH] * [bug#68583,done,2h] Undelete related object. --- module/action/model.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/module/action/model.php b/module/action/model.php index 1e332db629..fbc46d55b9 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1799,6 +1799,26 @@ class actionModel extends model } } + if($action->objectType == 'projectchange') + { + $reviewID = $this->dao->select('id')->from(TABLE_REVIEW)->where('type')->eq('projectchange')->andWhere('object')->eq($action->objectID)->andWhere('deleted')->eq('1')->fetch('id'); + if($reviewID) + { + $reviewActionID = $this->dao->select('id')->from(TABLE_ACTION)->where('action')->eq('deleted')->andWhere('objectType')->eq('review')->andWhere('objectID')->eq($reviewID)->andWhere('extra')->eq(self::CAN_UNDELETED)->fetch('id'); + if($reviewActionID) $this->undelete($reviewActionID); + } + } + + if($action->objectType == 'review') + { + $review = $this->dao->select('*')->from(TABLE_REVIEW)->where('id')->eq($action->objectID)->fetch(); + if($review->type == 'projectchange') + { + $projectchangeActionID = $this->dao->select('id')->from(TABLE_ACTION)->where('action')->eq('deleted')->andWhere('objectType')->eq('projectchange')->andWhere('objectID')->eq($review->object)->andWhere('extra')->eq(self::CAN_UNDELETED)->fetch('id'); + if($projectchangeActionID) $this->undelete($projectchangeActionID); + } + } + if($action->objectType == 'deliverable') { $this->dao->update(TABLE_DELIVERABLE)->set('status')->eq('disabled')->where('id')->eq($action->objectID)->exec();