瀏覽代碼

update code toward php8 compliance

Philippe GRAND 2 年之前
父節點
當前提交
3f2faf4667
共有 4 個文件被更改,包括 5 次插入5 次删除
  1. 2 2
      htdocs/comm/index.php
  2. 1 1
      htdocs/contact/list.php
  3. 1 1
      htdocs/core/ajax/objectonoff.php
  4. 1 1
      htdocs/core/boxes/box_clients.php

+ 2 - 2
htdocs/comm/index.php

@@ -594,7 +594,7 @@ print '</div><div class="fichetwothirdright">';
 /*
  * Last modified customers or prospects
  */
-if (isModEnabled("societe") && $user->rights->societe->lire) {
+if (isModEnabled("societe") && $user->hasRight('societe', 'lire')) {
 	$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
 	$sql .= ", s.code_client, s.code_compta, s.client";
 	$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
@@ -700,7 +700,7 @@ if (isModEnabled("societe") && $user->rights->societe->lire) {
 /*
  * Last suppliers
  */
-if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && $user->rights->societe->lire) {
+if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && $user->hasRight('societe', 'lire')) {
 	$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
 	$sql .= ", s.code_client, s.code_compta, s.client";
 	$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";

+ 1 - 1
htdocs/contact/list.php

@@ -312,7 +312,7 @@ if (empty($reshook)) {
 	// Mass actions
 	$objectclass = 'Contact';
 	$objectlabel = 'Contact';
-	$permissiontoread = $user->rights->societe->lire;
+	$permissiontoread = $user->hasRight('societe', 'lire');
 	$permissiontodelete = $user->rights->societe->supprimer;
 	$permissiontoadd = $user->rights->societe->creer;
 	$uploaddir = $conf->societe->dir_output;

+ 1 - 1
htdocs/core/ajax/objectonoff.php

@@ -67,7 +67,7 @@ if (!empty($user->socid)) {
 	$socid = $user->socid;
 }
 
-//$user->rights->societe->lire = 0;$user->rights->fournisseur->lire = 0;
+//$user->hasRight('societe', 'lire') = 0;$user->rights->fournisseur->lire = 0;
 //restrictedArea($user, 'societe', $id);
 
 if (in_array($field, array('status'))) {

+ 1 - 1
htdocs/core/boxes/box_clients.php

@@ -86,7 +86,7 @@ class box_clients extends ModeleBoxes
 
 		$this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedCustomers", $max));
 
-		if ($user->rights->societe->lire) {
+		if ($user->hasRight('societe', 'lire')) {
 			$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
 			$sql .= ", s.code_client, s.code_compta, s.client";
 			$sql .= ", s.logo, s.email, s.entity";