From 816d29d177d0c84b3f62ef003cae5cd55ec3d4fa Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Thu, 14 Dec 2023 14:49:52 +0100 Subject: [PATCH] add noprint parameter to select_conditions_paiements --- htdocs/core/class/html.form.class.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a81f40ebc2f..0b862caba1b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4304,13 +4304,19 @@ class Form * @param string $deposit_percent < 0 : deposit_percent input makes no sense (for example, in list filters) * 0 : use default deposit percentage from entry * > 0 : force deposit percentage (for example, from company object) + * @param int $noprint if set to one we return the html to print, if 0 (default) we print it * @return void * @deprecated */ - public function select_conditions_paiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '', $deposit_percent = -1) + public function select_conditions_paiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '', $deposit_percent = -1, $noprint = 0) { // phpcs:enable - print $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, $noinfoadmin, $morecss, $deposit_percent); + $out = $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, $noinfoadmin, $morecss, $deposit_percent, $noprint); + if (empty($noprint)) { + print $out; + } else { + return $out; + } }