From 3925ae0742f2d5b0b22f513986e280026e76a925 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Feb 2016 23:53:42 +0100 Subject: [PATCH] Fix: we loose ability to refresh contact list when changing a company on contact tab --- htdocs/core/class/html.formcompany.class.php | 16 +++++++--- htdocs/core/lib/ajax.lib.php | 32 ++++++++++++++------ 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index e91184ede12..40276b6205d 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -564,16 +564,21 @@ class FormCompany } } - // Refresh contacts list on thirdparty list change - $htmloption=''; $events=array(); + // Add an entry 'method' to say 'yes, we must execute url with param action = method'; + // Add an entry 'url' to say which url to execute + // Add an entry htmlname to say which element we must change once url is called + // Add entry params => array('cssid' => 'attr') to say to remov or add attribute attr if answer of url return 0 or >0 lines + // To refresh contacts list on thirdparty list change $events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); + if (count($events)) // If there is some ajax events to run once selection is done, we add code here to run events { print '