From fd07c5d6a074bdf6ec089f60c7da2ef94b6e5b8c Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 22:25:37 +0200 Subject: [PATCH] update code --- htdocs/expensereport/card.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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 '';