Merge pull request #21686 from hregis/fix_php8_compatibility
FIX php8 compatibility
This commit is contained in:
commit
f95b70eb9b
@ -112,17 +112,17 @@ if ($id > 0 || !empty($ref)) {
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('propalcard', 'globalcard'));
|
||||
|
||||
$usercanread = $user->rights->propal->lire;
|
||||
$usercancreate = $user->rights->propal->creer;
|
||||
$usercandelete = $user->rights->propal->supprimer;
|
||||
$usercanread = $user->hasRight("propal", "lire");
|
||||
$usercancreate = $user->hasRight("propal", "creer");
|
||||
$usercandelete = $user->hasRight("propal", "supprimer");
|
||||
|
||||
$usercanclose = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->propal->propal_advance->close)));
|
||||
$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->propal->propal_advance->validate)));
|
||||
$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->propal->propal_advance->send)));
|
||||
|
||||
$usercancreateorder = $user->rights->commande->creer;
|
||||
$usercancreateinvoice = $user->rights->facture->creer;
|
||||
$usercancreatecontract = $user->rights->contrat->creer;
|
||||
$usercancreateorder = $user->hasRight("commande", "creer");
|
||||
$usercancreateinvoice = $user->hasRight("facture", "creer");
|
||||
$usercancreatecontract = $user->hasRight("contrat", "creer");
|
||||
$usercancreateintervention = $user->hasRight('ficheinter', 'creer');
|
||||
$usercancreatepurchaseorder = ($user->hasRight('fournisseur', 'commande', 'creer') || $user->hasRight('supplier_order', 'creer'));
|
||||
|
||||
|
||||
@ -108,16 +108,16 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
// Load object
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
|
||||
|
||||
$usercanread = $user->rights->commande->lire;
|
||||
$usercancreate = $user->rights->commande->creer;
|
||||
$usercandelete = $user->rights->commande->supprimer;
|
||||
$usercanread = $user->hasRight("commande", "lire");
|
||||
$usercancreate = $user->hasRight("commande", "creer");
|
||||
$usercandelete = $user->hasRight("commande", "supprimer");
|
||||
// Advanced permissions
|
||||
$usercanclose = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->close)));
|
||||
$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->validate)));
|
||||
$usercancancel = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->annuler)));
|
||||
$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->commande->order_advance->send);
|
||||
|
||||
$usercancreatepurchaseorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
|
||||
$usercancreatepurchaseorder = ($user->hasRight("fournisseur", "commande", "creer") || $user->hasRight("supplier_order", "creer"));
|
||||
|
||||
$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php
|
||||
$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php
|
||||
|
||||
@ -128,11 +128,11 @@ if ($id > 0 || !empty($ref)) {
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('invoicecard', 'globalcard'));
|
||||
|
||||
$usercanread = $user->rights->facture->lire;
|
||||
$usercancreate = $user->rights->facture->creer;
|
||||
$usercanissuepayment = $user->rights->facture->paiement;
|
||||
$usercandelete = $user->rights->facture->supprimer;
|
||||
$usercancreatecontract = $user->rights->contrat->creer;
|
||||
$usercanread = $user->hasRight("facture", "lire");
|
||||
$usercancreate = $user->hasRight("facture", "creer");
|
||||
$usercanissuepayment = $user->hasRight("facture", "paiement");
|
||||
$usercandelete = $user->hasRight("facture", "supprimer");
|
||||
$usercancreatecontract = $user->hasRight("contrat", "creer");
|
||||
$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->facture->invoice_advance->validate)));
|
||||
$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->facture->invoice_advance->send)));
|
||||
$usercanreopen = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->facture->invoice_advance->reopen)));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user