N°2847 - Activity panel: Add highlight color on case log entries

This commit is contained in:
Molkobain
2020-08-14 10:41:51 +02:00
parent 0c5c2eccad
commit b9d7967c0e
9 changed files with 190 additions and 28 deletions

View File

@@ -40,8 +40,13 @@ class CaseLogEntry extends ActivityEntry
const BLOCK_CODE = 'ibo-caselog-entry';
const HTML_TEMPLATE_REL_PATH = 'layouts/activity-panel/activity-entry/caselog-entry';
// Specific constants
public const DEFAULT_CASELOG_RANK = 0;
/** @var string $sAttCode Code of the corresponding case log attribute */
protected $sAttCode;
/** @var int $iCaseLogRank Rank of its case log in the host panel, can be used for highlight purposes for example */
protected $iCaseLogRank;
/**
* CaseLogEntry constructor.
@@ -59,6 +64,7 @@ class CaseLogEntry extends ActivityEntry
parent::__construct($sContent, $oDateTime, $sAuthorLogin, $sId);
$this->sAttCode = $sAttCode;
$this->SetCaseLogRank(static::DEFAULT_CASELOG_RANK);
$this->SetOrigin('caselog:'.$this->sAttCode);
}
@@ -71,4 +77,27 @@ class CaseLogEntry extends ActivityEntry
{
return $this->sAttCode;
}
/**
* Set the rank of the case log in the host panel
*
* @param int $iCaseLogRank
*
* @return $this
*/
public function SetCaseLogRank($iCaseLogRank)
{
$this->iCaseLogRank = $iCaseLogRank;
return $this;
}
/**
* Return the rank of the case log in the host panel
*
* @return int
*/
public function GetCaseLogRank()
{
return $this->iCaseLogRank;
}
}