diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index 12d647820f4..bd4416e2bd5 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -6924,12 +6924,6 @@ parameters: count: 1 path: ../../../htdocs/core/class/html.formfile.class.php - - - message: '#^If condition is always false\.$#' - identifier: if.alwaysFalse - count: 3 - path: ../../../htdocs/core/class/html.formfile.class.php - - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue @@ -6960,24 +6954,6 @@ parameters: count: 1 path: ../../../htdocs/core/class/html.formfile.class.php - - - message: '#^Ternary operator condition is always false\.$#' - identifier: ternary.alwaysFalse - count: 3 - path: ../../../htdocs/core/class/html.formfile.class.php - - - - message: '#^Variable \$fileinfo might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../../htdocs/core/class/html.formfile.class.php - - - - message: '#^Left side of && is always false\.$#' - identifier: booleanAnd.leftAlwaysFalse - count: 1 - path: ../../../htdocs/core/class/html.formintervention.class.php - - message: '#^Left side of && is always true\.$#' identifier: booleanAnd.leftAlwaysTrue diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index e42b83485ba..3b8744b95ef 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -8,7 +8,7 @@ * Copyright (C) 2014 Marcos García * Copyright (C) 2015 Bahfir Abbes * Copyright (C) 2016-2017 Ferran Marcet - * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2019-2025 Frédéric France * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -1029,10 +1029,10 @@ class FormFile //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current //print ''.$langs->trans("Hash").' : '.$file['share'].''; - $forcedownload = 0; + $forcedownload = getDolGlobalInt('MAIN_FORCE_DOWNLOAD_IN_HTML_FORMFILE'); $paramlink = ''; if (!empty($file['share'])) { - $paramlink .= ($paramlink ? '&' : '').'hashp='.$file['share']; // Hash for public share + $paramlink .= /* ($paramlink ? '&' : ''). */'hashp='.$file['share']; // Hash for public share } if ($forcedownload) { $paramlink .= ($paramlink ? '&' : '').'attachment=1'; @@ -1584,8 +1584,8 @@ class FormFile print ''.dol_print_date($file['date'], "dayhour", "tzuser").''; // Preview + $fileinfo = pathinfo($file['name']); if (empty($useinecm) || $useinecm == 4 || $useinecm == 5 || $useinecm == 6) { - $fileinfo = pathinfo($file['name']); print ''; if (image_format_supported($file['name']) >= 0) { if ($useinecm == 5 || $useinecm == 6) { @@ -1639,10 +1639,10 @@ class FormFile //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current //print ''.$langs->trans("Hash").' : '.$file['share'].''; - $forcedownload = 0; + $forcedownload = getDolGlobalInt('MAIN_FORCE_DOWNLOAD_IN_HTML_FORMFILE'); $paramlink = ''; if (!empty($file['share'])) { - $paramlink .= ($paramlink ? '&' : '').'hashp='.$file['share']; // Hash for public share + $paramlink .= /* ($paramlink ? '&' : ''). */'hashp='.$file['share']; // Hash for public share } if ($forcedownload) { $paramlink .= ($paramlink ? '&' : '').'attachment=1'; @@ -2163,10 +2163,10 @@ class FormFile //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current //print ''.$langs->trans("Hash").' : '.$file['share'].''; - $forcedownload = 0; + $forcedownload = getDolGlobalInt('MAIN_FORCE_DOWNLOAD_IN_HTML_FORMFILE'); $paramlink = ''; if (!empty($file['share'])) { - $paramlink .= ($paramlink ? '&' : '').'hashp='.$file['share']; // Hash for public share + $paramlink .= /* ($paramlink ? '&' : ''). */'hashp='.$file['share']; // Hash for public share } if ($forcedownload) { $paramlink .= ($paramlink ? '&' : '').'attachment=1'; diff --git a/htdocs/core/class/html.formintervention.class.php b/htdocs/core/class/html.formintervention.class.php index 484ff337738..cd01dc3fbce 100644 --- a/htdocs/core/class/html.formintervention.class.php +++ b/htdocs/core/class/html.formintervention.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2025 MDW + * Copyright (C) 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 @@ -24,7 +25,7 @@ */ /** - * Class to manage generation of HTML components for contract module + * Class to manage generation of HTML components for intervention module */ class FormIntervention { @@ -52,7 +53,7 @@ class FormIntervention // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Show a combo list with contracts qualified for a third party + * Show a combo list with interventions qualified for a third party * * @param int $socid Id third party (-1=all, 0=only interventions not linked to a third party, id=intervention not linked or linked to third party id) * @param int $selected Id intervention preselected @@ -69,7 +70,7 @@ class FormIntervention $out = ''; - $hideunselectables = false; + $hideunselectables = getDolGlobalInt('MAIN_SHOW_UNSELECTABLES_IN_SELECT_INTERVENTIONS'); // Search all contacts $sql = "SELECT f.rowid, f.ref, f.fk_soc, f.fk_statut as status"; @@ -86,7 +87,7 @@ class FormIntervention $sql .= " AND f.fk_statut = 0"; } - dol_syslog(get_class($this)."::select_intervention", LOG_DEBUG); + dol_syslog(get_class($this)."::select_interventions", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { $out .= '