diff --git a/dev/setup/codesniffer/Sniffs/Dolibarr/LanguageOfCommentsSniff.php b/dev/setup/codesniffer/Sniffs/Dolibarr/LanguageOfCommentsSniff.php index 7f5ebaaf850..2b656adad0b 100644 --- a/dev/setup/codesniffer/Sniffs/Dolibarr/LanguageOfCommentsSniff.php +++ b/dev/setup/codesniffer/Sniffs/Dolibarr/LanguageOfCommentsSniff.php @@ -24,7 +24,9 @@ use PHP_CodeSniffer\Files\File; */ class LanguageOfCommentsSniff implements Sniff { - // List of words that betray a comment in French + /** + * @var string[] List of words that betray a comment in French + */ public $frenchWords = [ ' additionner ', ' arrondir ', @@ -102,7 +104,7 @@ class LanguageOfCommentsSniff implements Sniff $contentLower = strtolower($content); // content contains french examples - if (strpos($contentLower, 'france') !== false || strpos($contentLower, 'french')) { + if (strpos($contentLower, 'france') !== false || strpos($contentLower, 'french') || strpos($content, 'fr_FR')) { return; } diff --git a/htdocs/mrp/class/moline.class.php b/htdocs/mrp/class/moline.class.php index 38642ff2d7f..6b426708eb4 100644 --- a/htdocs/mrp/class/moline.class.php +++ b/htdocs/mrp/class/moline.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2020 Lenin Rivas - * Copyright (C) 2023-2025 Frédéric France + * Copyright (C) 2023-2026 Frédéric France * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 William Mead * @@ -197,6 +197,11 @@ class MoLine extends CommonObjectLine */ public $fk_default_workstation; + /** + * @var ?int Id of the child BOM linked to this line (not stored in the line table, set on the fly for display) + */ + public $fk_bom_child; + /** * Constructor * diff --git a/htdocs/mrp/tpl/originproductline.tpl.php b/htdocs/mrp/tpl/originproductline.tpl.php index 4352dc77cfc..9d1378557f7 100644 --- a/htdocs/mrp/tpl/originproductline.tpl.php +++ b/htdocs/mrp/tpl/originproductline.tpl.php @@ -2,7 +2,7 @@ /* Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2017 Charlie Benke * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024-2025 Frédéric France + * Copyright (C) 2024-2026 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 @@ -142,7 +142,7 @@ if ($resql) { $sub_bom_line = new BOMLine($db); $sub_bom_line->fetch($obj->rowid); - //If hidden conf is set, we show directly all the sub-BOM lines + // If hidden conf is set, we show directly all the sub-BOM lines if (!getDolGlobalString('BOM_SHOW_ALL_BOM_BY_DEFAULT')) { print ''; } else { @@ -170,14 +170,14 @@ if ($resql) { // Unit print ''.measuringUnitString($sub_bom_line->fk_unit, '', null, 1).''; - // Stock réel + // Physical Stock if ($sub_bom_product->stock_reel > 0) { print ''.$sub_bom_product->stock_reel.''; } else { print ' '; } - // Stock virtuel + // Virtual stock if ($sub_bom_product->stock_theorique > 0) { print ''.$sub_bom_product->stock_theorique.''; } else { diff --git a/test/phpunit/LangTest.php b/test/phpunit/LangTest.php index 424ad1ac341..0d4ed17f5af 100644 --- a/test/phpunit/LangTest.php +++ b/test/phpunit/LangTest.php @@ -1,8 +1,8 @@ - * Copyright (C) 2023 Alexandre Janniaux - * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France +/* Copyright (C) 2013 Laurent Destailleur + * Copyright (C) 2023 Alexandre Janniaux + * Copyright (C) 2024-2025 MDW + * Copyright (C) 2024-2026 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 @@ -79,6 +79,10 @@ $conf->global->MAIN_DISABLE_ALL_MAILS = 1; * @backupGlobals disabled * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. + * @phan-file-suppress PhanUndeclaredClass + * @phan-file-suppress PhanUndeclaredExtendedClass + * @phan-file-suppress PhanUndeclaredMethod + * @phan-file-suppress PhanUndeclaredProperty */ class LangTest extends CommonClassTest { @@ -122,13 +126,13 @@ class LangTest extends CommonClassTest $newlang->setDefaultLang('fr_FR'); $newlang->load("admin"); - // ErrorModuleRequirePHPVersion is a string than contains accent é and + // ErrorModuleRequirePHPVersion is a string than contains accent é and (french comment) // The ->transnoentities() does not escape nothing into entities. $result = $newlang->transnoentities("ModuleMustBeEnabled", 'éaaa'); print "result=".$result.PHP_EOL; $this->assertEquals('Le module éaaa doit être activé', $result, 'Translation transnoentities ko'); - // ErrorModuleRequirePHPVersion is a string than contains accent é and + // ErrorModuleRequirePHPVersion is a string than contains accent é and (french comment) // The ->trans() escapes content into ModuleMustBeEnabled except b, strong, a, i, br and span tags, // but content of parameters are escaped $result = $newlang->trans("ModuleMustBeEnabled", 'éaaa'); @@ -310,11 +314,11 @@ class LangTest extends CommonClassTest * @param string $dict Dictionary file for translation * @param string $expected Expected translation result * @param string $key Key for translation - * @param ?string $param1 Parameter 1 for translation - * @param ?string $param2 Parameter 2 for translation - * @return string + * @param string $param1 Parameter 1 for translation + * @param string $param2 Parameter 2 for translation + * @return void */ - public function testTrans($description, $langcode, $dict, $expected, $key, $param1 = null, $param2 = null) + public function testTrans($description, $langcode, $dict, $expected, $key, $param1 = '', $param2 = ''): void { global $conf,$user,$langs,$db; $conf = $this->savconf;