Merge pull request #23338 from braito4/patch-3

php 8 warnings test and testnew
This commit is contained in:
Laurent Destailleur 2022-12-27 14:50:19 +01:00 committed by GitHub
commit 3f99670b97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -376,8 +376,8 @@ $listofreferent = array(
'lang'=>'entrepot', 'lang'=>'entrepot',
'buttonnew'=>'AddWarehouse', 'buttonnew'=>'AddWarehouse',
'project_field'=>'fk_project', 'project_field'=>'fk_project',
'testnew'=>$user->rights->stock->creer, 'testnew'=>$user->hasRight('stock', 'creer'),
'test'=>$conf->stock->enabled && $user->rights->stock->lire && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROJECT)), 'test'=>!empty($conf->stock->enabled) && $user->hasRight('stock', 'lire') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROJECT)),
'propal'=>array( 'propal'=>array(
'name'=>"Proposals", 'name'=>"Proposals",
'title'=>"ListProposalsAssociatedProject", 'title'=>"ListProposalsAssociatedProject",
@ -387,8 +387,8 @@ $listofreferent = array(
'urlnew'=>DOL_URL_ROOT.'/comm/propal/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'urlnew'=>DOL_URL_ROOT.'/comm/propal/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
'lang'=>'propal', 'lang'=>'propal',
'buttonnew'=>'AddProp', 'buttonnew'=>'AddProp',
'testnew'=>$user->rights->propal->creer, 'testnew'=>$user->hasRight('propal', 'creer'),
'test'=>$conf->propal->enabled && $user->rights->propal->lire), 'test'=>!empty($conf->propal->enabled) && $user->hasRight('propal', 'lire')),
'order'=>array( 'order'=>array(
'name'=>"CustomersOrders", 'name'=>"CustomersOrders",
'title'=>"ListOrdersAssociatedProject", 'title'=>"ListOrdersAssociatedProject",
@ -398,8 +398,8 @@ $listofreferent = array(
'urlnew'=>DOL_URL_ROOT.'/commande/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'urlnew'=>DOL_URL_ROOT.'/commande/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
'lang'=>'orders', 'lang'=>'orders',
'buttonnew'=>'CreateOrder', 'buttonnew'=>'CreateOrder',
'testnew'=>$user->rights->commande->creer, 'testnew'=>$user->hasRight('commande', 'creer'),
'test'=>$conf->commande->enabled && $user->rights->commande->lire), 'test'=>!empty($conf->commande->enabled) && $user->hasRight('commande', 'lire')),
'invoice'=>array( 'invoice'=>array(
'name'=>"CustomersInvoices", 'name'=>"CustomersInvoices",
'title'=>"ListInvoicesAssociatedProject", 'title'=>"ListInvoicesAssociatedProject",
@ -410,8 +410,8 @@ $listofreferent = array(
'urlnew'=>DOL_URL_ROOT.'/compta/facture/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'urlnew'=>DOL_URL_ROOT.'/compta/facture/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
'lang'=>'bills', 'lang'=>'bills',
'buttonnew'=>'CreateBill', 'buttonnew'=>'CreateBill',
'testnew'=>$user->rights->facture->creer, 'testnew'=>$user->hasRight('facture', 'creer'),
'test'=>$conf->facture->enabled && $user->rights->facture->lire), 'test'=>!empty($conf->facture->enabled) && $user->hasRight('facture', 'lire')),
'invoice_predefined'=>array( 'invoice_predefined'=>array(
'name'=>"PredefinedInvoices", 'name'=>"PredefinedInvoices",
'title'=>"ListPredefinedInvoicesAssociatedProject", 'title'=>"ListPredefinedInvoicesAssociatedProject",
@ -421,8 +421,8 @@ $listofreferent = array(
'urlnew'=>DOL_URL_ROOT.'/compta/facture/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'urlnew'=>DOL_URL_ROOT.'/compta/facture/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
'lang'=>'bills', 'lang'=>'bills',
'buttonnew'=>'CreateBill', 'buttonnew'=>'CreateBill',
'testnew'=>$user->rights->facture->creer, 'testnew'=>$user->hasRight('facture', 'creer'),
'test'=>$conf->facture->enabled && $user->rights->facture->lire), 'test'=>!empty($conf->facture->enabled) && $user->hasRight('facture', 'lire')),
'proposal_supplier'=>array( 'proposal_supplier'=>array(
'name'=>"SuppliersProposals", 'name'=>"SuppliersProposals",
'title'=>"ListSupplierProposalsAssociatedProject", 'title'=>"ListSupplierProposalsAssociatedProject",
@ -432,8 +432,8 @@ $listofreferent = array(
'urlnew'=>DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), // No socid parameter here, the socid is often the customer and we create a supplier object 'urlnew'=>DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), // No socid parameter here, the socid is often the customer and we create a supplier object
'lang'=>'supplier_proposal', 'lang'=>'supplier_proposal',
'buttonnew'=>'AddSupplierProposal', 'buttonnew'=>'AddSupplierProposal',
'testnew'=>$user->rights->supplier_proposal->creer, 'testnew'=>$user->hasRight('supplier_proposal', 'creer'),
'test'=>$conf->supplier_proposal->enabled && $user->rights->supplier_proposal->lire), 'test'=>!empty($conf->supplier_proposal->enabled) && $user->hasRight('supplier_proposal', 'lire')),
'order_supplier'=>array( 'order_supplier'=>array(
'name'=>"SuppliersOrders", 'name'=>"SuppliersOrders",
'title'=>"ListSupplierOrdersAssociatedProject", 'title'=>"ListSupplierOrdersAssociatedProject",
@ -443,8 +443,8 @@ $listofreferent = array(
'urlnew'=>DOL_URL_ROOT.'/fourn/commande/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), // No socid parameter here, the socid is often the customer and we create a supplier object 'urlnew'=>DOL_URL_ROOT.'/fourn/commande/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), // No socid parameter here, the socid is often the customer and we create a supplier object
'lang'=>'suppliers', 'lang'=>'suppliers',
'buttonnew'=>'AddSupplierOrder', 'buttonnew'=>'AddSupplierOrder',
'testnew'=>($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer), 'testnew'=>$user->hasRight('fournisseur', 'commande', 'creer') || $user->hasRight('supplier_order', 'creer'),
'test'=>$conf->supplier_order->enabled && ($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)), 'test'=>!empty($conf->supplier_order->enabled) && $user->hasRight('fournisseur', 'commande', 'lire') || $user->hasRight('supplier_order', 'lire')),
'invoice_supplier'=>array( 'invoice_supplier'=>array(
'name'=>"BillsSuppliers", 'name'=>"BillsSuppliers",
'title'=>"ListSupplierInvoicesAssociatedProject", 'title'=>"ListSupplierInvoicesAssociatedProject",
@ -455,8 +455,8 @@ $listofreferent = array(
'urlnew'=>DOL_URL_ROOT.'/fourn/facture/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), // No socid parameter here, the socid is often the customer and we create a supplier object 'urlnew'=>DOL_URL_ROOT.'/fourn/facture/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), // No socid parameter here, the socid is often the customer and we create a supplier object
'lang'=>'suppliers', 'lang'=>'suppliers',
'buttonnew'=>'AddSupplierInvoice', 'buttonnew'=>'AddSupplierInvoice',
'testnew'=>($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer), 'testnew'=>$user->hasRight('fournisseur', 'facture', 'creer') || $user->hasRight('supplier_invoice', 'creer'),
'test'=>$conf->supplier_invoice->enabled && ($user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->lire)), 'test'=>!empty($conf->supplier_invoice->enabled) && $user->hasRight('fournisseur', 'facture', 'lire') || $user->hasRight('supplier_invoice', 'lire')),
'contract'=>array( 'contract'=>array(
'name'=>"Contracts", 'name'=>"Contracts",
'title'=>"ListContractAssociatedProject", 'title'=>"ListContractAssociatedProject",
@ -466,8 +466,8 @@ $listofreferent = array(
'urlnew'=>DOL_URL_ROOT.'/contrat/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'urlnew'=>DOL_URL_ROOT.'/contrat/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
'lang'=>'contracts', 'lang'=>'contracts',
'buttonnew'=>'AddContract', 'buttonnew'=>'AddContract',
'testnew'=>$user->rights->contrat->creer, 'testnew'=>$user->hasRight('contrat', 'creer'),
'test'=>$conf->contrat->enabled && $user->rights->contrat->lire), 'test'=>!empty($conf->contrat->enabled) && $user->hasRight('contrat', 'lire')),
'intervention'=>array( 'intervention'=>array(
'name'=>"Interventions", 'name'=>"Interventions",
'title'=>"ListFichinterAssociatedProject", 'title'=>"ListFichinterAssociatedProject",
@ -479,8 +479,8 @@ $listofreferent = array(
'urlnew'=>DOL_URL_ROOT.'/fichinter/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'urlnew'=>DOL_URL_ROOT.'/fichinter/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
'lang'=>'interventions', 'lang'=>'interventions',
'buttonnew'=>'AddIntervention', 'buttonnew'=>'AddIntervention',
'testnew'=>$user->rights->ficheinter->creer, 'testnew'=>$user->hasRight('ficheinter', 'creer'),
'test'=>$conf->ficheinter->enabled && $user->rights->ficheinter->lire), 'test'=>!empty($conf->ficheinter->enabled) && $user->hasRight('ficheinter', 'lire')),
'shipping'=>array( 'shipping'=>array(
'name'=>"Shippings", 'name'=>"Shippings",
'title'=>"ListShippingAssociatedProject", 'title'=>"ListShippingAssociatedProject",
@ -501,9 +501,9 @@ $listofreferent = array(
'urlnew'=>DOL_URL_ROOT.'/mrp/mo_card.php?action=create&origin=project&originid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'urlnew'=>DOL_URL_ROOT.'/mrp/mo_card.php?action=create&origin=project&originid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
'lang'=>'mrp', 'lang'=>'mrp',
'buttonnew'=>'CreateMO', 'buttonnew'=>'CreateMO',
'testnew'=>'$user->rights->mrp->write', 'testnew'=>$user->hasRight('mrp', 'write'),
'project_field'=>'fk_project', 'project_field'=>'fk_project',
'test'=>$conf->mrp->enabled && $user->rights->mrp->read), 'test'=>!empty($conf->mrp->enabled) && $user->hasRight('mrp', 'read')),
'trip'=>array( 'trip'=>array(
'name'=>"TripsAndExpenses", 'name'=>"TripsAndExpenses",
'title'=>"ListExpenseReportsAssociatedProject", 'title'=>"ListExpenseReportsAssociatedProject",
@ -515,8 +515,8 @@ $listofreferent = array(
'urlnew'=>DOL_URL_ROOT.'/deplacement/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'urlnew'=>DOL_URL_ROOT.'/deplacement/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
'lang'=>'trips', 'lang'=>'trips',
'buttonnew'=>'AddTrip', 'buttonnew'=>'AddTrip',
'testnew'=>$user->rights->deplacement->creer, 'testnew'=>$user->hasRight('deplacement', 'creer'),
'test'=>$conf->deplacement->enabled && $user->rights->deplacement->lire), 'test'=>!empty($conf->deplacement->enabled) && $user->hasRight('deplacement', 'lire')),
'expensereport'=>array( 'expensereport'=>array(
'name'=>"ExpenseReports", 'name'=>"ExpenseReports",
'title'=>"ListExpenseReportsAssociatedProject", 'title'=>"ListExpenseReportsAssociatedProject",
@ -528,8 +528,8 @@ $listofreferent = array(
'urlnew'=>DOL_URL_ROOT.'/expensereport/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'urlnew'=>DOL_URL_ROOT.'/expensereport/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
'lang'=>'trips', 'lang'=>'trips',
'buttonnew'=>'AddTrip', 'buttonnew'=>'AddTrip',
'testnew'=>$user->rights->expensereport->creer, 'testnew'=>$user->hasRight('expensereport', 'creer'),
'test'=>$conf->expensereport->enabled && $user->rights->expensereport->lire), 'test'=>!empty($conf->expensereport->enabled) && $user->hasRight('expensereport', 'lire')),
'donation'=>array( 'donation'=>array(
'name'=>"Donation", 'name'=>"Donation",
'title'=>"ListDonationsAssociatedProject", 'title'=>"ListDonationsAssociatedProject",
@ -541,8 +541,8 @@ $listofreferent = array(
'urlnew'=>DOL_URL_ROOT.'/don/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'urlnew'=>DOL_URL_ROOT.'/don/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
'lang'=>'donations', 'lang'=>'donations',
'buttonnew'=>'AddDonation', 'buttonnew'=>'AddDonation',
'testnew'=>$user->rights->don->creer, 'testnew'=>$user->hasRight('don', 'creer'),
'test'=>$conf->don->enabled && $user->rights->don->lire), 'test'=>!empty($conf->don->enabled) && $user->hasRight('don', 'lire')),
'loan'=>array( 'loan'=>array(
'name'=>"Loan", 'name'=>"Loan",
'title'=>"ListLoanAssociatedProject", 'title'=>"ListLoanAssociatedProject",
@ -554,8 +554,8 @@ $listofreferent = array(
'urlnew'=>DOL_URL_ROOT.'/loan/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'urlnew'=>DOL_URL_ROOT.'/loan/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
'lang'=>'loan', 'lang'=>'loan',
'buttonnew'=>'AddLoan', 'buttonnew'=>'AddLoan',
'testnew'=>$user->rights->loan->write, 'testnew'=>$user->hasRight('loan', 'write'),
'test'=>$conf->loan->enabled && $user->rights->loan->read), 'test'=>!empty($conf->loan->enabled) && $user->hasRight('loan', 'read')),
'chargesociales'=>array( 'chargesociales'=>array(
'name'=>"SocialContribution", 'name'=>"SocialContribution",
'title'=>"ListSocialContributionAssociatedProject", 'title'=>"ListSocialContributionAssociatedProject",
@ -567,8 +567,8 @@ $listofreferent = array(
'urlnew'=>DOL_URL_ROOT.'/compta/sociales/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'urlnew'=>DOL_URL_ROOT.'/compta/sociales/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
'lang'=>'compta', 'lang'=>'compta',
'buttonnew'=>'AddSocialContribution', 'buttonnew'=>'AddSocialContribution',
'testnew'=>$user->rights->tax->charges->lire, 'testnew'=>$user->hasRight('tax', 'charges', 'lire'),
'test'=>$conf->tax->enabled && $user->rights->tax->charges->lire), 'test'=>!empty($conf->tax->enabled) && $user->hasRight('tax', 'charges', 'lire')),
'project_task'=>array( 'project_task'=>array(
'name'=>"TaskTimeSpent", 'name'=>"TaskTimeSpent",
'title'=>"ListTaskTimeUserProject", 'title'=>"ListTaskTimeUserProject",
@ -579,8 +579,8 @@ $listofreferent = array(
'disableamount'=>0, 'disableamount'=>0,
'urlnew'=>DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&action=createtime&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'urlnew'=>DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&action=createtime&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
'buttonnew'=>'AddTimeSpent', 'buttonnew'=>'AddTimeSpent',
'testnew'=>$user->rights->projet->creer, 'testnew'=>$user->hasRight('project', 'creer'),
'test'=>($conf->project->enabled && $user->rights->projet->lire && empty($conf->global->PROJECT_HIDE_TASKS))), 'test'=>!empty($conf->project->enabled) && $user->hasRight('projet', 'lire') && !empty($conf->global->PROJECT_HIDE_TASKS)),
'stock_mouvement'=>array( 'stock_mouvement'=>array(
'name'=>"MouvementStockAssociated", 'name'=>"MouvementStockAssociated",
'title'=>"ListMouvementStockProject", 'title'=>"ListMouvementStockProject",
@ -589,7 +589,7 @@ $listofreferent = array(
'table'=>'stock_mouvement', 'table'=>'stock_mouvement',
'datefieldname'=>'datem', 'datefieldname'=>'datem',
'disableamount'=>0, 'disableamount'=>0,
'test'=>($conf->stock->enabled && $user->rights->stock->mouvement->lire && !empty($conf->global->STOCK_MOVEMENT_INTO_PROJECT_OVERVIEW))), 'test'=>!empty($conf->stock->enabled) && $user->hasRight('stock', 'mouvement', 'lire') && !empty($conf->global->STOCK_MOVEMENT_INTO_PROJECT_OVERVIEW)),
'salaries'=>array( 'salaries'=>array(
'name'=>"Salaries", 'name'=>"Salaries",
'title'=>"ListSalariesAssociatedProject", 'title'=>"ListSalariesAssociatedProject",
@ -601,8 +601,8 @@ $listofreferent = array(
'urlnew'=>DOL_URL_ROOT.'/salaries/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'urlnew'=>DOL_URL_ROOT.'/salaries/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
'lang'=>'salaries', 'lang'=>'salaries',
'buttonnew'=>'AddSalary', 'buttonnew'=>'AddSalary',
'testnew'=>$user->rights->salaries->write, 'testnew'=>$user->hasRight('salaries', 'write'),
'test'=>$conf->salaries->enabled && $user->rights->salaries->read), 'test'=>!empty($conf->salaries->enabled) && $user->hasRight('salaries', 'read')),
'variouspayment'=>array( 'variouspayment'=>array(
'name'=>"VariousPayments", 'name'=>"VariousPayments",
'title'=>"ListVariousPaymentsAssociatedProject", 'title'=>"ListVariousPaymentsAssociatedProject",
@ -614,8 +614,8 @@ $listofreferent = array(
'urlnew'=>DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'urlnew'=>DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
'lang'=>'banks', 'lang'=>'banks',
'buttonnew'=>'AddVariousPayment', 'buttonnew'=>'AddVariousPayment',
'testnew'=>$user->rights->banque->modifier, 'testnew'=>$user->hasRight('banque', 'modifier'),
'test'=>$conf->banque->enabled && $user->rights->banque->lire && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)), 'test'=>!empty($conf->banque->enabled) && $user->hasRight('banque', 'lire') && !empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)),
/* No need for this, available on dedicated tab "Agenda/Events" /* No need for this, available on dedicated tab "Agenda/Events"
'agenda'=>array( 'agenda'=>array(
'name'=>"Agenda", 'name'=>"Agenda",