diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 7d57575dacd..a849b00a282 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -35,14 +35,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('projet')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } // Load translation files required by the page $langs->loadLangs(array("compta", "banks", "bills", "users", "salaries", "hrm", "trips")); -if (!empty($conf->project->enabled)) { +if (isModEnabled('projet')) { $langs->load("projects"); } @@ -260,7 +260,7 @@ if ($action == 'add' && empty($cancel)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors'); $error++; } - if (!empty($conf->banque->enabled) && !empty($auto_create_paiement) && !$object->accountid > 0) { + if (isModEnabled('banque') && !empty($auto_create_paiement) && !$object->accountid > 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")), null, 'errors'); $error++; } @@ -441,7 +441,7 @@ if ($action == "update_extras" && !empty($user->rights->salaries->read)) { $form = new Form($db); $formfile = new FormFile($db); -if (!empty($conf->project->enabled)) $formproject = new FormProjets($db); +if (isModEnabled('projet')) $formproject = new FormProjets($db); $title = $langs->trans('Salary')." - ".$langs->trans('Card'); $help_url = ""; @@ -559,7 +559,7 @@ if ($action == 'create') { print ''; // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('projet')) { $formproject = new FormProjets($db); print '
| ';
print $langs->trans('DefaultBankAccount');
@@ -922,7 +922,7 @@ if ($id) {
print ' ';
$nbcols = 3;
- if (!empty($conf->banque->enabled)) {
+ if (isModEnabled('banque')) {
$nbcols++;
}
@@ -956,7 +956,7 @@ if ($id) {
print ' '.$langs->trans("RefPayment").' | ';
print ''.$langs->trans("Date").' | ';
print ''.$langs->trans("Type").' | ';
- if (!empty($conf->banque->enabled)) {
+ if (isModEnabled('banque')) {
print ''.$langs->trans('BankAccount').' | ';
}
print ''.$langs->trans("Amount").' | ';
@@ -972,14 +972,14 @@ if ($id) {
print ''.dol_print_date($db->jdate($objp->dp), 'day')." | \n";
$labeltype = $langs->trans("PaymentType".$objp->type_code) != ("PaymentType".$objp->type_code) ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type;
print "".$labeltype.' '.$objp->num_payment." | \n";
- if (!empty($conf->banque->enabled)) {
+ if (isModEnabled('banque')) {
$bankaccountstatic->id = $objp->baid;
$bankaccountstatic->ref = $objp->baref;
$bankaccountstatic->label = $objp->baref;
$bankaccountstatic->number = $objp->banumber;
$bankaccountstatic->currency_code = $objp->bacurrency_code;
- if (!empty($conf->accounting->enabled)) {
+ if (isModEnabled('accounting')) {
$bankaccountstatic->account_number = $objp->account_number;
$accountingjournal = new AccountingJournal($db);
|