From d2fc87c6f9b5328711a28ea290e64c9cd9739bad Mon Sep 17 00:00:00 2001 From: vdumas Date: Mon, 30 Oct 2023 12:22:07 +0100 Subject: [PATCH 1/4] =?UTF-8?q?N=C2=B06884=20-=20Error=20on=20creating=20U?= =?UTF-8?q?ser=20from=20a=20Person=20edit=20screen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- datamodels/2.x/itop-structure/datamodel.itop-structure.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/datamodels/2.x/itop-structure/datamodel.itop-structure.xml b/datamodels/2.x/itop-structure/datamodel.itop-structure.xml index 6eafece7a..dcb91e5d9 100644 --- a/datamodels/2.x/itop-structure/datamodel.itop-structure.xml +++ b/datamodels/2.x/itop-structure/datamodel.itop-structure.xml @@ -713,6 +713,7 @@ User contactid add_only + on_host_display 0 0 From 74004fa3750773191bba8d6e40779f010e8f34e3 Mon Sep 17 00:00:00 2001 From: bdalsass <95754414+bdalsass@users.noreply.github.com> Date: Mon, 30 Oct 2023 08:34:53 +0100 Subject: [PATCH 2/4] =?UTF-8?q?N=C2=B06651=20-=203.1=20bulk=20modify=20n:n?= =?UTF-8?q?=20like=20Tagset:=20checkbox=20ignored=20(#552)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - handle selectize enable/disable to update operation hidden input state - don't execute elements click callback when input disabled - merge current and initial values for the initial value --- .../plugin_combodo_multi_values_synthesis.js | 5 +++++ .../plugin_combodo_update_operations.js | 18 ++++++++++++++++++ .../UI/Links/Set/LinksSetUIBlockFactory.php | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/js/selectize/plugin_combodo_multi_values_synthesis.js b/js/selectize/plugin_combodo_multi_values_synthesis.js index 4c33cf395..aaeebbbb4 100644 --- a/js/selectize/plugin_combodo_multi_values_synthesis.js +++ b/js/selectize/plugin_combodo_multi_values_synthesis.js @@ -154,6 +154,11 @@ Selectize.define("combodo_multi_values_synthesis", function (aOptions) { // Listen item element click event $item.on('click', function(){ + // input disabled + if(oSelf.$input.is(':disabled')){ + return; + } + // If element has operation if(aOperations[sItem] === OPERATIONS.add || aOperations[sItem] === OPERATIONS.remove) { diff --git a/js/selectize/plugin_combodo_update_operations.js b/js/selectize/plugin_combodo_update_operations.js index f8bd73811..e670a0207 100644 --- a/js/selectize/plugin_combodo_update_operations.js +++ b/js/selectize/plugin_combodo_update_operations.js @@ -43,6 +43,24 @@ Selectize.define("combodo_update_operations", function (aOptions) { }; })(); + // Override enable function + oSelf.enable = (function () { + let oOriginal = oSelf.enable; + return function () { + oOriginal.apply(oSelf, arguments); + oSelf.$operationsInput.prop('disabled', false); + } + })(); + + // Override disable function + oSelf.disable = (function () { + let oOriginal = oSelf.disable; + return function () { + oOriginal.apply(oSelf, arguments); + oSelf.$operationsInput.prop('disabled', true); + } + })(); + // Override addItem function oSelf.addItem = (function () { let oOriginal = oSelf.addItem; diff --git a/sources/Application/UI/Links/Set/LinksSetUIBlockFactory.php b/sources/Application/UI/Links/Set/LinksSetUIBlockFactory.php index 96137563b..4f7a5fa07 100644 --- a/sources/Application/UI/Links/Set/LinksSetUIBlockFactory.php +++ b/sources/Application/UI/Links/Set/LinksSetUIBlockFactory.php @@ -81,7 +81,7 @@ class LinkSetUIBlockFactory extends SetUIBlockFactory $oSetUIBlock->GetDataProvider()->SetOptions(array_values($aInitialOptions)); // Set value $oSetUIBlock->SetValue(json_encode($aCurrentValues)); - $oSetUIBlock->SetInitialValue(json_encode($aInitialValues)); + $oSetUIBlock->SetInitialValue(json_encode(array_merge($aInitialValues, $aCurrentValues))); } else { $oSetUIBlock->SetHasError(true); } From 95aa4afe755cb0e79e852e456b2b53e212fadd22 Mon Sep 17 00:00:00 2001 From: Stephen Abello Date: Mon, 30 Oct 2023 16:28:57 +0100 Subject: [PATCH 3/4] =?UTF-8?q?=20N=C2=B06385=20-=20Allow=20to=20disable?= =?UTF-8?q?=20LinkedSet=20(1:n=20&=20n:n)=20edition=20by=20XML=20in=20host?= =?UTF-8?q?=20edition?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/cmdbabstract.class.inc.php | 6 +++++- .../UI/Links/Indirect/BlockIndirectLinkSetEditTable.php | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index 9d0e595d9..d871105da 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -744,7 +744,11 @@ HTML $oPage->SetCurrentTab($sTabCode, $oAttDef->GetLabel().$sCount, $sTabDescription); $aArgs = array('this' => $this); - $bReadOnly = ($iFlags & (OPT_ATT_READONLY | OPT_ATT_SLAVE)); + + $sEditWhen = $oAttDef->GetEditWhen(); + $bIsEditableBasedOnEditWhen = ($sEditWhen === LINKSET_EDITWHEN_ALWAYS || $sEditWhen === LINKSET_EDITWHEN_ON_HOST_EDITION); + + $bReadOnly = ($iFlags & (OPT_ATT_READONLY | OPT_ATT_SLAVE)) || !$bIsEditableBasedOnEditWhen; if ($bEditMode && (!$bReadOnly)) { $sInputId = $this->m_iFormId.'_'.$sAttCode; $sDisplayValue = ''; // not used diff --git a/sources/Application/UI/Links/Indirect/BlockIndirectLinkSetEditTable.php b/sources/Application/UI/Links/Indirect/BlockIndirectLinkSetEditTable.php index 36e6bc359..b15995c20 100644 --- a/sources/Application/UI/Links/Indirect/BlockIndirectLinkSetEditTable.php +++ b/sources/Application/UI/Links/Indirect/BlockIndirectLinkSetEditTable.php @@ -281,7 +281,7 @@ EOF if ($bReadOnly) { $aRow['form::checkbox'] = ""; - foreach ($this->m_aEditableFields as $sFieldCode) { + foreach ($this->oUILinksWidget->GetEditableFields() as $sFieldCode) { $sDisplayValue = $linkObjOrId->GetEditValue($sFieldCode); $aRow[$sFieldCode] = $sDisplayValue; } @@ -435,7 +435,7 @@ JS $oAttDef = MetaModel::GetAttributeDef($this->oUILinksWidget->GetLinkedClass(), $sFieldCode); if ($bReadOnlyField) { - $sFieldForHtml = $sDisplayValue; + $sFieldForHtml = $oAttDef->GetAsHTML($sValue); } else { $sFieldForHtml = cmdbAbstractObject::GetFormElementForField( $oP, From a49a4e6c2bd2a532cbd1ca1dc62f2b075cc78232 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Mon, 30 Oct 2023 16:53:54 +0100 Subject: [PATCH 4/4] =?UTF-8?q?N=C2=B06886=20-=20Add=20OAuth=20tests=20fol?= =?UTF-8?q?der=20to=20removable=20directories=20list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/Composer/iTopComposer.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/Composer/iTopComposer.php b/sources/Composer/iTopComposer.php index d9994e2ab..c4eca6e69 100644 --- a/sources/Composer/iTopComposer.php +++ b/sources/Composer/iTopComposer.php @@ -135,6 +135,8 @@ class iTopComposer $APPROOT_WITH_SLASHES.'lib/symfony/web-profiler-bundle/Tests', $APPROOT_WITH_SLASHES.'lib/symfony/yaml/Tests', + $APPROOT_WITH_SLASHES.'lib/thenetworg/oauth2-azure/tests', + $APPROOT_WITH_SLASHES.'lib/twig/twig/src/Test', $APPROOT_WITH_SLASHES.'lib/twig/twig/lib/Twig/Test', $APPROOT_WITH_SLASHES.'lib/twig/twig/doc/tests',