mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 11:08:45 +02:00
N°5976 - Add modal creation for linksets displayed with tagset-like widget (#469)
This commit is contained in:
@@ -37,7 +37,8 @@ class Set extends AbstractInput
|
||||
public const DEFAULT_JS_ON_READY_TEMPLATE_REL_PATH = 'base/components/input/set/layout';
|
||||
|
||||
public const DEFAULT_JS_FILES_REL_PATH = [
|
||||
'js/links/links_set_worker.js',
|
||||
'js/links/links-set-worker.js',
|
||||
'js/object/object-worker.js',
|
||||
'js/selectize/plugin_combodo_add_button.js',
|
||||
'js/selectize/plugin_combodo_auto_position.js',
|
||||
'js/selectize/plugin_combodo_update_operations.js',
|
||||
|
||||
@@ -36,8 +36,8 @@ abstract class AbstractBlockLinksViewTable extends UIContentBlock
|
||||
public const DEFAULT_JS_ON_READY_TEMPLATE_REL_PATH = 'application/links/layout';
|
||||
public const DEFAULT_JS_FILES_REL_PATH = [
|
||||
'js/links/links_view_table_widget.js',
|
||||
'js/links/links_set_worker.js',
|
||||
'js/objects/objects_worker.js',
|
||||
'js/links/links-set-worker.js',
|
||||
'js/object/object-worker.js',
|
||||
'js/wizardhelper.js',
|
||||
];
|
||||
|
||||
|
||||
@@ -59,18 +59,14 @@ class LinksSetUIBlockFactory extends SetUIBlockFactory
|
||||
// Set UI block for OQL
|
||||
$oSetUIBlock = SetUIBlockFactory::MakeForOQL($sId, $sTargetClass, $oAttDef->GetValuesDef()->GetFilterExpression(), $sWizardHelperJsVarName);
|
||||
|
||||
$oSetUIBlock->AddJsFileRelPath('js/links/links_set.js');
|
||||
$oSetUIBlock->AddJsFileRelPath('js/links/links-set.js');
|
||||
|
||||
// Remove add button for 3_1_lot1
|
||||
// Linkset controller OperationCreateLinkedObject need the host object to exist, so if we are in creation of the host object (id=-1) the linked object creation doesn't work.
|
||||
//
|
||||
// // Add button behaviour
|
||||
// if (in_array($oAttDef->GetEditMode(), [LINKSET_EDITMODE_ADDREMOVE, LINKSET_EDITMODE_ADDONLY, LINKSET_EDITMODE_INPLACE, LINKSET_EDITMODE_ACTIONS])
|
||||
// && $oHostDbObject !== null) {
|
||||
// $sHostClass = get_class($oHostDbObject);
|
||||
// $oSetUIBlock->SetHasAddOptionButton(true);
|
||||
// $oSetUIBlock->SetAddOptionButtonJsOnClick("CombodoLinkSet.CreateLinkedObject('{$oAttDef->GetLinkedClass()}', '{$oAttDef->GetCode()}', '{$sHostClass}', '{$oHostDbObject->GetKey()}', '{$sTargetField}', '{$sTargetClass}', oWidget{$oSetUIBlock->GetId()} );");
|
||||
// }
|
||||
// Add button behaviour
|
||||
if (in_array($oAttDef->GetEditMode(), [LINKSET_EDITMODE_ADDREMOVE, LINKSET_EDITMODE_ADDONLY, LINKSET_EDITMODE_INPLACE, LINKSET_EDITMODE_ACTIONS])
|
||||
&& $oHostDbObject !== null) {
|
||||
$oSetUIBlock->SetHasAddOptionButton(true);
|
||||
$oSetUIBlock->SetAddOptionButtonJsOnClick("iTopLinkSet.CreateLinkedObject('{$sTargetClass}', oWidget{$oSetUIBlock->GetId()} );");
|
||||
}
|
||||
|
||||
// Current value
|
||||
$aCurrentValues = LinkSetDataTransformer::Decode($oDbObjectSet, $sTargetClass, $sTargetField);
|
||||
|
||||
Reference in New Issue
Block a user