diff --git a/sources/application/UI/Layout/ActivityPanel/ActivityPanel.php b/sources/application/UI/Layout/ActivityPanel/ActivityPanel.php index e0df11408..e293f70c7 100644 --- a/sources/application/UI/Layout/ActivityPanel/ActivityPanel.php +++ b/sources/application/UI/Layout/ActivityPanel/ActivityPanel.php @@ -54,6 +54,8 @@ class ActivityPanel extends UIBlock protected $aEntries; /** @var bool $bAreEntriedSorted True if the entries have been sorted by date */ protected $bAreEntriedSorted; + /** @var bool $bHasLifecycle True if the host object has a lifecycle */ + protected $bHasLifecycle; /** * ActivityPanel constructor. @@ -97,6 +99,9 @@ class ActivityPanel extends UIBlock $this->AddCaseLogTab($sCaseLogAttCode); } + // Check if object has a lifecycle + $this->bHasLifecycle = !empty(MetaModel::GetStateAttributeCode($sObjectClass)); + return $this; } @@ -387,6 +392,16 @@ class ActivityPanel extends UIBlock return !empty($this->aCaseLogs); } + /** + * Return true if the host object has a lifecycle + * + * @return bool + */ + public function HasLifecycle() + { + return $this->bHasLifecycle; + } + /** * Return the formatted (user-friendly) date time format for the JS widget. * Will be used by moment.js for instance. diff --git a/templates/layouts/activity-panel/layout.html.twig b/templates/layouts/activity-panel/layout.html.twig index 03d599026..a36755ecf 100644 --- a/templates/layouts/activity-panel/layout.html.twig +++ b/templates/layouts/activity-panel/layout.html.twig @@ -35,16 +35,20 @@