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',
'buttonnew'=>'AddWarehouse',
'project_field'=>'fk_project',
'testnew'=>$user->rights->stock->creer,
'test'=>$conf->stock->enabled && $user->rights->stock->lire && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROJECT)),
'testnew'=>$user->hasRight('stock', 'creer'),
'test'=>!empty($conf->stock->enabled) && $user->hasRight('stock', 'lire') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROJECT)),
'propal'=>array(
'name'=>"Proposals",
'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),
'lang'=>'propal',
'buttonnew'=>'AddProp',
'testnew'=>$user->rights->propal->creer,
'test'=>$conf->propal->enabled && $user->rights->propal->lire),
'testnew'=>$user->hasRight('propal', 'creer'),
'test'=>!empty($conf->propal->enabled) && $user->hasRight('propal', 'lire')),
'order'=>array(
'name'=>"CustomersOrders",
'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),
'lang'=>'orders',
'buttonnew'=>'CreateOrder',
'testnew'=>$user->rights->commande->creer,
'test'=>$conf->commande->enabled && $user->rights->commande->lire),
'testnew'=>$user->hasRight('commande', 'creer'),
'test'=>!empty($conf->commande->enabled) && $user->hasRight('commande', 'lire')),
'invoice'=>array(
'name'=>"CustomersInvoices",
'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),
'lang'=>'bills',
'buttonnew'=>'CreateBill',
'testnew'=>$user->rights->facture->creer,
'test'=>$conf->facture->enabled && $user->rights->facture->lire),
'testnew'=>$user->hasRight('facture', 'creer'),
'test'=>!empty($conf->facture->enabled) && $user->hasRight('facture', 'lire')),
'invoice_predefined'=>array(
'name'=>"PredefinedInvoices",
'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),
'lang'=>'bills',
'buttonnew'=>'CreateBill',
'testnew'=>$user->rights->facture->creer,
'test'=>$conf->facture->enabled && $user->rights->facture->lire),
'testnew'=>$user->hasRight('facture', 'creer'),
'test'=>!empty($conf->facture->enabled) && $user->hasRight('facture', 'lire')),
'proposal_supplier'=>array(
'name'=>"SuppliersProposals",
'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
'lang'=>'supplier_proposal',
'buttonnew'=>'AddSupplierProposal',
'testnew'=>$user->rights->supplier_proposal->creer,
'test'=>$conf->supplier_proposal->enabled && $user->rights->supplier_proposal->lire),
'testnew'=>$user->hasRight('supplier_proposal', 'creer'),
'test'=>!empty($conf->supplier_proposal->enabled) && $user->hasRight('supplier_proposal', 'lire')),
'order_supplier'=>array(
'name'=>"SuppliersOrders",
'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
'lang'=>'suppliers',
'buttonnew'=>'AddSupplierOrder',
'testnew'=>($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer),
'test'=>$conf->supplier_order->enabled && ($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)),
'testnew'=>$user->hasRight('fournisseur', 'commande', 'creer') || $user->hasRight('supplier_order', 'creer'),
'test'=>!empty($conf->supplier_order->enabled) && $user->hasRight('fournisseur', 'commande', 'lire') || $user->hasRight('supplier_order', 'lire')),
'invoice_supplier'=>array(
'name'=>"BillsSuppliers",
'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
'lang'=>'suppliers',
'buttonnew'=>'AddSupplierInvoice',
'testnew'=>($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer),
'test'=>$conf->supplier_invoice->enabled && ($user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->lire)),
'testnew'=>$user->hasRight('fournisseur', 'facture', 'creer') || $user->hasRight('supplier_invoice', 'creer'),
'test'=>!empty($conf->supplier_invoice->enabled) && $user->hasRight('fournisseur', 'facture', 'lire') || $user->hasRight('supplier_invoice', 'lire')),
'contract'=>array(
'name'=>"Contracts",
'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),
'lang'=>'contracts',
'buttonnew'=>'AddContract',
'testnew'=>$user->rights->contrat->creer,
'test'=>$conf->contrat->enabled && $user->rights->contrat->lire),
'testnew'=>$user->hasRight('contrat', 'creer'),
'test'=>!empty($conf->contrat->enabled) && $user->hasRight('contrat', 'lire')),
'intervention'=>array(
'name'=>"Interventions",
'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),
'lang'=>'interventions',
'buttonnew'=>'AddIntervention',
'testnew'=>$user->rights->ficheinter->creer,
'test'=>$conf->ficheinter->enabled && $user->rights->ficheinter->lire),
'testnew'=>$user->hasRight('ficheinter', 'creer'),
'test'=>!empty($conf->ficheinter->enabled) && $user->hasRight('ficheinter', 'lire')),
'shipping'=>array(
'name'=>"Shippings",
'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),
'lang'=>'mrp',
'buttonnew'=>'CreateMO',
'testnew'=>'$user->rights->mrp->write',
'testnew'=>$user->hasRight('mrp', 'write'),
'project_field'=>'fk_project',
'test'=>$conf->mrp->enabled && $user->rights->mrp->read),
'test'=>!empty($conf->mrp->enabled) && $user->hasRight('mrp', 'read')),
'trip'=>array(
'name'=>"TripsAndExpenses",
'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),
'lang'=>'trips',
'buttonnew'=>'AddTrip',
'testnew'=>$user->rights->deplacement->creer,
'test'=>$conf->deplacement->enabled && $user->rights->deplacement->lire),
'testnew'=>$user->hasRight('deplacement', 'creer'),
'test'=>!empty($conf->deplacement->enabled) && $user->hasRight('deplacement', 'lire')),
'expensereport'=>array(
'name'=>"ExpenseReports",
'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),
'lang'=>'trips',
'buttonnew'=>'AddTrip',
'testnew'=>$user->rights->expensereport->creer,
'test'=>$conf->expensereport->enabled && $user->rights->expensereport->lire),
'testnew'=>$user->hasRight('expensereport', 'creer'),
'test'=>!empty($conf->expensereport->enabled) && $user->hasRight('expensereport', 'lire')),
'donation'=>array(
'name'=>"Donation",
'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),
'lang'=>'donations',
'buttonnew'=>'AddDonation',
'testnew'=>$user->rights->don->creer,
'test'=>$conf->don->enabled && $user->rights->don->lire),
'testnew'=>$user->hasRight('don', 'creer'),
'test'=>!empty($conf->don->enabled) && $user->hasRight('don', 'lire')),
'loan'=>array(
'name'=>"Loan",
'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),
'lang'=>'loan',
'buttonnew'=>'AddLoan',
'testnew'=>$user->rights->loan->write,
'test'=>$conf->loan->enabled && $user->rights->loan->read),
'testnew'=>$user->hasRight('loan', 'write'),
'test'=>!empty($conf->loan->enabled) && $user->hasRight('loan', 'read')),
'chargesociales'=>array(
'name'=>"SocialContribution",
'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),
'lang'=>'compta',
'buttonnew'=>'AddSocialContribution',
'testnew'=>$user->rights->tax->charges->lire,
'test'=>$conf->tax->enabled && $user->rights->tax->charges->lire),
'testnew'=>$user->hasRight('tax', 'charges', 'lire'),
'test'=>!empty($conf->tax->enabled) && $user->hasRight('tax', 'charges', 'lire')),
'project_task'=>array(
'name'=>"TaskTimeSpent",
'title'=>"ListTaskTimeUserProject",
@ -579,8 +579,8 @@ $listofreferent = array(
'disableamount'=>0,
'urlnew'=>DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&action=createtime&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
'buttonnew'=>'AddTimeSpent',
'testnew'=>$user->rights->projet->creer,
'test'=>($conf->project->enabled && $user->rights->projet->lire && empty($conf->global->PROJECT_HIDE_TASKS))),
'testnew'=>$user->hasRight('project', 'creer'),
'test'=>!empty($conf->project->enabled) && $user->hasRight('projet', 'lire') && !empty($conf->global->PROJECT_HIDE_TASKS)),
'stock_mouvement'=>array(
'name'=>"MouvementStockAssociated",
'title'=>"ListMouvementStockProject",
@ -589,7 +589,7 @@ $listofreferent = array(
'table'=>'stock_mouvement',
'datefieldname'=>'datem',
'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(
'name'=>"Salaries",
'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),
'lang'=>'salaries',
'buttonnew'=>'AddSalary',
'testnew'=>$user->rights->salaries->write,
'test'=>$conf->salaries->enabled && $user->rights->salaries->read),
'testnew'=>$user->hasRight('salaries', 'write'),
'test'=>!empty($conf->salaries->enabled) && $user->hasRight('salaries', 'read')),
'variouspayment'=>array(
'name'=>"VariousPayments",
'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),
'lang'=>'banks',
'buttonnew'=>'AddVariousPayment',
'testnew'=>$user->rights->banque->modifier,
'test'=>$conf->banque->enabled && $user->rights->banque->lire && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)),
'testnew'=>$user->hasRight('banque', 'modifier'),
'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"
'agenda'=>array(
'name'=>"Agenda",