N°2847 - Activity panel: Display only necessary toolbar actions in the "Activity" tab

This commit is contained in:
Molkobain
2020-08-17 08:38:44 +02:00
parent e3f1deda00
commit 46909c210c
2 changed files with 29 additions and 10 deletions

View File

@@ -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.