Update html.form.class.php

This commit is contained in:
Laurent Destailleur 2018-04-11 18:00:34 +02:00 committed by GitHub
parent fa8cf98249
commit 9ccba03a17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5293,7 +5293,7 @@ class Form
$sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".MAIN_DB_PREFIX .$objecttmp->table_element." as t";
if ($objecttmp->ismultientitymanaged == 2)
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE 1";
$sql.= " WHERE 1=1";
if(! empty($objecttmp->ismultientitymanaged)) $sql.= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
if ($objecttmp->ismultientitymanaged == 1 && ! empty($user->societe_id))
{