From daf901ff6154e171114560c04f84ede1fc8e953b Mon Sep 17 00:00:00 2001 From: Volodymyr Hadomskyi Date: Thu, 15 Aug 2024 21:56:39 +0200 Subject: [PATCH] Fix translation link ENG-17101 --- src/elements/Translation.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/elements/Translation.php b/src/elements/Translation.php index 89f2205e..6ede1a9a 100644 --- a/src/elements/Translation.php +++ b/src/elements/Translation.php @@ -19,6 +19,7 @@ use lilthq\craftliltplugin\elements\actions\JobEdit; use lilthq\craftliltplugin\elements\db\TranslationQuery; use lilthq\craftliltplugin\models\TranslationModelTrait; +use craft\elements\User; use lilthq\craftliltplugin\records\TranslationNotificationsRecord; use lilthq\craftliltplugin\records\TranslationRecord; @@ -128,6 +129,16 @@ public function getIsReviewed(): bool return $this->getIsPublished() || $this->status === TranslationRecord::STATUS_READY_TO_PUBLISH; } + public function getUrl(): ?string + { + return $this->getCpEditUrl(); + } + + public function canView(User $user): bool + { + return true; + } + public function getStatusHtml(): string { $label = self::statuses()[$this->status]['label'] ?? self::statuses()[$this->status];