Option to show the n first line of desc into the basket

This commit is contained in:
Laurent Destailleur 2020-03-11 23:56:48 +01:00
parent efeda2e747
commit 54da1e73ff

View File

@ -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 .= '<br>';
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 = '<b>'.$langs->trans("Ref").'</b> : '.$line->product_ref.'<br>';
$tooltiptext .= '<b>'.$langs->trans("Label").'</b> : '.$line->product_label.'<br>';
$tooltiptext .= '<br>';
$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 .= '<br>';
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 .= "<br>(".$line->array_options['options_order_notes'].")";
if ($_SESSION["basiclayout"] != 1)