diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index e8d85f21c76..47bded0df29 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -6,6 +6,7 @@ * Copyright (C) 2014-2016 Juanjo Menent * Copyright (C) 2018 Alexandre Spangaro * Copyright (C) 2021-2023 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -203,6 +204,7 @@ foreach ($object->fields as $key => $val) { } } $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan //var_dump($arrayfields);exit; // Security check diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 6eb5db86056..3abd25ae840 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -177,6 +177,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan $result = restrictedArea($user, 'agenda', 0, '', 'myactions'); if ($user->socid && $socid) { diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index e01dd74859e..22703534d89 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -227,6 +227,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); //$arrayfields['anotherfield'] = array('type'=>'integer', 'label'=>'AnotherField', 'checked'=>1, 'enabled'=>1, 'position'=>90, 'csslist'=>'right'); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan // Security check diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php index 2046845b8db..d9435aea40f 100644 --- a/htdocs/commande/list_det.php +++ b/htdocs/commande/list_det.php @@ -231,6 +231,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan if (!$user->hasRight('societe', 'client', 'voir')) { $search_sale = $user->id; @@ -1295,6 +1296,7 @@ if ($resql) { // Détail commande if (!empty($arrayfields['rowid']['checked'])) { print_liste_field_titre($arrayfields['rowid']['label'], $_SERVER["PHP_SELF"], 'rowid', '', $param, '', $sortfield, $sortorder); + '@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan } if (!empty($arrayfields['pr.ref']['checked'])) { print_liste_field_titre($arrayfields['pr.ref']['label'], $_SERVER["PHP_SELF"], 'pr.ref', '', $param, '', $sortfield, $sortorder); diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index 480c36cd07e..76a3f8e2abd 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -5,6 +5,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2020 Tobias Sekan + * 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 @@ -125,6 +126,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan $permissiontoadd = $user->hasRight('banque', 'modifier'); $permissiontodelete = $user->hasRight('banque', 'configurer'); diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index 8a2aa9178f7..d41e3c2e4a6 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -3,6 +3,7 @@ * Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2018 Frédéric France * Copyright (C) 2020 Tobias Sekan + * 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 @@ -172,6 +173,7 @@ $arrayfields = array( ); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan // Security check $socid = GETPOSTINT("socid"); diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 63e01dac397..0c5526d0ae9 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -9,6 +9,7 @@ * Copyright (C) 2015-2021 Alexandre Spangaro * Copyright (C) 2016 Meziane Sof * Copyright (C) 2023 William Mead + * 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 @@ -161,6 +162,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan if ($socid > 0) { $tmpthirdparty = new Societe($db); diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 13995e6cc0b..63cee7e8709 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -293,6 +293,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan if (!$user->hasRight('societe', 'client', 'voir')) { $search_sale = $user->id; diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index 7243c91f3c3..c639acd036e 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -4,6 +4,7 @@ * Copyright (C) 2009-2012 Regis Houssin * Copyright (C) 2014 Alexandre Spangaro * Copyright (C) 2016 Juanjo Menent + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -99,6 +100,7 @@ $arrayfields = array( 'bc.statut' => array('label' => "Status", 'checked' => 1, 'position' => 70) ); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('chequelist')); diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 12c2ec797d8..2ae8ee73d74 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -9,6 +9,7 @@ * Copyright (C) 2018-2021 Ferran Marcet * Copyright (C) 2018 Charlene Benke * Copyright (C) 2020 Tobias Sekan + * 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 @@ -110,6 +111,7 @@ $arrayfields = array( 'p.statut' => array('label' => "Status", 'checked' => 1, 'position' => 90, 'enabled' => (getDolGlobalString('BILL_ADD_PAYMENT_VALIDATION'))), ); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('paymentlist')); diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 5f07abd308a..d31e12f575b 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -7,6 +7,7 @@ * Copyright (C) 2020 Tobias Sekan * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2021-2023 Alexandre Spangaro + * 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 @@ -114,6 +115,7 @@ if (isModEnabled("bank")) { } $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('sclist')); diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 573c3d50289..68e84da8be2 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -5,6 +5,7 @@ * Copyright (C) 2011-2019 Alexandre Spangaro * Copyright (C) 2020 Tobias Sekan * Copyright (C) 2021 Gauthier VERDOL + * 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 @@ -95,6 +96,7 @@ if (isModEnabled("bank")) { } $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('salestaxeslist')); diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index d391b2e8d4b..c7058f80d68 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -12,6 +12,7 @@ * Copyright (C) 2019 Frédéric France * Copyright (C) 2019 Josep Lluís Amador * Copyright (C) 2020 Open-Dsi + * 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 @@ -268,6 +269,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); //$arrayfields['anotherfield'] = array('type'=>'integer', 'label'=>'AnotherField', 'checked'=>1, 'enabled'=>1, 'position'=>90, 'csslist'=>'right'); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan if (($id > 0 || !empty($ref)) && $action != 'add') { diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index a9c49bbeaab..43c7b8da85b 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -9,6 +9,7 @@ * Copyright (C) 2016-2018 Ferran Marcet * Copyright (C) 2019 Nicolas Zabouri * Copyright (C) 2021 Alexandre Spangaro + * 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 @@ -194,6 +195,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan if (!$user->hasRight('societe', 'client', 'voir')) { $search_sale = $user->id; diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index a2542669485..c61e72867f2 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -7,6 +7,7 @@ * Copyright (C) 2018 Frédéric France * Copyright (C) 2019 Juanjo Menent * Copyright (C) 2023-2024 William Mead + * 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 @@ -139,6 +140,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan $permissiontoread = $user->hasRight('contrat', 'lire'); $permissiontoadd = $user->hasRight('contrat', 'creer'); diff --git a/htdocs/don/paiement/list.php b/htdocs/don/paiement/list.php index b314131ca5b..23288c8035e 100644 --- a/htdocs/don/paiement/list.php +++ b/htdocs/don/paiement/list.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2019 Thibault FOUCART + * 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 +99,7 @@ $arrayfields = array( 'pd.amount' => array('label' => "Amount", 'checked' => 1, 'position' => 80), ); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan $optioncss = GETPOST('optioncss', 'alpha'); $moreforfilter = GETPOST('moreforfilter', 'alpha'); diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 69980c72d1e..0e0fedc9c5d 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -6,6 +6,7 @@ * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2020 Thibault FOUCART * Copyright (C) 2023 Christophe Battarel + * 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 @@ -145,6 +146,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan // Security check $expeditionid = GETPOSTINT('id'); diff --git a/htdocs/expensereport/payment/list.php b/htdocs/expensereport/payment/list.php index c1f474af0db..88431f01682 100644 --- a/htdocs/expensereport/payment/list.php +++ b/htdocs/expensereport/payment/list.php @@ -112,6 +112,7 @@ $arrayfields = array( 'pndf.amount' => array('label' => "Amount", 'checked' => 1, 'position' => 70), ); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('paymentexpensereportlist')); diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 20878a34e16..a04b89bef02 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -9,6 +9,7 @@ * Copyright (C) 2021-2023 Frédéric France * Copyright (C) 2022 Charlène Benke * Copyright (C) 2024 William Mead + * 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 @@ -149,6 +150,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan // Security check $id = GETPOSTINT('id'); diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 1bab50ecddd..e42b0e326eb 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -10,6 +10,7 @@ * Copyright (C) 2018-2022 Charlene Benke * Copyright (C) 2019 Nicolas Zabouri * Copyright (C) 2021-2023 Alexandre Spangaro + * 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 @@ -211,6 +212,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan $error = 0; diff --git a/htdocs/fourn/facture/list-rec.php b/htdocs/fourn/facture/list-rec.php index 62531e8a569..cfa3fbdc457 100644 --- a/htdocs/fourn/facture/list-rec.php +++ b/htdocs/fourn/facture/list-rec.php @@ -8,6 +8,7 @@ * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2015-2021 Alexandre Spangaro * Copyright (C) 2016 Meziane Sof + * 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 @@ -159,6 +160,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan if ($socid > 0) { $tmpthirdparty = new Societe($db); diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 4772ddea4e8..6cf9a81433d 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -212,6 +212,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan if (!isModEnabled('supplier_invoice')) { accessforbidden(); diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index aa328d13024..a354a15f3bc 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -12,6 +12,7 @@ * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2020 Tobias Sekan * Copyright (C) 2021 Ferran Marcet + * 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 @@ -107,6 +108,7 @@ $arrayfields = array( 'p.amount' => array('label' => "Amount", 'checked' => 1, 'position' => 70), ); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('paymentsupplierlist')); diff --git a/htdocs/intracommreport/list.php b/htdocs/intracommreport/list.php index 132163b1f89..cbdd0838d0c 100644 --- a/htdocs/intracommreport/list.php +++ b/htdocs/intracommreport/list.php @@ -1,6 +1,7 @@ * Copyright (C) 2019-2020 Open-DSI + * 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 @@ -143,6 +144,7 @@ if (isset($extrafields->attributes[$object->table_element]['label']) && is_array $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan // Security check if ($search_type == '0') { diff --git a/htdocs/multicurrency/multicurrency_rate.php b/htdocs/multicurrency/multicurrency_rate.php index 836b3de06de..430dda9ec0a 100644 --- a/htdocs/multicurrency/multicurrency_rate.php +++ b/htdocs/multicurrency/multicurrency_rate.php @@ -12,6 +12,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016 Ferran Marcet * Copyright (C) 2023 Lenin Rivas + * 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 @@ -93,23 +94,24 @@ if (empty($action)) { // List of fields to search into when doing a "search in all" $fieldstosearchall = array( - 'cr.date_sync'=>"date_sync", - 'cr.rate'=>"rate", - 'cr.rate_indirect'=>"rate_indirect", - 'm.code'=>"code", + 'cr.date_sync' => "date_sync", + 'cr.rate' => "rate", + 'cr.rate_indirect' => "rate_indirect", + 'm.code' => "code", ); // Definition of fields for lists $arrayfields = array( - 'cr.date_sync'=>array('label'=>'Date', 'checked'=>1), - 'cr.rate'=>array('label'=>'Rate', 'checked'=>1), - 'cr.rate_indirect'=>array('label'=>'RateIndirect', 'checked'=>0, 'enabled'=>(!getDolGlobalString('MULTICURRENCY_USE_RATE_INDIRECT') ? 0 : 1)), - 'm.code'=>array('label'=>'Code', 'checked'=>1), + 'cr.date_sync' => array('label' => 'Date', 'checked' => 1), + 'cr.rate' => array('label' => 'Rate', 'checked' => 1), + 'cr.rate_indirect' => array('label' => 'RateIndirect', 'checked' => 0, 'enabled' => (!getDolGlobalString('MULTICURRENCY_USE_RATE_INDIRECT') ? 0 : 1)), + 'm.code' => array('label' => 'Code', 'checked' => 1), ); $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan // Access control // TODO Open this page to a given permission so a sale representative can modify change rates. Permission should be added into module multicurrency. @@ -242,7 +244,7 @@ if (empty($reshook)) { 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 $sall = ""; $search_date_sync = ""; - $search_date_sync_end=""; + $search_date_sync_end = ""; $search_rate = ""; $search_code = ""; $search_array_options = array(); @@ -403,13 +405,13 @@ if ($resql) { $param = "&search_date_sync=".$search_date_sync; } if ($search_date_sync_end) { - $param="&search_date_sync_end=".$search_date_sync_end; + $param = "&search_date_sync_end=".$search_date_sync_end; } if ($search_rate) { $param = "&search_rate=".urlencode($search_rate); } if ($search_code != '') { - $param.="&search_code=".urlencode($search_code); + $param .= "&search_code=".urlencode($search_code); } // Add $param from extra fields @@ -504,7 +506,7 @@ if ($resql) { } // Fields from hook - $parameters = array('arrayfields'=>$arrayfields); + $parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -533,7 +535,7 @@ if ($resql) { } // Hook fields - $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); + $parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column @@ -669,5 +671,5 @@ if ($resql) { } - llxFooter(); - $db->close(); +llxFooter(); +$db->close(); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 7d387457b23..d7f5d7450ba 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -308,6 +308,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan // Security check if ($search_type == '0') { diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 4e0f40d0127..9b07083156d 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -261,6 +261,7 @@ if (GETPOST('search_usage_event_organization')) { $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan /* diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index c3e91e95c88..a093682ecde 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -177,6 +177,7 @@ $extrafieldsobjectprefix = 'efpt.'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index a7a5c47d757..eda19a63dab 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -5,6 +5,7 @@ * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2021 Alexandre Spangaro * Copyright (C) 2023 Gauthier VERDOL + * 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 @@ -182,6 +183,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan $permissiontoread = $user->hasRight('projet', 'lire'); $permissiontocreate = $user->hasRight('projet', 'creer'); diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index c48a6f296cc..f12a06e2560 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1288,6 +1288,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; $arrayfields = dol_sort_array($arrayfields, 'position'); + '@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan $param = ''; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index 20b9262923f..e30f152fc61 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -140,6 +140,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan $error = 0; diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 33f21aa75bb..7f09a9d6b3a 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -3,6 +3,7 @@ * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2024 William Mead + * 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 @@ -157,6 +158,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; @@ -703,7 +705,7 @@ if ($num == 0) { $db->free($resql); -$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 498b869c92b..73fdb35e5af 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -319,6 +319,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan // Security check $socid = GETPOSTINT('socid'); diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index c34a60b581b..f6c08d20e4b 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -12,6 +12,7 @@ * Copyright (C) 2016 Ferran Marcet * Copyright (C) 2018-2023 Charlene Benke * Copyright (C) 2021 Alexandre Spangaro + * 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 @@ -197,6 +198,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan if (!$user->hasRight('societe', 'client', 'voir')) { $search_sale = $user->id; diff --git a/htdocs/user/list.php b/htdocs/user/list.php index e55dc5ea1bc..65955a4c39f 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -151,6 +151,7 @@ include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan // Init search fields $search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); diff --git a/htdocs/variants/list.php b/htdocs/variants/list.php index 0bee01ba154..8c2a486c322 100644 --- a/htdocs/variants/list.php +++ b/htdocs/variants/list.php @@ -1,6 +1,7 @@ * Copyright (C) 2022 Open-Dsi + * 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 @@ -97,7 +98,7 @@ foreach ($object->fields as $key => $val) { $fieldstosearchall['t.'.$key] = $val['label']; } } -$parameters = array('fieldstosearchall'=>$fieldstosearchall); +$parameters = array('fieldstosearchall' => $fieldstosearchall); $reshook = $hookmanager->executeHooks('completeFieldsToSearchAll', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $fieldstosearchall = empty($hookmanager->resArray['fieldstosearchall']) ? array() : $hookmanager->resArray['fieldstosearchall']; @@ -112,11 +113,11 @@ foreach ($object->fields as $key => $val) { if (!empty($val['visible'])) { $visible = (int) dol_eval($val['visible'], 1); $arrayfields['t.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } @@ -139,6 +140,7 @@ $arrayfields['nb_products'] = array( $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan $permissiontoread = $user->hasRight('variants', 'read'); $permissiontoadd = $user->hasRight('variants', 'write'); @@ -459,8 +461,8 @@ print ''; print ''; $newcardbutton = ''; -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/variants/card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); @@ -561,7 +563,7 @@ foreach ($object->fields as $key => $val) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -618,7 +620,7 @@ foreach ($object->fields as $key => $val) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -757,7 +759,7 @@ while ($i < $imaxinloop) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Other @@ -826,7 +828,7 @@ if ($num == 0) { $db->free($resql); -$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/workstation/workstation_list.php b/htdocs/workstation/workstation_list.php index 2d1e9d9fefc..3638739a101 100644 --- a/htdocs/workstation/workstation_list.php +++ b/htdocs/workstation/workstation_list.php @@ -2,6 +2,7 @@ /* Copyright (C) 2007-2017 Laurent Destailleur * Copyright (C) 2020 Gauthier VERDOL + * 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 @@ -149,6 +150,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan $permissiontoread = $user->hasRight('workstation', 'workstation', 'read'); $permissiontoadd = $user->hasRight('workstation', 'workstation', 'write');