forked from Wavyzz/dolibarr
Qual: Fix phan notices (modulebuilder)
This commit is contained in:
@@ -9,9 +9,9 @@
|
|||||||
*/
|
*/
|
||||||
return [
|
return [
|
||||||
// # Issue statistics:
|
// # Issue statistics:
|
||||||
// PhanTypeMismatchArgument : 2560+ occurrences
|
// PhanTypeMismatchArgument : 2490+ occurrences
|
||||||
// PhanUndeclaredProperty : 530+ occurrences
|
// PhanUndeclaredProperty : 530+ occurrences
|
||||||
// PhanTypeMismatchArgumentNullable : 450+ occurrences
|
// PhanTypeMismatchArgumentNullable : 430+ occurrences
|
||||||
// PhanUndeclaredGlobalVariable : 190+ occurrences
|
// PhanUndeclaredGlobalVariable : 190+ occurrences
|
||||||
// PhanPluginUnknownArrayMethodReturnType : 180+ occurrences
|
// PhanPluginUnknownArrayMethodReturnType : 180+ occurrences
|
||||||
// PhanPossiblyUndeclaredGlobalVariable : 160+ occurrences
|
// PhanPossiblyUndeclaredGlobalVariable : 160+ occurrences
|
||||||
@@ -84,7 +84,7 @@ return [
|
|||||||
'htdocs/adherents/admin/website.php' => ['PhanTypeMismatchArgument'],
|
'htdocs/adherents/admin/website.php' => ['PhanTypeMismatchArgument'],
|
||||||
'htdocs/adherents/canvas/actions_adherentcard_common.class.php' => ['PhanTypeMismatchArgument'],
|
'htdocs/adherents/canvas/actions_adherentcard_common.class.php' => ['PhanTypeMismatchArgument'],
|
||||||
'htdocs/adherents/card.php' => ['PhanTypeMismatchArgument'],
|
'htdocs/adherents/card.php' => ['PhanTypeMismatchArgument'],
|
||||||
'htdocs/adherents/class/adherent.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
'htdocs/adherents/class/adherent.class.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||||
'htdocs/adherents/class/adherent_type.class.php' => ['PhanTypeMismatchArgument'],
|
'htdocs/adherents/class/adherent_type.class.php' => ['PhanTypeMismatchArgument'],
|
||||||
'htdocs/adherents/class/api_members.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
'htdocs/adherents/class/api_members.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||||
'htdocs/adherents/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable'],
|
'htdocs/adherents/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable'],
|
||||||
@@ -411,20 +411,16 @@ return [
|
|||||||
'htdocs/core/login/functions_dolibarr.php' => ['PhanTypeMismatchArgument'],
|
'htdocs/core/login/functions_dolibarr.php' => ['PhanTypeMismatchArgument'],
|
||||||
'htdocs/core/login/functions_ldap.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
'htdocs/core/login/functions_ldap.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||||
'htdocs/core/menus/standard/auguria.lib.php' => ['PhanTypeMismatchArgument'],
|
'htdocs/core/menus/standard/auguria.lib.php' => ['PhanTypeMismatchArgument'],
|
||||||
'htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php' => ['PhanTypeMismatchArgument'],
|
|
||||||
'htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php' => ['PhanTypeMismatchArgumentNullable'],
|
'htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||||
'htdocs/core/modules/asset/mod_asset_advanced.php' => ['PhanUndeclaredProperty'],
|
'htdocs/core/modules/asset/mod_asset_advanced.php' => ['PhanUndeclaredProperty'],
|
||||||
'htdocs/core/modules/barcode/mod_barcode_product_standard.php' => ['PhanTypeMismatchArgument'],
|
'htdocs/core/modules/barcode/mod_barcode_product_standard.php' => ['PhanTypeMismatchArgument'],
|
||||||
'htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php' => ['PhanTypeMismatchArgument'],
|
'htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php' => ['PhanTypeMismatchArgument'],
|
||||||
'htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php' => ['PhanTypeMismatchArgument'],
|
|
||||||
'htdocs/core/modules/bom/mod_bom_advanced.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
'htdocs/core/modules/bom/mod_bom_advanced.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||||
'htdocs/core/modules/cheque/doc/pdf_blochet.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
'htdocs/core/modules/cheque/doc/pdf_blochet.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||||
'htdocs/core/modules/cheque/modules_chequereceipts.php' => ['PhanTypeMismatchArgument'],
|
'htdocs/core/modules/cheque/modules_chequereceipts.php' => ['PhanTypeMismatchArgument'],
|
||||||
'htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php' => ['PhanTypeMismatchArgument'],
|
|
||||||
'htdocs/core/modules/commande/doc/pdf_einstein.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
'htdocs/core/modules/commande/doc/pdf_einstein.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||||
'htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
'htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||||
'htdocs/core/modules/commande/mod_commande_saphir.php' => ['PhanTypeMismatchArgumentNullable'],
|
'htdocs/core/modules/commande/mod_commande_saphir.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||||
'htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php' => ['PhanTypeMismatchArgument'],
|
|
||||||
'htdocs/core/modules/contract/doc/pdf_strato.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
'htdocs/core/modules/contract/doc/pdf_strato.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||||
'htdocs/core/modules/delivery/doc/pdf_storm.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
'htdocs/core/modules/delivery/doc/pdf_storm.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||||
'htdocs/core/modules/delivery/doc/pdf_typhon.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
'htdocs/core/modules/delivery/doc/pdf_typhon.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||||
@@ -435,7 +431,6 @@ return [
|
|||||||
'htdocs/core/modules/expedition/doc/pdf_rouget.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
'htdocs/core/modules/expedition/doc/pdf_rouget.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||||
'htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
'htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||||
'htdocs/core/modules/expensereport/mod_expensereport_jade.php' => ['PhanTypeMismatchArgument'],
|
'htdocs/core/modules/expensereport/mod_expensereport_jade.php' => ['PhanTypeMismatchArgument'],
|
||||||
'htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php' => ['PhanTypeMismatchArgument'],
|
|
||||||
'htdocs/core/modules/facture/doc/pdf_crabe.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
'htdocs/core/modules/facture/doc/pdf_crabe.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||||
'htdocs/core/modules/facture/doc/pdf_octopus.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
'htdocs/core/modules/facture/doc/pdf_octopus.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||||
'htdocs/core/modules/facture/doc/pdf_sponge.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
'htdocs/core/modules/facture/doc/pdf_sponge.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||||
@@ -471,38 +466,29 @@ return [
|
|||||||
'htdocs/core/modules/modSupplierProposal.class.php' => ['PhanTypeMismatchArgument'],
|
'htdocs/core/modules/modSupplierProposal.class.php' => ['PhanTypeMismatchArgument'],
|
||||||
'htdocs/core/modules/modTicket.class.php' => ['PhanTypeMismatchArgument'],
|
'htdocs/core/modules/modTicket.class.php' => ['PhanTypeMismatchArgument'],
|
||||||
'htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php' => ['PhanTypeMismatchArgument'],
|
'htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php' => ['PhanTypeMismatchArgument'],
|
||||||
'htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php' => ['PhanTypeMismatchArgument'],
|
|
||||||
'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||||
'htdocs/core/modules/mrp/mod_mo_advanced.php' => ['PhanUndeclaredProperty'],
|
'htdocs/core/modules/mrp/mod_mo_advanced.php' => ['PhanUndeclaredProperty'],
|
||||||
'htdocs/core/modules/oauth/github_oauthcallback.php' => ['PhanUndeclaredGlobalVariable'],
|
'htdocs/core/modules/oauth/github_oauthcallback.php' => ['PhanUndeclaredGlobalVariable'],
|
||||||
'htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php' => ['PhanTypeMismatchArgument'],
|
'htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php' => ['PhanTypeMismatchArgument'],
|
||||||
'htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php' => ['PhanTypeMismatchArgument'],
|
'htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php' => ['PhanTypeMismatchArgument'],
|
||||||
'htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php' => ['PhanTypeMismatchArgument'],
|
|
||||||
'htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
'htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||||
'htdocs/core/modules/project/doc/pdf_beluga.modules.php' => ['PhanTypeMismatchArgument'],
|
'htdocs/core/modules/project/doc/pdf_beluga.modules.php' => ['PhanTypeMismatchArgument'],
|
||||||
'htdocs/core/modules/project/doc/pdf_timespent.modules.php' => ['PhanUndeclaredProperty'],
|
'htdocs/core/modules/project/doc/pdf_timespent.modules.php' => ['PhanUndeclaredProperty'],
|
||||||
'htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
'htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||||
'htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php' => ['PhanTypeMismatchArgument'],
|
|
||||||
'htdocs/core/modules/propale/doc/pdf_azur.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
'htdocs/core/modules/propale/doc/pdf_azur.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||||
'htdocs/core/modules/propale/doc/pdf_cyan.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
'htdocs/core/modules/propale/doc/pdf_cyan.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||||
'htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php' => ['PhanTypeMismatchArgument'],
|
|
||||||
'htdocs/core/modules/reception/doc/pdf_squille.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
'htdocs/core/modules/reception/doc/pdf_squille.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||||
'htdocs/core/modules/societe/doc/doc_generic_odt.modules.php' => ['PhanTypeMismatchArgumentNullable'],
|
'htdocs/core/modules/societe/doc/doc_generic_odt.modules.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||||
'htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php' => ['PhanTypeMismatchArgument'],
|
|
||||||
'htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
'htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||||
'htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php' => ['PhanTypeMismatchArgumentNullable'],
|
'htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||||
'htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php' => ['PhanUndeclaredProperty'],
|
'htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php' => ['PhanUndeclaredProperty'],
|
||||||
'htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php' => ['PhanTypeMismatchArgument'],
|
|
||||||
'htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty'],
|
'htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty'],
|
||||||
'htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php' => ['PhanTypeMismatchArgument'],
|
|
||||||
'htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
'htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||||
'htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
'htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||||
'htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php' => ['PhanTypeMismatchArgument'],
|
|
||||||
'htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
'htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||||
'htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
'htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||||
'htdocs/core/modules/syslog/mod_syslog_file.php' => ['PhanPluginDuplicateArrayKey'],
|
'htdocs/core/modules/syslog/mod_syslog_file.php' => ['PhanPluginDuplicateArrayKey'],
|
||||||
'htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php' => ['PhanTypeMismatchArgumentNullable'],
|
'htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||||
'htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php' => ['PhanTypeMismatchArgument'],
|
|
||||||
'htdocs/core/modules/workstation/mod_workstation_advanced.php' => ['PhanUndeclaredProperty'],
|
'htdocs/core/modules/workstation/mod_workstation_advanced.php' => ['PhanUndeclaredProperty'],
|
||||||
'htdocs/core/multicompany_page.php' => ['PhanTypeMismatchArgument'],
|
'htdocs/core/multicompany_page.php' => ['PhanTypeMismatchArgument'],
|
||||||
'htdocs/core/search_page.php' => ['PhanTypeMismatchArgument'],
|
'htdocs/core/search_page.php' => ['PhanTypeMismatchArgument'],
|
||||||
@@ -622,15 +608,6 @@ return [
|
|||||||
'htdocs/loan/document.php' => ['PhanUndeclaredProperty'],
|
'htdocs/loan/document.php' => ['PhanUndeclaredProperty'],
|
||||||
'htdocs/loan/note.php' => ['PhanUndeclaredProperty'],
|
'htdocs/loan/note.php' => ['PhanUndeclaredProperty'],
|
||||||
'htdocs/loan/payment/payment.php' => ['PhanUndeclaredProperty'],
|
'htdocs/loan/payment/payment.php' => ['PhanUndeclaredProperty'],
|
||||||
'htdocs/modulebuilder/index.php' => ['PhanTypeMismatchArgumentNullable'],
|
|
||||||
'htdocs/modulebuilder/template/admin/setup.php' => ['PhanTypeMismatchArgument'],
|
|
||||||
'htdocs/modulebuilder/template/ajax/myobject.php' => ['PhanTypeMismatchArgument'],
|
|
||||||
'htdocs/modulebuilder/template/class/api_mymodule.class.php' => ['PhanTypeMismatchArgument'],
|
|
||||||
'htdocs/modulebuilder/template/class/myobject.class.php' => ['PhanTypeMismatchArgument'],
|
|
||||||
'htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php' => ['PhanTypeMismatchArgument'],
|
|
||||||
'htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
|
||||||
'htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php' => ['PhanTypeMismatchArgument'],
|
|
||||||
'htdocs/modulebuilder/template/myobject_list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
|
||||||
'htdocs/mrp/ajax/ajax_bom.php' => ['PhanTypeMismatchArgument'],
|
'htdocs/mrp/ajax/ajax_bom.php' => ['PhanTypeMismatchArgument'],
|
||||||
'htdocs/mrp/class/api_mos.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'],
|
'htdocs/mrp/class/api_mos.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'],
|
||||||
'htdocs/mrp/class/mo.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
|
'htdocs/mrp/class/mo.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
|
||||||
@@ -802,7 +779,6 @@ return [
|
|||||||
'htdocs/recruitment/class/api_recruitments.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
'htdocs/recruitment/class/api_recruitments.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||||
'htdocs/recruitment/class/recruitmentcandidature.class.php' => ['PhanUndeclaredProperty'],
|
'htdocs/recruitment/class/recruitmentcandidature.class.php' => ['PhanUndeclaredProperty'],
|
||||||
'htdocs/recruitment/class/recruitmentjobposition.class.php' => ['PhanUndeclaredProperty'],
|
'htdocs/recruitment/class/recruitmentjobposition.class.php' => ['PhanUndeclaredProperty'],
|
||||||
'htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php' => ['PhanTypeMismatchArgument'],
|
|
||||||
'htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
'htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||||
'htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
'htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||||
'htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
'htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||||
|
|||||||
@@ -1207,7 +1207,7 @@ function checkVal($out = '', $check = 'alphanohtml', $filter = null, $options =
|
|||||||
/**
|
/**
|
||||||
* Return a sanitized or empty value after checking value against a rule.
|
* Return a sanitized or empty value after checking value against a rule.
|
||||||
*
|
*
|
||||||
* @param string|array<mixed> $out Value to check/clear.
|
* @param string|mixed[]|null $out Value to check/clear.
|
||||||
* @param string $check Type of check/sanitizing
|
* @param string $check Type of check/sanitizing
|
||||||
* @param ?int $filter Filter to apply when $check is set to 'custom'. (See http://php.net/manual/en/filter.filters.php for détails)
|
* @param ?int $filter Filter to apply when $check is set to 'custom'. (See http://php.net/manual/en/filter.filters.php for détails)
|
||||||
* @param ?mixed $options Options to pass to filter_var when $check is set to 'custom'
|
* @param ?mixed $options Options to pass to filter_var when $check is set to 'custom'
|
||||||
@@ -1217,6 +1217,9 @@ function sanitizeVal($out = '', $check = 'alphanohtml', $filter = null, $options
|
|||||||
{
|
{
|
||||||
// TODO : use class "Validate" to perform tests (and add missing tests) if needed for factorize
|
// TODO : use class "Validate" to perform tests (and add missing tests) if needed for factorize
|
||||||
// Check is done after replacement
|
// Check is done after replacement
|
||||||
|
if ($out === null) {
|
||||||
|
$out = '';
|
||||||
|
}
|
||||||
switch ($check) {
|
switch ($check) {
|
||||||
case 'none':
|
case 'none':
|
||||||
case 'password':
|
case 'password':
|
||||||
@@ -9895,7 +9898,7 @@ function make_substitutions($text, $substitutionarray, $outputlangs = null, $con
|
|||||||
* Complete the $substitutionarray with more entries coming from external module that had set the "substitutions=1" into module_part array.
|
* Complete the $substitutionarray with more entries coming from external module that had set the "substitutions=1" into module_part array.
|
||||||
* In this case, method completesubstitutionarray provided by module is called.
|
* In this case, method completesubstitutionarray provided by module is called.
|
||||||
*
|
*
|
||||||
* @param array<string,string> $substitutionarray Array substitution old value => new value value
|
* @param array<string,string|float|null> $substitutionarray Array substitution old value => new value value
|
||||||
* @param Translate $outputlangs Output language
|
* @param Translate $outputlangs Output language
|
||||||
* @param ?CommonObject $object Source object
|
* @param ?CommonObject $object Source object
|
||||||
* @param ?mixed $parameters Add more parameters (useful to pass product lines)
|
* @param ?mixed $parameters Add more parameters (useful to pass product lines)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -447,7 +447,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
|
|||||||
$reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
foreach ($tmparray as $key => $val) {
|
foreach ($tmparray as $key => $val) {
|
||||||
try {
|
try {
|
||||||
if (!is_array($val)) {
|
if (!is_array($val)) { // @phpstan-ignore-line
|
||||||
$listlines->setVars($key, $val, true, 'UTF-8');
|
$listlines->setVars($key, $val, true, 'UTF-8');
|
||||||
}
|
}
|
||||||
} catch (SegmentException $e) {
|
} catch (SegmentException $e) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2004-2023 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2023 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2018-2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
* Copyright (C) 2018-2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||||
* Copyright (C) 2023 Alexandre Janniaux <alexandre.janniaux@gmail.com>
|
* Copyright (C) 2023 Alexandre Janniaux <alexandre.janniaux@gmail.com>
|
||||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@@ -67,7 +67,7 @@ $sortfield = GETPOST('sortfield', 'alpha');
|
|||||||
$sortorder = GETPOST('sortorder', 'aZ09');
|
$sortorder = GETPOST('sortorder', 'aZ09');
|
||||||
|
|
||||||
$module = GETPOST('module', 'alpha');
|
$module = GETPOST('module', 'alpha');
|
||||||
$tab = GETPOST('tab', 'aZ09');
|
$tab = (string) GETPOST('tab', 'aZ09');
|
||||||
$tabobj = GETPOST('tabobj', 'alpha');
|
$tabobj = GETPOST('tabobj', 'alpha');
|
||||||
$tabdic = GETPOST('tabdic', 'alpha');
|
$tabdic = GETPOST('tabdic', 'alpha');
|
||||||
$propertykey = GETPOST('propertykey', 'alpha');
|
$propertykey = GETPOST('propertykey', 'alpha');
|
||||||
@@ -77,6 +77,7 @@ if (empty($module)) {
|
|||||||
if (empty($tab)) {
|
if (empty($tab)) {
|
||||||
$tab = 'description';
|
$tab = 'description';
|
||||||
}
|
}
|
||||||
|
'@phan-var-force string $tab'; // Workaround 'empty()' bug of phan
|
||||||
if (empty($tabobj)) {
|
if (empty($tabobj)) {
|
||||||
$tabobj = 'newobjectifnoobj';
|
$tabobj = 'newobjectifnoobj';
|
||||||
}
|
}
|
||||||
@@ -850,6 +851,7 @@ if ($dirins && $action == 'initcli' && !empty($module) && $user->hasRight("modul
|
|||||||
|
|
||||||
|
|
||||||
$moduledescriptorfile = '/not_set/';
|
$moduledescriptorfile = '/not_set/';
|
||||||
|
$modulelowercase = null;
|
||||||
|
|
||||||
// init Doc
|
// init Doc
|
||||||
if ($dirins && $action == 'initdoc' && !empty($module) && $user->hasRight("modulebuilder", "run")) {
|
if ($dirins && $action == 'initdoc' && !empty($module) && $user->hasRight("modulebuilder", "run")) {
|
||||||
@@ -1288,7 +1290,7 @@ if ($dirins && $action == 'initobject' && $module && $objectname && $user->hasRi
|
|||||||
$position = 900;
|
$position = 900;
|
||||||
}
|
}
|
||||||
// $alwayseditable
|
// $alwayseditable
|
||||||
$alwayseditable=0;
|
$alwayseditable = 0;
|
||||||
if ($fieldname == 'label') {
|
if ($fieldname == 'label') {
|
||||||
$alwayseditable = 1;
|
$alwayseditable = 1;
|
||||||
} else {
|
} else {
|
||||||
@@ -2347,15 +2349,12 @@ if ($dirins && $action == 'generatepackage' && $user->hasRight("modulebuilder",
|
|||||||
|
|
||||||
$dirofmodule = dol_buildpath($modulelowercase, 0).'/bin';
|
$dirofmodule = dol_buildpath($modulelowercase, 0).'/bin';
|
||||||
$outputfilezip = $dirofmodule.'/'.$FILENAMEZIP;
|
$outputfilezip = $dirofmodule.'/'.$FILENAMEZIP;
|
||||||
if ($dirofmodule) {
|
|
||||||
if (!dol_is_dir($dirofmodule)) {
|
if (!dol_is_dir($dirofmodule)) {
|
||||||
dol_mkdir($dirofmodule);
|
dol_mkdir($dirofmodule);
|
||||||
}
|
}
|
||||||
// Note: We exclude /bin/ to not include the already generated zip
|
// Note: We exclude /bin/ to not include the already generated zip
|
||||||
$result = dol_compress_dir($dir, $outputfilezip, 'zip', '/\/bin\/|\.git|\.old|\.back|\.ssh/', $modulelowercase);
|
$result = dol_compress_dir($dir, $outputfilezip, 'zip', '/\/bin\/|\.git|\.old|\.back|\.ssh/', $modulelowercase);
|
||||||
} else {
|
|
||||||
$result = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
setEventMessages($langs->trans("ZipFileGeneratedInto", $outputfilezip), null);
|
setEventMessages($langs->trans("ZipFileGeneratedInto", $outputfilezip), null);
|
||||||
@@ -2706,12 +2705,9 @@ if ($action == 'set' && $user->admin && $user->hasRight("modulebuilder", "run"))
|
|||||||
if ($module) {
|
if ($module) {
|
||||||
$param .= '&module='.urlencode($module);
|
$param .= '&module='.urlencode($module);
|
||||||
}
|
}
|
||||||
if ($tab) {
|
|
||||||
$param .= '&tab='.urlencode($tab);
|
$param .= '&tab='.urlencode($tab);
|
||||||
}
|
|
||||||
if ($tabobj) {
|
|
||||||
$param .= '&tabobj='.urlencode($tabobj);
|
$param .= '&tabobj='.urlencode($tabobj);
|
||||||
}
|
|
||||||
|
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
$resarray = activateModule($value);
|
$resarray = activateModule($value);
|
||||||
@@ -2744,12 +2740,8 @@ if ($action == 'reset' && $user->admin && $user->hasRight("modulebuilder", "run"
|
|||||||
if ($module) {
|
if ($module) {
|
||||||
$param .= '&module='.urlencode($module);
|
$param .= '&module='.urlencode($module);
|
||||||
}
|
}
|
||||||
if ($tab) {
|
|
||||||
$param .= '&tab='.urlencode($tab);
|
$param .= '&tab='.urlencode($tab);
|
||||||
}
|
|
||||||
if ($tabobj) {
|
|
||||||
$param .= '&tabobj='.urlencode($tabobj);
|
$param .= '&tabobj='.urlencode($tabobj);
|
||||||
}
|
|
||||||
|
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
$result = unActivateModule($value);
|
$result = unActivateModule($value);
|
||||||
@@ -3310,15 +3302,12 @@ if (is_array($listofmodules) && count($listofmodules) > 0) {
|
|||||||
$modulelowercase = strtolower($module);
|
$modulelowercase = strtolower($module);
|
||||||
|
|
||||||
$param = '';
|
$param = '';
|
||||||
if ($tab) {
|
|
||||||
$param .= '&tab='.urlencode($tab);
|
|
||||||
}
|
|
||||||
if ($module) {
|
if ($module) {
|
||||||
$param .= '&module='.urlencode($module);
|
$param .= '&module='.urlencode($module);
|
||||||
}
|
}
|
||||||
if ($tabobj) {
|
|
||||||
|
$param .= '&tab='.urlencode($tab);
|
||||||
$param .= '&tabobj='.urlencode($tabobj);
|
$param .= '&tabobj='.urlencode($tabobj);
|
||||||
}
|
|
||||||
|
|
||||||
$urltomodulesetup = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?search_keyword='.urlencode($module).'">'.$langs->trans('Home').'-'.$langs->trans("Setup").'-'.$langs->trans("Modules").'</a>';
|
$urltomodulesetup = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?search_keyword='.urlencode($module).'">'.$langs->trans('Home').'-'.$langs->trans("Setup").'-'.$langs->trans("Modules").'</a>';
|
||||||
|
|
||||||
@@ -3333,9 +3322,7 @@ if (is_array($listofmodules) && count($listofmodules) > 0) {
|
|||||||
$objMod = $moduleobj;
|
$objMod = $moduleobj;
|
||||||
$backtourlparam = '';
|
$backtourlparam = '';
|
||||||
$backtourlparam .= ($backtourlparam ? '&' : '?').'module='.$module; // No urlencode here, done later
|
$backtourlparam .= ($backtourlparam ? '&' : '?').'module='.$module; // No urlencode here, done later
|
||||||
if ($tab) {
|
|
||||||
$backtourlparam .= ($backtourlparam ? '&' : '?').'tab='.$tab; // No urlencode here, done later
|
$backtourlparam .= ($backtourlparam ? '&' : '?').'tab='.$tab; // No urlencode here, done later
|
||||||
}
|
|
||||||
$backtourl = $_SERVER["PHP_SELF"].$backtourlparam;
|
$backtourl = $_SERVER["PHP_SELF"].$backtourlparam;
|
||||||
|
|
||||||
$regs = array();
|
$regs = array();
|
||||||
@@ -3493,7 +3480,7 @@ if ($module == 'initmodule') {
|
|||||||
print '<input type="text" name="module" placeholder="'.dol_escape_htmltag($langs->trans("ModuleKey")).'" value="" autofocus>';
|
print '<input type="text" name="module" placeholder="'.dol_escape_htmltag($langs->trans("ModuleKey")).'" value="" autofocus>';
|
||||||
print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Delete").'"'.($dirins ? '' : ' disabled="disabled"').'>';
|
print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Delete").'"'.($dirins ? '' : ' disabled="disabled"').'>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
} elseif (!empty($module) && isset($modulelowercase)) {
|
} elseif (!empty($module) && $modulelowercase !== null) {
|
||||||
// Tabs for module
|
// Tabs for module
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$dirread = $listofmodules[strtolower($module)]['moduledescriptorrootpath'];
|
$dirread = $listofmodules[strtolower($module)]['moduledescriptorrootpath'];
|
||||||
@@ -3848,6 +3835,7 @@ if ($module == 'initmodule') {
|
|||||||
} else { // Edit text file
|
} else { // Edit text file
|
||||||
$fullpathoffile = dol_buildpath($file, 0, 1); // Description - level 2
|
$fullpathoffile = dol_buildpath($file, 0, 1); // Description - level 2
|
||||||
|
|
||||||
|
$content = '';
|
||||||
if ($fullpathoffile) {
|
if ($fullpathoffile) {
|
||||||
$content = file_get_contents($fullpathoffile);
|
$content = file_get_contents($fullpathoffile);
|
||||||
}
|
}
|
||||||
@@ -4377,7 +4365,7 @@ if ($module == 'initmodule') {
|
|||||||
print $form->textwithpicto('', $langs->trans("InfoForApiFile"), 1, 'warning');
|
print $form->textwithpicto('', $langs->trans("InfoForApiFile"), 1, 'warning');
|
||||||
print ' ';
|
print ' ';
|
||||||
// Comparing to null (phan considers $modulelowercase can be null here)
|
// Comparing to null (phan considers $modulelowercase can be null here)
|
||||||
if ($modulelowercase !== null && !isModEnabled($modulelowercase)) { // If module is not activated
|
if (!isModEnabled($modulelowercase)) { // If module is not activated
|
||||||
print '<a href="#" class="classfortooltip" target="apiexplorer" title="'.$langs->trans("ModuleMustBeEnabled", $module).'"><strike>'.$langs->trans("ApiExplorer").'</strike></a>';
|
print '<a href="#" class="classfortooltip" target="apiexplorer" title="'.$langs->trans("ModuleMustBeEnabled", $module).'"><strike>'.$langs->trans("ApiExplorer").'</strike></a>';
|
||||||
} else {
|
} else {
|
||||||
print '<a href="'.DOL_URL_ROOT.'/api/index.php/explorer/" target="apiexplorer">'.$langs->trans("ApiExplorer").'</a>';
|
print '<a href="'.DOL_URL_ROOT.'/api/index.php/explorer/" target="apiexplorer">'.$langs->trans("ApiExplorer").'</a>';
|
||||||
@@ -6418,7 +6406,7 @@ if ($module == 'initmodule') {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$texttoshow = null;
|
$texttoshow = '';
|
||||||
if ($cron['jobtype'] == 'method') {
|
if ($cron['jobtype'] == 'method') {
|
||||||
$text = $langs->trans("CronClass");
|
$text = $langs->trans("CronClass");
|
||||||
$texttoshow = $langs->trans('CronModule').': '.$module.'<br>';
|
$texttoshow = $langs->trans('CronModule').': '.$module.'<br>';
|
||||||
@@ -6658,7 +6646,7 @@ if ($module == 'initmodule') {
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<span class="fa fa-file"></span> '.$langs->trans("PathToModulePackage").' : ';
|
print '<span class="fa fa-file"></span> '.$langs->trans("PathToModulePackage").' : ';
|
||||||
if (!dol_is_file($outputfilezip)) {
|
if ($outputfilezip === null || !dol_is_file($outputfilezip)) {
|
||||||
print '<span class="opacitymedium">'.$langs->trans("FileNotYetGenerated").'</span>';
|
print '<span class="opacitymedium">'.$langs->trans("FileNotYetGenerated").'</span>';
|
||||||
} else {
|
} else {
|
||||||
$relativepath = $modulelowercase.'/bin/'.$FILENAMEZIP;
|
$relativepath = $modulelowercase.'/bin/'.$FILENAMEZIP;
|
||||||
|
|||||||
@@ -453,7 +453,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
@@ -589,7 +589,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||||||
$htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
|
$htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
|
||||||
|
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Preview
|
// Preview
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ dol_include_once('/mymodule/class/myobject.class.php');
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$mode = GETPOST('mode', 'aZ09');
|
$mode = GETPOST('mode', 'aZ09');
|
||||||
$objectId = GETPOST('objectId', 'aZ09');
|
$objectId = GETPOSTINT('objectId');
|
||||||
$field = GETPOST('field', 'aZ09');
|
$field = GETPOST('field', 'aZ09');
|
||||||
$value = GETPOST('value', 'aZ09');
|
$value = GETPOST('value', 'aZ09');
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ dol_include_once('/mymodule/class/myobject.class.php');
|
|||||||
class MyModuleApi extends DolibarrApi
|
class MyModuleApi extends DolibarrApi
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var MyObject $myobject {@type MyObject}
|
* @var MyObject {@type MyObject}
|
||||||
*/
|
*/
|
||||||
public $myobject;
|
public $myobject;
|
||||||
|
|
||||||
@@ -46,7 +46,6 @@ class MyModuleApi extends DolibarrApi
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @url GET /
|
* @url GET /
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@@ -194,8 +193,8 @@ class MyModuleApi extends DolibarrApi
|
|||||||
* Create myobject object
|
* Create myobject object
|
||||||
*
|
*
|
||||||
* @param array $request_data Request data
|
* @param array $request_data Request data
|
||||||
* @phan-param array{string,mixed} $request_data
|
* @phan-param ?array<string,mixed> $request_data
|
||||||
* @phpstan-param array{string,mixed} $request_data
|
* @phpstan-param ?array<string,mixed> $request_data
|
||||||
* @return int ID of myobject
|
* @return int ID of myobject
|
||||||
*
|
*
|
||||||
* @throws RestException 403 Not allowed
|
* @throws RestException 403 Not allowed
|
||||||
@@ -215,7 +214,7 @@ class MyModuleApi extends DolibarrApi
|
|||||||
foreach ($request_data as $field => $value) {
|
foreach ($request_data as $field => $value) {
|
||||||
if ($field === 'caller') {
|
if ($field === 'caller') {
|
||||||
// Add a mention of caller so on trigger called after action, we can filter to avoid a loop if we try to sync back again with the caller @phan-suppress-next-line PhanTypeInvalidDimOffset
|
// Add a mention of caller so on trigger called after action, we can filter to avoid a loop if we try to sync back again with the caller @phan-suppress-next-line PhanTypeInvalidDimOffset
|
||||||
$this->myobject->context['caller'] = sanitizeVal($request_data['caller'], 'aZ09');
|
$this->myobject->context['caller'] = sanitizeVal((string) $request_data['caller'], 'aZ09');
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,8 +242,8 @@ class MyModuleApi extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @param int $id Id of myobject to update
|
* @param int $id Id of myobject to update
|
||||||
* @param array $request_data Data
|
* @param array $request_data Data
|
||||||
* @phan-param mixed[] $request_data
|
* @phan-param ?array<string,mixed> $request_data
|
||||||
* @phpstan-param mixed[] $request_data
|
* @phpstan-param ?array<string,mixed> $request_data
|
||||||
* @return Object Object after update
|
* @return Object Object after update
|
||||||
* @phan-return MyObject
|
* @phan-return MyObject
|
||||||
* @phpstan-return MyObject
|
* @phpstan-return MyObject
|
||||||
@@ -301,7 +300,7 @@ class MyModuleApi extends DolibarrApi
|
|||||||
// Clean data
|
// Clean data
|
||||||
// $this->myobject->abc = sanitizeVal($this->myobject->abc, 'alphanohtml');
|
// $this->myobject->abc = sanitizeVal($this->myobject->abc, 'alphanohtml');
|
||||||
|
|
||||||
if ($this->myobject->update(DolibarrApiAccess::$user, false) > 0) {
|
if ($this->myobject->update(DolibarrApiAccess::$user, 0) > 0) {
|
||||||
return $this->get($id);
|
return $this->get($id);
|
||||||
} else {
|
} else {
|
||||||
throw new RestException(500, $this->myobject->error);
|
throw new RestException(500, $this->myobject->error);
|
||||||
@@ -356,8 +355,8 @@ class MyModuleApi extends DolibarrApi
|
|||||||
* Validate fields before creating or updating object
|
* Validate fields before creating or updating object
|
||||||
*
|
*
|
||||||
* @param array $data Array of data to validate
|
* @param array $data Array of data to validate
|
||||||
* @phan-param array<string,null|int|float|string> $data
|
* @phan-param ?array<string,null|int|float|string> $data
|
||||||
* @phpstan-param array<string,null|int|float|string> $data
|
* @phpstan-param ?array<string,null|int|float|string> $data
|
||||||
* @return array
|
* @return array
|
||||||
* @phan-return array<string,null|int|float|string>|array{}
|
* @phan-return array<string,null|int|float|string>|array{}
|
||||||
* @phpstan-return array<string,null|int|float|string>|array{}
|
* @phpstan-return array<string,null|int|float|string>|array{}
|
||||||
@@ -366,6 +365,9 @@ class MyModuleApi extends DolibarrApi
|
|||||||
*/
|
*/
|
||||||
private function _validateMyObject($data)
|
private function _validateMyObject($data)
|
||||||
{
|
{
|
||||||
|
if (!is_array($data)) {
|
||||||
|
$data = array();
|
||||||
|
}
|
||||||
$myobject = array();
|
$myobject = array();
|
||||||
foreach ($this->myobject->fields as $field => $propfield) {
|
foreach ($this->myobject->fields as $field => $propfield) {
|
||||||
if (in_array($field, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat')) || $propfield['notnull'] != 1) {
|
if (in_array($field, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat')) || $propfield['notnull'] != 1) {
|
||||||
|
|||||||
@@ -802,7 +802,7 @@ class MyObject extends CommonObject
|
|||||||
|
|
||||||
$result = '';
|
$result = '';
|
||||||
$params = [
|
$params = [
|
||||||
'id' => $this->id,
|
'id' => (string) $this->id,
|
||||||
'objecttype' => $this->element.($this->module ? '@'.$this->module : ''),
|
'objecttype' => $this->element.($this->module ? '@'.$this->module : ''),
|
||||||
'option' => $option,
|
'option' => $option,
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||||
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||||
* Copyright (C) ---Replace with your own copyright and developer email---
|
* Copyright (C) ---Replace with your own copyright and developer email---
|
||||||
*
|
*
|
||||||
@@ -431,12 +431,12 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||||||
// $this->_pagefoot($pdf,$object,$outputlangs,1);
|
// $this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||||
$pdf->setTopMargin($tab_top_newpage);
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
// The only function to edit the bottom margin of current page to set it.
|
// The only function to edit the bottom margin of current page to set it.
|
||||||
$pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext);
|
$pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext);
|
||||||
}
|
}
|
||||||
|
|
||||||
// back to start
|
// back to start
|
||||||
$pdf->setPage($pageposbeforenote);
|
$pdf->setPage($pageposbeforenote);
|
||||||
$pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext);
|
$pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext);
|
||||||
$pdf->SetFont('', '', $default_font_size - 1);
|
$pdf->SetFont('', '', $default_font_size - 1);
|
||||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
|
$pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
|
||||||
$pageposafternote = $pdf->getPage();
|
$pageposafternote = $pdf->getPage();
|
||||||
@@ -450,7 +450,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||||||
$pdf->setPage($pageposafternote);
|
$pdf->setPage($pageposafternote);
|
||||||
$pdf->setTopMargin($tab_top_newpage);
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
// The only function to edit the bottom margin of current page to set it.
|
// The only function to edit the bottom margin of current page to set it.
|
||||||
$pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext);
|
$pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext);
|
||||||
//$posyafter = $tab_top_newpage;
|
//$posyafter = $tab_top_newpage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -472,7 +472,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add footer
|
// Add footer
|
||||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it.
|
||||||
$this->_pagefoot($pdf, $object, $outputlangs, 1);
|
$this->_pagefoot($pdf, $object, $outputlangs, 1);
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
@@ -1174,7 +1174,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||||||
$pdf->SetXY($posx + 2, $posy + 3);
|
$pdf->SetXY($posx + 2, $posy + 3);
|
||||||
$pdf->SetFont('', 'B', $default_font_size);
|
$pdf->SetFont('', 'B', $default_font_size);
|
||||||
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
|
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
|
||||||
$pdf->MultiCell($widthrecbox, 2, $carac_client_name, 0, $ltrdirection);
|
$pdf->MultiCell($widthrecbox, 2, (string) $carac_client_name, 0, $ltrdirection);
|
||||||
|
|
||||||
$posy = $pdf->getY();
|
$posy = $pdf->getY();
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2008i Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
* Copyright (C) 2008i Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||||
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
|
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
|
||||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||||
* Copyright (C) ---Replace with your own copyright and developer email---
|
* Copyright (C) ---Replace with your own copyright and developer email---
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@@ -83,7 +83,7 @@ class mod_myobject_advanced extends ModeleNumRefMyObject
|
|||||||
|
|
||||||
// prefix configuration
|
// prefix configuration
|
||||||
$text .= '<tr><td>'.$langs->trans("Mask").':</td>';
|
$text .= '<tr><td>'.$langs->trans("Mask").':</td>';
|
||||||
$text .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskvalue" value="'.getDolGlobalString('MYMODULE_MYOBJECT_ADVANCED_MASK').'">', $tooltip, 1, 1).'</td>';
|
$text .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskvalue" value="'.getDolGlobalString('MYMODULE_MYOBJECT_ADVANCED_MASK').'">', $tooltip, 1, 'help').'</td>';
|
||||||
$text .= '<td class="left" rowspan="2"> <input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'" name="Button"></td>';
|
$text .= '<td class="left" rowspan="2"> <input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'" name="Button"></td>';
|
||||||
$text .= '</tr>';
|
$text .= '</tr>';
|
||||||
|
|
||||||
|
|||||||
@@ -336,14 +336,18 @@ foreach ($search as $key => $val) {
|
|||||||
if ($key == 'status' && $search[$key] == -1) {
|
if ($key == 'status' && $search[$key] == -1) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
|
$field_spec = $object->fields[$key];
|
||||||
if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) {
|
if ($field_spec === null) {
|
||||||
if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) {
|
continue;
|
||||||
|
}
|
||||||
|
$mode_search = (($object->isInt($field_spec) || $object->isFloat($field_spec)) ? 1 : 0);
|
||||||
|
if ((strpos($field_spec['type'], 'integer:') === 0) || (strpos($field_spec['type'], 'sellist:') === 0) || !empty($field_spec['arrayofkeyval'])) {
|
||||||
|
if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($field_spec['arrayofkeyval']) || !array_key_exists('0', $field_spec['arrayofkeyval'])))) {
|
||||||
$search[$key] = '';
|
$search[$key] = '';
|
||||||
}
|
}
|
||||||
$mode_search = 2;
|
$mode_search = 2;
|
||||||
}
|
}
|
||||||
if (empty($object->fields[$key]['searchmulti'])) {
|
if (empty($field_spec['searchmulti'])) {
|
||||||
if (!is_array($search[$key]) && $search[$key] != '') {
|
if (!is_array($search[$key]) && $search[$key] != '') {
|
||||||
$sql .= natural_search("t.".$db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search));
|
$sql .= natural_search("t.".$db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search));
|
||||||
}
|
}
|
||||||
@@ -829,15 +833,15 @@ while ($i < $imaxinloop) {
|
|||||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||||
print '<td'.($cssforfield ? ' class="'.$cssforfield.((preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key)) ? ' classfortooltip' : '').'"' : '');
|
print '<td'.($cssforfield ? ' class="'.$cssforfield.((preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key)) ? ' classfortooltip' : '').'"' : '');
|
||||||
if (preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key) && !in_array($key, array('ref'))) {
|
if (preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key) && !in_array($key, array('ref'))) {
|
||||||
print ' title="'.dol_escape_htmltag($object->$key).'"';
|
print ' title="'.dol_escape_htmltag((string) $object->$key).'"';
|
||||||
}
|
}
|
||||||
print '>';
|
print '>';
|
||||||
if ($key == 'status') {
|
if ($key == 'status') {
|
||||||
print $object->getLibStatut(5);
|
print $object->getLibStatut(5);
|
||||||
} elseif ($key == 'rowid') {
|
} elseif ($key == 'rowid') {
|
||||||
print $object->showOutputField($val, $key, $object->id, '');
|
print $object->showOutputField($val, $key, (string) $object->id, '');
|
||||||
} else {
|
} else {
|
||||||
print $object->showOutputField($val, $key, $object->$key, '');
|
print $object->showOutputField($val, $key, (string) $object->$key, '');
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
|
|||||||
Reference in New Issue
Block a user