diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index a7d946f5ec7..f8b3215e083 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2014-2017 Olivier Geffroy * Copyright (C) 2015-2022 Alexandre Spangaro * Copyright (C) 2015-2020 Florian Henry - * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -1723,7 +1723,7 @@ class BookKeeping extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -1753,6 +1753,8 @@ class BookKeeping extends CommonObject $this->journal_label = 'Journal de vente'; $this->piece_num = 1234; $this->date_creation = $now; + + return 1; } /** diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index b0a9d88eaef..44f51ff9aca 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2016 Charlie Benke * Copyright (C) 2018-2019 Thibault Foucart * Copyright (C) 2021 Waël Almoman + * 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 @@ -883,7 +884,7 @@ class AdherentType extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -907,6 +908,8 @@ class AdherentType extends CommonObject $this->members = array( $user->id => $user ); + + return 1; } /** diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 38da4658d25..4b468a5633c 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2018 Alexandre Spangaro + * 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 @@ -1508,7 +1509,7 @@ class Asset extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -1516,7 +1517,7 @@ class Asset extends CommonObject // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/asset/class/assetmodel.class.php b/htdocs/asset/class/assetmodel.class.php index 0694ae75fd6..12132d4b65a 100644 --- a/htdocs/asset/class/assetmodel.class.php +++ b/htdocs/asset/class/assetmodel.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2021 Open-Dsi + * 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 @@ -774,7 +775,7 @@ class AssetModel extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -782,7 +783,7 @@ class AssetModel extends CommonObject // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index e36415b4077..ba88dfff476 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2019 Laurent Destailleur * Copyright (C) 2023 Benjamin Falière * Copyright (C) 2023 Charlene Benke + * 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 @@ -1368,13 +1369,15 @@ class BOM extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { $this->initAsSpecimenCommon(); $this->ref = 'BOM-123'; $this->date_creation = dol_now() - 20000; + + return 1; } @@ -2128,10 +2131,10 @@ class BOMLine extends CommonObjectLine * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } } diff --git a/htdocs/bookcal/class/availabilities.class.php b/htdocs/bookcal/class/availabilities.class.php index 5e9ffe56f5c..a839ae3e52c 100644 --- a/htdocs/bookcal/class/availabilities.class.php +++ b/htdocs/bookcal/class/availabilities.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2022 Alice Adminson + * 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 @@ -926,7 +927,7 @@ class Availabilities extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -934,7 +935,7 @@ class Availabilities extends CommonObject // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/bookcal/class/calendar.class.php b/htdocs/bookcal/class/calendar.class.php index 5f7352bd493..eec383501db 100644 --- a/htdocs/bookcal/class/calendar.class.php +++ b/htdocs/bookcal/class/calendar.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2023 Frédéric France + * Copyright (C) 2023-2024 Frédéric France * Copyright (C) 2023 Alice Adminson * * This program is free software; you can redistribute it and/or modify @@ -915,7 +915,7 @@ class Calendar extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -923,7 +923,7 @@ class Calendar extends CommonObject // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index b16a0608680..1f901d7381e 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -2078,7 +2078,7 @@ class Categorie extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -2092,6 +2092,8 @@ class Categorie extends CommonObject $this->description = 'This is a description'; $this->socid = 1; $this->type = self::TYPE_PRODUCT; + + return 1; } /** diff --git a/htdocs/comm/action/class/actioncommreminder.class.php b/htdocs/comm/action/class/actioncommreminder.class.php index 81d6249eaad..4880e42300d 100644 --- a/htdocs/comm/action/class/actioncommreminder.class.php +++ b/htdocs/comm/action/class/actioncommreminder.class.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 @@ -264,10 +265,10 @@ class ActionCommReminder extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index f7c25ae4545..39c01663d93 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -13,7 +13,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018-2021 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2022 ATM Consulting * Copyright (C) 2022 OpenDSI @@ -3598,7 +3598,7 @@ class Propal extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -3683,6 +3683,8 @@ class Propal extends CommonObject $xnbp++; } + + return 1; } /** diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index e7f81eb8af5..d89d3b39dfb 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -11,7 +11,7 @@ * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2016-2022 Ferran Marcet - * Copyright (C) 2021-2023 Frédéric France + * Copyright (C) 2021-2024 Frédéric France * Copyright (C) 2022 Gauthier VERDOL * * This program is free software; you can redistribute it and/or modify @@ -3972,7 +3972,7 @@ class Commande extends CommonOrder * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -4056,6 +4056,8 @@ class Commande extends CommonOrder $xnbp++; } + + return 1; } diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index d6568fb9855..980139ac752 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -9,7 +9,7 @@ * Copyright (C) 2015-2017 Alexandre Spangaro * Copyright (C) 2016 Ferran Marcet * Copyright (C) 2019 JC Prieto - * Copyright (C) 2022-2023 Frédéric France + * Copyright (C) 2022-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 @@ -1851,7 +1851,7 @@ class Account extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -1876,6 +1876,8 @@ class Account extends CommonObject $this->owner_town = 'Owner town'; $this->owner_country_id = 'Owner country_id'; $this->country_id = 1; + + return 1; } /** diff --git a/htdocs/compta/bank/class/bankcateg.class.php b/htdocs/compta/bank/class/bankcateg.class.php index ad9d08b9fbc..ae96f872ce9 100644 --- a/htdocs/compta/bank/class/bankcateg.class.php +++ b/htdocs/compta/bank/class/bankcateg.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2008 Laurent Destailleur * Copyright (C) 2009 Regis Houssin * Copyright (C) 2016 Marcos García + * 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 @@ -354,11 +355,13 @@ class BankCateg // extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { $this->id = 0; $this->label = ''; + + return 1; } } diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 81f5e8e6320..33ac0d8f817 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2018-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 @@ -402,7 +402,7 @@ class PaymentVarious extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -419,6 +419,8 @@ class PaymentVarious extends CommonObject $this->fk_bank = 0; $this->fk_user_author = 0; $this->fk_user_modif = 0; + + return 1; } /** diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 14e090339bb..50317b0ece3 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2013 Florian Henry * Copyright (C) 2015 Marcos García - * Copyright (C) 2017-2023 Frédéric France + * Copyright (C) 2017-2024 Frédéric France * Copyright (C) 2023 Nick Fragoulis * * This program is free software; you can redistribute it and/or modify @@ -1710,7 +1710,7 @@ class FactureRec extends CommonInvoice * id must be 0 if object instance is a specimen. * * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines - * @return void + * @return int */ public function initAsSpecimen($option = '') { @@ -1830,6 +1830,8 @@ class FactureRec extends CommonInvoice } $this->usenewprice = 0; + + return 1; } /** diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index fc0ff165cd2..3f12e4e045f 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -21,6 +21,7 @@ * Copyright (C) 2023 Gauthier VERDOL * Copyright (C) 2023 Nick Fragoulis * 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 @@ -4996,7 +4997,7 @@ class Facture extends CommonInvoice * id must be 0 if object instance is a specimen. * * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines - * @return void + * @return int */ public function initAsSpecimen($option = '') { @@ -5145,6 +5146,8 @@ class Facture extends CommonInvoice $this->lines[$xnbp] = $line; $xnbp++; } + + return 1; } /** diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index 5d665921bc9..f23c8131d9f 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.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 @@ -432,7 +433,7 @@ class PaymentTerm // extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -446,5 +447,7 @@ class PaymentTerm // extends CommonObject $this->type_cdr = ''; $this->nbjour = ''; $this->decalage = ''; + + return 1; } } diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index ffc1c3314fb..579890f9b38 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.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 @@ -320,7 +321,7 @@ class Localtax extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -338,6 +339,8 @@ class Localtax extends CommonObject $this->fk_bank = 0; $this->fk_user_creat = $user->id; $this->fk_user_modif = $user->id; + + return 1; } diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index a659a0b460a..2be5b322d69 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2011-2016 Juanjo Menent * Copyright (C) 2015 Marcos García + * 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 @@ -872,7 +873,7 @@ class RemiseCheque extends CommonObject * id must be 0 if object instance is a specimen. * * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines - * @return void + * @return int */ public function initAsSpecimen($option = '') { @@ -887,6 +888,8 @@ class RemiseCheque extends CommonObject $this->ref = 'SPECIMEN'; $this->specimen = 1; $this->date_bordereau = $nownotime; + + return 1; } /** diff --git a/htdocs/compta/paiement/class/cpaiement.class.php b/htdocs/compta/paiement/class/cpaiement.class.php index 8b77c745061..a8a49ca43d3 100644 --- a/htdocs/compta/paiement/class/cpaiement.class.php +++ b/htdocs/compta/paiement/class/cpaiement.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2023 Frédéric France + * Copyright (C) 2023-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 @@ -360,7 +360,7 @@ class Cpaiement extends CommonDict * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -372,5 +372,7 @@ class Cpaiement extends CommonDict $this->active = 1; $this->accountancy_code = ''; $this->module = ''; + + return 1; } } diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index b9fb85f148b..013c0fcebad 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -8,7 +8,7 @@ * Copyright (C) 2015 Juanjo Menent * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2018 Thibault FOUCART - * Copyright (C) 2018-2022 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2020 Andreu Bisquerra Gaya * Copyright (C) 2021 OpenDsi * Copyright (C) 2023 Joachim Kueter @@ -1258,7 +1258,7 @@ class Paiement extends CommonObject * id must be 0 if object instance is a specimen. * * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines - * @return void + * @return int */ public function initAsSpecimen($option = '') { @@ -1274,6 +1274,8 @@ class Paiement extends CommonObject $this->specimen = 1; $this->facid = 1; $this->datepaye = $nownotime; + + return 1; } diff --git a/htdocs/compta/sociales/class/cchargesociales.class.php b/htdocs/compta/sociales/class/cchargesociales.class.php index 287dda0dcb2..5141708f815 100644 --- a/htdocs/compta/sociales/class/cchargesociales.class.php +++ b/htdocs/compta/sociales/class/cchargesociales.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud + * 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 @@ -514,7 +515,7 @@ class Cchargesociales * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -527,6 +528,8 @@ class Cchargesociales $this->fk_pays = 0; $this->module = ''; $this->accountancy_code = ''; + + return 1; } /** diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 066e007ad16..e81d5b80e5d 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2007 Laurent Destailleur - * Copyright (C) 2016-2022 Frédéric France + * Copyright (C) 2016-2024 Frédéric France * Copyright (C) 2017 Alexandre Spangaro * Copyright (C) 2021 Gauthier VERDOL * @@ -737,7 +737,7 @@ class ChargeSociales extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -754,6 +754,8 @@ class ChargeSociales extends CommonObject $this->label = 'Social contribution label'; $this->type = 1; $this->type_label = 'Type of social contribution'; + + return 1; } /** diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 13844252901..2a724f56d42 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2002 Rodolphe Quiedeville * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2022 Alexandre Spangaro + * 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 @@ -527,7 +528,7 @@ class PaymentSocialContribution extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -544,6 +545,8 @@ class PaymentSocialContribution extends CommonObject $this->fk_bank = 0; $this->fk_user_creat = 0; $this->fk_user_modif = 0; + + return 1; } diff --git a/htdocs/compta/tva/class/paymentvat.class.php b/htdocs/compta/tva/class/paymentvat.class.php index 0d2d82b0dd0..f45cc80e909 100644 --- a/htdocs/compta/tva/class/paymentvat.class.php +++ b/htdocs/compta/tva/class/paymentvat.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2002 Rodolphe Quiedeville * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2021 Gauthier VERDOL + * 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 @@ -530,7 +531,7 @@ class PaymentVAT extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -547,6 +548,8 @@ class PaymentVAT extends CommonObject $this->fk_bank = 0; $this->fk_user_creat = 0; $this->fk_user_modif = 0; + + return 1; } diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 568fea68048..9b6081e6d7f 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2011-2017 Alexandre Spangaro * Copyright (C) 2018 Philippe Grand - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2021 Gauthier VERDOL * * This program is free software; you can redistribute it and/or modify @@ -413,7 +413,7 @@ class Tva extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -428,6 +428,8 @@ class Tva extends CommonObject $this->fk_bank = 0; $this->fk_user_creat = 0; $this->fk_user_modif = 0; + + return 1; } diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 65cf34dcaeb..9b6752305a7 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -11,6 +11,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2020 Open-Dsi + * 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 @@ -1683,6 +1684,7 @@ class Contact extends CommonObject $this->socid = $socid; $this->statut = 1; + return 1; } diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 66f4aad8596..8139d7aa755 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -9,7 +9,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2015-2018 Ferran Marcet * Copyright (C) 2024 William Mead * Copyright (C) 2024 MDW @@ -2442,7 +2442,7 @@ class Contrat extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -2507,6 +2507,8 @@ class Contrat extends CommonObject $this->lines[$xnbp] = $line; $xnbp++; } + + return 1; } /** diff --git a/htdocs/core/class/cgenericdic.class.php b/htdocs/core/class/cgenericdic.class.php index 7e163c56acb..9c617d9c78d 100644 --- a/htdocs/core/class/cgenericdic.class.php +++ b/htdocs/core/class/cgenericdic.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2014-2016 Juanjo Menent * Copyright (C) 2016 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud + * 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 @@ -471,7 +472,7 @@ class CGenericDic extends CommonDict * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -480,5 +481,7 @@ class CGenericDic extends CommonDict $this->code = 'CODE'; $this->label = 'Label'; $this->active = 1; + + return 1; } } diff --git a/htdocs/core/class/ctyperesource.class.php b/htdocs/core/class/ctyperesource.class.php index 717b7c43ec6..5d839fb0f26 100644 --- a/htdocs/core/class/ctyperesource.class.php +++ b/htdocs/core/class/ctyperesource.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2014-2016 Juanjo Menent * Copyright (C) 2016 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud + * 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 @@ -425,7 +426,7 @@ class Ctyperesource extends CommonDict * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -434,6 +435,8 @@ class Ctyperesource extends CommonDict $this->code = ''; $this->label = ''; $this->active = 0; + + return 1; } } diff --git a/htdocs/core/class/defaultvalues.class.php b/htdocs/core/class/defaultvalues.class.php index acd56ec12a5..8389630123a 100644 --- a/htdocs/core/class/defaultvalues.class.php +++ b/htdocs/core/class/defaultvalues.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2021 Florian HENRY - * Copyright (C) 2021 Frédéric France + * Copyright (C) 2021-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 @@ -346,10 +346,10 @@ class DefaultValues extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } } diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 6f8157ca22c..bb597cb713b 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005 Rodolphe Quiedeville * Copyright (C) 2004-2018 Laurent Destailleur * Copyright (C) 2024 Alexandre Janniaux + * 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 @@ -731,7 +732,7 @@ class DiscountAbsolute extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -742,5 +743,7 @@ class DiscountAbsolute extends CommonObject $this->amount_ttc = 11.96; $this->tva_tx = 19.6; $this->description = 'Specimen discount'; + + return 1; } } diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index 2370ceaaad6..ec1eea0116c 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) ---Put here your own copyright and developer email--- + * 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 @@ -371,11 +372,11 @@ class EmailSenderProfile extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } } diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index 104a99d2f3d..a5dc47bb64c 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2007-2019 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2023 William Mead + * 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 @@ -305,7 +306,7 @@ class Events // extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -318,5 +319,7 @@ class Events // extends CommonObject $this->ip = '1.2.3.4'; $this->user_agent = 'Mozilla specimen User Agent X.Y'; $this->prefix_session = dol_getprefix(); + + return 1; } } diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index b86ee41f60f..ebda232e331 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2009-2012 Regis Houssin - * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2018-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 @@ -478,7 +478,7 @@ class Menubase * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -499,6 +499,8 @@ class Menubase $this->enabled = ''; $this->user = 0; $this->tms = dol_now(); + + return 1; } diff --git a/htdocs/core/class/timespent.class.php b/htdocs/core/class/timespent.class.php index 1c5868176c7..36cedd67896 100644 --- a/htdocs/core/class/timespent.class.php +++ b/htdocs/core/class/timespent.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2023 Frédéric France + * Copyright (C) 2023-2024 Frédéric France * Copyright (C) 2023 Gauthier VERDOL * * This program is free software; you can redistribute it and/or modify @@ -923,15 +923,15 @@ class TimeSpent extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - // Set here init that are not commonf fields + // Set here init that are not common fields // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 9644153c2e4..eea29c83601 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2007-2022 Laurent Destailleur * Copyright (C) 2013 Florian Henry * Copyright (C) 2023-2024 William Mead + * 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 @@ -934,7 +935,7 @@ class Cronjob extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -972,6 +973,8 @@ class Cronjob extends CommonObject $this->nbrun = 0; $this->maxrun = 100; $this->libname = ''; + + return 1; } diff --git a/htdocs/datapolicy/class/datapolicycron.class.php b/htdocs/datapolicy/class/datapolicycron.class.php index 3dc187455fb..d83e4534acd 100644 --- a/htdocs/datapolicy/class/datapolicycron.class.php +++ b/htdocs/datapolicy/class/datapolicycron.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2024 William Mead * * This program is free software: you can redistribute it and/or modify @@ -486,7 +486,7 @@ class DataPolicyCron if ($object->isObjectUsed($obj->rowid) == 0) { // If object to clean is used foreach ($params['fields_anonym'] as $field => $val) { if ($val == 'MAKEANONYMOUS') { - $object->$field = $field.'-anonymous-'.$obj->rowid; + $object->$field = $field.'-anonymous-'.$obj->rowid; // @phpstan-ignore-line } else { $object->$field = $val; } diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index a5017547c34..6e634bfb669 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -965,7 +965,7 @@ class Delivery extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -1012,6 +1012,8 @@ class Delivery extends CommonObject $line->total_ht = 100; $this->lines[$i] = $line; + + return 1; } /** diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 19cc0ed8dee..dbdd5caf745 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2015-2017 Alexandre Spangaro * Copyright (C) 2016 Juanjo Menent * Copyright (C) 2019 Thibault FOUCART - * Copyright (C) 2019-2020 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2021 Maxime DEMAREST * * This program is free software; you can redistribute it and/or modify @@ -234,7 +234,7 @@ class Don extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -283,7 +283,9 @@ class Don extends CommonObject $this->email = 'email@email.com'; $this->phone = '0123456789'; $this->phone_mobile = '0606060606'; - $this->statut = 1; + $this->status = 1; + + return 1; } diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php index 6720301d326..3d5a1e9071f 100644 --- a/htdocs/don/class/paymentdonation.class.php +++ b/htdocs/don/class/paymentdonation.class.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 @@ -540,7 +541,7 @@ class PaymentDonation extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -558,6 +559,8 @@ class PaymentDonation extends CommonObject $this->fk_bank = 0; $this->fk_user_creat = dol_now(); $this->fk_user_modif = dol_now(); + + return 1; } diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 6e73b229858..905eabdb5c1 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2008-2012 Regis Houssin + * 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 @@ -450,7 +451,7 @@ class EcmDirectory extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -459,6 +460,8 @@ class EcmDirectory extends CommonObject $this->label = 'MyDirectory'; $this->fk_parent = 0; $this->description = 'This is a directory'; + + return 1; } diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index 5e1c0107cfa..ce77414b31b 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2018 Francis Appels - * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2019-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 @@ -957,7 +957,7 @@ class EcmFiles extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -983,6 +983,8 @@ class EcmFiles extends CommonObject $this->acl = ''; $this->src_object_type = 'product'; $this->src_object_id = 1; + + return 1; } } diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 86672a0f225..bffa405796e 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.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 @@ -698,14 +699,14 @@ class EmailCollector extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { $this->host = 'localhost'; $this->login = 'alogin'; - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/emailcollector/class/emailcollectoraction.class.php b/htdocs/emailcollector/class/emailcollectoraction.class.php index 6a49ee7fa87..bdefd8a1f87 100644 --- a/htdocs/emailcollector/class/emailcollectoraction.class.php +++ b/htdocs/emailcollector/class/emailcollectoraction.class.php @@ -1,6 +1,7 @@ * Copyright (C) ---Put here your own copyright and developer email--- + * 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 @@ -449,10 +450,10 @@ class EmailCollectorAction extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } } diff --git a/htdocs/emailcollector/class/emailcollectorfilter.class.php b/htdocs/emailcollector/class/emailcollectorfilter.class.php index 6618633a6b3..52acc3440d7 100644 --- a/htdocs/emailcollector/class/emailcollectorfilter.class.php +++ b/htdocs/emailcollector/class/emailcollectorfilter.class.php @@ -1,6 +1,7 @@ * Copyright (C) ---Put here your own copyright and developer email--- + * 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 @@ -463,10 +464,10 @@ class EmailCollectorFilter extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } } diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index d71fc6b2a9f..69cfcbf7b23 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -1,6 +1,7 @@ * Copyright (C) ---Put here your own copyright and developer email--- + * 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 @@ -749,11 +750,11 @@ class ConferenceOrBooth extends ActionComm * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index eecb06e137c..6df9bad4a72 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -1,6 +1,7 @@ * Copyright (C) ---Put here your own copyright and developer email--- + * 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 @@ -946,11 +947,11 @@ class ConferenceOrBoothAttendee extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index d5d689618d8..4704baf9bb3 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -11,7 +11,7 @@ * Copyright (C) 2015 Claudio Aschieri * Copyright (C) 2016-2022 Ferran Marcet * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2020 Lenin Rivas * * This program is free software; you can redistribute it and/or modify @@ -2003,7 +2003,7 @@ class Expedition extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -2055,6 +2055,8 @@ class Expedition extends CommonObject $this->lines[] = $line; $xnbp++; } + + return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 46b7706d4f6..38d86dc15c7 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2015 Laurent Destailleur * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (c) 2018-2023 Frédéric France + * Copyright (c) 2018-2024 Frédéric France * Copyright (C) 2016-2020 Ferran Marcet * * This program is free software; you can redistribute it and/or modify @@ -876,7 +876,7 @@ class ExpenseReport extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -898,7 +898,6 @@ class ExpenseReport extends CommonObject $type_fees_id = 2; // TF_TRIP $this->status = 5; - $this->fk_statut = 5; $this->fk_user_author = $user->id; $this->fk_user_validator = $user->id; @@ -932,6 +931,8 @@ class ExpenseReport extends CommonObject $this->total_tva += $line->total_tva; $this->total_ttc += $line->total_ttc; } + + return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index ca7da95f824..09ea23d79c1 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2018 Nicolas ZABOURI + * 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 @@ -495,7 +496,7 @@ class PaymentExpenseReport extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -512,6 +513,8 @@ class PaymentExpenseReport extends CommonObject $this->fk_bank = 0; $this->fk_user_creat = 0; $this->fk_user_modif = 0; + + return 1; } diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 6e8195ac3d9..0b29b094202 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2015-2020 Charlene Benke * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2023-2024 William Mead * * This program is free software; you can redistribute it and/or modify @@ -1401,7 +1401,7 @@ class Fichinter extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -1433,6 +1433,8 @@ class Fichinter extends CommonObject $this->duration += $line->duration; } + + return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php index f81c1812b1c..9e529651f8a 100644 --- a/htdocs/fichinter/class/fichinterrec.class.php +++ b/htdocs/fichinter/class/fichinterrec.class.php @@ -8,6 +8,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2016-2018 Charlie Benke * Copyright (C) 2024 William Mead + * 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 @@ -304,7 +305,7 @@ class FichinterRec extends Fichinter $obj = $this->db->fetch_object($result); $this->id = $rowid; - $this->title = $obj->title; + $this->title = $obj->title; $this->ref = $obj->title; $this->description = $obj->description; $this->datec = $obj->datec; @@ -674,7 +675,7 @@ class FichinterRec extends Fichinter * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -685,6 +686,8 @@ class FichinterRec extends Fichinter parent::initAsSpecimen(); $this->usenewprice = 1; + + return 1; } /** diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 7a3ecf3dae6..2e128bcd7ec 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -9,7 +9,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2018-2022 Ferran Marcet * Copyright (C) 2021 Josep Lluís Amador * Copyright (C) 2022 Gauthier VERDOL @@ -3079,7 +3079,7 @@ class CommandeFournisseur extends CommonOrder * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -3156,6 +3156,8 @@ class CommandeFournisseur extends CommonOrder $xnbp++; } + + return 1; } /** diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index b8bc60a463d..2b415cfc936 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2014 Juanjo Menent + * 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 @@ -619,7 +620,7 @@ class CommandeFournisseurDispatch extends CommonObjectLine * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -638,6 +639,8 @@ class CommandeFournisseurDispatch extends CommonObjectLine $this->batch = ''; $this->eatby = ''; $this->sellby = ''; + + return 1; } /** diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php index 820c92baa11..f592f36ea9f 100644 --- a/htdocs/fourn/class/fournisseur.facture-rec.class.php +++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2013 Florian Henry * Copyright (C) 2015 Marcos García - * Copyright (C) 2017-2020 Frédéric France + * Copyright (C) 2017-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 @@ -1651,7 +1651,7 @@ class FactureFournisseurRec extends CommonInvoice * id must be 0 if object instance is a specimen. * * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines - * @return void + * @return int */ public function initAsSpecimen($option = '') { @@ -1771,6 +1771,8 @@ class FactureFournisseurRec extends CommonInvoice } $this->usenewprice = 0; + + return 1; } /** diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 887b5ab425f..87af56e106c 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -12,7 +12,7 @@ * Copyright (C) 2015-2022 Ferran Marcet * Copyright (C) 2016-2023 Alexandre Spangaro * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2022 Gauthier VERDOL * Copyright (C) 2023 Nick Fragoulis * @@ -2989,7 +2989,7 @@ class FactureFournisseur extends CommonInvoice * id must be 0 if object instance is a specimen. * * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines - * @return void + * @return int */ public function initAsSpecimen($option = '') { @@ -3077,9 +3077,11 @@ class FactureFournisseur extends CommonInvoice } } - $this->total_ht = $xnbp * 100; - $this->total_tva = $xnbp * 19.6; - $this->total_ttc = $xnbp * 119.6; + $this->total_ht = $xnbp * 100; + $this->total_tva = $xnbp * 19.6; + $this->total_ttc = $xnbp * 119.6; + + return 1; } /** diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 7a33f41eb06..132af79c05f 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -9,6 +9,7 @@ * Copyright (C) 2018 Frédéric France * Copyright (C) 2023 Joachim Kueter * Copyright (C) 2023 Sylvain Legrand + * 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 @@ -725,7 +726,7 @@ class PaiementFourn extends Paiement * id must be 0 if object instance is a specimen. * * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines - * @return void + * @return int */ public function initAsSpecimen($option = '') { @@ -740,6 +741,8 @@ class PaiementFourn extends Paiement $this->facid = 1; $this->socid = 1; $this->datepaye = $nownotime; + + return 1; } /** diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 6d22e0a915d..b778a22466d 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2012-2016 Regis Houssin * Copyright (C) 2013 Florian Henry * Copyright (C) 2016 Juanjo Menent - * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2018-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 @@ -2344,7 +2344,7 @@ class Holiday extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -2364,6 +2364,8 @@ class Holiday extends CommonObject $this->fk_type = 1; $this->statut = Holiday::STATUS_VALIDATED; $this->status = Holiday::STATUS_VALIDATED; + + return 1; } /** diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index 291546f253b..6825247be89 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2018-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 @@ -541,12 +541,14 @@ class Establishment extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { $this->id = 0; $this->ref = '0'; $this->label = 'Department AAA'; + + return 1; } } diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index c900f583cb4..be133e09c62 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2021 Greg Rastklan * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND + * 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 @@ -906,7 +907,7 @@ class Evaluation extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -914,7 +915,7 @@ class Evaluation extends CommonObject // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php index 6e9099a2f73..216b5ff1704 100644 --- a/htdocs/hrm/class/evaluationdet.class.php +++ b/htdocs/hrm/class/evaluationdet.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2021 Greg Rastklan * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND + * 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 @@ -874,7 +875,7 @@ class EvaluationLine extends CommonObjectLine * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -882,7 +883,7 @@ class EvaluationLine extends CommonObjectLine // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index 34f0960cb94..743a5f75e02 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2021 Greg Rastklan * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND + * 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 @@ -914,7 +915,7 @@ class Job extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -922,7 +923,7 @@ class Job extends CommonObject // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index 4577c13ba33..14fe2f18be4 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2021 Greg Rastklan * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND + * 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 @@ -956,7 +957,7 @@ class Position extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -964,7 +965,7 @@ class Position extends CommonObject // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index 3eed59b8665..6d3be881130 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2021 Greg Rastklan * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND + * 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 @@ -955,7 +956,7 @@ class Skill extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -963,7 +964,7 @@ class Skill extends CommonObject // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index 78318fc1514..8865aa94db8 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2021 Greg Rastklan * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND + * 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 @@ -864,7 +865,7 @@ class Skilldet extends CommonObjectLine * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -872,7 +873,7 @@ class Skilldet extends CommonObjectLine // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index c66a86c5e0d..788cf2a1ded 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2021 Greg Rastklan * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND + * 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 @@ -912,7 +913,7 @@ class SkillRank extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -920,7 +921,7 @@ class SkillRank extends CommonObject // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index b8148c97f43..5e8011fd645 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.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 @@ -958,12 +959,13 @@ class KnowledgeRecord extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { $this->question = "ABCD"; - $this->initAsSpecimenCommon(); + + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index 89b7a974854..3eb5b1bdc45 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2015-2023 Frédéric France + * Copyright (C) 2015-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 @@ -609,7 +609,7 @@ class Loan extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -631,6 +631,8 @@ class Loan extends CommonObject $this->capital = 20000; $this->nbterm = 48; $this->rate = 4.3; + + return 1; } /** diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index cf83e9228d7..c0363bbc5b6 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2023 Frédéric France + * Copyright (C) 2023-2024 Frédéric France * Copyright (C) ---Put here your own copyright and developer email--- * * This program is free software; you can redistribute it and/or modify @@ -1118,7 +1118,7 @@ class MyObject extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -1126,7 +1126,7 @@ class MyObject extends CommonObject // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index eb72e1cdaab..24595cab867 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -1589,13 +1589,15 @@ class Mo extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + $ret = $this->initAsSpecimenCommon(); $this->lines = array(); + + return $ret; } /** diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 538b9df3268..e69330ceddd 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2014 Marcos García - * Copyright (C) 2020-2024 Frédéric France + * Copyright (C) 2020-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 @@ -615,7 +615,7 @@ class Opensurveysondage extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -630,6 +630,8 @@ class Opensurveysondage extends CommonObject $this->status = 1; $this->format = 'classic'; $this->mailsonde = 0; + + return 1; } /** diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 811697a1216..f3779321a51 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2021 NextGestion + * 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 @@ -1161,11 +1162,11 @@ class Partnership extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/partnership/class/partnership_type.class.php b/htdocs/partnership/class/partnership_type.class.php index f02aa2c011c..06f7ab7b35c 100644 --- a/htdocs/partnership/class/partnership_type.class.php +++ b/htdocs/partnership/class/partnership_type.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2016 Charlie Benke * Copyright (C) 2018-2019 Thibault Foucart * Copyright (C) 2021 Waël Almoman + * 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 @@ -415,7 +416,7 @@ class PartnershipType extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -423,6 +424,6 @@ class PartnershipType extends CommonObject // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 1cfc859b2b9..262fbeaeb6c 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -14,7 +14,7 @@ * Copyright (C) 2014 Ion agorria * Copyright (C) 2016-2018 Ferran Marcet * Copyright (C) 2017 Gustavo Novaro - * Copyright (C) 2019-2023 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2023 Benjamin Falière * * This program is free software; you can redistribute it and/or modify @@ -6341,7 +6341,7 @@ class Product extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -6380,6 +6380,8 @@ class Product extends CommonObject $this->volume_units = 0; $this->barcode = -1; // Create barcode automatically + + return 1; } /** diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php index 5f5987b439f..a447910fe5d 100644 --- a/htdocs/product/class/productbatch.class.php +++ b/htdocs/product/class/productbatch.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2013-2014 Cedric GROSS + * 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 @@ -335,7 +336,7 @@ class Productbatch extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -347,6 +348,8 @@ class Productbatch extends CommonObject $this->eatby = ''; $this->batch = ''; $this->import_key = ''; + + return 1; } /** diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 2c63a76b059..a32fea0c6b6 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2014 Florian Henry + * 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 @@ -1000,7 +1001,7 @@ class ProductCustomerPrice extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -1024,6 +1025,8 @@ class ProductCustomerPrice extends CommonObject $this->localtax2_tx = ''; $this->fk_user = 0; $this->import_key = ''; + + return 1; } } diff --git a/htdocs/product/class/productfournisseurprice.class.php b/htdocs/product/class/productfournisseurprice.class.php index 6812ce9f498..e178fce18e3 100644 --- a/htdocs/product/class/productfournisseurprice.class.php +++ b/htdocs/product/class/productfournisseurprice.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2021 Alexis LAURIER + * 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 @@ -779,11 +780,11 @@ class ProductFournisseurPrice extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index a16edd1f53f..965a251a1f0 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2015 Florian HENRY + * 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 @@ -547,7 +548,7 @@ class Propalmergepdfproduct extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -560,6 +561,8 @@ class Propalmergepdfproduct extends CommonObject $this->datec = ''; $this->tms = dol_now(); $this->import_key = ''; + + return 1; } } diff --git a/htdocs/product/dynamic_price/class/price_expression.class.php b/htdocs/product/dynamic_price/class/price_expression.class.php index 5a0fa5243ff..ef99ef8603c 100644 --- a/htdocs/product/dynamic_price/class/price_expression.class.php +++ b/htdocs/product/dynamic_price/class/price_expression.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2007-2012 Laurent Destailleur * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Ion Agorria + * 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 @@ -325,11 +326,13 @@ class PriceExpression * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { $this->id = 0; $this->expression = ''; + + return 1; } } diff --git a/htdocs/product/dynamic_price/class/price_global_variable.class.php b/htdocs/product/dynamic_price/class/price_global_variable.class.php index 13cf5233342..6b81d780c49 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable.class.php @@ -281,7 +281,7 @@ class PriceGlobalVariable * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -289,6 +289,8 @@ class PriceGlobalVariable $this->code = ''; $this->description = ''; $this->value = ''; + + return 1; } /** diff --git a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php index d36c0477bf4..42030aa290e 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php @@ -306,7 +306,7 @@ class PriceGlobalVariableUpdater * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -318,6 +318,8 @@ class PriceGlobalVariableUpdater $this->update_interval = 0; $this->next_update = 0; $this->last_status = ''; + + return 1; } /** diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index ae477dafd8e..d20e7336110 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2014-2016 Juanjo Menent * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud + * 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 @@ -739,12 +740,14 @@ class Inventory extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + $ret = $this->initAsSpecimenCommon(); $this->title = ''; + + return $ret; } /** diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 010d657cb93..c3106759f8e 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2008 Regis Houssin * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2016 Francis Appels - * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2019-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 @@ -841,7 +841,7 @@ class Entrepot extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -862,6 +862,8 @@ class Entrepot extends CommonObject $this->town = 'MyTown'; $this->country_id = 1; $this->country_code = 'FR'; + + return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 6b310bdac1a..80751ebbec7 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2011 Jean Heimburger * Copyright (C) 2014 Cedric GROSS * 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 @@ -1066,16 +1067,16 @@ class MouvementStock extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { - global $user, $langs, $conf, $mysoc; - // Initialize parameters $this->id = 0; // There is no specific properties. All data into insert are provided as method parameter. + + return 1; } /** diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index cd4dca967dc..28f8b53c88b 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2018-2022 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2023 Gauthier VERDOL * * This program is free software; you can redistribute it and/or modify @@ -1205,7 +1205,7 @@ class Productlot extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -1228,6 +1228,8 @@ class Productlot extends CommonObject $this->fk_user_creat = 0; $this->fk_user_modif = 0; $this->import_key = '123456'; + + return 1; } /** diff --git a/htdocs/product/stock/class/productstockentrepot.class.php b/htdocs/product/stock/class/productstockentrepot.class.php index 7d9e7c07d2b..f4dbdca4a75 100644 --- a/htdocs/product/stock/class/productstockentrepot.class.php +++ b/htdocs/product/stock/class/productstockentrepot.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2014-2016 Juanjo Menent * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-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 @@ -596,7 +596,7 @@ class ProductStockEntrepot extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -608,5 +608,7 @@ class ProductStockEntrepot extends CommonObject $this->seuil_stock_alerte = ''; $this->desiredstock = ''; $this->import_key = ''; + + return 1; } } diff --git a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php index ba3ab193089..ed7c6394d61 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2022 Frédéric France + * Copyright (C) 2022-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 @@ -929,11 +929,11 @@ class StockTransfer extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php index 4e6847287ca..bc0c56baa3f 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) ---Put here your own copyright and developer email--- + * 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 @@ -911,11 +912,11 @@ class StockTransferLine extends CommonObjectLine * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 893ced6f27c..4f6e2b36480 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1477,7 +1477,7 @@ class Project extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -1520,6 +1520,8 @@ class Project extends CommonObject $xnbp++; } */ + + return 1; } /** diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index f474d200783..df339ae9004 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -897,7 +897,7 @@ class Task extends CommonObjectLine * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -912,6 +912,8 @@ class Task extends CommonObjectLine $this->progress = '25'; $this->status = 0; $this->note = 'This is a specimen task not'; + + return 1; } /** diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 2ab50c297f4..0aeb300a666 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -11,7 +11,7 @@ * Copyright (C) 2015 Claudio Aschieri * Copyright (C) 2016-2022 Ferran Marcet * Copyright (C) 2018 Quentin Vial-Gouteyron - * Copyright (C) 2022-2023 Frédéric France + * Copyright (C) 2022-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 @@ -1414,7 +1414,7 @@ class Reception extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -1465,6 +1465,8 @@ class Reception extends CommonObject $this->lines[] = $line; $xnbp++; } + + return 1; } /** diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index ae119deae92..0d02a59a573 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.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 @@ -906,11 +907,11 @@ class RecruitmentCandidature extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index 049456248dd..3fa9c360610 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -1,6 +1,7 @@ /* Copyright (C) 2022 Alexandre Spangaro + * 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 @@ -973,11 +974,11 @@ class RecruitmentJobPosition extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index 0f2760668df..18f3d1263e1 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2011-2022 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2024 Frédéric France + * 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 @@ -556,7 +556,7 @@ class PaymentSalary extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -573,6 +573,8 @@ class PaymentSalary extends CommonObject $this->fk_bank = 0; $this->fk_user_author = 0; $this->fk_user_modif = 0; + + return 1; } diff --git a/htdocs/salaries/class/salary.class.php b/htdocs/salaries/class/salary.class.php index c7cbc98ccb3..85b2b312f16 100644 --- a/htdocs/salaries/class/salary.class.php +++ b/htdocs/salaries/class/salary.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2011-2022 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2021 Gauthier VERDOL + * 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 @@ -305,7 +306,7 @@ class Salary extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -323,6 +324,8 @@ class Salary extends CommonObject $this->fk_bank = 0; $this->fk_user_author = 0; $this->fk_user_modif = 0; + + return 1; } /** diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index e67452d4347..6b95ec4ab79 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2012 Regis Houssin * Copyright (C) 2013 Peter Fontaine * Copyright (C) 2016 Marcos García + * 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 @@ -673,7 +674,7 @@ class CompanyBankAccount extends Account * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -702,5 +703,7 @@ class CompanyBankAccount extends Account $this->frstrecur = 'FRST'; $this->socid = 1; + + return 1; } } diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php index ce94ae75e38..99901fc00c8 100644 --- a/htdocs/societe/class/companypaymentmode.class.php +++ b/htdocs/societe/class/companypaymentmode.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 Frédéric France + * 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 @@ -552,10 +552,10 @@ class CompanyPaymentMode extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 2885555b01a..abdd447f9a1 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -15,7 +15,7 @@ * Copyright (C) 2017 Rui Strecht * Copyright (C) 2018 Philippe Grand * Copyright (C) 2019-2020 Josep Lluís Amador - * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2020 Open-Dsi * Copyright (C) 2022 ButterflyOfFire * Copyright (C) 2023 Alexandre Janniaux @@ -4514,6 +4514,7 @@ class Societe extends CommonObject $this->idprof4 = 'idprof4'; $this->idprof5 = 'idprof5'; $this->idprof6 = 'idprof6'; + return 1; } diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index 41bf4164981..c4a3f1fa824 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2014-2016 Juanjo Menent * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud + * 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 @@ -561,10 +562,10 @@ class SocieteAccount extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } } diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index b2a681606df..05f790292a4 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2289,7 +2289,7 @@ class SupplierProposal extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -2362,6 +2362,8 @@ class SupplierProposal extends CommonObject $xnbp++; } + + return 1; } /** diff --git a/htdocs/ticket/class/cticketcategory.class.php b/htdocs/ticket/class/cticketcategory.class.php index e783a40372a..923219858f7 100644 --- a/htdocs/ticket/class/cticketcategory.class.php +++ b/htdocs/ticket/class/cticketcategory.class.php @@ -1,6 +1,7 @@ * Copyright (C) ---Put here your own copyright and developer email--- + * 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 @@ -637,10 +638,10 @@ class CTicketCategory extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } } diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index d2f8fd9bb31..beace9b3dbd 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2016 Christophe Battarel - * Copyright (C) 2019-2023 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2020 Laurent Destailleur * Copyright (C) 2023 Charlene Benke * Copyright (C) 2023 Benjamin Falière @@ -1291,6 +1291,7 @@ class Ticket extends CommonObject $this->date_last_msg_sent = dol_now(); $this->date_close = dol_now(); $this->tms = dol_now(); + return 1; } diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 996fbee5611..0d442f9e121 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -12,7 +12,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2018 charlene Benke * Copyright (C) 2018-2021 Nicolas ZABOURI - * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2019 Abbes Bahfir * Copyright (C) 2024 MDW * @@ -3471,6 +3471,7 @@ class User extends CommonObject $this->status = 1; $this->entity = 1; + return 1; } diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index b3a60d92d90..48ec6758351 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -7,7 +7,7 @@ * Copyright (C) 2014 Alexis Algoud * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2019 Abbes Bahfir - * Copyright (C) 2023 Frédéric France + * Copyright (C) 2023-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 @@ -947,7 +947,7 @@ class UserGroup extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -967,6 +967,8 @@ class UserGroup extends CommonObject $this->members = array( $user->id => $user ); + + return 1; } /** diff --git a/htdocs/webhook/class/target.class.php b/htdocs/webhook/class/target.class.php index 1858d3791cb..6d538208dfa 100644 --- a/htdocs/webhook/class/target.class.php +++ b/htdocs/webhook/class/target.class.php @@ -1,6 +1,7 @@ * Copyright (C) ---Put here your own copyright and developer email--- + * 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 @@ -858,13 +859,14 @@ class Target extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { $this->url = "https://thisisunurl"; $this->trigger_codes = "ThisIsATestCode"; - $this->initAsSpecimenCommon(); + + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index f22db99fd9c..a4b80193d02 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -909,7 +909,7 @@ class Website extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -929,6 +929,8 @@ class Website extends CommonObject $this->fk_user_modif = $user->id; $this->date_creation = dol_now(); $this->tms = dol_now(); + + return 1; } diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 5e408330b4f..737e57ac3ec 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2020 Nicolas ZABOURI + * 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 @@ -857,7 +858,7 @@ class WebsitePage extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -884,5 +885,7 @@ class WebsitePage extends CommonObject $this->date_modification = $now - (24 * 7 * 3600); $this->fk_user_creat = $user->id; $this->author_alias = 'mypublicpseudo'; + + return 1; } } diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php index e38039e19c3..506071a26f2 100644 --- a/htdocs/workstation/class/workstation.class.php +++ b/htdocs/workstation/class/workstation.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2020 Gauthier VERDOL - * Copyright (C) 2023-2024 Frédéric France + * Copyright (C) 2023-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 @@ -855,11 +855,11 @@ class Workstation extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/zapier/class/hook.class.php b/htdocs/zapier/class/hook.class.php index 17c8d0c2160..68bda9bedb8 100644 --- a/htdocs/zapier/class/hook.class.php +++ b/htdocs/zapier/class/hook.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-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 * the Free Software Foundation; either version 3 of the License, or @@ -648,10 +648,10 @@ class Hook extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } } diff --git a/test/phpunit/CommonClassTest.class.php b/test/phpunit/CommonClassTest.class.php index bd1bfa4948b..daf33bbff69 100644 --- a/test/phpunit/CommonClassTest.class.php +++ b/test/phpunit/CommonClassTest.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2018 Laurent Destailleur * Copyright (C) 2023 Alexandre Janniaux * 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