Fix error on html.for.class on ismultientitymanaged test
Conflicts: htdocs/core/class/html.form.class.php
This commit is contained in:
parent
46e8f1bebf
commit
20e8dd4c54
@ -6769,13 +6769,15 @@ class Form
|
|||||||
|
|
||||||
// Search data
|
// Search data
|
||||||
$sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".MAIN_DB_PREFIX.$objecttmp->table_element." as t";
|
$sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".MAIN_DB_PREFIX.$objecttmp->table_element." as t";
|
||||||
if (isset($objecttmp->ismultientitymanaged) && !is_numeric($objecttmp->ismultientitymanaged)) {
|
if (isset($objecttmp->ismultientitymanaged)) {
|
||||||
$tmparray = explode('@', $objecttmp->ismultientitymanaged);
|
if (!is_numeric($objecttmp->ismultientitymanaged)) {
|
||||||
$sql .= ' INNER JOIN '.MAIN_DB_PREFIX.$tmparray[1].' as parenttable ON parenttable.rowid = t.'.$tmparray[0];
|
$tmparray = explode('@', $objecttmp->ismultientitymanaged);
|
||||||
}
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX.$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0];
|
||||||
if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') {
|
}
|
||||||
if (!$user->rights->societe->client->voir && !$user->socid) {
|
if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
|
||||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$user->socid) {
|
||||||
|
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6786,17 +6788,24 @@ class Form
|
|||||||
$sql .= $hookmanager->resPrint;
|
$sql .= $hookmanager->resPrint;
|
||||||
} else {
|
} else {
|
||||||
$sql .= " WHERE 1=1";
|
$sql .= " WHERE 1=1";
|
||||||
if (isset($objecttmp->ismultientitymanaged) && $objecttmp->ismultientitymanaged == 1) {
|
if (isset($objecttmp->ismultientitymanaged)) {
|
||||||
$sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
|
if ($objecttmp->ismultientitymanaged == 1) {
|
||||||
}
|
$sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
|
||||||
if (isset($objecttmp->ismultientitymanaged) && !is_numeric($objecttmp->ismultientitymanaged)) {
|
}
|
||||||
$sql .= ' AND parenttable.entity = t.'.$tmparray[0];
|
if (!is_numeric($objecttmp->ismultientitymanaged)) {
|
||||||
}
|
$sql .= " AND parenttable.entity = t.".$tmparray[0];
|
||||||
if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) {
|
}
|
||||||
if ($objecttmp->element == 'societe') {
|
if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) {
|
||||||
$sql .= " AND t.rowid = ".((int) $user->socid);
|
if ($objecttmp->element == 'societe') {
|
||||||
} else {
|
$sql .= " AND t.rowid = ".((int) $user->socid);
|
||||||
$sql .= " AND t.fk_soc = ".((int) $user->socid);
|
} else {
|
||||||
|
$sql .= " AND t.fk_soc = ".((int) $user->socid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
|
||||||
|
if (!$user->rights->societe->client->voir && !$user->socid) {
|
||||||
|
$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($searchkey != '') {
|
if ($searchkey != '') {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user