N°6176 - Allow to deny creation on linkset tagset widget

This commit is contained in:
Stephen Abello
2023-04-12 15:30:42 +02:00
parent 1960f370e9
commit 564c9388da
2 changed files with 20 additions and 5 deletions

View File

@@ -62,8 +62,7 @@ class LinkSetUIBlockFactory extends SetUIBlockFactory
$oSetUIBlock->AddJsFileRelPath('js/links/linkset.js');
// Add button behaviour
if (in_array($oAttDef->GetEditMode(), [LINKSET_EDITMODE_ADDREMOVE, LINKSET_EDITMODE_ADDONLY, LINKSET_EDITMODE_INPLACE, LINKSET_EDITMODE_ACTIONS])
&& $oHostDbObject !== null) {
if (LinkSetModel::IsRemoteCreationAllowed($oAttDef) && $oHostDbObject !== null) {
$oSetUIBlock->SetHasAddOptionButton(true);
$oSetUIBlock->SetAddOptionButtonJsOnClick("iTopLinkSet.CreateLinkedObject('{$sTargetClass}', oWidget{$oSetUIBlock->GetId()} );");
}