mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
N°2847 - Work on the ActivityPanel and PopoverMenu features
- Deprecate cmdbAbstractObject::DisplayBareHistory() as history will be replace by ActivityPanel - Rename illustrations to original filenames to find source more easily - Remove unused "max_history_case_log_entry_length" config. parameter - Activity panel: Introduce iCMDBChangeOp and iCMDBChangeOpSetAttribute interface for better dependency injection - Activity panel: Add placeholder when no entry - Activity panel: Fix tab toolbar icons color - Activity panel: Add history entries (entries after the first 50 are not loaded yet) - Popover menu: Fix no border-radius on first/last entries hover
This commit is contained in:
@@ -41,8 +41,13 @@ class ActivityEntry extends UIBlock
|
||||
const HTML_TEMPLATE_REL_PATH = 'layouts/activity-panel/activity-entry/layout';
|
||||
|
||||
// Specific constants
|
||||
/** @var string DEFAULT_ORIGIN */
|
||||
const DEFAULT_ORIGIN = 'unknown';
|
||||
/** @var string DEFAULT_DECORATION_CLASSES */
|
||||
const DEFAULT_DECORATION_CLASSES = 'fas fa-fw fa-mortar-pestle';
|
||||
|
||||
/** @var string $sDecorationClasses CSS classes to use to decorate the entry */
|
||||
protected $sDecorationClasses;
|
||||
/** @var string $sContent Raw content of the entry itself (should not have been processed / escaped) */
|
||||
protected $sContent;
|
||||
/** @var \DateTime $oDateTime Date / time the entry occurred */
|
||||
@@ -63,23 +68,48 @@ class ActivityEntry extends UIBlock
|
||||
/**
|
||||
* ActivityEntry constructor.
|
||||
*
|
||||
* @param string $sContent
|
||||
* @param \DateTime $oDateTime
|
||||
* @param \User $sAuthorLogin
|
||||
* @param string $sId
|
||||
* @param string $sContent
|
||||
* @param string $sIdCode
|
||||
*
|
||||
* @throws \OQLException
|
||||
*/
|
||||
public function __construct($sContent, DateTime $oDateTime, $sAuthorLogin, $sId = null)
|
||||
public function __construct(DateTime $oDateTime, $sAuthorLogin, $sContent = null, $sIdCode = null)
|
||||
{
|
||||
parent::__construct($sId);
|
||||
parent::__construct($sIdCode);
|
||||
|
||||
$this->SetDecorationClasses(static::DEFAULT_DECORATION_CLASSES);
|
||||
$this->SetContent($sContent);
|
||||
$this->SetDateTime($oDateTime);
|
||||
$this->SetAuthor($sAuthorLogin);
|
||||
$this->SetOrigin(static::DEFAULT_ORIGIN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the CSS decoration classes
|
||||
*
|
||||
* @param string $sDecorationClasses Must be a space-separated list of CSS classes
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function SetDecorationClasses($sDecorationClasses)
|
||||
{
|
||||
$this->sDecorationClasses = $sDecorationClasses;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a string of the space separated CSS decoration classes
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function GetDecorationClasses()
|
||||
{
|
||||
return $this->sDecorationClasses;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the content without any filtering / escaping
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user