From b2050a8895194e8e3aa1bfed281e76005d289333 Mon Sep 17 00:00:00 2001 From: acognet Date: Mon, 1 Mar 2021 15:34:09 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B03648=20-=20Feedback=20alpha=203.0=20:=20?= =?UTF-8?q?finish=20relation=20edition=20-=20tabulation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/ui.extkeywidget.class.inc.php | 45 ++++++----------------- js/extkeywidget.js | 19 ++-------- 2 files changed, 14 insertions(+), 50 deletions(-) diff --git a/application/ui.extkeywidget.class.inc.php b/application/ui.extkeywidget.class.inc.php index 3de066de2..3f0c1476d 100644 --- a/application/ui.extkeywidget.class.inc.php +++ b/application/ui.extkeywidget.class.inc.php @@ -1,20 +1,7 @@ bSearchMode) ? '' : 'attr_'; - $sHTMLValue = "
sAttCode."\" data-validation=\"untouched\" tabindex=0>"; + $sHTMLValue = "
sAttCode."\" data-validation=\"untouched\">"; $sFilter = addslashes($oAllowedValues->GetFilter()->ToOQL()); - if($this->bSearchMode) - { + if ($this->bSearchMode) { $sWizHelper = 'null'; $sWizHelperJSON = "''"; $sJSSearchMode = 'true'; - } - else - { - if (isset($aArgs['wizHelper'])) - { + } else { + if (isset($aArgs['wizHelper'])) { $sWizHelper = $aArgs['wizHelper']; - } - else - { + } else { $sWizHelper = 'oWizardHelper'.$sFormPrefix; } $sWizHelperJSON = $sWizHelper.'.UpdateWizardToJSON()'; $sJSSearchMode = 'false'; } - if (is_null($oAllowedValues)) - { + if (is_null($oAllowedValues)) { throw new Exception('Implementation: null value for allowed values definition'); } $oAllowedValues->SetShowObsoleteData(utils::ShowObsoleteData()); @@ -204,8 +184,7 @@ class UIExtKeyWidget $sJSDoSearch = $bDoSearch ? 'true' : 'false'; // We just need to compare the number of entries with MaxComboLength, so no need to get the real count. - if (!$oAllowedValues->CountExceeds($iMaxComboLength)) - { + if (!$oAllowedValues->CountExceeds($iMaxComboLength)) { // Discrete list of values, use a SELECT or RADIO buttons depending on the config $sHelpText = ''; //$this->oAttDef->GetHelpOnEdition(); //$sHTMLValue .= "
\n"; @@ -264,7 +243,7 @@ class UIExtKeyWidget array_push($aOptions, $aOption); } $sInputType = CmdbAbstractObject::ENUM_INPUT_TYPE_DROPDOWN_DECORATED; - $sHTMLValue .= ""; + $sHTMLValue .= ""; $sJsonOptions = json_encode($aOptions); $oPage->add_ready_script( <<oAttDef->GetMinAutoCompleteChars(); // the input for the auto-complete - $sInputType = CmdbAbstractObject::ENUM_INPUT_TYPE_AUTOCOMPLETE; $sHTMLValue .= "iId\" value=\"$sDisplayValue\"/>"; // another hidden input to store & pass the object's Id @@ -454,7 +432,6 @@ JS } /** - * @deprecated Use DisplayBob * Get the HTML fragment corresponding to the ext key editing widget * * @param \WebPage $oPage diff --git a/js/extkeywidget.js b/js/extkeywidget.js index afc7814dd..7e7fd709b 100644 --- a/js/extkeywidget.js +++ b/js/extkeywidget.js @@ -1,19 +1,6 @@ /* - * Copyright (C) 2010-2020 Combodo SARL - * - * This file is part of iTop. - * - * iTop is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * iTop is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License + * @copyright Copyright (C) 2010-2021 Combodo SARL + * @license http://opensource.org/licenses/AGPL-3.0 */ /* * Plugin to change the behaviour of enter and backspace buttons @@ -53,7 +40,7 @@ Selectize.define('custom_itop', function(aOptions) { } } } - return original.apply(this); + return original.apply(); }; })(); });