diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index e8d86cd9df0..73d656913ff 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2016 Laurent Destailleur * Copyright (C) 2016 Jean-François Ferry * Copyright (C) 2023 Romain Neil - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 MDW * * This program is free software you can redistribute it and/or modify @@ -324,6 +324,7 @@ class Documents extends DolibarrApi public function getDocumentsListByElement($modulepart, $id = 0, $ref = '', $sortfield = '', $sortorder = '') { global $conf; + /** @var Conf $conf */ if (empty($modulepart)) { throw new RestException(400, 'bad value for parameter modulepart'); @@ -580,7 +581,7 @@ class Documents extends DolibarrApi throw new RestException(404, 'Contract not found'); } - $upload_dir = $conf->contrat->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'contract'); + $upload_dir = $conf->contract->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'contract'); } elseif ($modulepart == 'projet' || $modulepart == 'project') { $modulepart = 'project'; require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; @@ -591,7 +592,7 @@ class Documents extends DolibarrApi throw new RestException(404, 'Project not found'); } - $upload_dir = $conf->projet->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'project'); + $upload_dir = $conf->project->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'project'); } elseif ($modulepart == 'mrp') { $modulepart = 'mrp'; require_once DOL_DOCUMENT_ROOT . '/mrp/class/mo.class.php'; diff --git a/htdocs/contrat/ticket.php b/htdocs/contrat/ticket.php index 4c8378c50ee..6a7f939c993 100644 --- a/htdocs/contrat/ticket.php +++ b/htdocs/contrat/ticket.php @@ -4,7 +4,7 @@ * Copyright (C) 2012-2023 Charlene BENKE * Copyright (C) 2024 MDW * Copyright (C) 2024 Alexandre Spangaro - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -147,7 +147,7 @@ $morehtmlref .= $form->editfieldval( // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project -if (! empty($conf->projet->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; $langs->load("projects"); diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index 1e19dc844f5..64c6c2e352b 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -146,7 +146,7 @@ class modProjet extends DolibarrModules 'frequency' => 1, 'unitfrequency' => 86400 * 7, 'status' => 0, - 'test' => '$conf->projet->enabled', + 'test' => 'isModEnabled("project")', ); // Permissions $this->rights = array(); diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index a2f47fffd10..6e3ef81ede7 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -120,18 +120,24 @@ if ($resql) { } $db->free($resql); + include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; /** * @var string $badgeStatus0 * @var string $badgeStatus1 * @var string $badgeStatus2 * @var string $badgeStatus4 */ - include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; + ' + @phan-var-force string $badgeStatus0 + @phan-var-force string $badgeStatus1 + @phan-var-force string $badgeStatus2 + @phan-var-force string $badgeStatus4 + '; print '
'; print ''; print ''."\n"; - $listofstatus = array(Fichinter::STATUS_DRAFT, Fichinter::STATUS_VALIDATED); + $listofstatus = array(Fichinter::STATUS_DRAFT, Fichinter::STATUS_VALIDATED, Fichinter::STATUS_CLOSED); if (getDolGlobalString('FICHINTER_CLASSIFY_BILLED')) { $listofstatus[] = Fichinter::STATUS_BILLED; } @@ -145,6 +151,9 @@ if ($resql) { if ($status == Fichinter::STATUS_VALIDATED) { $colorseries[$status] = $badgeStatus1; } + if ($status == Fichinter::STATUS_CLOSED) { + $colorseries[$status] = $badgeStatus2; + } if ($status == Fichinter::STATUS_BILLED) { $colorseries[$status] = $badgeStatus4; } diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 905deae6c5b..9d34144c00e 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -1,9 +1,9 @@ - * Copyright (C) 2004-2022 Laurent Destailleur - * Copyright (C) 2005-2010 Regis Houssin - * Copyright (C) 2019 Nicolas ZABOURI - * Copyright (C) 2024 Frédéric France +/* Copyright (C) 2001-2005 Rodolphe Quiedeville + * Copyright (C) 2004-2022 Laurent Destailleur + * Copyright (C) 2005-2010 Regis Houssin + * Copyright (C) 2019 Nicolas ZABOURI + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -125,15 +125,14 @@ if ($user->hasRight('projet', 'all', 'lire') && !$socid) { $titleall = $langs->trans("AllAllowedProjects").'

'; } -$morehtml = ''; -$morehtml .= '
'; +$morehtml = ''; $morehtml .= ''; $morehtml .= ''; -$morehtml .= ''; $morehtml .= ''; $morehtml .= ''; -$morehtml .= ''; +$morehtml .= ''; $morehtml .= ajax_combobox("search_project_user", array(), 0, 0, 'resolve', '-1', 'small'); $morehtml .= ''; $morehtml .= ''; @@ -153,6 +152,14 @@ print_barre_liste($form->textwithpicto($title, $htmltooltip), 0, $_SERVER["PHP_S // Get list of ponderated percent and colors for each status include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; +/** + * @var string $badgeStatus0 + * @var string $badgeStatus1 + * @var string $badgeStatus2 + * @var string $badgeStatus4 + * @var string $badgeStatus6 + * @var string $badgeStatus9 + */ // Available from theme_vars: ' @phan-var-force string $badgeStatus0 @@ -211,7 +218,6 @@ if ($resql) { } else { dol_print_error($db); } -//var_dump($listofoppcode); print '
'; @@ -299,7 +305,7 @@ if ($resql) { print '
'.$langs->trans("Statistics").' - '.$langs->trans("Interventions").'
'; $filename = dol_sanitizeFileName($obj->ref); - $filedir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($obj->ref); + $filedir = $conf->project->dir_output.'/'.dol_sanitizeFileName($obj->ref); $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid; print $formfile->getDocumentsLink($projectstatic->element, $filename, $filedir); print '
';