FIX php8 compatibility

This commit is contained in:
Philippe GRAND 2022-08-24 10:22:06 +02:00
parent db3f37f416
commit 74c5892e4c

View File

@ -26,7 +26,7 @@ require '../main.inc.php';
// Class
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
}
@ -76,7 +76,7 @@ if ($action == 'update') {
llxHeader();
$form = new Form($db);
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$formaccounting = new FormAccounting($db);
}
@ -100,14 +100,14 @@ foreach ($list as $key) {
// Param
$label = $langs->trans($key);
print '<td><label for="'.$key.'">'.$label.'</label></td>';
print '<td><label for="' . $key . '">' . $label . '</label></td>';
// Value
print '<td>';
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
print $formaccounting->select_account(getDolGlobalString($key), $key, 1, '', 1, 1);
} 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) . '">';
}
print '</td></tr>';
}