From 9687e9985e1bad3353ee7cf6f617f786931cd449 Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Fri, 20 Nov 2015 14:16:07 +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:trunk[3822] --- 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 fcac2f0e7..09bc1b861 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 2ad60e55e..7af1d3b69 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 94050901e..138d8b31a 100644 --- a/js/utils.js +++ b/js/utils.js @@ -228,7 +228,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; }