diff --git a/lib/dolismq_function.lib.php b/lib/dolismq_function.lib.php index 0c3b09bd..08819006 100644 --- a/lib/dolismq_function.lib.php +++ b/lib/dolismq_function.lib.php @@ -61,6 +61,7 @@ function dolismq_select_product_lots($productid = -1, $selected = '', $htmlname if ( ! is_object($hookmanager)) { include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; $hookmanager = new HookManager($db); + $hookmanager->initHooks(['globalcard']); } // We search third parties @@ -119,19 +120,28 @@ function dolismq_select_product_lots($productid = -1, $selected = '', $htmlname $out .= ''; } + if ($htmlname != 'none' && ! $options_only) { + $out .= ''; + } + $parameters = array( - 'socid' => $productid, + 'productid' => $productid, 'htmlname' => $htmlname, + 'htmlid' => $htmlid, + 'moreclass' => $moreclass, + 'moreparam' => $moreparam, + 'selected' => $selected, 'resql' => $resql, 'out' => &$out, 'showfunction' => $showfunction, 'showsoc' => $showsoc, ); - //$reshook = $hookmanager->executeHooks('afterSelectContactOptions', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('modifyProductlotSelector', $parameters); - if ($htmlname != 'none' && ! $options_only) { - $out .= ''; + if ($reshook < 0) { + dol_print_error($db, $hookmanager->error, $hookmanager->errors); + return -1; } return $out;