2
0
forked from Wavyzz/dolibarr

Fix: php 8.1 warnings

This commit is contained in:
hystepik
2022-12-15 14:46:29 +01:00
parent 6ca84ff554
commit 27cb4b4d86
14 changed files with 69 additions and 67 deletions

View File

@@ -201,10 +201,10 @@ $arrayfields = array(
'c.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1), 'position'=>110),
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>115),
'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>0, 'position'=>116),
'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous ? 0 : 1)),
'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous ? 0 : 1)),
'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)),
'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)),
'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (!isModEnabled('margin') || !$user->hasRight("margins", "liretous") ? 0 : 1)),
'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (!isModEnabled('margin') || !$user->hasRight("margins", "liretous") ? 0 : 1)),
'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (!isModEnabled('margin') || !$user->hasRight("margins", "liretous") || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)),
'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (!isModEnabled('margin') || !$user->hasRight("margins", "liretous") || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)),
'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>120),
'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>125),
'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>130),
@@ -298,19 +298,19 @@ if (empty($reshook)) {
// Mass actions
$objectclass = 'Commande';
$objectlabel = 'Orders';
$permissiontoread = $user->rights->commande->lire;
$permissiontoadd = $user->rights->commande->creer;
$permissiontodelete = $user->rights->commande->supprimer;
$permissiontoread = $user->hasRight("commande", "lire");
$permissiontoadd = $user->hasRight("commande", "creer");
$permissiontodelete = $user->hasRight("commande", "supprimer");
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
$permissiontovalidate = $user->rights->commande->order_advance->validate;
$permissiontoclose = $user->rights->commande->order_advance->close;
$permissiontocancel = $user->rights->commande->order_advance->annuler;
$permissiontosendbymail = $user->rights->commande->order_advance->send;
$permissiontovalidate = $user->hasRight("commande", "order_advance", "validate");
$permissiontoclose = $user->hasRight("commande", "order_advance", "close");
$permissiontocancel = $user->hasRight("commande", "order_advance", "annuler");
$permissiontosendbymail = $user->hasRight("commande", "order_advance", "send");
} else {
$permissiontovalidate = $user->rights->commande->creer;
$permissiontoclose = $user->rights->commande->creer;
$permissiontocancel = $user->rights->commande->creer;
$permissiontosendbymail = $user->rights->commande->creer;
$permissiontovalidate = $user->hasRight("commande", "creer");
$permissiontoclose = $user->hasRight("commande", "creer");
$permissiontocancel = $user->hasRight("commande", "creer");
$permissiontosendbymail = $user->hasRight("commande", "creer");
}
$uploaddir = $conf->commande->multidir_output[$conf->entity];
$triggersendname = 'ORDER_SENTBYMAIL';
@@ -1287,7 +1287,7 @@ if ($resql) {
if ($permissiontocancel) {
$arrayofmassactions['cancelorders'] = img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Cancel");
}
if (isModEnabled('facture') && $user->rights->facture->creer) {
if (isModEnabled('facture') && $user->hasRight("facture", "creer")) {
$arrayofmassactions['createbills'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("CreateInvoiceForThisCustomer");
}
if ($permissiontoclose) {
@@ -1394,7 +1394,7 @@ if ($resql) {
$moreforfilter = '';
// If the user can view prospects? sales other than his own
if ($user->rights->user->user->lire) {
if ($user->hasRight("user", "user", "lire")) {
$langs->load("commercial");
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative');
@@ -1402,7 +1402,7 @@ if ($resql) {
$moreforfilter .= '</div>';
}
// If the user can view other users
if ($user->rights->user->user->lire) {
if ($user->hasRight("user", "user", "lire")) {
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('LinkedToSpecificUsers');
$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250 widthcentpercentminusx');
@@ -1410,7 +1410,7 @@ if ($resql) {
}
// If the user can view other products/services than his own
if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) {
if (isModEnabled('categorie') && $user->hasRight("categorie", "lire") && ($user->hasRight("produit", "lire") || $user->hasRight("service", "lire"))) {
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('IncludingProductWithTag');
@@ -1419,7 +1419,7 @@ if ($resql) {
$moreforfilter .= '</div>';
}
// If Categories are enabled & user has rights to see
if (isModEnabled('categorie') && $user->rights->categorie->lire) {
if (isModEnabled('categorie') && $user->hasRight("categorie", "lire")) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('CustomersProspectsCategoriesShort');