diff --git a/build/phpstan/phpstan-baseline.neon b/build/phpstan/phpstan-baseline.neon index 2366fe2a1f6..0c060a1a966 100644 --- a/build/phpstan/phpstan-baseline.neon +++ b/build/phpstan/phpstan-baseline.neon @@ -55,11 +55,6 @@ parameters: count: 3 path: ../../htdocs/accountancy/admin/categories_list.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 4 - path: ../../htdocs/accountancy/admin/defaultaccounts.php - - message: "#^Right side of && is always true\\.$#" count: 4 @@ -160,11 +155,6 @@ parameters: count: 6 path: ../../htdocs/accountancy/bookkeeping/balance.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 2 - path: ../../htdocs/accountancy/bookkeeping/card.php - - message: "#^If condition is always true\\.$#" count: 1 @@ -590,11 +580,6 @@ parameters: count: 2 path: ../../htdocs/accountancy/expensereport/index.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 1 - path: ../../htdocs/accountancy/expensereport/index.php - - message: "#^Right side of && is always true\\.$#" count: 1 @@ -950,11 +935,6 @@ parameters: count: 1 path: ../../htdocs/adherents/list.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 1 - path: ../../htdocs/adherents/list.php - - message: "#^Variable \\$contextpage in empty\\(\\) always exists and is not falsy\\.$#" count: 1 @@ -1040,11 +1020,6 @@ parameters: count: 2 path: ../../htdocs/adherents/type.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 5 - path: ../../htdocs/adherents/type.php - - message: "#^Negated boolean expression is always true\\.$#" count: 1 @@ -1055,11 +1030,6 @@ parameters: count: 2 path: ../../htdocs/admin/agenda.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 2 - path: ../../htdocs/admin/agenda.php - - message: "#^Variable \\$label might not be defined\\.$#" count: 2 @@ -1080,16 +1050,6 @@ parameters: count: 1 path: ../../htdocs/admin/bank.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 6 - path: ../../htdocs/admin/bom.php - - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 4 - path: ../../htdocs/admin/chequereceipts.php - - message: "#^Variable \\$massaction might not be defined\\.$#" count: 1 @@ -1105,11 +1065,6 @@ parameters: count: 3 path: ../../htdocs/admin/dav.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 4 - path: ../../htdocs/admin/delivery.php - - message: "#^Variable \\$param in empty\\(\\) always exists and is not falsy\\.$#" count: 1 @@ -1155,16 +1110,6 @@ parameters: count: 1 path: ../../htdocs/admin/events.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 3 - path: ../../htdocs/admin/expedition.php - - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 4 - path: ../../htdocs/admin/expensereport.php - - message: "#^Parameter \\#4 \\$month of function dol_mktime expects int, array\\|string given\\.$#" count: 2 @@ -1180,11 +1125,6 @@ parameters: count: 2 path: ../../htdocs/admin/expensereport_rules.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 1 - path: ../../htdocs/admin/external_rss.php - - message: "#^Variable \\$form might not be defined\\.$#" count: 2 @@ -1195,11 +1135,6 @@ parameters: count: 1 path: ../../htdocs/admin/fediverse.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 18 - path: ../../htdocs/admin/fichinter.php - - message: "#^Variable \\$form might not be defined\\.$#" count: 1 @@ -1210,11 +1145,6 @@ parameters: count: 1 path: ../../htdocs/admin/geoipmaxmind.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 4 - path: ../../htdocs/admin/holiday.php - - message: "#^Elseif condition is always false\\.$#" count: 4 @@ -1285,11 +1215,6 @@ parameters: count: 2 path: ../../htdocs/admin/limits.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 8 - path: ../../htdocs/admin/mailing.php - - message: "#^Right side of && is always true\\.$#" count: 3 @@ -1300,11 +1225,6 @@ parameters: count: 3 path: ../../htdocs/admin/mails.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 3 - path: ../../htdocs/admin/mails.php - - message: "#^Variable \\$text in empty\\(\\) always exists and is not falsy\\.$#" count: 4 @@ -1395,11 +1315,6 @@ parameters: count: 2 path: ../../htdocs/admin/modules.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 6 - path: ../../htdocs/admin/mrp.php - - message: "#^Negated boolean expression is always true\\.$#" count: 1 @@ -1425,11 +1340,6 @@ parameters: count: 1 path: ../../htdocs/admin/oauthlogintokens.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 2 - path: ../../htdocs/admin/oauthlogintokens.php - - message: "#^Negated boolean expression is always false\\.$#" count: 5 @@ -1450,36 +1360,11 @@ parameters: count: 1 path: ../../htdocs/admin/openinghours.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 12 - path: ../../htdocs/admin/order.php - - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 5 - path: ../../htdocs/admin/payment.php - - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 5 - path: ../../htdocs/admin/paymentbybanktransfer.php - - message: "#^If condition is always false\\.$#" count: 1 path: ../../htdocs/admin/pdf.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 3 - path: ../../htdocs/admin/proxy.php - - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 3 - path: ../../htdocs/admin/reception_setup.php - - message: "#^If condition is always false\\.$#" count: 2 @@ -1515,16 +1400,6 @@ parameters: count: 5 path: ../../htdocs/admin/sms.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 2 - path: ../../htdocs/admin/spip.php - - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 1 - path: ../../htdocs/admin/stock.php - - message: "#^If condition is always true\\.$#" count: 2 @@ -1685,11 +1560,6 @@ parameters: count: 2 path: ../../htdocs/admin/tools/purge.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 3 - path: ../../htdocs/admin/translation.php - - message: "#^Variable \\$massactionbutton in empty\\(\\) always exists and is always falsy\\.$#" count: 1 @@ -1740,11 +1610,6 @@ parameters: count: 1 path: ../../htdocs/admin/website.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 3 - path: ../../htdocs/admin/website.php - - message: "#^If condition is always false\\.$#" count: 1 @@ -2300,11 +2165,6 @@ parameters: count: 1 path: ../../htdocs/asset/tpl/linkedobjectblock.tpl.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 4 - path: ../../htdocs/barcode/codeinit.php - - message: "#^Right side of && is always true\\.$#" count: 4 @@ -2335,11 +2195,6 @@ parameters: count: 1 path: ../../htdocs/blockedlog/admin/blockedlog_list.php - - - message: "#^Variable \\$dolibarr_main_db_name might not be defined\\.$#" - count: 1 - path: ../../htdocs/blockedlog/admin/blockedlog_list.php - - message: "#^Parameter \\#1 \\$objtoshow of function formatObject expects object, array given\\.$#" count: 1 @@ -2385,11 +2240,6 @@ parameters: count: 1 path: ../../htdocs/bom/bom_list.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 2 - path: ../../htdocs/bom/bom_list.php - - message: "#^Property BOM\\:\\:\\$status \\(int\\) in isset\\(\\) is not nullable\\.$#" count: 1 @@ -2660,11 +2510,6 @@ parameters: count: 6 path: ../../htdocs/bookcal/availabilities_card.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 1 - path: ../../htdocs/bookcal/availabilities_card.php - - message: "#^Variable \\$permissiontoadd in empty\\(\\) always exists and is not falsy\\.$#" count: 1 @@ -2935,11 +2780,6 @@ parameters: count: 2 path: ../../htdocs/bookcal/lib/bookcal_calendar.lib.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 2 - path: ../../htdocs/bookmarks/admin/bookmark.php - - message: "#^Ternary operator condition is always false\\.$#" count: 1 @@ -3020,11 +2860,6 @@ parameters: count: 3 path: ../../htdocs/categories/class/categorie.class.php - - - message: "#^Ternary operator condition is always true\\.$#" - count: 1 - path: ../../htdocs/categories/class/categorie.class.php - - message: "#^Variable \\$url in empty\\(\\) always exists and is not falsy\\.$#" count: 2 @@ -3460,11 +3295,6 @@ parameters: count: 6 path: ../../htdocs/comm/card.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 2 - path: ../../htdocs/comm/card.php - - message: "#^Variable \\$filedir in empty\\(\\) always exists and is not falsy\\.$#" count: 6 @@ -3895,11 +3725,6 @@ parameters: count: 1 path: ../../htdocs/comm/propal/contact.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 3 - path: ../../htdocs/comm/propal/contact.php - - message: "#^If condition is always false\\.$#" count: 1 @@ -3925,11 +3750,6 @@ parameters: count: 2 path: ../../htdocs/comm/propal/list.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 1 - path: ../../htdocs/comm/propal/list.php - - message: "#^Variable \\$searchCategoryCustomerList in empty\\(\\) always exists and is not falsy\\.$#" count: 1 @@ -4375,11 +4195,6 @@ parameters: count: 2 path: ../../htdocs/compta/bank/account_statement_document.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 1 - path: ../../htdocs/compta/bank/annuel.php - - message: "#^Variable \\$max might not be defined\\.$#" count: 1 @@ -4610,11 +4425,6 @@ parameters: count: 1 path: ../../htdocs/compta/bank/line.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 2 - path: ../../htdocs/compta/bank/line.php - - message: "#^Variable \\$filepath might not be defined\\.$#" count: 1 @@ -4815,21 +4625,11 @@ parameters: count: 1 path: ../../htdocs/compta/cashcontrol/cashcontrol_card.php - - - message: "#^Negated boolean expression is always true\\.$#" - count: 1 - path: ../../htdocs/compta/cashcontrol/cashcontrol_card.php - - message: "#^Ternary operator condition is always false\\.$#" count: 3 path: ../../htdocs/compta/cashcontrol/cashcontrol_card.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 3 - path: ../../htdocs/compta/cashcontrol/cashcontrol_card.php - - message: "#^Variable \\$posmodule might not be defined\\.$#" count: 1 @@ -5030,11 +4830,6 @@ parameters: count: 1 path: ../../htdocs/compta/facture/card.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 26 - path: ../../htdocs/compta/facture/card.php - - message: "#^Variable \\$i might not be defined\\.$#" count: 4 @@ -5820,11 +5615,6 @@ parameters: count: 2 path: ../../htdocs/compta/paiement.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 1 - path: ../../htdocs/compta/paiement.php - - message: "#^Variable \\$multicurrency_creditnotes might not be defined\\.$#" count: 1 @@ -6095,11 +5885,6 @@ parameters: count: 1 path: ../../htdocs/compta/prelevement/class/bonprelevement.class.php - - - message: "#^Parameter \\#2 \\$executiondate of method BonPrelevement\\:\\:generate\\(\\) expects int, string given\\.$#" - count: 1 - path: ../../htdocs/compta/prelevement/class/bonprelevement.class.php - - message: "#^Property BonPrelevement\\:\\:\\$amount \\(float\\) in isset\\(\\) is not nullable\\.$#" count: 1 @@ -6170,11 +5955,6 @@ parameters: count: 1 path: ../../htdocs/compta/prelevement/orders_list.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 2 - path: ../../htdocs/compta/prelevement/orders_list.php - - message: "#^Variable \\$form might not be defined\\.$#" count: 5 @@ -7600,11 +7380,6 @@ parameters: count: 6 path: ../../htdocs/core/actions_addupdatedelete.inc.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 14 - path: ../../htdocs/core/actions_addupdatedelete.inc.php - - message: "#^Variable \\$id might not be defined\\.$#" count: 4 @@ -7645,26 +7420,11 @@ parameters: count: 3 path: ../../htdocs/core/actions_comments.inc.php - - - message: "#^Variable \\$action might not be defined\\.$#" - count: 3 - path: ../../htdocs/core/actions_dellink.inc.php - - message: "#^Variable \\$id might not be defined\\.$#" count: 2 path: ../../htdocs/core/actions_dellink.inc.php - - - message: "#^Variable \\$langs might not be defined\\.$#" - count: 2 - path: ../../htdocs/core/actions_dellink.inc.php - - - - message: "#^Variable \\$object might not be defined\\.$#" - count: 9 - path: ../../htdocs/core/actions_dellink.inc.php - - message: "#^Variable \\$action might not be defined\\.$#" count: 1 @@ -7710,11 +7470,6 @@ parameters: count: 6 path: ../../htdocs/core/actions_linkedfiles.inc.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 6 - path: ../../htdocs/core/actions_linkedfiles.inc.php - - message: "#^Comparison operation \"\\>\" between 0 and 1 is always false\\.$#" count: 2 @@ -7740,11 +7495,6 @@ parameters: count: 14 path: ../../htdocs/core/actions_massactions.inc.php - - - message: "#^Variable \\$errors might not be defined\\.$#" - count: 1 - path: ../../htdocs/core/actions_massactions.inc.php - - message: "#^Variable \\$from might not be defined\\.$#" count: 5 @@ -7810,31 +7560,16 @@ parameters: count: 1 path: ../../htdocs/core/actions_sendmails.inc.php - - - message: "#^Right side of \\|\\| is always true\\.$#" - count: 1 - path: ../../htdocs/core/actions_sendmails.inc.php - - message: "#^Variable \\$contact might not be defined\\.$#" count: 5 path: ../../htdocs/core/actions_sendmails.inc.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 2 - path: ../../htdocs/core/actions_sendmails.inc.php - - message: "#^Variable \\$from might not be defined\\.$#" count: 6 path: ../../htdocs/core/actions_sendmails.inc.php - - - message: "#^Variable \\$hookmanager might not be defined\\.$#" - count: 1 - path: ../../htdocs/core/actions_sendmails.inc.php - - message: "#^Variable \\$id might not be defined\\.$#" count: 1 @@ -7865,11 +7600,6 @@ parameters: count: 7 path: ../../htdocs/core/actions_sendmails.inc.php - - - message: "#^Variable \\$action might not be defined\\.$#" - count: 4 - path: ../../htdocs/core/actions_setmoduleoptions.inc.php - - message: "#^Variable \\$conf might not be defined\\.$#" count: 2 @@ -7880,11 +7610,6 @@ parameters: count: 8 path: ../../htdocs/core/actions_setmoduleoptions.inc.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 5 - path: ../../htdocs/core/actions_setmoduleoptions.inc.php - - message: "#^Variable \\$langs might not be defined\\.$#" count: 7 @@ -11060,36 +10785,6 @@ parameters: count: 1 path: ../../htdocs/core/modules/facture/doc/pdf_octopus.modules.php - - - message: "#^Method pdf_octopus\\:\\:_pagehead\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/facture/doc/pdf_octopus.modules.php - - - - message: "#^Method pdf_octopus\\:\\:btpGetInvoiceAmounts\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/facture/doc/pdf_octopus.modules.php - - - - message: "#^Method pdf_octopus\\:\\:getDataSituation\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/facture/doc/pdf_octopus.modules.php - - - - message: "#^Method pdf_octopus\\:\\:sumSituation\\(\\) has parameter \\$a with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/facture/doc/pdf_octopus.modules.php - - - - message: "#^Method pdf_octopus\\:\\:sumSituation\\(\\) has parameter \\$b with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/facture/doc/pdf_octopus.modules.php - - - - message: "#^Method pdf_octopus\\:\\:sumSituation\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/facture/doc/pdf_octopus.modules.php - - message: "#^Parameter \\#1 \\$object of method CommonDocGenerator\\:\\:getExtrafieldsInHtml\\(\\) expects CommonObjectLine, Facture given\\.$#" count: 1 @@ -11125,11 +10820,6 @@ parameters: count: 5 path: ../../htdocs/core/modules/facture/doc/pdf_octopus.modules.php - - - message: "#^Property pdf_octopus\\:\\:\\$TDataSituation type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/facture/doc/pdf_octopus.modules.php - - message: "#^Variable \\$hidetop in empty\\(\\) always exists and is always falsy\\.$#" count: 3 @@ -11150,11 +10840,6 @@ parameters: count: 1 path: ../../htdocs/core/modules/facture/doc/pdf_sponge.modules.php - - - message: "#^Method pdf_sponge\\:\\:_pagehead\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/facture/doc/pdf_sponge.modules.php - - message: "#^Parameter \\#1 \\$object of method CommonDocGenerator\\:\\:getExtrafieldsInHtml\\(\\) expects CommonObjectLine, Facture given\\.$#" count: 1 @@ -11450,26 +11135,6 @@ parameters: count: 1 path: ../../htdocs/core/modules/mailings/modules_mailings.php - - - message: "#^Method MailingTargets\\:\\:addTargetsToDatabase\\(\\) has parameter \\$cibles with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/mailings/modules_mailings.php - - - - message: "#^Method MailingTargets\\:\\:getEmailingSelectorsList\\(\\) has parameter \\$forcedir with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/mailings/modules_mailings.php - - - - message: "#^Method MailingTargets\\:\\:getEmailingSelectorsList\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/mailings/modules_mailings.php - - - - message: "#^Property MailingTargets\\:\\:\\$evenunsubscribe has no type specified\\.$#" - count: 1 - path: ../../htdocs/core/modules/mailings/modules_mailings.php - - message: "#^Variable \\$modName in empty\\(\\) always exists and is not falsy\\.$#" count: 1 @@ -11930,66 +11595,6 @@ parameters: count: 1 path: ../../htdocs/core/modules/project/mod_project_simple.php - - - message: "#^Method doc_generic_task_odt\\:\\:get_substitutionarray_object\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php - - - - message: "#^Method doc_generic_task_odt\\:\\:get_substitutionarray_project_contacts\\(\\) has parameter \\$contact with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php - - - - message: "#^Method doc_generic_task_odt\\:\\:get_substitutionarray_project_contacts\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php - - - - message: "#^Method doc_generic_task_odt\\:\\:get_substitutionarray_project_file\\(\\) has parameter \\$file with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php - - - - message: "#^Method doc_generic_task_odt\\:\\:get_substitutionarray_project_file\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php - - - - message: "#^Method doc_generic_task_odt\\:\\:get_substitutionarray_project_reference\\(\\) has parameter \\$refdetail with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php - - - - message: "#^Method doc_generic_task_odt\\:\\:get_substitutionarray_project_reference\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php - - - - message: "#^Method doc_generic_task_odt\\:\\:get_substitutionarray_tasks\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php - - - - message: "#^Method doc_generic_task_odt\\:\\:get_substitutionarray_tasksressource\\(\\) has parameter \\$taskresource with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php - - - - message: "#^Method doc_generic_task_odt\\:\\:get_substitutionarray_tasksressource\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php - - - - message: "#^Method doc_generic_task_odt\\:\\:get_substitutionarray_taskstime\\(\\) has parameter \\$tasktime with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php - - - - message: "#^Method doc_generic_task_odt\\:\\:get_substitutionarray_taskstime\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php - - message: "#^Parameter \\#2 \\$config of class Odf constructor expects string, array\\ given\\.$#" count: 1 @@ -12545,11 +12150,6 @@ parameters: count: 1 path: ../../htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php - - - message: "#^Method doc_generic_ticket_odt\\:\\:get_substitutionarray_object\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php - - message: "#^Parameter \\#2 \\$config of class Odf constructor expects string, array\\ given\\.$#" count: 1 @@ -12565,11 +12165,6 @@ parameters: count: 1 path: ../../htdocs/core/modules/ticket/mod_ticket_simple.php - - - message: "#^Method doc_generic_user_odt\\:\\:get_substitutionarray_object\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php - - message: "#^Parameter \\#2 \\$config of class Odf constructor expects string, array\\ given\\.$#" count: 1 @@ -12925,21 +12520,6 @@ parameters: count: 1 path: ../../htdocs/core/tpl/document_actions_post_headers.tpl.php - - - message: "#^Variable \\$hookmanager might not be defined\\.$#" - count: 2 - path: ../../htdocs/core/tpl/extrafields_add.tpl.php - - - - message: "#^Variable \\$extrafields might not be defined\\.$#" - count: 1 - path: ../../htdocs/core/tpl/extrafields_edit.tpl.php - - - - message: "#^Variable \\$hookmanager might not be defined\\.$#" - count: 2 - path: ../../htdocs/core/tpl/extrafields_edit.tpl.php - - message: "#^Variable \\$object might not be defined\\.$#" count: 1 @@ -13085,11 +12665,6 @@ parameters: count: 1 path: ../../htdocs/core/tpl/filemanager.tpl.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 3 - path: ../../htdocs/core/tpl/filemanager.tpl.php - - message: "#^Variable \\$filepathnoext might not be defined\\.$#" count: 1 @@ -13105,11 +12680,6 @@ parameters: count: 1 path: ../../htdocs/core/tpl/filemanager.tpl.php - - - message: "#^Variable \\$website might not be defined\\.$#" - count: 2 - path: ../../htdocs/core/tpl/filemanager.tpl.php - - message: "#^Variable \\$websitekey might not be defined\\.$#" count: 1 @@ -13375,11 +12945,6 @@ parameters: count: 2 path: ../../htdocs/core/tpl/objectline_view.tpl.php - - - message: "#^Variable \\$conf might not be defined\\.$#" - count: 5 - path: ../../htdocs/core/tpl/objectline_view.tpl.php - - message: "#^Variable \\$form might not be defined\\.$#" count: 3 @@ -13625,26 +13190,6 @@ parameters: count: 1 path: ../../htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php - - - message: "#^Right side of \\|\\| is always true\\.$#" - count: 1 - path: ../../htdocs/core/upload_page.php - - - - message: "#^Variable \\$accept in empty\\(\\) always exists and is not falsy\\.$#" - count: 1 - path: ../../htdocs/core/upload_page.php - - - - message: "#^Variable \\$capture in empty\\(\\) always exists and is not falsy\\.$#" - count: 1 - path: ../../htdocs/core/upload_page.php - - - - message: "#^Variable \\$perm in empty\\(\\) always exists and is not falsy\\.$#" - count: 1 - path: ../../htdocs/core/upload_page.php - - message: "#^Variable \\$conf might not be defined\\.$#" count: 3 @@ -13815,11 +13360,6 @@ parameters: count: 2 path: ../../htdocs/cron/list.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 1 - path: ../../htdocs/cron/list.php - - message: "#^Variable \\$filter might not be defined\\.$#" count: 1 @@ -13840,11 +13380,6 @@ parameters: count: 1 path: ../../htdocs/datapolicy/admin/setup.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 1 - path: ../../htdocs/datapolicy/admin/setup.php - - message: "#^Variable \\$form might not be defined\\.$#" count: 1 @@ -13870,91 +13405,11 @@ parameters: count: 1 path: ../../htdocs/dav/fileserver.php - - - message: "#^Method DolConfigCollector\\:\\:collect\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/debugbar/class/DataCollector/DolConfigCollector.php - - - - message: "#^Method DolConfigCollector\\:\\:getConfig\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/debugbar/class/DataCollector/DolConfigCollector.php - - - - message: "#^Method DolConfigCollector\\:\\:getWidgets\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/debugbar/class/DataCollector/DolConfigCollector.php - - - - message: "#^Method DolConfigCollector\\:\\:objectToArray\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/debugbar/class/DataCollector/DolConfigCollector.php - - - - message: "#^Method DolExceptionsCollector\\:\\:getWidgets\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/debugbar/class/DataCollector/DolExceptionsCollector.php - - - - message: "#^Method DolMemoryCollector\\:\\:collect\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/debugbar/class/DataCollector/DolMemoryCollector.php - - - - message: "#^Method DolMemoryCollector\\:\\:getWidgets\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/debugbar/class/DataCollector/DolMemoryCollector.php - - message: "#^Parameter \\#1 \\$callback of function set_error_handler expects \\(callable\\(int, string, string, int\\)\\: bool\\)\\|null, array\\{\\$this\\(PhpCollector\\), 'errorHandler'\\} given\\.$#" count: 1 path: ../../htdocs/debugbar/class/DataCollector/DolPhpCollector.php - - - message: "#^Method DolQueryCollector\\:\\:collect\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/debugbar/class/DataCollector/DolQueryCollector.php - - - - message: "#^Method DolQueryCollector\\:\\:getAssets\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/debugbar/class/DataCollector/DolQueryCollector.php - - - - message: "#^Method DolQueryCollector\\:\\:getWidgets\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/debugbar/class/DataCollector/DolQueryCollector.php - - - - message: "#^Method DolRequestDataCollector\\:\\:collect\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php - - - - message: "#^Method DolRequestDataCollector\\:\\:getWidgets\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php - - - - message: "#^Method DolTimeDataCollector\\:\\:getWidgets\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/debugbar/class/DataCollector/DolTimeDataCollector.php - - - - message: "#^Method DolibarrCollector\\:\\:collect\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/debugbar/class/DataCollector/DolibarrCollector.php - - - - message: "#^Method DolibarrCollector\\:\\:getAssets\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/debugbar/class/DataCollector/DolibarrCollector.php - - - - message: "#^Method DolibarrCollector\\:\\:getWidgets\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/debugbar/class/DataCollector/DolibarrCollector.php - - message: "#^Parameter \\#2 \\$resql of method TraceableDB\\:\\:endTracing\\(\\) expects string, bool\\|mysqli_result\\|resource given\\.$#" count: 1 @@ -14020,11 +13475,6 @@ parameters: count: 1 path: ../../htdocs/document.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 4 - path: ../../htdocs/don/admin/donation.php - - message: "#^Variable \\$formaccounting might not be defined\\.$#" count: 1 @@ -14045,11 +13495,6 @@ parameters: count: 1 path: ../../htdocs/don/card.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 2 - path: ../../htdocs/don/card.php - - message: "#^Variable \\$hidedesc might not be defined\\.$#" count: 1 @@ -14740,11 +14185,6 @@ parameters: count: 1 path: ../../htdocs/eventorganization/core/actions_massactions_mail.inc.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 4 - path: ../../htdocs/eventorganization/core/actions_massactions_mail.inc.php - - message: "#^Variable \\$from might not be defined\\.$#" count: 6 @@ -14805,11 +14245,6 @@ parameters: count: 2 path: ../../htdocs/expedition/card.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 17 - path: ../../htdocs/expedition/card.php - - message: "#^Variable \\$extrafields in empty\\(\\) always exists and is not falsy\\.$#" count: 2 @@ -15180,11 +14615,6 @@ parameters: count: 1 path: ../../htdocs/expedition/shipment.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 2 - path: ../../htdocs/expedition/shipment.php - - message: "#^Variable \\$newlang in empty\\(\\) always exists and is always falsy\\.$#" count: 1 @@ -15245,11 +14675,6 @@ parameters: count: 1 path: ../../htdocs/expensereport/card.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 10 - path: ../../htdocs/expensereport/card.php - - message: "#^Variable \\$fk_project might not be defined\\.$#" count: 1 @@ -15595,11 +15020,6 @@ parameters: count: 1 path: ../../htdocs/fichinter/card-rec.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 5 - path: ../../htdocs/fichinter/card-rec.php - - message: "#^Variable \\$maxlength might not be defined\\.$#" count: 1 @@ -15805,11 +15225,6 @@ parameters: count: 10 path: ../../htdocs/fourn/card.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 2 - path: ../../htdocs/fourn/card.php - - message: "#^Variable \\$num might not be defined\\.$#" count: 1 @@ -16555,16 +15970,6 @@ parameters: count: 3 path: ../../htdocs/fourn/commande/dispatch.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 3 - path: ../../htdocs/fourn/commande/dispatch.php - - - - message: "#^Variable \\$errors might not be defined\\.$#" - count: 2 - path: ../../htdocs/fourn/commande/dispatch.php - - message: "#^Variable \\$product might not be defined\\.$#" count: 2 @@ -16870,11 +16275,6 @@ parameters: count: 1 path: ../../htdocs/fourn/facture/list.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 1 - path: ../../htdocs/fourn/facture/list.php - - message: "#^Variable \\$numprlv might not be defined\\.$#" count: 1 @@ -16912,7 +16312,7 @@ parameters: - message: "#^Negated boolean expression is always true\\.$#" - count: 2 + count: 1 path: ../../htdocs/fourn/facture/paiement.php - @@ -16930,11 +16330,6 @@ parameters: count: 1 path: ../../htdocs/fourn/facture/paiement.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 1 - path: ../../htdocs/fourn/facture/paiement.php - - message: "#^Variable \\$formquestion might not be defined\\.$#" count: 1 @@ -17120,16 +16515,6 @@ parameters: count: 1 path: ../../htdocs/holiday/card.php - - - message: "#^Variable \\$errors might not be defined\\.$#" - count: 2 - path: ../../htdocs/holiday/card.php - - - - message: "#^Variable \\$formfile might not be defined\\.$#" - count: 1 - path: ../../htdocs/holiday/card.php - - message: "#^Variable \\$starthalfdaykey might not be defined\\.$#" count: 1 @@ -19720,11 +19105,6 @@ parameters: count: 1 path: ../../htdocs/opensurvey/results.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 1 - path: ../../htdocs/opensurvey/results.php - - message: "#^Variable \\$expiredate might not be defined\\.$#" count: 1 @@ -19925,11 +19305,6 @@ parameters: count: 2 path: ../../htdocs/partnership/partnership_list.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 16 - path: ../../htdocs/paybox/admin/paybox.php - - message: "#^Variable \\$form might not be defined\\.$#" count: 3 @@ -19950,11 +19325,6 @@ parameters: count: 1 path: ../../htdocs/paybox/lib/paybox.lib.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 18 - path: ../../htdocs/paypal/admin/paypal.php - - message: "#^Comparison operation \"\\<\" between \\-1 and 0 is always true\\.$#" count: 1 @@ -19970,11 +19340,6 @@ parameters: count: 3 path: ../../htdocs/printing/admin/printing.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 2 - path: ../../htdocs/printing/admin/printing.php - - message: "#^Result of \\|\\| is always true\\.$#" count: 1 @@ -20635,11 +20000,6 @@ parameters: count: 2 path: ../../htdocs/product/list.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 2 - path: ../../htdocs/product/list.php - - message: "#^Variable \\$perm might not be defined\\.$#" count: 2 @@ -20910,11 +20270,6 @@ parameters: count: 1 path: ../../htdocs/product/stats/supplier_proposal.php - - - message: "#^If condition is always false\\.$#" - count: 1 - path: ../../htdocs/product/stock/card.php - - message: "#^Variable \\$formproject might not be defined\\.$#" count: 1 @@ -20930,11 +20285,6 @@ parameters: count: 1 path: ../../htdocs/product/stock/card.php - - - message: "#^Variable \\$units might not be defined\\.$#" - count: 1 - path: ../../htdocs/product/stock/card.php - - message: "#^Method StockMovements\\:\\:index\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -21650,11 +21000,6 @@ parameters: count: 1 path: ../../htdocs/product/stock/stocktransfer/stocktransfer_contact.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 3 - path: ../../htdocs/product/stock/stocktransfer/stocktransfer_contact.php - - message: "#^Variable \\$result might not be defined\\.$#" count: 1 @@ -21760,11 +21105,6 @@ parameters: count: 1 path: ../../htdocs/projet/activity/perday.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 7 - path: ../../htdocs/projet/activity/perday.php - - message: "#^Variable \\$moreforfilter in empty\\(\\) always exists and is not falsy\\.$#" count: 1 @@ -21835,19 +21175,9 @@ parameters: count: 1 path: ../../htdocs/projet/activity/perweek.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 4 - path: ../../htdocs/projet/admin/project.php - - - - message: "#^Variable \\$obj might not be defined\\.$#" - count: 6 - path: ../../htdocs/projet/admin/project.php - - message: "#^Variable \\$res might not be defined\\.$#" - count: 2 + count: 1 path: ../../htdocs/projet/admin/project.php - @@ -21855,11 +21185,6 @@ parameters: count: 1 path: ../../htdocs/projet/admin/website.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 1 - path: ../../htdocs/projet/card.php - - message: "#^Variable \\$morecss might not be defined\\.$#" count: 1 @@ -22055,11 +21380,6 @@ parameters: count: 1 path: ../../htdocs/projet/comment.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 4 - path: ../../htdocs/projet/contact.php - - message: "#^Variable \\$formconfirmtoaddtasks might not be defined\\.$#" count: 1 @@ -22225,6 +21545,11 @@ parameters: count: 1 path: ../../htdocs/projet/list.php + - + message: "#^Negated boolean expression is always true\\.$#" + count: 1 + path: ../../htdocs/projet/list.php + - message: "#^Ternary operator condition is always false\\.$#" count: 1 @@ -22240,11 +21565,6 @@ parameters: count: 1 path: ../../htdocs/projet/list.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 1 - path: ../../htdocs/projet/list.php - - message: "#^Variable \\$groupbyfield might not be defined\\.$#" count: 2 @@ -22495,11 +21815,6 @@ parameters: count: 1 path: ../../htdocs/projet/tasks/task.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 2 - path: ../../htdocs/projet/tasks/task.php - - message: "#^Parameter \\#1 \\$hour of function dol_mktime expects int, array\\|string given\\.$#" count: 1 @@ -22545,11 +21860,6 @@ parameters: count: 2 path: ../../htdocs/projet/tasks/time.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 7 - path: ../../htdocs/projet/tasks/time.php - - message: "#^Variable \\$result might not be defined\\.$#" count: 1 @@ -22910,11 +22220,6 @@ parameters: count: 1 path: ../../htdocs/public/opensurvey/index.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 2 - path: ../../htdocs/public/opensurvey/studs.php - - message: "#^Variable \\$modifier might not be defined\\.$#" count: 1 @@ -23055,11 +22360,6 @@ parameters: count: 1 path: ../../htdocs/public/project/index.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 1 - path: ../../htdocs/public/project/index.php - - message: "#^Variable \\$suffix might not be defined\\.$#" count: 1 @@ -23110,11 +22410,6 @@ parameters: count: 1 path: ../../htdocs/public/project/suggestbooth.php - - - message: "#^Variable \\$errors might not be defined\\.$#" - count: 3 - path: ../../htdocs/public/project/suggestbooth.php - - message: "#^Variable \\$object might not be defined\\.$#" count: 1 @@ -23170,11 +22465,6 @@ parameters: count: 7 path: ../../htdocs/public/project/suggestconference.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 2 - path: ../../htdocs/public/project/viewandvote.php - - message: "#^Variable \\$suffix might not be defined\\.$#" count: 2 @@ -24580,6 +23870,11 @@ parameters: count: 2 path: ../../htdocs/salaries/payments.php + - + message: "#^Negated boolean expression is always true\\.$#" + count: 1 + path: ../../htdocs/salaries/payments.php + - message: "#^Ternary operator condition is always false\\.$#" count: 1 @@ -24590,11 +23885,6 @@ parameters: count: 1 path: ../../htdocs/salaries/payments.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 1 - path: ../../htdocs/salaries/payments.php - - message: "#^Variable \\$resql might not be defined\\.$#" count: 2 @@ -24635,11 +23925,6 @@ parameters: count: 1 path: ../../htdocs/salaries/virement_request.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 24 - path: ../../htdocs/societe/admin/societe.php - - message: "#^Variable \\$mc might not be defined\\.$#" count: 1 @@ -25210,11 +24495,6 @@ parameters: count: 1 path: ../../htdocs/stripe/admin/stripe.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 21 - path: ../../htdocs/stripe/admin/stripe.php - - message: "#^Ternary operator condition is always false\\.$#" count: 1 @@ -25475,26 +24755,11 @@ parameters: count: 1 path: ../../htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 2 - path: ../../htdocs/takepos/admin/appearance.php - - message: "#^Variable \\$dolibarr_main_url_root might not be defined\\.$#" count: 2 path: ../../htdocs/takepos/admin/bar.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 2 - path: ../../htdocs/takepos/admin/bar.php - - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 2 - path: ../../htdocs/takepos/admin/receipt.php - - message: "#^Variable \\$res might not be defined\\.$#" count: 1 @@ -25510,11 +24775,6 @@ parameters: count: 2 path: ../../htdocs/takepos/admin/terminal.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 2 - path: ../../htdocs/takepos/admin/terminal.php - - message: "#^Right side of && is always true\\.$#" count: 5 @@ -25585,11 +24845,6 @@ parameters: count: 2 path: ../../htdocs/takepos/invoice.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 5 - path: ../../htdocs/takepos/invoice.php - - message: "#^Variable \\$fk_source might not be defined\\.$#" count: 1 @@ -26195,11 +25450,6 @@ parameters: count: 1 path: ../../htdocs/ticket/contact.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 1 - path: ../../htdocs/ticket/contact.php - - message: "#^If condition is always false\\.$#" count: 1 @@ -26460,11 +25710,6 @@ parameters: count: 1 path: ../../htdocs/user/document.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 2 - path: ../../htdocs/user/group/card.php - - message: "#^Variable \\$mc might not be defined\\.$#" count: 3 @@ -26540,11 +25785,6 @@ parameters: count: 1 path: ../../htdocs/user/list.php - - - message: "#^Variable \\$error might not be defined\\.$#" - count: 2 - path: ../../htdocs/user/logout.php - - message: "#^Variable \\$contextpage in empty\\(\\) always exists and is not falsy\\.$#" count: 1 @@ -27120,41 +26360,6 @@ parameters: count: 1 path: ../../htdocs/webservices/server_user.php - - - message: "#^Method Website\\:\\:compareFichierModifie\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/website/class/website.class.php - - - - message: "#^Method Website\\:\\:componentSelectLang\\(\\) has parameter \\$languagecodes with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/website/class/website.class.php - - - - message: "#^Method Website\\:\\:fetchAll\\(\\) has parameter \\$filter with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/website/class/website.class.php - - - - message: "#^Method Website\\:\\:fetchAll\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/website/class/website.class.php - - - - message: "#^Method Website\\:\\:replaceLineUsingNum\\(\\) has parameter \\$differences with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/website/class/website.class.php - - - - message: "#^Method Website\\:\\:showDifferences\\(\\) has parameter \\$exceptNumPge with no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/website/class/website.class.php - - - - message: "#^Method Website\\:\\:showDifferences\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: ../../htdocs/website/class/website.class.php - - message: "#^Negated boolean expression is always true\\.$#" count: 2 diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index efce1e4a6d4..175f210ace3 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -132,8 +132,9 @@ if (isModEnabled('societe')) { * Actions */ +$error = 0; + if ($action == 'update') { - $error = 0; // Process $list_account_main foreach ($list_account_main as $constname) { $constvalue = GETPOST($constname, 'alpha'); diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 3971bbea212..0da31291160 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -118,14 +118,14 @@ if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { + $error = 0; + if ($cancel) { header("Location: ".DOL_URL_ROOT.'/accountancy/bookkeeping/list.php'); exit; } if ($action == "confirm_update" && $permissiontoadd) { - $error = 0; - if (((float) $debit != 0.0) && ((float) $credit != 0.0)) { $error++; setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors'); @@ -180,8 +180,6 @@ if (empty($reshook)) { } } } elseif ($action == "add" && $permissiontoadd) { - $error = 0; - if (((float) $debit != 0.0) && ((float) $credit != 0.0)) { $error++; setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors'); @@ -263,8 +261,6 @@ if (empty($reshook)) { } $action = ''; } elseif ($action == "confirm_create" && $permissiontoadd) { - $error = 0; - $object = new BookKeeping($db); if (!$journal_code || $journal_code == '-1') { diff --git a/htdocs/accountancy/class/lettering.class.php b/htdocs/accountancy/class/lettering.class.php index c2ad7f05320..923f977c544 100644 --- a/htdocs/accountancy/class/lettering.class.php +++ b/htdocs/accountancy/class/lettering.class.php @@ -2,8 +2,8 @@ /* Copyright (C) 2004-2005 Rodolphe Quiedeville * Copyright (C) 2013 Olivier Geffroy * Copyright (C) 2013-2024 Alexandre Spangaro - * Copyright (C) 2018 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index 0fab2ffd2f9..b8d8a85216c 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -84,6 +84,7 @@ if (!$user->hasRight('accounting', 'bind', 'write')) { /* * Actions */ +$error = 0; if (($action == 'clean' || $action == 'validatehistory') && $user->hasRight('accounting', 'bind', 'write')) { // Clean database by removing binding done on non existing or no more existing accounts @@ -110,7 +111,6 @@ if (($action == 'clean' || $action == 'validatehistory') && $user->hasRight('acc } if ($action == 'validatehistory' && $user->hasRight('accounting', 'bind', 'write')) { - $error = 0; $nbbinddone = 0; $nbbindfailed = 0; $notpossible = 0; diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php index e67d3e3e0b2..26fb38c0562 100644 --- a/htdocs/adherents/class/api_members.class.php +++ b/htdocs/adherents/class/api_members.class.php @@ -1,9 +1,9 @@ - * Copyright (C) 2017 Regis Houssin - * Copyright (C) 2020 Thibault FOUCART - * Copyright (C) 2020 Frédéric France - * Copyright (C) 2024 MDW +/* Copyright (C) 2016 Xebax Christy + * Copyright (C) 2017 Regis Houssin + * Copyright (C) 2020 Thibault FOUCART + * Copyright (C) 2020-2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 7bfcc4c2d79..dea345e776d 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -238,6 +238,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa $permissiontoread = 0; $permissiontodelete = 0; $permissiontoadd = 0; +$error = 0; $parameters = array('socid' => isset($socid) ? $socid : null, 'arrayfields' => &$arrayfields); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -291,7 +292,6 @@ if (empty($reshook)) { // Close if ($massaction == 'close' && $user->hasRight('adherent', 'creer')) { $tmpmember = new Adherent($db); - $error = 0; $nbclose = 0; $db->begin(); @@ -321,7 +321,6 @@ if (empty($reshook)) { // Create external user if ($massaction == 'createexternaluser' && $user->hasRight('adherent', 'creer') && $user->hasRight('user', 'user', 'creer')) { $tmpmember = new Adherent($db); - $error = 0; $nbcreated = 0; $db->begin(); @@ -358,7 +357,6 @@ if (empty($reshook)) { if ($action == 'createsubscription_confirm' && $confirm == "yes" && $user->hasRight('adherent', 'creer')) { $tmpmember = new Adherent($db); $adht = new AdherentType($db); - $error = 0; $nbcreated = 0; $now = dol_now(); $amount = price2num(GETPOST('amount', 'alpha')); diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 229c15c7217..91f105c48b8 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -134,6 +134,7 @@ $result = restrictedArea($user, 'adherent', $rowid, 'adherent_type'); /* * Actions */ +$error = 0; if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers $search_ref = ""; diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index cad5b63a1ff..c33233c4131 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -80,6 +80,7 @@ if ($resql) { /* * Actions */ +$error = 0; // Purge search criteria if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php index 6e2051337f7..484547fbcfe 100644 --- a/htdocs/admin/bom.php +++ b/htdocs/admin/bom.php @@ -58,6 +58,7 @@ $type = 'bom'; /* * Actions */ +$error = 0; include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php index ecf961da9de..a26f0f33af2 100644 --- a/htdocs/admin/chequereceipts.php +++ b/htdocs/admin/chequereceipts.php @@ -63,6 +63,7 @@ if (!getDolGlobalString('CHEQUERECEIPTS_ADDON')) { /* * Actions */ +$error = 0; if ($action == 'updateMask') { $maskconstchequereceipts = GETPOST('maskconstchequereceipts', 'aZ09'); diff --git a/htdocs/admin/delivery.php b/htdocs/admin/delivery.php index 97608479ae5..8cbc9a19cf3 100644 --- a/htdocs/admin/delivery.php +++ b/htdocs/admin/delivery.php @@ -64,6 +64,7 @@ $type = 'delivery'; /* * Actions */ +$error = 0; include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index a04ad57d880..f18c2c4b7bd 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -69,6 +69,7 @@ if (!getDolGlobalString('EXPEDITION_ADDON_NUMBER')) { /* * Actions */ +$error = 0; include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index 6020b8eb075..65434761dfb 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -64,6 +64,7 @@ $type = 'expensereport'; /* * Actions */ +$error = 0; include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index 98d1f4802af..2b94e599a2c 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -59,6 +59,7 @@ if (!$user->admin) { /* * Actions */ +$error = 0; // positionne la variable pour le nombre de rss externes $sql = "SELECT ".$db->decrypt('name')." as name FROM ".MAIN_DB_PREFIX."const"; diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index e000af68f44..1da1132f262 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -65,6 +65,7 @@ $type = 'ficheinter'; /* * Actions */ +$error = 0; include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index c9d58fd3012..d8c7cc97a76 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -64,6 +64,7 @@ if (!getDolGlobalString('HOLIDAY_ADDON')) { /* * Actions */ +$error = 0; include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index eb4d5ab0437..36b8553156e 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -53,6 +53,7 @@ $form = new Form($db); /* * Actions */ +$error = 0; if ($action == 'setvalue') { $db->begin(); diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index ae89f9fa01c..da7e77b2810 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -84,9 +84,10 @@ complete_substitutions_array($substitutionarrayfortest, $langs); /* * Actions */ +$error = 0; if ($action == 'update' && !$cancel) { - if (!$error && !GETPOST("MAIN_MAIL_EMAIL_FROM", 'alphanohtml')) { + if (!GETPOST("MAIN_MAIL_EMAIL_FROM", 'alphanohtml')) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("MAIN_MAIL_EMAIL_FROM")), null, 'errors'); $action = 'edit'; diff --git a/htdocs/admin/mrp.php b/htdocs/admin/mrp.php index a51e2d8a109..9a55acfe90f 100644 --- a/htdocs/admin/mrp.php +++ b/htdocs/admin/mrp.php @@ -59,6 +59,7 @@ $type = 'mrp'; /* * Actions */ +$error = 0; include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; diff --git a/htdocs/admin/oauthlogintokens.php b/htdocs/admin/oauthlogintokens.php index 3067b1b839a..d3eab320127 100644 --- a/htdocs/admin/oauthlogintokens.php +++ b/htdocs/admin/oauthlogintokens.php @@ -70,23 +70,20 @@ if (!$user->admin) { /* * Action */ +$error = 0; -/*if (($mode == 'test' || $mode == 'setup') && empty($driver)) -{ +/*if (($mode == 'test' || $mode == 'setup') && empty($driver)) { setEventMessages($langs->trans('PleaseSelectaDriverfromList'), null); header("Location: ".$_SERVER['PHP_SELF'].'?mode=config'); exit; }*/ if ($action == 'setconst' && $user->admin) { - $error = 0; $db->begin(); $setupconstarray = GETPOST('setupdriver', 'array'); foreach ($setupconstarray as $setupconst) { - //print '
'.print_r($setupconst, true).'
'; - $constname = dol_escape_htmltag($setupconst['varname']); $constvalue = dol_escape_htmltag($setupconst['value']); $consttype = dol_escape_htmltag($setupconst['type']); diff --git a/htdocs/admin/order.php b/htdocs/admin/order.php index fefb5763431..e2f2cac0bfe 100644 --- a/htdocs/admin/order.php +++ b/htdocs/admin/order.php @@ -67,6 +67,7 @@ $type = 'order'; /* * Actions */ +$error = 0; include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; @@ -112,8 +113,8 @@ if ($action == 'updateMask') { $module = new $classname($db); '@phan-var-force ModelePDFCommandes $module'; - /** @var ModelePDFCommandes $module */ + if ($module->write_file($commande, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=commande&file=SPECIMEN.pdf"); return; diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index 2c2db9a1ea5..c37c008ad9c 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -60,6 +60,7 @@ if (!getDolGlobalString('PAYMENT_ADDON')) { /* * Actions */ +$error = 0; if ($action == 'updateMask') { $maskconstpayment = GETPOST('maskconstpayment', 'aZ09'); diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php index 115f615aff2..419a8b96384 100644 --- a/htdocs/admin/paymentbybanktransfer.php +++ b/htdocs/admin/paymentbybanktransfer.php @@ -55,6 +55,7 @@ $type = 'paymentorder'; /* * Actions */ +$error = 0; if ($action == "set") { $db->begin(); diff --git a/htdocs/admin/proxy.php b/htdocs/admin/proxy.php index 8fbb28c5d9b..fc330d6d4b1 100644 --- a/htdocs/admin/proxy.php +++ b/htdocs/admin/proxy.php @@ -49,6 +49,7 @@ $upload_dir = $conf->admin->dir_temp; /* * Actions */ +$error = 0; if (GETPOST('action', 'aZ09') == 'set_proxy') { if (GETPOST("MAIN_USE_CONNECT_TIMEOUT") && !is_numeric(GETPOST("MAIN_USE_CONNECT_TIMEOUT"))) { diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php index f65d9bb2b81..88dc292538b 100644 --- a/htdocs/admin/reception_setup.php +++ b/htdocs/admin/reception_setup.php @@ -72,6 +72,7 @@ if (!getDolGlobalString('RECEPTION_ADDON_NUMBER')) { /* * Actions */ +$error = 0; include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; diff --git a/htdocs/admin/security_captcha.php b/htdocs/admin/security_captcha.php index c73631f5e74..5cf9abc5506 100644 --- a/htdocs/admin/security_captcha.php +++ b/htdocs/admin/security_captcha.php @@ -91,7 +91,7 @@ print load_fiche_titre($langs->trans("SecuritySetup"), '', 'title_setup'); print ''.$langs->trans("CaptchaDesc")."
\n"; print "
\n"; -$dirModCaptcha = array_merge(array('/core/modules/security/captcha/'), is_array($conf->modules_parts['captcha']) ? $conf->modules_parts['captcha'] : array()); +$dirModCaptcha = array_merge(array('/core/modules/security/captcha/'), (isset($conf->modules_parts['captcha']) && is_array($conf->modules_parts['captcha'])) ? $conf->modules_parts['captcha'] : array()); // Load array with all captcha generation modules $arrayhandler = array(); @@ -112,6 +112,7 @@ foreach ($dirModCaptcha as $dirroot) { $obj = new $classname($db, $conf, $langs, $user); '@phan-var-force ModeleCaptcha $obj'; + /** @var ModeleCaptcha $obj */ $arrayhandler[$obj->id] = $obj; $i++; } diff --git a/htdocs/admin/spip.php b/htdocs/admin/spip.php index 10131c2e6e6..e7185a55077 100644 --- a/htdocs/admin/spip.php +++ b/htdocs/admin/spip.php @@ -57,6 +57,7 @@ $action = GETPOST('action', 'aZ09'); /* * Actions */ +$error = 0; // Action mise a jour ou ajout d'une constante if ($action == 'update' || $action == 'add') { diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 9fe80cd634a..258fd52e511 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -59,6 +59,8 @@ $type = 'stock'; /* * Action */ +$error = 0; + include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; $reg = array(); diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index ae71822a2d0..045c32ef64a 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -85,6 +85,7 @@ $hookmanager->initHooks(array('admintranslation', 'globaladmin')); /* * Actions */ +$error = 0; if (GETPOST('cancel', 'alpha')) { $action = 'list'; diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index f84483ffd0f..52275a3f80b 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -139,6 +139,7 @@ if (!$user->admin) { /* * Actions */ +$error = 0; // Actions add or modify a website if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { diff --git a/htdocs/barcode/codeinit.php b/htdocs/barcode/codeinit.php index da30fc709cf..ebc528a553c 100644 --- a/htdocs/barcode/codeinit.php +++ b/htdocs/barcode/codeinit.php @@ -75,6 +75,7 @@ if (empty($user->admin)) { /* * Actions */ +$error = 0; // Define barcode template for third-party if (getDolGlobalString('BARCODE_THIRDPARTY_ADDON_NUM')) { diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index c37145e05cd..860a2c29552 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -41,6 +41,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; * @var HookManager $hookmanager * @var Translate $langs * @var User $user + * + * @var string $dolibarr_main_db_name */ // Load translation files required by the page diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 14324a9dd31..210a26bb9b1 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -148,6 +148,7 @@ $result = restrictedArea($user, 'bom'); /* * Actions */ +$error = 0; if (GETPOST('cancel', 'alpha')) { $action = 'list'; @@ -194,7 +195,7 @@ if (empty($reshook)) { // Validate records - if (!$error && $massaction == 'disable' && $permissiontoadd) { + if ($massaction == 'disable' && $permissiontoadd) { $objecttmp = new $objectclass($db); if (!$error) { @@ -277,7 +278,6 @@ if (empty($reshook)) { } else { $db->rollback(); } - //var_dump($listofobjectthirdparties);exit; } } } diff --git a/htdocs/bookcal/availabilities_card.php b/htdocs/bookcal/availabilities_card.php index 5c23ea24b57..e25dfbf5428 100644 --- a/htdocs/bookcal/availabilities_card.php +++ b/htdocs/bookcal/availabilities_card.php @@ -119,13 +119,10 @@ if (!$permissiontoread) { } - - - - /* * Actions */ +$error = 0; $parameters = array(); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -134,8 +131,6 @@ if ($reshook < 0) { } if (empty($reshook)) { - $error = 0; - $backurlforlist = dol_buildpath('/bookcal/availabilities_list.php', 1); if (empty($backtopage) || ($cancel && empty($id))) { @@ -150,7 +145,6 @@ if (empty($reshook)) { $triggermodname = 'BOOKCAL_AVAILABILITIES_MODIFY'; // Name of trigger action code to execute when we modify record - $startday = GETPOST('startday', 'int'); $startmonth = GETPOST('startmonth', 'int'); $startyear = GETPOST('startyear', 'int'); @@ -236,22 +230,6 @@ $title = $langs->trans("Availabilities"); $help_url = ''; llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-bookcal page-card_availabilities'); -// Example : Adding jquery code -// print ''; - - // Part to create if ($action == 'create') { if (empty($permissiontoadd)) { diff --git a/htdocs/bookmarks/admin/bookmark.php b/htdocs/bookmarks/admin/bookmark.php index 594de6c41e0..3c2506972e0 100644 --- a/htdocs/bookmarks/admin/bookmark.php +++ b/htdocs/bookmarks/admin/bookmark.php @@ -44,6 +44,11 @@ if (!$user->admin) { $action = GETPOST('action', 'aZ09'); +/* + * Actions + */ +$error = 0; + if ($action == 'setvalue') { $showmenu = GETPOST('BOOKMARKS_SHOW_IN_MENU', 'alpha'); $res = dolibarr_set_const($db, "BOOKMARKS_SHOW_IN_MENU", $showmenu, 'chaine', 0, '', $conf->entity); diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 766b1876f16..bf25225e64b 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -163,6 +163,7 @@ $result = restrictedArea($user, 'societe', $object->id, '&societe', '', 'fk_soc' /* * Actions */ +$error = 0; $parameters = array('id' => $id, 'socid' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index c2230abdea6..0e9b5bbbaf1 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -329,6 +329,9 @@ llxHeader('', $langs->trans("Mailing"), 'EN:Module_EMailing|FR:Module_Mailing|ES $form = new Form($db); $formmailing = new FormMailing($db); $arrayofselected = is_array($toselect) ? $toselect : array(); +$totalarray = [ + 'nbfield' => 0, +]; if ($object->fetch($id) >= 0) { $head = emailing_prepare_head($object); @@ -380,8 +383,7 @@ if ($object->fetch($id) >= 0) { print dol_print_email($object->email_from, 0, 0, 0, 0, 1); } } - //print dol_print_email($object->email_from, 0, 0, 0, 0, 1); - //var_dump($object->email_from); + print ''; // Errors to @@ -799,6 +801,7 @@ if ($object->fetch($id) >= 0) { print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("ConfirmResetMailingTargetMassaction"), $langs->trans("ConfirmResetMailingTargetMassactionQuestion"), "confirm_reset_target", null, '', 0, 0, 500, 1); } + $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 9d099aa4a2b..15c918aca8b 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -52,6 +52,7 @@ $lineid = GETPOSTINT('lineid'); $action = GETPOST('action', 'aZ09'); $object = new Propal($db); +$error = 0; // Load object if ($id > 0 || !empty($ref)) { diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 6d2b714ed17..dd089bb36bc 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -319,6 +319,7 @@ if (getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) { /* * Actions */ +$error = 0; if (GETPOST('cancel', 'alpha')) { $action = 'list'; @@ -424,10 +425,9 @@ if ($action == 'validate' && $permissiontovalidate) { if (GETPOST('confirm') == 'yes') { $tmpproposal = new Propal($db); $db->begin(); - $error = 0; foreach ($toselect as $checked) { if ($tmpproposal->fetch($checked) > 0) { - if ($tmpproposal->statut == $tmpproposal::STATUS_DRAFT) { + if ($tmpproposal->status == $tmpproposal::STATUS_DRAFT) { if ($tmpproposal->valid($user) > 0) { setEventMessages($langs->trans('hasBeenValidated', $tmpproposal->ref), null, 'mesgs'); } else { @@ -456,11 +456,10 @@ if ($action == "sign" && $permissiontoclose) { if (GETPOST('confirm') == 'yes') { $tmpproposal = new Propal($db); $db->begin(); - $error = 0; foreach ($toselect as $checked) { if ($tmpproposal->fetch($checked) > 0) { - if ($tmpproposal->statut == $tmpproposal::STATUS_VALIDATED) { - $tmpproposal->statut = $tmpproposal::STATUS_SIGNED; + if ($tmpproposal->status == $tmpproposal::STATUS_VALIDATED) { + $tmpproposal->status = $tmpproposal::STATUS_SIGNED; if ($tmpproposal->closeProposal($user, $tmpproposal::STATUS_SIGNED) >= 0) { setEventMessages($tmpproposal->ref." ".$langs->trans('Signed'), null, 'mesgs'); } else { @@ -488,11 +487,10 @@ if ($action == "nosign" && $permissiontoclose) { if (GETPOST('confirm') == 'yes') { $tmpproposal = new Propal($db); $db->begin(); - $error = 0; foreach ($toselect as $checked) { if ($tmpproposal->fetch($checked) > 0) { - if ($tmpproposal->statut == $tmpproposal::STATUS_VALIDATED || (getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE') && $tmpproposal->statut == $tmpproposal::STATUS_DRAFT)) { - $tmpproposal->statut = $tmpproposal::STATUS_NOTSIGNED; + if ($tmpproposal->status == $tmpproposal::STATUS_VALIDATED || (getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE') && $tmpproposal->statut == $tmpproposal::STATUS_DRAFT)) { + $tmpproposal->status = $tmpproposal::STATUS_NOTSIGNED; if ($tmpproposal->closeProposal($user, $tmpproposal::STATUS_NOTSIGNED) > 0) { setEventMessage($tmpproposal->ref." ".$langs->trans('NoSigned'), 'mesgs'); } else { diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index d5247e9d39c..8299965fc17 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -74,6 +74,7 @@ if (!$year_start) { /* * View */ +$error = 0; $form = new Form($db); diff --git a/htdocs/compta/bank/line.php b/htdocs/compta/bank/line.php index a7d0971ed3f..d2334d377d0 100644 --- a/htdocs/compta/bank/line.php +++ b/htdocs/compta/bank/line.php @@ -97,6 +97,7 @@ $extrafields->fetch_name_optionals_label($object->element); /* * Actions */ +$error = 0; $parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -138,8 +139,6 @@ if ($action == 'confirm_delete_categ' && $confirm == "yes" && $user->hasRight('b } if ($user->hasRight('banque', 'modifier') && $action == "update") { - $error = 0; - $result = $object->fetch($rowid); if ($result <= 0) { dol_syslog('Failed to read bank line with id '.$rowid, LOG_WARNING); // This happens due to old bug that has set fk_account to null. diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index 09ad860ef41..89675f57f08 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -117,6 +117,7 @@ $permissiontodelete = ($user->hasRight("cashdesk", "run") || $user->hasRight("ta /* * Actions */ +$error = 0; if (empty($backtopage)) { $backtopage = DOL_URL_ROOT.'/compta/cashcontrol/cashcontrol_card.php?id='.(!empty($id) && $id > 0 ? $id : '__ID__'); @@ -147,7 +148,6 @@ if ($action == "reopen" && $permissiontoadd) { } if ($action == "start" && $permissiontoadd) { - $error = 0; if (!GETPOST('posmodule', 'alpha') || GETPOST('posmodule', 'alpha') == '-1') { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Module")), null, 'errors'); $action = 'create'; @@ -169,7 +169,6 @@ if ($action == "start" && $permissiontoadd) { $action = 'start'; $error++; } - $error = 0; foreach ($arrayofpaymentmode as $key => $val) { $object->$key = (float) price2num(GETPOST($key.'_amount', 'alpha')); } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 366afb61c4b..a3db802de3a 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -200,6 +200,7 @@ $result = restrictedArea($user, 'facture', $object->id, '', '', 'fk_soc', 'rowid /* * Actions */ +$error = 0; $parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -523,8 +524,6 @@ if (empty($reshook)) { $object->cond_reglement_code = 0; // To clean property $object->cond_reglement_id = 0; // To clean property - $error = 0; - $db->begin(); if (!$error) { @@ -1060,7 +1059,6 @@ if (empty($reshook)) { $db->begin(); - $error = 0; $originentity = GETPOSTINT('originentity'); // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost(null, $object); diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 6f65283d69c..941a3813fe9 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -12,7 +12,7 @@ * Copyright (C) 2023 Lenin Rivas * Copyright (C) 2023 Sylvain Legrand * Copyright (C) 2023 William Mead - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -98,6 +98,7 @@ $result = restrictedArea($user, 'facture', $object->id, '', '', 'fk_soc', $field /* * Actions */ +$error = 0; $parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -107,8 +108,6 @@ if ($reshook < 0) { if (empty($reshook)) { if (($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm == 'yes')) && $usercanissuepayment) { - $error = 0; - $datepaye = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); $paiement_id = 0; $totalpayment = 0; @@ -223,8 +222,6 @@ if (empty($reshook)) { * Action confirm_paiement */ if ($action == 'confirm_paiement' && $confirm == 'yes' && $usercanissuepayment) { - $error = 0; - $datepaye = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzuser'); $db->begin(); diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 30ef36430a0..55222f6c4cd 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1089,11 +1089,11 @@ class BonPrelevement extends CommonObject $error = 0; // Pre-store some values into variables to simplify following sql requests if ($sourcetype != 'salary') { - $entity = $type != 'bank-transfer' ? getEntity('invoice') : getEntity('supplier_invoice'); + $entities = $type != 'bank-transfer' ? getEntity('invoice') : getEntity('supplier_invoice'); $socOrUser = 'fk_soc'; $societeOrUser = 'societe'; } else { - $entity = getEntity('salary'); + $entities = getEntity('salary'); $sqlTable = 'salary'; $socOrUser = 'fk_user'; $societeOrUser = 'user'; @@ -1173,7 +1173,7 @@ class BonPrelevement extends CommonObject // TODO Add 'AND sr.default_rib = 1' in sourcetype salary too Note: the column has been created in v21 in llx_user_rib and default to 0 // If we add a test on sr.default_rib = 1, we must also check we have a correct error management to stop if no default BAN is found. } - $sql .= " WHERE f.entity IN (".((int) $entity).')'; + $sql .= " WHERE f.entity IN (".$this->db->escape($entities).')'; if ($sourcetype != 'salary') { $sql .= " AND f.fk_statut = 1"; // Invoice validated $sql .= " AND f.paye = 0"; diff --git a/htdocs/compta/prelevement/orders_list.php b/htdocs/compta/prelevement/orders_list.php index b9e61e9a11d..5bc7721acd7 100644 --- a/htdocs/compta/prelevement/orders_list.php +++ b/htdocs/compta/prelevement/orders_list.php @@ -103,6 +103,7 @@ if ($type == 'bank-transfer') { /* * Actions */ +$error = 0; if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers $search_ref = ""; diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 8fb5b654a62..a69eb15fbf5 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -74,7 +74,7 @@ $hidedetails = isset($hidedetails) ? $hidedetails : ''; $hidedesc = isset($hidedesc) ? $hidedesc : ''; $hideref = isset($hideref) ? $hideref : ''; - +$error = 0; if (!empty($permissionedit) && empty($permissiontoadd)) { $permissiontoadd = $permissionedit; // For backward compatibility diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index 9c24f117591..b0de8759a93 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -56,6 +56,7 @@ if ((GETPOST('sendit', 'alpha') die; } +$error = 0; // Submit file/link if (GETPOST('sendit', 'alpha') && getDolGlobalString('MAIN_UPLOAD_DOC') && !empty($permissiontoadd)) { diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 6712c76b077..77e8bcf5240 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -56,6 +56,7 @@ * @var ?string $option * @var ?int $deliveryreceipt * @var string $massaction + * @var string $objectclass * @var string $uploaddir * @var string $confirm */ @@ -711,7 +712,7 @@ if (!$error && $massaction == 'confirm_presend') { // End call triggers if ($error) { - setEventMessages($db->lasterror(), $errors, 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); dol_syslog("Error in trigger ".$triggername.' '.$db->lasterror(), LOG_ERR); } } diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 541bc8f9995..f6f812d86b0 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -35,6 +35,7 @@ * @var CommonObject $object * @var Conf $conf * @var DoliDB $db + * @var HookManager $hookmanager * @var Societe $mysoc * @var Translate $langs * @@ -47,6 +48,8 @@ @phan-var-force CommonObject $object '; +$error = 0; + /* * Add file in email form */ diff --git a/htdocs/core/actions_setmoduleoptions.inc.php b/htdocs/core/actions_setmoduleoptions.inc.php index 39b2826e712..a749cf1da98 100644 --- a/htdocs/core/actions_setmoduleoptions.inc.php +++ b/htdocs/core/actions_setmoduleoptions.inc.php @@ -28,7 +28,13 @@ // $nomessageinupdate can be set to 1 // $nomessageinsetmoduleoptions can be set to 1 // $formSetup may be defined - +/** + * @var FormSetup $formSetup + * @var string $action + * @var int $error + * @var ?int $nomessageinupdate + * @var ?int $nomessageinsetmoduleoptions + */ if ($action == 'update' && !empty($formSetup) && is_object($formSetup) && !empty($user->admin)) { $formSetup->saveConfFromPost(); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 4d6019847c7..8bd1a38431a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8488,7 +8488,7 @@ class Form return 'selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc; } '@phan-var-force CommonObject $objecttmp'; - + /** @var CommonObject $objecttmp */ //var_dump($filter); $prefixforautocompletemode = $objecttmp->element; if ($prefixforautocompletemode == 'societe') { diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 0e754811b6c..28a507aa324 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2189,6 +2189,7 @@ function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uplo $textforfulltextindex = ''; $keywords = ''; + $cmd = 'unknown'; if (preg_match('/\.pdf/i', $filename)) { // TODO Move this into external submodule files diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 814c741090f..b96ad5f8bdd 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -287,7 +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'; + '@phan-var-force Website $website'; $nbrep = 0; @@ -519,7 +519,7 @@ function dolWebsiteSaveContent($content) function redirectToContainer($containerref, $containeraliasalt = '', $containerid = 0, $permanent = 0, $parameters = array()) { global $db, $website; - '@phan-var-force WebSite $website'; + '@phan-var-force Website $website'; $newurl = ''; $result = 0; @@ -604,7 +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'; + '@phan-var-force Website $website'; $MAXLEVEL = 20; @@ -660,7 +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'; + '@phan-var-force Website $website'; $type = strtolower($type); @@ -868,7 +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'; + '@phan-var-force Website $website'; $out = ''; @@ -944,7 +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'; + '@phan-var-force Website $website'; $out = ''."\n"; @@ -1172,7 +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'; + '@phan-var-force Website $website'; $error = 0; $arrayresult = array('code' => '', 'list' => array()); diff --git a/htdocs/core/modules/security/captcha/modCaptchaStandard.class.php b/htdocs/core/modules/security/captcha/modCaptchaStandard.class.php index 7d5e4fd3929..6b22ec7c1da 100644 --- a/htdocs/core/modules/security/captcha/modCaptchaStandard.class.php +++ b/htdocs/core/modules/security/captcha/modCaptchaStandard.class.php @@ -133,19 +133,19 @@ class modCaptchaStandard extends ModeleCaptcha function submitFormFromCaptcha(event) { console.log("submitFormFromCaptcha"); - // Prevent the default action of the link - event.preventDefault(); - // Search the form + // Prevent the default action of the link + event.preventDefault(); + // Search the form const form = event.target.closest("form"); - // Submit the form if found - if (form) { + // Submit the form if found + if (form) { console.log("we set actionlogin to value \"disabled\""); document.getElementById("actionlogin").value = "disabled"; - form.submit(); - } - } + form.submit(); + } + } '."\n"; @@ -164,7 +164,7 @@ class modCaptchaStandard extends ModeleCaptcha { $sessionkey = 'dol_antispam_value'; // The same key than set into the /core/antispamimage.php file. - $ok = (array_key_exists($sessionkey, $_SESSION) && (strtolower($_SESSION[$sessionkey]) === strtolower(GETPOST('code', 'restricthtml')))); + $ok = (array_key_exists($sessionkey, $_SESSION) && (strtolower($_SESSION[$sessionkey]) === strtolower(GETPOST('code', 'restricthtml')))) ? 1 : 0; return $ok; } diff --git a/htdocs/core/tpl/extrafields_add.tpl.php b/htdocs/core/tpl/extrafields_add.tpl.php index a36a948f9dc..a4000c2fa4d 100644 --- a/htdocs/core/tpl/extrafields_add.tpl.php +++ b/htdocs/core/tpl/extrafields_add.tpl.php @@ -1,6 +1,7 @@ * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,6 +31,7 @@ * @var Conf $conf * @var DoliDB $db * @var ExtraFields $extrafields + * @var HookManager $hookmanager * @var Translate $langs * * @var Societe $thirdpartytopropagateextrafieldsfrom diff --git a/htdocs/core/tpl/extrafields_edit.tpl.php b/htdocs/core/tpl/extrafields_edit.tpl.php index a5f50b9132b..2a623a3ba84 100644 --- a/htdocs/core/tpl/extrafields_edit.tpl.php +++ b/htdocs/core/tpl/extrafields_edit.tpl.php @@ -1,6 +1,7 @@ * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,6 +27,8 @@ /** * @var CommonObject $object * @var Conf $conf + * @var ExtraFields $extrafields + * @var HookManager $hookmanager * @var Translate $langs * @var string $action * @var array $parameters diff --git a/htdocs/core/tpl/filemanager.tpl.php b/htdocs/core/tpl/filemanager.tpl.php index c3a05ab76bb..7f46d5e76cc 100644 --- a/htdocs/core/tpl/filemanager.tpl.php +++ b/htdocs/core/tpl/filemanager.tpl.php @@ -27,6 +27,7 @@ * @var HookManager $hookmanager * @var Translate $langs * @var User $user + * @var Website $website */ // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { @@ -49,11 +50,13 @@ if (empty($module)) { $module = 'ecm'; } -'@phan-var-force WebSite $website'; +'@phan-var-force Website $website'; $permtoadd = 0; $permtoupload = 0; $showroot = 0; +$error = 0; + if ($module == 'ecm') { $permtoadd = $user->hasRight("ecm", "setup"); $permtoupload = $user->hasRight("ecm", "upload"); diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 71dd2eb8396..ff1b423e2d8 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -44,6 +44,7 @@ * @var CommonObject $object * @var CommonObject $this * @var CommonObjectLine $line + * @var Conf $conf * @var HookManager $hookmanager * @var ?Product $product_static * @var Societe $mysoc diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 31b60c2434b..79cd9af8ae9 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -109,6 +109,7 @@ $permissiontoexecute = $user->hasRight('cron', 'execute'); /* * Actions */ +$error = 0; if (GETPOST('cancel', 'alpha')) { $action = 'list'; diff --git a/htdocs/datapolicy/admin/setup.php b/htdocs/datapolicy/admin/setup.php index 4f64da642ae..52b02c108f1 100644 --- a/htdocs/datapolicy/admin/setup.php +++ b/htdocs/datapolicy/admin/setup.php @@ -100,6 +100,7 @@ if (!$user->admin) { */ $nbdone = 0; +$error = 0; foreach ($arrayofparameters as $title => $tab) { foreach ($tab as $key => $val) { diff --git a/htdocs/don/admin/donation.php b/htdocs/don/admin/donation.php index 0ea8dc4a789..ca4e3c0ec36 100644 --- a/htdocs/don/admin/donation.php +++ b/htdocs/don/admin/donation.php @@ -62,6 +62,7 @@ $type = 'donation'; /* * Action */ +$error = 0; if ($action == 'specimen') { $modele = GETPOST('module', 'alpha'); diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 344c9813d81..06d7212fadf 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -105,6 +105,8 @@ $permissiontodelete = $user->hasRight('don', 'supprimer'); * Actions */ +$error = 0; + $parameters = array(); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some @@ -180,8 +182,6 @@ if (empty($reshook)) { exit; } - $error = 0; - if (empty($donation_date)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); $action = "create"; @@ -235,8 +235,6 @@ if (empty($reshook)) { exit; } - $error = 0; - if (isModEnabled("societe") && getDolGlobalString('DONATION_USE_THIRDPARTIES') && !(GETPOSTINT("socid") > 0)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ThirdParty")), null, 'errors'); $action = "create"; diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index 3fcde4ff22c..6f92db937c3 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -97,7 +97,7 @@ class EcmFiles extends CommonObject public $keywords; /** - * @var string content + * @var ?string content */ public $content; diff --git a/htdocs/eventorganization/core/actions_massactions_mail.inc.php b/htdocs/eventorganization/core/actions_massactions_mail.inc.php index 7e9c7b2a076..9763b38df4a 100644 --- a/htdocs/eventorganization/core/actions_massactions_mail.inc.php +++ b/htdocs/eventorganization/core/actions_massactions_mail.inc.php @@ -62,6 +62,8 @@ if (empty($objectclass) || empty($uploaddir)) { @phan-var-force array $parameters '; +$error = 0; + // Mass actions. Controls on number of lines checked. $maxformassaction = (!getDolGlobalString('MAIN_LIMIT_FOR_MASS_ACTIONS') ? 1000 : $conf->global->MAIN_LIMIT_FOR_MASS_ACTIONS); if (!empty($massaction) && is_array($toselect) && count($toselect) < 1) { diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 6f9192808ad..daef9ea49f1 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -144,7 +144,7 @@ $typeobject = null; /* * Actions */ - +$error = 0; $parameters = array(); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -240,8 +240,6 @@ if (empty($reshook)) { // Create shipment if ($action == 'add' && $permissiontoadd) { - $error = 0; - $db->begin(); $object->note = GETPOST('note', 'restricthtml'); diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index db17bc6d43a..89930ef944c 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -102,7 +102,7 @@ $permissiondellink = $user->hasRight('expedition', 'creer'); // Used by the incl /* * Actions */ - +$error = 0; $parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 1fa27d33f34..f24bc7d9d9a 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -169,6 +169,8 @@ $permissiontoadd = $user->hasRight('expensereport', 'creer'); // Used by the inc /* * Actions */ +$error = 0; + $value_unit_ht = price2num(GETPOST('value_unit_ht', 'alpha'), 'MU'); $value_unit = price2num(GETPOST('value_unit', 'alpha'), 'MU'); $qty = price2num(GETPOST('qty', 'alpha')); @@ -265,8 +267,6 @@ if (empty($reshook)) { } if ($action == 'add' && $permissiontoadd) { - $error = 0; - $object = new ExpenseReport($db); $object->date_debut = $date_start; @@ -387,8 +387,6 @@ if (empty($reshook)) { } if ($action == "confirm_validate" && GETPOST("confirm", 'alpha') == "yes" && $id > 0 && $permissiontoadd) { - $error = 0; - $db->begin(); $object = new ExpenseReport($db); @@ -1128,8 +1126,6 @@ if (empty($reshook)) { } if ($action == "addline" && $user->hasRight('expensereport', 'creer')) { - $error = 0; - // First save uploaded file $fk_ecm_files = 0; if (GETPOSTISSET('attachfile')) { diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index b31f3efcb20..0a0c187ebd9 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -126,9 +126,9 @@ $permissiontodelete = $user->hasRight('ficheinter', 'supprimer'); /* * Actions */ +$error = 0; if ($cancel) { - /*var_dump($cancel);var_dump($backtopage);var_dump($backtopageforcancel);exit;*/ if (!empty($backtopageforcancel)) { header("Location: ".$backtopageforcancel); exit; diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index b1486b6a516..a32dd6ef1c3 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -105,7 +105,7 @@ if ($object->id > 0) { /* * Action */ - +$error = 0; $parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 992c9d9fdb7..f795369446c 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -111,13 +111,15 @@ if (!isModEnabled('stock')) { } $usercancreate = ($user->hasRight("fournisseur", "commande", "creer") || $user->hasRight("supplier_order", "creer")); -$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php +$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php /* * Actions */ +$error = 0; +$errors = []; $parameters = array(); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -125,7 +127,6 @@ if ($reshook < 0) { } if ($action == 'checkdispatchline' && $permissiontocontrol) { - $error = 0; $supplierorderdispatch = new CommandeFournisseurDispatch($db); $db->begin(); @@ -162,7 +163,6 @@ if ($action == 'checkdispatchline' && $permissiontocontrol) { } if ($action == 'uncheckdispatchline' && $permissiontocontrol) { - $error = 0; $supplierorderdispatch = new CommandeFournisseurDispatch($db); $db->begin(); @@ -198,7 +198,6 @@ if ($action == 'uncheckdispatchline' && $permissiontocontrol) { } if ($action == 'denydispatchline' && $permissiontocontrol) { - $error = 0; $supplierorderdispatch = new CommandeFournisseurDispatch($db); $db->begin(); @@ -235,7 +234,6 @@ if ($action == 'denydispatchline' && $permissiontocontrol) { $saveprice = "savepriceIsNotSet"; if ($action == 'dispatch' && $permissiontoreceive) { - $error = 0; $notrigger = 0; $db->begin(); @@ -461,7 +459,7 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && $permissiontoreceive } if ($error > 0) { $db->rollback(); - setEventMessages($error, $errors, 'errors'); + setEventMessages(null, $errors, 'errors'); } else { $db->commit(); } @@ -470,7 +468,6 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && $permissiontoreceive // Update a dispatched line if ($action == 'updateline' && $permissiontoreceive && empty($cancel)) { $db->begin(); - $error = 0; $supplierorderdispatch = new CommandeFournisseurDispatch($db); $result = $supplierorderdispatch->fetch($lineid); diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 8fc931eb42f..ddcc72864ca 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -248,7 +248,7 @@ $permissiontodelete = ($user->hasRight("fournisseur", "facture", "supprimer") || /* * Actions */ - +$error = 0; if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index d0f645585d1..f02cb35d18e 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -124,6 +124,7 @@ $permissiontoadd = ($user->hasRight("fournisseur", "facture", "creer") || $user- /* * Actions */ +$error = 0; if ($cancel) { if (!empty($backtopageforcancel)) { @@ -158,8 +159,6 @@ if ($reshook < 0) { if (empty($reshook)) { if (($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm == 'yes')) && $permissiontoadd) { - $error = 0; - $datepaye = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); $paiement_id = 0; $totalpayment = 0; @@ -277,8 +276,6 @@ if (empty($reshook)) { * Action confirm_paiement */ if ($action == 'confirm_paiement' && $confirm == 'yes') { - $error = 0; - $datepaye = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); $multicurrency_code = array(); diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 0adcba01961..95bb39f7f3f 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -67,6 +67,7 @@ $socid = GETPOSTINT('socid'); $langs->loadLangs(array("other", "holiday", "mails", "trips")); $error = 0; +$errors = []; $now = dol_now(); @@ -973,6 +974,7 @@ if (empty($reshook)) { */ $form = new Form($db); +$formfile = new FormFile($db); $object = new Holiday($db); $listhalfday = array('morning'=>$langs->trans("Morning"), "afternoon"=>$langs->trans("Afternoon")); @@ -1021,7 +1023,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { break; } - setEventMessages($errors, null, 'errors'); + setEventMessages(null, $errors, 'errors'); } @@ -1029,9 +1031,9 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { $( document ).ready(function() { $("input.button-save").click("submit", function(e) { console.log("Call valider()"); - if (document.demandeCP.date_debut_.value != "") - { - if(document.demandeCP.date_fin_.value != "") + if (document.demandeCP.date_debut_.value != "") + { + if(document.demandeCP.date_fin_.value != "") { if(document.demandeCP.valideur.value != "-1") { return true; @@ -1052,7 +1054,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { alert("'.dol_escape_js($langs->transnoentities('NoDateDebut')).'"); return false; } - }); + }); }); '."\n"; @@ -1275,7 +1277,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { break; } - setEventMessages($errors, null, 'errors'); + setEventMessages(null, $errors, 'errors'); } // check if the user has the right to read this request diff --git a/htdocs/langs/en_US/ecm.lang b/htdocs/langs/en_US/ecm.lang index 3e87f385577..079d35b4aab 100644 --- a/htdocs/langs/en_US/ecm.lang +++ b/htdocs/langs/en_US/ecm.lang @@ -57,3 +57,4 @@ ECMParentDirectory=Parent directory ShowFile=Show file FullPathOrig=Full path origin GenOrUpload=File origin +FileHasAnIndexedTextContent=File has an indexed text content diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index d268eb03cc9..fba4a2f12cb 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -5273,7 +5273,7 @@ if ($module == 'initmodule') { // Search all files of modules mentioned by menu $listODifferentUrlsInMenu = array(); foreach ($menus as $obj) { - if (preg_match('/^\/'.preg_quote(strtolower($module), '/').'\//', $obj['url'])) { + if (preg_match('/^\/'.preg_quote(strtolower($module), '/').'\//', $obj['url']) && !empty($pathoffile)) { if (!empty($listODifferentUrlsInMenu[$pathoffile])) { // Test to avoid to show same file twice. continue; } diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index 07f8afb890a..bb50018291b 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -60,6 +60,7 @@ $nblines = $object->fetch_lines(); /* * Actions */ +$error = 0; // Return to the results if (GETPOST('cancel')) { diff --git a/htdocs/paybox/admin/paybox.php b/htdocs/paybox/admin/paybox.php index 19223d67b7c..e034234e944 100644 --- a/htdocs/paybox/admin/paybox.php +++ b/htdocs/paybox/admin/paybox.php @@ -1,7 +1,7 @@ - * Copyright (C) 2005-2010 Laurent Destailleur - * Copyright (C) 2011-2012 Juanjo Menent +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2005-2010 Laurent Destailleur + * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -48,7 +48,7 @@ if (!$user->admin) { } $action = GETPOST('action', 'aZ09'); - +$error = 0; if ($action == 'setvalue' && $user->admin) { $db->begin(); diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index 129b6aa211b..22a53c5d1ef 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -51,6 +51,7 @@ if (!$user->admin) { } $action = GETPOST('action', 'aZ09'); +$error = 0; if ($action == 'setvalue' && $user->admin) { $db->begin(); diff --git a/htdocs/printing/admin/printing.php b/htdocs/printing/admin/printing.php index 1cb2017b487..d1b5583f5f4 100644 --- a/htdocs/printing/admin/printing.php +++ b/htdocs/printing/admin/printing.php @@ -67,6 +67,7 @@ if (!$user->admin) { /* * Action */ +$error = 0; if (($mode == 'test' || $mode == 'setup') && empty($driver)) { setEventMessages($langs->trans('PleaseSelectaDriverfromList'), null); @@ -75,7 +76,6 @@ if (($mode == 'test' || $mode == 'setup') && empty($driver)) { } if ($action == 'setconst' && $user->admin) { - $error = 0; $db->begin(); foreach ($_POST['setupdriver'] as $setupconst) { '@phan-var-force array $setupconst'; diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 28a9d723ad5..0f7d57db40c 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -316,7 +316,6 @@ if (getDolGlobalString('PRODUIT_MULTIPRICES')) { } } -//var_dump($arraypricelevel); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; @@ -337,6 +336,7 @@ if ($search_type == '0') { /* * Actions */ +$error = 0; if (GETPOST('cancel', 'alpha')) { $action = 'list'; @@ -407,7 +407,7 @@ if (empty($reshook)) { $uploaddir = $conf->product->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; - if (!$error && $massaction == 'switchonsalestatus' && $permissiontoadd) { + if ($massaction == 'switchonsalestatus' && $permissiontoadd) { $product = new Product($db); foreach ($toselect as $toselectid) { $result = $product->fetch($toselectid); @@ -418,7 +418,7 @@ if (empty($reshook)) { } } } - if (!$error && $massaction == 'switchonpurchasestatus' && $permissiontoadd) { + if ($massaction == 'switchonpurchasestatus' && $permissiontoadd) { $product = new Product($db); foreach ($toselect as $toselectid) { $result = $product->fetch($toselectid); diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 7477e386fe7..4736a24eff0 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -619,10 +619,8 @@ if ($action == 'create') { print ""; - // Show list of products into warehouse - $totalarray = array(); $totalarray['val'] = array(); $totalarray['pos'] = array(); @@ -743,6 +741,7 @@ if ($action == 'create') { if ($resql) { $num = $db->num_rows($resql); $i = 0; + $units = 0; $sameunits = true; while ($i < $num) { @@ -854,8 +853,6 @@ if ($action == 'create') { print ""; - $i++; - // Define $unit and $sameunits if (getDolGlobalString('PRODUCT_USE_UNITS')) { if ($i == 0) { @@ -864,6 +861,8 @@ if ($action == 'create') { $sameunits = false; } } + + $i++; } $db->free($resql); diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_contact.php b/htdocs/product/stock/stocktransfer/stocktransfer_contact.php index ab9fade90da..aab6d493cc7 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_contact.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_contact.php @@ -53,6 +53,7 @@ $lineid = GETPOSTINT('lineid'); $action = GETPOST('action', 'alpha'); $object = new StockTransfer($db); +$error = 0; // Load object //include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 814bd3678f1..3a784e4db5e 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -164,7 +164,7 @@ $search_array_options_task = $extrafields->getOptionalsFromPost($object->table_e /* * Actions */ - +$error = 0; $parameters = array('id' => $id, 'taskid' => $taskid, 'projectid' => $projectid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php index dc2114cf7b4..717732b67e0 100644 --- a/htdocs/projet/admin/project.php +++ b/htdocs/projet/admin/project.php @@ -64,7 +64,7 @@ $type = 'project'; /* * Actions */ - +$error = 0; include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'updateMask') { @@ -89,7 +89,7 @@ if ($action == 'updateMask') { if ($action == 'updateMaskTask') { $maskconstmasktask = GETPOST('maskconsttask', 'aZ09'); $masktaskt = GETPOST('masktask', 'alpha'); - + $res = 0; if ($maskconstmasktask && preg_match('/_MASK$/', $maskconstmasktask)) { $res = dolibarr_set_const($db, $maskconstmasktask, $masktaskt, 'chaine', 0, '', $conf->entity); } @@ -125,15 +125,15 @@ if ($action == 'updateMaskTask') { require_once $file; $module = new $classname($db); - '@phan-var-force ModelePDFProjects $module'; + /** @var ModelePDFProjects $module */ if ($module->write_file($project, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=project&file=SPECIMEN.pdf"); return; } else { - setEventMessages($obj->error, $obj->errors, 'errors'); - dol_syslog($obj->error, LOG_ERR); + setEventMessages($module->error, $module->errors, 'errors'); + dol_syslog($module->error, LOG_ERR); } } else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); @@ -161,15 +161,15 @@ if ($action == 'updateMaskTask') { require_once $file; $module = new $classname($db); - '@phan-var-force ModelePDFTask $module'; + /** @var ModelePDFTask $module */ if ($module->write_file($project, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=project_task&file=SPECIMEN.pdf"); return; } else { - setEventMessages($obj->error, $obj->errors, 'errors'); - dol_syslog($obj->error, LOG_ERR); + setEventMessages($module->error, $module->errors, 'errors'); + dol_syslog($module->error, LOG_ERR); } } else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); @@ -435,6 +435,7 @@ if (!getDolGlobalString('PROJECT_HIDE_TASKS')) { $module = new $file(); '@phan-var-force ModeleNumRefTask $module'; + /** @var ModeleNumRefTask $module */ // Show modules according to features level if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) { diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 43010d13233..7456cc829e3 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -126,7 +126,7 @@ $permissiondellink = $user->hasRight('projet', 'creer'); // Used by the include /* * Actions */ - +$error = 0; $parameters = array('id' => $socid, 'objcanvas' => $objcanvas); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -303,8 +303,6 @@ if (empty($reshook)) { } if ($action == 'update' && empty(GETPOST('cancel')) && $permissiontoadd) { - $error = 0; - if (empty($ref)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Ref")), null, 'errors'); @@ -419,7 +417,6 @@ if (empty($reshook)) { } if ($action == 'set_opp_status' && $user->hasRight('projet', 'creer')) { - $error = 0; if (GETPOSTISSET('opp_status')) { $object->opp_status = $opp_status; } diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index 8d5944ea830..ac7bdaa51ac 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -81,7 +81,7 @@ $permissiontoadd = $user->hasRight('projet', 'creer'); /* * Actions */ - +$error = 0; $parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); if ($reshook < 0) { diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 6f5385ee1e5..da8c2b669b0 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -346,7 +346,7 @@ if ($mode == 'kanban' && $groupby) { /* * Actions */ - +$error = 0; if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index b9f25b7716f..627ea71977e 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -204,6 +204,7 @@ $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; /* * Actions */ +$error = 0; if ($cancel) { if (!empty($backtopageforcancel)) { @@ -339,8 +340,6 @@ if (count($morewherefilterarray) > 0) { } if ($action == 'createtask' && $user->hasRight('projet', 'creer')) { - $error = 0; - // If we use user timezone, we must change also view/list to use user timezone everywhere $date_start = dol_mktime(GETPOSTINT('date_starthour'), GETPOSTINT('date_startmin'), 0, GETPOSTINT('date_startmonth'), GETPOSTINT('date_startday'), GETPOSTINT('date_startyear')); $date_end = dol_mktime(GETPOSTINT('date_endhour'), GETPOSTINT('date_endmin'), 0, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear')); diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 9f114454e10..29ddbe2b731 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -94,10 +94,9 @@ restrictedArea($user, 'projet', $object->fk_project, 'projet&project'); /* * Actions */ +$error = 0; if ($action == 'update' && !GETPOST("cancel") && $user->hasRight('projet', 'creer')) { - $error = 0; - if (empty($taskref)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Ref")), null, 'errors'); diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 3a933522bff..7e6514bb77a 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -161,6 +161,7 @@ if ($object->fk_project > 0) { /* * Actions */ +$error = 0; if (GETPOST('cancel', 'alpha')) { $action = ''; @@ -212,8 +213,6 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' } if ($action == 'addtimespent' && $user->hasRight('projet', 'time')) { - $error = 0; - $timespent_durationhour = GETPOSTINT('timespent_durationhour'); $timespent_durationmin = GETPOSTINT('timespent_durationmin'); if (empty($timespent_durationhour) && empty($timespent_durationmin)) { @@ -278,8 +277,6 @@ if ($action == 'addtimespent' && $user->hasRight('projet', 'time')) { } if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $user->hasRight('projet', 'lire')) { - $error = 0; - if (!GETPOST("new_durationhour") && !GETPOST("new_durationmin")) { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Duration")), null, 'errors'); $error++; @@ -788,8 +785,6 @@ if ($action == 'confirm_generateinvoice') { $mesg = str_replace('{s1}', $urltoinvoice, $mesg); setEventMessages($mesg, null, 'mesgs'); - //var_dump($tmpinvoice); - $db->commit(); } else { $db->rollback(); diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index eb38c93a1ee..ad5339deb41 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -81,14 +81,14 @@ $nbcolonnes = substr_count($object->sujet, ',') + 1; $listofvoters = explode(',', $_SESSION["savevoter"]); +$error = 0; + // Add comment if (GETPOST('ajoutcomment', 'alpha')) { if (!$canbemodified) { httponly_accessforbidden('ErrorForbidden'); } - $error = 0; - $comment = GETPOST("comment", 'alphanohtml'); $comment_user = GETPOST('commentuser', 'alphanohtml'); diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index d1556b3605f..8b399217059 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -72,6 +72,7 @@ $langs->loadLangs(array("other", "dict", "bills", "companies", "errors", "paybox // No check on module enabled. Done later according to $validpaymentmethod $errmsg = ''; +$error = 0; $action = GETPOST('action', 'aZ09'); $id = GETPOSTINT('id'); $securekeyreceived = GETPOST("securekey", 'alpha'); diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 1b8a2e2d470..e83055b3eb7 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -72,6 +72,7 @@ global $dolibarr_main_url_root; $errmsg = ''; $num = 0; $error = 0; +$errors = []; $backtopage = GETPOST('backtopage', 'alpha'); $action = GETPOST('action', 'aZ09'); diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index eec8bb12c91..47d5893ae8a 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -77,6 +77,7 @@ $langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", // No check on module enabled. Done later according to $validpaymentmethod $errmsg = ''; +$error = 0; $action = GETPOST('action', 'aZ09'); $id = GETPOST('id'); $securekeyreceived = GETPOST("securekey"); diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index f9a4334a27a..cc51621c14a 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.php @@ -169,6 +169,7 @@ restrictedArea($user, 'salaries', 0, 'salary', ''); /* * Actions */ +$error = 0; if (GETPOST('cancel', 'alpha')) { $action = 'list'; diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 1cc8ea5bdc6..7daf29d6ca7 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -60,6 +60,7 @@ $formcompany = new FormCompany($db); /* * Actions */ +$error = 0; include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index d3a3d992391..3d5bd42f488 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -61,6 +61,7 @@ $action = GETPOST('action', 'aZ09'); /* * Actions */ +$error = 0; if ($action == 'setvalue' && $user->admin) { $db->begin(); diff --git a/htdocs/takepos/admin/appearance.php b/htdocs/takepos/admin/appearance.php index 7e8e9b4331f..2b9ad9e153c 100644 --- a/htdocs/takepos/admin/appearance.php +++ b/htdocs/takepos/admin/appearance.php @@ -49,6 +49,7 @@ $langs->loadLangs(array("admin", "cashdesk", "commercial")); /* * Actions */ +$error = 0; if (GETPOST('action', 'alpha') == 'set') { $db->begin(); diff --git a/htdocs/takepos/admin/bar.php b/htdocs/takepos/admin/bar.php index 45330661409..362942bc16d 100644 --- a/htdocs/takepos/admin/bar.php +++ b/htdocs/takepos/admin/bar.php @@ -53,6 +53,7 @@ $res = 0; /* * Actions */ +$error = 0; if (GETPOST('action', 'alpha') == 'set') { $db->begin(); diff --git a/htdocs/takepos/admin/receipt.php b/htdocs/takepos/admin/receipt.php index 0ccc22feb32..de3993f23c1 100644 --- a/htdocs/takepos/admin/receipt.php +++ b/htdocs/takepos/admin/receipt.php @@ -52,6 +52,7 @@ $langs->loadLangs(array("admin", "cashdesk", "commercial")); /* * Actions */ +$error = 0; if (GETPOST('action', 'alpha') == 'set') { $db->begin(); diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 117c9ca3987..597319c1686 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -59,8 +59,6 @@ if (!$user->admin) { $langs->loadLangs(array("admin", "cashdesk", "printing", "receiptprinter")); -global $db; - $sql = "SELECT code, libelle as label FROM ".MAIN_DB_PREFIX."c_paiement"; $sql .= " WHERE entity IN (".getEntity('c_paiement').")"; $sql .= " AND active = 1"; @@ -79,6 +77,7 @@ $terminaltouse = $terminal; /* * Actions */ +$error = 0; if (GETPOST('action', 'alpha') == 'set') { $db->begin(); diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index c5edfa37504..21681ef27b4 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -178,7 +178,7 @@ $term = empty($_SESSION["takeposterminal"]) ? 1 : $_SESSION["takeposterminal"]; /* * Actions */ - +$error = 0; $parameters = array(); $reshook = $hookmanager->executeHooks('doActions', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { diff --git a/htdocs/ticket/contact.php b/htdocs/ticket/contact.php index e66da0c0cab..3d1c04c5cce 100644 --- a/htdocs/ticket/contact.php +++ b/htdocs/ticket/contact.php @@ -98,6 +98,7 @@ $permissiontoadd = $user->hasRight('ticket', 'write'); /* * Actions */ +$error = 0; $parameters = array(); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -111,8 +112,6 @@ if ($action == 'addcontact' && $user->hasRight('ticket', 'write')) { $contactid = (GETPOSTINT('userid') ? GETPOSTINT('userid') : GETPOSTINT('contactid')); $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); - $error = 0; - $codecontact = dol_getIdFromCode($db, $typeid, 'c_type_contact', 'rowid', 'code'); if ($codecontact == 'SUPPORTTEC') { $internal_contacts = $object->listeContact(-1, 'internal', 0, 'SUPPORTTEC'); diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 7f71f656f37..1b7816b5bb6 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -96,7 +96,7 @@ if (isModEnabled('multicompany') && $conf->entity > 1 && $conf->global->MULTICOM /** * Actions */ - +$error = 0; $parameters = array('id' => $id, 'userid' => $userid, 'caneditperms' => $permissiontoedit); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { diff --git a/htdocs/user/logout.php b/htdocs/user/logout.php index 9fece5a5d1e..5c1905bcdfc 100644 --- a/htdocs/user/logout.php +++ b/htdocs/user/logout.php @@ -61,6 +61,7 @@ if (!empty($_SESSION["dol_authmode"]) && ($_SESSION["dol_authmode"] == 'forceuse * @var Translate $langs * @var User $user */ +$error = 0; // Call trigger $result = $user->call_trigger('USER_LOGOUT', $user); diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index 1ba1c2c15c5..c8c6c71ee3e 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -1525,7 +1525,7 @@ class Website extends CommonObject public function componentSelectLang($languagecodes, $weblangs, $morecss = '', $htmlname = '') { global $websitepagefile, $website; - '@phan-var-force WebSite $website'; + '@phan-var-force Website $website'; if (!is_object($weblangs)) { return 'ERROR componentSelectLang called with parameter $weblangs not defined';