From 0da4d510030ad59125d8c9722795439d7bbc9318 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 28 Sep 2024 12:09:35 +0200 Subject: [PATCH] Qual: Fix multiple phan notifications (#31151) * Qual: Fix notifications multiple files # Qual: Fix notifications multiple files Fixes to files with UnknownObject notices, fixing other notices in these files as well * Improve boxes typing * Qual: Extend accepted types to reduce notices * Fix type for GET/POST arguments of GETPOST* calls --- dev/tools/phan/baseline.txt | 59 +++++++-------- htdocs/admin/fediverse.php | 8 +- htdocs/compta/facture/card.php | 30 +++++++- .../box_accountancy_last_manual_entries.php | 9 ++- .../box_accountancy_suspense_account.php | 11 ++- htdocs/core/boxes/box_actions.php | 8 +- htdocs/core/boxes/box_actions_future.php | 8 +- htdocs/core/boxes/box_activity.php | 10 ++- htdocs/core/boxes/box_birthdays.php | 8 +- htdocs/core/boxes/box_birthdays_members.php | 8 +- htdocs/core/boxes/box_boms.php | 8 +- htdocs/core/boxes/box_bookmarks.php | 10 ++- htdocs/core/boxes/box_clients.php | 8 +- htdocs/core/boxes/box_commandes.php | 8 +- htdocs/core/boxes/box_comptes.php | 10 ++- htdocs/core/boxes/box_contacts.php | 8 +- htdocs/core/boxes/box_contracts.php | 8 +- ...box_customers_outstanding_bill_reached.php | 8 +- .../core/boxes/box_dolibarr_state_board.php | 8 +- htdocs/core/boxes/box_external_rss.php | 8 +- htdocs/core/boxes/box_factures.php | 8 +- htdocs/core/boxes/box_factures_fourn.php | 8 +- htdocs/core/boxes/box_factures_fourn_imp.php | 8 +- htdocs/core/boxes/box_factures_imp.php | 8 +- htdocs/core/boxes/box_fediverse.php | 8 +- htdocs/core/boxes/box_ficheinter.php | 8 +- htdocs/core/boxes/box_fournisseurs.php | 8 +- .../core/boxes/box_funnel_of_prospection.php | 14 ++-- htdocs/core/boxes/box_goodcustomers.php | 8 +- .../boxes/box_graph_invoices_permonth.php | 8 +- .../core/boxes/box_graph_invoices_peryear.php | 8 +- .../box_graph_invoices_supplier_permonth.php | 8 +- .../boxes/box_graph_nb_ticket_last_x_days.php | 10 ++- .../core/boxes/box_graph_nb_tickets_type.php | 10 ++- .../boxes/box_graph_new_vs_close_ticket.php | 10 ++- .../core/boxes/box_graph_orders_permonth.php | 10 ++- .../box_graph_orders_supplier_permonth.php | 8 +- .../boxes/box_graph_product_distribution.php | 8 +- .../boxes/box_graph_propales_permonth.php | 8 +- .../boxes/box_graph_ticket_by_severity.php | 10 ++- .../core/boxes/box_last_knowledgerecord.php | 10 ++- .../box_last_modified_knowledgerecord.php | 10 ++- .../core/boxes/box_last_modified_ticket.php | 10 ++- htdocs/core/boxes/box_last_ticket.php | 10 ++- htdocs/core/boxes/box_lastlogin.php | 10 ++- htdocs/core/boxes/box_members_by_tags.php | 8 +- htdocs/core/boxes/box_members_by_type.php | 8 +- .../core/boxes/box_members_last_modified.php | 8 +- .../boxes/box_members_last_subscriptions.php | 8 +- .../box_members_subscriptions_by_year.php | 8 +- htdocs/core/boxes/box_mos.php | 8 +- htdocs/core/boxes/box_produits.php | 10 ++- .../core/boxes/box_produits_alerte_stock.php | 8 +- htdocs/core/boxes/box_project.php | 8 +- .../core/boxes/box_project_opportunities.php | 8 +- htdocs/core/boxes/box_propales.php | 8 +- htdocs/core/boxes/box_prospect.php | 8 +- htdocs/core/boxes/box_scheduled_jobs.php | 8 +- htdocs/core/boxes/box_services_contracts.php | 8 +- htdocs/core/boxes/box_services_expired.php | 10 ++- htdocs/core/boxes/box_shipments.php | 8 +- htdocs/core/boxes/box_supplier_orders.php | 10 ++- ...box_supplier_orders_awaiting_reception.php | 10 ++- htdocs/core/boxes/box_task.php | 8 +- htdocs/core/boxes/box_validated_projects.php | 8 +- htdocs/core/boxes/modules_boxes.php | 28 +++++-- htdocs/core/class/dolgeophp.class.php | 8 +- htdocs/core/class/dolgraph.class.php | 16 ++-- htdocs/core/class/html.form.class.php | 20 ++--- htdocs/core/class/html.formother.class.php | 34 ++++++--- htdocs/core/class/infobox.class.php | 16 ++-- htdocs/core/class/notify.class.php | 27 +++++-- htdocs/core/class/translate.class.php | 10 +-- htdocs/core/lib/functions2.lib.php | 75 ++++++++++++------- htdocs/core/lib/functions_ch.lib.php | 3 +- htdocs/core/lib/usergroups.lib.php | 28 +++---- htdocs/core/modules/DolibarrModules.class.php | 5 +- htdocs/core/tpl/commonfields_add.tpl.php | 2 +- htdocs/core/tpl/commonfields_edit.tpl.php | 3 +- .../template/core/boxes/mymodulewidget1.php | 21 ++++-- htdocs/public/demo/index.php | 52 +++++++------ .../canvas/actions_card_common.class.php | 57 ++++++++++---- htdocs/user/agenda_extsites.php | 3 +- 83 files changed, 649 insertions(+), 396 deletions(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index b0be4551f2b..8cd57100be0 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -9,20 +9,20 @@ */ return [ // # Issue statistics: - // PhanPluginUnknownPropertyType : 1490+ occurrences - // PhanUndeclaredProperty : 830+ occurrences - // PhanTypeMismatchArgumentProbablyReal : 740+ occurrences - // PhanPossiblyUndeclaredGlobalVariable : 720+ occurrences + // PhanPluginUnknownPropertyType : 1460+ occurrences + // PhanUndeclaredProperty : 850+ occurrences + // PhanPossiblyUndeclaredGlobalVariable : 700+ occurrences + // PhanTypeMismatchArgumentProbablyReal : 670+ occurrences // PhanUndeclaredGlobalVariable : 440+ occurrences // PhanPluginUnknownArrayMethodReturnType : 430+ occurrences - // PhanPluginUnknownArrayMethodParamType : 360+ occurrences - // PhanPossiblyUndeclaredVariable : 320+ occurrences - // PhanPluginUnknownObjectMethodCall : 200+ occurrences + // PhanPluginUnknownArrayMethodParamType : 350+ occurrences + // PhanPossiblyUndeclaredVariable : 300+ occurrences // PhanTypeMismatchProperty : 200+ occurrences - // PhanPluginUnknownArrayFunctionReturnType : 160+ occurrences - // PhanPluginUnknownArrayFunctionParamType : 150+ occurrences - // PhanTypeMismatchArgumentNullableInternal : 110+ occurrences - // PhanPluginUnknownArrayPropertyType : 80+ occurrences + // PhanPluginUnknownObjectMethodCall : 160+ occurrences + // PhanPluginUnknownArrayFunctionReturnType : 150+ occurrences + // PhanPluginUnknownArrayFunctionParamType : 140+ occurrences + // PhanTypeMismatchArgumentNullableInternal : 90+ occurrences + // PhanPluginUnknownArrayPropertyType : 75+ occurrences // PhanPluginUndeclaredVariableIsset : 70+ occurrences // PhanPluginEmptyStatementIf : 55+ occurrences // PhanRedefineFunction : 50+ occurrences @@ -123,12 +123,12 @@ return [ 'htdocs/comm/propal/card.php' => ['PhanTypeMismatchProperty'], 'htdocs/comm/propal/class/api_proposals.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/comm/propal/class/propal.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], - 'htdocs/comm/propal/class/propalestats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], + 'htdocs/comm/propal/class/propalestats.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/comm/propal/list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/comm/propal/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/commande/class/api_orders.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/commande/class/commande.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], - 'htdocs/commande/class/commandestats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], + 'htdocs/commande/class/commandestats.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/commande/customer.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/commande/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/commande/list_det.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], @@ -136,13 +136,13 @@ return [ 'htdocs/commande/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/compta/accounting-files.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], 'htdocs/compta/bank/account_statement_document.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/compta/bank/annuel.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/compta/bank/annuel.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/compta/bank/bankentries_list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/bank/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/bank/class/account.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], 'htdocs/compta/bank/class/api_bankaccounts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/bank/class/bankcateg.class.php' => ['PhanPluginUnknownArrayPropertyType'], - 'htdocs/compta/bank/graph.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/compta/bank/graph.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/compta/bank/line.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/compta/bank/releve.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/compta/bank/transfer.php' => ['PhanTypeMismatchArgumentProbablyReal'], @@ -161,7 +161,7 @@ return [ 'htdocs/compta/deplacement/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/compta/facture/agenda-rec.php' => ['PhanPluginEmptyStatementIf'], 'htdocs/compta/facture/card-rec.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/compta/facture/card.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchDimFetch', 'PhanUndeclaredGlobalVariable'], + 'htdocs/compta/facture/card.php' => ['PhanUndeclaredProperty'], 'htdocs/compta/facture/class/api_invoices.class.php' => ['PhanEmptyForeach', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeComparisonFromArray', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/facture/class/facture-rec.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/compta/facture/class/facture.class.php' => ['PhanUndeclaredProperty'], @@ -263,7 +263,6 @@ return [ 'htdocs/core/boxes/box_actions.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/boxes/box_actions_future.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/boxes/box_external_rss.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/core/boxes/box_funnel_of_prospection.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/boxes/box_graph_invoices_permonth.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/boxes/box_graph_invoices_supplier_permonth.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php' => ['PhanPluginUnknownPropertyType'], @@ -281,7 +280,6 @@ return [ 'htdocs/core/boxes/box_services_contracts.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/boxes/box_task.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/boxes/box_validated_projects.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/core/boxes/modules_boxes.php' => ['PhanPluginUnknownArrayPropertyType'], 'htdocs/core/class/CSMSFile.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/canvas.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/ccountry.class.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], @@ -304,7 +302,6 @@ return [ 'htdocs/core/class/discount.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/class/doleditor.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/dolgeoip.class.php' => ['PhanTypeMismatchProperty'], - 'htdocs/core/class/dolgeophp.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall'], 'htdocs/core/class/dolgraph.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchDimFetch', 'PhanUndeclaredProperty'], 'htdocs/core/class/dolreceiptprinter.class.php' => ['PhanEmptyForeach', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/emailsenderprofile.class.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], @@ -324,17 +321,15 @@ return [ 'htdocs/core/class/html.formldap.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/core/class/html.formmail.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/class/html.formmargin.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'], - 'htdocs/core/class/html.formother.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/html.formprojet.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/class/html.formsetup.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayPropertyType'], 'htdocs/core/class/html.formticket.class.php' => ['PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/class/html.formwebsite.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType'], - 'htdocs/core/class/infobox.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/class/interfaces.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/ldap.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/core/class/link.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/mastodonhandler.class.php' => ['PhanPluginUnknownArrayMethodParamType'], - 'htdocs/core/class/notify.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], + 'htdocs/core/class/notify.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/openid.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/reddithandler.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType'], 'htdocs/core/class/rssparser.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], @@ -375,8 +370,7 @@ return [ 'htdocs/core/lib/fourn.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/ftp.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/core/lib/functions.lib.php' => ['PhanPluginDuplicateArrayKey'], - 'htdocs/core/lib/functions2.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/lib/functions_ch.lib.php' => ['PhanTypeMismatchDimFetch'], + 'htdocs/core/lib/functions2.lib.php' => ['PhanUndeclaredProperty'], 'htdocs/core/lib/functionsnumtoword.lib.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/lib/geturl.lib.php' => ['PhanPluginConstantVariableNull', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/core/lib/holiday.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], @@ -415,7 +409,6 @@ return [ 'htdocs/core/lib/tax.lib.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/lib/ticket.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/treeview.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'], - 'htdocs/core/lib/usergroups.lib.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/lib/website.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/core/lib/xcal.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'], 'htdocs/core/modules/DolibarrModules.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], @@ -518,8 +511,7 @@ return [ 'htdocs/core/tpl/ajaxrow.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/bloc_comment.tpl.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/card_presend.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/core/tpl/commonfields_add.tpl.php' => ['PhanPluginUnknownObjectMethodCall'], - 'htdocs/core/tpl/commonfields_edit.tpl.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredProperty'], + 'htdocs/core/tpl/commonfields_edit.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/core/tpl/commonfields_view.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/core/tpl/contacts.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/document_actions_post_headers.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable'], @@ -706,11 +698,11 @@ return [ 'htdocs/install/fileconf.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/install/inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanRedefineFunction'], 'htdocs/install/index.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/install/repair.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/install/repair.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/install/step2.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'], 'htdocs/install/step5.php' => ['PhanPluginUndeclaredVariableIsset'], - 'htdocs/install/upgrade.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/install/upgrade2.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/install/upgrade.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'], + 'htdocs/install/upgrade2.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/intracommreport/card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/intracommreport/class/intracommreport.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/intracommreport/lib/intracommreport.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], @@ -856,7 +848,7 @@ return [ 'htdocs/public/bookcal/index.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanRedefineFunction'], 'htdocs/public/company/new.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanRedefineFunction', 'PhanUndeclaredGlobalVariable'], 'htdocs/public/cron/cron_run_jobs_by_url.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/public/demo/index.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanRedefineFunction'], + 'htdocs/public/demo/index.php' => ['PhanRedefineFunction'], 'htdocs/public/donations/donateurs_code.php' => ['PhanRedefineFunction'], 'htdocs/public/emailing/mailing-read.php' => ['PhanRedefineFunction'], 'htdocs/public/eventorganization/attendee_new.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanRedefineFunction', 'PhanTypeMismatchArgumentProbablyReal'], @@ -939,7 +931,7 @@ return [ 'htdocs/societe/admin/societe.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'], 'htdocs/societe/ajax/ajaxcompanies.php' => ['PhanUndeclaredProperty'], 'htdocs/societe/ajax/company.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/societe/canvas/actions_card_common.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanTypeSuspiciousNonTraversableForeach'], + 'htdocs/societe/canvas/actions_card_common.class.php' => ['PhanTypeMismatchProperty', 'PhanTypeSuspiciousNonTraversableForeach'], 'htdocs/societe/card.php' => ['PhanTypeMismatchProperty'], 'htdocs/societe/checkvat/checkVatPopup.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/societe/class/api_contacts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], @@ -999,7 +991,6 @@ return [ 'htdocs/ticket/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/ticket/list.php' => ['PhanTypeComparisonFromArray'], 'htdocs/ticket/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/user/agenda_extsites.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/user/bank.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/user/card.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], 'htdocs/user/class/api_users.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], @@ -1043,7 +1034,7 @@ return [ 'htdocs/webservices/server_supplier_invoice.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanUndeclaredProperty'], 'htdocs/webservices/server_thirdparty.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/webservices/server_user.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/website/class/website.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/website/class/website.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/website/class/websitepage.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/website/index.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/website/lib/websiteaccount.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], diff --git a/htdocs/admin/fediverse.php b/htdocs/admin/fediverse.php index dd04b1e6783..c030997e8f6 100644 --- a/htdocs/admin/fediverse.php +++ b/htdocs/admin/fediverse.php @@ -206,7 +206,7 @@ if ($action == 'updatesocialnetwork') { } } - // Add new key, value if changed + // Add new key, value if changed foreach ($mergedParams as $newKey => $newValue) { if (!isset($socialNetworkData[$newKey]) || $socialNetworkData[$newKey] !== $newValue) { $socialNetworkData[$newKey] = $newValue; @@ -466,7 +466,7 @@ if ($resql) { print ''."\n"; print ''; - print ""; + print ""; print '
".$langs->trans("SocialNetworks")." ".($i+1)."".$langs->trans("SocialNetworks")." ".($i + 1)."'; print ''.img_edit().''; print ''.img_delete().''; @@ -564,8 +564,8 @@ $db->close(); /** * Check if the given fediverse feed if inside the list of boxes/widgets * - * @param int $id The id of the socialnetwork - * @param array $boxlist A list with boxes/widgets (array of stdClass objects). + * @param int $id The id of the socialnetwork + * @param ModeleBoxes[] $boxlist A list with boxes/widgets * @return bool True if the socialnetwork is inside the box/widget list, otherwise false */ function _isInBoxListFediverse(int $id, array $boxlist) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index dddef99cd70..7f7eea3b28d 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -120,6 +120,14 @@ $extrafields = new ExtraFields($db); // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); +$objectidnext = 0; +$total_global_ttc = 0; +$displayWarranty = false; +$statusreplacement = 0; +$type_fac = 0; +$price_base_type = ''; +$array_options = array(); + // Load object if ($id > 0 || !empty($ref)) { if ($action != 'add') { @@ -2250,6 +2258,7 @@ if (empty($reshook)) { } } + $price_base_type = null; if (!$error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) { $ret = $object->fetch($id); if ($ret < 0) { @@ -2494,7 +2503,7 @@ if (empty($reshook)) { } if (!$error) { - '@phan-var-force array $lines'; + '@phan-var-force CommonObjectLine[] $lines'; // Add batchinfo if the detail_batch array is defined if (isModEnabled('productbatch') && !empty($lines[$i]->detail_batch) && is_array($lines[$i]->detail_batch) && getDolGlobalString('INVOICE_INCUDE_DETAILS_OF_LOTS_SERIALS')) { $langs->load('productbatch'); @@ -2996,6 +3005,7 @@ if (empty($reshook)) { $importLines = GETPOST('line_checkbox'); if (!empty($importLines) && is_array($importLines) && !empty($fromElement) && ctype_alpha($fromElement) && !empty($fromElementid)) { + $lineClassName = ''; if ($fromElement == 'commande') { dol_include_once('/'.$fromElement.'/class/'.$fromElement.'.class.php'); $lineClassName = 'OrderLine'; @@ -3007,6 +3017,17 @@ if (empty($reshook)) { $importCount = 0; $error = 0; foreach ($importLines as $lineId) { + if ($lineClassName === '') { + // No class + if ($error === 0) { + // Log only once + dol_syslog('compta/facture/card - No lineClassName - skip import', LOG_ERR); + } + // Ensure we report that all line failed (see error message below) + $error++; + break; + } + $lineId = intval($lineId); $originLine = new $lineClassName($db); if (intval($fromElementid) > 0 && $originLine->fetch($lineId) > 0) { @@ -3166,6 +3187,7 @@ $formmargin = new FormMargin($db); $soc = new Societe($db); $paymentstatic = new Paiement($db); $bankaccountstatic = new Account($db); +$formproject = null; if (isModEnabled('project')) { $formproject = new FormProjets($db); } @@ -3199,6 +3221,7 @@ if ($action == 'create') { $fk_account = GETPOSTINT('fk_account'); // Load objectsrc + $objectsrc = null; // Initialise //$remise_absolue = 0; if (!empty($origin) && !empty($originid)) { // Parse element/subelement (ex: project_task) @@ -3248,6 +3271,7 @@ if ($action == 'create') { $classname = ucfirst($subelement); $objectsrc = new $classname($db); + '@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc'; $objectsrc->fetch($originid); if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) { $objectsrc->fetch_lines(); @@ -3273,6 +3297,7 @@ if ($action == 'create') { $classname = ucfirst($subelem); $expesrc = new $classname($db); + '@phan-var-force CommonObject $expesrc'; $expesrc->fetch($expeoriginid); $cond_reglement_id = (!empty($expesrc->cond_reglement_id) ? $expesrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 1)); @@ -3992,7 +4017,7 @@ if ($action == 'create') { } // Project - if (isModEnabled('project')) { + if (isModEnabled('project') && is_object($formproject)) { $langs->load('projects'); print '
'.$langs->trans('Project').''; print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); @@ -4116,6 +4141,7 @@ if ($action == 'create') { // TODO for compatibility if ($origin == 'contrat') { + '@phan-var-force Contrat $objectsrc'; // Calcul contrat->price (HT), contrat->total (TTC), contrat->tva $objectsrc->update_price(1, 'auto', 1); } diff --git a/htdocs/core/boxes/box_accountancy_last_manual_entries.php b/htdocs/core/boxes/box_accountancy_last_manual_entries.php index bcac923ba58..cad285014c2 100644 --- a/htdocs/core/boxes/box_accountancy_last_manual_entries.php +++ b/htdocs/core/boxes/box_accountancy_last_manual_entries.php @@ -154,11 +154,14 @@ class box_accountancy_last_manual_entries extends ModeleBoxes } } + + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_accountancy_suspense_account.php b/htdocs/core/boxes/box_accountancy_suspense_account.php index bd35f9a302f..1bf03ec68d6 100644 --- a/htdocs/core/boxes/box_accountancy_suspense_account.php +++ b/htdocs/core/boxes/box_accountancy_suspense_account.php @@ -56,9 +56,10 @@ class box_accountancy_suspense_account extends ModeleBoxes /** * Load data for box to show them later * + * @param int $max Maximum number of records to load * @return void */ - public function loadBox() + public function loadBox($max = 1) { global $user, $langs, $conf; @@ -107,11 +108,13 @@ class box_accountancy_suspense_account extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index 08ca1f973f8..fa2eaf30e2c 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -197,11 +197,13 @@ class box_actions extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_actions_future.php b/htdocs/core/boxes/box_actions_future.php index a717d5574b3..88293dfff4c 100644 --- a/htdocs/core/boxes/box_actions_future.php +++ b/htdocs/core/boxes/box_actions_future.php @@ -200,11 +200,13 @@ class box_actions_future extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index d637230d409..e62e49fe3a6 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -437,13 +437,15 @@ class box_activity extends ModeleBoxes } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string - * @return string + * @return string */ public function showBox($head = null, $contents = null, $nooutput = 0) { diff --git a/htdocs/core/boxes/box_birthdays.php b/htdocs/core/boxes/box_birthdays.php index d7e30b83d0a..30cc8ea9491 100644 --- a/htdocs/core/boxes/box_birthdays.php +++ b/htdocs/core/boxes/box_birthdays.php @@ -167,11 +167,13 @@ class box_birthdays extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_birthdays_members.php b/htdocs/core/boxes/box_birthdays_members.php index 0453d30ee01..3ab3863fdb6 100644 --- a/htdocs/core/boxes/box_birthdays_members.php +++ b/htdocs/core/boxes/box_birthdays_members.php @@ -159,11 +159,13 @@ class box_birthdays_members extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_boms.php b/htdocs/core/boxes/box_boms.php index acd95fc5563..e5c8a0ca6e6 100644 --- a/htdocs/core/boxes/box_boms.php +++ b/htdocs/core/boxes/box_boms.php @@ -172,11 +172,13 @@ class box_boms extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_bookmarks.php b/htdocs/core/boxes/box_bookmarks.php index dcbe2c7da41..9c025931400 100644 --- a/htdocs/core/boxes/box_bookmarks.php +++ b/htdocs/core/boxes/box_bookmarks.php @@ -137,13 +137,15 @@ class box_bookmarks extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string - * @return string + * @return string */ public function showBox($head = null, $contents = null, $nooutput = 0) { diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index 08e3c1af516..0b18e3ca48f 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -170,11 +170,13 @@ class box_clients extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php index 38a36a4175f..de80645db7d 100644 --- a/htdocs/core/boxes/box_commandes.php +++ b/htdocs/core/boxes/box_commandes.php @@ -209,11 +209,13 @@ class box_commandes extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php index 7bdca79e5ac..926ec55041b 100644 --- a/htdocs/core/boxes/box_comptes.php +++ b/htdocs/core/boxes/box_comptes.php @@ -178,13 +178,15 @@ class box_comptes extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string - * @return string + * @return string */ public function showBox($head = null, $contents = null, $nooutput = 0) { diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index 7cc479d7a8b..06a5db32149 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -207,11 +207,13 @@ class box_contacts extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index 867651ae408..d3c66fce04b 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -185,11 +185,13 @@ class box_contracts extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php index 76e6db5dddc..8dcd6a5ecc7 100644 --- a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php +++ b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php @@ -170,11 +170,13 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_dolibarr_state_board.php b/htdocs/core/boxes/box_dolibarr_state_board.php index 1fbb3216444..d5b47a101f9 100644 --- a/htdocs/core/boxes/box_dolibarr_state_board.php +++ b/htdocs/core/boxes/box_dolibarr_state_board.php @@ -312,11 +312,13 @@ class box_dolibarr_state_board extends ModeleBoxes } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_external_rss.php b/htdocs/core/boxes/box_external_rss.php index 1d3930a86f5..73f69b2d723 100644 --- a/htdocs/core/boxes/box_external_rss.php +++ b/htdocs/core/boxes/box_external_rss.php @@ -204,11 +204,13 @@ class box_external_rss extends ModeleBoxes } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index 0fa3a0af7ab..408fcb1fa49 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -220,11 +220,13 @@ class box_factures extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index a52cec120bf..dceb3d6843c 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -216,11 +216,13 @@ class box_factures_fourn extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php index 09ac76fce4e..21ef52a56fc 100644 --- a/htdocs/core/boxes/box_factures_fourn_imp.php +++ b/htdocs/core/boxes/box_factures_fourn_imp.php @@ -258,11 +258,13 @@ class box_factures_fourn_imp extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index f4515caf95c..d6a24e31576 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -271,11 +271,13 @@ class box_factures_imp extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_fediverse.php b/htdocs/core/boxes/box_fediverse.php index 479f47a2684..5109aeba8cb 100644 --- a/htdocs/core/boxes/box_fediverse.php +++ b/htdocs/core/boxes/box_fediverse.php @@ -148,11 +148,13 @@ class box_fediverse extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php index 406a9c45305..dfa059d4bf6 100644 --- a/htdocs/core/boxes/box_ficheinter.php +++ b/htdocs/core/boxes/box_ficheinter.php @@ -174,11 +174,13 @@ class box_ficheinter extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php index 4f8b8211f33..4917492036b 100644 --- a/htdocs/core/boxes/box_fournisseurs.php +++ b/htdocs/core/boxes/box_fournisseurs.php @@ -162,11 +162,13 @@ class box_fournisseurs extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_funnel_of_prospection.php b/htdocs/core/boxes/box_funnel_of_prospection.php index 860ed045ecd..d6cff6b37c4 100644 --- a/htdocs/core/boxes/box_funnel_of_prospection.php +++ b/htdocs/core/boxes/box_funnel_of_prospection.php @@ -134,8 +134,8 @@ class box_funnel_of_prospection extends ModeleBoxes $this->info_box_head = array( 'text' => $langs->trans("Statistics").' - '.$langs->trans("BoxTitleFunnelOfProspection"), - 'nbcol' => '2', - 'graph' => '1' + 'nbcol' => 2, + 'graph' => 1 ); if ($user->hasRight('projet', 'lire') || getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) { @@ -309,12 +309,14 @@ class box_funnel_of_prospection extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines - * @param int<0,1> $nooutput No $stringtoprint .=, only return string + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string * @return string */ public function showBox($head = null, $contents = null, $nooutput = 0) diff --git a/htdocs/core/boxes/box_goodcustomers.php b/htdocs/core/boxes/box_goodcustomers.php index eb71fb09538..12d12b7e855 100644 --- a/htdocs/core/boxes/box_goodcustomers.php +++ b/htdocs/core/boxes/box_goodcustomers.php @@ -158,11 +158,13 @@ class box_goodcustomers extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index 84a4bdf3de8..d3e0c205ed9 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -273,11 +273,13 @@ class box_graph_invoices_permonth extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_graph_invoices_peryear.php b/htdocs/core/boxes/box_graph_invoices_peryear.php index c5610b99dae..dc10a4e23d6 100644 --- a/htdocs/core/boxes/box_graph_invoices_peryear.php +++ b/htdocs/core/boxes/box_graph_invoices_peryear.php @@ -206,11 +206,13 @@ class box_graph_invoices_peryear extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index ff3788142c6..3405aa5527d 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -268,11 +268,13 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php index 4f6aec89a00..d7a7e27c314 100644 --- a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php +++ b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php @@ -201,13 +201,15 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string - * @return string + * @return string */ public function showBox($head = null, $contents = null, $nooutput = 0) { diff --git a/htdocs/core/boxes/box_graph_nb_tickets_type.php b/htdocs/core/boxes/box_graph_nb_tickets_type.php index 334e747a8a4..1a17fbf1de8 100644 --- a/htdocs/core/boxes/box_graph_nb_tickets_type.php +++ b/htdocs/core/boxes/box_graph_nb_tickets_type.php @@ -183,13 +183,15 @@ class box_graph_nb_tickets_type extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string - * @return string + * @return string */ public function showBox($head = null, $contents = null, $nooutput = 0) { diff --git a/htdocs/core/boxes/box_graph_new_vs_close_ticket.php b/htdocs/core/boxes/box_graph_new_vs_close_ticket.php index 271bf534cdb..ca61d098f6a 100644 --- a/htdocs/core/boxes/box_graph_new_vs_close_ticket.php +++ b/htdocs/core/boxes/box_graph_new_vs_close_ticket.php @@ -164,13 +164,15 @@ class box_graph_new_vs_close_ticket extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string - * @return string + * @return string */ public function showBox($head = null, $contents = null, $nooutput = 0) { diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index fbcd51f9bb1..ebfe1af9ee3 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -281,13 +281,15 @@ class box_graph_orders_permonth extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string - * @return string + * @return string */ public function showBox($head = null, $contents = null, $nooutput = 0) { diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index f913089a77d..7e4fb9eae09 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -280,11 +280,13 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 983f8c61fc5..1841a0f1496 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -420,11 +420,13 @@ class box_graph_product_distribution extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index bb8c6f894ac..d7e7dc58b32 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -277,11 +277,13 @@ class box_graph_propales_permonth extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_graph_ticket_by_severity.php b/htdocs/core/boxes/box_graph_ticket_by_severity.php index e12fe6a6d6e..6dd7f3b6bff 100644 --- a/htdocs/core/boxes/box_graph_ticket_by_severity.php +++ b/htdocs/core/boxes/box_graph_ticket_by_severity.php @@ -199,13 +199,15 @@ class box_graph_ticket_by_severity extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string - * @return string + * @return string */ public function showBox($head = null, $contents = null, $nooutput = 0) { diff --git a/htdocs/core/boxes/box_last_knowledgerecord.php b/htdocs/core/boxes/box_last_knowledgerecord.php index 88a12929e0e..9f4d98999ac 100644 --- a/htdocs/core/boxes/box_last_knowledgerecord.php +++ b/htdocs/core/boxes/box_last_knowledgerecord.php @@ -183,13 +183,15 @@ class box_last_knowledgerecord extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string - * @return string + * @return string */ public function showBox($head = null, $contents = null, $nooutput = 0) { diff --git a/htdocs/core/boxes/box_last_modified_knowledgerecord.php b/htdocs/core/boxes/box_last_modified_knowledgerecord.php index ca121fc409c..c41d141d5e8 100644 --- a/htdocs/core/boxes/box_last_modified_knowledgerecord.php +++ b/htdocs/core/boxes/box_last_modified_knowledgerecord.php @@ -183,13 +183,15 @@ class box_last_modified_knowledgerecord extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string - * @return string + * @return string */ public function showBox($head = null, $contents = null, $nooutput = 0) { diff --git a/htdocs/core/boxes/box_last_modified_ticket.php b/htdocs/core/boxes/box_last_modified_ticket.php index abdc6653331..f5c5c6b49d3 100644 --- a/htdocs/core/boxes/box_last_modified_ticket.php +++ b/htdocs/core/boxes/box_last_modified_ticket.php @@ -190,13 +190,15 @@ class box_last_modified_ticket extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string - * @return string + * @return string */ public function showBox($head = null, $contents = null, $nooutput = 0) { diff --git a/htdocs/core/boxes/box_last_ticket.php b/htdocs/core/boxes/box_last_ticket.php index 833af7f3cc1..8910aed5aa4 100644 --- a/htdocs/core/boxes/box_last_ticket.php +++ b/htdocs/core/boxes/box_last_ticket.php @@ -184,13 +184,15 @@ class box_last_ticket extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string - * @return string + * @return string */ public function showBox($head = null, $contents = null, $nooutput = 0) { diff --git a/htdocs/core/boxes/box_lastlogin.php b/htdocs/core/boxes/box_lastlogin.php index 6561ebfe695..6ec1d99c032 100644 --- a/htdocs/core/boxes/box_lastlogin.php +++ b/htdocs/core/boxes/box_lastlogin.php @@ -95,13 +95,15 @@ class box_lastlogin extends ModeleBoxes } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string - * @return string + * @return string */ public function showBox($head = null, $contents = null, $nooutput = 0) { diff --git a/htdocs/core/boxes/box_members_by_tags.php b/htdocs/core/boxes/box_members_by_tags.php index 3209b710505..07a9e9962ad 100644 --- a/htdocs/core/boxes/box_members_by_tags.php +++ b/htdocs/core/boxes/box_members_by_tags.php @@ -254,11 +254,13 @@ class box_members_by_tags extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_members_by_type.php b/htdocs/core/boxes/box_members_by_type.php index 812ad837abb..ebe15471a4b 100644 --- a/htdocs/core/boxes/box_members_by_type.php +++ b/htdocs/core/boxes/box_members_by_type.php @@ -254,11 +254,13 @@ class box_members_by_type extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_members_last_modified.php b/htdocs/core/boxes/box_members_last_modified.php index 3f3d74f6c10..c4a3fc27e7d 100644 --- a/htdocs/core/boxes/box_members_last_modified.php +++ b/htdocs/core/boxes/box_members_last_modified.php @@ -180,11 +180,13 @@ class box_members_last_modified extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_members_last_subscriptions.php b/htdocs/core/boxes/box_members_last_subscriptions.php index c1d637ebada..03c77b0500e 100644 --- a/htdocs/core/boxes/box_members_last_subscriptions.php +++ b/htdocs/core/boxes/box_members_last_subscriptions.php @@ -179,11 +179,13 @@ class box_members_last_subscriptions extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_members_subscriptions_by_year.php b/htdocs/core/boxes/box_members_subscriptions_by_year.php index 7b262f595eb..755e58a0118 100644 --- a/htdocs/core/boxes/box_members_subscriptions_by_year.php +++ b/htdocs/core/boxes/box_members_subscriptions_by_year.php @@ -219,11 +219,13 @@ class box_members_subscriptions_by_year extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_mos.php b/htdocs/core/boxes/box_mos.php index 985f7c48e3d..214c38ced17 100644 --- a/htdocs/core/boxes/box_mos.php +++ b/htdocs/core/boxes/box_mos.php @@ -169,11 +169,13 @@ class box_mos extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php index 82299daf345..52a27b151cb 100644 --- a/htdocs/core/boxes/box_produits.php +++ b/htdocs/core/boxes/box_produits.php @@ -233,13 +233,15 @@ class box_produits extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string - * @return string + * @return string */ public function showBox($head = null, $contents = null, $nooutput = 0) { diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php index 650040367e2..da714ede7ab 100644 --- a/htdocs/core/boxes/box_produits_alerte_stock.php +++ b/htdocs/core/boxes/box_produits_alerte_stock.php @@ -225,11 +225,13 @@ class box_produits_alerte_stock extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index c2713dff76b..e713b654997 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -204,11 +204,13 @@ class box_project extends ModeleBoxes ); } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_project_opportunities.php b/htdocs/core/boxes/box_project_opportunities.php index 53a30d2ae01..43e35640e7e 100644 --- a/htdocs/core/boxes/box_project_opportunities.php +++ b/htdocs/core/boxes/box_project_opportunities.php @@ -189,11 +189,13 @@ class box_project_opportunities extends ModeleBoxes ); } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index 02fe9be8912..59daa109ef1 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -194,11 +194,13 @@ class box_propales extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php index 88c93c86700..0052c28a331 100644 --- a/htdocs/core/boxes/box_prospect.php +++ b/htdocs/core/boxes/box_prospect.php @@ -176,11 +176,13 @@ class box_prospect extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_scheduled_jobs.php b/htdocs/core/boxes/box_scheduled_jobs.php index 4e66eca08fc..1b621155ee2 100644 --- a/htdocs/core/boxes/box_scheduled_jobs.php +++ b/htdocs/core/boxes/box_scheduled_jobs.php @@ -194,11 +194,13 @@ class box_scheduled_jobs extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index 25df9d0275a..ccdf6b9fce1 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -223,11 +223,13 @@ class box_services_contracts extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_services_expired.php b/htdocs/core/boxes/box_services_expired.php index 46dec068b35..f5c7ee6211a 100644 --- a/htdocs/core/boxes/box_services_expired.php +++ b/htdocs/core/boxes/box_services_expired.php @@ -179,13 +179,15 @@ class box_services_expired extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string - * @return string + * @return string */ public function showBox($head = null, $contents = null, $nooutput = 0) { diff --git a/htdocs/core/boxes/box_shipments.php b/htdocs/core/boxes/box_shipments.php index 34d0e10a518..9dbf5448c07 100644 --- a/htdocs/core/boxes/box_shipments.php +++ b/htdocs/core/boxes/box_shipments.php @@ -186,11 +186,13 @@ class box_shipments extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_supplier_orders.php b/htdocs/core/boxes/box_supplier_orders.php index 3dbd7d852a6..168d5f6fc9b 100644 --- a/htdocs/core/boxes/box_supplier_orders.php +++ b/htdocs/core/boxes/box_supplier_orders.php @@ -183,13 +183,15 @@ class box_supplier_orders extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string - * @return string + * @return string */ public function showBox($head = null, $contents = null, $nooutput = 0) { diff --git a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php index a882814a5ca..2b89a8ed436 100644 --- a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php +++ b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php @@ -182,13 +182,15 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string - * @return string + * @return string */ public function showBox($head = null, $contents = null, $nooutput = 0) { diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index d81278383d3..fc106d05e8b 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -200,11 +200,13 @@ class box_task extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/box_validated_projects.php b/htdocs/core/boxes/box_validated_projects.php index fc1df5741d0..0bd6472805a 100644 --- a/htdocs/core/boxes/box_validated_projects.php +++ b/htdocs/core/boxes/box_validated_projects.php @@ -186,11 +186,13 @@ class box_validated_projects extends ModeleBoxes } } + + /** - * Method to show box + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 6877e50419a..d7d237d6961 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -52,12 +52,12 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo public $param; /** - * @var array box info heads. Example: array('text' => $langs->trans("BoxScheduledJobs", $max), 'nbcol' => 4); + * @var array,sublink?:string,subtext?:string,picto?:string,target?:string,td?:string}>|array{text:string,nbcol?:int,limit?:int,graph?:int<0,1>,sublink?:string,subtext?:string,picto?:string,target?:string,td?:string} box info heads. Example: array('text' => $langs->trans("BoxScheduledJobs", $max), 'nbcol' => 4); */ public $info_box_head = array(); /** - * @var array box info content + * @var array,maxlength?:int}>>|array,maxlength?:int}> box info content */ public $info_box_contents = array(); @@ -172,6 +172,22 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo $this->db = $db; } + + + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + // Must be implemented in derived classes + $msg = get_class($this)."::".__FUNCTION__." not implemented"; + dol_syslog($msg, LOG_ERR); + } + + /** * Return last error message * @@ -224,8 +240,8 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo /** * Standard method to show a box (usage by boxes not mandatory, a box can still use its own showBox function) * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines * @param int<0,1> $nooutput No print, only return string * @return string */ @@ -284,7 +300,7 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo //$out.= ''; @@ -614,6 +623,7 @@ function dol_print_object_info($object, $usetable = 0) // Date send if (!empty($object->date_envoi)) { + '@phan-var-force Mailing $object'; if ($usetable) { print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ""; $i++;
'; $out .= '
'; } - if (!empty($head['text'])) { + if (!empty($head['text']) && !is_array($head['text'])) { $s = dol_trunc($head['text'], isset($head['limit']) ? $head['limit'] : $MAXLENGTHBOX); $out .= $s; } @@ -298,7 +314,7 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo if (!empty($head['sublink'])) { $sublink .= ''; } - if (!empty($head['subpicto'])) { + if (!empty($head['subpicto']) && !is_array($head['subtext']) && !is_array($head['subpicto'])) { $sublink .= img_picto($head['subtext'], $head['subpicto'], 'class="opacitymedium marginleftonly '.(empty($head['subclass']) ? '' : $head['subclass']).'" id="idsubimg'.$this->boxcode.'"'); } if (!empty($head['sublink'])) { diff --git a/htdocs/core/class/dolgeophp.class.php b/htdocs/core/class/dolgeophp.class.php index 5e9ed89f7f8..78f6bfed620 100644 --- a/htdocs/core/class/dolgeophp.class.php +++ b/htdocs/core/class/dolgeophp.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 Frédéric France + * 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 @@ -50,14 +51,16 @@ class DolGeoPHP * Return data from a value * * @param string $value Value - * @return array Centroid + * @return array{}|array{geojson:string,centroid:Geometry,centroidjson:string} Centroid */ public function parseGeoString($value) { $geom = geoPHP::load($value, 'wkt'); if ($geom) { + '@phan-var-force Geometry $geom'; $geojson = $geom->out('json'); $centroid = $geom->getCentroid(); + '@phan-var-force Geometry $centroid'; $centroidjson = $centroid->out('json'); return array('geojson' => $geojson, 'centroid' => $centroid, 'centroidjson' => $centroidjson); @@ -78,6 +81,7 @@ class DolGeoPHP $geom = geoPHP::load($value, 'wkt'); if ($geom) { + '@phan-var-force Geometry $geom'; $value = $geom->x().' '.$geom->y(); } return $value; @@ -95,6 +99,7 @@ class DolGeoPHP $geom = geoPHP::load($value, 'wkt'); if ($geom) { + '@phan-var-force Geometry $geom'; $value = get_class($geom) . ' : '. $geom->numPoints() . ' Points'; } return $value; @@ -112,6 +117,7 @@ class DolGeoPHP $geom = geoPHP::load($geojson, 'json'); if ($geom) { + '@phan-var-force Geometry $geom'; $value_key = $geom->out('wkt'); } return $value_key; diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 4163a6b7553..b923e1f0f6c 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -317,8 +317,8 @@ class DolGraph /** * Set border skip * - * @param int $borderskip Can be 'start' to skip start border, 'end' to skip end border, 'middle' to skip middle border, - * 'false' to not skip any border, 'true' to skip all border + * @param 'start'|'end'|'middle'|'false'|'true' $borderskip Can be 'start' to skip start border, 'end' to skip end border, 'middle' to skip middle border, + * 'false' to not skip any border, 'true' to skip all border * @return void */ public function setBorderSkip($borderskip) @@ -329,7 +329,7 @@ class DolGraph /** * Set tooltips labels of the graph * - * @param array $tooltipsLabels Tooltips Labels array('...','...'...) + * @param string[] $tooltipsLabels Tooltips Labels array('...','...'...) * @return void */ public function setTooltipsLabels($tooltipsLabels) @@ -340,7 +340,7 @@ class DolGraph /** * Set tooltips titles of the graph * - * @param array $tooltipsTitles Tooltips Titles array('...','...'...) + * @param string[] $tooltipsTitles Tooltips Titles array('...','...'...) * @return void */ public function setTooltipsTitles($tooltipsTitles) @@ -352,8 +352,8 @@ class DolGraph /** * Set type * - * @param array $type Array with type for each series. Example: array('type1', 'type2', ...) where type can be: - * 'pie', 'piesemicircle', 'polar', 'lines', 'linesnopoint', 'bars', 'horizontalbars'... + * @param string[] $type Array with type for each series. Example: array('type1', 'type2', ...) where type can be: + * 'pie', 'piesemicircle', 'polar', 'lines', 'linesnopoint', 'bars', 'horizontalbars'... * @return void */ public function SetType($type) @@ -366,7 +366,7 @@ class DolGraph /** * Set legend * - * @param array $legend Legend. Example: array('seriename1','seriname2',...) + * @param string[] $legend Legend. Example: array('seriename1','seriname2',...) * @return void */ public function SetLegend($legend) @@ -561,7 +561,7 @@ class DolGraph /** * Define background color of complete image * - * @param array $bg_color array(R,G,B) ou 'onglet' ou 'default' + * @param array{0:int,1:int,2:int}|'onglet'|'default' $bg_color array(R,G,B) ou 'onglet' ou 'default' * @return void */ public function SetBgColor($bg_color = array(255, 255, 255)) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 01b3968757b..3df31ddb375 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -9791,16 +9791,16 @@ class Form /** * Return an html string with a select combo box to choose yes or no * - * @param string $htmlname Name of html select field - * @param string $value Pre-selected value - * @param int $option 0 return yes/no, 1 return 1/0 - * @param bool $disabled true or false - * @param int $useempty 1=Add empty line - * @param int $addjscombo 1=Add js beautifier on combo box - * @param string $morecss More CSS - * @param string $labelyes Label for Yes - * @param string $labelno Label for No - * @return string See option + * @param string $htmlname Name of html select field + * @param string|int $value Pre-selected value + * @param int $option 0 return yes/no, 1 return 1/0 + * @param bool $disabled true or false + * @param int $useempty 1=Add empty line + * @param int $addjscombo 1=Add js beautifier on combo box + * @param string $morecss More CSS + * @param string $labelyes Label for Yes + * @param string $labelno Label for No + * @return string See option */ public function selectyesno($htmlname, $value = '', $option = 0, $disabled = false, $useempty = 0, $addjscombo = 0, $morecss = 'width75', $labelyes = 'Yes', $labelno = 'No') { diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index f4c8a736b99..09a9daa5994 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -40,6 +40,9 @@ */ class FormOther { + /** + * @var DoliDB + */ private $db; /** @@ -694,7 +697,7 @@ class FormOther * * @param int $inc Cursor counter * @param int $parent Id of parent task we want to see - * @param array $lines Array of task lines + * @param Task[] $lines Array of task lines * @param int $level Level * @param int $selectedtask Id selected task * @param int $selectedproject Id selected project @@ -831,9 +834,9 @@ class FormOther * @param string $prefix Name of HTML field * @param string $form_name Deprecated. Not used. * @param int $showcolorbox 1=Show color code and color box, 0=Show only color code - * @param array $arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813') + * @param string[] $arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813') * @return void - * @deprecated Use instead selectColor + * @deprecated Use selectColor() * @see selectColor() */ public function select_color($set_color = '', $prefix = 'f_color', $form_name = '', $showcolorbox = 1, $arrayofcolors = []) @@ -1216,16 +1219,23 @@ class FormOther * * @param User $user Object User * @param string $areacode Code of area for pages - 0 = Home page ... See getListOfPagesForBoxes() - * @return array array('selectboxlist'=>, 'boxactivated'=>, 'boxlista'=>, 'boxlistb'=>) + * @return array{selectboxlist:string,boxactivated:ModeleBoxes[],boxlista:string,boxlistb:string} */ public static function getBoxesArea($user, $areacode) { global $conf, $langs, $db; include_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; + // From include + ' + @phan-var-force ModeleBoxes[] $boxactivated + @phan-var-force int[] $boxidactivatedforuser + '; $confuserzone = 'MAIN_BOXES_'.$areacode; + + // $boxactivated will be array of boxes enabled into global setup // $boxidactivatedforuser will be array of boxes chose by user @@ -1541,12 +1551,12 @@ class FormOther /** * Return HTML select list to select a group by field * - * @param mixed $object Object analyzed - * @param array $search_groupby Array of preselected fields - * @param array $arrayofgroupby Array of groupby to fill - * @param string $morecss More CSS - * @param string $showempty '1' or 'text' - * @return string HTML string component + * @param mixed $object Object analyzed + * @param string[] $search_groupby Array of preselected fields + * @param array $arrayofgroupby Array of groupby to fill + * @param string $morecss More CSS + * @param string $showempty '1' or 'text' + * @return string HTML string component */ public function selectGroupByField($object, $search_groupby, &$arrayofgroupby, $morecss = 'minwidth200 maxwidth250', $showempty = '1') { @@ -1565,8 +1575,8 @@ class FormOther * Return HTML select list to select a group by field * * @param mixed $object Object analyzed - * @param array $search_xaxis Array of preselected fields - * @param array $arrayofxaxis Array of groupby to fill + * @param string[] $search_xaxis Array of preselected fields + * @param array $arrayofxaxis Array of groupby to fill * @param string $showempty '1' or 'text' * @param string $morecss More css * @return string HTML string component diff --git a/htdocs/core/class/infobox.class.php b/htdocs/core/class/infobox.class.php index e8b8b11d7da..19ebf3e77ac 100644 --- a/htdocs/core/class/infobox.class.php +++ b/htdocs/core/class/infobox.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2019 Nicolas ZABOURI + * 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 @@ -86,10 +87,10 @@ class InfoBox * @param DoliDB $dbs Database handler * @param string $mode 'available' or 'activated' * @param int $zone Name or area (-1 for all, 0 for Homepage, 1 for Accountancy, 2 for xxx, ...) - * @param User|null $user Object user to filter - * @param array $excludelist Array of box id (box.box_id = boxes_def.rowid) to exclude + * @param ?User $user Object user to filter + * @param int[] $excludelist Array of box id (box.box_id = boxes_def.rowid) to exclude * @param int $includehidden Include also hidden boxes - * @return array Array of boxes + * @return ModeleBoxes[]|array{error:string} Array of boxes or error info */ public static function listBoxes($dbs, $mode, $zone, $user = null, $excludelist = array(), $includehidden = 1) { @@ -145,6 +146,7 @@ class InfoBox dol_include_once($relsourcefile); if (class_exists($boxname)) { $box = new $boxname($dbs, $obj->note); // Constructor may set properties like box->enabled. obj->note is note into box def, not user params. + '@phan-var-force ModeleBoxes $box'; //$box=new stdClass(); // box properties @@ -158,9 +160,9 @@ class InfoBox if ($mode == 'activated' && !is_object($user)) { // List of activated box was not yet personalized into database if (is_numeric($box->box_order)) { - if ($box->box_order % 2 == 1) { + if (((int) $box->box_order % 2) == 1) { $box->box_order = 'A'.$box->box_order; - } elseif ($box->box_order % 2 == 0) { + } elseif (((int) $box->box_order % 2) == 0) { $box->box_order = 'B'.$box->box_order; } } @@ -205,7 +207,7 @@ class InfoBox } } else { dol_syslog($dbs->lasterror(), LOG_ERR); - return array('error'=>$dbs->lasterror()); + return array('error' => $dbs->lasterror()); } return $boxes; @@ -243,7 +245,7 @@ class InfoBox // Save parameters to say user has a dedicated setup $tab = array(); $confuserzone = 'MAIN_BOXES_'.$zone; - $tab[$confuserzone] = 1; + $tab[$confuserzone] = '1'; if (dol_set_user_param($dbs, $conf, $user, $tab) < 0) { $error = $dbs->lasterror(); $dbs->rollback(); diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 93519c6e0ec..7a2fa57b2d3 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -112,10 +112,25 @@ class Notify */ public $errors = array(); + /** + * @var string + */ public $author; + /** + * @var string + */ public $ref; + /** + * @var int + */ public $date; + /** + * @var int + */ public $duree; + /** + * @var string + */ public $note; /** @@ -602,12 +617,12 @@ class Notify * Check if notification are active for couple action/company. * If yes, send mail and save trace into llx_notify. * - * @param string $notifcode Code of action in llx_c_action_trigger (new usage) or Id of action in llx_c_action_trigger (old usage) - * @param Object $object Object the notification deals on - * @param array $filename_list List of files to attach (full path of filename on file system) - * @param array $mimetype_list List of MIME type of attached files - * @param array $mimefilename_list List of attached file name in message - * @return int Return integer <0 if KO, or number of changes if OK + * @param string $notifcode Code of action in llx_c_action_trigger (new usage) or Id of action in llx_c_action_trigger (old usage) + * @param CommonObject $object Object the notification deals on + * @param string[] $filename_list List of files to attach (full path of filename on file system) + * @param string[] $mimetype_list List of MIME type of attached files + * @param string[] $mimefilename_list List of attached file name in message + * @return int Return integer <0 if KO, or number of changes if OK */ public function send($notifcode, $object, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array()) { diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index e15b80798f2..e6c36e61e51 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -666,11 +666,11 @@ class Translate * If there is no match for this text, we look in alternative file and if still not found, it is returned as it is. * The parameters of this method should not contain HTML tags. If there is, they will be htmlencoded to have no effect. * - * @param string $key Key to translate - * @param string $param1 param1 string - * @param string $param2 param2 string - * @param string $param3 param3 string - * @param string $param4 param4 string + * @param string $key Key to translate + * @param string|int $param1 param1 string + * @param string|int $param2 param2 string + * @param string|int $param3 param3 string + * @param string|int $param4 param4 string * @param int $maxsize Max length of text. Warning: Will not work if paramX has HTML content. deprecated. * @return string Translated string (encoded into HTML entities and UTF8) */ diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index e0e8360d234..30fd7f7b1b5 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -143,8 +143,8 @@ function dol_getDefaultFormat(Translate $outputlangs = null) * Show information on an object * TODO Move this into html.formother * - * @param object $object Object to show - * @param int $usetable Output into a table + * @param object|CommonObject $object Object to show + * @param int $usetable Output into a table * @return void */ function dol_print_object_info($object, $usetable = 0) @@ -361,8 +361,10 @@ function dol_print_object_info($object, $usetable = 0) } else { print ': '; } + // user_approve is not defined in Dolibarr code @phan-suppress-next-line PhanUndeclaredProperty if (!empty($object->user_approve) && is_object($object->user_approve)) { - if ($object->user_approve->id) { + if ($object->user_approve->id) { // @phan-suppress-current-line PhanUndeclaredProperty + // @phan-suppress-next-line PhanUndeclaredProperty,PhanPluginUnknownObjectMethodCall print $object->user_approve->getNomUrl(-1, '', 0, 0, 0); } else { print $langs->trans("Unknown"); @@ -385,6 +387,7 @@ function dol_print_object_info($object, $usetable = 0) // Date approve if (!empty($object->date_approve) || !empty($object->date_approval)) { + '@phan-var-force ExpenseReport|CommandeFournisseur $object'; if ($usetable) { print '
'; } @@ -407,6 +410,7 @@ function dol_print_object_info($object, $usetable = 0) // User approve if (!empty($object->user_approve_id2)) { + '@phan-var-force CommandeFournisseur $object'; if ($usetable) { print '
'; } @@ -454,6 +458,7 @@ function dol_print_object_info($object, $usetable = 0) // User signature if (!empty($object->user_signature) || !empty($object->user_signature_id)) { + '@phan-var-force Propal $object'; if ($usetable) { print '
'; } @@ -559,6 +564,7 @@ function dol_print_object_info($object, $usetable = 0) // User conciliate if (!empty($object->user_rappro) || !empty($object->user_rappro_id)) { + '@phan-var-force Account $object'; if ($usetable) { print '
'; } @@ -569,8 +575,10 @@ function dol_print_object_info($object, $usetable = 0) print ': '; } if (is_object($object->user_rappro)) { - if ($object->user_rappro->id) { - print $object->user_rappro->getNomUrl(-1, '', 0, 0, 0); + $user_rappro = $object->user_rappro; + '@phan-var-force User $user_rappro'; + if ($user_rappro->id) { + print $user_rappro->getNomUrl(-1, '', 0, 0, 0); } else { print $langs->trans("Unknown"); } @@ -590,8 +598,9 @@ function dol_print_object_info($object, $usetable = 0) } } - // Date conciliate + // Date conciliate Note: date_rappro is not found on Dolibarr classes if (!empty($object->date_rappro)) { + // Datte if ($usetable) { print '
'; } @@ -601,9 +610,9 @@ function dol_print_object_info($object, $usetable = 0) } else { print ': '; } - print dol_print_date($object->date_rappro, 'dayhour', 'tzserver'); + print dol_print_date($object->date_rappro, 'dayhour', 'tzserver'); // @phan-suppress-current-line PhanUndeclaredProperty if ($deltadateforuser) { - print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_rappro, "dayhour", 'tzuserrel').'  '.$langs->trans("ClientHour").''; + print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_rappro, "dayhour", 'tzuserrel').'  '.$langs->trans("ClientHour").''; // @phan-suppress-current-line PhanUndeclaredProperty } if ($usetable) { print '
'; } @@ -930,8 +940,12 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ //$mask='FA{yy}{mm}-{0000@99}'; //$date=dol_mktime(12, 0, 0, 1, 1, 1900); //$date=dol_stringtotime('20130101'); - $hasglobalcounter = false; + $maskrefclient_maskcounter = ''; + $maskrefclient_clientcode = ''; + $maskrefclient_maskclientcode = ''; + $maskrefclient_maskoffset = ''; + $reg = array(); // Extract value for mask counter, mask raz and mask offset if (preg_match('/\{(0+)([@\+][0-9\-\+\=]+)?([@\+][0-9\-\+\=]+)?\}/i', $mask, $reg)) { @@ -1156,6 +1170,8 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ $yearcomp1 = sprintf("%04d", idate("Y", $date) + $yearoffset + 1); } elseif ($yearlen == 2) { $yearcomp1 = sprintf("%02d", idate("y", $date) + $yearoffset + 1); + } else { + $yearcomp1 = ''; } $sqlwhere .= "("; @@ -1408,7 +1424,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ if (dol_strlen($maskrefclient_maskcounter) > 0) { $maskrefclient_maskafter .= str_pad((string) $maskrefclient_counter, dol_strlen($maskrefclient_maskcounter), "0", STR_PAD_LEFT); } - $numFinal = str_replace($maskrefclient_maskbefore, $maskrefclient_maskafter, $numFinal); + $numFinal = str_replace($maskrefclient_maskbefore, (string) $maskrefclient_maskafter, $numFinal); } // Now we replace the type @@ -1470,6 +1486,8 @@ function check_value($mask, $value) $result = 0; $hasglobalcounter = false; + $maskrefclient_maskcounter = ''; + // Extract value for mask counter, mask raz and mask offset $reg = array(); if (preg_match('/\{(0+)([@\+][0-9]+)?([@\+][0-9]+)?\}/i', $mask, $reg)) { @@ -1639,6 +1657,10 @@ function numero_semaine($time) $annee = (int) $reg[1]; $mois = (int) $reg[2]; $jour = (int) $reg[3]; + } else { + $annee = 0; + $mois = 0; + $jour = 0; } /* @@ -1738,7 +1760,7 @@ function weight_convert($weight, &$from_unit, $to_unit) * @param DoliDB $db Handler database * @param Conf $conf Object conf * @param User $user Object user - * @param array $tab Array (key=>value) with all parameters to save/update + * @param array $tab Array (key=>value) with all parameters to save/update * @return int Return integer <0 if KO, >0 if OK * * @see dolibarr_get_const(), dolibarr_set_const(), dolibarr_del_const() @@ -1941,7 +1963,7 @@ function getListOfModels($db, $type, $maxfilenamelength = 0) } if (is_dir($tmpdir)) { // all type of template is allowed - $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '', null, 'name', SORT_ASC, 0); + $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '', array(), 'name', SORT_ASC, 0); if (count($tmpfiles)) { $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -2044,7 +2066,7 @@ function dol_buildlogin($lastname, $firstname) /** * Return array to use for SoapClient constructor * - * @return array + * @return array{connection_timeout:int,response_timeout:int,proxy_use:int<0,1>,proxy_host:false|string,proxy_port:false|string,proxy_login:false|string,proxy_password:false|string,trace:int<0,1>} */ function getSoapParams() { @@ -2284,7 +2306,7 @@ function cleanCorruptedTree($db, $tabletocleantree, $fieldfkparent) $sql = "UPDATE ".MAIN_DB_PREFIX.$tabletocleantree." SET ".$fieldfkparent." = 0 WHERE ".$fieldfkparent." = rowid"; // So we update only records linked to themself $resql = $db->query($sql); if ($resql) { - $nb = $db->affected_rows($sql); + $nb = $db->affected_rows($resql); if ($nb > 0) { print '
Some record that were parent of themself were cleaned.'; } @@ -2323,7 +2345,7 @@ function cleanCorruptedTree($db, $tabletocleantree, $fieldfkparent) $sql .= " WHERE rowid IN (".$db->sanitize(implode(',', $listofidtoclean)).")"; // So we update only records detected wrong $resql = $db->query($sql); if ($resql) { - $nb = $db->affected_rows($sql); + $nb = $db->affected_rows($resql); if ($nb > 0) { // Removed orphelins records print '
Some records were detected to have parent that is a child, we set them as root record for id: '; @@ -2340,7 +2362,7 @@ function cleanCorruptedTree($db, $tabletocleantree, $fieldfkparent) $sql .= " WHERE ".$db->sanitize($fieldfkparent)." NOT IN (".$db->sanitize(implode(',', $listofid), 1).")"; // So we update only records linked to a non existing parent $resql = $db->query($sql); if ($resql) { - $nb = $db->affected_rows($sql); + $nb = $db->affected_rows($resql); if ($nb > 0) { // Removed orphelins records print '
Some orphelins were found and modified to be parent so records are visible again for id: '; @@ -2362,7 +2384,7 @@ function cleanCorruptedTree($db, $tabletocleantree, $fieldfkparent) * Convert an array with RGB value into hex RGB value. * This is the opposite function of colorStringToArray * - * @param array $arraycolor Array + * @param array{0:int,1:int,2:int} $arraycolor Array * @param string $colorifnotfound Color code to return if entry not defined or not a RGB format * @return string RGB hex value (without # before). For example: 'FF00FF', '01FF02' * @see colorStringToArray(), colorHexToRgb() @@ -2383,9 +2405,9 @@ function colorArrayToHex($arraycolor, $colorifnotfound = '888888') * This is the opposite function of colorArrayToHex. * If entry is already an array, return it. * - * @param string $stringcolor String with hex (FFFFFF) or comma RGB ('255,255,255') - * @param array $colorifnotfound Color code array to return if entry not defined - * @return array RGB hex value (without # before). For example: FF00FF + * @param string $stringcolor String with hex (FFFFFF) or comma RGB ('255,255,255') + * @param array{0:int,1:int,2:int}|array{} $colorifnotfound Color code array to return if entry not defined + * @return array{0:int,1:int,2:int} RGB hex value (without # before). For example: FF00FF * @see colorArrayToHex(), colorHexToRgb() */ function colorStringToArray($stringcolor, $colorifnotfound = array(88, 88, 88)) @@ -2396,7 +2418,8 @@ function colorStringToArray($stringcolor, $colorifnotfound = array(88, 88, 88)) $reg = array(); $tmp = preg_match('/^#?([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])$/', $stringcolor, $reg); if (!$tmp) { - $tmp = explode(',', $stringcolor); + $tmp = array_map('intval', explode(',', $stringcolor)); + '@phan-var-force int[] $tmp'; if (count($tmp) < 3) { return $colorifnotfound; } @@ -2624,8 +2647,8 @@ function colorHexToHsl($hex, $alpha = false, $returnArray = false) * Applies the Cartesian product algorithm to an array * Source: http://stackoverflow.com/a/15973172 * - * @param array $input Array of products - * @return array Array of combinations + * @param array $input Array of products + * @return array> Array of combinations */ function cartesianArray(array $input) { @@ -3020,9 +3043,9 @@ function getArrayOfEmojiBis() /** * Remove EMoji from email content * - * @param string $text String to sanitize - * @param int $allowedemoji Mode to allow emoji - * @return string Sanitized string + * @param string $text String to sanitize + * @param int<0,2> $allowedemoji Mode to allow emoji + * @return string Sanitized string */ function removeEmoji($text, $allowedemoji = 1) { diff --git a/htdocs/core/lib/functions_ch.lib.php b/htdocs/core/lib/functions_ch.lib.php index 50b373e17d7..a702f05c1ef 100644 --- a/htdocs/core/lib/functions_ch.lib.php +++ b/htdocs/core/lib/functions_ch.lib.php @@ -1,5 +1,6 @@ + * 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 @@ -160,7 +161,7 @@ function dol_ch_controle_bvrb($bvrb) // Check (verify/validate) $report = 0; while (dol_strlen($bv) > 1) { - $match = substr($bv, 0, 1); + $match = (int) substr($bv, 0, 1); $report = $tableau[$report][$match]; $bv = substr($bv, 1); } diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 475d60da1c8..6e31b8726f7 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -671,7 +671,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print '
'.$langs->trans("TopMenuBackgroundColor").''; if ($edit) { - print $formother->selectColor(colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_TOPMENU_BACK1') ? $conf->global->THEME_ELDY_TOPMENU_BACK1 : ''), array()), ''), 'THEME_ELDY_TOPMENU_BACK1', '', 1, '', '', 'colorbackhmenu1', $default).' '; + print $formother->selectColor(colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_TOPMENU_BACK1') ? $conf->global->THEME_ELDY_TOPMENU_BACK1 : ''), array()), ''), 'THEME_ELDY_TOPMENU_BACK1', '', 1, array(), '', 'colorbackhmenu1', $default).' '; } else { $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1, array()), ''); if ($color) { @@ -715,7 +715,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''.$langs->trans("LeftMenuBackgroundColor").''; if ($edit) { - print $formother->selectColor(colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_VERMENU_BACK1') ? $conf->global->THEME_ELDY_VERMENU_BACK1 : ''), array()), ''), 'THEME_ELDY_VERMENU_BACK1', '', 1, '', '', 'colorbackvmenu1', $default).' '; + print $formother->selectColor(colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_VERMENU_BACK1') ? $conf->global->THEME_ELDY_VERMENU_BACK1 : ''), array()), ''), 'THEME_ELDY_VERMENU_BACK1', '', 1, array(), '', 'colorbackvmenu1', $default).' '; } else { $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_VERMENU_BACK1, array()), ''); if ($color) { @@ -756,7 +756,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''; //var_dump($conf->global->THEME_ELDY_BACKBODY); if ($edit) { - print $formother->selectColor(colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_BACKBODY') ? $conf->global->THEME_ELDY_BACKBODY : ''), array()), ''), 'THEME_ELDY_BACKBODY', '', 1, '', '', 'colorbackbody', $default).' '; + print $formother->selectColor(colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_BACKBODY') ? $conf->global->THEME_ELDY_BACKBODY : ''), array()), ''), 'THEME_ELDY_BACKBODY', '', 1, array(), '', 'colorbackbody', $default).' '; } else { $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKBODY, array()), ''); if ($color) { @@ -780,7 +780,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''.$langs->trans("TextTitleColor").''; if ($edit) { - print $formother->selectColor(colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_TEXTTITLENOTAB') ? $conf->global->THEME_ELDY_TEXTTITLENOTAB : ''), array()), ''), 'THEME_ELDY_TEXTTITLENOTAB', '', 1, '', '', 'colortexttitlenotab', $default).' '; + print $formother->selectColor(colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_TEXTTITLENOTAB') ? $conf->global->THEME_ELDY_TEXTTITLENOTAB : ''), array()), ''), 'THEME_ELDY_TEXTTITLENOTAB', '', 1, array(), '', 'colortexttitlenotab', $default).' '; } else { print $formother->showColor($conf->global->THEME_ELDY_TEXTTITLENOTAB, $langs->trans("Default")); } @@ -800,7 +800,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''.$langs->trans("BackgroundTableTitleColor").''; if ($edit) { - print $formother->selectColor(colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_BACKTITLE1') ? $conf->global->THEME_ELDY_BACKTITLE1 : ''), array()), ''), 'THEME_ELDY_BACKTITLE1', '', 1, '', '', 'colorbacktitle1', $default).' '; + print $formother->selectColor(colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_BACKTITLE1') ? $conf->global->THEME_ELDY_BACKTITLE1 : ''), array()), ''), 'THEME_ELDY_BACKTITLE1', '', 1, array(), '', 'colorbacktitle1', $default).' '; } else { print $formother->showColor($conf->global->THEME_ELDY_BACKTITLE1, $langs->trans("Default")); } @@ -820,7 +820,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''.$langs->trans("BackgroundTableTitleTextColor").''; if ($edit) { - print $formother->selectColor(colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_TEXTTITLE') ? $conf->global->THEME_ELDY_TEXTTITLE : ''), array()), ''), 'THEME_ELDY_TEXTTITLE', '', 1, '', '', 'colortexttitle', $default).' '; + print $formother->selectColor(colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_TEXTTITLE') ? $conf->global->THEME_ELDY_TEXTTITLE : ''), array()), ''), 'THEME_ELDY_TEXTTITLE', '', 1, array(), '', 'colortexttitle', $default).' '; } else { print $formother->showColor($conf->global->THEME_ELDY_TEXTTITLE, $langs->trans("Default")); } @@ -840,7 +840,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''.$langs->trans("BackgroundTableTitleTextlinkColor").''; if ($edit) { - print $formother->selectColor(colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_TEXTTITLELINK') ? $conf->global->THEME_ELDY_TEXTTITLELINK : ''), array()), ''), 'THEME_ELDY_TEXTTITLELINK', '', 1, '', '', 'colortexttitlelink', $default).' '; + print $formother->selectColor(colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_TEXTTITLELINK') ? $conf->global->THEME_ELDY_TEXTTITLELINK : ''), array()), ''), 'THEME_ELDY_TEXTTITLELINK', '', 1, array(), '', 'colortexttitlelink', $default).' '; } else { print $formother->showColor($conf->global->THEME_ELDY_TEXTTITLELINK, $langs->trans("Default")); } @@ -861,7 +861,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''.$langs->trans("BackgroundTableLineOddColor").''; if ($edit) { - print $formother->selectColor(colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_LINEIMPAIR1') ? $conf->global->THEME_ELDY_LINEIMPAIR1 : ''), array()), ''), 'THEME_ELDY_LINEIMPAIR1', '', 1, '', '', 'colorbacklineimpair2', $default).' '; + print $formother->selectColor(colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_LINEIMPAIR1') ? $conf->global->THEME_ELDY_LINEIMPAIR1 : ''), array()), ''), 'THEME_ELDY_LINEIMPAIR1', '', 1, array(), '', 'colorbacklineimpair2', $default).' '; } else { $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_LINEIMPAIR1, array()), ''); if ($color) { @@ -885,7 +885,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''.$langs->trans("BackgroundTableLineEvenColor").''; if ($edit) { - print $formother->selectColor(colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_LINEPAIR1') ? $conf->global->THEME_ELDY_LINEPAIR1 : ''), array()), ''), 'THEME_ELDY_LINEPAIR1', '', 1, '', '', 'colorbacklinepair2', $default).' '; + print $formother->selectColor(colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_LINEPAIR1') ? $conf->global->THEME_ELDY_LINEPAIR1 : ''), array()), ''), 'THEME_ELDY_LINEPAIR1', '', 1, array(), '', 'colorbacklinepair2', $default).' '; } else { $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_LINEPAIR1, array()), ''); if ($color) { @@ -929,7 +929,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''.$langs->trans("LinkColor").''; if ($edit) { - print $formother->selectColor(colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_TEXTLINK') ? $conf->global->THEME_ELDY_TEXTLINK : ''), array()), ''), 'THEME_ELDY_TEXTLINK', '', 1, '', '', 'colortextlink', $default).' '; + print $formother->selectColor(colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_TEXTLINK') ? $conf->global->THEME_ELDY_TEXTLINK : ''), array()), ''), 'THEME_ELDY_TEXTLINK', '', 1, array(), '', 'colortextlink', $default).' '; } else { $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTLINK, array()), ''); if ($color) { @@ -972,7 +972,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) } else { $color = colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_USE_HOVER') ? $conf->global->THEME_ELDY_USE_HOVER : ''), array()), ''); } - print $formother->selectColor($color, 'THEME_ELDY_USE_HOVER', '', 1, '', '', 'colorbacklinepairhover', $default).' '; + print $formother->selectColor($color, 'THEME_ELDY_USE_HOVER', '', 1, array(), '', 'colorbacklinepairhover', $default).' '; } else { if (getDolGlobalString('THEME_ELDY_USE_HOVER') == '1') { $color = colorArrayToHex(colorStringToArray($colorbacklinepairhover)); @@ -1020,7 +1020,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) } else { $color = colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_USE_CHECKED') ? $conf->global->THEME_ELDY_USE_CHECKED : ''), array()), ''); } - print $formother->selectColor($color, 'THEME_ELDY_USE_CHECKED', '', 1, '', '', 'colorbacklinepairchecked', $default).' '; + print $formother->selectColor($color, 'THEME_ELDY_USE_CHECKED', '', 1, array(), '', 'colorbacklinepairchecked', $default).' '; } else { if (getDolGlobalString('THEME_ELDY_USE_CHECKED') == '1') { $color = 'e6edf0'; @@ -1072,7 +1072,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''.$langs->trans("BtnActionColor").''; if ($edit) { - print $formother->selectColor(colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_BTNACTION') ? $conf->global->THEME_ELDY_BTNACTION : ''), array()), ''), 'THEME_ELDY_BTNACTION', '', 1, '', '', 'butactionbg', $default).' '; + print $formother->selectColor(colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_BTNACTION') ? $conf->global->THEME_ELDY_BTNACTION : ''), array()), ''), 'THEME_ELDY_BTNACTION', '', 1, array(), '', 'butactionbg', $default).' '; } else { $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BTNACTION, array()), ''); if ($color) { @@ -1118,7 +1118,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''.$langs->trans("TextBtnActionColor").''; if ($edit) { - print $formother->selectColor(colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_TEXTBTNACTION') ? $conf->global->THEME_ELDY_TEXTBTNACTION : ''), array()), ''), 'THEME_ELDY_TEXTBTNACTION', '', 1, '', '', 'textbutaction', $default).' '; + print $formother->selectColor(colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_TEXTBTNACTION') ? $conf->global->THEME_ELDY_TEXTBTNACTION : ''), array()), ''), 'THEME_ELDY_TEXTBTNACTION', '', 1, array(), '', 'textbutaction', $default).' '; } else { $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTBTNACTION, array()), ''); if ($color) { diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index f78b707923a..2169c0c1542 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -109,12 +109,13 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it public $dirs = array(); /** - * @var array Module boxes + * @var array Module boxes */ public $boxes = array(); /** - * @var array Module constants + * @var array,5?:string,6?:int<0,1>}> Module constants + * (0:name,1:type,2:val,3:note,4:visible,5:entity,6:deleteonunactive) */ public $const = array(); diff --git a/htdocs/core/tpl/commonfields_add.tpl.php b/htdocs/core/tpl/commonfields_add.tpl.php index 90b7f99f063..2ea20d8ed04 100644 --- a/htdocs/core/tpl/commonfields_add.tpl.php +++ b/htdocs/core/tpl/commonfields_add.tpl.php @@ -109,7 +109,7 @@ foreach ($object->fields as $key => $val) { } else { if ($key == 'lang') { print img_picto('', 'language', 'class="pictofixedwidth"'); - print $formadmin->select_language($value, $key, 0, null, 1, 0, 0, 'minwidth300', 2); + print $formadmin->select_language($value, $key, 0, array(), 1, 0, 0, 'minwidth300', 2); } else { print $object->showInputField($val, $key, $value, '', '', '', 0); } diff --git a/htdocs/core/tpl/commonfields_edit.tpl.php b/htdocs/core/tpl/commonfields_edit.tpl.php index 72ca7a2ba0e..02b8b01d9ca 100644 --- a/htdocs/core/tpl/commonfields_edit.tpl.php +++ b/htdocs/core/tpl/commonfields_edit.tpl.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 Frédéric France + * 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 @@ -104,7 +105,7 @@ foreach ($object->fields as $key => $val) { } else { if ($key == 'lang') { print img_picto('', 'language', 'class="pictofixedwidth"'); - print $formadmin->select_language($value, $key, 0, null, 1, 0, 0, 'minwidth300', 2); + print $formadmin->select_language($value, $key, 0, array(), 1, 0, 0, 'minwidth300', 2); } else { print $object->showInputField($val, $key, $value, '', '', '', 0); } diff --git a/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php b/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php index 0a1eca79027..57e548c1ba9 100644 --- a/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php +++ b/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php @@ -121,7 +121,7 @@ class mymodulewidget1 extends ModeleBoxes // Limit and truncate with "…" the displayed text length, 0 = disabled 'limit' => 0, // Adds translated " (Graph)" to a hidden form value's input (?) - 'graph' => false + 'graph' => 0 ); // Populate the contents at runtime @@ -150,9 +150,9 @@ class mymodulewidget1 extends ModeleBoxes // Truncates 'text' element to the specified character length, 0 = disabled 'maxlength' => 0, // Prevents HTML cleaning (and truncation) - 'asis' => false, + 'asis' => 0, // Same for 'text2' - 'asis2' => true + 'asis2' => 0 ), 1 => array( // Another column // No TR for n≠0 @@ -183,13 +183,18 @@ class mymodulewidget1 extends ModeleBoxes ); } + + + + + /** - * Method to show box. Called by Dolibarr each time it needs to display the box. + * Method to show box. Called when the box needs to be displayed. * - * @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title - * @param ?array> $contents Array with properties of box lines - * @param int<0,1> $nooutput When 1, do not print, return string - * @return string + * @param ?array,target?:string}> $head Array with properties of box title + * @param ?array}> $contents Array with properties of box lines + * @param int<0,1> $nooutput No print, only return string + * @return string */ public function showBox($head = null, $contents = null, $nooutput = 0) { diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index c4f4d32041c..0e57672aa9c 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -4,6 +4,7 @@ * Copyright (C) 2010 Regis Houssin * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2024 Frédéric France + * 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 @@ -53,7 +54,8 @@ if (empty($dolibarr_main_demo)) { httponly_accessforbidden('Parameter dolibarr_main_demo must be defined in conf file with value "default login,default pass" to enable the demo entry page'); } -// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context +// Initialize a technical object to manage hooks of the page. +// Note that conf->hooks_modules contains an array of hook contexats $res = $hookmanager->initHooks(array('demo')); $demoprofiles = array(); @@ -74,46 +76,47 @@ $tmpaction = 'view'; $parameters = array(); $object = new stdClass(); $reshook = $hookmanager->executeHooks('addDemoProfile', $parameters, $object, $tmpaction); // Note that $action and $object may have been modified by some hooks -$error = $hookmanager->error; $errors = $hookmanager->errors; +$error = $hookmanager->error; +$errors = $hookmanager->errors; if (empty($reshook)) { $demoprofiles = array( array( - 'default'=>'1', 'key'=>'profdemoservonly', 'label'=>'DemoCompanyServiceOnly', - 'disablemodules'=>'adherent,barcode,bom,cashdesk,don,expedition,externalsite,ftp,incoterm,mailmanspip,margin,mrp,prelevement,product,productbatch,stock,takepos', + 'default' => '1', 'key' => 'profdemoservonly', 'label' => 'DemoCompanyServiceOnly', + 'disablemodules' => 'adherent,barcode,bom,cashdesk,don,expedition,externalsite,ftp,incoterm,mailmanspip,margin,mrp,prelevement,product,productbatch,stock,takepos', //'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot8.png', - 'icon'=>DOL_URL_ROOT.'/public/demo/demo-profile-service.jpg', - 'url'=>$url, + 'icon' => DOL_URL_ROOT.'/public/demo/demo-profile-service.jpg', + 'url' => $url, 'lang' => '', ), array( - 'default'=>'0', 'key'=>'profmanufacture', 'label'=>'DemoCompanyManufacturing', - 'disablemodules'=>'adherent,contrat,don,externalsite,ficheinter,ftp,mailmanspip,prelevement,service', - 'icon'=>DOL_URL_ROOT.'/public/demo/demo-profile-manufacturing.jpg', - 'url'=>$url, + 'default' => '0', 'key' => 'profmanufacture', 'label' => 'DemoCompanyManufacturing', + 'disablemodules' => 'adherent,contrat,don,externalsite,ficheinter,ftp,mailmanspip,prelevement,service', + 'icon' => DOL_URL_ROOT.'/public/demo/demo-profile-manufacturing.jpg', + 'url' => $url, 'lang' => '', ), array( - 'default'=>'0', 'key'=>'profdemoprodstock', 'label'=>'DemoCompanyProductAndStocks', - 'disablemodules'=>'adherent,bom,contrat,don,externalsite,ficheinter,ftp,mailmanspip,mrp,prelevement,service', + 'default' => '0', 'key' => 'profdemoprodstock', 'label' => 'DemoCompanyProductAndStocks', + 'disablemodules' => 'adherent,bom,contrat,don,externalsite,ficheinter,ftp,mailmanspip,mrp,prelevement,service', //'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot2.png', - 'icon'=>DOL_URL_ROOT.'/public/demo/demo-profile-product.jpg', - 'url'=>$url, + 'icon' => DOL_URL_ROOT.'/public/demo/demo-profile-product.jpg', + 'url' => $url, 'lang' => '', ), array( - 'default'=>'0', 'key'=>'profdemofun2', 'label'=>'DemoFundation2', - 'disablemodules'=>'barcode,cashdesk,bom,commande,commercial,compta,comptabilite,contrat,expedition,externalsite,ficheinter,ftp,incoterm,mailmanspip,margin,mrp,prelevement,product,productbatch,projet,propal,propale,service,societe,stock,tax,takepos', + 'default' => '0', 'key' => 'profdemofun2', 'label' => 'DemoFundation2', + 'disablemodules' => 'barcode,cashdesk,bom,commande,commercial,compta,comptabilite,contrat,expedition,externalsite,ficheinter,ftp,incoterm,mailmanspip,margin,mrp,prelevement,product,productbatch,projet,propal,propale,service,societe,stock,tax,takepos', //'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot6.png', - 'icon'=>DOL_URL_ROOT.'/public/demo/demo-profile-foundation.jpg', - 'url'=>$url, + 'icon' => DOL_URL_ROOT.'/public/demo/demo-profile-foundation.jpg', + 'url' => $url, 'lang' => '', ), - // All demo profile + // All demo profiles array( - 'default'=>'0', 'key'=>'profdemoall', 'label'=>'ChooseYourDemoProfilMore', - 'disablemodules'=>'adherent,cashdesk,don,externalsite,mailmanspip', + 'default' => '0', 'key' => 'profdemoall', 'label' => 'ChooseYourDemoProfilMore', + 'disablemodules' => 'adherent,cashdesk,don,externalsite,mailmanspip', //'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot9.png' - 'icon'=>DOL_URL_ROOT.'/public/demo/demo-profile-all.jpg', + 'icon' => DOL_URL_ROOT.'/public/demo/demo-profile-all.jpg', 'lang' => '', ) ); @@ -140,13 +143,13 @@ $dirlist = $conf->file->dol_document_root; // Search modules dirs $modulesdir = dolGetModulesDirs(); - $filename = array(); $modules = array(); $orders = array(); $categ = array(); $i = 0; // is a sequencer of modules found -$j = 0; // j is module number. Automatically affected if module number not defined. +$j = 0; // j is module number. Automatically assigned if module number is not defined. +$const_name = ''; foreach ($modulesdir as $dir) { // Charge tableaux modules, nom, numero, orders depuis repertoire dir @@ -196,6 +199,7 @@ foreach ($modulesdir as $dir) { } } +'@phan-var-force DolibarrModules[] $modules'; asort($orders); diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 42820ce8369..a06a442568f 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2011-2012 Laurent Destailleur + * 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 @@ -32,15 +33,32 @@ abstract class ActionsCardCommon */ public $db; + /** + * @var string + */ public $dirmodule; + /** + * @var string + */ public $targetmodule; + /** + * @var string + */ public $canvas; + /** + * @var string + */ public $card; - //! Template container + /** + * @var array Template container + */ public $tpl = array(); //! Object container + /** + * @var Societe + */ public $object; /** @@ -59,7 +77,7 @@ abstract class ActionsCardCommon * * @param int $id Object id * @param string $ref Object ref - * @return object Object loaded + * @return Societe Object loaded */ protected function getObject($id, $ref = '') { @@ -78,7 +96,7 @@ abstract class ActionsCardCommon /** * Assign custom values for canvas (for example into this->tpl to be used by templates) * - * @param string $action Type of action + * @param string $action Type of action * @param integer $id Id of object * @param string $ref Ref of object * @return void @@ -88,6 +106,11 @@ abstract class ActionsCardCommon // phpcs:enable global $conf, $langs, $db, $user, $mysoc, $canvas; global $form, $formadmin, $formcompany; + ' + @phan-var-force Form $form + @phan-var-force FormAdmin $formadmin + @phan-var-force FormCompany $formcompany + '; if ($action == 'add' || $action == 'update') { $this->assign_post($action); @@ -165,6 +188,7 @@ abstract class ActionsCardCommon } } $modCodeClient = new $module($db); + '@phan-var-force ModeleThirdPartyCode $modCodeClient'; $this->tpl['auto_customercode'] = $modCodeClient->code_auto; // We verified if the tag prefix is used if ($modCodeClient->code_auto) { @@ -204,6 +228,7 @@ abstract class ActionsCardCommon } } $modCodeFournisseur = new $module(); + '@phan-var-force ModeleThirdPartyCode $modCodeFournisseur'; $this->tpl['auto_suppliercode'] = $modCodeFournisseur->code_auto; // We verified if the tag prefix is used if ($modCodeFournisseur->code_auto) { @@ -249,7 +274,7 @@ abstract class ActionsCardCommon // Language if (getDolGlobalInt('MAIN_MULTILANGS')) { - $this->tpl['select_lang'] = $formadmin->select_language((empty($this->object->default_lang) ? getDolGlobalString('MAIN_LANG_DEFAULT') : $this->object->default_lang), 'default_lang', 0, 0, 1); + $this->tpl['select_lang'] = $formadmin->select_language((empty($this->object->default_lang) ? getDolGlobalString('MAIN_LANG_DEFAULT') : $this->object->default_lang), 'default_lang', 0, array(), 1); } // VAT @@ -348,7 +373,7 @@ abstract class ActionsCardCommon if (isModEnabled('member')) { $langs->load("members"); $adh = new Adherent($this->db); - $result = $adh->fetch('', '', $this->object->id); + $result = $adh->fetch(0, '', $this->object->id); if ($result > 0) { $adh->ref = $adh->getFullName($langs); $this->tpl['linked_member'] = $adh->getNomUrl(1); @@ -390,41 +415,41 @@ abstract class ActionsCardCommon // phpcs:enable global $langs, $mysoc; - $this->object->id = GETPOST("socid"); + $this->object->id = GETPOSTINT("socid"); $this->object->name = GETPOST("nom"); $this->object->prefix_comm = GETPOST("prefix_comm"); - $this->object->client = GETPOST("client"); + $this->object->client = GETPOSTINT("client"); $this->object->code_client = GETPOST("code_client"); - $this->object->fournisseur = GETPOST("fournisseur"); + $this->object->fournisseur = GETPOSTINT("fournisseur"); $this->object->code_fournisseur = GETPOST("code_fournisseur"); $this->object->address = GETPOST("address"); $this->object->zip = GETPOST("zipcode"); $this->object->town = GETPOST("town"); $this->object->country_id = GETPOST("country_id") ? GETPOST("country_id") : $mysoc->country_id; - $this->object->state_id = GETPOST("state_id"); + $this->object->state_id = GETPOSTINT("state_id"); $this->object->phone = GETPOST("phone"); $this->object->phone_mobile = GETPOST("phone_mobile"); $this->object->fax = GETPOST("fax"); $this->object->email = GETPOST("email", 'alphawithlgt'); $this->object->url = GETPOST("url"); - $this->object->capital = GETPOST("capital"); + $this->object->capital = (float) GETPOST("capital"); $this->object->idprof1 = GETPOST("idprof1"); $this->object->idprof2 = GETPOST("idprof2"); $this->object->idprof3 = GETPOST("idprof3"); $this->object->idprof4 = GETPOST("idprof4"); - $this->object->typent_id = GETPOST("typent_id"); - $this->object->effectif_id = GETPOST("effectif_id"); + $this->object->typent_id = GETPOSTINT("typent_id"); + $this->object->effectif_id = GETPOSTINT("effectif_id"); $this->object->barcode = GETPOST("barcode"); - $this->object->forme_juridique_code = GETPOST("forme_juridique_code"); + $this->object->forme_juridique_code = GETPOSTINT("forme_juridique_code"); $this->object->default_lang = GETPOST("default_lang"); - $this->object->commercial_id = GETPOST("commercial_id"); + $this->object->commercial_id = GETPOSTINT("commercial_id"); $this->object->tva_assuj = GETPOST("assujtva_value") ? GETPOST("assujtva_value") : 1; $this->object->tva_intra = GETPOST("tva_intra"); //Local Taxes - $this->object->localtax1_assuj = GETPOST("localtax1assuj_value"); - $this->object->localtax2_assuj = GETPOST("localtax2assuj_value"); + $this->object->localtax1_assuj = GETPOSTINT("localtax1assuj_value"); + $this->object->localtax2_assuj = GETPOSTINT("localtax2assuj_value"); // We set country_id, and country_code label of the chosen country if ($this->object->country_id) { diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php index ec8ba488e95..bbf7f431100 100644 --- a/htdocs/user/agenda_extsites.php +++ b/htdocs/user/agenda_extsites.php @@ -1,6 +1,7 @@ * Copyright (C) 2011-2014 Juanjo Menent + * 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 @@ -263,7 +264,7 @@ while ($i <= $MAXAGENDA) { // Color (Possible colors are limited by Google) print ''; $color_value = (GETPOST("AGENDA_EXT_COLOR_".$id.'_'.$key) ? GETPOST("AGENDA_EXT_COLOR_".$id.'_'.$key) : (empty($object->conf->$color) ? 'ffffff' : $object->conf->$color)); - print $formother->selectColor($color_value, "AGENDA_EXT_COLOR_".$id.'_'.$key, '', 1, '', 'hideifnotset'); + print $formother->selectColor($color_value, "AGENDA_EXT_COLOR_".$id.'_'.$key, '', 1, array(), 'hideifnotset'); print '