diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php
index e9310fab792..d0a0ab671d4 100644
--- a/htdocs/accountancy/admin/export.php
+++ b/htdocs/accountancy/admin/export.php
@@ -239,7 +239,7 @@ if (!$conf->use_javascript_ajax) {
} else {
print '
';
$listmodelcsv = $accountancyexport->getType();
- print $form->selectarray("ACCOUNTING_EXPORT_MODELCSV", $listmodelcsv, $conf->global->ACCOUNTING_EXPORT_MODELCSV, 0, 0, 0, '', 0, 0, 0, '', '', 1);
+ print $form->selectarray("ACCOUNTING_EXPORT_MODELCSV", $listmodelcsv, getDolGlobalString('ACCOUNTING_EXPORT_MODELCSV'), 0, 0, 0, '', 0, 0, 0, '', '', 1);
print ' ';
}
diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php
index 8dd004fcc35..4bc6d50de89 100644
--- a/htdocs/accountancy/bookkeeping/list.php
+++ b/htdocs/accountancy/bookkeeping/list.php
@@ -207,7 +207,7 @@ if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
$accountancyexport = new AccountancyExport($db);
$listofformat = $accountancyexport->getType();
-$formatexportset = $conf->global->ACCOUNTING_EXPORT_MODELCSV;
+$formatexportset = getDolGlobalString('ACCOUNTING_EXPORT_MODELCSV');
if (empty($listofformat[$formatexportset])) {
$formatexportset = 1;
}
diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php
index e7496c08db8..1369c5667a8 100644
--- a/htdocs/admin/commande.php
+++ b/htdocs/admin/commande.php
@@ -661,7 +661,7 @@ if ($conf->banque->enabled) {
}
// Ask for warehouse during order
-if ($conf->stock->enabled) {
+if (isModEnabled('stock')) {
print '';
print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").' ';
if (! empty($conf->use_javascript_ajax)) {
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index 5b033fc11f7..a3ce1738fac 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -1244,7 +1244,7 @@ class Expedition extends CommonObject
$mouvS->origin = null;
// get lot/serial
$lotArray = null;
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
$lotArray = $shipmentlinebatch->fetchAll($obj->expeditiondet_id);
if (!is_array($lotArray)) {
$error++;
@@ -2781,7 +2781,7 @@ class ExpeditionLigne extends CommonObjectLine
$this->db->begin();
// delete batch expedition line
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."expeditiondet_batch";
$sql .= " WHERE fk_expeditiondet = ".((int) $this->id);
diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php
index 16249087403..f6aba7f2597 100644
--- a/htdocs/mrp/mo_production.php
+++ b/htdocs/mrp/mo_production.php
@@ -747,7 +747,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
}
print ' ';
- if ($conf->stock->enabled) {
+ if (isModEnabled('stock')) {
// Available
print '';
if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) {
@@ -756,7 +756,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print ' ';
}
// Lot - serial
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print '';
if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) {
print $langs->trans("Batch");
@@ -787,11 +787,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print ' ';
print ' ';
print ' ';
- if ($conf->stock->enabled) {
+ if (isModEnabled('stock')) {
print ' ';
}
// Lot - serial
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print ' ';
}
// Action
@@ -909,7 +909,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '';
print ' ';
// Stock
- if ($conf->stock->enabled) {
+ if (isModEnabled('stock')) {
print '';
if ($tmpproduct->stock_reel < ($line->qty - $alreadyconsumed)) {
print img_warning($langs->trans('StockTooLow')).' ';
@@ -918,7 +918,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print ' ';
}
// Lot
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print ' ';
}
// Action delete line
@@ -965,12 +965,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '';
// Stock
- if ($conf->stock->enabled) {
+ if (isModEnabled('stock')) {
print ' ';
}
// Lot Batch
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print '';
if ($line2['batch'] != '') {
$tmpbatch->fetch(0, $line2['fk_product'], $line2['batch']);
@@ -1033,12 +1033,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print ' ';
// Stock
- if ($conf->stock->enabled) {
+ if (isModEnabled('stock')) {
print ' ';
}
// Lot / Batch
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print '';
if ($tmpproduct->status_batch) {
$preselected = (GETPOSTISSET('batch-'.$line->id.'-'.$i) ? GETPOST('batch-'.$line->id.'-'.$i) : '');
@@ -1121,7 +1121,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print $langs->trans("Warehouse");
}
print ' ';
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print '';
if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) {
print $langs->trans("Batch");
@@ -1149,7 +1149,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print ' ';
print ' ';
// Lot - serial
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print ' ';
}
// Action
@@ -1236,7 +1236,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '';
print ''; // Warehouse
print ' ';
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print ' '; // Lot
}
@@ -1277,7 +1277,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
}
print '';
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print '';
if ($line2['batch'] != '') {
$tmpbatch->fetch(0, $line2['fk_product'], $line2['batch']);
@@ -1324,7 +1324,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print ''.$langs->trans("NoStockChangeOnServices").' ';
}
print ' ';
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print '';
if ($tmpproduct->status_batch) {
$preselected = (GETPOSTISSET('batchtoproduce-'.$line->id.'-'.$i) ? GETPOST('batchtoproduce-'.$line->id.'-'.$i) : '');
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index a1b450f7a0c..733d2202313 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -1860,7 +1860,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ' ';
// Batch number managment
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
if ($object->isProduct() || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
print ''.$langs->trans("ManageLotSerial").' ';
$statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"), '2' => $langs->trans("ProductStatusOnSerial"));
diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php
index 80823c7ba5a..e0e2f9c59da 100644
--- a/htdocs/product/inventory/class/inventory.class.php
+++ b/htdocs/product/inventory/class/inventory.class.php
@@ -308,7 +308,7 @@ class Inventory extends CommonObject
$inventoryline->batch = $obj->batch;
$inventoryline->datec = dol_now();
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
$inventoryline->qty_stock = ($obj->batch ? $obj->qty : $obj->reel); // If there is batch detail, we take qty for batch, else global qty
} else {
$inventoryline->qty_stock = $obj->reel;
diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php
index e0e191fc5d1..85848942fbe 100644
--- a/htdocs/product/stock/massstockmove.php
+++ b/htdocs/product/stock/massstockmove.php
@@ -569,7 +569,7 @@ print ' ';
print getTitleFieldOfList($langs->trans('WarehouseSource'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
print getTitleFieldOfList($langs->trans('WarehouseTarget'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
print getTitleFieldOfList($langs->trans('ProductRef'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
-if ($conf->productbatch->enabled) {
+if (isModEnabled('productbatch')) {
print getTitleFieldOfList($langs->trans('Batch'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
}
print getTitleFieldOfList($langs->trans('Qty'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'center tagtd maxwidthonsmartphone ');
@@ -601,7 +601,7 @@ print img_picto($langs->trans("Product"), 'product', 'class="paddingright"');
print $form->select_produits($id_product, 'productid', $filtertype, $limit, 0, -1, 2, '', 1, array(), 0, '1', 0, 'minwidth200imp maxwidth300', 1, '', null, 1);
print '';
// Batch number
-if ($conf->productbatch->enabled) {
+if (isModEnabled('productbatch')) {
print '';
print img_picto($langs->trans("LotSerial"), 'lot', 'class="paddingright"');
print ' ';
@@ -643,7 +643,7 @@ foreach ($listofdata as $key => $val) {
print ' ';
print $productstatic->getNomUrl(1).' - '.$productstatic->label;
print ' ';
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print '';
print $val['batch'];
print ' ';
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index 3054e6785bd..6af0e105b47 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -631,7 +631,7 @@ if ($id > 0 || $ref) {
print ' ';
}
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print ''.$langs->trans("ManageLotSerial").' ';
print $object->getLibStatut(0, 2);
print ' ';
diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_card.php b/htdocs/product/stock/stocktransfer/stocktransfer_card.php
index b88df4e1da1..b009ace7275 100644
--- a/htdocs/product/stock/stocktransfer/stocktransfer_card.php
+++ b/htdocs/product/stock/stocktransfer/stocktransfer_card.php
@@ -749,7 +749,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '';
print getTitleFieldOfList($langs->trans('ProductRef'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print getTitleFieldOfList($langs->trans('Batch'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
}
print getTitleFieldOfList($langs->trans('WarehouseSource'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
@@ -789,7 +789,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if ($action === 'editline' && $line->id == $lineid) $form->select_produits($line->fk_product, 'fk_product', $filtertype, $limit, 0, -1, 2, '', 0, array(), 0, 0, 0, 'minwidth200imp maxwidth300', 1);
else print $productstatic->getNomUrl(1).' - '.$productstatic->label;
print '';
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print '';
if ($action === 'editline' && $line->id == $lineid) print ' ';
else {
@@ -883,7 +883,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$form->select_produits($fk_product, 'fk_product', $filtertype, $limit, 0, -1, 2, '', 0, array(), 0, 0, 0, 'minwidth200imp maxwidth300', 1);
print ' ';
// Batch number
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
print '';
print ' ';
print ' ';
diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php
index 9c0d3b01136..ed4586a7376 100644
--- a/htdocs/reception/card.php
+++ b/htdocs/reception/card.php
@@ -1244,7 +1244,7 @@ if ($action == 'create') {
if (!empty($extrafields)) {
//var_dump($line);
$colspan = 5;
- if ($conf->productbatch->enabled) {
+ if (isModEnabled('productbatch')) {
$colspan += 3;
}
$recLine = new CommandeFournisseurDispatch($db);