From 1cfc0c427ca949406284c2f3c7b4f16c707770cc Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 15 Feb 2022 21:13:24 +0100 Subject: [PATCH] ActivityLogInfo: show remarks refs #2471 --- .../Director/Web/Widget/ActivityLogInfo.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/library/Director/Web/Widget/ActivityLogInfo.php b/library/Director/Web/Widget/ActivityLogInfo.php index bb2aea3a..4a863487 100644 --- a/library/Director/Web/Widget/ActivityLogInfo.php +++ b/library/Director/Web/Widget/ActivityLogInfo.php @@ -522,6 +522,13 @@ class ActivityLogInfo extends HtmlDocument ); } + if ($comment = $this->getOptionalRangeComment()) { + $table->addNameValueRow( + $this->translate('Remark'), + $comment + ); + } + if ($this->hasBeenEnabled()) { $table->addNameValueRow( $this->translate('Rendering'), @@ -584,6 +591,21 @@ class ActivityLogInfo extends HtmlDocument return sprintf($msg, $this->typeName, $this->entry->object_name); } + protected function getOptionalRangeComment() + { + if ($this->id) { + $db = $this->db->getDbAdapter(); + return $db->fetchOne( + $db->select() + ->from('director_activity_log_remark', 'remark') + ->where('first_related_activity <= ?', $this->id) + ->where('last_related_activity >= ?', $this->id) + ); + } + + return null; + } + /** * @param $type * @param $props