diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 4eb95d298c5..8f023432727 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -50,8 +50,6 @@ $action = GETPOST('action', 'alpha'); // Parameters ACCOUNTING_* and others $list = array ( - //'ACCOUNTING_LIMIT_LIST_VENTILATION', Useless, we can change value dynamically, so we use default global setup - 'ACCOUNTING_MANAGE_ZERO', 'ACCOUNTING_LENGTH_GACCOUNT', 'ACCOUNTING_LENGTH_AACCOUNT' , 'ACCOUNTING_LENGTH_DESCRIPTION', // adjust size displayed for lines description for dol_trunc @@ -85,13 +83,11 @@ if ($action == 'update') { $error ++; } - if (! $error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { + if ($error) { setEventMessages($langs->trans("Error"), null, 'errors'); } - foreach ( $list as $constname ) { + foreach ($list as $constname) { $constvalue = GETPOST($constname, 'alpha'); if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { @@ -259,41 +255,37 @@ if (! empty($user->admin)) print ''; } print ''; + + $var = ! $var; + print ""; + print '' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . ''; + if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + } else { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; + } + print ''; } // Param a user $user->rights->accountancy->chartofaccount can access -foreach ( $list as $key ) { +foreach ($list as $key) +{ $var = ! $var; - if ($key != 'ACCOUNTING_MANAGE_ZERO') - { - print ''; - // Param - $label = $langs->trans($key); - print ''.$label.''; - // Value - print ''; - print ''; - print ''; - print ''; - } - if ($key == 'ACCOUNTING_MANAGE_ZERO') - { - $var = ! $var; - print ""; - print '' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . ''; - if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; - } else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; - } - print ''; - } + print ''; + // Param + $label = $langs->trans($key); + print ''.$label.''; + // Value + print ''; + print ''; + print ''; + print ''; } @@ -302,10 +294,6 @@ print ''; - - - - dol_fiche_end(); print '
';