enhance dol_print_ip (#33819)

* enhance dol_print_ip

* fix cache

* fix CI
This commit is contained in:
Frédéric FRANCE
2025-04-12 16:19:45 +02:00
committed by GitHub
parent ec7ecd9f08
commit 2b468e6b0f
2 changed files with 22 additions and 7 deletions

View File

@@ -1256,7 +1256,7 @@ abstract class CommonObject
return -2;
}
if ($this->restrictiononfksoc && property_exists('socid', $this) && !empty($this->socid) && !$user->hasRight('societe', 'client', 'voir')) {
if ($this->restrictiononfksoc && property_exists($this, 'socid') && !empty($this->socid) && !$user->hasRight('societe', 'client', 'voir')) {
$sql_allowed_contacts = 'SELECT COUNT(*) as cnt FROM '.$this->db->prefix().'societe_commerciaux as sc';
$sql_allowed_contacts.= ' WHERE sc.fk_soc = '.(int) $this->socid;
$sql_allowed_contacts.= ' AND sc.fk_user = '.(int) $user->id;