Use isModEnabled

This commit is contained in:
Alexandre SPANGARO 2022-08-29 10:52:37 +02:00
parent bf735600bf
commit 78c2d859f4

View File

@ -27,7 +27,7 @@ require '../../main.inc.php';
// Class // Class
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php';
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
} }
@ -83,7 +83,7 @@ if (preg_match('/^(set|del)_?([A-Z_]+)$/', $action, $reg)) {
llxHeader('', $langs->trans('SalariesSetup')); llxHeader('', $langs->trans('SalariesSetup'));
$form = new Form($db); $form = new Form($db);
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$formaccounting = new FormAccounting($db); $formaccounting = new FormAccounting($db);
} }
@ -119,7 +119,7 @@ foreach ($list as $key) {
// Value // Value
print '<td>'; print '<td>';
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
print $formaccounting->select_account(getDolGlobalString($key), $key, 1, '', 1, 1); print $formaccounting->select_account(getDolGlobalString($key), $key, 1, '', 1, 1);
} else { } else {
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">'; print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';