From e2915d29792f2f22e57778a33bc65ff39a9047f7 Mon Sep 17 00:00:00 2001
From: Florent Poinsaut <1256948+FlorentPoinsaut@users.noreply.github.com>
Date: Mon, 31 Jul 2023 01:41:24 +0200
Subject: [PATCH] NEW Add picto in product/service list in object lines
(#25511)
---
htdocs/core/class/html.form.class.php | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index d258d5726a4..e067fbcf56f 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -3547,7 +3547,25 @@ class Form
$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '$1', $label, 1);
}
- $optlabel = $objp->ref;
+ switch ($objp->fk_product_type) {
+ case Product::TYPE_PRODUCT:
+ $picto = 'product';
+ break;
+ case Product::TYPE_SERVICE:
+ $picto = 'service';
+ break;
+ default:
+ $picto = '';
+ break;
+ }
+
+ if (empty($picto)) {
+ $optlabel = '';
+ } else {
+ $optlabel = img_object('', $picto, 'class="paddingright classfortooltip"', 0, 0, 1);
+ }
+
+ $optlabel .= $objp->ref;
if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
$optlabel .= ' (' . $objp->ref_fourn . ')';
}