From 5bbcfd2c4c3b20ade130e8cc2a224f781373ffb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Thu, 10 Aug 2023 09:37:20 +0200 Subject: [PATCH] new add filter on link allow to add a filter on array as defined on selectForForms with remplacement id // Bom:bom/class/bom.class.php:0:(t.fk_product:=:$ID$):ref --- htdocs/core/class/extrafields.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 69a6ff82424..5a1029fad29 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2009-2012 Laurent Destailleur * Copyright (C) 2009-2012 Regis Houssin * Copyright (C) 2013 Florian Henry - * Copyright (C) 2015 Charles-Fr BENKE + * Copyright (C) 2015-2023 Charlene BENKE * Copyright (C) 2016 Raphaël Doursenaud * Copyright (C) 2017 Nicolas ZABOURI * Copyright (C) 2018-2022 Frédéric France @@ -1554,6 +1554,8 @@ class ExtraFields } } elseif ($type == 'link') { $param_list = array_keys($param['options']); // $param_list='ObjectName:classPath' + if (strpos($param_list[0], '$ID$') !== false && !empty($objectid)) + $param_list[0] = str_replace('$ID$', $objectid, $param_list[0]); $showempty = (($required && $default != '') ? 0 : 1); $out = $form->selectForForms($param_list[0], $keyprefix.$key.$keysuffix, $value, $showempty, '', '', $morecss); } elseif ($type == 'password') {