N°6555 - Add class description in tooltip of Dashlet badge (#504)

This commit is contained in:
Anne-Catherine
2023-08-31 14:37:37 +02:00
committed by GitHub
parent 42acbe66c3
commit 73a2c935a7
11 changed files with 140 additions and 53 deletions

View File

@@ -9,6 +9,7 @@ namespace Combodo\iTop\Application\UI\Base\Component\Dashlet;
use Combodo\iTop\Application\UI\Base\tJSRefreshCallback;
use utils;
class DashletBadge extends DashletContainer
{
@@ -29,6 +30,11 @@ class DashletBadge extends DashletContainer
protected $iCount;
/** @var string */
protected $sClassLabel;
/**
* @var string
* @since 3.1.1 3.2.0
*/
protected $sClassDescription;
/** @var string */
protected $sCreateActionUrl;
@@ -62,6 +68,7 @@ class DashletBadge extends DashletContainer
$this->sCreateActionUrl = $sCreateActionUrl;
$this->sCreateActionLabel = $sCreateActionLabel;
$this->aRefreshParams = $aRefreshParams;
$this->sClassDescription = '';
}
@@ -185,6 +192,37 @@ class DashletBadge extends DashletContainer
return $this;
}
/**
* @return string
* @since 3.1.1 3.2.0
*/
public function GetClassDescription(): string
{
return $this->sClassDescription;
}
/**
* @param string $sClassDescription
*
* @return DashletBadge
* @since 3.1.1 3.2.0
*/
public function SetClassDescription(string $sClassDescription)
{
$this->sClassDescription = $sClassDescription;
return $this;
}
/**
* @return bool
* @since 3.1.1
*/
public function HasClassDescription(): bool
{
return utils::IsNotNullOrEmptyString($this->sClassDescription);
}
public function GetJSRefresh(): string
{
return "$('#".$this->sId."').block();