update code

This commit is contained in:
Philippe GRAND 2022-08-31 22:25:37 +02:00
parent 162cdcc676
commit fd07c5d6a0

View File

@ -117,7 +117,7 @@ $permissiontoadd = $user->rights->expensereport->creer; // Used by the include o
$upload_dir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($object->ref); $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); $fileRequired = !empty($conf->global->EXPENSEREPORT_FILE_IS_REQUIRED);
if ($object->id > 0) { if ($object->id > 0) {
@ -1697,7 +1697,7 @@ if ($action == 'create') {
// Thirdparty // Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1);
// Project // Project
if (! empty($conf->project->enabled)) if (isModEnabled('project'))
{ {
$langs->load("projects"); $langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
@ -2064,7 +2064,7 @@ if ($action == 'create') {
print '<td class="center linecollinenb">'.$langs->trans('LineNb').'</td>'; print '<td class="center linecollinenb">'.$langs->trans('LineNb').'</td>';
//print '<td class="center">'.$langs->trans('Piece').'</td>'; //print '<td class="center">'.$langs->trans('Piece').'</td>';
print '<td class="center linecoldate">'.$langs->trans('Date').'</td>'; print '<td class="center linecoldate">'.$langs->trans('Date').'</td>';
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
print '<td class="minwidth100imp linecolproject">'.$langs->trans('Project').'</td>'; print '<td class="minwidth100imp linecolproject">'.$langs->trans('Project').'</td>';
} }
print '<td class="center linecoltype">'.$langs->trans('Type').'</td>'; print '<td class="center linecoltype">'.$langs->trans('Type').'</td>';
@ -2109,7 +2109,7 @@ if ($action == 'create') {
print '<td class="center linecoldate">'.dol_print_date($db->jdate($line->date), 'day').'</td>'; print '<td class="center linecoldate">'.dol_print_date($db->jdate($line->date), 'day').'</td>';
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
print '<td class="center dateproject">'; print '<td class="center dateproject">';
if ($line->fk_project > 0) { if ($line->fk_project > 0) {
$projecttmp->id = $line->fk_project; $projecttmp->id = $line->fk_project;
@ -2270,7 +2270,7 @@ if ($action == 'create') {
if ($action == 'editline' && $line->rowid == GETPOST('rowid', 'int')) { if ($action == 'editline' && $line->rowid == GETPOST('rowid', 'int')) {
// Add line with link to add new file or attach line to an existing file // Add line with link to add new file or attach line to an existing file
$colspan = 11; $colspan = 11;
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$colspan++; $colspan++;
} }
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) {
@ -2345,7 +2345,7 @@ if ($action == 'create') {
print '</td>'; print '</td>';
// Select project // Select project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
print '<td>'; print '<td>';
$formproject->select_projects(-1, $line->fk_project, 'fk_project', 0, 0, $projectRequired ? 0 : 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth300'); $formproject->select_projects(-1, $line->fk_project, 'fk_project', 0, 0, $projectRequired ? 0 : 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth300');
print '</td>'; print '</td>';
@ -2418,7 +2418,7 @@ if ($action == 'create') {
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) {
$colspan++; $colspan++;
} }
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$colspan++; $colspan++;
} }
if ($action != 'editline') { if ($action != 'editline') {
@ -2495,7 +2495,7 @@ if ($action == 'create') {
print '<tr class="liste_titre expensereportcreate">'; print '<tr class="liste_titre expensereportcreate">';
print '<td></td>'; print '<td></td>';
print '<td class="center expensereportcreatedate">'.$langs->trans('Date').'</td>'; print '<td class="center expensereportcreatedate">'.$langs->trans('Date').'</td>';
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
print '<td class="minwidth100imp">'.$form->textwithpicto($langs->trans('Project'), $langs->trans("ClosedProjectsAreHidden")).'</td>'; print '<td class="minwidth100imp">'.$form->textwithpicto($langs->trans('Project'), $langs->trans("ClosedProjectsAreHidden")).'</td>';
} }
print '<td class="center expensereportcreatetype">'.$langs->trans('Type').'</td>'; print '<td class="center expensereportcreatetype">'.$langs->trans('Type').'</td>';
@ -2524,7 +2524,7 @@ if ($action == 'create') {
print '</td>'; print '</td>';
// Select project // Select project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
print '<td class="inputproject">'; print '<td class="inputproject">';
$formproject->select_projects(-1, $fk_project, 'fk_project', 0, 0, $projectRequired ? 0 : 1, -1, 0, 0, 0, '', 0, 0, 'maxwidth300'); $formproject->select_projects(-1, $fk_project, 'fk_project', 0, 0, $projectRequired ? 0 : 1, -1, 0, 0, 0, '', 0, 0, 'maxwidth300');
print '</td>'; print '</td>';