diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index f94fa243ad0..58894707c4b 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -12,21 +12,21 @@ return [ // PhanPluginUnknownPropertyType : 1550+ occurrences // PhanPossiblyUndeclaredGlobalVariable : 1070+ occurrences // PhanTypeMismatchArgumentProbablyReal : 1000+ occurrences - // PhanUndeclaredProperty : 750+ occurrences + // PhanUndeclaredProperty : 840+ occurrences // PhanUndeclaredGlobalVariable : 690+ occurrences - // PhanPluginUnknownObjectMethodCall : 520+ occurrences // PhanPluginUnknownArrayMethodReturnType : 480+ occurrences // PhanPluginUnknownArrayMethodParamType : 420+ occurrences + // PhanPluginUnknownObjectMethodCall : 350+ occurrences // PhanPossiblyUndeclaredVariable : 350+ occurrences // PhanPluginUnknownArrayFunctionReturnType : 230+ occurrences // PhanTypeMismatchProperty : 210+ occurrences // PhanPluginUnknownArrayFunctionParamType : 170+ occurrences // PhanTypeMismatchArgumentNullableInternal : 120+ occurrences - // PhanTypeExpectedObjectPropAccess : 85+ occurrences // PhanPluginUnknownArrayPropertyType : 80+ occurrences // PhanPluginUndeclaredVariableIsset : 70+ occurrences // PhanPluginEmptyStatementIf : 65+ occurrences // PhanRedefineFunction : 55+ occurrences + // PhanTypeExpectedObjectPropAccess : 50+ occurrences // PhanTypeSuspiciousNonTraversableForeach : 50+ occurrences // PhanTypeMismatchDimFetch : 45+ occurrences // PhanPossiblyNullTypeMismatchProperty : 20+ occurrences @@ -40,7 +40,7 @@ return [ // PhanPluginSuspiciousParamPosition : 10+ occurrences // PhanTypeMismatchDimFetchNullable : 10+ occurrences // PhanPluginDuplicateArrayKey : 8 occurrences - // PhanUndeclaredMethod : 5 occurrences + // PhanUndeclaredMethod : 8 occurrences // PhanInvalidFQSENInClasslike : 4 occurrences // PhanEmptyFQSENInClasslike : 3 occurrences // PhanParamTooMany : 2 occurrences @@ -57,7 +57,6 @@ return [ 'htdocs/admin/bank.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/admin/bank_extrafields.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/admin/bankline_extrafields.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/admin/barcode.php' => ['PhanPluginUnknownObjectMethodCall'], 'htdocs/admin/bom.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/admin/chequereceipts.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/admin/company.php' => ['PhanPossiblyUndeclaredGlobalVariable'], @@ -138,7 +137,7 @@ return [ 'htdocs/asset/model/list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/asset/tpl/accountancy_codes_edit.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/asset/tpl/depreciation_options_edit.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/asset/tpl/linkedobjectblock.tpl.php' => ['PhanPluginUnknownObjectMethodCall'], + 'htdocs/asset/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/asterisk/wrapper.php' => ['PhanRedefineFunction'], 'htdocs/barcode/codeinit.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/barcode/printsheet.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], @@ -206,7 +205,7 @@ return [ 'htdocs/comm/propal/class/propalestats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], 'htdocs/comm/propal/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/comm/propal/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/comm/propal/tpl/linkedobjectblock.tpl.php' => ['PhanPluginUnknownObjectMethodCall'], + 'htdocs/comm/propal/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/commande/card.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], 'htdocs/commande/class/api_orders.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/commande/class/commande.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], @@ -215,7 +214,7 @@ return [ 'htdocs/commande/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/commande/list_det.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/commande/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/commande/tpl/linkedobjectblock.tpl.php' => ['PhanPluginUnknownObjectMethodCall'], + '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'], @@ -255,8 +254,8 @@ return [ 'htdocs/compta/facture/note.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/facture/prelevement.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/facture/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/compta/facture/tpl/linkedobjectblock.tpl.php' => ['PhanEmptyFQSENInClasslike', 'PhanInvalidFQSENInClasslike', 'PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'], - 'htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php' => ['PhanPluginUnknownObjectMethodCall'], + 'htdocs/compta/facture/tpl/linkedobjectblock.tpl.php' => ['PhanEmptyFQSENInClasslike', 'PhanInvalidFQSENInClasslike', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'], + 'htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/compta/journal/purchasesjournal.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/compta/journal/sellsjournal.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/compta/localtax/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], @@ -323,11 +322,10 @@ return [ 'htdocs/contrat/class/api_contracts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/contrat/messaging.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/contrat/services_list.php' => ['PhanEmptyForeach', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/contrat/tpl/linkedobjectblock.tpl.php' => ['PhanPluginUnknownObjectMethodCall'], + 'htdocs/contrat/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/core/actions_addupdatedelete.inc.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanTypeMismatchDimFetch', 'PhanUndeclaredProperty'], 'htdocs/core/actions_builddoc.inc.php' => ['PhanUndeclaredProperty'], 'htdocs/core/actions_comments.inc.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/core/actions_dellink.inc.php' => ['PhanPluginUnknownObjectMethodCall'], 'htdocs/core/actions_extrafields.inc.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/actions_lineupdown.inc.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/actions_linkedfiles.inc.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], @@ -337,11 +335,7 @@ return [ 'htdocs/core/actions_setmoduleoptions.inc.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/core/ajax/ajaxdirpreview.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/ajax/ajaxdirtree.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], - 'htdocs/core/ajax/ajaxtooltip.php' => ['PhanPluginUnknownObjectMethodCall'], - 'htdocs/core/ajax/extraparams.php' => ['PhanPluginUnknownObjectMethodCall'], 'htdocs/core/ajax/fileupload.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/ajax/loadinplace.php' => ['PhanPluginUnknownObjectMethodCall'], - 'htdocs/core/ajax/objectonoff.php' => ['PhanPluginUnknownObjectMethodCall'], 'htdocs/core/ajax/onlineSign.php' => ['PhanPluginUnknownArrayFunctionParamType'], 'htdocs/core/ajax/saveinplace.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/core/ajax/selectobject.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], @@ -515,7 +509,7 @@ return [ 'htdocs/core/lib/trip.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/usergroups.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/lib/vat.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/core/lib/website.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgumentNullableInternal'], + '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'], 'htdocs/core/modules/action/doc/pdf_standard_actions.class.php' => ['PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType'], @@ -528,7 +522,7 @@ return [ 'htdocs/core/modules/barcode/modules_barcode.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/modules/bom/mod_bom_advanced.php' => ['PhanUndeclaredProperty'], 'htdocs/core/modules/cheque/doc/pdf_blochet.class.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/modules/cheque/modules_chequereceipts.php' => ['PhanPluginUnknownObjectMethodCall'], + 'htdocs/core/modules/cheque/modules_chequereceipts.php' => ['PhanUndeclaredMethod'], 'htdocs/core/modules/commande/doc/pdf_einstein.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/core/modules/commande/mod_commande_saphir.php' => ['PhanTypeMismatchArgumentProbablyReal'], @@ -645,12 +639,12 @@ return [ 'htdocs/core/tpl/resource_view.tpl.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/triggers/dolibarrtriggers.class.php' => ['PhanPluginUnknownArrayPropertyType'], 'htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php' => ['PhanPluginUnknownObjectMethodCall'], - 'htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php' => ['PhanPluginUnknownObjectMethodCall'], + 'htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php' => ['PhanTypeComparisonFromArray', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/triggers/interface_50_modNotification_Notification.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess'], 'htdocs/core/triggers/interface_80_modStripe_Stripe.class.php' => ['PhanPluginEmptyStatementIf', 'PhanUndeclaredProperty'], - 'htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php' => ['PhanPluginUnknownObjectMethodCall'], + 'htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php' => ['PhanUndeclaredProperty'], 'htdocs/cron/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/cron/class/cronjob.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], 'htdocs/cron/list.php' => ['PhanPossiblyUndeclaredGlobalVariable'], @@ -669,7 +663,7 @@ return [ 'htdocs/debugbar/class/TraceableDB.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType'], 'htdocs/delivery/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/delivery/class/delivery.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/delivery/tpl/linkedobjectblock.tpl.php' => ['PhanPluginUnknownObjectMethodCall'], + 'htdocs/delivery/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/document.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/don/admin/donation.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/don/card.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], @@ -707,7 +701,6 @@ return [ 'htdocs/eventorganization/conferenceorboothattendee_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/eventorganization/core/actions_massactions_mail.inc.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'], 'htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/eventorganization/tpl/linkedobjectblock.tpl.php' => ['PhanPluginUnknownObjectMethodCall'], 'htdocs/expedition/card.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/expedition/class/api_shipments.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/expedition/class/expedition.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], @@ -719,7 +712,7 @@ return [ 'htdocs/expedition/list.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/expedition/note.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/expedition/shipment.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], - 'htdocs/expedition/tpl/linkedobjectblock.tpl.php' => ['PhanPluginUnknownObjectMethodCall'], + 'htdocs/expedition/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/expensereport/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/expensereport/class/api_expensereports.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/expensereport/class/expensereport.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeExpectedObjectPropAccessButGotNull'], @@ -732,7 +725,7 @@ return [ 'htdocs/expensereport/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/expensereport/tpl/expensereport_addfile.tpl.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/expensereport/tpl/expensereport_linktofile.tpl.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/expensereport/tpl/linkedobjectblock.tpl.php' => ['PhanPluginUnknownObjectMethodCall'], + 'htdocs/expensereport/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/externalsite/frames.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/fichinter/card-rec.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccessButGotNull', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/fichinter/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], @@ -741,7 +734,7 @@ return [ 'htdocs/fichinter/class/fichinterrec.class.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/fichinter/class/fichinterstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], 'htdocs/fichinter/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/fichinter/tpl/linkedobjectblock.tpl.php' => ['PhanPluginUnknownObjectMethodCall'], + 'htdocs/fichinter/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/filefunc.inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/fourn/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/fourn/class/api_supplier_invoices.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], @@ -758,7 +751,7 @@ return [ 'htdocs/fourn/commande/info.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/fourn/commande/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/fourn/commande/note.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php' => ['PhanPluginUnknownObjectMethodCall'], + 'htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/fourn/contact.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/fourn/facture/card-rec.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/fourn/facture/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty'], @@ -870,10 +863,9 @@ return [ 'htdocs/partnership/partnership_list.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/paypal/lib/paypal.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/printing/admin/printing.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchDimFetch'], - 'htdocs/printing/index.php' => ['PhanPluginUnknownObjectMethodCall'], + 'htdocs/printing/index.php' => ['PhanUndeclaredProperty'], 'htdocs/printing/lib/printing.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/product/admin/dynamic_prices.php' => ['PhanPluginUnknownObjectMethodCall'], - 'htdocs/product/admin/product.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/product/admin/product.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/product/admin/product_lot.php' => ['PhanPluginUnknownObjectMethodCall'], 'htdocs/product/admin/product_tools.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/product/ajax/product_lot.php' => ['PhanTypeMismatchArgumentProbablyReal'], @@ -892,7 +884,7 @@ return [ 'htdocs/product/document.php' => ['PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/product/dynamic_price/class/price_global_variable.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownPropertyType'], 'htdocs/product/dynamic_price/class/price_global_variable_updater.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownPropertyType'], - 'htdocs/product/dynamic_price/class/price_parser.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], + 'htdocs/product/dynamic_price/class/price_parser.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType'], 'htdocs/product/index.php' => ['PhanPluginUndeclaredVariableIsset'], 'htdocs/product/inventory/card.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/product/inventory/class/inventory.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], @@ -968,7 +960,7 @@ return [ 'htdocs/projet/tasks/note.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/projet/tasks/task.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/projet/tasks/time.php' => ['PhanEmptyForeach', 'PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/projet/tasks/tpl/linkedobjectblock.tpl.php' => ['PhanPluginUnknownObjectMethodCall'], + 'htdocs/projet/tasks/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/public/agenda/agendaexport.php' => ['PhanRedefineFunction'], 'htdocs/public/bookcal/index.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanRedefineFunction'], 'htdocs/public/company/new.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanRedefineFunction', 'PhanUndeclaredGlobalVariable'], @@ -1000,12 +992,8 @@ return [ 'htdocs/public/ticket/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/public/ticket/view.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/public/webportal/index.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable'], - 'htdocs/public/webportal/tpl/errors.tpl.php' => ['PhanPluginUnknownObjectMethodCall'], - 'htdocs/public/webportal/tpl/footer.tpl.php' => ['PhanPluginUnknownObjectMethodCall'], 'htdocs/public/webportal/tpl/hero-header-banner.tpl.php' => ['PhanTypeExpectedObjectPropAccessButGotNull', 'PhanUndeclaredGlobalVariable'], - 'htdocs/public/webportal/tpl/home.tpl.php' => ['PhanPluginUnknownObjectMethodCall'], - 'htdocs/public/webportal/tpl/login.tpl.php' => ['PhanPluginUnknownObjectMethodCall'], - 'htdocs/public/webportal/tpl/menu.tpl.php' => ['PhanPluginUnknownObjectMethodCall'], + 'htdocs/public/webportal/tpl/menu.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/public/webportal/webportal.main.inc.php' => ['PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanRedefineFunction'], 'htdocs/public/website/index.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/public/website/javascript.js.php' => ['PhanRedefineFunction'], @@ -1019,7 +1007,7 @@ return [ 'htdocs/reception/dispatch.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/reception/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/reception/note.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/reception/tpl/linkedobjectblock.tpl.php' => ['PhanPluginUnknownObjectMethodCall'], + 'htdocs/reception/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/recruitment/admin/setup.php' => ['PhanEmptyForeach', 'PhanPluginUnknownObjectMethodCall'], 'htdocs/recruitment/admin/setup_candidatures.php' => ['PhanEmptyForeach', 'PhanPluginUnknownObjectMethodCall'], 'htdocs/recruitment/class/api_recruitments.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], @@ -1057,7 +1045,7 @@ return [ 'htdocs/salaries/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/salaries/paiement_salary.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/salaries/virement_request.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/societe/admin/societe.php' => ['PhanPluginUnknownObjectMethodCall'], + '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'], @@ -1088,7 +1076,7 @@ return [ 'htdocs/supplier_proposal/class/api_supplier_proposals.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'], 'htdocs/supplier_proposal/class/supplier_proposal.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/supplier_proposal/list.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php' => ['PhanPluginUnknownObjectMethodCall'], + 'htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/support/inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanRedefineFunction'], 'htdocs/takepos/admin/orderprinters.php' => ['PhanTypeMismatchDimFetch'], 'htdocs/takepos/admin/terminal.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal'], @@ -1124,7 +1112,7 @@ return [ 'htdocs/ticket/contact.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/ticket/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/ticket/list.php' => ['PhanTypeComparisonFromArray'], - 'htdocs/ticket/tpl/linkedobjectblock.tpl.php' => ['PhanPluginUnknownObjectMethodCall'], + 'htdocs/ticket/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/user/agenda_extsites.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/user/bank.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/user/card.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccessButGotNull', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], @@ -1132,10 +1120,8 @@ return [ 'htdocs/user/class/user.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/user/class/usergroup.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], 'htdocs/user/group/card.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/user/group/perms.php' => ['PhanPluginUnknownObjectMethodCall'], 'htdocs/user/param_ihm.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/user/passwordforgotten.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/user/perms.php' => ['PhanPluginUnknownObjectMethodCall'], 'htdocs/variants/ajax/get_attribute_values.php' => ['PhanTypeComparisonFromArray'], 'htdocs/variants/class/ProductAttribute.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/variants/class/ProductCombination.class.php' => ['PhanPluginSuspiciousParamPosition'], @@ -1145,7 +1131,6 @@ return [ 'htdocs/variants/tpl/productattributevalueline_edit.tpl.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/variants/tpl/productattributevalueline_view.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/viewimage.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanRedefineFunction'], - 'htdocs/webhook/ajax/webhook.php' => ['PhanPluginUnknownObjectMethodCall'], 'htdocs/webhook/class/api_webhook.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/webhook/class/target.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyNullTypeMismatchProperty'], 'htdocs/webhook/lib/webhook.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], @@ -1176,7 +1161,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', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/website/class/website.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'], '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/barcode.php b/htdocs/admin/barcode.php index 94c655315bc..c32c4af4376 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -391,6 +391,7 @@ if ($resql) { $classname = "mod".ucfirst($obj->coder); if (class_exists($classname)) { $module = new $classname($db); + '@phan-var-force ModeleBarCode $module'; if ($module->encodingIsSupported($obj->encoding)) { // Build barcode on disk (not used, this is done to make debug easier) $result = $module->writeBarCode($obj->example, $obj->encoding, 'Y'); diff --git a/htdocs/asset/tpl/linkedobjectblock.tpl.php b/htdocs/asset/tpl/linkedobjectblock.tpl.php index bb6034c6f70..04bfd2ad3df 100644 --- a/htdocs/asset/tpl/linkedobjectblock.tpl.php +++ b/htdocs/asset/tpl/linkedobjectblock.tpl.php @@ -38,6 +38,7 @@ $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; $langs->load("assets"); $linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1); +'@phan-var-force CommonObject[] $linkedObjectBlock'; // Repeat because type lost after dol_sort_array) $total = 0; $ilink = 0; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 4592adcd7e5..dddde5cfccc 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -70,7 +70,7 @@ class Categorie extends CommonObject /** - * @var array Table of mapping between type string and ID used for field 'type' in table llx_categories + * @var array Table of mapping between type string and ID used for field 'type' in table llx_categories */ protected $MAP_ID = array( 'product' => 0, @@ -90,7 +90,7 @@ class Categorie extends CommonObject ); /** - * @var array Code mapping from ID + * @var array Code mapping from ID * * @note This array should be removed in future, once previous constants are moved to the string value. Deprecated */ @@ -112,7 +112,7 @@ class Categorie extends CommonObject ); /** - * @var array Foreign keys mapping from type string when value does not match + * @var array Foreign keys mapping from type string when value does not match * * @todo Move to const array when PHP 5.6 will be our minimum target */ @@ -124,7 +124,7 @@ class Categorie extends CommonObject ); /** - * @var array Category tables mapping from type string (llx_categorie_...) when value does not match + * @var array Category tables mapping from type string (llx_categorie_...) when value does not match * * @note Move to const array when PHP 5.6 will be our minimum target */ @@ -135,7 +135,7 @@ class Categorie extends CommonObject ); /** - * @var array Object class mapping from type string + * @var array Object class mapping from type string * * @note Move to const array when PHP 5.6 will be our minimum target */ @@ -157,7 +157,7 @@ class Categorie extends CommonObject ); /** - * @var array Title Area mapping from type string + * @var array Title Area mapping from type string * * @note Move to const array when PHP 5.6 will be our minimum target */ @@ -179,7 +179,7 @@ class Categorie extends CommonObject ); /** - * @var array Object table mapping from type string (table llx_...) when value of key does not match table name. + * @var array Object table mapping from type string (table llx_...) when value of key does not match table name. * This array may be completed by external modules with hook "constructCategory" */ public $MAP_OBJ_TABLE = array( @@ -287,22 +287,22 @@ class Categorie extends CommonObject */ public $imgHeight; - public $fields=array( - "rowid" => array("type"=>"integer", "label"=>"TechnicalID", "enabled"=>"1", 'position'=>10, 'notnull'=>1, "visible"=>"-1",), - "fk_parent" => array("type"=>"integer", "label"=>"Fkparent", "enabled"=>"1", 'position'=>20, 'notnull'=>1, "visible"=>"-1", "css"=>"maxwidth500 widthcentpercentminusxx",), - "label" => array("type"=>"varchar(180)", "label"=>"Label", "enabled"=>"1", 'position'=>25, 'notnull'=>1, "visible"=>"-1", "alwayseditable"=>"1", "css"=>"minwidth300", "cssview"=>"wordbreak", "csslist"=>"tdoverflowmax150",), - "ref_ext" => array("type"=>"varchar(255)", "label"=>"Refext", "enabled"=>"1", 'position'=>30, 'notnull'=>0, "visible"=>"0", "alwayseditable"=>"1",), - "type" => array("type"=>"integer", "label"=>"Type", "enabled"=>"1", 'position'=>35, 'notnull'=>1, "visible"=>"-1", "alwayseditable"=>"1",), - "description" => array("type"=>"text", "label"=>"Description", "enabled"=>"1", 'position'=>40, 'notnull'=>0, "visible"=>"-1", "alwayseditable"=>"1",), - "color" => array("type"=>"varchar(8)", "label"=>"Color", "enabled"=>"1", 'position'=>45, 'notnull'=>0, "visible"=>"-1", "alwayseditable"=>"1",), - "position" => array("type"=>"integer", "label"=>"Position", "enabled"=>"1", 'position'=>50, 'notnull'=>0, "visible"=>"-1", "alwayseditable"=>"1",), - "fk_soc" => array("type"=>"integer:Societe:societe/class/societe.class.php", "label"=>"ThirdParty", "picto"=>"company", "enabled"=>"1", 'position'=>55, 'notnull'=>0, "visible"=>"-1", "alwayseditable"=>"1", "css"=>"maxwidth500 widthcentpercentminusxx", "csslist"=>"tdoverflowmax150",), - "visible" => array("type"=>"integer", "label"=>"Visible", "enabled"=>"1", 'position'=>60, 'notnull'=>1, "visible"=>"-1", "alwayseditable"=>"1",), - "import_key" => array("type"=>"varchar(14)", "label"=>"ImportId", "enabled"=>"1", 'position'=>900, 'notnull'=>0, "visible"=>"-2", "alwayseditable"=>"1",), - "date_creation" => array("type"=>"datetime", "label"=>"Datecreation", "enabled"=>"1", 'position'=>70, 'notnull'=>0, "visible"=>"-1", "alwayseditable"=>"1",), - "tms" => array("type"=>"timestamp", "label"=>"DateModification", "enabled"=>"1", 'position'=>75, 'notnull'=>1, "visible"=>"-1", "alwayseditable"=>"1",), - "fk_user_creat" => array("type"=>"integer:User:user/class/user.class.php", "label"=>"UserAuthor", "enabled"=>"1", 'position'=>80, 'notnull'=>0, "visible"=>"-2", "alwayseditable"=>"1", "css"=>"maxwidth500 widthcentpercentminusxx", "csslist"=>"tdoverflowmax150",), - "fk_user_modif" => array("type"=>"integer:User:user/class/user.class.php", "label"=>"UserModif", "enabled"=>"1", 'position'=>85, 'notnull'=>-1, "visible"=>"-2", "alwayseditable"=>"1", "css"=>"maxwidth500 widthcentpercentminusxx", "csslist"=>"tdoverflowmax150",), + public $fields = array( + "rowid" => array("type" => "integer", "label" => "TechnicalID", "enabled" => "1", 'position' => 10, 'notnull' => 1, "visible" => "-1",), + "fk_parent" => array("type" => "integer", "label" => "Fkparent", "enabled" => "1", 'position' => 20, 'notnull' => 1, "visible" => "-1", "css" => "maxwidth500 widthcentpercentminusxx",), + "label" => array("type" => "varchar(180)", "label" => "Label", "enabled" => "1", 'position' => 25, 'notnull' => 1, "visible" => "-1", "alwayseditable" => "1", "css" => "minwidth300", "cssview" => "wordbreak", "csslist" => "tdoverflowmax150",), + "ref_ext" => array("type" => "varchar(255)", "label" => "Refext", "enabled" => "1", 'position' => 30, 'notnull' => 0, "visible" => "0", "alwayseditable" => "1",), + "type" => array("type" => "integer", "label" => "Type", "enabled" => "1", 'position' => 35, 'notnull' => 1, "visible" => "-1", "alwayseditable" => "1",), + "description" => array("type" => "text", "label" => "Description", "enabled" => "1", 'position' => 40, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",), + "color" => array("type" => "varchar(8)", "label" => "Color", "enabled" => "1", 'position' => 45, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",), + "position" => array("type" => "integer", "label" => "Position", "enabled" => "1", 'position' => 50, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",), + "fk_soc" => array("type" => "integer:Societe:societe/class/societe.class.php", "label" => "ThirdParty", "picto" => "company", "enabled" => "1", 'position' => 55, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1", "css" => "maxwidth500 widthcentpercentminusxx", "csslist" => "tdoverflowmax150",), + "visible" => array("type" => "integer", "label" => "Visible", "enabled" => "1", 'position' => 60, 'notnull' => 1, "visible" => "-1", "alwayseditable" => "1",), + "import_key" => array("type" => "varchar(14)", "label" => "ImportId", "enabled" => "1", 'position' => 900, 'notnull' => 0, "visible" => "-2", "alwayseditable" => "1",), + "date_creation" => array("type" => "datetime", "label" => "Datecreation", "enabled" => "1", 'position' => 70, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",), + "tms" => array("type" => "timestamp", "label" => "DateModification", "enabled" => "1", 'position' => 75, 'notnull' => 1, "visible" => "-1", "alwayseditable" => "1",), + "fk_user_creat" => array("type" => "integer:User:user/class/user.class.php", "label" => "UserAuthor", "enabled" => "1", 'position' => 80, 'notnull' => 0, "visible" => "-2", "alwayseditable" => "1", "css" => "maxwidth500 widthcentpercentminusxx", "csslist" => "tdoverflowmax150",), + "fk_user_modif" => array("type" => "integer:User:user/class/user.class.php", "label" => "UserModif", "enabled" => "1", 'position' => 85, 'notnull' => -1, "visible" => "-2", "alwayseditable" => "1", "css" => "maxwidth500 widthcentpercentminusxx", "csslist" => "tdoverflowmax150",), ); /** diff --git a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php index b884ecd52db..df20f1b01e9 100644 --- a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php +++ b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php @@ -36,12 +36,14 @@ print "\n"; global $user; $langs = $GLOBALS['langs']; +'@phan-var-force Translate $langs'; $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; // Load translation files required by the page $langs->load("propal"); $linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1); +'@phan-var-force CommonObject[] $linkedObjectBlock'; // Repeat because type lost after dol_sort_array) $total = 0; $ilink = 0; diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php index 22bea09d2c0..5477168c142 100644 --- a/htdocs/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php @@ -30,12 +30,14 @@ global $user; global $noMoreLinkedObjectBlockAfter; $langs = $GLOBALS['langs']; +'@phan-var-force Translate $langs'; $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; // Load translation files required by the page $langs->load("orders"); $linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1); +'@phan-var-force CommonObject[] $linkedObjectBlock'; // Repeat because type lost after dol_sort_array) $total = 0; $ilink = 0; diff --git a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php index fa1a5bea7c7..c028e38426f 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php @@ -30,6 +30,7 @@ global $user; global $noMoreLinkedObjectBlockAfter; $langs = $GLOBALS['langs']; +'@phan-var-force Translate $langs'; $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; $langs->load("bills"); diff --git a/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php index f7dfdedf257..24b6a639992 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php @@ -32,7 +32,9 @@ global $user; global $noMoreLinkedObjectBlockAfter; $langs = $GLOBALS['langs']; +'@phan-var-force Translate $langs'; $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; +'@phan-var-force CommonObject[] $linkedObjectBlock'; $langs->load("bills"); diff --git a/htdocs/contrat/tpl/linkedobjectblock.tpl.php b/htdocs/contrat/tpl/linkedobjectblock.tpl.php index 1f4ac5f0449..329e1859caa 100644 --- a/htdocs/contrat/tpl/linkedobjectblock.tpl.php +++ b/htdocs/contrat/tpl/linkedobjectblock.tpl.php @@ -31,7 +31,9 @@ global $user; global $noMoreLinkedObjectBlockAfter; $langs = $GLOBALS['langs']; +'@phan-var-force Translate $langs'; $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; +'@phan-var-force CommonObject[] $linkedObjectBlock'; // Load translation files required by the page $langs->load("contracts"); diff --git a/htdocs/core/actions_dellink.inc.php b/htdocs/core/actions_dellink.inc.php index 9d5bb687c64..e915d920ba4 100644 --- a/htdocs/core/actions_dellink.inc.php +++ b/htdocs/core/actions_dellink.inc.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 @@ -46,6 +47,7 @@ if ($action == 'addlinkbyref' && !empty($permissiondellink) && !$cancellink && $ dol_include_once('/' . $element_prop['classpath'] . '/' . $element_prop['classfile'] . '.class.php'); $objecttmp = new $element_prop['classname']($db); + '@phan-var-force CommonObject $objecttmp'; $ret = $objecttmp->fetch(0, $addlinkref); if ($ret > 0) { $object->fetch($id); diff --git a/htdocs/core/ajax/ajaxtooltip.php b/htdocs/core/ajax/ajaxtooltip.php index 8bc7305d744..effde09c757 100644 --- a/htdocs/core/ajax/ajaxtooltip.php +++ b/htdocs/core/ajax/ajaxtooltip.php @@ -1,6 +1,7 @@ * Copyright (C) 2018-2023 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 @@ -82,6 +83,7 @@ top_httphead(); $html = ''; if (is_object($object)) { + '@phan-var-force CommonObject $object'; if ($object->id > 0 || !empty($object->ref)) { /** @var CommonObject $object */ $html = $object->getTooltipContent($params); diff --git a/htdocs/core/ajax/extraparams.php b/htdocs/core/ajax/extraparams.php index 9b63da251f5..b931cc9528e 100644 --- a/htdocs/core/ajax/extraparams.php +++ b/htdocs/core/ajax/extraparams.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 @@ -78,6 +79,7 @@ if (!empty($id) && !empty($element) && !empty($htmlelement) && !empty($type)) { dol_syslog("AjaxSetExtraParameters id=".$id." element=".$element." htmlelement=".$htmlelement." type=".$type." value=".$value, LOG_DEBUG); if (is_object($object)) { + '@phan-var-force CommonObject $object'; $params[$htmlelement] = array($type => $value); $object->extraparams = array_merge($object->extraparams, $params); diff --git a/htdocs/core/ajax/loadinplace.php b/htdocs/core/ajax/loadinplace.php index 13c80cd50b1..da926556250 100644 --- a/htdocs/core/ajax/loadinplace.php +++ b/htdocs/core/ajax/loadinplace.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 @@ -127,6 +128,7 @@ if (!empty($field) && !empty($element) && !empty($table_element) && !empty($fk_e dol_include_once('/'.$module.'/class/actions_'.$subelement.'.class.php'); $classname = 'Actions'.ucfirst($subelement); $object = new $classname($db); + '@phan-var-force ActionsMulticompany|ActionsAdherentCardCommon|ActionsContactCardCommon|CommonHookActions|ActionsCardProduct|ActionsCardService|ActionsCardCommon $object'; $ret = $object->$methodname($fk_element); if ($ret > 0) { echo json_encode($object->$cachename); diff --git a/htdocs/core/ajax/objectonoff.php b/htdocs/core/ajax/objectonoff.php index 4e4b19d6f54..891d8ef8630 100644 --- a/htdocs/core/ajax/objectonoff.php +++ b/htdocs/core/ajax/objectonoff.php @@ -56,6 +56,7 @@ $object = fetchObjectByElement($id, $element); if (!is_object($object)) { httponly_accessforbidden("Bad value for combination of parameters element/field: Object not found."); // This includes the exit. } +'@phan-var-force CommonObject $object'; $object->fields[$field] = array('type' => $format, 'enabled' => 1); diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 371c2cec1b8..a5a2200b4ba 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -287,6 +287,7 @@ function dolWebsiteOutput($content, $contenttype = 'html', $containerid = 0) global $dolibarr_main_url_root, $dolibarr_main_data_root; global $website; global $includehtmlcontentopened; + '@phan-var-force WebSite $website'; $nbrep = 0; @@ -518,6 +519,7 @@ function dolWebsiteSaveContent($content) function redirectToContainer($containerref, $containeraliasalt = '', $containerid = 0, $permanent = 0, $parameters = array()) { global $db, $website; + '@phan-var-force WebSite $website'; $newurl = ''; $result = 0; @@ -602,6 +604,7 @@ function includeContainer($containerref) global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running included containers. global $includehtmlcontentopened; global $websitekey, $websitepagefile; + '@phan-var-force WebSite $website'; $MAXLEVEL = 20; @@ -657,6 +660,7 @@ function includeContainer($containerref) function getStructuredData($type, $data = array()) { global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs, $pagelangs; // Very important. Required to have var available when running included containers. + '@phan-var-force WebSite $website'; $type = strtolower($type); @@ -864,6 +868,7 @@ function getStructuredData($type, $data = array()) function getSocialNetworkHeaderCards($params = null) { global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running included containers. + '@phan-var-force WebSite $website'; $out = ''; @@ -939,6 +944,7 @@ function getSocialNetworkHeaderCards($params = null) function getSocialNetworkSharingLinks($socialnetworks = '') { global $website, $websitepage; // Very important. Required to have var available when running included containers. + '@phan-var-force WebSite $website'; $out = ''."\n"; @@ -1166,6 +1172,7 @@ function getPublicFilesOfObject($object) function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $sortfield = 'date_creation', $sortorder = 'DESC', $langcode = '', $otherfilters = [], $status = 1) { global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running included containers. + '@phan-var-force WebSite $website'; $error = 0; $arrayresult = array('code' => '', 'list' => array()); diff --git a/htdocs/core/modules/barcode/modules_barcode.class.php b/htdocs/core/modules/barcode/modules_barcode.class.php index 9512e3e2036..9e3fe8894e2 100644 --- a/htdocs/core/modules/barcode/modules_barcode.class.php +++ b/htdocs/core/modules/barcode/modules_barcode.class.php @@ -74,6 +74,14 @@ abstract class ModeleBarCode { return -1; // Error by default, this method must be implemented by the driver } + + /** + * Return true if encoding is supported + * + * @param string $encoding Encoding norm + * @return int >0 if supported, 0 if not + */ + abstract public function encodingIsSupported($encoding); } diff --git a/htdocs/core/modules/cheque/modules_chequereceipts.php b/htdocs/core/modules/cheque/modules_chequereceipts.php index 1137a17cc05..d75805a1174 100644 --- a/htdocs/core/modules/cheque/modules_chequereceipts.php +++ b/htdocs/core/modules/cheque/modules_chequereceipts.php @@ -150,6 +150,7 @@ function chequereceipt_pdf_create($db, $id, $message, $modele, $outputlangs) require_once $dir.$file; $obj = new $classname($db); + '@phan-var-force ModeleChequeReceipts $obj'; // We save charset_output to restore it because write_file can change it if needed for // output format that does not support UTF8. diff --git a/htdocs/core/modules/oauth/stripelive_oauthcallback.php b/htdocs/core/modules/oauth/stripelive_oauthcallback.php index 6184fb8d0c3..3c3070a6abc 100644 --- a/htdocs/core/modules/oauth/stripelive_oauthcallback.php +++ b/htdocs/core/modules/oauth/stripelive_oauthcallback.php @@ -137,6 +137,7 @@ if (GETPOST('code')) { // We are coming from oauth provider page if ($apiService === null) { dol_syslog("No API Service", LOG_ERR); } else { + '@phan-var-force OAuth\OAuth2\Service\AbstractService|OAuth\OAuth1\Service\AbstractService $apiService'; try { //var_dump($state); //var_dump($apiService); // OAuth\OAuth2\Service\Stripe diff --git a/htdocs/core/modules/printing/modules_printing.php b/htdocs/core/modules/printing/modules_printing.php index ea5bcf02397..4bc49d2c37c 100644 --- a/htdocs/core/modules/printing/modules_printing.php +++ b/htdocs/core/modules/printing/modules_printing.php @@ -163,4 +163,19 @@ class PrintingDriver $this->errors[] = $msg; return 1; } + + /** + * List jobs print + * + * @param ?string $module module + * + * @return int 0 if OK, >0 if KO + */ + public function listJobs($module = null) + { + $msg = get_class($this)."::".__FUNCTION__." not implemented"; + dol_syslog($msg, LOG_ERR); + $this->errors[] = $msg; + return 1; + } } diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php index eb234513234..13db8922c58 100644 --- a/htdocs/core/modules/printing/printgcp.modules.php +++ b/htdocs/core/modules/printing/printgcp.modules.php @@ -436,9 +436,11 @@ class printing_printgcp extends PrintingDriver /** * List jobs print * + * @param ?string $module module + * * @return int 0 if OK, >0 if KO */ - public function listJobs() + public function listJobs($module = null) { global $conf, $langs; diff --git a/htdocs/core/modules/printing/printipp.modules.php b/htdocs/core/modules/printing/printipp.modules.php index 65cafd09939..453aa32157a 100644 --- a/htdocs/core/modules/printing/printipp.modules.php +++ b/htdocs/core/modules/printing/printipp.modules.php @@ -285,11 +285,11 @@ class printing_printipp extends PrintingDriver /** * List jobs print * - * @param string $module module + * @param ?string $module module * * @return int 0 if OK, >0 if KO */ - public function listJobs($module) + public function listJobs($module = null) { global $conf; $error = 0; @@ -304,7 +304,7 @@ class printing_printipp extends PrintingDriver $ipp->setAuthentication($this->user, $this->password); } // select printer uri for module order, propal,... - $sql = "SELECT rowid,printer_uri,printer_name FROM ".MAIN_DB_PREFIX."printer_ipp WHERE module = '".$this->db->escape($module)."'"; + $sql = "SELECT rowid,printer_uri,printer_name FROM ".MAIN_DB_PREFIX."printer_ipp WHERE module = '".$this->db->escape((string) $module)."'"; $result = $this->db->query($sql); if ($result) { $obj = $this->db->fetch_object($result); diff --git a/htdocs/core/tpl/commonfields_add.tpl.php b/htdocs/core/tpl/commonfields_add.tpl.php index cbfee031cb3..1a50479ae32 100644 --- a/htdocs/core/tpl/commonfields_add.tpl.php +++ b/htdocs/core/tpl/commonfields_add.tpl.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 @@ -22,6 +23,8 @@ * $form */ +'@phan-var-force FormAdmin $formAdmin'; + // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; diff --git a/htdocs/core/tpl/filemanager.tpl.php b/htdocs/core/tpl/filemanager.tpl.php index 9f9dcce6733..ea3d626c64b 100644 --- a/htdocs/core/tpl/filemanager.tpl.php +++ b/htdocs/core/tpl/filemanager.tpl.php @@ -41,6 +41,8 @@ if (empty($module)) { $module = 'ecm'; } +'@phan-var-force WebSite $website'; + $permtoadd = 0; $permtoupload = 0; $showroot = 0; diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 56e56197925..4a2a8f9880f 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -71,10 +71,10 @@ class InterfaceActionsAuto extends DolibarrTriggers * $object->module (if defined, elementtype in llx_actioncomm will be elementtype@module) * * @param string $action Event action code ('CONTRACT_MODIFY', 'RECRUITMENTCANDIDATURE_MODIFIY', or example by external module: 'SENTBYSMS'...) - * @param Object $object Object + * @param CommonObject $object Object * @param User $user Object user * @param Translate $langs Object langs - * @param conf $conf Object conf + * @param Conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) @@ -119,7 +119,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("NewCompanyToDolibarr", $object->name); } - $object->sendtoid = 0; + $object->sendtoid = array(); $object->socid = $object->id; } elseif ($action == 'COMPANY_MODIFY') { // Load translation files required by the page @@ -141,7 +141,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = dol_concatdesc($object->actionmsg, $langs->trans("DataFromWasMerged", $object->context['mergefromname'].' (id='.$object->context['mergefromname'].')')); } - $object->sendtoid = 0; + $object->sendtoid = array(); $object->socid = $object->id; } elseif ($action == 'COMPANY_SENTBYMAIL') { // Load translation files required by the page @@ -156,7 +156,7 @@ class InterfaceActionsAuto extends DolibarrTriggers } // Parameters $object->sendtoid defined by caller - //$object->sendtoid=0; + //$object->sendtoid = array(); } elseif ($action == 'CONTACT_CREATE') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "companies")); @@ -206,7 +206,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("ContractValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref)); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'CONTRACT_SENTBYMAIL') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "contracts")); @@ -223,7 +223,7 @@ class InterfaceActionsAuto extends DolibarrTriggers } // Parameters $object->sendtoid defined by caller - //$object->sendtoid=0; + //$object->sendtoid = array(); } elseif ($action == 'PROPAL_VALIDATE') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "propal")); @@ -239,7 +239,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("PropalValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref)); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'PROPAL_MODIFY') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "propal")); @@ -255,7 +255,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("PropalBackToDraftInDolibarr", ($object->newref ? $object->newref : $object->ref)); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'PROPAL_SENTBYMAIL') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "propal")); @@ -272,7 +272,7 @@ class InterfaceActionsAuto extends DolibarrTriggers } // Parameters $object->sendtoid defined by caller - //$object->sendtoid=0; + //$object->sendtoid = array(); } elseif ($action == 'PROPAL_CLOSE_SIGNED') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "propal")); @@ -288,7 +288,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("PropalClosedSignedInDolibarr", $object->ref); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'PROPAL_CLASSIFY_BILLED') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "propal")); @@ -304,7 +304,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("PropalClassifiedBilledInDolibarr", $object->ref); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'PROPAL_CLOSE_REFUSED') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "propal")); @@ -320,7 +320,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("PropalClosedRefusedInDolibarr", $object->ref); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'ORDER_VALIDATE') { // Load translation files required by the page $langs->loadLangs(array("agenda", "orders")); @@ -336,7 +336,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("OrderValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref)); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'ORDER_CLOSE') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "orders")); @@ -352,7 +352,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("OrderDeliveredInDolibarr", $object->ref); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'ORDER_CLASSIFY_BILLED') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "orders")); @@ -368,7 +368,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("OrderBilledInDolibarr", $object->ref); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'ORDER_CANCEL') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "orders")); @@ -384,7 +384,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("OrderCanceledInDolibarr", $object->ref); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'ORDER_SENTBYMAIL') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "orders")); @@ -401,7 +401,7 @@ class InterfaceActionsAuto extends DolibarrTriggers } // Parameters $object->sendtoid defined by caller - //$object->sendtoid=0; + //$object->sendtoid = array(); } elseif ($action == 'BILL_VALIDATE') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "bills")); @@ -417,7 +417,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("InvoiceValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref)); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'BILL_UNVALIDATE') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "bills")); @@ -433,7 +433,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("InvoiceBackToDraftInDolibarr", $object->ref); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'BILL_SENTBYMAIL') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "bills")); @@ -450,7 +450,7 @@ class InterfaceActionsAuto extends DolibarrTriggers } // Parameters $object->sendtoid defined by caller - //$object->sendtoid=0; + //$object->sendtoid = array(); } elseif ($action == 'BILL_PAYED') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "bills")); @@ -467,7 +467,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("InvoicePaidInDolibarr", $object->ref); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'BILL_CANCEL') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "bills")); @@ -483,7 +483,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("InvoiceCanceledInDolibarr", $object->ref); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'FICHINTER_CREATE') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "interventions")); @@ -499,7 +499,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("InterventionCreatedInDolibarr", $object->ref); } - $object->sendtoid = 0; + $object->sendtoid = array(); $object->fk_element = 0; $object->elementtype = ''; } elseif ($action == 'FICHINTER_VALIDATE') { @@ -517,7 +517,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("InterventionValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref)); } - $object->sendtoid = 0; + $object->sendtoid = array(); $object->fk_element = 0; $object->elementtype = ''; } elseif ($action == 'FICHINTER_MODIFY') { @@ -535,7 +535,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("InterventionModifiedInDolibarr", $object->ref); } - $object->sendtoid = 0; + $object->sendtoid = array(); $object->fk_element = 0; $object->elementtype = ''; } elseif ($action == 'FICHINTER_SENTBYMAIL') { @@ -554,7 +554,7 @@ class InterfaceActionsAuto extends DolibarrTriggers } // Parameters $object->sendtoid defined by caller - //$object->sendtoid=0; + //$object->sendtoid = array(); } elseif ($action == 'FICHINTER_CLASSIFY_BILLED') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "interventions")); @@ -570,7 +570,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("InterventionClassifiedBilledInDolibarr", $object->ref); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'FICHINTER_CLASSIFY_UNBILLED') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "interventions")); @@ -586,7 +586,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("InterventionClassifiedUnbilledInDolibarr", $object->ref); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'FICHINTER_CLOSE') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "interventions")); @@ -602,7 +602,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("InterventionClosedInDolibarr", $object->ref); } - $object->sendtoid = 0; + $object->sendtoid = array(); $object->fk_element = 0; $object->elementtype = ''; } elseif ($action == 'FICHINTER_DELETE') { @@ -620,7 +620,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("InterventionDeletedInDolibarr", $object->ref); } - $object->sendtoid = 0; + $object->sendtoid = array(); $object->fk_element = 0; $object->elementtype = ''; } elseif ($action == 'SHIPPING_VALIDATE') { @@ -639,7 +639,7 @@ class InterfaceActionsAuto extends DolibarrTriggers } // Parameters $object->sendtoid defined by caller - //$object->sendtoid=0; + //$object->sendtoid = array(); } elseif ($action == 'SHIPPING_SENTBYMAIL') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "sendings")); @@ -656,7 +656,7 @@ class InterfaceActionsAuto extends DolibarrTriggers } // Parameters $object->sendtoid defined by caller - //$object->sendtoid=0; + //$object->sendtoid = array(); } elseif ($action == 'RECEPTION_VALIDATE') { $langs->load("agenda"); $langs->load("other"); @@ -674,7 +674,7 @@ class InterfaceActionsAuto extends DolibarrTriggers } // Parameters $object->sendtoid defined by caller - //$object->sendtoid=0; + //$object->sendtoid = array(); } elseif ($action == 'RECEPTION_SENTBYMAIL') { $langs->load("agenda"); $langs->load("other"); @@ -692,7 +692,7 @@ class InterfaceActionsAuto extends DolibarrTriggers } // Parameters $object->sendtoid defined by caller - //$object->sendtoid=0; + //$object->sendtoid = array(); } elseif ($action == 'PROPOSAL_SUPPLIER_VALIDATE') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "propal")); @@ -708,7 +708,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("PropalValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref)); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'PROPOSAL_SUPPLIER_SENTBYMAIL') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "propal")); @@ -725,7 +725,7 @@ class InterfaceActionsAuto extends DolibarrTriggers } // Parameters $object->sendtoid defined by caller - //$object->sendtoid=0; + //$object->sendtoid = array(); } elseif ($action == 'PROPOSAL_SUPPLIER_CLOSE_SIGNED') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "propal")); @@ -741,7 +741,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("PropalClosedSignedInDolibarr", $object->ref); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'PROPOSAL_SUPPLIER_CLOSE_REFUSED') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "propal")); @@ -757,8 +757,9 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("PropalClosedRefusedInDolibarr", $object->ref); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'ORDER_SUPPLIER_CREATE') { + '@phan-var-force CommandeFournisseur $object'; // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "orders")); @@ -773,7 +774,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("OrderCreatedInDolibarr", ($object->newref ? $object->newref : $object->ref)); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'ORDER_SUPPLIER_VALIDATE') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "orders")); @@ -789,8 +790,9 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("OrderValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref)); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'ORDER_SUPPLIER_APPROVE') { + '@phan-var-force CommandeFournisseur $object'; // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "orders")); @@ -805,8 +807,9 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("OrderApprovedInDolibarr", $object->ref); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'ORDER_SUPPLIER_REFUSE') { + '@phan-var-force CommandeFournisseur $object'; // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "orders", "main")); @@ -826,8 +829,9 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg .= $langs->trans("Reason") . ': '.$object->refuse_note; } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'ORDER_SUPPLIER_CANCEL') { + '@phan-var-force CommandeFournisseur $object'; // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "orders", "main")); @@ -847,7 +851,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg .= $langs->trans("Reason") . ': '.$object->cancel_note; } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'ORDER_SUPPLIER_SUBMIT') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "orders")); @@ -868,8 +872,9 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg .= $langs->trans("Comment") . ': '.$object->context['comments']; } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'ORDER_SUPPLIER_RECEIVE') { + '@phan-var-force CommandeFournisseur $object'; // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "orders")); @@ -884,8 +889,9 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("SupplierOrderReceivedInDolibarr", ($object->newref ? $object->newref : $object->ref)); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'ORDER_SUPPLIER_SENTBYMAIL') { + '@phan-var-force CommandeFournisseur $object'; // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "bills", "orders")); @@ -901,8 +907,9 @@ class InterfaceActionsAuto extends DolibarrTriggers } // Parameters $object->sendtoid defined by caller - //$object->sendtoid=0; + //$object->sendtoid = array(); } elseif ($action == 'ORDER_SUPPLIER_CLASSIFY_BILLED') { + '@phan-var-force CommandeFournisseur $object'; // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "bills", "orders")); @@ -917,7 +924,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("SupplierOrderClassifiedBilled", $object->ref); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'BILL_SUPPLIER_VALIDATE') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "bills")); @@ -933,7 +940,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("InvoiceValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref)); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'BILL_SUPPLIER_UNVALIDATE') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "bills")); @@ -949,7 +956,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("InvoiceBackToDraftInDolibarr", $object->ref); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'BILL_SUPPLIER_SENTBYMAIL') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "bills", "orders")); @@ -966,7 +973,7 @@ class InterfaceActionsAuto extends DolibarrTriggers } // Parameters $object->sendtoid defined by caller - //$object->sendtoid=0; + //$object->sendtoid = array(); } elseif ($action == 'BILL_SUPPLIER_PAYED') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "bills")); @@ -982,7 +989,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("InvoicePaidInDolibarr", $object->ref); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'BILL_SUPPLIER_CANCELED') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "bills")); @@ -998,7 +1005,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("InvoiceCanceledInDolibarr", $object->ref); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'MEMBER_VALIDATE') { // Members // Load translation files required by the page @@ -1017,7 +1024,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg .= "\n".$langs->transnoentities("Type").': '.$object->type; } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'MEMBER_MODIFY') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "members")); @@ -1035,7 +1042,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg .= "\n".$langs->transnoentities("Type").': '.$object->type; } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'MEMBER_SUBSCRIPTION_CREATE') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "members")); @@ -1063,7 +1070,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg .= "\n".$langs->transnoentities("Period").': '.dol_print_date($object->dateh, 'day').' - '.dol_print_date($object->datef, 'day'); } - $object->sendtoid = 0; + $object->sendtoid = array(); if (isset($object->fk_soc) && $object->fk_soc > 0) { $object->socid = $object->fk_soc; } @@ -1093,7 +1100,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg .= "\n".$langs->transnoentities("Period").': '.dol_print_date($object->dateh, 'day').' - '.dol_print_date($object->datef, 'day'); } - $object->sendtoid = 0; + $object->sendtoid = array(); if (isset($object->fk_soc) && $object->fk_soc > 0) { $object->socid = $object->fk_soc; } @@ -1124,7 +1131,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg .= "\n".$langs->transnoentities("Period").': '.dol_print_date($object->dateh, 'day').' - '.dol_print_date($object->datef, 'day'); } - $object->sendtoid = 0; + $object->sendtoid = array(); if (isset($object->fk_soc) && $object->fk_soc > 0) { $object->socid = $object->fk_soc; } @@ -1145,7 +1152,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg .= "\n".$langs->transnoentities("Type").': '.$object->type; } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'MEMBER_DELETE') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "members")); @@ -1163,7 +1170,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg .= "\n".$langs->transnoentities("Type").': '.$object->type; } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'MEMBER_EXCLUDE') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "members")); @@ -1181,7 +1188,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg .= "\n".$langs->transnoentities("Type").': '.$object->type; } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'PROJECT_CREATE') { // Projects // Load translation files required by the page @@ -1199,7 +1206,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg .= "\n".$langs->transnoentities("Project").': '.$object->ref; } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'PROJECT_VALIDATE') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "projects")); @@ -1216,7 +1223,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg .= "\n".$langs->transnoentities("Project").': '.$object->ref; } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'PROJECT_MODIFY') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "projects")); @@ -1237,7 +1244,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg .= "\n".$langs->transnoentitiesnoconv("OpportunityStatus").': '.$object->oldcopy->opp_status.' -> '.$object->opp_status; } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'PROJECT_SENTBYMAIL') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "projects")); @@ -1254,7 +1261,7 @@ class InterfaceActionsAuto extends DolibarrTriggers } // Parameters $object->sendtoid defined by caller - //$object->sendtoid=0; + //$object->sendtoid = array(); } elseif ($action == 'PROJECT_DELETE') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "projects")); @@ -1264,7 +1271,7 @@ class InterfaceActionsAuto extends DolibarrTriggers } $object->actionmsg = $langs->transnoentities("ProjectDeletedInDolibarr", $object->ref); - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'PROJECT_CLOSE') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "projects")); @@ -1280,7 +1287,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("ProjectClosedInDolibarr", $object->ref); } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'TASK_CREATE') { // Project tasks // Load translation files required by the page @@ -1298,7 +1305,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg .= "\n".$langs->transnoentities("Task").': '.$object->ref; } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'TASK_MODIFY') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "projects")); @@ -1315,7 +1322,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg .= "\n".$langs->transnoentities("Task").': '.$object->ref; } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'TASK_DELETE') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "projects")); @@ -1332,7 +1339,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg .= "\n".$langs->transnoentities("Task").': '.$object->ref; } - $object->sendtoid = 0; + $object->sendtoid = array(); } elseif ($action == 'TICKET_ASSIGNED') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "projects")); @@ -1363,7 +1370,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg .= "\n".$langs->transnoentities("NewUser").': '.$langs->trans("None"); } - $object->sendtoid = 0; + $object->sendtoid = array(); } else { // TODO Merge all previous cases into this generic one // $action = PASSWORD, BILL_DELETE, TICKET_CREATE, TICKET_MODIFY, TICKET_DELETE, CONTACT_SENTBYMAIL, RECRUITMENTCANDIDATURE_MODIFY, ... @@ -1413,7 +1420,7 @@ class InterfaceActionsAuto extends DolibarrTriggers } if (!isset($object->sendtoid) || !is_array($object->sendtoid)) { - $object->sendtoid = 0; + $object->sendtoid = array(); } } diff --git a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php index 4626228ef93..a85060582c5 100644 --- a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php @@ -52,10 +52,10 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers * All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared) * * @param string $action Event action code - * @param Object $object Object + * @param CommonObject $object Object * @param User $user Object user * @param Translate $langs Object langs - * @param conf $conf Object conf + * @param Conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) diff --git a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php index 6906157f6ef..4c2aaf7b26a 100644 --- a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php +++ b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php @@ -58,12 +58,12 @@ class InterfaceContactRoles extends DolibarrTriggers * $object->socid or $object->fk_soc(id of thirdparty) * $object->element (element type of object) * - * @param string $action Event action code - * @param Object $object Object - * @param User $user Object user - * @param Translate $langs Object langs - * @param conf $conf Object conf - * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK + * @param string $action Event action code + * @param CommonObject $object Object + * @param User $user Object user + * @param Translate $langs Object langs + * @param Conf $conf Object conf + * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { diff --git a/htdocs/delivery/tpl/linkedobjectblock.tpl.php b/htdocs/delivery/tpl/linkedobjectblock.tpl.php index ad72d6ea05b..320243ce103 100644 --- a/htdocs/delivery/tpl/linkedobjectblock.tpl.php +++ b/htdocs/delivery/tpl/linkedobjectblock.tpl.php @@ -30,12 +30,15 @@ global $user; global $noMoreLinkedObjectBlockAfter; $langs = $GLOBALS['langs']; +'@phan-var-force Translate $langs'; $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; +'@phan-var-force CommonObject[] $linkedObjectBlock'; // Load translation files required by the page $langs->load('sendings'); $linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1); +'@phan-var-force CommonObject[] $linkedObjectBlock'; // Repeat because type lost after dol_sort_array) $total = 0; $ilink = 0; diff --git a/htdocs/eventorganization/tpl/linkedobjectblock.tpl.php b/htdocs/eventorganization/tpl/linkedobjectblock.tpl.php index e99e7fe8f83..9345e5d5fce 100644 --- a/htdocs/eventorganization/tpl/linkedobjectblock.tpl.php +++ b/htdocs/eventorganization/tpl/linkedobjectblock.tpl.php @@ -2,6 +2,7 @@ /* Copyright (C) 2010-2011 Regis Houssin * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2014 Marcos García + * 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 @@ -28,7 +29,9 @@ echo "\n"; global $user; $langs = $GLOBALS['langs']; +'@phan-var-force Translate $langs'; $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; +'@phan-var-force CommonObject[] $linkedObjectBlock'; // Load translation files required by the page $langs->load("sendings"); diff --git a/htdocs/expensereport/tpl/linkedobjectblock.tpl.php b/htdocs/expensereport/tpl/linkedobjectblock.tpl.php index 15e2c7cdd66..2378045c198 100644 --- a/htdocs/expensereport/tpl/linkedobjectblock.tpl.php +++ b/htdocs/expensereport/tpl/linkedobjectblock.tpl.php @@ -31,7 +31,9 @@ print "\n global $user; $langs = $GLOBALS['langs']; +'@phan-var-force Translate $langs'; $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; +'@phan-var-force CommonObject[] $linkedObjectBlock'; $var = true; $total = 0; diff --git a/htdocs/fichinter/tpl/linkedobjectblock.tpl.php b/htdocs/fichinter/tpl/linkedobjectblock.tpl.php index 9062d9f798b..1309689c07a 100644 --- a/htdocs/fichinter/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fichinter/tpl/linkedobjectblock.tpl.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 @@ -28,11 +29,14 @@ print "\n"; global $user; $langs = $GLOBALS['langs']; +'@phan-var-force Translate $langs'; $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; +'@phan-var-force CommonObject[] $linkedObjectBlock'; $langs->load("interventions"); $linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1); +'@phan-var-force CommonObject[] $linkedObjectBlock'; // Repeat because type lost after dol_sort_array) $ilink = 0; foreach ($linkedObjectBlock as $key => $objectlink) { diff --git a/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php index 2ef94206dde..2f7826c5ea6 100644 --- a/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php @@ -31,7 +31,9 @@ global $user; global $noMoreLinkedObjectBlockAfter; $langs = $GLOBALS['langs']; +'@phan-var-force Translate $langs'; $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; +'@phan-var-force CommonObject[] $linkedObjectBlock'; $langs->load("orders"); diff --git a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php index fe1118bd275..3c3143caed9 100644 --- a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php @@ -33,6 +33,7 @@ global $user; global $noMoreLinkedObjectBlockAfter; $langs = $GLOBALS['langs']; +'@phan-var-force Translate $langs'; $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; $langs->load("bills"); diff --git a/htdocs/mrp/tpl/linkedobjectblock.tpl.php b/htdocs/mrp/tpl/linkedobjectblock.tpl.php index 094a6b0c21f..1762af7a397 100644 --- a/htdocs/mrp/tpl/linkedobjectblock.tpl.php +++ b/htdocs/mrp/tpl/linkedobjectblock.tpl.php @@ -3,6 +3,7 @@ * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2014 Marcos García * Copyright (C) 2013-2020 Charlene BENKE + * 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 @@ -30,6 +31,7 @@ global $user, $db, $hookmanager; global $noMoreLinkedObjectBlockAfter; $langs = $GLOBALS['langs']; +'@phan-var-force Translate $langs'; $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; $object = $GLOBALS['object']; diff --git a/htdocs/printing/index.php b/htdocs/printing/index.php index a4cc4d9103d..0a8639bff38 100644 --- a/htdocs/printing/index.php +++ b/htdocs/printing/index.php @@ -1,6 +1,7 @@ * Copyright (C) 2016 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 @@ -59,6 +60,7 @@ foreach ($result as $driver) { $classname = 'printing_'.$driver; $langs->load($driver); $printer = new $classname($db); + '@phan-var-force PrintingDriver $printer'; $keyforprinteractive = $printer->active; if ($keyforprinteractive && getDolGlobalString($keyforprinteractive)) { //$printer->listJobs('commande'); diff --git a/htdocs/product/admin/dynamic_prices.php b/htdocs/product/admin/dynamic_prices.php index b1a132d8128..04d602a763b 100644 --- a/htdocs/product/admin/dynamic_prices.php +++ b/htdocs/product/admin/dynamic_prices.php @@ -1,6 +1,7 @@ * Copyright (C) 2023 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 @@ -251,7 +252,7 @@ if ($action != 'create_variable' && $action != 'edit_variable') { print ''; $arraypriceupdaters = $price_updaters->listUpdaters(); - if (!empty($arraypriceupdaters)) { + if (!empty($arraypriceupdaters) && is_array($arraypriceupdaters)) { foreach ($arraypriceupdaters as $i => $entry) { $code = ""; if ($entry->fk_variable > 0) { diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index d98818b51c9..7608a84cbe1 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -432,6 +432,7 @@ foreach ($dirmodels as $reldir) { require_once $dir.'/'.$file; $module = new $classname($db); + '@phan-var-force ModelePDFProduct $module'; $modulequalified = 1; if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) { @@ -446,7 +447,7 @@ foreach ($dirmodels as $reldir) { print(empty($module->name) ? $name : $module->name); print "\n"; if (method_exists($module, 'info')) { - print $module->info($langs); + print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod } else { print $module->description; } diff --git a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php index 11b8b1db214..b6404b0b608 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php @@ -374,7 +374,7 @@ class PriceGlobalVariableUpdater /** * List all price global variables * - * @return array|int Array of price global variable updaters + * @return PriceGlobalVariableUpdater[]|int<-1,-1> Array of price global variable updaters */ public function listUpdaters() { @@ -411,7 +411,7 @@ class PriceGlobalVariableUpdater /** * List all updaters which need to be processed * - * @return array|int Array of price global variable updaters + * @return PriceGlobalVariableUpdater[]|int<-1,-1> Array of price global variable updaters */ public function listPendingUpdaters() { diff --git a/htdocs/projet/tasks/tpl/linkedobjectblock.tpl.php b/htdocs/projet/tasks/tpl/linkedobjectblock.tpl.php index 3f5cda25074..ad71c0335ea 100644 --- a/htdocs/projet/tasks/tpl/linkedobjectblock.tpl.php +++ b/htdocs/projet/tasks/tpl/linkedobjectblock.tpl.php @@ -3,6 +3,7 @@ * Copyright (C) 2014 Marcos García * Copyright (C) 2019 Laurent Destailleur * Copyright (C) 2024 Charlene Benke + * 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 @@ -33,14 +34,18 @@ global $user; global $noMoreLinkedObjectBlockAfter; $langs = $GLOBALS['langs']; +'@phan-var-force Translate $langs'; $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; +'@phan-var-force CommonObject[] $linkedObjectBlock'; // Load translation files required by the page $langs->load("tasks"); $linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1); +'@phan-var-force CommonObject[] $linkedObjectBlock'; // Repeat because type lost after dol_sort_array) -$total = 0; $ilink = 0; +$total = 0; +$ilink = 0; foreach ($linkedObjectBlock as $key => $objectlink) { $ilink++; diff --git a/htdocs/public/webportal/tpl/errors.tpl.php b/htdocs/public/webportal/tpl/errors.tpl.php index 11e073b04c2..27182f2f0c7 100644 --- a/htdocs/public/webportal/tpl/errors.tpl.php +++ b/htdocs/public/webportal/tpl/errors.tpl.php @@ -1,10 +1,13 @@ + */ // Protection to avoid direct call of template if (empty($context) || !is_object($context)) { print "Error, template page can't be called as URL"; exit(1); } +'@phan-var-force Context $context'; print '