From 7c3a3820b792614bac58c2dcd10fac0792ebb091 Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Fri, 20 Nov 2015 14:26:05 +0000 Subject: [PATCH] Support of derived classes in "add_remove" edition mode for AttributeLinkSet fields (the search form was not refreshing / loading properly when toggling the class to search for). SVN:2.1.1[3824] --- application/ui.linksdirectwidget.class.inc.php | 2 +- js/linksdirectwidget.js | 6 +++++- js/utils.js | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/application/ui.linksdirectwidget.class.inc.php b/application/ui.linksdirectwidget.class.inc.php index c3b1e88722..ce6a55db47 100644 --- a/application/ui.linksdirectwidget.class.inc.php +++ b/application/ui.linksdirectwidget.class.inc.php @@ -294,7 +294,7 @@ class UILinksWidgetDirect $valuesDef = $oLinksetDef->GetValuesDef(); if ($valuesDef === null) { - $oFilter = new DBObjectSearch($this->sLinkedClass); + $oFilter = new DBObjectSearch($sRemoteClass); } else { diff --git a/js/linksdirectwidget.js b/js/linksdirectwidget.js index 080473e432..912c37bfba 100644 --- a/js/linksdirectwidget.js +++ b/js/linksdirectwidget.js @@ -238,8 +238,12 @@ $(function() } ); oParams.operation = 'searchObjectsToAdd2'; - oParams['class'] = this.options.class_name; oParams.real_class = ''; + if ((oParams['class'] != undefined) && (oParams['class'] != '')) + { + oParams.real_class = oParams['class']; + } + oParams['class'] = this.options.class_name; oParams.att_code = this.options.att_code; oParams.iInputId = this.id; if (this.options.oWizardHelper) diff --git a/js/utils.js b/js/utils.js index 87369eacf8..094777606d 100644 --- a/js/utils.js +++ b/js/utils.js @@ -201,7 +201,7 @@ function ReloadSearchForm(divId, sClassName, sBaseClass, sContext) { // Restore the previously bound submit handlers var sEventName = 'submit'; - if (aSubmit[index].namespace != undefined) + if ((aSubmit[index].namespace != undefined) && (aSubmit[index].namespace != '')) { sEventName += '.'+aSubmit[index].namespace; }