diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index f40da966786..e280fcb49e0 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -363,6 +363,7 @@ if (empty($reshook)) { $nbOrders = is_array($orders) ? count($orders) : 1; + $currentIndex = 0; foreach ($orders as $id_order) { $cmd = new Commande($db); if ($cmd->fetch($id_order) <= 0) { @@ -373,6 +374,7 @@ if (empty($reshook)) { $objecttmp = new Facture($db); if (!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) { // If option "one bill per third" is set, and an invoice for this thirdparty was already created, we reuse it. + $currentIndex++; $objecttmp = $TFactThird[$cmd->socid]; } else { // If we want one invoice per order or if there is no first invoice yet for this thirdparty. @@ -389,6 +391,10 @@ if (empty($reshook)) { $objecttmp->ref_client = $cmd->ref_client; } + if (empty($objecttmp->note_public)) { + $objecttmp->note_public = $langs->transnoentities("Orders"); + } + $datefacture = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); if (empty($datefacture)) { $datefacture = dol_now(); @@ -553,6 +559,11 @@ if (empty($reshook)) { } } + if ($currentIndex <= (getDolGlobalInt("MAXREFONDOC") ? getDolGlobalInt("MAXREFONDOC") : 10)) { + $objecttmp->note_public = dol_concatdesc($objecttmp->note_public, $langs->transnoentities($cmd->ref).(empty($cmd->ref_client) ? '' : ' ('.$cmd->ref_client.')')); + $objecttmp->update($user); + } + //$cmd->classifyBilled($user); // Disabled. This behavior must be set or not using the workflow module. if (!empty($createbills_onebythird) && empty($TFactThird[$cmd->socid])) { diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 985587f09df..dac55d099e3 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -2796,9 +2796,9 @@ class Contrat extends CommonObject if ($expirationdate && $expirationdate < $enddatetoscan) { dol_syslog("Define the newdate of end of services from expirationdate=".$expirationdate); $newdate = $expirationdate; - $protecti = 0; //$protecti is to avoid infinite loop + $protecti = 0; // $protecti is to avoid infinite loop while ($newdate < $enddatetoscan && $protecti < 1000) { - $newdate = dol_time_plus_duree($newdate, $duration_value, $duration_unit); + $newdate = dol_time_plus_duree($newdate, (int) $duration_value, $duration_unit); $protecti++; } diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 00deffe10ad..3277bb7ab3c 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -893,7 +893,7 @@ function array2table($data, $tableMarkup = 1, $tableoptions = '', $troptions = ' * @param string $table Table containing field with counter * @param string $field Field containing already used values of counter * @param string $where To add a filter on selection (for example to filter on invoice types) - * @param Societe|string $objsoc The company that own the object we need a counter for + * @param Societe|'' $objsoc The company that own the object we need a counter for * @param string $date Date to use for the {y},{m},{d} tags. * @param string $mode 'next' for next value or 'last' for last value * @param bool $bentityon Activate the entity filter. Default is true (for modules not compatible with multicompany) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 8bab1e1bd0e..4096253a94d 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -2500,13 +2500,7 @@ function pdf_getLinkedObjects(&$object, $outputlangs) } elseif ($objecttype == 'commande' || $objecttype == 'supplier_order') { $outputlangs->load('orders'); - if (count($objects) > 1 && count($objects) <= (getDolGlobalInt("MAXREFONDOC") ? getDolGlobalInt("MAXREFONDOC") : 10)) { - $object->note_public = dol_concatdesc($object->note_public, $outputlangs->transnoentities("RefOrder").' :'); - foreach ($objects as $elementobject) { - $object->note_public = dol_concatdesc($object->note_public, $outputlangs->transnoentities($elementobject->ref).(empty($elementobject->ref_client) ? '' : ' ('.$elementobject->ref_client.')').(empty($elementobject->ref_supplier) ? '' : ' ('.$elementobject->ref_supplier.')').' '); - $object->note_public = dol_concatdesc($object->note_public, $outputlangs->transnoentities("OrderDate").' : '.dol_print_date($elementobject->date, 'day', '', $outputlangs)); - } - } elseif (count($objects) == 1) { + if (count($objects) == 1) { $elementobject = array_shift($objects); $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder"); $linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref).(!empty($elementobject->ref_client) ? ' ('.$elementobject->ref_client.')' : '').(!empty($elementobject->ref_supplier) ? ' ('.$elementobject->ref_supplier.')' : ''); diff --git a/htdocs/core/modules/asset/mod_asset_advanced.php b/htdocs/core/modules/asset/mod_asset_advanced.php index a1f800d309d..a0aa657d536 100644 --- a/htdocs/core/modules/asset/mod_asset_advanced.php +++ b/htdocs/core/modules/asset/mod_asset_advanced.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2019-2022 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 @@ -98,7 +98,7 @@ class mod_asset_advanced extends ModeleNumRefAsset */ public function getExample() { - global $conf, $db, $langs, $mysoc; + global $db, $langs; $object = new Asset($db); $object->initAsSpecimen(); @@ -133,7 +133,7 @@ class mod_asset_advanced extends ModeleNumRefAsset $date = $object->date; - $numFinal = get_next_value($db, $mask, 'asset', 'ref', '', null, $date); + $numFinal = get_next_value($db, $mask, 'asset', 'ref', '', '', $date); return $numFinal; } diff --git a/htdocs/core/modules/bom/mod_bom_advanced.php b/htdocs/core/modules/bom/mod_bom_advanced.php index 2428e79595d..b1160222cba 100644 --- a/htdocs/core/modules/bom/mod_bom_advanced.php +++ b/htdocs/core/modules/bom/mod_bom_advanced.php @@ -138,7 +138,7 @@ class mod_bom_advanced extends ModeleNumRefBoms $date = ($object->date_bom ? $object->date_bom : $object->date); - $numFinal = get_next_value($db, $mask, 'bom_bom', 'ref', '', null, $date); + $numFinal = get_next_value($db, $mask, 'bom_bom', 'ref', '', '', $date); return $numFinal; } diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php b/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php index 44eff63035d..71cf8effc92 100644 --- a/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php +++ b/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php @@ -93,16 +93,22 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts */ public function getExample() { - global $conf, $langs, $mysoc; + global $db, $langs; - $old_code_client = $mysoc->code_client; - $mysoc->code_client = 'CCCCCCCCCC'; - $numExample = $this->getNextValue($mysoc, ''); - $mysoc->code_client = $old_code_client; + require_once DOL_DOCUMENT_ROOT . '/compta/paiement/cheque/class/remisecheque.class.php'; + require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; + + $remise = new RemiseCheque($db); + $remise->initAsSpecimen(); + $thirdparty = new Societe($db); + $thirdparty->initAsSpecimen(); + + $numExample = $this->getNextValue($thirdparty, $remise); if (!$numExample) { $numExample = $langs->trans('NotConfigured'); } + return $numExample; } diff --git a/htdocs/core/modules/contract/mod_contract_magre.php b/htdocs/core/modules/contract/mod_contract_magre.php index ebd7957780f..02345cda0f4 100644 --- a/htdocs/core/modules/contract/mod_contract_magre.php +++ b/htdocs/core/modules/contract/mod_contract_magre.php @@ -88,12 +88,18 @@ class mod_contract_magre extends ModelNumRefContracts */ public function getExample() { - global $langs, $mysoc; + global $db, $langs; + + require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php'; + require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; + + $contract = new Contrat($db); + $contract->initAsSpecimen(); + $thirdparty = new Societe($db); + $thirdparty->initAsSpecimen(); + + $numExample = $this->getNextValue($thirdparty, $contract); - $old_code_client = $mysoc->code_client; - $mysoc->code_client = 'CCCCCCCCCC'; - $numExample = $this->getNextValue($mysoc, ''); - $mysoc->code_client = $old_code_client; if (!$numExample) { $numExample = $langs->trans('NotConfigured'); diff --git a/htdocs/core/modules/holiday/mod_holiday_immaculate.php b/htdocs/core/modules/holiday/mod_holiday_immaculate.php index 434b9614985..672a37885fa 100644 --- a/htdocs/core/modules/holiday/mod_holiday_immaculate.php +++ b/htdocs/core/modules/holiday/mod_holiday_immaculate.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Charlene Benke +/* Copyright (C) 2011-2019 Juanjo Menent + * Copyright (C) 2018 Charlene Benke * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -88,11 +88,15 @@ class mod_holiday_immaculate extends ModelNumRefHolidays */ public function getExample() { - global $conf, $langs, $user; + global $db, $langs, $user; + require_once DOL_DOCUMENT_ROOT . '/holiday/class/holiday.class.php'; + + $holiday = new Holiday($db); + $holiday->initAsSpecimen(); $old_login = $user->login; $user->login = 'UUUUUUU'; - $numExample = $this->getNextValue($user, ''); + $numExample = $this->getNextValue($user, $holiday); $user->login = $old_login; if (!$numExample) { diff --git a/htdocs/core/modules/product_batch/mod_sn_advanced.php b/htdocs/core/modules/product_batch/mod_sn_advanced.php index 20fcb64d382..6284ed2f7f3 100644 --- a/htdocs/core/modules/product_batch/mod_sn_advanced.php +++ b/htdocs/core/modules/product_batch/mod_sn_advanced.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2021 Christophe Battarel * Copyright (C) 2024 MDW * @@ -114,15 +114,14 @@ class mod_sn_advanced extends ModeleNumRefBatch */ public function getExample() { - global $conf, $langs, $mysoc; + global $db, $langs; - $old_code_client = $mysoc->code_client; - $old_code_type = $mysoc->typent_code; - $mysoc->code_client = 'CCCCCCCCCC'; - $mysoc->typent_code = 'TTTTTTTTTT'; - $numExample = $this->getNextValue($mysoc, ''); - $mysoc->code_client = $old_code_client; - $mysoc->typent_code = $old_code_type; + require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; + + $thirdparty = new Societe($db); + $thirdparty->initAsSpecimen(); + + $numExample = $this->getNextValue($thirdparty, ''); if (!$numExample) { $numExample = $langs->trans('NotConfigured'); diff --git a/htdocs/core/modules/product_batch/mod_sn_free.php b/htdocs/core/modules/product_batch/mod_sn_free.php index bd795c726a1..87d3e5e62cd 100644 --- a/htdocs/core/modules/product_batch/mod_sn_free.php +++ b/htdocs/core/modules/product_batch/mod_sn_free.php @@ -75,7 +75,14 @@ class mod_sn_free extends ModeleNumRefBatch */ public function getExample() { - return $this->getNextValue(null, null); + global $db; + + require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; + + $thirdparty = new Societe($db); + $thirdparty->initAsSpecimen(); + + return $this->getNextValue($thirdparty, null); } /** diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index 21e3e2ffdf2..7fac3e5ea6f 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -838,7 +838,7 @@ class pdf_standard extends ModelePDFStock * Show footer of page. Need this->emetteur object * * @param TCPDF $pdf PDF - * @param Object $object Object to show + * @param Entrepot $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text * @return int Return height of bottom margin including footer text diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index 7cac5150b48..f4ef3990726 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -117,12 +117,12 @@ class EcmFiles extends CommonObject public $extraparams; /** - * @var int|string date create + * @var int|'' date create */ public $date_c = ''; /** - * @var int|string date modify + * @var int|'' date modify */ public $date_m = ''; diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 4139a23a52e..a5231a73b6e 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -2665,7 +2665,7 @@ class EmailCollector extends CommonObject // Search country by name or code if (!empty($contactstatic->country)) { require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; - $result = getCountry('', 3, $this->db, '', 1, $contactstatic->country); + $result = getCountry('', 3, $this->db, null, 1, $contactstatic->country); if ($result == 'NotDefined') { $errorforactions++; $this->error = "Error country not found by this name '" . $contactstatic->country . "'"; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index d7ed5a2c5e7..9ec4182d0f9 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -11,10 +11,10 @@ * Copyright (C) 2015 Claudio Aschieri * Copyright (C) 2016-2018 Ferran Marcet * Copyright (C) 2016 Yasser Carreón - * Copyright (C) 2018-2022 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2020 Lenin Rivas * Copyright (C) 2022 Josep Lluís Amador - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW * * 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 @@ -2082,7 +2082,7 @@ if ($action == 'create') { if ($volumeUnit < 50) { print showDimensionInBestUnit($calculatedVolume, $volumeUnit, "volume", $langs, isset($conf->global->MAIN_VOLUME_DEFAULT_ROUND) ? $conf->global->MAIN_VOLUME_DEFAULT_ROUND : -1, isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT) ? $conf->global->MAIN_VOLUME_DEFAULT_UNIT : 'no'); } else { - print $calculatedVolume.' '.measuringUnitString(0, "volume", $volumeUnit); + print $calculatedVolume.' '.measuringUnitString(0, "volume", (string) $volumeUnit); } } if ($totalVolume > 0) { diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 4a1e019334c..75f01e33eb7 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -39,6 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formorder.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; @@ -383,7 +384,7 @@ if (empty($reshook)) { $db->begin(); $default_ref_supplier = dol_print_date(dol_now(), '%Y%m%d%H%M%S'); - + $currentIndex = 0; foreach ($orders as $id_order) { $cmd = new CommandeFournisseur($db); if ($cmd->fetch($id_order) <= 0) { @@ -392,6 +393,7 @@ if (empty($reshook)) { $objecttmp = new FactureFournisseur($db); if (!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) { + $currentIndex++; $objecttmp = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created supplier invoice. } else { // Search if the VAT reverse-charge is activated by default in supplier card to resume the information @@ -428,6 +430,10 @@ if (empty($reshook)) { } if ($objecttmp->id > 0) { + if (empty($objecttmp->note_public)) { + $objecttmp->note_public = $langs->transnoentities("Orders"); + } + $sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element ("; $sql .= "fk_source"; $sql .= ", sourcetype"; @@ -548,6 +554,11 @@ if (empty($reshook)) { } } + if ($currentIndex <= (getDolGlobalInt("MAXREFONDOC") ? getDolGlobalInt("MAXREFONDOC") : 10)) { + $objecttmp->note_public = dol_concatdesc($objecttmp->note_public, $langs->transnoentities($cmd->ref).(empty($cmd->ref_supplier) ? '' : ' ('.$cmd->ref_supplier.')')); + $objecttmp->update($user); + } + $cmd->classifyBilled($user); // TODO Move this in workflow like done for sales orders if (!empty($createbills_onebythird) && empty($TFactThird[$cmd->socid])) { diff --git a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php index 0c1b043f006..6e8903119d9 100644 --- a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php +++ b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2019-2021 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 @@ -141,7 +141,7 @@ class mod_knowledgerecord_advanced extends ModeleNumRefKnowledgeRecord $date = $object->date; - $numFinal = get_next_value($db, $mask, 'knowledgemanagement_knowledgerecord', 'ref', '', null, $date); + $numFinal = get_next_value($db, $mask, 'knowledgemanagement_knowledgerecord', 'ref', '', '', $date); return $numFinal; } diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index f305107210b..55ace9c6928 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -135,7 +135,7 @@ Manufacturing=Manufacturing Disassemble=Disassemble ProducedBy=Produced by QtyTot=Qty Total - +MOIsClosed=Manufacturing Order is closed QtyCantBeSplit= Quantity cannot be split NoRemainQtyToDispatch=No quantity remaining to divide THMOperatorEstimatedHelp=Estimated cost of operator per hour. Will be used to estimate cost of a BOM using this workstation. diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php index 208b4c4a054..25bb76993e7 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * 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 @@ -140,7 +140,7 @@ class mod_myobject_advanced extends ModeleNumRefMyObject $date = $object->date; - $numFinal = get_next_value($db, $mask, 'mymodule_myobject', 'ref', '', null, $date); + $numFinal = get_next_value($db, $mask, 'mymodule_myobject', 'ref', '', '', $date); return $numFinal; } diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index e01db20309c..5773f72354a 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -817,17 +817,22 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Lines to consume + print ''."\n"; print '
'; print '
'; print '
'; $url = $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addconsumeline&token='.newToken(); - $permissiontoaddaconsumeline = $object->status != $object::STATUS_PRODUCED && $object->status != $object::STATUS_CANCELED; + $permissiontoaddaconsumeline = ($object->status != $object::STATUS_PRODUCED && $object->status != $object::STATUS_CANCELED) ? 1 : -2; $parameters = array('morecss' => 'reposition'); + $helpText = ''; + if ($permissiontoaddaconsumeline == -2) { + $helpText = $langs->trans('MOIsClosed'); + } $newcardbutton = ''; if ($action != 'consumeorproduce' && $action != 'consumeandproduceall') { - $newcardbutton = dolGetButtonTitle($langs->trans('AddNewConsumeLines'), '', 'fa fa-plus-circle size15x', $url, '', $permissiontoaddaconsumeline, $parameters); + $newcardbutton = dolGetButtonTitle($langs->trans('AddNewConsumeLines'), $helpText, 'fa fa-plus-circle size15x', $url, '', $permissiontoaddaconsumeline, $parameters); } print load_fiche_titre($langs->trans('Consumption'), $newcardbutton, '', 0, '', '', ''); diff --git a/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php b/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php index 75596eba9ea..3db7ae28a6d 100644 --- a/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php +++ b/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2019-2023 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 @@ -142,7 +142,7 @@ class mod_partnership_advanced extends ModeleNumRefPartnership $date = $object->date; - $numFinal = get_next_value($db, $mask, 'partnership', 'ref', '', null, $date); + $numFinal = get_next_value($db, $mask, 'partnership', 'ref', '', '', $date); return $numFinal; } diff --git a/htdocs/product/card.php b/htdocs/product/card.php index c734af74e7c..871bac2e52a 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1,26 +1,26 @@ - * Copyright (C) 2004-2016 Laurent Destailleur - * Copyright (C) 2005 Eric Seigne - * Copyright (C) 2005-2015 Regis Houssin - * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2006 Auguria SARL - * Copyright (C) 2010-2015 Juanjo Menent - * Copyright (C) 2013-2016 Marcos García - * Copyright (C) 2012-2013 Cédric Salvador - * Copyright (C) 2011-2023 Alexandre Spangaro - * Copyright (C) 2014 Cédric Gross - * Copyright (C) 2014-2015 Ferran Marcet - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2016-2022 Charlene Benke - * Copyright (C) 2016 Meziane Sof - * Copyright (C) 2017 Josep Lluís Amador - * Copyright (C) 2019-2024 Frédéric France - * Copyright (C) 2019-2020 Thibault FOUCART - * Copyright (C) 2020 Pierre Ardoin - * Copyright (C) 2022 Vincent de Grandpré - * Copyright (C) 2024 MDW +/* Copyright (C) 2001-2007 Rodolphe Quiedeville + * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2005 Eric Seigne + * Copyright (C) 2005-2015 Regis Houssin + * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2006 Auguria SARL + * Copyright (C) 2010-2015 Juanjo Menent + * Copyright (C) 2013-2016 Marcos García + * Copyright (C) 2012-2013 Cédric Salvador + * Copyright (C) 2011-2023 Alexandre Spangaro + * Copyright (C) 2014 Cédric Gross + * Copyright (C) 2014-2015 Ferran Marcet + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2016-2022 Charlene Benke + * Copyright (C) 2016 Meziane Sof + * Copyright (C) 2017 Josep Lluís Amador + * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2019-2020 Thibault FOUCART + * Copyright (C) 2020 Pierre Ardoin + * Copyright (C) 2022 Vincent de Grandpré + * Copyright (C) 2024 MDW * * 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 @@ -1955,7 +1955,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio $head = product_prepare_head($object); $titre = $langs->trans("CardProduct".$object->type); $picto = ($object->type == Product::TYPE_SERVICE ? 'service' : 'product'); - print dol_get_fiche_head($head, 'card', $titre, 0, $picto); + print dol_get_fiche_head($head, 'card', $titre, 0, $picto, 0, '', '', 0, '', 1); // Call Hook tabContentEditProduct $parameters = array(); diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 4c06be7396b..457b21e046c 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -12,7 +12,8 @@ * Copyright (C) 2016 Ferran Marcet * Copyright (C) 2016 Yasser Carreón * Copyright (C) 2018 Quentin Vial-Gouteyron - * Copyright (C) 2024 MDW + * 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 @@ -1613,7 +1614,7 @@ if ($action == 'create') { if ($volumeUnit < 50) { print showDimensionInBestUnit($calculatedVolume, $volumeUnit, "volume", $langs, isset($conf->global->MAIN_VOLUME_DEFAULT_ROUND) ? $conf->global->MAIN_VOLUME_DEFAULT_ROUND : -1, isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT) ? $conf->global->MAIN_VOLUME_DEFAULT_UNIT : 'no'); } else { - print $calculatedVolume.' '.measuringUnitString(0, "volume", $volumeUnit); + print $calculatedVolume.' '.measuringUnitString(0, "volume", (string) $volumeUnit); } } if ($totalVolume > 0) { diff --git a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php index c1258703e6c..8453dceacd4 100644 --- a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php +++ b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php @@ -137,7 +137,7 @@ class mod_recruitmentcandidature_advanced extends ModeleNumRefRecruitmentCandida $date = $object->date ?? ''; - $numFinal = get_next_value($db, $mask, 'recruitment_recruitmentcandidature', 'ref', '', null, $date); + $numFinal = get_next_value($db, $mask, 'recruitment_recruitmentcandidature', 'ref', '', '', $date); return $numFinal; } diff --git a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php index 868b4b284e0..56efbf0239c 100644 --- a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php +++ b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php @@ -137,7 +137,7 @@ class mod_recruitmentjobposition_advanced extends ModeleNumRefRecruitmentJobPosi $date = $object->date ?? ''; - $numFinal = get_next_value($db, $mask, 'recruitment_recruitmentjobposition', 'ref', '', null, $date); + $numFinal = get_next_value($db, $mask, 'recruitment_recruitmentjobposition', 'ref', '', '', $date); return $numFinal; } diff --git a/htdocs/recruitment/lib/recruitment_recruitmentcandidature.lib.php b/htdocs/recruitment/lib/recruitment_recruitmentcandidature.lib.php index d6a0de449dc..b6e8ae365d6 100644 --- a/htdocs/recruitment/lib/recruitment_recruitmentcandidature.lib.php +++ b/htdocs/recruitment/lib/recruitment_recruitmentcandidature.lib.php @@ -25,7 +25,7 @@ /** * Prepare array of tabs for RecruitmentCandidature * - * @param RecruitmentJobPosition $object RecruitmentCandidature + * @param RecruitmentCandidature $object RecruitmentCandidature * @return array Array of tabs */ function recruitmentCandidaturePrepareHead($object) diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index 98e79785fce..54c09924e2a 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2018 Laurent Destailleur * Copyright (C) 2005-2024 Regis Houssin * Copyright (C) 2011 Herve Prot - * Copyright (C) 2019-2021 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 @@ -300,7 +300,7 @@ $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-l if ($caneditperms) { $newcardbutton .= dolGetButtonTitleSeparator(); - $newcardbutton .= dolGetButtonTitle($langs->trans('NewGroup'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/user/group/card.php?action=create&leftmenu=', '', $caneditperms); + $newcardbutton .= dolGetButtonTitle($langs->trans('NewGroup'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/user/group/card.php?action=create&leftmenu=', '', $caneditperms ? 1 : 0); } print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 3e2c708b978..8b2ec7364b7 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -65,11 +65,13 @@ parameters: - '#expects bool#' - '#expects bool, int given.#' - '#expects bool, string given.#' - - '#expects int#' + - '#expects int\|#' + - '#expects int\|#' - '#expects int<-2, 2>, bool given.#' - - '#expects int<0, 1>, false given.#' - - '#expects int, string given.#' - - '#expects int, float given.#' + - '#expects int<0, 1>#' + - '#expects int, string#' + - '#expects int, float#' + - '#expects int, null#' - '#expects int, bool given.#' - '#expects int, false given.#' - '#expects int, true given.#' @@ -78,15 +80,18 @@ parameters: - '#expects float\|string#' - '#expects float\|null#' - '#expects float, string given.#' - - '#expects string#' - - '#expects string, int given.#' + - '#expects string\|null,#' + - '#expects string, int#' - '#expects string, \(float\|int\) given.#' - - '#expects string, array given.#' - - '#expects string, float given.#' + - '#expects string, array#' + - '#expects string, float#' + - '#expects string, bool given.#' - '#expects string, true given.#' + - '#expects string, false given.#' - '#expects string, null given.#' - '#expects string, int<0, 10> given.#' - '#expects string, DateTime given.#' + - '#expects string, bool\|mysqli_result\|resource given.#' - '#expects array#' - '#expects array, string given.#' - '#expects array, null given.#' @@ -97,9 +102,7 @@ parameters: - '#expects object#' - '#expects Adherent#' - '#expects BOM#' - - '#expects Contrat#' - '#expects FTP\\Connection#' - - '#expects Holiday#' - '#expects LDAP\\Connection#' - '#expects MultiCurrency#' - '#expects Productlot#' @@ -107,17 +110,13 @@ parameters: - '#expects FactureFournisseur#' - '#expects Paiement#' - '#expects PgSql\\Result#' - - '#expects RecruitmentJobPosition#' - - '#expects RemiseCheque#' - '#expects Societe#' + - '#expects ''''\|Societe#' - '#expects SupplierProposal#' - - '#expects Translate#' - '#expects User#' - '#expects CommonObjectLine#' - - '#dol_eval expects#' - '#check_authentication expects#' - '#colorHexToHsl expects#' - - '#dolGetButtonTitle expects#' internalErrorsCountLimit: 50 cache: nodesByFileCountMax: 512