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
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$hookmanager->initHooks(array('propalcard', 'globalcard'));
|
$hookmanager->initHooks(array('propalcard', 'globalcard'));
|
||||||
|
|
||||||
$usercanread = $user->rights->propal->lire;
|
$usercanread = $user->hasRight("propal", "lire");
|
||||||
$usercancreate = $user->rights->propal->creer;
|
$usercancreate = $user->hasRight("propal", "creer");
|
||||||
$usercandelete = $user->rights->propal->supprimer;
|
$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)));
|
$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)));
|
$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)));
|
$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;
|
$usercancreateorder = $user->hasRight("commande", "creer");
|
||||||
$usercancreateinvoice = $user->rights->facture->creer;
|
$usercancreateinvoice = $user->hasRight("facture", "creer");
|
||||||
$usercancreatecontract = $user->rights->contrat->creer;
|
$usercancreatecontract = $user->hasRight("contrat", "creer");
|
||||||
$usercancreateintervention = $user->hasRight('ficheinter', 'creer');
|
$usercancreateintervention = $user->hasRight('ficheinter', 'creer');
|
||||||
$usercancreatepurchaseorder = ($user->hasRight('fournisseur', 'commande', 'creer') || $user->hasRight('supplier_order', '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
|
// Load object
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
|
||||||
|
|
||||||
$usercanread = $user->rights->commande->lire;
|
$usercanread = $user->hasRight("commande", "lire");
|
||||||
$usercancreate = $user->rights->commande->creer;
|
$usercancreate = $user->hasRight("commande", "creer");
|
||||||
$usercandelete = $user->rights->commande->supprimer;
|
$usercandelete = $user->hasRight("commande", "supprimer");
|
||||||
// Advanced permissions
|
// 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)));
|
$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)));
|
$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)));
|
$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);
|
$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
|
$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php
|
||||||
$permissiondellink = $usercancreate; // Used by the include of actions_dellink.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
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$hookmanager->initHooks(array('invoicecard', 'globalcard'));
|
$hookmanager->initHooks(array('invoicecard', 'globalcard'));
|
||||||
|
|
||||||
$usercanread = $user->rights->facture->lire;
|
$usercanread = $user->hasRight("facture", "lire");
|
||||||
$usercancreate = $user->rights->facture->creer;
|
$usercancreate = $user->hasRight("facture", "creer");
|
||||||
$usercanissuepayment = $user->rights->facture->paiement;
|
$usercanissuepayment = $user->hasRight("facture", "paiement");
|
||||||
$usercandelete = $user->rights->facture->supprimer;
|
$usercandelete = $user->hasRight("facture", "supprimer");
|
||||||
$usercancreatecontract = $user->rights->contrat->creer;
|
$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)));
|
$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)));
|
$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)));
|
$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