test fix phan (#33879)

* test fix phan

* test fix phan

* test fix phan

* test fix phan

* test fix phan
This commit is contained in:
Frédéric FRANCE 2025-04-16 19:55:44 +02:00 committed by GitHub
parent 50345daea9
commit 255300a29e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 35 additions and 19 deletions

View file

@ -4,7 +4,7 @@
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2023 Romain Neil <contact@romain-neil.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*
* 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';

View file

@ -4,7 +4,7 @@
* Copyright (C) 2012-2023 Charlene BENKE <charlene@patas-monkey.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
*
* 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 .= '<br>'.$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");

View file

@ -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();

View file

@ -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 '<div class="div-table-responsive-no-min">';
print '<table class="noborder nohover centpercent">';
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Interventions").'</th></tr>'."\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;
}

View file

@ -1,9 +1,9 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2022 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2022 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* 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").'<br><br>';
}
$morehtml = '';
$morehtml .= '<form name="projectform" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
$morehtml = '<form name="projectform" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
$morehtml .= '<input type="hidden" name="token" value="'.newToken().'">';
$morehtml .= '<input type="hidden" name="action" value="refresh_search_project_user">';
$morehtml .= '<SELECT name="search_project_user" id="search_project_user">';
$morehtml .= '<select name="search_project_user" id="search_project_user">';
$morehtml .= '<option name="all" value="0"'.($mine ? '' : ' selected').'>'.$titleall.'</option>';
$morehtml .= '<option name="mine" value="'.$user->id.'"'.(($search_project_user == $user->id) ? ' selected' : '').'>'.$langs->trans("ProjectsImContactFor").'</option>';
$morehtml .= '</SELECT>';
$morehtml .= '</select>';
$morehtml .= ajax_combobox("search_project_user", array(), 0, 0, 'resolve', '-1', 'small');
$morehtml .= '<input type="submit" class="button smallpaddingimp" name="refresh" value="'.$langs->trans("Refresh").'">';
$morehtml .= '</form>';
@ -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 '<div class="fichecenter">';
@ -299,7 +305,7 @@ if ($resql) {
print '<td width="16" class="right nobordernopadding hideonsmartphone">';
$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 '</td></tr></table>';