N°6154 Fix some classes names hardcoded in dict entries and calls MetaModel GetName instead of hardcoded dict entry

This commit is contained in:
Stephen Abello
2023-05-10 10:03:02 +02:00
parent 4695511b46
commit 5219541b74
4 changed files with 11 additions and 10 deletions

View File

@@ -17,6 +17,7 @@ use Dict;
use DictExceptionMissingString;
use DisplayBlock;
use Exception;
use MetaModel;
use MySQLException;
use UserRights;
use Utils;
@@ -135,10 +136,10 @@ abstract class AbstractBlockLinkSetViewTable extends UIContentBlock
public function GetDictionaryEntry(string $sKey, DBObject $oDBObject = null)
{
return $this->oAttDef->SearchSpecificLabel($sKey, '', true,
Dict::S("Class:{$this->sObjectClass}"),
MetaModel::GetName($this->sObjectClass),
$this->oDbObject->Get('friendlyname'),
$this->oAttDef->GetLabel(),
Dict::S("Class:{$this->sTargetClass}"),
MetaModel::GetName($this->sTargetClass),
$oDBObject !== null ? $oDBObject->Get('friendlyname') : '{item}');
}

View File

@@ -307,16 +307,16 @@ class BlockDirectLinkSetEditTable extends UIContentBlock
$aRowActions = array();
$sDeleteButtonTooltip = $this->oAttributeLinkedSet->SearchSpecificLabel('UI:Links:Delete:Button+', '', true,
Dict::S("Class:{$this->oAttributeLinkedSet->GetHostClass()}"),
MetaModel::GetName($this->oAttributeLinkedSet->GetHostClass()),
$oHostObject->Get('friendlyname'),
$this->oAttributeLinkedSet->GetLabel(),
Dict::S("Class:{$this->oUILinksDirectWidget->GetLinkedClass()}"));
MetaModel::GetName($this->oUILinksDirectWidget->GetLinkedClass()));
$sRemoveButtonTooltip = $this->oAttributeLinkedSet->SearchSpecificLabel('UI:Links:Remove:Button+', '', true,
Dict::S("Class:{$this->oAttributeLinkedSet->GetHostClass()}"),
MetaModel::GetName($this->oAttributeLinkedSet->GetHostClass()),
$oHostObject->Get('friendlyname'),
$this->oAttributeLinkedSet->GetLabel(),
Dict::S("Class:{$this->oUILinksDirectWidget->GetLinkedClass()}"));
MetaModel::GetName($this->oUILinksDirectWidget->GetLinkedClass()));
// until a full link set refactoring (continue using edit_mode property)
switch ($this->oAttributeLinkedSet->GetEditMode()) {

View File

@@ -492,10 +492,10 @@ JS
$aRowActions = array();
$sRemoveButtonTooltip = $this->oAttributeLinkedSetIndirect->SearchSpecificLabel('UI:Links:Remove:Button+', '', true,
Dict::S("Class:{$this->oAttributeLinkedSetIndirect->GetHostClass()}"),
MetaModel::GetName($this->oAttributeLinkedSetIndirect->GetHostClass()),
$oHostObject->Get('friendlyname'),
$this->oAttributeLinkedSetIndirect->GetLabel(),
Dict::S("Class:{$this->oUILinksWidget->GetRemoteClass()}"));
MetaModel::GetName($this->oUILinksWidget->GetRemoteClass()));
if ($this->bIsAllowDelete) {
$aRowActions[] = array(

View File

@@ -208,10 +208,10 @@ JS;
$oLinksetDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
$oHostObj = MetaModel::GetObject($sClass, $sId);
$sFormTitle = $oLinksetDef->SearchSpecificLabel('UI:Links:Add:Modal:Title', '', true,
Dict::S("Class:{$sClass}"),
MetaModel::GetName($sClass),
$oHostObj->Get('friendlyname'),
$oLinksetDef->GetLabel(),
LinkSetModel::GetTargetClass($oLinksetDef));
MetaModel::GetName(LinkSetModel::GetTargetClass($oLinksetDef)));
$aExtraParams = [
'noRelations' => true,