diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 0b6380ca1b0..5f4c8453bab 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -514,7 +514,7 @@ $tabcond[27] = isModEnabled("societe"); $tabcond[28] = isModEnabled('holiday'); $tabcond[29] = isModEnabled('project'); $tabcond[30] = isModEnabled('label'); -//$tabcond[31]= !empty($conf->accounting->enabled); +//$tabcond[31]= isModEnabled('accounting'); $tabcond[32] = (isModEnabled('holiday') || isModEnabled('hrm')); $tabcond[33] = isModEnabled('hrm'); $tabcond[34] = isModEnabled('hrm'); @@ -2077,7 +2077,7 @@ if ($id > 0) { } elseif (in_array($value, array('recuperableonly'))) { $class = "center"; } elseif ($value == 'accountancy_code' || $value == 'accountancy_code_sell' || $value == 'accountancy_code_buy') { - if (!empty($conf->accounting->enabled)) { + if (isModEnabled('accounting')) { require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; $tmpaccountingaccount = new AccountingAccount($db); $tmpaccountingaccount->fetch(0, $valuetoshow, 1); @@ -2486,7 +2486,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') print ''; } elseif ($value == 'accountancy_code' || $value == 'accountancy_code_sell' || $value == 'accountancy_code_buy') { print ''; - if (!empty($conf->accounting->enabled)) { + if (isModEnabled('accounting')) { $fieldname = $value; $accountancy_account = (!empty($obj->$fieldname) ? $obj->$fieldname : 0); print $formaccounting->select_account($accountancy_account, '.'. $value, 1, '', 1, 1, 'maxwidth200 maxwidthonsmartphone'); diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index c7242085024..f997c44ef6e 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -66,7 +66,7 @@ $conditions = array( 'PRODUCTDESC' => (isModEnabled("product") || isModEnabled("service")), 'DETAILS' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande') || isModEnabled('supplier_proposal') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")), 'USERSIGN' => 1, - 'MAILING' => !empty($conf->mailing->enabled), + 'MAILING' => isModEnabled('mailing'), 'MAIL' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande')), 'TICKET' => !empty($conf->ticket->enabled), ); diff --git a/htdocs/asset/admin/setup.php b/htdocs/asset/admin/setup.php index f36559e4577..67448b0e304 100644 --- a/htdocs/asset/admin/setup.php +++ b/htdocs/asset/admin/setup.php @@ -531,7 +531,7 @@ if ($action == 'edit') { } } elseif ($val['type'] == 'accountancy_code') { $selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname); - if (!empty($conf->accounting->enabled)) { + if (isModEnabled('accounting')) { require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; $formaccounting = new FormAccounting($db); print $formaccounting->select_account($selected, $constname, 1, null, 1, 1, 'minwidth150 maxwidth300', 1); @@ -540,7 +540,7 @@ if ($action == 'edit') { } } elseif ($val['type'] == 'accountancy_category') { $selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname); - if (!empty($conf->accounting->enabled)) { + if (isModEnabled('accounting')) { print ''; // autosuggest from existing account types if found print ''; @@ -637,7 +637,7 @@ if ($action == 'edit') { setEventMessages(null, $object->errors, "errors"); } } elseif ($val['type'] == 'accountancy_code') { - if (!empty($conf->accounting->enabled)) { + if (isModEnabled('accounting')) { require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; $accountingaccount = new AccountingAccount($db); $accountingaccount->fetch('', $conf->global->{$constname}, 1); diff --git a/htdocs/asset/tpl/accountancy_codes_edit.tpl.php b/htdocs/asset/tpl/accountancy_codes_edit.tpl.php index bbd2b3d797c..fa01cbd59bc 100644 --- a/htdocs/asset/tpl/accountancy_codes_edit.tpl.php +++ b/htdocs/asset/tpl/accountancy_codes_edit.tpl.php @@ -34,7 +34,7 @@ if (!is_object($form)) { $form = new Form($db); } -if (!empty($conf->accounting->enabled) && !is_object($formaccounting)) { +if (isModEnabled('accounting') && !is_object($formaccounting)) { require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; $formaccounting = new FormAccounting($db); } @@ -66,7 +66,7 @@ if (empty($reshook)) { $html_name = $mode_key . '_' . $field_key; print '' . $langs->trans($field_info['label']) . ''; $accountancy_code = GETPOSTISSET($html_name) ? GETPOST($html_name, 'aZ09') : (!empty($assetaccountancycodes->accountancy_codes[$mode_key][$field_key]) ? $assetaccountancycodes->accountancy_codes[$mode_key][$field_key] : ''); - if (!empty($conf->accounting->enabled)) { + if (isModEnabled('accounting')) { print $formaccounting->select_account($accountancy_code, $html_name, 1, null, 1, 1, 'minwidth150 maxwidth300', 1); } else { print ''; diff --git a/htdocs/asset/tpl/accountancy_codes_view.tpl.php b/htdocs/asset/tpl/accountancy_codes_view.tpl.php index 0d92ad8eb37..67993291359 100644 --- a/htdocs/asset/tpl/accountancy_codes_view.tpl.php +++ b/htdocs/asset/tpl/accountancy_codes_view.tpl.php @@ -50,7 +50,7 @@ if ($reshook < 0) { } if (empty($reshook)) { - if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; + if (isModEnabled('accounting')) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; foreach ($assetaccountancycodes->accountancy_codes_fields as $mode_key => $mode_info) { //if (empty($object->enabled_modes[$mode_key])) continue; @@ -63,7 +63,7 @@ if (empty($reshook)) { print '' . $langs->trans($field_info['label']) . ''; if (!empty($assetaccountancycodes->accountancy_codes[$mode_key][$field_key])) { $accountancy_code = $assetaccountancycodes->accountancy_codes[$mode_key][$field_key]; - if (!empty($conf->accounting->enabled)) { + if (isModEnabled('accounting')) { $accountingaccount = new AccountingAccount($db); $accountingaccount->fetch('', $accountancy_code, 1); diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index d1cc70b4927..4a3fc28c9de 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -180,7 +180,7 @@ abstract class ActionsContactCardCommon if ($action == 'view' || $action == 'edit' || $action == 'delete') { // Emailing - if (!empty($conf->mailing->enabled)) { + if (isModEnabled('mailing')) { $langs->load("mails"); $this->tpl['nb_emailing'] = $this->object->getNbOfEMailings(); } diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 4712b673ad1..d751cbef511 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -249,7 +249,7 @@ if (empty($reshook)) { $action = 'create'; } - if (!empty($conf->mailing->enabled) && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2 && $object->no_email == -1 && !empty($object->email)) { + if (isModEnabled('mailing') && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2 && $object->no_email == -1 && !empty($object->email)) { $error++; $errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentities("No_Email")); $action = 'create'; @@ -290,7 +290,7 @@ if (empty($reshook)) { } } - if (empty($error) && !empty($conf->mailing->enabled) && !empty($object->email)) { + if (empty($error) && isModEnabled('mailing') && !empty($object->email)) { // Add mass emailing flag into table mailing_unsubscribe $result = $object->setNoEmail($object->no_email); if ($result < 0) { @@ -342,7 +342,7 @@ if (empty($reshook)) { $action = 'edit'; } - if (!empty($conf->mailing->enabled) && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2 && GETPOST("no_email", "int") == -1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { + if (isModEnabled('mailing') && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2 && GETPOST("no_email", "int") == -1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { $error++; $errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentities("No_Email")); $action = 'edit'; @@ -830,7 +830,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; // Unsubscribe - if (!empty($conf->mailing->enabled)) { + if (isModEnabled('mailing')) { if ($conf->use_javascript_ajax && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2) { print "\n".'