From bc92afe403b25ca2c5dd8db8245914e759f0318c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 1 Sep 2025 22:27:36 +0200 Subject: [PATCH] add doc (#35168) * add doc * add doc * add doc * add doc * add doc * add doc * add doc --- dev/build/phpstan/phpstan-baseline.neon | 6 ---- htdocs/comm/action/index.php | 44 ++++++++++++++++++------- 2 files changed, 32 insertions(+), 18 deletions(-) diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index 7da5d40851c..9444300cfd6 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -2814,12 +2814,6 @@ parameters: count: 1 path: ../../../htdocs/comm/action/index.php - - - message: '#^Variable \$theme_datacolor might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/comm/action/index.php - - message: '#^Variable \$socid might not be defined\.$#' identifier: variable.undefined diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 46f6afd5a42..b3060cac0ff 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1,12 +1,12 @@ - * Copyright (C) 2003 Eric Seigne - * Copyright (C) 2004-2018 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2014 Cedric GROSS - * Copyright (C) 2015 Marcos García - * Copyright (C) 2017 Open-DSI +/* Copyright (C) 2001-2004 Rodolphe Quiedeville + * Copyright (C) 2003 Eric Seigne + * Copyright (C) 2004-2018 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2014 Cedric GROSS + * Copyright (C) 2015 Marcos García + * Copyright (C) 2017 Open-DSI * Copyright (C) 2021-2025 Frédéric France * Copyright (C) 2024-2025 MDW * @@ -1580,15 +1580,30 @@ $maxnbofchar = 0; $cachethirdparties = array(); $cachecontacts = array(); $cacheusers = array(); +// default values +$theme_datacolor = array( + array(137, 86, 161), + array(60, 147, 183), + array(250, 190, 80), + array(80, 166, 90), + array(190, 190, 100), + array(91, 115, 247), + array(140, 140, 220), + array(190, 120, 120), + array(115, 125, 150), + array(100, 170, 20), + array(150, 135, 125), + array(85, 135, 150), + array(150, 135, 80), + array(150, 80, 150) +); // Define theme_datacolor array $color_file = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/theme_vars.inc.php"; if (is_readable($color_file)) { + global $theme_datacolor; include $color_file; - /** @var array $theme_datacolor */ -} -if (!is_array($theme_datacolor)) { - $theme_datacolor = array(array(137, 86, 161), array(60, 147, 183), array(250, 190, 80), array(80, 166, 90), array(190, 190, 100), array(91, 115, 247), array(140, 140, 220), array(190, 120, 120), array(115, 125, 150), array(100, 170, 20), array(150, 135, 125), array(85, 135, 150), array(150, 135, 80), array(150, 80, 150)); + /** @var array $theme_datacolor */ } $massactionbutton = ''; @@ -1911,6 +1926,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa '@phan-var-force array{0:array{0:int,1:int,2:int},1:array{0:int,1:int,2:int},2:array{0:int,1:int,2:int},3:array{0:int,1:int,2:int}} $theme_datacolor @phan-var-force User[] $cacheusers @phan-var-force array> $colorindexused'; + /** + * @var array{0:array{0:int,1:int,2:int},1:array{0:int,1:int,2:int},2:array{0:int,1:int,2:int},3:array{0:int,1:int,2:int}} $theme_datacolor + * @var User[] $cacheusers + * @var array> $colorindexused + */ if ($conf->use_javascript_ajax) { // Enable the "Show more button..." $conf->global->MAIN_JS_SWITCH_AGENDA = 1;