Use isModEnabled

This commit is contained in:
Alexandre SPANGARO 2022-09-25 22:53:21 +02:00
parent fee02fa632
commit 1edaa58d88
5 changed files with 21 additions and 21 deletions

View File

@ -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 '<tr>';
print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), !empty($objectsrc->label_incoterms) ? $objectsrc->label_incoterms : '', 1).'</label></td>';
print '<td colspan="3" class="maxwidthonsmartphone">';
@ -3127,7 +3127,7 @@ if ($action == 'create') {
}
// Incoterms
if (!empty($conf->incoterm->enabled)) {
if (isModEnabled('incoterm')) {
print '<tr><td>';
print '<table width="100%" class="nobordernopadding"><tr><td>';
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")) {

View File

@ -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 '<tr>';
print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $soc->label_incoterms, 1).'</label></td>';
print '<td class="maxwidthonsmartphone">';
@ -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 '<tr><td>';
print '<table width="100%" class="nobordernopadding"><tr><td>';
print $langs->trans('IncotermLabel');

View File

@ -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 '<tr>';
print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $objectsrc->label_incoterms, 1).'</label></td>';
print '<td colspan="3" class="maxwidthonsmartphone">';
@ -1628,7 +1628,7 @@ if ($action == 'create') {
print '</td></tr>';
// Incoterms
if (!empty($conf->incoterm->enabled)) {
if (isModEnabled('incoterm')) {
print '<tr><td>';
print '<table width="100%" class="nobordernopadding"><tr><td>';
print $langs->trans('IncotermLabel');

View File

@ -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 '<tr>';
print '<td>'.$form->editfieldkey('IncotermLabel', 'incoterm_id', '', $object, 0).'</td>';
print '<td colspan="3" class="maxwidthonsmartphone">';
@ -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 '<tr>';
print '<td>'.$form->editfieldkey('IncotermLabel', 'incoterm_id', '', $object, 0).'</td>';
print '<td colspan="3" class="maxwidthonsmartphone">';
@ -3084,7 +3084,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
// Incoterms
if (!empty($conf->incoterm->enabled)) {
if (isModEnabled('incoterm')) {
print '<tr><td>';
print '<table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans('IncotermLabel').'</td>';
if ($action != 'editincoterm' && $user->rights->societe->creer) {

View File

@ -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')) {