From aa133f8facd6af139b27b87e5cb903d91d687429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Tue, 10 Dec 2024 21:28:21 +0100 Subject: [PATCH 01/46] fix phpstan --- build/phpstan/phpstan-baseline.neon | 54 ------------------- .../default/tpl/contactcard_create.tpl.php | 5 +- .../default/tpl/contactcard_edit.tpl.php | 5 +- .../default/tpl/contactcard_view.tpl.php | 5 +- 4 files changed, 12 insertions(+), 57 deletions(-) diff --git a/build/phpstan/phpstan-baseline.neon b/build/phpstan/phpstan-baseline.neon index 838f6d2cb1b..b0d24bdcbaf 100644 --- a/build/phpstan/phpstan-baseline.neon +++ b/build/phpstan/phpstan-baseline.neon @@ -7518,60 +7518,6 @@ parameters: count: 1 path: ../../htdocs/contact/ajax/contact.php - - - message: '#^Cannot access property \$control on mixed\.$#' - identifier: property.nonObject - count: 24 - path: ../../htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php - - - - message: '#^Variable \$canvas might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php - - - - message: '#^Variable \$this might not be defined\.$#' - identifier: variable.undefined - count: 24 - path: ../../htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php - - - - message: '#^Cannot access property \$control on mixed\.$#' - identifier: property.nonObject - count: 31 - path: ../../htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php - - - - message: '#^Variable \$canvas might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php - - - - message: '#^Variable \$this might not be defined\.$#' - identifier: variable.undefined - count: 29 - path: ../../htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php - - - - message: '#^Cannot access property \$control on mixed\.$#' - identifier: property.nonObject - count: 34 - path: ../../htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php - - - - message: '#^Variable \$canvas might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php - - - - message: '#^Variable \$this might not be defined\.$#' - identifier: variable.undefined - count: 32 - path: ../../htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php - - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue diff --git a/htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php b/htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php index 2e7e1cf2859..19e6d028968 100644 --- a/htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php +++ b/htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2010 Regis Houssin * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -17,9 +17,12 @@ */ /** + * @var Canvas $this * @var Conf $conf * @var Contact $object * @var Translate $langs + * + * @var string $canvas */ // Protection to avoid direct call of template diff --git a/htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php b/htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php index 4003d80a0b9..f96d10a93bd 100644 --- a/htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php +++ b/htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2010 Regis Houssin * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -17,9 +17,12 @@ */ /** + * @var Canvas $this * @var Conf $conf * @var Contact $object * @var Translate $langs + * + * @var string $canvas */ // Protection to avoid direct call of template diff --git a/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php b/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php index 3af33672398..d408c0fbdf8 100644 --- a/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php +++ b/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -17,10 +17,13 @@ */ /** + * @var Canvas $this * @var Conf $conf * @var Contact $object * @var Translate $langs * @var User $user + * + * @var string $canvas */ // Protection to avoid direct call of template From 778b07dabd4a8251649d258a01be2264f9308d77 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Fri, 13 Dec 2024 17:22:48 +0100 Subject: [PATCH 02/46] Debug v21 Fix tooltip on setup pages --- htdocs/core/modules/asset/mod_asset_advanced.php | 4 ++-- .../core/modules/barcode/mod_barcode_product_standard.php | 2 +- .../modules/barcode/mod_barcode_thirdparty_standard.php | 2 +- htdocs/core/modules/bom/mod_bom_advanced.php | 2 +- htdocs/core/modules/cheque/mod_chequereceipt_thyme.php | 2 +- htdocs/core/modules/commande/mod_commande_saphir.php | 2 +- htdocs/core/modules/contract/mod_contract_magre.php | 2 +- htdocs/core/modules/delivery/mod_delivery_saphir.php | 2 +- htdocs/core/modules/expedition/mod_expedition_ribera.php | 2 +- .../core/modules/expensereport/mod_expensereport_sand.php | 2 +- htdocs/core/modules/facture/mod_facture_mercure.php | 8 ++++---- htdocs/core/modules/fichinter/mod_arctic.php | 2 +- htdocs/core/modules/holiday/mod_holiday_immaculate.php | 2 +- htdocs/core/modules/hrm/mod_evaluation_advanced.php | 2 +- htdocs/core/modules/mrp/mod_mo_advanced.php | 2 +- htdocs/core/modules/payment/mod_payment_ant.php | 2 +- htdocs/core/modules/product/mod_codeproduct_elephant.php | 4 ++-- htdocs/core/modules/product_batch/mod_lot_advanced.php | 2 +- htdocs/core/modules/product_batch/mod_sn_advanced.php | 2 +- htdocs/core/modules/project/mod_project_universal.php | 2 +- htdocs/core/modules/project/task/mod_task_universal.php | 2 +- htdocs/core/modules/propale/mod_propale_saphir.php | 2 +- htdocs/core/modules/reception/mod_reception_moonstone.php | 2 +- htdocs/core/modules/societe/mod_codeclient_elephant.php | 4 ++-- htdocs/core/modules/societe/mod_codecompta_aquarium.php | 5 ++--- htdocs/core/modules/societe/mod_codecompta_digitaria.php | 8 ++++---- .../modules/stocktransfer/mod_stocktransfer_advanced.php | 2 +- .../supplier_invoice/mod_facture_fournisseur_tulip.php | 8 ++++---- .../supplier_order/mod_commande_fournisseur_orchidee.php | 2 +- .../supplier_payment/mod_supplier_payment_brodator.php | 2 +- .../supplier_proposal/mod_supplier_proposal_saphir.php | 2 +- htdocs/core/modules/takepos/mod_takepos_ref_universal.php | 2 +- htdocs/core/modules/ticket/mod_ticket_universal.php | 2 +- .../core/modules/workstation/mod_workstation_advanced.php | 2 +- .../recruitment/mod_recruitmentcandidature_advanced.php | 2 +- .../recruitment/mod_recruitmentjobposition_advanced.php | 2 +- 36 files changed, 49 insertions(+), 50 deletions(-) diff --git a/htdocs/core/modules/asset/mod_asset_advanced.php b/htdocs/core/modules/asset/mod_asset_advanced.php index 129e5c55ea6..969abdefbe9 100644 --- a/htdocs/core/modules/asset/mod_asset_advanced.php +++ b/htdocs/core/modules/asset/mod_asset_advanced.php @@ -70,7 +70,7 @@ class mod_asset_advanced extends ModeleNumRefAsset $text .= ''; $text .= ''; $text .= ''; - $text .= ''; + $text .= '
'; $tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Asset"), $langs->transnoentities("Asset")); $tooltip .= $langs->trans("GenericMaskCodes2"); @@ -81,7 +81,7 @@ class mod_asset_advanced extends ModeleNumRefAsset // Parametrage du prefix $text .= ''; - $text .= ''; + $text .= ''; $text .= ''; diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php index 944e244fd17..1ea205d0d1c 100644 --- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php @@ -95,7 +95,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode // Mask parameter //$texte.= ''; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php b/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php index 9cb371267b6..69278d4643f 100644 --- a/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php @@ -131,7 +131,7 @@ class mod_barcode_thirdparty_standard extends ModeleNumRefBarCode // Mask parameter //$texte.= ''; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/bom/mod_bom_advanced.php b/htdocs/core/modules/bom/mod_bom_advanced.php index 18cbfa0cdb6..bc3ef9a72ff 100644 --- a/htdocs/core/modules/bom/mod_bom_advanced.php +++ b/htdocs/core/modules/bom/mod_bom_advanced.php @@ -82,7 +82,7 @@ class mod_bom_advanced extends ModeleNumRefBoms // Parametrage du prefix $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php b/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php index c03e67d6687..848b3ccbace 100644 --- a/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php +++ b/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php @@ -76,7 +76,7 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts // Parametrage du prefix $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/commande/mod_commande_saphir.php b/htdocs/core/modules/commande/mod_commande_saphir.php index a3280fa1455..bb0603ef0f0 100644 --- a/htdocs/core/modules/commande/mod_commande_saphir.php +++ b/htdocs/core/modules/commande/mod_commande_saphir.php @@ -82,7 +82,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes // Parametrage du prefix $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/contract/mod_contract_magre.php b/htdocs/core/modules/contract/mod_contract_magre.php index 7af0d9e16bb..e872357c63c 100644 --- a/htdocs/core/modules/contract/mod_contract_magre.php +++ b/htdocs/core/modules/contract/mod_contract_magre.php @@ -73,7 +73,7 @@ class mod_contract_magre extends ModelNumRefContracts $tooltip .= '
'.$langs->trans("GenericMaskCodes5b"); $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; $texte .= ''; $texte .= '
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'.$langs->trans("Mask").' ('.$langs->trans("BarCodeModel").'):
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'.$langs->trans("Mask").' ('.$langs->trans("BarCodeModel").'):
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'; diff --git a/htdocs/core/modules/delivery/mod_delivery_saphir.php b/htdocs/core/modules/delivery/mod_delivery_saphir.php index 60cbc9420ab..f09c8764d7a 100644 --- a/htdocs/core/modules/delivery/mod_delivery_saphir.php +++ b/htdocs/core/modules/delivery/mod_delivery_saphir.php @@ -87,7 +87,7 @@ class mod_delivery_saphir extends ModeleNumRefDeliveryOrder // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= '  '; diff --git a/htdocs/core/modules/expedition/mod_expedition_ribera.php b/htdocs/core/modules/expedition/mod_expedition_ribera.php index 30bd7abd94b..a6394c0df16 100644 --- a/htdocs/core/modules/expedition/mod_expedition_ribera.php +++ b/htdocs/core/modules/expedition/mod_expedition_ribera.php @@ -83,7 +83,7 @@ class mod_expedition_ribera extends ModelNumRefExpedition $tooltip .= '
'.$langs->trans("GenericMaskCodes5b"); $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= '  '; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/expensereport/mod_expensereport_sand.php b/htdocs/core/modules/expensereport/mod_expensereport_sand.php index 0c5962c871e..6f4f091f90e 100644 --- a/htdocs/core/modules/expensereport/mod_expensereport_sand.php +++ b/htdocs/core/modules/expensereport/mod_expensereport_sand.php @@ -87,7 +87,7 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; $mask = getDolGlobalString('EXPENSEREPORT_SAND_MASK'); - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= '  '; diff --git a/htdocs/core/modules/facture/mod_facture_mercure.php b/htdocs/core/modules/facture/mod_facture_mercure.php index 40dc1034642..3d3a93e8154 100644 --- a/htdocs/core/modules/facture/mod_facture_mercure.php +++ b/htdocs/core/modules/facture/mod_facture_mercure.php @@ -84,7 +84,7 @@ class mod_facture_mercure extends ModeleNumRefFactures // Setting the prefix $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceStandard").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1, '', 0, 3, 'tooltipstandardmercure').''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', '', 0, 3, 'tooltipstandardmercure').''; $texte .= '  '; @@ -92,20 +92,20 @@ class mod_facture_mercure extends ModeleNumRefFactures // Prefix setting of credit note $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceAvoir").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1, '', 0, 3, 'tooltipcreditnotemercure').''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', '', 0, 3, 'tooltipcreditnotemercure').''; $texte .= ''; // Prefix setting of replacement invoices if (!getDolGlobalString('INVOICE_DISABLE_REPLACEMENT')) { $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1, '', 0, 3, 'tooltipreplacementmercure').''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', '', 0, 3, 'tooltipreplacementmercure').''; $texte .= ''; } // Prefix setting of deposit if (!getDolGlobalString('INVOICE_DISABLE_DEPOSIT')) { $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceDeposit").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1, '', 0, 3, 'tooltipdownpaymentmercure').''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', '', 0, 3, 'tooltipdownpaymentmercure').''; $texte .= ''; } diff --git a/htdocs/core/modules/fichinter/mod_arctic.php b/htdocs/core/modules/fichinter/mod_arctic.php index 0ac08eb7e06..a23fe52bbf6 100644 --- a/htdocs/core/modules/fichinter/mod_arctic.php +++ b/htdocs/core/modules/fichinter/mod_arctic.php @@ -88,7 +88,7 @@ class mod_arctic extends ModeleNumRefFicheinter // Setting the prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= '  '; diff --git a/htdocs/core/modules/holiday/mod_holiday_immaculate.php b/htdocs/core/modules/holiday/mod_holiday_immaculate.php index 03029517427..c8ed8ec5996 100644 --- a/htdocs/core/modules/holiday/mod_holiday_immaculate.php +++ b/htdocs/core/modules/holiday/mod_holiday_immaculate.php @@ -73,7 +73,7 @@ class mod_holiday_immaculate extends ModelNumRefHolidays //$tooltip .= '
'.$langs->trans("GenericMaskCodes5b"); $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= '  '; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/hrm/mod_evaluation_advanced.php b/htdocs/core/modules/hrm/mod_evaluation_advanced.php index de221e52fee..434512e1cb1 100644 --- a/htdocs/core/modules/hrm/mod_evaluation_advanced.php +++ b/htdocs/core/modules/hrm/mod_evaluation_advanced.php @@ -82,7 +82,7 @@ class mod_evaluation_advanced extends ModeleNumRefEvaluation // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= '  '; diff --git a/htdocs/core/modules/mrp/mod_mo_advanced.php b/htdocs/core/modules/mrp/mod_mo_advanced.php index 255a3e6da43..82286280b8e 100644 --- a/htdocs/core/modules/mrp/mod_mo_advanced.php +++ b/htdocs/core/modules/mrp/mod_mo_advanced.php @@ -83,7 +83,7 @@ class mod_mo_advanced extends ModeleNumRefMos // Parametrage du prefix $text .= ''.$langs->trans("Mask").':'; - $text .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $text .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $text .= '  '; diff --git a/htdocs/core/modules/payment/mod_payment_ant.php b/htdocs/core/modules/payment/mod_payment_ant.php index 3a1fe0a9fad..5e3f0a4b37d 100644 --- a/htdocs/core/modules/payment/mod_payment_ant.php +++ b/htdocs/core/modules/payment/mod_payment_ant.php @@ -85,7 +85,7 @@ class mod_payment_ant extends ModeleNumRefPayments // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= '  '; diff --git a/htdocs/core/modules/product/mod_codeproduct_elephant.php b/htdocs/core/modules/product/mod_codeproduct_elephant.php index 51d3943314c..b0932e24308 100644 --- a/htdocs/core/modules/product/mod_codeproduct_elephant.php +++ b/htdocs/core/modules/product/mod_codeproduct_elephant.php @@ -98,7 +98,7 @@ class mod_codeproduct_elephant extends ModeleProductCode // Parametrage du prefix customers $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("ProductCodeModel").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= '  '; @@ -106,7 +106,7 @@ class mod_codeproduct_elephant extends ModeleProductCode // Parametrage du prefix suppliers $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("ServiceCodeModel").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/product_batch/mod_lot_advanced.php b/htdocs/core/modules/product_batch/mod_lot_advanced.php index 35fa10f867e..d07ce3fd9e3 100644 --- a/htdocs/core/modules/product_batch/mod_lot_advanced.php +++ b/htdocs/core/modules/product_batch/mod_lot_advanced.php @@ -86,7 +86,7 @@ class mod_lot_advanced extends ModeleNumRefBatch // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= '  '; diff --git a/htdocs/core/modules/product_batch/mod_sn_advanced.php b/htdocs/core/modules/product_batch/mod_sn_advanced.php index dfcba97ccaf..18a33833ed3 100644 --- a/htdocs/core/modules/product_batch/mod_sn_advanced.php +++ b/htdocs/core/modules/product_batch/mod_sn_advanced.php @@ -86,7 +86,7 @@ class mod_sn_advanced extends ModeleNumRefBatch // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= '  '; diff --git a/htdocs/core/modules/project/mod_project_universal.php b/htdocs/core/modules/project/mod_project_universal.php index 2be62efa5f3..4132956f86e 100644 --- a/htdocs/core/modules/project/mod_project_universal.php +++ b/htdocs/core/modules/project/mod_project_universal.php @@ -92,7 +92,7 @@ class mod_project_universal extends ModeleNumRefProjects // Prefix settings $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= '  '; diff --git a/htdocs/core/modules/project/task/mod_task_universal.php b/htdocs/core/modules/project/task/mod_task_universal.php index 08cee523fec..4fcb310c941 100644 --- a/htdocs/core/modules/project/task/mod_task_universal.php +++ b/htdocs/core/modules/project/task/mod_task_universal.php @@ -87,7 +87,7 @@ class mod_task_universal extends ModeleNumRefTask // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= '  '; diff --git a/htdocs/core/modules/propale/mod_propale_saphir.php b/htdocs/core/modules/propale/mod_propale_saphir.php index 8f3e6402b63..93ebf4f8298 100644 --- a/htdocs/core/modules/propale/mod_propale_saphir.php +++ b/htdocs/core/modules/propale/mod_propale_saphir.php @@ -90,7 +90,7 @@ class mod_propale_saphir extends ModeleNumRefPropales // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; $mask = !getDolGlobalString('PROPALE_SAPHIR_MASK') ? '' : $conf->global->PROPALE_SAPHIR_MASK; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= '  '; diff --git a/htdocs/core/modules/reception/mod_reception_moonstone.php b/htdocs/core/modules/reception/mod_reception_moonstone.php index 3810da99bb1..a482366fc36 100644 --- a/htdocs/core/modules/reception/mod_reception_moonstone.php +++ b/htdocs/core/modules/reception/mod_reception_moonstone.php @@ -67,7 +67,7 @@ class mod_reception_moonstone extends ModelNumRefReception $tooltip .= '
'.$langs->trans("GenericMaskCodes5b"); $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= '  '; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index 566d7bb70f0..b01fcafb6db 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -110,7 +110,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode // Parametrage du prefix customers $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("CustomerCodeModel").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1, '', 0, 3, 'tooltipelephantcutomer').''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', '', 0, 3, 'tooltipelephantcutomer').''; $texte .= '  '; @@ -118,7 +118,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode // Parametrage du prefix suppliers $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("SupplierCodeModel").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1, '', 0, 3, 'tooltipelephantsupplier').''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', '', 0, 3, 'tooltipelephantsupplier').''; $texte .= ''; // Date of switch to that numbering model diff --git a/htdocs/core/modules/societe/mod_codecompta_aquarium.php b/htdocs/core/modules/societe/mod_codecompta_aquarium.php index 0161aff09d6..868488bd4a2 100644 --- a/htdocs/core/modules/societe/mod_codecompta_aquarium.php +++ b/htdocs/core/modules/societe/mod_codecompta_aquarium.php @@ -87,7 +87,6 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode */ public function info($langs) { - global $conf; global $form; $langs->load("companies"); @@ -100,8 +99,8 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode $texte .= ''; $texte .= ''; $texte .= ''; - $s1 = $form->textwithpicto('', $tooltip, 1, 1); - $s2 = $form->textwithpicto('', $tooltip, 1, 1); + $s1 = $form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name); + $s2 = $form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name); $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php b/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php index 67592bde09a..113549aef15 100644 --- a/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php +++ b/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php @@ -86,7 +86,7 @@ class mod_supplier_payment_brodator extends ModeleNumRefSupplierPayments // Parametrage du prefix $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php index 4eada1d1578..9c83c7d9176 100644 --- a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php +++ b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php @@ -90,7 +90,7 @@ class mod_supplier_proposal_saphir extends ModeleNumRefSupplierProposal // Parametrage du prefix $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/takepos/mod_takepos_ref_universal.php b/htdocs/core/modules/takepos/mod_takepos_ref_universal.php index 2affafe14ba..75768b9f87e 100644 --- a/htdocs/core/modules/takepos/mod_takepos_ref_universal.php +++ b/htdocs/core/modules/takepos/mod_takepos_ref_universal.php @@ -84,7 +84,7 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos // Setting up the prefix $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/ticket/mod_ticket_universal.php b/htdocs/core/modules/ticket/mod_ticket_universal.php index 81b263a931e..dcac49b041a 100644 --- a/htdocs/core/modules/ticket/mod_ticket_universal.php +++ b/htdocs/core/modules/ticket/mod_ticket_universal.php @@ -85,7 +85,7 @@ class mod_ticket_universal extends ModeleNumRefTicket // Prefix settings $text .= ''; - $text .= ''; + $text .= ''; $text .= ''; diff --git a/htdocs/core/modules/workstation/mod_workstation_advanced.php b/htdocs/core/modules/workstation/mod_workstation_advanced.php index f372547a395..c67765e88d8 100644 --- a/htdocs/core/modules/workstation/mod_workstation_advanced.php +++ b/htdocs/core/modules/workstation/mod_workstation_advanced.php @@ -83,7 +83,7 @@ class mod_workstation_advanced extends ModeleNumRefWorkstation // Parametrage du prefix $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php index e5feff9f403..5be97a45988 100644 --- a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php +++ b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php @@ -82,7 +82,7 @@ class mod_recruitmentcandidature_advanced extends ModeleNumRefRecruitmentCandida // Parametrage du prefix $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php index e7d6b1d918c..0ada1a5e802 100644 --- a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php +++ b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php @@ -82,7 +82,7 @@ class mod_recruitmentjobposition_advanced extends ModeleNumRefRecruitmentJobPosi // Parametrage du prefix $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; From 2ddd5180298583130c7c9d52f07028c1526dcc15 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Fri, 13 Dec 2024 18:11:05 +0100 Subject: [PATCH 03/46] Debug v21 --- htdocs/core/class/html.form.class.php | 2 +- htdocs/mrp/mo_production.php | 28 ++++++++++++++++--- .../product/class/html.formproduct.class.php | 1 + .../workstation/class/workstation.class.php | 6 ++-- htdocs/workstation/workstation_card.php | 8 +++--- 5 files changed, 33 insertions(+), 12 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 61763c5af9a..e820a5ddc21 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -10539,7 +10539,7 @@ class Form // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Return select list of groups + * Return select list of user groups * * @param int|object|object[] $selected Id group or group(s) preselected * @param string $htmlname Field name in form diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 8f5e4080fa7..ac250908951 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -494,7 +494,15 @@ if (empty($reshook)) { $moline->array_options["options_".$key] = $value; } $moline->qty = GETPOSTFLOAT('qty_lineProduce'); + if (GETPOSTISSET('warehouse_lineProduce')) { + $moline->fk_warehouse = (GETPOSTINT('warehouse_lineProduce') > 0 ? GETPOSTINT('warehouse_lineProduce') : 0); + } + if (GETPOSTISSET('workstation_lineProduce')) { + $moline->fk_default_workstation = (GETPOSTINT('workstation_lineProduce') > 0 ? GETPOSTINT('workstation_lineProduce') : 0); + } + $res = $moline->update($user); + if ($res < 0) { setEventMessages($moline->error, $moline->errors, 'errors'); header("Location: ".$_SERVER["PHP_SELF"].'?id='.$object->id); @@ -1085,8 +1093,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ' ' . price2num($alreadyconsumed, 'MS'); print ''; - // Entrepot + // Warehouse / Workstation print ''; // Stock @@ -1198,9 +1211,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; // Warehouse and/or workstation - print ''; + print ''; print ''; print '
'; // trans remove html entities $texte .= $langs->trans("ModuleCompanyCodeCustomer".$this->name, '{s2}')."
\n"; diff --git a/htdocs/core/modules/societe/mod_codecompta_digitaria.php b/htdocs/core/modules/societe/mod_codecompta_digitaria.php index 28686db0ed6..857cb2d9521 100644 --- a/htdocs/core/modules/societe/mod_codecompta_digitaria.php +++ b/htdocs/core/modules/societe/mod_codecompta_digitaria.php @@ -112,10 +112,10 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode $texte .= ''; $texte .= ''; $texte .= ''; - $s1 = $form->textwithpicto('', $tooltip, 1, 1); - $s2 = $form->textwithpicto('', $tooltip, 1, 1); - $s3 = $form->textwithpicto('', $tooltip, 1, 1); - $s4 = $form->textwithpicto('', $tooltip, 1, 1); + $s1 = $form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name); + $s2 = $form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name); + $s3 = $form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name); + $s4 = $form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name); $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php index ed15e0e7351..bafa84d20c8 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php @@ -99,7 +99,7 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices // Setting the prefix $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; @@ -107,19 +107,19 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices // Prefix setting of credit note $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; if (!getDolGlobalString('INVOICE_DISABLE_REPLACEMENT') && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { // Prefix setting of replacement $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; } // Prefix setting of deposit $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; $texte .= '
'; // trans remove html entities $texte .= $langs->trans("ModuleCompanyCodeCustomer".$this->name, '{s2}', '{s4}')."
\n"; diff --git a/htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php b/htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php index 62387787668..0bc819da50b 100644 --- a/htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php +++ b/htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php @@ -83,7 +83,7 @@ class mod_stocktransfer_advanced extends ModeleNumRefStockTransfer // Parametrage du prefix $texte .= '
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'.$langs->trans("Mask").' ('.$langs->trans("InvoiceStandard").')'; $texte .= ':'.$form->textwithpicto('', $tooltip, 1, 1, '', 0, 3, 'tooltipstandardtulip').''.$form->textwithpicto('', $tooltip, 1, 'help', '', 0, 3, 'tooltipstandardtulip').' 
'.$langs->trans("Mask").' ('.$langs->trans("InvoiceAvoir").'):'.$form->textwithpicto('', $tooltip, 1, 1, '', 0, 3, 'tooltipcredittuplie').''.$form->textwithpicto('', $tooltip, 1, 'help', '', 0, 3, 'tooltipcredittuplie').'
'.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):'.$form->textwithpicto('', $tooltip, 1, 1, '', 0, 3, 'tooltipreplacementtulip').''.$form->textwithpicto('', $tooltip, 1, 'help', '', 0, 3, 'tooltipreplacementtulip').'
'.$langs->trans("Mask").' ('.$langs->trans("InvoiceDeposit").'):'.$form->textwithpicto('', $tooltip, 1, 1, '', 0, 3, 'tooltipdownpaymenttulip').''.$form->textwithpicto('', $tooltip, 1, 'help', '', 0, 3, 'tooltipdownpaymenttulip').'
'; diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php index 350e22302ea..707b64505d6 100644 --- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php +++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php @@ -91,7 +91,7 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders // Parametrage du prefix $texte .= '
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1, '', 0, 3, 'tooltiporchidee').''.$form->textwithpicto('', $tooltip, 1, 'help', '', 0, 3, 'tooltiporchidee').' 
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).'
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).'  '; + if ($tmpproduct->type == Product::TYPE_PRODUCT) { + print $formproduct->selectWarehouses($line->fk_warehouse, 'warehouse_lineProduce', 'warehouseopen', 1); + } elseif (isModEnabled('workstation')) { + print $formproduct->selectWorkstations($line->fk_default_workstation, 'workstation_lineProduce', 1); + } print ''; - if (getDolGlobalString('STOCK_CONSUMPTION_FROM_MANUFACTURING_WAREHOUSE') && $tmpwarehouse->id > 0) { - print img_picto('', $tmpwarehouse->picto) . " " . $tmpwarehouse->label; + print ''; + if ($tmpproduct->isStockManaged()) { + // When STOCK_CONSUMPTION_FROM_MANUFACTURING_WAREHOUSE is set, we always use the warehouse of the MO, the same than production. + if (getDolGlobalString('STOCK_CONSUMPTION_FROM_MANUFACTURING_WAREHOUSE') && $tmpwarehouse->id > 0) { + print img_picto('', $tmpwarehouse->picto) . " " . $tmpwarehouse->label; + } else { + $warehouseline = new Entrepot($db); + $warehouseline->fetch($line->fk_warehouse); + print $warehouseline->getNomUrl(1); + } } if (isModEnabled('workstation') && $line->fk_default_workstation > 0) { $tmpworkstation = new Workstation($db); diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index bc8a42046a2..2b2c1d0a198 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -335,6 +335,7 @@ class FormProduct } } + $out .= ''; $out .= '
'; - print $langs->trans('Groups'); + print '
'; + print $langs->trans('UserGroups'); print ''; print img_picto('', 'group'); @@ -288,7 +288,7 @@ if (($id || $ref) && $action == 'edit') { print '
'; - print $langs->trans('Groups'); + print $langs->trans('UserGroups'); print ''; print img_picto('', 'group'); From c00d07e790e8974eb2e0cd56f91eb4698b0ddae7 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Fri, 13 Dec 2024 18:13:08 +0100 Subject: [PATCH 04/46] Debug v21 --- htdocs/mrp/mo_production.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index ac250908951..bd40cf7ed2e 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -1217,9 +1217,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (getDolGlobalString('STOCK_CONSUMPTION_FROM_MANUFACTURING_WAREHOUSE') && $tmpwarehouse->id > 0) { print img_picto('', $tmpwarehouse->picto) . " " . $tmpwarehouse->label; } else { - $warehouseline = new Entrepot($db); - $warehouseline->fetch($line->fk_warehouse); - print $warehouseline->getNomUrl(1); + if ($line->fk_warehouse > 0) { + $warehouseline = new Entrepot($db); + $warehouseline->fetch($line->fk_warehouse); + print $warehouseline->getNomUrl(1); + } } } if (isModEnabled('workstation') && $line->fk_default_workstation > 0) { From 8673588274b9fc2b3262dcf9f93c73b0e36ab8f6 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Fri, 13 Dec 2024 20:26:32 +0100 Subject: [PATCH 05/46] Debug v21 --- htdocs/mrp/js/lib_dispatch.js.php | 27 +++++++++++-------- htdocs/mrp/mo_production.php | 45 +++++++++++++++++++++++-------- htdocs/theme/eldy/global.inc.php | 5 +++- htdocs/theme/md/style.css.php | 16 +++-------- 4 files changed, 57 insertions(+), 36 deletions(-) diff --git a/htdocs/mrp/js/lib_dispatch.js.php b/htdocs/mrp/js/lib_dispatch.js.php index c36c59b6f3b..d63cc494c2b 100644 --- a/htdocs/mrp/js/lib_dispatch.js.php +++ b/htdocs/mrp/js/lib_dispatch.js.php @@ -76,14 +76,14 @@ if (empty($dolibarr_nocache)) { * * @param index int index of product line. 0 = first product line * @param type string type of dispatch (batch = batch dispatch, dispatch = non batch dispatch) - * @param mode string 'qtymissing' will create new line with qty missing, 'lessone' will keep 1 in old line and the rest in new one + * @param mode string If mode is 'qtymissing' the split button will create a new line with qty missing, If 'lessone' it will keep 1 in old line and the rest in new one */ function addDispatchLine(index, type, mode) { mode = mode || 'qtymissing' console.log("mrp/js/lib_dispatch.js.php Split line type="+type+" index="+index+" mode="+mode); - if(mode == 'qtymissingconsume' || mode == 'allmissingconsume') { + if (mode == 'qtymissingconsume' || mode == 'allmissingconsume') { var inputId = 'qtytoconsume'; var warehouseId = 'idwarehouse'; } @@ -94,7 +94,10 @@ function addDispatchLine(index, type, mode) var nbrTrs = $("tr[name^='"+type+"_"+index+"']").length; // position of line for batch var $row = $("tr[name='"+type+'_'+index+"_1']").clone(true); // clone last batch line to jQuery object var qtyOrdered = parseFloat($("#qty_ordered_"+index).val()); // Qty ordered is same for all rows - var qty = parseFloat($("#"+inputId+"-"+index+"-"+nbrTrs).val()); + var qty = parseFloat($("#"+inputId+"-"+index+"-"+nbrTrs).val()); // qty entered in field to consume + + console.log("#"+inputId+"-"+index+"-"+nbrTrs+" => "+qty); + var qtyDispatched; if (mode === 'lessone') @@ -103,21 +106,22 @@ function addDispatchLine(index, type, mode) } else { - qtyDispatched = parseFloat($("#qty_dispatched_"+index).val()) + qty; console.log($("#qty_dispatched_"+index).val()); + qtyDispatched = parseFloat($("#qty_dispatched_"+index).val()) + qty; // If user did not reduced the qty to dispatch on old line, we keep only 1 on old line and the rest on new line if (qtyDispatched == qtyOrdered && qtyDispatched > 1) { qtyDispatched = parseFloat($("#qty_dispatched_" + index).val()) + 1; - } - if(mode == 'allmissingconsume' || mode == 'alltoproduce') { - var qtymax = parseFloat($($row).data('max-qty')); - if(qtymax === 'undefined') qtymax = 1; + if (mode == 'allmissingconsume' || mode == 'alltoproduce') { + var qtymax = parseFloat($($row).data('max-qty')); + if (qtymax === 'undefined') { + qtymax = 1; + } } } - if(mode == 'allmissingconsume' || mode == 'alltoproduce') { + if (mode == 'allmissingconsume' || mode == 'alltoproduce') { var count = 0; var qtyalreadyused = 0; var error = 0; @@ -141,11 +145,12 @@ function addDispatchLine(index, type, mode) $row = $("tr[name='" + type + '_' + index + "_1']").clone(true); } - if(error === 0) { + if (error === 0) { addDispatchTR(qtyOrdered, qtyDispatched, index, nbrTrs, warehouseId, inputId, type, '', mode, $row); } + } else { + addDispatchTR(qtyOrdered, qtyDispatched, index, nbrTrs, warehouseId, inputId, type, qty, mode, $row); } - else addDispatchTR(qtyOrdered, qtyDispatched, index, nbrTrs, warehouseId, inputId, type, qty, mode, $row) } diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index bd40cf7ed2e..bd701a4cf99 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -213,10 +213,21 @@ if (empty($reshook)) { $tmpproduct->fetch($moline->fk_product); if ($tmpproduct->type == Product::TYPE_SERVICE) { $moline->fk_default_workstation = $tmpproduct->fk_default_workstation; - } - $moline->disable_stock_change = ($tmpproduct->type == Product::TYPE_SERVICE ? 1 : 0); - if (getDolGlobalInt('PRODUCT_USE_UNITS')) { - $moline->fk_unit = $tmpproduct->fk_unit; + $moline->disable_stock_change = 1; + if ($tmpproduct->duration_unit) { + $moline->qty = $tmpproduct->duration_value; + include_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php'; + $cunits = new CUnits($db); + $res = $cunits->fetch(0, '', $tmpproduct->duration_unit, 'time'); + if ($res > 0) { + $moline->fk_unit = $cunits->id; + } + } + } else { + $moline->disable_stock_change = 0; + if (getDolGlobalInt('PRODUCT_USE_UNITS')) { + $moline->fk_unit = $tmpproduct->fk_unit; + } } } // Extrafields @@ -859,7 +870,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; print ''."\n"; - print ''; + print ''; // Product print ''; // Qty @@ -871,7 +882,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; } // Qty already consumed - print ''; + print ''; // Warehouse print ''; // Unit - print ''; + print ''; // Cost price if ($permissiontoupdatecost && getDolGlobalString('MRP_SHOW_COST_FOR_CONSUMPTION')) { print ''; @@ -1521,7 +1538,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'; print '
'.$langs->trans("Product").''.$langs->trans("UnitCost").''.$form->textwithpicto($langs->trans("QtyAlreadyConsumedShort"), $langs->trans("QtyAlreadyConsumed")).''; + print $langs->trans("QtyAlreadyConsumedShort"); + print ''; if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) { @@ -936,7 +949,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Qty print ''; + if (getDolGlobalInt('PRODUCT_USE_UNITS')) { + //... + } + print '
'; - print ''; + print ''; // Product print ''; // Qty @@ -1533,13 +1550,19 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Cost price if ($permissiontoupdatecost) { if (empty($bomcostupdated)) { - print ''; + print ''; } else { - print ''; + print ''; } } // Already produced - print ''; + print ''; // Warehouse print ''; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php b/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php index 69278d4643f..cf3cb3135a4 100644 --- a/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php @@ -131,7 +131,7 @@ class mod_barcode_thirdparty_standard extends ModeleNumRefBarCode // Mask parameter //$texte.= ''; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; $texte .= ''; From da26fdbb38c08ba05f54c15e544faf8a3478bafa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sat, 14 Dec 2024 09:44:19 +0100 Subject: [PATCH 08/46] test phan baseline --- dev/tools/phan/baseline.txt | 127 +++++++++++++++++++----------------- 1 file changed, 67 insertions(+), 60 deletions(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index 220cdb76c5f..d69db0e405e 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -10,43 +10,43 @@ return [ // # Issue statistics: // PhanUndeclaredProperty : 560+ occurrences - // PhanPossiblyUndeclaredGlobalVariable : 350+ occurrences - // PhanUndeclaredGlobalVariable : 300+ occurrences + // PhanPossiblyUndeclaredGlobalVariable : 320+ occurrences + // PhanUndeclaredGlobalVariable : 290+ occurrences // PhanTypeMismatchArgumentProbablyReal : 230+ occurrences // PhanPluginUnknownArrayMethodReturnType : 180+ occurrences - // PhanTypeMismatchProperty : 140+ occurrences + // PhanTypeMismatchProperty : 130+ occurrences // PhanPluginUnknownArrayMethodParamType : 120+ occurrences - // PhanPluginUnknownPropertyType : 120+ occurrences + // PhanPluginUnknownPropertyType : 110+ occurrences // PhanPossiblyUndeclaredVariable : 80+ occurrences - // PhanPluginUndeclaredVariableIsset : 60+ occurrences // PhanRedefineFunction : 45+ occurrences // PhanTypeExpectedObjectPropAccess : 45+ occurrences // PhanTypeMismatchArgumentNullableInternal : 40+ occurrences + // PhanPluginSuspiciousParamOrder : 35+ occurrences // PhanTypeInvalidDimOffset : 30+ occurrences // PhanTypeMismatchDimFetch : 30+ occurrences // PhanPluginEmptyStatementIf : 15+ occurrences - // PhanUndeclaredConstant : 15+ occurrences // PhanPluginUnknownObjectMethodCall : 10+ occurrences // PhanTypeComparisonFromArray : 10+ occurrences // PhanTypeMismatchDimFetchNullable : 10+ occurrences // PhanUndeclaredMethod : 10+ occurrences // PhanEmptyForeach : 8 occurrences - // PhanTypeArraySuspiciousNull : 8 occurrences // PhanPluginBothLiteralsBinaryOp : 7 occurrences // PhanPluginDuplicateExpressionBinaryOp : 7 occurrences // PhanPluginSuspiciousParamPosition : 7 occurrences + // PhanTypeArraySuspiciousNull : 6 occurrences + // PhanParamTooMany : 5 occurrences // PhanPossiblyNullTypeMismatchProperty : 5 occurrences - // PhanParamTooMany : 4 occurrences - // PhanPluginDuplicateArrayKey : 4 occurrences // PhanEmptyFQSENInClasslike : 3 occurrences // PhanInvalidFQSENInClasslike : 3 occurrences // PhanTypeMismatchReturn : 3 occurrences // PhanTypeExpectedObjectPropAccessButGotNull : 2 occurrences // PhanTypeMismatchDimAssignment : 2 occurrences // PhanTypeSuspiciousStringExpression : 2 occurrences + // PhanUndeclaredTypeParameter : 2 occurrences // PhanAccessMethodProtected : 1 occurrence // PhanPluginUnknownArrayPropertyType : 1 occurrence // PhanTypeConversionFromArray : 1 occurrence + // PhanTypeMismatchArgumentInternalProbablyReal : 1 occurrence // Currently, file_suppressions and directory_suppressions are the only supported suppressions 'file_suppressions' => [ @@ -60,7 +60,7 @@ return [ 'htdocs/api/class/api_login.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/api/class/api_setup.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/api/class/api_status.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/asset/class/asset.class.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeInvalidDimOffset'], + 'htdocs/asset/class/asset.class.php' => ['PhanTypeInvalidDimOffset'], 'htdocs/asset/class/assetdepreciationoptions.class.php' => ['PhanTypeInvalidDimOffset'], 'htdocs/asset/class/assetmodel.class.php' => ['PhanUndeclaredProperty'], 'htdocs/asset/tpl/accountancy_codes_edit.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal'], @@ -106,7 +106,6 @@ return [ 'htdocs/compta/bank/various_payment/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/compta/bank/various_payment/document.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/compta/bank/various_payment/info.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/compta/bank/various_payment/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty'], 'htdocs/compta/cashcontrol/cashcontrol_card.php' => ['PhanPluginDuplicateExpressionBinaryOp'], 'htdocs/compta/cashcontrol/cashcontrol_list.php' => ['PhanTypeMismatchProperty'], 'htdocs/compta/clients.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], @@ -134,13 +133,12 @@ return [ 'htdocs/core/actions_addupdatedelete.inc.php' => ['PhanTypeMismatchDimFetch', 'PhanUndeclaredProperty'], 'htdocs/core/actions_massactions.inc.php' => ['PhanUndeclaredProperty'], 'htdocs/core/actions_printing.inc.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/actions_sendmails.inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/core/actions_sendmails.inc.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/core/ajax/ajaxdirtree.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/class/canvas.class.php' => ['PhanParamTooMany', 'PhanUndeclaredMethod'], 'htdocs/core/class/ccountry.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/cgenericdic.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/commonobject.class.php' => ['PhanParamTooMany', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/core/class/commonorder.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/class/commonpeople.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/commonsocialnetworks.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/conf.class.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchProperty'], @@ -153,6 +151,7 @@ return [ 'htdocs/core/class/html.formcompany.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/html.formfile.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/html.formmail.class.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/class/ldap.class.php' => ['PhanTypeMismatchArgumentInternalProbablyReal'], 'htdocs/core/class/notify.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/smtps.class.php' => ['PhanTypeConversionFromArray'], 'htdocs/core/class/timespent.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'], @@ -170,49 +169,65 @@ return [ 'htdocs/core/lib/project.lib.php' => ['PhanUndeclaredProperty'], 'htdocs/core/lib/xcal.lib.php' => ['PhanUndeclaredProperty'], 'htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/modules/asset/mod_asset_advanced.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/modules/asset/mod_asset_advanced.php' => ['PhanPluginSuspiciousParamOrder', 'PhanUndeclaredProperty'], 'htdocs/core/modules/barcode/doc/phpbarcode.modules.php' => ['PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredVariable'], - 'htdocs/core/modules/barcode/mod_barcode_product_standard.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/core/modules/bom/mod_bom_advanced.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/modules/barcode/mod_barcode_product_standard.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginUnknownPropertyType'], + 'htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php' => ['PhanPluginSuspiciousParamOrder'], + 'htdocs/core/modules/bom/mod_bom_advanced.php' => ['PhanPluginSuspiciousParamOrder', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/cheque/mod_chequereceipt_thyme.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/commande/doc/pdf_einstein.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/commande/mod_commande_saphir.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/commande/modules_commande.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/modules/contract/doc/pdf_strato.modules.php' => ['PhanTypeMismatchArgumentNullableInternal'], + 'htdocs/core/modules/contract/mod_contract_magre.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/delivery/doc/pdf_storm.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/delivery/doc/pdf_typhon.modules.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/core/modules/delivery/mod_delivery_saphir.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/modules/delivery/mod_delivery_saphir.php' => ['PhanPluginSuspiciousParamOrder', 'PhanUndeclaredProperty'], 'htdocs/core/modules/expedition/doc/pdf_merou.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/core/modules/expedition/mod_expedition_ribera.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/expensereport/mod_expensereport_sand.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/facture/doc/pdf_crabe.modules.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/modules/facture/doc/pdf_octopus.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/core/modules/facture/doc/pdf_sponge.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/core/modules/facture/modules_facture.php' => ['PhanPluginUnknownPropertyType'], + 'htdocs/core/modules/fichinter/mod_arctic.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/fichinter/mod_pacific.php' => ['PhanPossiblyUndeclaredVariable'], + 'htdocs/core/modules/holiday/mod_holiday_immaculate.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/hrm/mod_evaluation_advanced.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/modules/hrm/mod_evaluation_advanced.php' => ['PhanPluginSuspiciousParamOrder', 'PhanUndeclaredProperty'], 'htdocs/core/modules/import/import_csv.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty'], 'htdocs/core/modules/import/import_xlsx.modules.php' => ['PhanTypeMismatchProperty'], 'htdocs/core/modules/mailings/contacts1.modules.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/mailings/thirdparties.modules.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginEmptyStatementIf', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/mrp/mod_mo_advanced.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/modules/mrp/mod_mo_advanced.php' => ['PhanPluginSuspiciousParamOrder', 'PhanUndeclaredProperty'], 'htdocs/core/modules/oauth/github_oauthcallback.php' => ['PhanUndeclaredGlobalVariable'], + 'htdocs/core/modules/payment/mod_payment_ant.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/printing/printgcp.modules.php' => ['PhanTypeMismatchDimFetch'], 'htdocs/core/modules/product/doc/pdf_standard.modules.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable'], + 'htdocs/core/modules/product/mod_codeproduct_elephant.php' => ['PhanPluginSuspiciousParamOrder'], + 'htdocs/core/modules/product_batch/mod_lot_advanced.php' => ['PhanPluginSuspiciousParamOrder'], + 'htdocs/core/modules/product_batch/mod_sn_advanced.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php' => ['PhanUndeclaredProperty'], 'htdocs/core/modules/project/doc/pdf_timespent.modules.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/modules/project/mod_project_universal.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/project/task/mod_task_universal.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/propale/doc/pdf_azur.modules.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/modules/propale/doc/pdf_cyan.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/propale/mod_propale_saphir.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/propale/modules_propale.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/modules/reception/doc/pdf_squille.modules.php' => ['PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/societe/mod_codecompta_aquarium.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/core/modules/societe/mod_codecompta_digitaria.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'], + 'htdocs/core/modules/reception/mod_reception_moonstone.php' => ['PhanPluginSuspiciousParamOrder'], + 'htdocs/core/modules/societe/mod_codecompta_aquarium.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginUnknownPropertyType'], + 'htdocs/core/modules/societe/mod_codecompta_digitaria.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'], 'htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php' => ['PhanPluginSuspiciousParamOrder', 'PhanUndeclaredProperty'], 'htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], 'htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php' => ['PhanPossiblyUndeclaredVariable'], @@ -221,24 +236,24 @@ return [ 'htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/modules/supplier_order/modules_commandefournisseur.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php' => ['PhanPluginUnknownPropertyType'], + 'htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/syslog/mod_syslog_file.php' => ['PhanPluginDuplicateArrayKey'], + 'htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php' => ['PhanPluginSuspiciousParamOrder'], + 'htdocs/core/modules/takepos/mod_takepos_ref_universal.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php' => ['PhanPossiblyUndeclaredVariable'], + 'htdocs/core/modules/ticket/mod_ticket_universal.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php' => ['PhanPossiblyUndeclaredVariable'], - 'htdocs/core/modules/workstation/mod_workstation_advanced.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/modules/workstation/mod_workstation_advanced.php' => ['PhanPluginSuspiciousParamOrder', 'PhanUndeclaredProperty'], 'htdocs/core/search_page.php' => ['PhanEmptyForeach', 'PhanPluginBothLiteralsBinaryOp'], - 'htdocs/core/tpl/ajaxrow.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable'], + 'htdocs/core/tpl/ajaxrow.tpl.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/commonfields_view.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/core/tpl/document_actions_post_headers.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable'], - 'htdocs/core/tpl/extrafields_edit.tpl.php' => ['PhanPluginUndeclaredVariableIsset'], - 'htdocs/core/tpl/extrafields_list_search_title.tpl.php' => ['PhanPluginUndeclaredVariableIsset'], + 'htdocs/core/tpl/document_actions_post_headers.tpl.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/extrafields_view.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/tpl/filemanager.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredGlobalVariable'], - 'htdocs/core/tpl/formlayoutai.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable'], - 'htdocs/core/tpl/list_print_total.tpl.php' => ['PhanPluginUndeclaredVariableIsset'], - 'htdocs/core/tpl/massactions_pre.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/core/tpl/notes.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/core/tpl/filemanager.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredGlobalVariable'], + 'htdocs/core/tpl/formlayoutai.tpl.php' => ['PhanUndeclaredGlobalVariable'], + 'htdocs/core/tpl/massactions_pre.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/core/tpl/notes.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/tpl/object_discounts.tpl.php' => ['PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/objectline_create.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/objectline_view.tpl.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], @@ -262,11 +277,10 @@ return [ 'htdocs/delivery/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/document.php' => ['PhanRedefineFunction'], 'htdocs/don/admin/donation.php' => ['PhanUndeclaredMethod'], - 'htdocs/don/card.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/don/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/don/class/api_donations.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/don/class/don.class.php' => ['PhanParamTooMany'], 'htdocs/don/document.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], - 'htdocs/don/index.php' => ['PhanPluginUndeclaredVariableIsset'], 'htdocs/don/info.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/don/list.php' => ['PhanTypeMismatchProperty'], 'htdocs/don/note.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], @@ -277,9 +291,9 @@ return [ 'htdocs/ecm/dir_card.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/ecm/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/emailcollector/class/emailcollector.class.php' => ['PhanUndeclaredProperty'], + 'htdocs/emailcollector/lib/emailcollector.lib.php' => ['PhanUndeclaredTypeParameter'], 'htdocs/eventorganization/class/conferenceorboothattendee.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/eventorganization/conferenceorbooth_card.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/eventorganization/conferenceorbooth_contact.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/eventorganization/conferenceorbooth_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/eventorganization/conferenceorboothattendee_card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/eventorganization/conferenceorboothattendee_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], @@ -303,12 +317,12 @@ return [ 'htdocs/expensereport/tpl/expensereport_linktofile.tpl.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/expensereport/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/externalsite/frames.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/fichinter/card-rec.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/fichinter/card-rec.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/fichinter/class/api_interventions.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'], 'htdocs/fichinter/class/fichinterrec.class.php' => ['PhanUndeclaredProperty'], 'htdocs/fichinter/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/fichinter/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/filefunc.inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], + 'htdocs/filefunc.inc.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/fourn/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/fourn/class/api_supplier_invoices.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/fourn/class/api_supplier_orders.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'], @@ -325,7 +339,7 @@ return [ 'htdocs/fourn/facture/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty'], 'htdocs/fourn/facture/list-rec.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/fourn/facture/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/fourn/facture/paiement.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], + 'htdocs/fourn/facture/paiement.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/fourn/paiement/card.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/fourn/paiement/document.php' => ['PhanTypeMismatchArgumentProbablyReal'], @@ -353,12 +367,10 @@ return [ 'htdocs/imports/emptyexample.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/imports/import.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/install/check.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'], - 'htdocs/install/fileconf.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/install/inc.php' => ['PhanPluginUndeclaredVariableIsset'], + 'htdocs/install/fileconf.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/install/index.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/install/repair.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable'], + 'htdocs/install/repair.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/install/step2.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'], - 'htdocs/install/step5.php' => ['PhanPluginUndeclaredVariableIsset'], 'htdocs/install/upgrade.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/intracommreport/card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], @@ -376,7 +388,7 @@ return [ 'htdocs/mrp/class/mo.class.php' => ['PhanTypeMismatchProperty'], 'htdocs/mrp/mo_card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/mrp/mo_movements.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable'], - 'htdocs/mrp/mo_production.php' => ['PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/mrp/mo_production.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/mrp/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/mrp/tpl/originproductline.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/multicurrency/class/api_multicurrencies.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], @@ -384,7 +396,6 @@ return [ 'htdocs/opcachepreload.php' => ['PhanEmptyForeach'], 'htdocs/opensurvey/card.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/opensurvey/class/opensurveysondage.class.php' => ['PhanTypeMismatchProperty'], - 'htdocs/opensurvey/list.php' => ['PhanPluginUndeclaredVariableIsset'], 'htdocs/opensurvey/results.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'], 'htdocs/opensurvey/wizard/choix_date.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/opensurvey/wizard/create_survey.php' => ['PhanPossiblyUndeclaredGlobalVariable'], @@ -401,12 +412,11 @@ return [ 'htdocs/product/class/html.formproduct.class.php' => ['PhanUndeclaredProperty'], 'htdocs/product/class/productfournisseurprice.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/product/document.php' => ['PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/product/index.php' => ['PhanPluginUndeclaredVariableIsset'], 'htdocs/product/inventory/card.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/product/inventory/class/inventory.class.php' => ['PhanUndeclaredProperty'], 'htdocs/product/inventory/inventory.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/product/inventory/list.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/product/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable'], + 'htdocs/product/list.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/product/price.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/product/reassort.php' => ['PhanTypeExpectedObjectPropAccessButGotNull'], 'htdocs/product/stats/card.php' => ['PhanTypeComparisonFromArray'], @@ -417,8 +427,8 @@ return [ 'htdocs/product/stock/class/mouvementstock.class.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/product/stock/info.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/product/stock/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/product/stock/movement_card.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/product/stock/movement_list.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/product/stock/movement_card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/product/stock/movement_list.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/product/stock/product.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/product/stock/productlot_card.php' => ['PhanUndeclaredProperty'], 'htdocs/product/stock/productlot_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], @@ -442,7 +452,7 @@ return [ 'htdocs/projet/element.php' => ['PhanUndeclaredProperty'], 'htdocs/projet/ganttchart.inc.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/projet/ganttview.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/projet/graph_opportunities.inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable'], + 'htdocs/projet/graph_opportunities.inc.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/projet/index.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/projet/list.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/projet/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], @@ -453,11 +463,11 @@ return [ 'htdocs/projet/tasks/list.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/projet/tasks/note.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/projet/tasks/task.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/projet/tasks/time.php' => ['PhanEmptyForeach', 'PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/projet/tasks/time.php' => ['PhanEmptyForeach', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/projet/tasks/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/public/agenda/agendaexport.php' => ['PhanRedefineFunction'], 'htdocs/public/bookcal/index.php' => ['PhanRedefineFunction'], - 'htdocs/public/company/new.php' => ['PhanRedefineFunction', 'PhanUndeclaredGlobalVariable'], + 'htdocs/public/company/new.php' => ['PhanRedefineFunction'], 'htdocs/public/cron/cron_run_jobs_by_url.php' => ['PhanUndeclaredProperty'], 'htdocs/public/demo/index.php' => ['PhanRedefineFunction'], 'htdocs/public/donations/donateurs_code.php' => ['PhanRedefineFunction'], @@ -480,7 +490,6 @@ return [ 'htdocs/public/project/viewandvote.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/public/recruitment/view.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/public/stripe/ipn.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], - 'htdocs/public/test/test_arrays.php' => ['PhanPluginUndeclaredVariableIsset'], 'htdocs/public/ticket/create_ticket.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchDimFetchNullable', 'PhanTypeMismatchProperty'], 'htdocs/public/ticket/view.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/public/webportal/tpl/menu.tpl.php' => ['PhanUndeclaredProperty'], @@ -492,15 +501,15 @@ return [ 'htdocs/reception/class/reception.class.php' => ['PhanUndeclaredProperty'], 'htdocs/reception/contact.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/reception/dispatch.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/reception/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/reception/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/reception/note.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/recruitment/admin/setup.php' => ['PhanEmptyForeach'], 'htdocs/recruitment/admin/setup_candidatures.php' => ['PhanEmptyForeach'], 'htdocs/recruitment/class/recruitmentcandidature.class.php' => ['PhanUndeclaredProperty'], 'htdocs/recruitment/class/recruitmentjobposition.class.php' => ['PhanUndeclaredProperty'], 'htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php' => ['PhanUndeclaredProperty'], - 'htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php' => ['PhanUndeclaredProperty'], + 'htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php' => ['PhanPluginSuspiciousParamOrder', 'PhanUndeclaredProperty'], + 'htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php' => ['PhanPluginSuspiciousParamOrder', 'PhanUndeclaredProperty'], 'htdocs/recruitment/index.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/recruitment/recruitmentcandidature_card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/recruitment/recruitmentcandidature_list.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], @@ -522,7 +531,7 @@ return [ 'htdocs/societe/class/api_thirdparties.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/societe/class/societe.class.php' => ['PhanTypeMismatchProperty'], 'htdocs/societe/consumption.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/societe/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/societe/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/societe/paymentmodes.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredGlobalVariable'], 'htdocs/societe/price.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/societe/tpl/linesalesrepresentative.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal'], @@ -536,10 +545,9 @@ return [ 'htdocs/takepos/ajax/ajax.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/takepos/floors.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/takepos/freezone.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/takepos/index.php' => ['PhanPluginUndeclaredVariableIsset'], 'htdocs/takepos/invoice.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/takepos/pay.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/takepos/split.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/takepos/split.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/theme/eldy/badges.inc.php' => ['PhanRedefineFunction'], 'htdocs/theme/eldy/btn.inc.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/theme/eldy/dropdown.inc.php' => ['PhanUndeclaredGlobalVariable'], @@ -597,7 +605,6 @@ return [ 'htdocs/workstation/workstation_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/zapier/class/api_zapier.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/zapier/class/hook.class.php' => ['PhanUndeclaredProperty'], - 'internal' => ['PhanUndeclaredConstant'], ], // 'directory_suppressions' => ['src/directory_name' => ['PhanIssueName1', 'PhanIssueName2']] can be manually added if needed. // (directory_suppressions will currently be ignored by subsequent calls to --save-baseline, but may be preserved in future Phan releases) From 55ef8bfe5c5cebc0e1a1f731b2837acf75802755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sat, 14 Dec 2024 11:52:45 +0100 Subject: [PATCH 09/46] fix phpstan --- build/phpstan/phpstan-baseline.neon | 48 -------------------------- htdocs/bom/tpl/objectline_edit.tpl.php | 30 ++++++++++------ 2 files changed, 20 insertions(+), 58 deletions(-) diff --git a/build/phpstan/phpstan-baseline.neon b/build/phpstan/phpstan-baseline.neon index 049fc06a132..4da318ff886 100644 --- a/build/phpstan/phpstan-baseline.neon +++ b/build/phpstan/phpstan-baseline.neon @@ -2850,24 +2850,6 @@ parameters: count: 1 path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - - message: '#^Cannot access property \$db on mixed\.$#' - identifier: property.nonObject - count: 1 - path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - - - message: '#^Variable \$action might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - - - message: '#^Variable \$buyer might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - message: '#^Variable \$dateSelector might not be defined\.$#' identifier: variable.undefined @@ -2880,42 +2862,12 @@ parameters: count: 1 path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - - message: '#^Variable \$i might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - message: '#^Variable \$langs might not be defined\.$#' identifier: variable.undefined count: 2 path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - - message: '#^Variable \$line might not be defined\.$#' - identifier: variable.undefined - count: 20 - path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - - - message: '#^Variable \$seller might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - - - message: '#^Variable \$this might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - - - message: '#^Variable \$var might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue diff --git a/htdocs/bom/tpl/objectline_edit.tpl.php b/htdocs/bom/tpl/objectline_edit.tpl.php index 4ae80f95915..336c4095a78 100644 --- a/htdocs/bom/tpl/objectline_edit.tpl.php +++ b/htdocs/bom/tpl/objectline_edit.tpl.php @@ -1,13 +1,13 @@ - * Copyright (C) 2010-2012 Laurent Destailleur - * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2012 Cédric Salvador - * Copyright (C) 2012-2014 Raphaël Doursenaud - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2018 Frédéric France - * Copyright (C) 2024 Vincent Maury - * Copyright (C) 2024 MDW +/* Copyright (C) 2010-2012 Regis Houssin + * Copyright (C) 2010-2012 Laurent Destailleur + * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2012 Cédric Salvador + * Copyright (C) 2012-2014 Raphaël Doursenaud + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2024 Vincent Maury + * 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 @@ -34,7 +34,17 @@ */ require_once DOL_DOCUMENT_ROOT."/product/class/html.formproduct.class.php"; - +/** + * @var CommonObject $this + * @var CommonObject $object + * @var BOMLine $line + * @var Societe $buyer + * @var Societe $seller + * + * @var string $action + * @var int $i + * @var bool $var + */ // Protection to avoid direct call of template if (empty($object) || !is_object($object)) { From a0e3f617e855d4e5e2302403a220c64e0eb33558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sat, 14 Dec 2024 13:05:41 +0100 Subject: [PATCH 10/46] fix phpstan --- htdocs/bom/tpl/objectline_edit.tpl.php | 4 +++- htdocs/bom/tpl/objectline_view.tpl.php | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/bom/tpl/objectline_edit.tpl.php b/htdocs/bom/tpl/objectline_edit.tpl.php index 336c4095a78..48fa81082b1 100644 --- a/htdocs/bom/tpl/objectline_edit.tpl.php +++ b/htdocs/bom/tpl/objectline_edit.tpl.php @@ -35,11 +35,13 @@ require_once DOL_DOCUMENT_ROOT."/product/class/html.formproduct.class.php"; /** + * @var BOMLine $line * @var CommonObject $this * @var CommonObject $object - * @var BOMLine $line + * @var HookManager $hookmanager * @var Societe $buyer * @var Societe $seller + * @var Translate $langs * * @var string $action * @var int $i diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 1c2c615a138..def20558866 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -45,6 +45,7 @@ * * @var int $i * @var int $num + * @var string $action */ ' @phan-var-force CommonObjectLine $line From 2d6389873a69ebbd218eb7d02caa96d8815e1843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sat, 14 Dec 2024 13:32:42 +0100 Subject: [PATCH 11/46] fix phpstan --- build/phpstan/phpstan-baseline.neon | 48 ------------------- .../tpl/depreciation_options_view.tpl.php | 5 +- htdocs/asset/tpl/depreciation_view.tpl.php | 9 +++- 3 files changed, 10 insertions(+), 52 deletions(-) diff --git a/build/phpstan/phpstan-baseline.neon b/build/phpstan/phpstan-baseline.neon index 4da318ff886..63edb325065 100644 --- a/build/phpstan/phpstan-baseline.neon +++ b/build/phpstan/phpstan-baseline.neon @@ -2562,42 +2562,12 @@ parameters: count: 1 path: ../../htdocs/asset/tpl/depreciation_options_view.tpl.php - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 7 - path: ../../htdocs/asset/tpl/depreciation_options_view.tpl.php - - message: '#^Variable \$parameters might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../htdocs/asset/tpl/depreciation_options_view.tpl.php - - - message: '#^Unable to resolve the template type T in call to function dol_sort_array$#' - identifier: argument.templateType - count: 1 - path: ../../htdocs/asset/tpl/depreciation_view.tpl.php - - - - message: '#^Variable \$assetdepreciationoptions might not be defined\.$#' - identifier: variable.undefined - count: 7 - path: ../../htdocs/asset/tpl/depreciation_view.tpl.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/asset/tpl/depreciation_view.tpl.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 7 - path: ../../htdocs/asset/tpl/depreciation_view.tpl.php - - message: '#^Variable \$parameters might not be defined\.$#' identifier: variable.undefined @@ -2856,18 +2826,6 @@ parameters: count: 1 path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - - message: '#^Variable \$hookmanager might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue @@ -2880,12 +2838,6 @@ parameters: count: 1 path: ../../htdocs/bom/tpl/objectline_view.tpl.php - - - message: '#^Variable \$action might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/bom/tpl/objectline_view.tpl.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse diff --git a/htdocs/asset/tpl/depreciation_options_view.tpl.php b/htdocs/asset/tpl/depreciation_options_view.tpl.php index 7b35097b4c6..0f0a28adf63 100644 --- a/htdocs/asset/tpl/depreciation_options_view.tpl.php +++ b/htdocs/asset/tpl/depreciation_options_view.tpl.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW +/* Copyright (C) 2021 Open-Dsi + * Copyright (C) 2024 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -30,6 +30,7 @@ * @var Form $form * @var HookManager $hookmanager * @var AssetDepreciationOptions $assetdepreciationoptions + * @var Translate $langs */ ' @phan-var-force ?Form $form diff --git a/htdocs/asset/tpl/depreciation_view.tpl.php b/htdocs/asset/tpl/depreciation_view.tpl.php index 9fcf366ae3f..c0a6d3e1e91 100644 --- a/htdocs/asset/tpl/depreciation_view.tpl.php +++ b/htdocs/asset/tpl/depreciation_view.tpl.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW +/* Copyright (C) 2021 Open-Dsi + * Copyright (C) 2024 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -27,8 +27,13 @@ */ /** + * @var AssetDepreciationOptions $assetdepreciationoptions + * @var DoliDB $db * @var Form $form * @var HookManager $hookmanager + * @var Translate $langs + * + * @var string $action */ // Protection to avoid direct call of template From e24ad829f31b28fc44d80801581345ba1b2d4548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sat, 14 Dec 2024 13:59:56 +0100 Subject: [PATCH 12/46] fix getPositionOfAttribute --- htdocs/variants/class/ProductAttribute.class.php | 2 +- htdocs/variants/list.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/variants/class/ProductAttribute.class.php b/htdocs/variants/class/ProductAttribute.class.php index 2ce516a245b..698d6f211fe 100644 --- a/htdocs/variants/class/ProductAttribute.class.php +++ b/htdocs/variants/class/ProductAttribute.class.php @@ -976,7 +976,7 @@ class ProductAttribute extends CommonObject public function getPositionOfAttribute($rowid) { $sql = "SELECT position FROM " . MAIN_DB_PREFIX . $this->table_element; - $sql .= " WHERE entity IN (" . getEntity('product') . ")"; + $sql .= " WHERE rowid=".(int) $rowid." AND entity IN (" . getEntity('product') . ")"; dol_syslog(__METHOD__, LOG_DEBUG); $resql = $this->db->query($sql); diff --git a/htdocs/variants/list.php b/htdocs/variants/list.php index fbec288d582..0ce02d3624c 100644 --- a/htdocs/variants/list.php +++ b/htdocs/variants/list.php @@ -53,6 +53,7 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' $mode = GETPOST('mode', 'aZ'); // The display mode ('list', 'kanban', 'hierarchy', 'calendar', 'gantt', ...) $id = GETPOSTINT('id'); +$rowid = GETPOSTINT('rowid'); // for line reordering in not ajax mode // Load variable for pagination $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; From c8a7c09033943bbaab0db81a2d3f46887ed86891 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Sat, 14 Dec 2024 18:38:48 +0100 Subject: [PATCH 13/46] Fix logs and protection for infinit loop --- htdocs/core/lib/files.lib.php | 13 +++++++++---- htdocs/includes/odtphp/odf.php | 3 ++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 737f8ac24fc..4cd771c5191 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1641,14 +1641,19 @@ function dol_delete_dir($dir, $nophperrors = 0) * @param int $onlysub Delete only files and subdir, not main directory * @param int $countdeleted Counter to count nb of elements found really deleted * @param int $indexdatabase Try to remove also index entries. - * @param int $nolog Disable log files (too verbose when making recursive directories) + * @param int $nolog 1=Disable log for files and subdirectories (too verbose when making recursive directories) + * @param int $level 0 = level or recursivity * @return int Number of files and directory we try to remove. NB really removed is returned into var by reference $countdeleted. */ -function dol_delete_dir_recursive($dir, $count = 0, $nophperrors = 0, $onlysub = 0, &$countdeleted = 0, $indexdatabase = 1, $nolog = 0) +function dol_delete_dir_recursive($dir, $count = 0, $nophperrors = 0, $onlysub = 0, &$countdeleted = 0, $indexdatabase = 1, $nolog = 0, $level = 0) { - if (empty($nolog)) { + if (empty($nolog) || empty($level)) { dol_syslog("functions.lib:dol_delete_dir_recursive ".$dir, LOG_DEBUG); } + if ($level > 1000) { + dol_syslog("functions.lib:dol_delete_dir_recursive too many depth", LOG_WARNING); + } + if (dol_is_dir($dir)) { $dir_osencoded = dol_osencode($dir); if ($handle = opendir("$dir_osencoded")) { @@ -1659,7 +1664,7 @@ function dol_delete_dir_recursive($dir, $count = 0, $nophperrors = 0, $onlysub = if ($item != "." && $item != "..") { if (is_dir(dol_osencode("$dir/$item")) && !is_link(dol_osencode("$dir/$item"))) { - $count = dol_delete_dir_recursive("$dir/$item", $count, $nophperrors, 0, $countdeleted, $indexdatabase, $nolog); + $count = dol_delete_dir_recursive("$dir/$item", $count, $nophperrors, 0, $countdeleted, $indexdatabase, $nolog, ($level + 1)); } else { $result = dol_delete_file("$dir/$item", 1, $nophperrors, 0, null, false, $indexdatabase, $nolog); $count++; diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php index 0fa6d65e907..cbf958ad41b 100644 --- a/htdocs/includes/odtphp/odf.php +++ b/htdocs/includes/odtphp/odf.php @@ -836,7 +836,8 @@ IMG; dol_mkdir($conf->user->dir_temp); // We must be sure the directory exists and is writable // We delete and recreate a subdir because the soffice may have change pemrissions on it - dol_delete_dir_recursive($conf->user->dir_temp.'/odtaspdf'); + $countdeleted = 0; + dol_delete_dir_recursive($conf->user->dir_temp.'/odtaspdf', 0, 0, 0, $countdeleted, 0, 1); dol_mkdir($conf->user->dir_temp.'/odtaspdf'); // Install prerequisites: apt install soffice libreoffice-common libreoffice-writer From a1ef08158dab0ceff90f79ce5f52cbf0f2c11846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sat, 14 Dec 2024 20:54:08 +0100 Subject: [PATCH 14/46] fix phpstan --- build/phpstan/phpstan-baseline.neon | 6 ------ 1 file changed, 6 deletions(-) diff --git a/build/phpstan/phpstan-baseline.neon b/build/phpstan/phpstan-baseline.neon index 63edb325065..e27f45a01a6 100644 --- a/build/phpstan/phpstan-baseline.neon +++ b/build/phpstan/phpstan-baseline.neon @@ -32940,12 +32940,6 @@ parameters: count: 1 path: ../../htdocs/variants/list.php - - - message: '#^Variable \$rowid might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/variants/list.php - - message: '#^Call to function is_numeric\(\) with int will always evaluate to true\.$#' identifier: function.alreadyNarrowedType From 0325ee6d6d245f6bf32f0e13ec130a4819620f0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sat, 14 Dec 2024 21:07:07 +0100 Subject: [PATCH 15/46] fix phpstan --- build/phpstan/phpstan-baseline.neon | 12 ------------ htdocs/admin/agenda_other.php | 1 + htdocs/admin/agenda_reminder.php | 1 + 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/build/phpstan/phpstan-baseline.neon b/build/phpstan/phpstan-baseline.neon index e27f45a01a6..eb9d896d365 100644 --- a/build/phpstan/phpstan-baseline.neon +++ b/build/phpstan/phpstan-baseline.neon @@ -1176,18 +1176,6 @@ parameters: count: 2 path: ../../htdocs/admin/agenda.php - - - message: '#^Variable \$label might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/admin/agenda_other.php - - - - message: '#^Variable \$label might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/admin/agenda_reminder.php - - message: '#^Variable \$errorsaved in empty\(\) always exists and is always falsy\.$#' identifier: empty.variable diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 972ede049d2..5f50050e53c 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -53,6 +53,7 @@ $langs->loadLangs(array('admin', 'other', 'agenda', 'users')); $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); $modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php $param = GETPOST('param', 'alpha'); diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index 68e63d3eb32..14821a3da45 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -48,6 +48,7 @@ $langs->loadLangs(array("admin", "other", "agenda")); $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); $modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php $param = GETPOST('param', 'alpha'); From 9eea4d68e2155c1b8614025fdb4a8435317740a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sat, 14 Dec 2024 21:15:27 +0100 Subject: [PATCH 16/46] fix phpstan --- build/phpstan/phpstan-baseline.neon | 12 ------------ htdocs/admin/system/security.php | 3 +++ 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/build/phpstan/phpstan-baseline.neon b/build/phpstan/phpstan-baseline.neon index eb9d896d365..7f7bb926d3c 100644 --- a/build/phpstan/phpstan-baseline.neon +++ b/build/phpstan/phpstan-baseline.neon @@ -1722,18 +1722,6 @@ parameters: count: 1 path: ../../htdocs/admin/system/security.php - - - message: '#^Variable \$arrayofstreamtodisable might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/admin/system/security.php - - - - message: '#^Variable \$conffile might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../htdocs/admin/system/security.php - - message: '#^Variable \$dolibarr_main_document_root might not be defined\.$#' identifier: variable.undefined diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index b0f657e9411..2861b0fce9b 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -38,6 +38,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php'; * @var HookManager $hookmanager * @var Translate $langs * @var User $user + * + * @var string[] $arrayofstreamtodisable // $arrayofstreamtodisable is defined into filefunc.inc.php + * @var string $conffile // $conffile is defined into filefunc.inc.php */ // Load translation files required by the page From 8a2a67f2ec5be95789c97382aa6e2c852d767390 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Sun, 15 Dec 2024 02:02:14 +0100 Subject: [PATCH 17/46] Clean sql --- htdocs/public/donations/donateurs_code.php | 4 ++-- htdocs/public/fichinter/agendaexport.php | 18 +++++++++--------- htdocs/public/members/public_list.php | 4 ---- htdocs/public/onlinesign/newonlinesign.php | 2 +- htdocs/public/opensurvey/studs.php | 2 +- htdocs/public/payment/paymentok.php | 2 +- htdocs/public/project/viewandvote.php | 4 ++-- htdocs/public/recruitment/view.php | 2 +- htdocs/public/stripe/ipn.php | 2 +- htdocs/public/ticket/list.php | 20 ++++++++++---------- 10 files changed, 28 insertions(+), 32 deletions(-) diff --git a/htdocs/public/donations/donateurs_code.php b/htdocs/public/donations/donateurs_code.php index 96bca9bd84e..e801451df37 100644 --- a/htdocs/public/donations/donateurs_code.php +++ b/htdocs/public/donations/donateurs_code.php @@ -84,7 +84,7 @@ $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); if ($num) { - print "
'.$langs->trans("Product").''.$form->textwithpicto($langs->trans("UnitCost"), $langs->trans("AmountUsedToUpdateWAP")).''; + print $langs->trans("UnitCost"); + print ''.$form->textwithpicto($langs->trans("ManufacturingPrice"), $langs->trans("AmountUsedToUpdateWAP")).''; + print $langs->trans("ManufacturingPrice"); + print ''.$form->textwithpicto($langs->trans("QtyAlreadyProducedShort"), $langs->trans("QtyAlreadyProduced")).''; + print $langs->trans("QtyAlreadyProducedShort"); + print ''; if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) { diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 88adc86552b..b198e461b82 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -317,6 +317,9 @@ tr.liste_titre th.liste_titre_sel:not(.maxwidthsearch), tr.liste_titre td.liste_ tr.liste_titre th.liste_titre:not(.maxwidthsearch), tr.liste_titre td.liste_titre:not(.maxwidthsearch) { opacity: 0.8; } /* th.liste_titre_sel a, th.liste_titre a, td.liste_titre_sel a, td.liste_titre a { color: #766; } */ tr.liste_titre_filter th.liste_titre { text-align: unset; } +.liste_titre.trheight5em { + height: 4em !important; +} input { font-size: unset; @@ -3872,7 +3875,7 @@ a.fmdirlia { /* ============================================================================== */ -/* Onglets */ +/* Tabs */ /* ============================================================================== */ div.tabs { text-align: ; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 8dbb46a008d..4f3b8732af4 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -600,19 +600,6 @@ th.wrapcolumntitle dl dt a span.fas.fa-list { padding-bottom: 1px; } -/*.liste_titre input[name=month_date_when], .liste_titre input[name=monthvalid], .liste_titre input[name=search_ordermonth], .liste_titre input[name=search_deliverymonth], -.liste_titre input[name=search_smonth], .liste_titre input[name=search_month], .liste_titre input[name=search_emonth], .liste_titre input[name=smonth], .liste_titre input[name=month], -.liste_titre input[name=month_lim], .liste_titre input[name=month_start], .liste_titre input[name=month_end], .liste_titre input[name=month_create], -.liste_titre input[name=search_month_lim], .liste_titre input[name=search_month_start], .liste_titre input[name=search_month_end], .liste_titre input[name=search_month_create], -.liste_titre input[name=search_month_create], .liste_titre input[name=search_month_start], .liste_titre input[name=search_month_end], -.liste_titre input[name=day_date_when], .liste_titre input[name=dayvalid], .liste_titre input[name=search_orderday], .liste_titre input[name=search_deliveryday], -.liste_titre input[name=search_sday], .liste_titre input[name=search_day], .liste_titre input[name=search_eday], .liste_titre input[name=sday], .liste_titre input[name=day], .liste_titre select[name=day], -.liste_titre input[name=day_lim], .liste_titre input[name=day_start], .liste_titre input[name=day_end], .liste_titre input[name=day_create], -.liste_titre input[name=search_day_lim], .liste_titre input[name=search_day_start], .liste_titre input[name=search_day_end], .liste_titre input[name=search_day_create], -.liste_titre input[name=search_day_create], .liste_titre input[name=search_day_start], .liste_titre input[name=search_day_end], -.liste_titre input[name=search_day_date_when], .liste_titre input[name=search_month_date_when], .liste_titre input[name=search_year_date_when], -.liste_titre input[name=search_dtstartday], .liste_titre input[name=search_dtendday], .liste_titre input[name=search_dtstartmonth], .liste_titre input[name=search_dtendmonth], -*/ .liste_titre input[name=search_month], .liste_titre input[name=search_month_start], .liste_titre input[name=search_month_end] { margin-right: 4px; } @@ -4256,6 +4243,9 @@ div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border tr.liste_titre.box_titre td table td, .bordernooddeven tr td { height: 28px; } +.liste_titre.trheight5em { + height: 4em !important; +} table.border td, table.bordernooddeven td, div.border div div.tagtd { padding: 3px 4px 3px 4px; From 912206d99bcd25013a31492dc282ed8b8dd57725 Mon Sep 17 00:00:00 2001 From: Charlie Root Date: Fri, 13 Dec 2024 23:35:47 +0100 Subject: [PATCH 06/46] Correction bug #32365 Warning: Attempt to read property datepaye on string --- .../modules/supplier_payment/mod_supplier_payment_brodator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php b/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php index 113549aef15..628b7411ebf 100644 --- a/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php +++ b/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php @@ -139,7 +139,7 @@ class mod_supplier_payment_brodator extends ModeleNumRefSupplierPayments return 0; } - $numFinal = get_next_value($db, $mask, 'paiementfourn', 'ref', '', $objsoc, $object->datepaye); + $numFinal = get_next_value($db, $mask, 'paiementfourn', 'ref', '', $objsoc, is_object($object) ?$object->datepaye :''); return $numFinal; } From 1dd86e9d320e71a22029d3721c85296b87094ab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sat, 14 Dec 2024 09:08:33 +0100 Subject: [PATCH 07/46] fix --- htdocs/core/modules/barcode/mod_barcode_product_standard.php | 2 +- htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php index 1ea205d0d1c..ca5c3b7a3e0 100644 --- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php @@ -95,7 +95,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode // Mask parameter //$texte.= '
'.$langs->trans("Mask").' ('.$langs->trans("BarCodeModel").'):
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'.$langs->trans("Mask").' ('.$langs->trans("BarCodeModel").'):
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
"; + print '
'; print ''; print ""; @@ -102,7 +102,7 @@ if ($resql) { print "\n"; } print "\n"; - print ''; + print ''; print ""; $i++; } diff --git a/htdocs/public/fichinter/agendaexport.php b/htdocs/public/fichinter/agendaexport.php index a5c6f843041..c122767cf85 100644 --- a/htdocs/public/fichinter/agendaexport.php +++ b/htdocs/public/fichinter/agendaexport.php @@ -474,22 +474,22 @@ function build_exportfile($format, $type, $cachedelay, $filename, $filters) } if ($key == 'year') { $sql .= " AND fd.date BETWEEN '".$db->idate(dol_get_first_day($value, 1))."'"; - $sql .= " AND '".$db->idate(dol_get_last_day($value, 12))."'"; + $sql .= " AND '".$db->idate(dol_get_last_day($value, 12))."'"; } if ($key == 'id') { - $sql .= " AND f.rowid = ".(is_numeric($value) ? $value : 0); + $sql .= " AND f.rowid = ".((int) $value); } if ($key == 'idfrom') { - $sql .= " AND f.rowid >= ".(is_numeric($value) ? $value : 0); + $sql .= " AND f.rowid >= ".((int) $value); } if ($key == 'idto') { - $sql .= " AND f.rowid <= ".(is_numeric($value) ? $value : 0); + $sql .= " AND f.rowid <= ".((int) $value); } if ($key == 'project') { - $sql .= " AND f.fk_project = ".(is_numeric($value) ? $value : 0); + $sql .= " AND f.fk_project = ".((int) $value); } if ($key == 'contract') { - $sql .= " AND f.fk_contract = ".(is_numeric($value) ? $value : 0); + $sql .= " AND f.fk_contract = ".((int) $value); } if ($key == 'logina') { @@ -502,7 +502,7 @@ function build_exportfile($format, $type, $cachedelay, $filename, $filters) $userforfilter = new User($db); $result = $userforfilter->fetch(0, $logina); if ($result > 0) { - $sql .= " AND a.fk_user_author ".$condition." ".$userforfilter->id; + $sql .= " AND a.fk_user_author ".$condition." ".((int) $userforfilter->id); } elseif ($result < 0 || $condition == '=') { $sql .= " AND a.fk_user_author = 0"; } @@ -518,7 +518,7 @@ function build_exportfile($format, $type, $cachedelay, $filename, $filters) $result = $userforfilter->fetch(0, $logini); $sql .= " AND EXISTS (SELECT ec.rowid FROM ".MAIN_DB_PREFIX."element_contact as ec"; $sql .= " WHERE ec.element_id = f.rowid"; - $sql .= " AND ec.fk_c_type_contact = 26"; + $sql .= " AND ec.fk_c_type_contact = 26"; // FIXME do not use hardcoded ID if ($result > 0) { $sql .= " AND ec.fk_socpeople = ".((int) $userforfilter->id); } elseif ($result < 0 || $condition == '=') { @@ -537,7 +537,7 @@ function build_exportfile($format, $type, $cachedelay, $filename, $filters) $result = $userforfilter->fetch(0, $loginr); $sql .= " AND EXISTS (SELECT ecr.rowid FROM ".MAIN_DB_PREFIX."element_contact as ecr"; $sql .= " WHERE ecr.element_id = f.rowid"; - $sql .= " WHERE AND ecr.fk_c_type_contact = 27"; + $sql .= " WHERE AND ecr.fk_c_type_contact = 27"; // FIXME do not use hardcoded ID if ($result > 0) { $sql .= " AND ecr.fk_socpeople = ".((int) $userforfilter->id); } elseif ($result < 0 || $condition == '=') { diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php index 5445587309c..0df9b10a12b 100644 --- a/htdocs/public/members/public_list.php +++ b/htdocs/public/members/public_list.php @@ -168,10 +168,6 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $sql .= $db->order($sortfield, $sortorder); $sql .= $db->plimit($conf->liste_limit + 1, $offset); -//$sql = "SELECT d.rowid, d.firstname, d.lastname, d.societe, zip, town, d.email, t.libelle as type, d.morphy, d.statut, t.subscription"; -//$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t"; -//$sql .= " WHERE d.fk_adherent_type = t.rowid AND d.statut = $statut"; -//$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset); $result = $db->query($sql); diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 802d8996853..17506fc264a 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -194,7 +194,7 @@ if ($action == 'confirm_refusepropal' && $confirm == 'yes') { // Test on pemriss $db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."propal"; - $sql .= " SET fk_statut = ".((int) $object::STATUS_NOTSIGNED).", note_private = '".$db->escape($object->note_private)."', date_signature='".$db->idate(dol_now())."'"; + $sql .= " SET fk_statut = ".((int) $object::STATUS_NOTSIGNED).", note_private = '".$db->escape($object->note_private)."', date_signature = '".$db->idate(dol_now())."'"; $sql .= " WHERE rowid = ".((int) $object->id); dol_syslog(__FILE__, LOG_DEBUG); diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index 37051fda92d..c7dfb5d3aa8 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -191,7 +191,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) { // bo // Check if vote already exists $sql = 'SELECT id_users, nom as name'; $sql .= ' FROM '.MAIN_DB_PREFIX.'opensurvey_user_studs'; - $sql .= " WHERE id_sondage='".$db->escape($numsondage)."' AND nom = '".$db->escape($nom)."' ORDER BY id_users"; + $sql .= " WHERE id_sondage = '".$db->escape($numsondage)."' AND nom = '".$db->escape($nom)."' ORDER BY id_users"; $resql = $db->query($sql); if (!$resql) { dol_print_error($db); diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 63b7ed58b94..972c78675ba 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -740,7 +740,7 @@ if ($ispaymentok) { } } else { $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_account (fk_soc, login, key_account, site, site_account, status, entity, date_creation, fk_user_creat)"; - $sql .= " VALUES (".$thirdparty_id.", '', '".$db->escape($stripecu)."', 'stripe', '".$db->escape($stripearrayofkeysbyenv[$servicestatus]['publishable_key'])."', ".((int) $servicestatus).", ".((int) $conf->entity).", '".$db->idate(dol_now())."', 0)"; + $sql .= " VALUES (".((int) $thirdparty_id).", '', '".$db->escape($stripecu)."', 'stripe', '".$db->escape($stripearrayofkeysbyenv[$servicestatus]['publishable_key'])."', ".((int) $servicestatus).", ".((int) $conf->entity).", '".$db->idate(dol_now())."', 0)"; $resql = $db->query($sql); if (!$resql) { // should not happen $error++; diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 47d5893ae8a..5b9404e2515 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -122,8 +122,8 @@ $listOfConferences .= ''; $sql = "SELECT a.id, a.fk_action, a.datep, a.datep2, a.label, a.fk_soc, a.note, ca.libelle as label FROM ".MAIN_DB_PREFIX."actioncomm as a - INNER JOIN ".MAIN_DB_PREFIX."c_actioncomm as ca ON (a.fk_action=ca.id) - WHERE a.status<2"; + INNER JOIN ".MAIN_DB_PREFIX."c_actioncomm as ca ON (a.fk_action = ca.id) + WHERE a.status < 2"; $sqlforconf = $sql." AND ca.module='conference@eventorganization'"; //$sqlforbooth = $sql." AND ca.module='booth@eventorganization'"; diff --git a/htdocs/public/recruitment/view.php b/htdocs/public/recruitment/view.php index bdcf71420c2..87127f7f906 100644 --- a/htdocs/public/recruitment/view.php +++ b/htdocs/public/recruitment/view.php @@ -139,7 +139,7 @@ if ($action == "dosubmit") { // Test on permission not required here (anonymous if (!$error) { $sql = "SELECT rrc.rowid FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rrc"; $sql .= " WHERE rrc.email = '". $db->escape($email)."'"; - $sql .= " AND rrc.entity = ". getEntity($object->element, 0); + $sql .= " AND rrc.entity IN (". getEntity($object->element, 0).")"; $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index 9e547eacb6c..0a2c982258d 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -321,7 +321,7 @@ if ($event->type == 'payout.created') { } elseif ($event->type == 'customer.deleted') { // When a customer account is delete on Stripe side $db->begin(); - $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_account WHERE key_account = '".$db->escape($event->data->object->id)."' and site='stripe'"; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_account WHERE key_account = '".$db->escape($event->data->object->id)."' AND site = 'stripe'"; $db->query($sql); $db->commit(); } elseif ($event->type == 'payment_intent.succeeded') { diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index 86645c9a6ec..03dba86959a 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -397,26 +397,26 @@ if ($action == "view_ticketlist") { } $sql .= " WHERE t.entity IN (".getEntity('ticket').")"; $sql .= " AND ((tc.source = 'external'"; - $sql .= " AND tc.element='".$db->escape($object->element)."'"; - $sql .= " AND tc.active=1"; - $sql .= " AND sp.email='".$db->escape($_SESSION['email_customer'])."')"; // email found into an external contact - $sql .= " OR s.email='".$db->escape($_SESSION['email_customer'])."'"; // or email of the linked company - $sql .= " OR t.origin_email='".$db->escape($_SESSION['email_customer'])."')"; // or email of the requester + $sql .= " AND tc.element = '".$db->escape($object->element)."'"; + $sql .= " AND tc.active = 1"; + $sql .= " AND sp.email = '".$db->escape($_SESSION['email_customer'])."')"; // email found into an external contact + $sql .= " OR s.email = '".$db->escape($_SESSION['email_customer'])."'"; // or email of the linked company + $sql .= " OR t.origin_email = '".$db->escape($_SESSION['email_customer'])."')"; // or email of the requester // Manage filter if (!empty($filter)) { foreach ($filter as $key => $value) { if (strpos($key, 'date')) { // To allow $filter['YEAR(s.dated)']=>$year - $sql .= " AND ".$key." = '".$db->escape($value)."'"; + $sql .= " AND ".$db->sanitize($key)." = '".$db->escape($value)."'"; } elseif (($key == 't.fk_user_assign') || ($key == 't.type_code') || ($key == 't.category_code') || ($key == 't.severity_code')) { - $sql .= " AND ".$key." = '".$db->escape($value)."'"; + $sql .= " AND ".$db->sanitize($key)." = '".$db->escape($value)."'"; } elseif ($key == 't.fk_statut') { if (is_array($value) && count($value) > 0) { - $sql .= " AND ".$key." IN (".$db->sanitize(implode(',', $value)).")"; + $sql .= " AND ".$db->sanitize($key)." IN (".$db->sanitize(implode(',', $value)).")"; } else { - $sql .= " AND ".$key." = ".((int) $value); + $sql .= " AND ".$db->sanitize($key)." = ".((int) $value); } } else { - $sql .= " AND ".$key." LIKE '%".$db->escape($value)."%'"; + $sql .= " AND ".$db->sanitize($key)." LIKE '%".$db->escape($value)."%'"; } } } From 4c40c7886851658e62d67e715a74b0735cb3a794 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Sun, 15 Dec 2024 02:26:41 +0100 Subject: [PATCH 18/46] Trans --- htdocs/langs/en_US/errors.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 485917e7d86..302f4f0c0ed 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -140,7 +140,7 @@ ErrorBadValueForCode=Bad value for security code. Try again with new value... ErrorBothFieldCantBeNegative=Fields %s and %s can't be both negative ErrorFieldCantBeNegativeOnInvoice=Field %s cannot be negative on this type of invoice. If you need to add a discount line, just create the discount first (from field '%s' in third-party card) and apply it to the invoice. ErrorLinesCantBeNegativeForOneVATRate=Total of lines (net of tax) can't be negative for a given not null VAT rate (Found a negative total for VAT rate %s%%). -ErrorLinesCantBeNegativeOnDeposits=Lines can't be negative in a deposit. You will face problems when you will need to consume the deposit in final invoice if you do so. +ErrorLinesCantBeNegativeOnDeposits=Lines can't be negative in a down payment. You will face problems when you will need to consume the deposit in final invoice if you do so. ErrorQtyForCustomerInvoiceCantBeNegative=Quantity for line into customer invoices can't be negative ErrorQtyForSupplierInvoiceCantBeNegative=Quantity for line into supplier invoices can't be negative ErrorWebServerUserHasNotPermission=User account %s used to execute web server has no permission for that From 27a1edb6fc1d0f1b154c714647e80d22a44af2a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sun, 15 Dec 2024 08:58:20 +0100 Subject: [PATCH 19/46] fix phpstan --- build/phpstan/phpstan-baseline.neon | 8 +------- .../class/recruitmentjobposition.class.php | 12 +++++------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/build/phpstan/phpstan-baseline.neon b/build/phpstan/phpstan-baseline.neon index e4b3a0c31c9..9f5c8d9d8a7 100644 --- a/build/phpstan/phpstan-baseline.neon +++ b/build/phpstan/phpstan-baseline.neon @@ -29841,7 +29841,7 @@ parameters: - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue - count: 2 + count: 1 path: ../../htdocs/recruitment/class/recruitmentjobposition.class.php - @@ -29856,12 +29856,6 @@ parameters: count: 1 path: ../../htdocs/recruitment/class/recruitmentjobposition.class.php - - - message: '#^Variable \$error in empty\(\) always exists and is always falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/recruitment/class/recruitmentjobposition.class.php - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_each_var_object\(\) expects array\, RecruitmentJobPosition given\.$#' identifier: argument.type diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index 0e5a14e12ea..49aefd7f41b 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -765,14 +765,12 @@ class RecruitmentJobPosition extends CommonObject $this->generateDocument($modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } - if (!$error) { - $this->oldcopy = clone $this; - $this->status = $status; - $this->date_cloture = $now; - $this->note_private = $newprivatenote; - } + $this->oldcopy = clone $this; + $this->status = $status; + $this->date_cloture = $now; + $this->note_private = $newprivatenote; - if (!$notrigger && empty($error)) { + if (!$notrigger /* && empty($error) */) { // Call trigger $result = $this->call_trigger($triggerName, $user); if ($result < 0) { From 22be2de2596f090b769b6386e651accb5dcc51ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sun, 15 Dec 2024 09:01:36 +0100 Subject: [PATCH 20/46] fix phpstan --- build/phpstan/phpstan-baseline.neon | 6 ------ .../recruitment/class/recruitmentjobposition.class.php | 10 +--------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/build/phpstan/phpstan-baseline.neon b/build/phpstan/phpstan-baseline.neon index 9f5c8d9d8a7..ad84c0bed0a 100644 --- a/build/phpstan/phpstan-baseline.neon +++ b/build/phpstan/phpstan-baseline.neon @@ -29838,12 +29838,6 @@ parameters: count: 1 path: ../../htdocs/recruitment/class/recruitmentjobposition.class.php - - - message: '#^Negated boolean expression is always true\.$#' - identifier: booleanNot.alwaysTrue - count: 1 - path: ../../htdocs/recruitment/class/recruitmentjobposition.class.php - - message: '#^Property CommonObject\:\:\$ismultientitymanaged \(int\<0, 1\>\|string\) in isset\(\) is not nullable\.$#' identifier: isset.property diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index 49aefd7f41b..bb64a3ccb34 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -552,20 +552,12 @@ class RecruitmentJobPosition extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->recruitmentjobposition->create)) - || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->recruitmentjobposition->recruitmentjobposition_advance->validate)))) - { - $this->error='NotEnoughPermissions'; - dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); - return -1; - }*/ - $now = dol_now(); $this->db->begin(); // Define new ref - if (!$error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) { // empty should not happened, but when it occurs, the test save life + if (/* !$error && */ (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) { // empty should not happened, but when it occurs, the test save life $num = $this->getNextNumRef(); } else { $num = $this->ref; From 2bb990344ef03b452ac88623b01e3b0342d49e97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sun, 15 Dec 2024 09:08:27 +0100 Subject: [PATCH 21/46] fix phpstan --- build/phpstan/phpstan-baseline.neon | 12 ------- htdocs/core/class/commonobject.class.php | 34 +++++++++---------- .../asset/doc/pdf_standard_asset.modules.php | 3 +- ...tandard_recruitmentjobposition.modules.php | 3 +- 4 files changed, 21 insertions(+), 31 deletions(-) diff --git a/build/phpstan/phpstan-baseline.neon b/build/phpstan/phpstan-baseline.neon index ad84c0bed0a..3d079bdac6e 100644 --- a/build/phpstan/phpstan-baseline.neon +++ b/build/phpstan/phpstan-baseline.neon @@ -12426,12 +12426,6 @@ parameters: count: 1 path: ../../htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php - - - message: '#^Variable \$outputlangsbis might not be defined\.$#' - identifier: variable.undefined - count: 7 - path: ../../htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php - - message: '#^Property mod_asset_standard\:\:\$prefix has no type specified\.$#' identifier: missingType.property @@ -29898,12 +29892,6 @@ parameters: count: 1 path: ../../htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php - - - message: '#^Variable \$outputlangsbis might not be defined\.$#' - identifier: variable.undefined - count: 7 - path: ../../htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php - - message: '#^Variable \$badgeStatus0 might not be defined\.$#' identifier: variable.undefined diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index caa1db00df2..28422a2d77f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1,22 +1,22 @@ - * Copyright (C) 2005-2013 Regis Houssin - * Copyright (C) 2010-2020 Juanjo Menent - * Copyright (C) 2012-2013 Christophe Battarel - * Copyright (C) 2011-2022 Philippe Grand - * Copyright (C) 2012-2015 Marcos García - * Copyright (C) 2012-2015 Raphaël Doursenaud - * Copyright (C) 2012 Cedric Salvador - * Copyright (C) 2015-2022 Alexandre Spangaro - * Copyright (C) 2016 Bahfir abbes - * Copyright (C) 2017 ATM Consulting - * Copyright (C) 2017-2019 Nicolas ZABOURI - * Copyright (C) 2017 Rui Strecht +/* Copyright (C) 2006-2015 Laurent Destailleur + * Copyright (C) 2005-2013 Regis Houssin + * Copyright (C) 2010-2020 Juanjo Menent + * Copyright (C) 2012-2013 Christophe Battarel + * Copyright (C) 2011-2022 Philippe Grand + * Copyright (C) 2012-2015 Marcos García + * Copyright (C) 2012-2015 Raphaël Doursenaud + * Copyright (C) 2012 Cedric Salvador + * Copyright (C) 2015-2022 Alexandre Spangaro + * Copyright (C) 2016 Bahfir abbes + * Copyright (C) 2017 ATM Consulting + * Copyright (C) 2017-2019 Nicolas ZABOURI + * Copyright (C) 2017 Rui Strecht * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2018 Josep Lluís Amador - * Copyright (C) 2023 Gauthier VERDOL - * Copyright (C) 2021 Grégory Blémand - * Copyright (C) 2023 Lenin Rivas + * Copyright (C) 2018 Josep Lluís Amador + * Copyright (C) 2023 Gauthier VERDOL + * Copyright (C) 2021 Grégory Blémand + * Copyright (C) 2023 Lenin Rivas * Copyright (C) 2024 MDW * Copyright (C) 2024 William Mead * diff --git a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php index 0992224c367..96140ac1780 100644 --- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php +++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php @@ -173,8 +173,9 @@ class pdf_standard_asset extends ModelePDFAsset // Load translation files required by the page $outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies")); + global $outputlangsbis; + $outputlangsbis = null; if (getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE') && $outputlangs->defaultlang != getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE')) { - global $outputlangsbis; $outputlangsbis = new Translate('', $conf); $outputlangsbis->setDefaultLang(getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE')); $outputlangsbis->loadLangs(array("main", "bills", "products", "dict", "companies")); diff --git a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php index 475cb21f216..7402190de2b 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php @@ -210,8 +210,9 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio // Load translation files required by the page $outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies")); + global $outputlangsbis; + $outputlangsbis = null; if (getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE') && $outputlangs->defaultlang != getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE')) { - global $outputlangsbis; $outputlangsbis = new Translate('', $conf); $outputlangsbis->setDefaultLang(getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE')); $outputlangsbis->loadLangs(array("main", "bills", "products", "dict", "companies")); From 1afe0047fb7fe9c5650a9c55d71d924f4c313871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sun, 15 Dec 2024 09:39:02 +0100 Subject: [PATCH 22/46] fix phpstan --- htdocs/document.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/document.php b/htdocs/document.php index 9b440a30e06..895256a1def 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -102,9 +102,12 @@ function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disab * Footer empty * * @ignore + * @param string $comment A text to add as HTML comment into HTML generated page + * @param string $zone 'private' (for private pages) or 'public' (for public pages) + * @param int $disabledoutputofmessages Clear all messages stored into session without displaying them * @return void */ -function llxFooter() +function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) { } From 7d918ac0c9e912513f1b5eac5121b023f0bbd911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sun, 15 Dec 2024 09:57:48 +0100 Subject: [PATCH 23/46] tests --- htdocs/document.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/document.php b/htdocs/document.php index 9b440a30e06..230282831de 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -5,8 +5,8 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010 Pierre Morin * Copyright (C) 2010 Juanjo Menent - * Copyright (C) 2022 Ferran Marcet - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2022 Ferran Marcet + * 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 From b3a580aaa9d9105778c0759d9a240c908fbe078f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sun, 15 Dec 2024 10:55:23 +0100 Subject: [PATCH 24/46] tests --- htdocs/core/lib/files.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 4cd771c5191..6fa13fc5196 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2490,7 +2490,7 @@ function dol_compress_file($inputfile, $outputfile, $mode = "gz", &$errorstring if (defined('ODTPHP_PATHTOPCLZIP')) { $foundhandler = 1; - include_once ODTPHP_PATHTOPCLZIP.'/pclzip.lib.php'; + include_once ODTPHP_PATHTOPCLZIP.'pclzip.lib.php'; $archive = new PclZip($outputfile); $result = $archive->add($inputfile, PCLZIP_OPT_REMOVE_PATH, dirname($inputfile)); From 8c988479cd0f8e6b7ef287de985cc9781ba5608e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sun, 15 Dec 2024 11:24:24 +0100 Subject: [PATCH 25/46] tests --- htdocs/core/lib/files.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 6fa13fc5196..4f25f02093c 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2557,7 +2557,7 @@ function dol_uncompress($inputfile, $outputdir) if ($fileinfo["extension"] == "zip") { if (defined('ODTPHP_PATHTOPCLZIP') && !getDolGlobalString('MAIN_USE_ZIPARCHIVE_FOR_ZIP_UNCOMPRESS')) { dol_syslog("Constant ODTPHP_PATHTOPCLZIP for pclzip library is set to ".ODTPHP_PATHTOPCLZIP.", so we use Pclzip to unzip into ".$outputdir); - include_once ODTPHP_PATHTOPCLZIP.'/pclzip.lib.php'; + include_once ODTPHP_PATHTOPCLZIP.'pclzip.lib.php'; $archive = new PclZip($inputfile); // We create output dir manually, so it uses the correct permission (When created by the archive->extract, dir is rwx for everybody). From 6e68fc7fa833d7aa6e374580699c3a76806e1847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sun, 15 Dec 2024 12:13:12 +0100 Subject: [PATCH 26/46] tests --- build/phpstan/bootstrap_action.php | 1 + 1 file changed, 1 insertion(+) diff --git a/build/phpstan/bootstrap_action.php b/build/phpstan/bootstrap_action.php index 2bcc70dd965..90e70167c11 100644 --- a/build/phpstan/bootstrap_action.php +++ b/build/phpstan/bootstrap_action.php @@ -32,6 +32,7 @@ define('DOL_DATA_ROOT', __DIR__ . '/../../documents'); define('DOL_URL_ROOT', '/'); define('DOL_MAIN_URL_ROOT', '/'); define('MAIN_DB_PREFIX', 'llx_'); +define('ODTPHP_PATHTOPCLZIP', DOL_DOCUMENT_ROOT.'/includes/odtphp/zip/pclzip/'); /** * @var Conf $conf From a174795a60c29c06948d4253682b138a5cc82857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sun, 15 Dec 2024 13:16:40 +0100 Subject: [PATCH 27/46] tests --- build/phpstan/bootstrap_action.php | 1 - 1 file changed, 1 deletion(-) diff --git a/build/phpstan/bootstrap_action.php b/build/phpstan/bootstrap_action.php index 90e70167c11..2bcc70dd965 100644 --- a/build/phpstan/bootstrap_action.php +++ b/build/phpstan/bootstrap_action.php @@ -32,7 +32,6 @@ define('DOL_DATA_ROOT', __DIR__ . '/../../documents'); define('DOL_URL_ROOT', '/'); define('DOL_MAIN_URL_ROOT', '/'); define('MAIN_DB_PREFIX', 'llx_'); -define('ODTPHP_PATHTOPCLZIP', DOL_DOCUMENT_ROOT.'/includes/odtphp/zip/pclzip/'); /** * @var Conf $conf From 03bf9c9a4f8b5cbce29afd9fc440d84d1c2feb42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Sun, 15 Dec 2024 13:57:45 +0100 Subject: [PATCH 28/46] fix login error on update with captcha --- htdocs/core/tpl/login.tpl.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 077f7d4aeb1..e2ba274dfb2 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -3,6 +3,7 @@ * Copyright (C) 2011-2022 Laurent Destailleur * Copyright (C) 2024 MDW * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Charlene Benke * * 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 @@ -317,7 +318,7 @@ if (!empty($captcha)) { } // List of directories where we can find captcha handlers - $dirModCaptcha = array_merge(array('main' => '/core/modules/security/captcha/'), is_array($conf->modules_parts['captcha']) ? $conf->modules_parts['captcha'] : array()); + $dirModCaptcha = array_merge(array('main' => '/core/modules/security/captcha/'), isset($conf->modules_parts['captcha']) ? $conf->modules_parts['captcha'] : array()); $fullpathclassfile = ''; foreach ($dirModCaptcha as $dir) { $fullpathclassfile = dol_buildpath($dir."modCaptcha".ucfirst($captcha).'.class.php', 0, 2); @@ -334,7 +335,7 @@ if (!empty($captcha)) { $classname = "modCaptcha".ucfirst($captcha); if (class_exists($classname)) { /** @var ModeleCaptcha $captchaobj */ - $captchaobj = new $classname($db, $conf, $langs, $user); + $captchaobj = new $classname($db, $conf, $langs, null); '@phan-var-force ModeleCaptcha $captchaobj'; if (is_object($captchaobj) && method_exists($captchaobj, 'getCaptchaCodeForForm')) { From 7c94a01cc5c7b121752938cd4a07876d73d0351a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Sun, 15 Dec 2024 14:01:33 +0100 Subject: [PATCH 29/46] Update login.tpl.php --- htdocs/core/tpl/login.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index e2ba274dfb2..54c2238adfa 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -318,7 +318,7 @@ if (!empty($captcha)) { } // List of directories where we can find captcha handlers - $dirModCaptcha = array_merge(array('main' => '/core/modules/security/captcha/'), isset($conf->modules_parts['captcha']) ? $conf->modules_parts['captcha'] : array()); + $dirModCaptcha = array_merge(array('main' => '/core/modules/security/captcha/'), (isset($conf->modules_parts['captcha']) && is_array($conf->modules_parts['captcha'])) ? $conf->modules_parts['captcha'] : array()); $fullpathclassfile = ''; foreach ($dirModCaptcha as $dir) { $fullpathclassfile = dol_buildpath($dir."modCaptcha".ucfirst($captcha).'.class.php', 0, 2); From 65f9e7f172b2b0c6a56c43e5d9d617f8a4c59ef7 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Sun, 15 Dec 2024 15:38:38 +0100 Subject: [PATCH 30/46] Fix parsing input date for eldy calendar when using short year --- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/js/lib_head.js.php | 75 +++++++++++++++++---------- 2 files changed, 48 insertions(+), 29 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index e820a5ddc21..a291083bf62 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7271,7 +7271,7 @@ class Form // Input area to enter date manually $retstring .= 'trans("FormatDateShortJavaInput") . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript + $retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript $retstring .= ' autocomplete="off">'; // Icon calendar diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php index 6f2fe0b3657..44cb68bd697 100644 --- a/htdocs/core/js/lib_head.js.php +++ b/htdocs/core/js/lib_head.js.php @@ -222,37 +222,59 @@ function getObjectFromID(id){ return theObject; } -// Called after selection of a date to save details into detailed fields +// Called after the selection or typing of a date to save details into detailed fields function dpChangeDay(dateFieldID, format) { //showDP.datefieldID=dateFieldID; console.log("Call dpChangeDay, we save date into detailed fields from format = "+format); - var thefield=getObjectFromID(dateFieldID); - var thefieldday=getObjectFromID(dateFieldID+"day"); - var thefieldmonth=getObjectFromID(dateFieldID+"month"); - var thefieldyear=getObjectFromID(dateFieldID+"year"); + var thefield = getObjectFromID(dateFieldID); + var thefieldday = getObjectFromID(dateFieldID+"day"); + var thefieldmonth = getObjectFromID(dateFieldID+"month"); + var thefieldyear = getObjectFromID(dateFieldID+"year"); - var date=getDateFromFormat(thefield.value, format); + var date = getDateFromFormat(thefield.value, format); //console.log(date); if (date) { - thefieldday.value=date.getDate(); - if(thefieldday.onchange) thefieldday.onchange.call(thefieldday); - thefieldmonth.value=date.getMonth()+1; - if(thefieldmonth.onchange) thefieldmonth.onchange.call(thefieldmonth); - thefieldyear.value=date.getFullYear(); - if(thefieldyear.onchange) thefieldyear.onchange.call(thefieldyear); + thefieldday.value = date.getDate(); + if (thefieldday.onchange) thefieldday.onchange.call(thefieldday); + thefieldmonth.value = date.getMonth()+1; + if (thefieldmonth.onchange) thefieldmonth.onchange.call(thefieldmonth); + thefieldyear.value = date.getFullYear(); + if (thefieldyear.onchange) thefieldyear.onchange.call(thefieldyear); + + return 1; } - else - { - thefieldday.value=''; - if(thefieldday.onchange) thefieldday.onchange.call(thefieldday); - thefieldmonth.value=''; - if(thefieldmonth.onchange) thefieldmonth.onchange.call(thefieldmonth); - thefieldyear.value=''; - if(thefieldyear.onchange) thefieldyear.onchange.call(thefieldyear); + + // Replace yyyy into yy + newformat = format.replace(/yyyy/g, 'yy'); + if (newformat != format) { + console.log("dpChangeDay, we try now from format = "+newformat); + + var date = getDateFromFormat(thefield.value, newformat); + //console.log(date); + if (date) + { + thefieldday.value = date.getDate(); + if (thefieldday.onchange) thefieldday.onchange.call(thefieldday); + thefieldmonth.value = date.getMonth()+1; + if (thefieldmonth.onchange) thefieldmonth.onchange.call(thefieldmonth); + thefieldyear.value = date.getFullYear(); + if (thefieldyear.onchange) thefieldyear.onchange.call(thefieldyear); + + return 2; + } } + + thefieldday.value = ''; + if (thefieldday.onchange) thefieldday.onchange.call(thefieldday); + thefieldmonth.value = ''; + if (thefieldmonth.onchange) thefieldmonth.onchange.call(thefieldmonth); + thefieldyear.value = ''; + if (thefieldyear.onchange) thefieldyear.onchange.call(thefieldyear); + + return 0; } /* @@ -337,13 +359,13 @@ function formatDate(date,format) * Licence: GPL * ================================================================== */ -function getDateFromFormat(val,format) +function getDateFromFormat(val, format) { // alert('getDateFromFormat val='+val+' format='+format); // Force parameters en chaine - val=val+""; - format=format+""; + val = val+""; + format = format+""; if (val == '') return 0; @@ -356,17 +378,14 @@ function getDateFromFormat(val,format) var seconde=now.getSeconds(); var i=0; - var d=0; // -d- follows the date string while -i- follows the format - // string + var d=0; // -d- follows the date string while -i- follows the format string while (i < format.length) { c=format.charAt(i); // Recupere char du format substr=""; j=i; - while ((format.charAt(j)==c) && (j < format.length)) // Recupere char - // successif - // identiques + while ((format.charAt(j)==c) && (j < format.length)) // Get successive similar characters { substr += format.charAt(j++); } From 81f0bb892171f46209979e662faa3aa35c65e9b8 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Sun, 15 Dec 2024 17:47:08 +0100 Subject: [PATCH 31/46] Debug v21 --- htdocs/compta/bank/bankentries_list.php | 14 +++++++++----- htdocs/compta/bank/line.php | 4 ++-- htdocs/compta/bank/releve.php | 5 ++--- htdocs/core/ajax/bankconciliate.php | 10 ++++++---- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 057ef86ec08..b7e00c3259c 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -900,7 +900,7 @@ if ($resql) { } // Code to adjust value date with plus and less picto using an Ajax call instead of a full reload of page - $urlajax = DOL_URL_ROOT.'/core/ajax/bankconciliate.php?token='.currentToken(); + $urlajax = DOL_URL_ROOT.'/core/ajax/bankconciliate.php?format=dayreduceformat&token='.currentToken(); print '
".$langs->trans("Name")." / ".$langs->trans("Company")."".$langs->trans("Anonymous")."".dol_print_date($db->jdate($objp->datedon))."'.number_format($objp->amount, 2, '.', ' ').' '.$langs->trans("Currency".$conf->currency).''.price($objp->amount).' '.$langs->trans("Currency".$conf->currency).'
'.$langs->trans('Note').'