Use isModEnabled

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

View File

@ -388,7 +388,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 + $top_shift : 10);
// Incoterm
if (!empty($conf->incoterm->enabled)) {
if (isModEnabled('incoterm')) {
$desc_incoterms = $object->getIncotermsForPDF();
if ($desc_incoterms) {
$tab_top -= 2;

View File

@ -52,7 +52,7 @@ if (isModEnabled('project')) {
// Load translation files required by the page
$langs->loadLangs(array('bills', 'deliveries', 'orders', 'sendings'));
if (!empty($conf->incoterm->enabled)) {
if (isModEnabled('incoterm')) {
$langs->load('incoterm');
}
@ -186,7 +186,7 @@ if ($action == 'setdate_delivery' && $user->rights->expedition->delivery->creer)
if ($result < 0) {
$mesg = '<div class="error">'.$object->error.'</div>';
}
} elseif ($action == 'set_incoterms' && !empty($conf->incoterm->enabled)) {
} elseif ($action == 'set_incoterms' && isModEnabled('incoterm')) {
// Set incoterm
$result = $object->setIncoterms((int) GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha'));
}
@ -451,7 +451,7 @@ if ($action == 'create') {
print '</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

@ -65,7 +65,7 @@ if (isModEnabled('project')) {
// Load translation files required by the page
$langs->loadLangs(array("sendings", "companies", "bills", 'deliveries', 'orders', 'stocks', 'other', 'propal'));
if (!empty($conf->incoterm->enabled)) {
if (isModEnabled('incoterm')) {
$langs->load('incoterm');
}
if (isModEnabled('productbatch')) {
@ -164,7 +164,7 @@ if (empty($reshook)) {
}
// Set incoterm
if ($action == 'set_incoterms' && !empty($conf->incoterm->enabled)) {
if ($action == 'set_incoterms' && isModEnabled('incoterm')) {
$result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha'));
}
@ -1009,7 +1009,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"), $object->label_incoterms, 1).'</label></td>';
print '<td colspan="3" class="maxwidthonsmartphone">';
@ -1982,7 +1982,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

@ -161,7 +161,7 @@ if (empty($reshook)) {
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
} 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'));
if ($result < 0) {
@ -523,7 +523,7 @@ if ($id > 0 || !empty($ref)) {
// TODO How record was recorded OrderMode (llx_c_input_method)
// 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 (isModEnabled('variants')) {
// Load translation files required by the page
$langs->loadLangs(array('admin', 'orders', 'sendings', 'companies', 'bills', 'propal', 'receptions', 'supplier_proposal', 'deliveries', 'products', 'stocks', 'productbatch'));
if (!empty($conf->incoterm->enabled)) {
if (isModEnabled('incoterm')) {
$langs->load('incoterm');
}
@ -1777,7 +1777,7 @@ if ($action == 'create') {
}
// Incoterms
if (!empty($conf->incoterm->enabled)) {
if (isModEnabled('incoterm')) {
$fkincoterms = (!empty($object->fk_incoterms) ? $object->fk_incoterms : ($socid > 0 ? $societe->fk_incoterms : ''));
$locincoterms = (!empty($object->location_incoterms) ? $object->location_incoterms : ($socid > 0 ? $societe->location_incoterms : ''));
print '<tr>';
@ -2290,7 +2290,7 @@ if ($action == 'create') {
print '</td></tr>';
// Incoterms
if (!empty($conf->incoterm->enabled)) {
if (isModEnabled('incoterm')) {
print '<tr><td>';
print '<table class="nobordernopadding centpercent"><tr><td>';
print $langs->trans('IncotermLabel');
@ -2373,7 +2373,7 @@ if ($action == 'create') {
print '</table>';
// Margin Infos
/*if (!empty($conf->margin->enabled)) {
/*if (isModEnabled('margin')) {
$formmargin->displayMarginInfos($object);
}*/