mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°5904 - Use attribute linked set edit mode to enable actions in view
This commit is contained in:
@@ -72,4 +72,39 @@ class LinkSetModel
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert edit_mode to relation type.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
static public function ConvertEditModeToRelationType(AttributeLinkedSet $oAttDef): ?string
|
||||
{
|
||||
switch ($oAttDef->GetEditMode()) {
|
||||
case LINKSET_EDITMODE_INPLACE:
|
||||
return LINKSET_RELATIONTYPE_PROPERTY;
|
||||
case LINKSET_EDITMODE_ADDREMOVE:
|
||||
return LINKSET_RELATIONTYPE_LINK;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert edit_mode to read only.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
static public function ConvertEditModeToReadOnly(AttributeLinkedSet $oAttDef): bool
|
||||
{
|
||||
switch ($oAttDef->GetEditMode()) {
|
||||
case LINKSET_EDITMODE_NONE:
|
||||
case LINKSET_EDITMODE_ADDONLY:
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user