mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 17:48:43 +02:00
N°5905 - Fix linkset panel description still in an alert when editing host object
This commit is contained in:
@@ -114,12 +114,7 @@ class BlockDirectLinksEditTable extends UIContentBlock
|
||||
*/
|
||||
private function InitUI()
|
||||
{
|
||||
// Linkset description as an informative alert
|
||||
$sDescription = $this->oAttributeLinkedSet->GetDescription();
|
||||
if (utils::IsNotNullOrEmptyString($sDescription)) {
|
||||
$oAlert = AlertUIBlockFactory::MakeForInformation('', $sDescription);
|
||||
$this->AddSubBlock($oAlert);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -148,6 +143,15 @@ class BlockDirectLinksEditTable extends UIContentBlock
|
||||
->SetIcon(MetaModel::GetClassIcon($this->oUILinksDirectWidget->GetLinkedClass(), false))
|
||||
->AddCSSClass('ibo-datatable-panel');
|
||||
|
||||
// - Panel description
|
||||
$sDescription = $this->oAttributeLinkedSet->GetDescription();
|
||||
if (utils::IsNotNullOrEmptyString($sDescription)) {
|
||||
$oTitleBlock = $aTablePanel->GetTitleBlock()
|
||||
->AddDataAttribute('tooltip-content', $sDescription)
|
||||
->AddDataAttribute('tooltip-max-width', 'min(600px, 90vw)') // Allow big description to be wide enough while shrinking on small screens
|
||||
->AddCSSClass('ibo-has-description');
|
||||
}
|
||||
|
||||
// Toolbar and actions
|
||||
$oToolbar = ToolbarUIBlockFactory::MakeForButton();
|
||||
$oActionButtonUnlink = ButtonUIBlockFactory::MakeNeutral('Unlink');
|
||||
|
||||
@@ -107,13 +107,6 @@ class BlockIndirectLinksEditTable extends UIContentBlock
|
||||
// To prevent adding forms inside the main form
|
||||
$oDeferredBlock = new UIContentBlock("dlg_{$this->oUILinksWidget->GetLinkedSetId()}", ['ibo-block-indirect-links--edit--dialog']);
|
||||
$this->AddDeferredBlock($oDeferredBlock);
|
||||
|
||||
// Linkset description as an informative alert
|
||||
$sDescription = $this->oAttributeLinkedSetIndirect->GetDescription();
|
||||
if (utils::IsNotNullOrEmptyString($sDescription)) {
|
||||
$oAlert = AlertUIBlockFactory::MakeForInformation('', $sDescription);
|
||||
$this->AddSubBlock($oAlert);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -204,6 +197,15 @@ class BlockIndirectLinksEditTable extends UIContentBlock
|
||||
->SetIcon(MetaModel::GetClassIcon($this->oUILinksWidget->GetRemoteClass(), false))
|
||||
->AddCSSClass('ibo-datatable-panel');
|
||||
|
||||
// - Panel description
|
||||
$sDescription = $this->oAttributeLinkedSetIndirect->GetDescription();
|
||||
if (utils::IsNotNullOrEmptyString($sDescription)) {
|
||||
$oTitleBlock = $aTablePanel->GetTitleBlock()
|
||||
->AddDataAttribute('tooltip-content', $sDescription)
|
||||
->AddDataAttribute('tooltip-max-width', 'min(600px, 90vw)') // Allow big description to be wide enough while shrinking on small screens
|
||||
->AddCSSClass('ibo-has-description');
|
||||
}
|
||||
|
||||
// Toolbar and actions
|
||||
$oToolbar = ToolbarUIBlockFactory::MakeForButton();
|
||||
$oActionButtonUnlink = ButtonUIBlockFactory::MakeNeutral('Unlink');
|
||||
|
||||
Reference in New Issue
Block a user