From 54da1e73ffd411ad3a9d93c2a654f7c26dfa8954 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Mar 2020 23:56:48 +0100 Subject: [PATCH] Option to show the n first line of desc into the basket --- htdocs/takepos/invoice.php | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 22c8171a46c..60854bf2407 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -845,19 +845,27 @@ if ($placeid > 0) if (empty($line->product_type)) $htmlforlines .= img_object('', 'product').' '; else $htmlforlines .= img_object('', 'service').' '; } - if ($line->product_label) $htmlforlines .= $line->product_label; - if ($line->product_label && $line->desc) $htmlforlines .= '
'; - if ($line->product_label != $line->desc) - { - $firstline = dolGetFirstLineOfText($line->desc); - if ($firstline != $line->desc) - { - $htmlforlines .= $form->textwithpicto(dolGetFirstLineOfText($line->desc), $line->desc); - } - else - { - $htmlforlines .= $line->desc; - } + if (empty($conf->global->TAKEPOS_SHOW_N_FIRST_LINES)) { + $tooltiptext = ''.$langs->trans("Ref").' : '.$line->product_ref.'
'; + $tooltiptext .= ''.$langs->trans("Label").' : '.$line->product_label.'
'; + $tooltiptext .= '
'; + $tooltiptext .= $line->desc; + $htmlforlines .= $form->textwithpicto($line->product_label ? $line->product_label : $line->product_ref, $tooltiptext); + } else { + if ($line->product_label) $htmlforlines .= $line->product_label; + if ($line->product_label && $line->desc) $htmlforlines .= '
'; + if ($line->product_label != $line->desc) + { + $firstline = dolGetFirstLineOfText($line->desc, $conf->global->TAKEPOS_SHOW_N_FIRST_LINES); + if ($firstline != $line->desc) + { + $htmlforlines .= $form->textwithpicto(dolGetFirstLineOfText($line->desc), $line->desc); + } + else + { + $htmlforlines .= $line->desc; + } + } } if (!empty($line->array_options['options_order_notes'])) $htmlforlines .= "
(".$line->array_options['options_order_notes'].")"; if ($_SESSION["basiclayout"] != 1)