Merge pull request #21806 from frederic34/patch-5

fix php8 warnings
This commit is contained in:
Laurent Destailleur 2022-08-22 10:50:59 +02:00 committed by GitHub
commit 6f34072a27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 75 additions and 75 deletions

View File

@ -190,7 +190,7 @@ foreach ($dirbarcode as $reldir) {
// Select barcode numbering module
if ($conf->product->enabled) {
if (isModEnabled('product')) {
print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("Product").")", '', '');
print '<div class="div-table-responsive-no-min">';
@ -252,7 +252,7 @@ if ($conf->product->enabled) {
}
// Select barcode numbering module
if ($conf->societe->enabled) {
if (isModEnabled('societe')) {
print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("ThirdParty").")", '', '');
print '<div class="div-table-responsive-no-min">';
@ -450,7 +450,7 @@ if (!isset($_SERVER['WINDIR'])) {
}
// Module products
if (!empty($conf->product->enabled)) {
if (isModEnabled('product')) {
print '<tr class="oddeven">';
print '<td>'.$langs->trans("SetDefaultBarcodeTypeProducts").'</td>';
print '<td width="60" class="right">';
@ -461,7 +461,7 @@ if (!empty($conf->product->enabled)) {
}
// Module thirdparty
if (!empty($conf->societe->enabled)) {
if (isModEnabled('societe')) {
print '<tr class="oddeven">';
print '<td>'.$langs->trans("SetDefaultBarcodeTypeThirdParties").'</td>';
print '<td width="60" class="right">';

View File

@ -466,7 +466,7 @@ print '<input class="maxwidth300 widthcentpercentminusx" name="web" id="web" val
print '</td></tr>'."\n";
// Barcode
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
print '<tr class="oddeven"><td>';
print '<label for="barcode">'.$langs->trans("Gencod").'</label></td><td>';
print '<span class="fa fa-barcode pictofixedwidth"></span>';

View File

@ -355,7 +355,7 @@ if (isModEnabled('societe')) {
// For products
if ($conf->product->enabled || $conf->product->service) {
if (isModEnabled('product') || isModEnabled('service')) {
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="mode" value="label">';
print '<input type="hidden" name="action" value="initbarcodeproducts">';

View File

@ -1408,7 +1408,7 @@ class Form
if (count($scrit) > 1) {
$sql .= ")";
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
}
$sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'";
@ -2691,7 +2691,7 @@ class Form
if (count($scrit) > 1) {
$sql .= ")";
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
}
$sql .= ')';
@ -3254,7 +3254,7 @@ class Form
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
$sql .= ", u.label as unit_long, u.short_label as unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units";
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$sql .= ", pfp.barcode";
}
$sql .= " FROM ".$this->db->prefix()."product as p";
@ -3305,7 +3305,7 @@ class Form
if (count($scrit) > 1) {
$sql .= ")";
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
$sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
}
@ -3402,7 +3402,7 @@ class Form
if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
$optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>';
}
if (!empty($conf->barcode->enabled) && !empty($objp->barcode)) {
if (isModEnabled('barcode') && !empty($objp->barcode)) {
$optlabel .= ' ('.$outbarcode.')';
}
$optlabel .= ' - '.dol_trunc($label, $maxlengtharticle);
@ -3411,7 +3411,7 @@ class Form
if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
$outvallabel .= ' ('.$objRefFourn.')';
}
if (!empty($conf->barcode->enabled) && !empty($objp->barcode)) {
if (isModEnabled('barcode') && !empty($objp->barcode)) {
$outvallabel .= ' ('.$outbarcode.')';
}
$outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle);

View File

@ -986,20 +986,20 @@ class pdf_espadon extends ModelePdfExpedition
}
// Show barcode
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$posx = 105;
} else {
$posx = $this->marge_gauche + 3;
}
//$pdf->Rect($this->marge_gauche, $this->marge_haute, $this->page_largeur-$this->marge_gauche-$this->marge_droite, 30);
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
// TODO Build code bar with function writeBarCode of barcode module for sending ref $object->ref
//$pdf->SetXY($this->marge_gauche+3, $this->marge_haute+3);
//$pdf->Image($logo,10, 5, 0, 24);
}
$pdf->SetDrawColor(128, 128, 128);
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
// TODO Build code bar with function writeBarCode of barcode module for sending ref $object->ref
//$pdf->SetXY($this->marge_gauche+3, $this->marge_haute+3);
//$pdf->Image($logo,10, 5, 0, 24);

View File

@ -931,20 +931,20 @@ class pdf_rouget extends ModelePdfExpedition
}
// Show barcode
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$posx = 105;
} else {
$posx = $this->marge_gauche + 3;
}
//$pdf->Rect($this->marge_gauche, $this->marge_haute, $this->page_largeur-$this->marge_gauche-$this->marge_droite, 30);
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
// TODO Build code bar with function writeBarCode of barcode module for sending ref $object->ref
//$pdf->SetXY($this->marge_gauche+3, $this->marge_haute+3);
//$pdf->Image($logo,10, 5, 0, 24);
}
$pdf->SetDrawColor(128, 128, 128);
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
// TODO Build code bar with function writeBarCode of barcode module for sending ref $object->ref
//$pdf->SetXY($this->marge_gauche+3, $this->marge_haute+3);
//$pdf->Image($logo,10, 5, 0, 24);

View File

@ -209,7 +209,7 @@ class modProduct extends DolibarrModules
if (!empty($conf->stock->enabled)) {
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('e.ref'=>'DefaultWarehouse', 'p.tobatch'=>'ManageLotSerial', 'p.stock'=>'Stock', 'p.seuil_stock_alerte'=>'StockLimit', 'p.desiredstock'=>'DesiredStock', 'p.pmp'=>'PMPValue'));
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.barcode'=>'BarCode'));
}
$keyforselect = 'product';
@ -247,7 +247,7 @@ class modProduct extends DolibarrModules
if (!empty($conf->stock->enabled)) {
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('e.ref'=>'Text', 'p.tobatch'=>'Numeric', 'p.stock'=>'Numeric', 'p.seuil_stock_alerte'=>'Numeric', 'p.desiredstock'=>'Numeric', 'p.pmp'=>'Numeric', 'p.cost_price'=>'Numeric'));
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.barcode'=>'Text'));
}
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
@ -266,7 +266,7 @@ class modProduct extends DolibarrModules
if (!empty($conf->stock->enabled)) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'product', 'p.pmp'=>'product'));
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode'=>'product'));
}
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
@ -281,7 +281,7 @@ class modProduct extends DolibarrModules
if (!empty($conf->stock->enabled)) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'product', 'p.pmp'=>'product'));
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode'=>'product'));
}
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
@ -404,7 +404,7 @@ class modProduct extends DolibarrModules
if (!empty($conf->stock->enabled)) {
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.stock'=>'Stock', 'p.seuil_stock_alerte'=>'StockLimit', 'p.desiredstock'=>'DesiredStock', 'p.pmp'=>'PMPValue'));
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.barcode'=>'BarCode'));
}
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('pa.qty'=>'Qty', 'pa.incdec'=>'ComposedProductIncDecStock'));
@ -420,7 +420,7 @@ class modProduct extends DolibarrModules
if (!empty($conf->stock->enabled)) {
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.stock'=>'Numeric', 'p.seuil_stock_alerte'=>'Numeric', 'p.desiredstock'=>'Numeric', 'p.pmp'=>'Numeric', 'p.cost_price'=>'Numeric'));
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.barcode'=>'Text'));
}
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('pa.qty'=>'Numeric'));
@ -436,7 +436,7 @@ class modProduct extends DolibarrModules
if (!empty($conf->stock->enabled)) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'virtualproduct', 'p.seuil_stock_alerte'=>'virtualproduct', 'p.desiredstock'=>'virtualproduct', 'p.pmp'=>'virtualproduct'));
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode'=>'virtualproduct'));
}
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('pa.qty'=>"subproduct", 'pa.incdec'=>'subproduct'));
@ -629,7 +629,7 @@ class modProduct extends DolibarrModules
if (is_object($mysoc) && $mysoc->useLocalTax(2)) {
$this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array('p.localtax2_tx'=>'LT2', 'p.localtax2_type'=>'LT2Type'));
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array('p.barcode'=>'BarCode'));
}
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
@ -722,7 +722,7 @@ class modProduct extends DolibarrModules
if (is_object($mysoc) && $mysoc->useLocalTax(2)) {
$import_sample = array_merge($import_sample, array('p.localtax2_tx'=>'', 'p.localtax2_type'=>''));
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$import_sample = array_merge($import_sample, array('p.barcode'=>''));
}
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
@ -745,7 +745,7 @@ class modProduct extends DolibarrModules
}
$this->import_examplevalues_array[$r] = array_merge($import_sample, $import_extrafield_sample);
$this->import_updatekeys_array[$r] = array('p.ref'=>'Ref');
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$this->import_updatekeys_array[$r] = array_merge($this->import_updatekeys_array[$r], array('p.barcode'=>'BarCode')); //only show/allow barcode as update key if Barcode module enabled
}

View File

@ -174,7 +174,7 @@ class modService extends DolibarrModules
if (!empty($conf->stock->enabled)) {
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.stock'=>'Stock', 'p.seuil_stock_alerte'=>'StockLimit', 'p.desiredstock'=>'DesiredStock', 'p.pmp'=>'PMPValue'));
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.barcode'=>'BarCode'));
}
$keyforselect = 'product';
@ -210,7 +210,7 @@ class modService extends DolibarrModules
if (!empty($conf->stock->enabled)) {
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.stock'=>'Numeric', 'p.seuil_stock_alerte'=>'Numeric', 'p.desiredstock'=>'Numeric', 'p.pmp'=>'Numeric', 'p.cost_price'=>'Numeric'));
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.barcode'=>'Text'));
}
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
@ -229,7 +229,7 @@ class modService extends DolibarrModules
if (!empty($conf->stock->enabled)) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'product', 'p.pmp'=>'product'));
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode'=>'product'));
}
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
@ -244,7 +244,7 @@ class modService extends DolibarrModules
if (!empty($conf->stock->enabled)) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'product', 'p.pmp'=>'product'));
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode'=>'product'));
}
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
@ -363,7 +363,7 @@ class modService extends DolibarrModules
if (!empty($conf->stock->enabled)) {
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.stock'=>'Stock', 'p.seuil_stock_alerte'=>'StockLimit', 'p.desiredstock'=>'DesiredStock', 'p.pmp'=>'PMPValue'));
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.barcode'=>'BarCode'));
}
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('pa.qty'=>'Qty', 'pa.incdec'=>'ComposedProductIncDecStock'));
@ -379,7 +379,7 @@ class modService extends DolibarrModules
if (!empty($conf->stock->enabled)) {
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.stock'=>'Numeric', 'p.seuil_stock_alerte'=>'Numeric', 'p.desiredstock'=>'Numeric', 'p.pmp'=>'Numeric', 'p.cost_price'=>'Numeric'));
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.barcode'=>'Text'));
}
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('pa.qty'=>'Numeric'));
@ -395,7 +395,7 @@ class modService extends DolibarrModules
if (!empty($conf->stock->enabled)) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'virtualproduct', 'p.seuil_stock_alerte'=>'virtualproduct', 'p.desiredstock'=>'virtualproduct', 'p.pmp'=>'virtualproduct'));
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode'=>'virtualproduct'));
}
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('pa.qty'=>"subproduct", 'pa.incdec'=>'subproduct'));
@ -576,7 +576,7 @@ class modService extends DolibarrModules
if (is_object($mysoc) && $mysoc->useLocalTax(2)) {
$this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array('p.localtax2_tx'=>'LT2', 'p.localtax2_type'=>'LT2Type'));
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array('p.barcode'=>'BarCode'));
}
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
@ -667,7 +667,7 @@ class modService extends DolibarrModules
if (is_object($mysoc) && $mysoc->useLocalTax(2)) {
$import_sample = array_merge($import_sample, array('p.localtax2_tx'=>'', 'p.localtax2_type'=>''));
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$import_sample = array_merge($import_sample, array('p.barcode'=>''));
}
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
@ -693,7 +693,7 @@ class modService extends DolibarrModules
}
$this->import_examplevalues_array[$r] = array_merge($import_sample, $import_extrafield_sample);
$this->import_updatekeys_array[$r] = array('p.ref'=>'Ref');
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$this->import_updatekeys_array[$r] = array_merge($this->import_updatekeys_array[$r], array('p.barcode'=>'BarCode')); //only show/allow barcode as update key if Barcode module enabled
}

View File

@ -856,20 +856,20 @@ class pdf_squille extends ModelePdfReception
}
// Show barcode
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$posx = 105;
} else {
$posx = $this->marge_gauche + 3;
}
//$pdf->Rect($this->marge_gauche, $this->marge_haute, $this->page_largeur-$this->marge_gauche-$this->marge_droite, 30);
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
// TODO Build code bar with function writeBarCode of barcode module for reception ref $object->ref
//$pdf->SetXY($this->marge_gauche+3, $this->marge_haute+3);
//$pdf->Image($logo,10, 5, 0, 24);
}
$pdf->SetDrawColor(128, 128, 128);
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
// TODO Build code bar with function writeBarCode of barcode module for reception ref $object->ref
//$pdf->SetXY($this->marge_gauche+3, $this->marge_haute+3);
//$pdf->Image($logo,10, 5, 0, 24);

View File

@ -944,20 +944,20 @@ class pdf_eagle extends ModelePdfStockTransfer
}
// Show barcode
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$posx = 105;
} else {
$posx = $this->marge_gauche + 3;
}
//$pdf->Rect($this->marge_gauche, $this->marge_haute, $this->page_largeur-$this->marge_gauche-$this->marge_droite, 30);
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
// TODO Build code bar with function writeBarCode of barcode module for sending ref $object->ref
//$pdf->SetXY($this->marge_gauche+3, $this->marge_haute+3);
//$pdf->Image($logo,10, 5, 0, 24);
}
$pdf->SetDrawColor(128, 128, 128);
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
// TODO Build code bar with function writeBarCode of barcode module for sending ref $object->ref
//$pdf->SetXY($this->marge_gauche+3, $this->marge_haute+3);
//$pdf->Image($logo,10, 5, 0, 24);

View File

@ -620,7 +620,7 @@ class ProductFournisseur extends Product
$this->fourn_multicurrency_tx = $obj->multicurrency_tx;
$this->fourn_multicurrency_id = $obj->fk_multicurrency;
$this->fourn_multicurrency_code = $obj->multicurrency_code;
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$this->fourn_barcode = $obj->barcode; // deprecated
$this->fourn_fk_barcode_type = $obj->fk_barcode_type; // deprecated
$this->supplier_barcode = $obj->barcode;
@ -730,7 +730,7 @@ class ProductFournisseur extends Product
$prodfourn->packaging = $record["packaging"];
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$prodfourn->supplier_barcode = $record["barcode"];
$prodfourn->supplier_fk_barcode_type = $record["fk_barcode_type"];
}
@ -1178,7 +1178,7 @@ class ProductFournisseur extends Product
$label .= "<br><b>".$langs->trans("ManageLotSerial").'</b>: '.$this->getLibStatut(0, 2);
}
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$label .= '<br><b>'.$langs->trans('BarCode').':</b> '.$this->barcode;
}

View File

@ -1228,7 +1228,7 @@ llxHeader('', $title, $help_url);
// Load object modBarCodeProduct
$res = 0;
if (!empty($conf->barcode->enabled) && !empty($conf->global->BARCODE_PRODUCT_ADDON_NUM)) {
if (isModEnabled('barcode') && !empty($conf->global->BARCODE_PRODUCT_ADDON_NUM)) {
$module = strtolower($conf->global->BARCODE_PRODUCT_ADDON_NUM);
$dirbarcode = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
foreach ($dirbarcode as $dirroot) {

View File

@ -474,7 +474,7 @@ class Product extends CommonObject
'ref' =>array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>5),
'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>2, 'position'=>15),
'barcode' =>array('type'=>'varchar(255)', 'label'=>'Barcode', 'enabled'=>'!empty($conf->barcode->enabled)', 'position'=>20, 'visible'=>-1, 'showoncombobox'=>3),
'barcode' =>array('type'=>'varchar(255)', 'label'=>'Barcode', 'enabled'=>'isModEnabled("barcode")', 'position'=>20, 'visible'=>-1, 'showoncombobox'=>3),
'fk_barcode_type' => array('type'=>'integer', 'label'=>'BarcodeType', 'enabled'=>'1', 'position'=>21, 'notnull'=>0, 'visible'=>-1,),
'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61),
'note' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62),
@ -913,7 +913,7 @@ class Product extends CommonObject
{
// phpcs:enable
global $conf;
if (!empty($conf->barcode->enabled) && !empty($conf->global->BARCODE_PRODUCT_ADDON_NUM)) {
if (isModEnabled('barcode') && !empty($conf->global->BARCODE_PRODUCT_ADDON_NUM)) {
$module = strtolower($conf->global->BARCODE_PRODUCT_ADDON_NUM);
$dirsociete = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
@ -4944,7 +4944,7 @@ class Product extends CommonObject
$label .= "<br><b>".$langs->trans("ManageLotSerial").'</b>: '.$this->getLibStatut(0, 2);
}
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$label .= '<br><b>'.$langs->trans('BarCode').':</b> '.$this->barcode;
}

View File

@ -174,7 +174,7 @@ if ($action == 'search') {
$params[] = 'pl.description';
$params[] = 'pl.note';
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$params[] = 'p.barcode';
}
$sql .= natural_search($params, $key);

View File

@ -40,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_expression.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
dol_include_once('/core/class/html.formbarcode.class.php');
}
// Load translation files required by the page
@ -745,7 +745,7 @@ END;
print '</td></tr>';
// Barcode
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$formbarcode = new FormBarCode($db);
// Barcode type
@ -913,10 +913,10 @@ END;
'pfp.multicurrency_unitprice'=>array('label'=>$langs->trans("UnitPriceHTCurrency"), 'enabled' => (!empty($conf->multicurrency->enabled)), 'checked'=>0, 'position'=>10),
'pfp.delivery_time_days'=>array('label'=>$langs->trans("NbDaysToDelivery"), 'checked'=>1, 'position'=>13),
'pfp.supplier_reputation'=>array('label'=>$langs->trans("ReputationForThisProduct"), 'checked'=>1, 'position'=>14),
'pfp.fk_barcode_type'=>array('label'=>$langs->trans("BarcodeType"), 'enabled' => !empty($conf->barcode->enabled), 'checked'=>0, 'position'=>15),
'pfp.barcode'=>array('label'=>$langs->trans("BarcodeValue"), 'enabled' => !empty($conf->barcode->enabled), 'checked'=>0, 'position'=>16),
'pfp.fk_barcode_type'=>array('label'=>$langs->trans("BarcodeType"), 'enabled' => isModEnabled('barcode'), 'checked'=>0, 'position'=>15),
'pfp.barcode'=>array('label'=>$langs->trans("BarcodeValue"), 'enabled' => isModEnabled('barcode'), 'checked'=>0, 'position'=>16),
'pfp.packaging'=>array('label'=>$langs->trans("PackagingForThisProduct"), 'enabled' => !empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING), 'checked'=>0, 'position'=>17),
'pfp.tms'=>array('label'=>$langs->trans("DateModification"), 'enabled' => !empty($conf->barcode->enabled), 'checked'=>1, 'position'=>18),
'pfp.tms'=>array('label'=>$langs->trans("DateModification"), 'enabled' => isModEnabled('barcode'), 'checked'=>1, 'position'=>18),
);
// fetch optionals attributes and labels

View File

@ -608,7 +608,7 @@ if ($object->id > 0) {
if (!empty($conf->use_javascript_ajax)) {
if ($permissiontoadd) {
// Link to launch scan tool
if (!empty($conf->barcode->enabled) || !empty($conf->productbatch->enabled)) {
if (isModEnabled('barcode') || !empty($conf->productbatch->enabled)) {
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=updatebyscaning" class="marginrightonly paddingright marginleftonly paddingleft">'.img_picto('', 'barcode', 'class="paddingrightonly"').$langs->trans("UpdateByScaning").'</a>';
}

View File

@ -179,7 +179,7 @@ if (!empty($conf->global->MAIN_MULTILANGS)) {
$fieldstosearchall['pl.description'] = 'ProductDescriptionTranslated';
$fieldstosearchall['pl.note'] = 'ProductNoteTranslated';
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$fieldstosearchall['p.barcode'] = 'Gencod';
$fieldstosearchall['pfp.barcode'] = 'GencodBuyPrice';
}
@ -207,7 +207,7 @@ $arrayfields = array(
'thumbnail'=>array('label'=>'Photo', 'checked'=>0, 'position'=>10),
'p.label'=>array('label'=>"Label", 'checked'=>1, 'position'=>10),
'p.fk_product_type'=>array('label'=>"Type", 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && !empty($conf->service->enabled)), 'position'=>11),
'p.barcode'=>array('label'=>"Gencod", 'checked'=>1, 'enabled'=>(!empty($conf->barcode->enabled)), 'position'=>12),
'p.barcode'=>array('label'=>"Gencod", 'checked'=>1, 'enabled'=>(isModEnabled('barcode')), 'position'=>12),
'p.duration'=>array('label'=>"Duration", 'checked'=>($contextpage != 'productlist'), 'enabled'=>(!empty($conf->service->enabled) && (string) $type == '1'), 'position'=>13),
'p.finished'=>array('label'=>"Nature", 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && $type != '1'), 'position'=>19),
'p.weight'=>array('label'=>'Weight', 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && $type != '1'), 'position'=>20),

View File

@ -105,7 +105,7 @@ if (empty($conf) || !is_object($conf)) {
<?php }
}
if (!empty($conf->barcode->enabled)) { ?>
if (isModEnabled('barcode')) { ?>
<tr>
<td><?php echo $langs->trans('Gencod'); ?></td>
<td colspan="3"><input type="text" name="barcode" value="<?php echo $this->control->tpl['barcode']; ?>"></td>

View File

@ -120,7 +120,7 @@ if ($this->control->tpl['fournisseur']) {
}
}
if (!empty($conf->barcode->enabled)) { ?>
if (isModEnabled('barcode')) { ?>
<tr>
<td><?php echo $langs->trans('Gencod'); ?></td>
<td colspan="3"><input type="text" name="barcode" value="<?php echo $this->control->tpl['barcode']; ?>"></td>

View File

@ -79,7 +79,7 @@ print dol_get_fiche_head($head, 'card', $langs->trans("ThirdParty"), 0, 'company
</tr>
<?php } ?>
<?php if (!empty($conf->barcode->enabled)) { ?>
<?php if (isModEnabled('barcode')) { ?>
<tr>
<td><?php echo $langs->trans('Gencod'); ?></td>
<td colspan="3"><?php echo $this->control->tpl['barcode']; ?></td>

View File

@ -113,7 +113,7 @@ if (empty($conf) || !is_object($conf)) {
<?php }
}
if (!empty($conf->barcode->enabled)) { ?>
if (isModEnabled('barcode')) { ?>
<tr>
<td><?php echo $langs->trans('Gencod'); ?></td>
<td colspan="3"><input type="text" name="barcode" value="<?php echo $this->control->tpl['barcode']; ?>"></td>

View File

@ -117,7 +117,7 @@ if ($this->control->tpl['fournisseur']) {
}
?>
<?php if (!empty($conf->barcode->enabled)) { ?>
<?php if (isModEnabled('barcode')) { ?>
<tr>
<td><?php echo $langs->trans('Gencod'); ?></td>
<td colspan="3"><input type="text" name="barcode" value="<?php echo $this->control->tpl['barcode']; ?>"></td>

View File

@ -74,7 +74,7 @@ if ($this->control->tpl['action_delete']) {
</tr>
<?php } ?>
<?php if (!empty($conf->barcode->enabled)) { ?>
<?php if (isModEnabled('barcode')) { ?>
<tr>
<td><?php echo $langs->trans('Gencod'); ?></td>
<td colspan="3"><?php echo $this->control->tpl['barcode']; ?></td>

View File

@ -1510,7 +1510,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '</td></tr>';
// Barcode
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
print '<tr><td>'.$form->editfieldkey('Gencod', 'barcode', '', $object, 0).'</td>';
print '<td colspan="3">';
print img_picto('', 'barcode', 'class="pictofixedwidth"');
@ -2207,7 +2207,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
// Barcode
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
print '<tr><td class="tdtop">'.$form->editfieldkey('Gencod', 'barcode', '', $object, 0).'</td>';
print '<td colspan="3">';
print img_picto('', 'barcode');
@ -2687,7 +2687,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
// Barcode
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
print '<tr><td>';
print $langs->trans('Gencod').'</td><td>'.showValueWithClipboardCPButton(dol_escape_htmltag($object->barcode));
print '</td>';

View File

@ -187,7 +187,7 @@ if (($tmp = $langs->transnoentities("ProfId5".$mysoc->country_code)) && $tmp !=
if (($tmp = $langs->transnoentities("ProfId6".$mysoc->country_code)) && $tmp != "ProfId6".$mysoc->country_code && $tmp != '-') {
$fieldstosearchall['s.idprof6'] = 'ProfId6';
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$fieldstosearchall['s.barcode'] = 'Gencod';
}
// Personalized search criterias. Example: $conf->global->THIRDPARTY_QUICKSEARCH_ON_FIELDS = 's.nom=ThirdPartyName;s.name_alias=AliasNameShort;s.code_client=CustomerCode'
@ -217,7 +217,7 @@ $arrayfields = array(
's.rowid'=>array('label'=>"TechnicalID", 'position'=>1, 'checked'=>(!empty($conf->global->MAIN_SHOW_TECHNICAL_ID)), 'enabled'=>(!empty($conf->global->MAIN_SHOW_TECHNICAL_ID))),
's.nom'=>array('label'=>"ThirdPartyName", 'position'=>2, 'checked'=>1),
's.name_alias'=>array('label'=>"AliasNameShort", 'position'=>3, 'checked'=>1),
's.barcode'=>array('label'=>"Gencod", 'position'=>5, 'checked'=>1, 'enabled'=>(!empty($conf->barcode->enabled))),
's.barcode'=>array('label'=>"Gencod", 'position'=>5, 'checked'=>1, 'enabled'=>(isModEnabled('barcode'))),
's.code_client'=>array('label'=>"CustomerCodeShort", 'position'=>10, 'checked'=>$checkedcustomercode),
's.code_fournisseur'=>array('label'=>"SupplierCodeShort", 'position'=>11, 'checked'=>$checkedsuppliercode, 'enabled'=>((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))),
's.code_compta'=>array('label'=>"CustomerAccountancyCodeShort", 'position'=>13, 'checked'=>$checkedcustomeraccountcode),
@ -638,7 +638,7 @@ if ($search_type == '0') {
if ($search_status != '' && $search_status >= 0) {
$sql .= natural_search("s.status", $search_status, 2);
}
if (!empty($conf->barcode->enabled) && $search_barcode) {
if (isModEnabled('barcode') && $search_barcode) {
$sql .= natural_search("s.barcode", $search_barcode);
}
if ($search_price_level && $search_price_level != '-1') {

View File

@ -82,7 +82,7 @@ if ($action == 'set') {
$res = dolibarr_set_const($db, "TAKEPOS_SUMUP_AFFILIATE", GETPOST('TAKEPOS_SUMUP_AFFILIATE', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_SUMUP_APPID", GETPOST('TAKEPOS_SUMUP_APPID', 'alpha'), 'chaine', 0, '', $conf->entity);
}
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
$res = dolibarr_set_const($db, 'TAKEPOS_BARCODE_RULE_TO_INSERT_PRODUCT', GETPOST('TAKEPOS_BARCODE_RULE_TO_INSERT_PRODUCT', 'alpha'), 'chaine', 0, '', $conf->entity);
}
@ -388,7 +388,7 @@ print ajax_constantonoff("TAKEPOS_SHOW_HT", array(), $conf->entity, 0, 0, 1, 0);
print "</td></tr>\n";
// Barcode rule to insert product
if (!empty($conf->barcode->enabled)) {
if (isModEnabled('barcode')) {
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("TakeposBarcodeRuleToInsertProduct"), $langs->trans("TakeposBarcodeRuleToInsertProductDesc"));
print '<td colspan="2">';

View File

@ -128,7 +128,7 @@ if ($action == 'getProducts') {
}
$barcode_rules = getDolGlobalString('TAKEPOS_BARCODE_RULE_TO_INSERT_PRODUCT');
if (!empty($conf->barcode->enabled) && !empty($barcode_rules)) {
if (isModEnabled('barcode') && !empty($barcode_rules)) {
$barcode_rules_list = array();
// get barcode rules