From 1edaa58d880751ea3264ef7bd34decb5c5352c68 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 22:53:21 +0200 Subject: [PATCH] Use isModEnabled --- htdocs/fourn/facture/card.php | 10 +++++----- .../stock/stocktransfer/stocktransfer_card.php | 8 ++++---- htdocs/reception/card.php | 8 ++++---- htdocs/societe/card.php | 14 +++++++------- htdocs/societe/contact.php | 2 +- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 74f8705133b..7033b40cc1c 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -64,7 +64,7 @@ if (isModEnabled('accounting')) { $langs->loadLangs(array('bills', 'compta', 'suppliers', 'companies', 'products', 'banks', 'admin')); -if (!empty($conf->incoterm->enabled)) { +if (isModEnabled('incoterm')) { $langs->load('incoterm'); } @@ -399,7 +399,7 @@ if (empty($reshook)) { } else { $db->commit(); } - } elseif ($action == 'set_incoterms' && !empty($conf->incoterm->enabled)) { + } elseif ($action == 'set_incoterms' && isModEnabled('incoterm')) { // Set incoterm $result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha')); } elseif ($action == 'setmode' && $usercancreate) { @@ -2429,7 +2429,7 @@ if ($action == 'create') { } // Incoterms - if (!empty($conf->incoterm->enabled)) { + if (isModEnabled('incoterm')) { print ''; print ''; print ''; @@ -3127,7 +3127,7 @@ if ($action == 'create') { } // Incoterms - if (!empty($conf->incoterm->enabled)) { + if (isModEnabled('incoterm')) { print ''; print ''; print ''; print '
'; print $langs->trans('IncotermLabel'); @@ -3265,7 +3265,7 @@ if ($action == 'create') { if (isModEnabled("banque")) { $nbrows++; $nbcols++; } - if (!empty($conf->incoterm->enabled)) { + if (isModEnabled('incoterm')) { $nbrows++; } if (isModEnabled("multicurrency")) { diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_card.php b/htdocs/product/stock/stocktransfer/stocktransfer_card.php index 8250006178a..ce8b045a6cd 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_card.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_card.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/stocktransfer/modules_stocktransfe // Load translation files required by the page $langs->loadLangs(array("stocks", "other", "productbatch", "companies")); - if (!empty($conf->incoterm->enabled)) $langs->load('incoterm'); + if (isModEnabled('incoterm')) $langs->load('incoterm'); // Get parameters $id = GETPOST('id', 'int'); @@ -336,7 +336,7 @@ if (empty($reshook)) { } // Set incoterm - if ($action == 'set_incoterms' && !empty($conf->incoterm->enabled) && $permissiontoadd) { + if ($action == 'set_incoterms' && isModEnabled('incoterm') && $permissiontoadd) { $result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha')); } // Actions to send emails @@ -399,7 +399,7 @@ if ($action == 'create') { // Common attributes include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; - if (!empty($conf->incoterm->enabled)) { + if (isModEnabled('incoterm')) { print '
'; @@ -611,7 +611,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; // Incoterms - if (!empty($conf->incoterm->enabled)) { + if (isModEnabled('incoterm')) { print '
'; print ''; print ''; print ''; // Incoterms - if (!empty($conf->incoterm->enabled)) { + if (isModEnabled('incoterm')) { print '
'; print $langs->trans('IncotermLabel'); diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 7d4d58cbc83..d69806f2517 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -65,7 +65,7 @@ if (!empty($conf->project->enabled)) { $langs->loadLangs(array("receptions", "companies", "bills", 'deliveries', 'orders', 'stocks', 'other', 'propal', 'sendings')); -if (!empty($conf->incoterm->enabled)) { +if (isModEnabled('incoterm')) { $langs->load('incoterm'); } if (isModEnabled('productbatch')) { @@ -219,7 +219,7 @@ if (empty($reshook)) { } // Set incoterm - if ($action == 'set_incoterms' && !empty($conf->incoterm->enabled) && $permissiontoadd) { + if ($action == 'set_incoterms' && isModEnabled('incoterm') && $permissiontoadd) { $result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha')); } @@ -893,7 +893,7 @@ if ($action == 'create') { } // Incoterms - if (!empty($conf->incoterm->enabled)) { + if (isModEnabled('incoterm')) { print '
'; @@ -1628,7 +1628,7 @@ if ($action == 'create') { print '
'; print ''; print ''; print ''; print ''; print '
'; print $langs->trans('IncotermLabel'); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index ee058f8685f..3670aca416b 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -74,7 +74,7 @@ if (isModEnabled('adherent')) { if (isModEnabled('categorie')) { $langs->load("categories"); } -if (!empty($conf->incoterm->enabled)) { +if (isModEnabled('incoterm')) { $langs->load("incoterm"); } if (isModEnabled('notification')) { @@ -537,7 +537,7 @@ if (empty($reshook)) { } // Incoterms - if (!empty($conf->incoterm->enabled)) { + if (isModEnabled('incoterm')) { $object->fk_incoterms = GETPOST('incoterm_id', 'int'); $object->location_incoterms = GETPOST('location_incoterms', 'alpha'); } @@ -938,7 +938,7 @@ if (empty($reshook)) { } // Set incoterm - if ($action == 'set_incoterms' && $user->rights->societe->creer && !empty($conf->incoterm->enabled)) { + if ($action == 'set_incoterms' && $user->rights->societe->creer && isModEnabled('incoterm')) { $object->fetch($socid); $result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha')); } @@ -1812,7 +1812,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Incoterms - if (!empty($conf->incoterm->enabled)) { + if (isModEnabled('incoterm')) { print '
'.$form->editfieldkey('IncotermLabel', 'incoterm_id', '', $object, 0).''; @@ -2042,7 +2042,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } //Incoterms - if (!empty($conf->incoterm->enabled)) { + if (isModEnabled('incoterm')) { $object->fk_incoterms = GETPOST('incoterm_id', 'int'); $object->location_incoterms = GETPOST('lcoation_incoterms', 'alpha'); } @@ -2562,7 +2562,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Incoterms - if (!empty($conf->incoterm->enabled)) { + if (isModEnabled('incoterm')) { print '
'.$form->editfieldkey('IncotermLabel', 'incoterm_id', '', $object, 0).''; @@ -3084,7 +3084,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Incoterms - if (!empty($conf->incoterm->enabled)) { + if (isModEnabled('incoterm')) { print '
'; print ''; if ($action != 'editincoterm' && $user->rights->societe->creer) { diff --git a/htdocs/societe/contact.php b/htdocs/societe/contact.php index 90267403a16..f477935d994 100644 --- a/htdocs/societe/contact.php +++ b/htdocs/societe/contact.php @@ -53,7 +53,7 @@ $langs->loadLangs(array("companies", "commercial", "bills", "banks", "users")); if (isModEnabled('categorie')) { $langs->load("categories"); } -if (!empty($conf->incoterm->enabled)) { +if (isModEnabled('incoterm')) { $langs->load("incoterm"); } if (isModEnabled('notification')) {
'.$langs->trans('IncotermLabel').'