diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index c4f78b7f91fc2..5a31f520a1779 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 MDW + * Copyright (C) 2024 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 @@ -290,9 +291,9 @@ public function parser($urlRSS, $maxNb = 0, $cachedelay = 60, $cachedir = '') xml_set_object($xmlparser, $this); // @phan-suppress-next-line PhanUndeclaredFunctionInCallable - xml_set_element_handler($xmlparser, 'feed_start_element', 'feed_end_element'); + xml_set_element_handler($xmlparser, 'feed_start_element', 'feed_end_element'); // @phpstan-ignore-line // @phan-suppress-next-line PhanUndeclaredFunctionInCallable - xml_set_character_data_handler($xmlparser, 'feed_cdata'); + xml_set_character_data_handler($xmlparser, 'feed_cdata'); // @phpstan-ignore-line $status = xml_parse($xmlparser, $str, false); diff --git a/htdocs/core/lib/phpsessionindb.lib.php b/htdocs/core/lib/phpsessionindb.lib.php index f856ac71c90b7..65db9c661e27a 100644 --- a/htdocs/core/lib/phpsessionindb.lib.php +++ b/htdocs/core/lib/phpsessionindb.lib.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 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 @@ -244,4 +245,4 @@ function dolSessionGC($max_lifetime) } // Call to register user call back functions. -session_set_save_handler("dolSessionOpen", "dolSessionClose", "dolSessionRead", "dolSessionWrite", "dolSessionDestroy", "dolSessionGC"); +session_set_save_handler("dolSessionOpen", "dolSessionClose", "dolSessionRead", "dolSessionWrite", "dolSessionDestroy", "dolSessionGC"); // @phpstan-ignore-line diff --git a/htdocs/core/modules/propale/mod_propale_saphir.php b/htdocs/core/modules/propale/mod_propale_saphir.php index 91772195411ab..bd940a8089af3 100644 --- a/htdocs/core/modules/propale/mod_propale_saphir.php +++ b/htdocs/core/modules/propale/mod_propale_saphir.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2007 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) + * Copyright (C) 2024 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 @@ -106,19 +107,20 @@ public function info($langs) */ public function getExample() { - global $conf, $langs, $mysoc; + global $mysoc, $db; - $old_code_client = $mysoc->code_client; - $old_code_type = $mysoc->typent_code; - $mysoc->code_client = 'CCCCCCCCCC'; - $mysoc->typent_code = 'TTTTTTTTTT'; - $numExample = $this->getNextValue($mysoc, ''); - $mysoc->code_client = $old_code_client; - $mysoc->typent_code = $old_code_type; + require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php'; + require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; + $propal = new Propal($db); + $propal->initAsSpecimen(); + $thirdparty = new Societe($db); + $thirdparty->initAsSpecimen(); + $numExample = $this->getNextValue($thirdparty, $propal); if (!$numExample) { $numExample = 'NotConfigured'; } + return $numExample; } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index ab0b41fb7d8e9..5896b5be52746 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -4502,6 +4502,7 @@ public function initAsSpecimen() $this->code_client = 'CC-'.dol_print_date($now, 'dayhourlog'); $this->code_fournisseur = 'SC-'.dol_print_date($now, 'dayhourlog'); + $this->typent_code = 'TE_OTHER'; $this->capital = 10000; $this->client = 1; $this->prospect = 1; diff --git a/phpstan.neon.dist b/phpstan.neon.dist index eabf59c877197..18152a68b0b62 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -96,7 +96,9 @@ parameters: - '#expects Adherent#' - '#expects BOM#' - '#expects Commande#' + - '#expects Contact#' - '#expects Contrat#' + - '#expects Delivery#' - '#expects Expedition#' - '#expects FTP\\Connection#' - '#expects Holiday#' @@ -106,8 +108,10 @@ parameters: - '#expects Product#' - '#expects Facture#' - '#expects Paiement#' + - '#expects Project#' - '#expects PgSql\\Result#' - '#expects RecruitmentJobPosition#' + - '#expects RemiseCheque#' - '#expects Societe#' - '#expects SupplierProposal#' - '#expects Ticket#'