Show product description (#26193)

* Show product description

shows product-description on list of products when hover the product-ref

* Update product.class.php

limiting the display to 5 lines
This commit is contained in:
tgsw 2023-10-12 15:39:42 +02:00 committed by GitHub
parent af0bf77d0d
commit de5b97c7e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -5072,6 +5072,9 @@ class Product extends CommonObject
if (!empty($this->label)) {
$datas['label']= '<br><b>'.$langs->trans('ProductLabel').':</b> '.$this->label;
}
if (!empty($this->description)) {
$datas['description']= '<br><b>'.$langs->trans('ProductDescription').':</b> '.dolGetFirstLineofText($this->description, 5);
}
if ($this->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
if (isModEnabled('productbatch')) {
$langs->load("productbatch");

View file

@ -432,7 +432,7 @@ if ($search_type != '' && $search_type != '-1') {
// Build and execute select
// --------------------------------------------------------------------
$sql = 'SELECT p.rowid, p.ref, p.label, p.fk_product_type, p.barcode, p.price, p.tva_tx, p.price_ttc, p.price_base_type, p.entity,';
$sql = 'SELECT p.rowid, p.ref, p.description, p.label, p.fk_product_type, p.barcode, p.price, p.tva_tx, p.price_ttc, p.price_base_type, p.entity,';
$sql .= ' p.fk_product_type, p.duration, p.finished, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,';
$sql .= ' p.tobatch, ';
if (isModEnabled('workstation')) {
@ -1495,6 +1495,7 @@ while ($i < $imaxinloop) {
if (empty($reshook)) {
$product_static->id = $obj->rowid;
$product_static->ref = $obj->ref;
$product_static->description = $obj->description;
$product_static->ref_fourn = empty($obj->ref_supplier) ? '' : $obj->ref_supplier; // deprecated
$product_static->ref_supplier = empty($obj->ref_supplier) ? '' : $obj->ref_supplier;
$product_static->label = $obj->label;