diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php
index 05831c5dd97..25adb1ff232 100644
--- a/htdocs/expensereport/card.php
+++ b/htdocs/expensereport/card.php
@@ -117,7 +117,7 @@ $permissiontoadd = $user->rights->expensereport->creer; // Used by the include o
$upload_dir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($object->ref);
-$projectRequired = $conf->project->enabled && ! empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED);
+$projectRequired = isModEnabled('project') && ! empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED);
$fileRequired = !empty($conf->global->EXPENSEREPORT_FILE_IS_REQUIRED);
if ($object->id > 0) {
@@ -1697,7 +1697,7 @@ if ($action == 'create') {
// Thirdparty
$morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1);
// Project
- if (! empty($conf->project->enabled))
+ if (isModEnabled('project'))
{
$langs->load("projects");
$morehtmlref.='
'.$langs->trans('Project') . ' ';
@@ -2064,7 +2064,7 @@ if ($action == 'create') {
print '
'.$langs->trans('LineNb').' | ';
//print ''.$langs->trans('Piece').' | ';
print ''.$langs->trans('Date').' | ';
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
print ''.$langs->trans('Project').' | ';
}
print ''.$langs->trans('Type').' | ';
@@ -2109,7 +2109,7 @@ if ($action == 'create') {
print ''.dol_print_date($db->jdate($line->date), 'day').' | ';
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
print '';
if ($line->fk_project > 0) {
$projecttmp->id = $line->fk_project;
@@ -2270,7 +2270,7 @@ if ($action == 'create') {
if ($action == 'editline' && $line->rowid == GETPOST('rowid', 'int')) {
// Add line with link to add new file or attach line to an existing file
$colspan = 11;
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$colspan++;
}
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) {
@@ -2345,7 +2345,7 @@ if ($action == 'create') {
print ' | ';
// Select project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
print '';
$formproject->select_projects(-1, $line->fk_project, 'fk_project', 0, 0, $projectRequired ? 0 : 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth300');
print ' | ';
@@ -2418,7 +2418,7 @@ if ($action == 'create') {
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) {
$colspan++;
}
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$colspan++;
}
if ($action != 'editline') {
@@ -2495,7 +2495,7 @@ if ($action == 'create') {
print '';
print ' | ';
print ''.$langs->trans('Date').' | ';
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
print ''.$form->textwithpicto($langs->trans('Project'), $langs->trans("ClosedProjectsAreHidden")).' | ';
}
print ''.$langs->trans('Type').' | ';
@@ -2524,7 +2524,7 @@ if ($action == 'create') {
print '';
// Select project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
print '';
$formproject->select_projects(-1, $fk_project, 'fk_project', 0, 0, $projectRequired ? 0 : 1, -1, 0, 0, 0, '', 0, 0, 'maxwidth300');
print ' | ';