From 3e5273d83b2c6e8d4135d4f7822ed1e199078589 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 Oct 2022 11:14:28 +0200 Subject: [PATCH] NEW Option PRODUIT_DESC_IN_FORM accept (desktop only or +smartphone) --- htdocs/admin/fckeditor.php | 2 +- htdocs/contact/consumption.php | 6 +++--- htdocs/contrat/card.php | 2 +- htdocs/core/boxes/box_services_contracts.php | 6 ------ htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/class/conf.class.php | 5 ++++- htdocs/core/lib/sendings.lib.php | 4 ++-- htdocs/core/tpl/objectline_view.tpl.php | 2 +- htdocs/delivery/card.php | 4 ++-- htdocs/expedition/card.php | 6 +++--- htdocs/expedition/shipment.php | 4 ++-- .../class/knowledgerecord.class.php | 2 +- htdocs/langs/en_US/admin.lang | 3 ++- htdocs/langs/en_US/knowledgemanagement.lang | 2 +- htdocs/main.inc.php | 10 +++++++++- htdocs/product/admin/product.php | 5 +++-- htdocs/reception/card.php | 8 ++++---- htdocs/societe/consumption.php | 6 +++--- 18 files changed, 43 insertions(+), 36 deletions(-) diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index dd4748a99f1..eeeb5035e16 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -93,7 +93,7 @@ foreach ($modules as $const => $desc) { if ($action == 'enable_'.strtolower($const)) { dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1", 'chaine', 0, '', $conf->entity); // If fckeditor is active in the product/service description, it is activated in the forms - if ($const == 'PRODUCTDESC' && !empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if ($const == 'PRODUCTDESC' && getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { dolibarr_set_const($db, "FCKEDITOR_ENABLE_DETAILS", "1", 'chaine', 0, '', $conf->entity); } header("Location: ".$_SERVER["PHP_SELF"]); diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index fcab597d43a..bbd5bf005d2 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -520,7 +520,7 @@ if ($sql_select) { } $text .= ' - '.(!empty($objp->label) ? $objp->label : $label); - $description = (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : dol_htmlentitiesbr($objp->description)); + $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($objp->description)); } if (($objp->info_bits & 2) == 2) { @@ -571,7 +571,7 @@ if ($sql_select) { echo get_date_range($objp->date_start, $objp->date_end); // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { print (!empty($objp->description) && $objp->description != $objp->product_label) ? '
'.dol_htmlentitiesbr($objp->description) : ''; } } else { @@ -608,7 +608,7 @@ if ($sql_select) { // Show range $prodreftxt .= get_date_range($objp->date_start, $objp->date_end); // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { $prodreftxt .= (!empty($objp->description) && $objp->description!=$objp->product_label)?'
'.dol_htmlentitiesbr($objp->description):''; } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 4c6c07da2cb..111b2d58fd9 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1589,7 +1589,7 @@ if ($action == 'create') { $description = $objp->description; // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { $text .= (!empty($objp->description) && $objp->description != $objp->plabel) ? '
'.dol_htmlentitiesbr($objp->description) : ''; $description = ''; // Already added into main visible desc } diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index 9ec279fe2d0..3d1e640f34b 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -169,12 +169,6 @@ class box_services_contracts extends ModeleBoxes } $description = $objp->description; - // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { - //$text .= (!empty($objp->description) && $objp->description!=$objp->product_label)?'
'.dol_htmlentitiesbr($objp->description):''; - $description = ''; // Already added into main visible desc - } - $s = $form->textwithtooltip($text, $description, 3, '', '', '', 0, (!empty($objp->fk_parent_line) ?img_picto('', 'rightarrow') : '')); } else { $s = img_object($langs->trans("ShowProductOrService"), ($objp->product_type ? 'service' : 'product')).' '.dol_htmlentitiesbr($objp->description); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a198d74f808..d8eb8789d6e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5015,7 +5015,7 @@ abstract class CommonObject } $text .= ' - '.(!empty($line->label) ? $line->label : $label); - $description .= (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : (!empty($line->description) ? dol_htmlentitiesbr($line->description) : '')); // Description is what to show on popup. We shown nothing if already into desc. + $description .= (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : (!empty($line->description) ? dol_htmlentitiesbr($line->description) : '')); // Description is what to show on popup. We shown nothing if already into desc. } $line->pu_ttc = price2num((!empty($line->subprice) ? $line->subprice : 0) * (1 + ((!empty($line->tva_tx) ? $line->tva_tx : 0) / 100)), 'MU'); diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 234f8d80e0c..42927d398aa 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -347,7 +347,7 @@ class Conf $db->free($resql); } - // Include other local consts.php files and fetch their values to the corresponding database constants. + // Include other local file xxx/zzz_consts.php to overwrite some variables if (!empty($this->global->LOCAL_CONSTS_FILES)) { $filesList = explode(":", $this->global->LOCAL_CONSTS_FILES); foreach ($filesList as $file) { @@ -675,6 +675,9 @@ class Conf } $this->product->limit_size = $this->global->PRODUIT_LIMIT_SIZE; + // Set PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE, may be modified later according to browser + $this->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = (isset($this->global->PRODUIT_DESC_IN_FORM) ? $this->global->PRODUIT_DESC_IN_FORM : 0); + // conf->theme et $this->css if (empty($this->global->MAIN_THEME)) { $this->global->MAIN_THEME = "eldy"; diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 110dcabb0f0..6d9598a04ae 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -341,14 +341,14 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') $product_static->status_batch = $objp->product_tobatch; $text = $product_static->getNomUrl(1); $text .= ' - '.$label; - $description = (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : dol_htmlentitiesbr($objp->description)); + $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($objp->description)); print $form->textwithtooltip($text, $description, 3, '', '', $i); // Show range print_date_range($objp->date_start, $objp->date_end); // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { print (!empty($objp->description) && $objp->description != $objp->product) ? '
'.dol_htmlentitiesbr($objp->description) : ''; } diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 11104f61798..03e98e1147d 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -213,7 +213,7 @@ if (($line->info_bits & 2) == 2) { } // Add description in form - if ($line->fk_product > 0 && !empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if ($line->fk_product > 0 && getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { if ($line->element == 'facturedetrec') { print (!empty($line->description) && $line->description != $line->product_label) ? (($line->date_start_fill || $line->date_end_fill) ? '' : '
').'
'.dol_htmlentitiesbr($line->description) : ''; } elseif ($line->element == 'invoice_supplier_det_rec') { diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index 8ab49d36990..d458b14b0cb 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -577,11 +577,11 @@ if ($action == 'create') { } $text .= ' '.$object->lines[$i]->product_ref.''; $text .= ' - '.$label; - $description = (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : dol_htmlentitiesbr($object->lines[$i]->description)); + $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($object->lines[$i]->description)); //print $description; print $form->textwithtooltip($text, $description, 3, '', '', $i); print_date_range($object->lines[$i]->date_start, $object->lines[$i]->date_end); - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { print (!empty($object->lines[$i]->description) && $object->lines[$i]->description != $object->lines[$i]->product_label) ? '
'.dol_htmlentitiesbr($object->lines[$i]->description) : ''; } } else { diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 17173088eed..6c880a6e425 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1143,7 +1143,7 @@ if ($action == 'create') { $product_static->status_buy = $line->product_tobuy; $product_static->status_batch = $line->product_tobatch; - $showdescinproductdesc = (getDolGlobalString('PRODUIT_DESC_IN_FORM') == 2 ? 1 : 0); + $showdescinproductdesc = getDolGlobalString('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE'); $text = $product_static->getNomUrl(1); $text .= ' - '.(!empty($line->label) ? $line->label : $line->product_label); @@ -2202,10 +2202,10 @@ if ($action == 'create') { $text = $product_static->getNomUrl(1); $text .= ' - '.$label; - $description = (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : dol_htmlentitiesbr($lines[$i]->description)); + $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($lines[$i]->description)); print $form->textwithtooltip($text, $description, 3, '', '', $i); print_date_range(!empty($lines[$i]->date_start) ? $lines[$i]->date_start : '', !empty($lines[$i]->date_end) ? $lines[$i]->date_end : ''); - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { print (!empty($lines[$i]->description) && $lines[$i]->description != $lines[$i]->product) ? '
'.dol_htmlentitiesbr($lines[$i]->description) : ''; } print "\n"; diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 769642d305a..97162f4aaf2 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -733,7 +733,7 @@ if ($id > 0 || !empty($ref)) { $text = $product_static->getNomUrl(1); $text .= ' - '.$label; - $description = ($conf->global->PRODUIT_DESC_IN_FORM ? '' : dol_htmlentitiesbr($objp->description)).'
'; + $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($objp->description)).'
'; $description .= $product_static->show_photos('product', $conf->product->multidir_output[$product_static->entity], 1, 1, 0, 0, 0, 80); print $form->textwithtooltip($text, $description, 3, '', '', $i); @@ -741,7 +741,7 @@ if ($id > 0 || !empty($ref)) { print_date_range($db->jdate($objp->date_start), $db->jdate($objp->date_end)); // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { print ($objp->description && $objp->description != $objp->product_label) ? '
'.dol_htmlentitiesbr($objp->description) : ''; } diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index 3e78b5b557c..fee18df2478 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -114,7 +114,7 @@ class KnowledgeRecord extends CommonObject 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,), 'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,), //'url' => array('type'=>'varchar(255)', 'label'=>'URL', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>-1, 'csslist'=>'tdoverflow200', 'help'=>'UrlForInfoPage'), - 'fk_c_ticket_category' => array('type'=>'integer:CTicketCategory:ticket/class/cticketcategory.class.php:0:(t.active:=:1):pos', 'label'=>'SuggestedForTicketsInGroup', 'enabled'=>'$conf->ticket->enabled', 'position'=>520, 'notnull'=>0, 'visible'=>-1, 'help'=>'YouCanLinkArticleToATicketCategory', 'csslist'=>'minwidth200 tdoverflowmax250'), + 'fk_c_ticket_category' => array('type'=>'integer:CTicketCategory:ticket/class/cticketcategory.class.php:0:(t.active:=:1):pos', 'label'=>'SuggestedForTicketsInGroup', 'enabled'=>'isModEnabled("ticket")', 'position'=>520, 'notnull'=>0, 'visible'=>-1, 'help'=>'YouCanLinkArticleToATicketCategory', 'csslist'=>'minwidth200 tdoverflowmax250'), 'answer' => array('type'=>'html', 'label'=>'Solution', 'enabled'=>'1', 'position'=>600, 'notnull'=>0, 'visible'=>3, 'csslist'=>'tdoverflowmax300', 'copytoclipboard'=>1, 'tdcss'=>'titlefieldcreate nowraponall'), 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'visible'=>5, 'default'=>0, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '9'=>'Obsolete'),), ); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a78c19f5dd9..e8f8f5bac6d 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2331,4 +2331,5 @@ RECEPTION_PDF_HIDE_ORDERED=Hide the quantity ordered on the generated documents MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT=Show the price on the generated documents for receptions WarningDisabled=Warning disabled LimitsAndMitigation=Access limits and mitigation - \ No newline at end of file +DesktopsOnly=Desktops only +DesktopsAndSmartphones=Desktops et smartphones \ No newline at end of file diff --git a/htdocs/langs/en_US/knowledgemanagement.lang b/htdocs/langs/en_US/knowledgemanagement.lang index 1746b0671ce..38c1624afad 100644 --- a/htdocs/langs/en_US/knowledgemanagement.lang +++ b/htdocs/langs/en_US/knowledgemanagement.lang @@ -47,7 +47,7 @@ KnowledgeRecord = Article KnowledgeRecordExtraFields = Extrafields for Article GroupOfTicket=Group of tickets YouCanLinkArticleToATicketCategory=You can link the article to a ticket group (so the article will be highlighted on any tickets in this group) -SuggestedForTicketsInGroup=Suggested for tickets when group is +SuggestedForTicketsInGroup=Suggested on ticket creation SetObsolete=Set as obsolete ConfirmCloseKM=Do you confirm the closing of this article as obsolete ? diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index dcf9bb7d96d..32d442008eb 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1207,14 +1207,22 @@ if (GETPOST('dol_no_mouse_hover', 'int') || !empty($_SESSION['dol_no_mouse_hover if (GETPOST('dol_use_jmobile', 'int') || !empty($_SESSION['dol_use_jmobile'])) { $conf->dol_use_jmobile = 1; } +// If not on Desktop if (!empty($conf->browser->layout) && $conf->browser->layout != 'classic') { $conf->dol_no_mouse_hover = 1; } + +// If on smartphone or optmized for small screen if ((!empty($conf->browser->layout) && $conf->browser->layout == 'phone') || (!empty($_SESSION['dol_screenwidth']) && $_SESSION['dol_screenwidth'] < 400) - || (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 400) + || (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 400 + || !empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) ) { $conf->dol_optimize_smallscreen = 1; + + if (isset($conf->global->PRODUIT_DESC_IN_FORM) && $conf->global->PRODUIT_DESC_IN_FORM == 1) { + $conf->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = 0; + } } // Replace themes bugged with jmobile with eldy if (!empty($conf->dol_use_jmobile) && in_array($conf->theme, array('bureau2crea', 'cameleo', 'amarok'))) { diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 7462431d087..a8106a9ae88 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -133,7 +133,7 @@ if ($action == 'other') { /*$value = GETPOST('PRODUIT_SOUSPRODUITS', 'alpha'); $res = dolibarr_set_const($db, "PRODUIT_SOUSPRODUITS", $value, 'chaine', 0, '', $conf->entity);*/ - $value = GETPOST('activate_viewProdDescInForm', 'alpha'); + $value = GETPOST('PRODUIT_DESC_IN_FORM', 'alpha'); $res = dolibarr_set_const($db, "PRODUIT_DESC_IN_FORM", $value, 'chaine', 0, '', $conf->entity); $value = GETPOST('activate_viewProdTextsInThirdpartyLanguage', 'alpha'); @@ -689,7 +689,8 @@ print ''; print ''; print ''.$langs->trans("ViewProductDescInFormAbility").''; print ''; -print $form->selectyesno("activate_viewProdDescInForm", $conf->global->PRODUIT_DESC_IN_FORM, 1); +$arrayofchoices = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes").' ('.$langs->trans("DesktopsOnly").')', '2' => $langs->trans("Yes").' ('.$langs->trans("DesktopsAndSmartphones").')'); +print $form->selectarray("PRODUIT_DESC_IN_FORM", $arrayofchoices, getDolGlobalInt('PRODUIT_DESC_IN_FORM'), 0); print ''; print ''; diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index d69806f2517..011781f33e2 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1102,14 +1102,14 @@ if ($action == 'create') { $text = $product_static->getNomUrl(1); $text .= ' - '.(!empty($line->label) ? $line->label : $line->product_label); - $description = ($conf->global->PRODUIT_DESC_IN_FORM ? '' : dol_htmlentitiesbr($line->desc)); + $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($line->desc)); print $form->textwithtooltip($text, $description, 3, '', '', $i); // Show range print_date_range($db->jdate($line->date_start), $db->jdate($line->date_end)); // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { print ($line->desc && $line->desc != $line->product_label) ? '
'.dol_htmlentitiesbr($line->desc) : ''; } } @@ -1825,10 +1825,10 @@ if ($action == 'create') { if (!array_key_exists($lines[$i]->fk_commandefourndet, $arrayofpurchaselinealreadyoutput)) { $text = $lines[$i]->product->getNomUrl(1); $text .= ' - '.$label; - $description = (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : dol_htmlentitiesbr($lines[$i]->product->description)); + $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($lines[$i]->product->description)); print $form->textwithtooltip($text, $description, 3, '', '', $i); print_date_range(!empty($lines[$i]->date_start) ? $lines[$i]->date_start : 0, !empty($lines[$i]->date_end) ? $lines[$i]->date_end : 0); - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { print (!empty($lines[$i]->product->description) && $lines[$i]->description != $lines[$i]->product->description) ? '
'.dol_htmlentitiesbr($lines[$i]->description) : ''; } } diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 0ddbe7f2ad5..c74b5e68985 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -564,7 +564,7 @@ if ($sql_select) { } $text .= ' - '.(!empty($objp->label) ? $objp->label : $label); - $description = (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : dol_htmlentitiesbr($objp->description)); + $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($objp->description)); } if (($objp->info_bits & 2) == 2) { ?> @@ -619,7 +619,7 @@ if ($sql_select) { echo get_date_range($objp->date_start, $objp->date_end); // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { print (!empty($objp->description) && $objp->description != $objp->product_label) ? '
'.dol_htmlentitiesbr($objp->description) : ''; } } else { @@ -656,7 +656,7 @@ if ($sql_select) { // Show range $prodreftxt .= get_date_range($objp->date_start, $objp->date_end); // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { $prodreftxt .= (!empty($objp->description) && $objp->description!=$objp->product_label)?'
'.dol_htmlentitiesbr($objp->description):''; }