From 0bb5efe0274232dedb56a2deeae3f46d270e69f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 24 Aug 2025 19:53:22 +0200 Subject: [PATCH] add doc (#35040) * add doc * add doc * add doc * add doc * add doc --- dev/build/phpstan/phpstan-baseline.neon | 36 --------------- htdocs/hrm/class/evaluation.class.php | 15 ++++--- htdocs/hrm/class/skillrank.class.php | 50 +++------------------ htdocs/hrm/core/tpl/objectline_view.tpl.php | 17 ++++--- htdocs/hrm/core/tpl/skilldet.fiche.tpl.php | 12 ++++- 5 files changed, 33 insertions(+), 97 deletions(-) diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index 65e14fc4d63..a6250e331bc 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -14202,42 +14202,6 @@ parameters: count: 1 path: ../../../htdocs/hrm/compare.php - - - message: '#^Cannot access property \$db on mixed\.$#' - identifier: property.nonObject - count: 1 - path: ../../../htdocs/hrm/core/tpl/objectline_view.tpl.php - - - - message: '#^Cannot access property \$status on mixed\.$#' - identifier: property.nonObject - count: 1 - path: ../../../htdocs/hrm/core/tpl/objectline_view.tpl.php - - - - message: '#^Variable \$action might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/hrm/core/tpl/objectline_view.tpl.php - - - - message: '#^Variable \$i might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/hrm/core/tpl/objectline_view.tpl.php - - - - message: '#^Variable \$line might not be defined\.$#' - identifier: variable.undefined - count: 12 - path: ../../../htdocs/hrm/core/tpl/objectline_view.tpl.php - - - - message: '#^Variable \$this might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/hrm/core/tpl/objectline_view.tpl.php - - message: '#^Variable \$colwidth might not be defined\.$#' identifier: variable.undefined diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index c31e68f047c..a42f92521b9 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -1,10 +1,10 @@ - * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2021 Greg Rastklan - * Copyright (C) 2021 Jean-Pascal BOUDET - * Copyright (C) 2021 Grégory BLEMAND - * Copyright (C) 2024 Frédéric France +/* Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -996,6 +996,7 @@ class Evaluation extends CommonObject if (class_exists($classname)) { $obj = new $classname(); '@phan-var-force ModeleNumRefEvaluation $obj'; + /** @var ModeleNumRefEvaluation $obj */ $numref = $obj->getNextValue($this); if ($numref != '' && $numref != '-1') { @@ -1028,7 +1029,7 @@ class Evaluation extends CommonObject */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) { - global $conf, $langs; + global $langs; $result = 0; diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index e70775cd7ca..7c170189323 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -1,10 +1,10 @@ - * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2021 Greg Rastklan - * Copyright (C) 2021 Jean-Pascal BOUDET - * Copyright (C) 2021 Grégory BLEMAND - * Copyright (C) 2024 Frédéric France +/* Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -140,43 +140,6 @@ class SkillRank extends CommonObject */ public $rankorder; - - // If this object has a subtable with lines - - // /** - // * @var string Name of subtable line - // */ - // public $table_element_line = 'hrm_skillrankline'; - - // /** - // * @var string Field with ID of parent key if this object has a parent - // */ - // public $fk_element = 'fk_skillrank'; - - // /** - // * @var string Name of subtable class that manage subtable lines - // */ - // public $class_element_line = 'SkillRankline'; - - // /** - // * @var array List of child tables. To test if we can delete object. - // */ - // protected $childtables = array(); - - // /** - // * @var array List of child tables. To know object to delete on cascade. - // * If name matches '@ClassNAme:FilePathClass;ParentFkFieldName' it will - // * call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object - // */ - // protected $childtablesoncascade = array('hrm_skillrankdet'); - - // /** - // * @var SkillRankLine[] Array of subtable lines - // */ - // public $lines = array(); - - - /** * Constructor * @@ -989,6 +952,7 @@ class SkillRank extends CommonObject if (class_exists($classname)) { $obj = new $classname(); '@phan-var-force ModeleNumRefEvaluation $obj'; + /** @var ModeleNumRefEvaluation $obj */ $numref = $obj->getNextValue($this); if ($numref != '' && $numref != '-1') { diff --git a/htdocs/hrm/core/tpl/objectline_view.tpl.php b/htdocs/hrm/core/tpl/objectline_view.tpl.php index 47ac29016b3..cd76854713a 100644 --- a/htdocs/hrm/core/tpl/objectline_view.tpl.php +++ b/htdocs/hrm/core/tpl/objectline_view.tpl.php @@ -11,7 +11,7 @@ * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND * Copyright (C) 2024-2025 MDW - * 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 @@ -31,12 +31,8 @@ * $conf * $langs * $dateSelector - * $forceall (0 by default, 1 for supplier invoices/orders) * $element (used to test $user->rights->$element->creer) * $permtoedit (used to replace test $user->rights->$element->creer) - * $senderissupplier (0 by default, 1 for supplier invoices/orders) - * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax) - * $outputalsopricetotalwithtax * $usemargins (0 to disable all margins columns, 1 to show according to margin setup) * $disableedit, $disablemove, $disableremove * @@ -44,19 +40,22 @@ */ /** + * @var string $action + * @var int $i + * @var int $permissiontoadd + * @var CommonObjectLine $line + * @var CommonObject $this + * @var ?Conf $conf * @var Form $form * @var Translate $langs */ // Protection to avoid direct call of template -if (empty($object) || !is_object($object)) { +if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; exit(1); } -global $mysoc; -global $forceall, $senderissupplier, $inputalsopricewithtax, $outputalsopricetotalwithtax; - // add html5 elements $domData = ' data-element="'.$line->element.'"'; $domData .= ' data-id="'.$line->id.'"'; diff --git a/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php b/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php index 292d4038f31..29023b7d382 100644 --- a/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php +++ b/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php @@ -1,6 +1,6 @@ - * 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 @@ -17,15 +17,23 @@ */ /** + * @var ?Conf $conf + * @var CommonObject $object * @var Form $form * @var Translate $langs * + * @var int $colwidth + * @var int $permission + * @var string $typeofdata + * @var string $moreparam * @var string $note_public * @var string $note_private + * @var string $value_public + * @var string $value_private */ // Protection to avoid direct call of template -if (empty($object) || !is_object($object)) { +if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; exit(1); }