From a36f41728f2ae61e67f05e993168d7fbfbb2f590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 10 Sep 2018 23:58:57 +0200 Subject: [PATCH] deprecate formbarcode:form_barcode_type --- htdocs/core/class/html.formbarcode.class.php | 39 ++++++++++++++------ htdocs/product/card.php | 2 +- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/htdocs/core/class/html.formbarcode.class.php b/htdocs/core/class/html.formbarcode.class.php index 7b0f7bd06fe..78bcb35d863 100644 --- a/htdocs/core/class/html.formbarcode.class.php +++ b/htdocs/core/class/html.formbarcode.class.php @@ -180,22 +180,37 @@ class FormBarCode * @param int $selected Id condition preselected * @param string $htmlname Nom du formulaire select * @return void + * @deprecated */ // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function form_barcode_type($page, $selected='', $htmlname='barcodetype_id') { - global $langs,$conf; - if ($htmlname != "none") - { - print '
'; - print ''; - print ''; - print ''; - print ''; - print '
'; - print $this->selectBarcodeType($selected, $htmlname, 1); - print ''; - print '
'; + print $this->formBarcodeType($page, $selected, $htmlname); + } + + /** + * Return html form to select type of barcode + * + * @param string $page Page + * @param int $selected Id condition preselected + * @param string $htmlname Nom du formulaire select + * @return string + */ + function formBarcodeType($page, $selected='', $htmlname='barcodetype_id') + { + global $langs, $conf; + $out = ''; + if ($htmlname != "none") { + $out .= '
'; + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; + $out .= '
'; + $out .= $this->selectBarcodeType($selected, $htmlname, 1); + $out .= ''; + $out .= '
'; } + return $out; } } diff --git a/htdocs/product/card.php b/htdocs/product/card.php index a252a1ccafa..d51a4fa494c 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1639,7 +1639,7 @@ else } if ($action == 'editbarcodetype') { - $formbarcode->form_barcode_type($_SERVER['PHP_SELF'].'?id='.$object->id,$object->barcode_type,'fk_barcode_type'); + print $formbarcode->formBarcodeType($_SERVER['PHP_SELF'].'?id='.$object->id, $object->barcode_type, 'fk_barcode_type'); } else {