Merge pull request #20379 from hregis/new_add_kooks_in_thirdparty_index
NEW add hooks in thirdparty index page
This commit is contained in:
commit
89aab0e9d5
@ -101,12 +101,18 @@ $sql .= ' WHERE s.entity IN ('.getEntity('societe').')';
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid > 0) {
|
||||
$sql .= " AND s.rowid = ".((int) $socid);
|
||||
}
|
||||
if (empty($user->rights->fournisseur->lire)) {
|
||||
$sql .= " AND (s.fournisseur <> 1 OR s.client <> 0)"; // client=0, fournisseur=0 must be visible
|
||||
}
|
||||
// Add where from hooks
|
||||
$parameters = array('socid' => $socid);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) {
|
||||
if ($socid > 0) {
|
||||
$sql .= " AND s.rowid = ".((int) $socid);
|
||||
}
|
||||
}
|
||||
$sql .= $hookmanager->resPrint;
|
||||
//print $sql;
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
@ -284,12 +290,18 @@ $sql .= ' WHERE s.entity IN ('.getEntity('societe').')';
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid) {
|
||||
$sql .= " AND s.rowid = ".((int) $socid);
|
||||
}
|
||||
if (empty($user->rights->fournisseur->lire)) {
|
||||
$sql .= " AND (s.fournisseur != 1 OR s.client != 0)";
|
||||
}
|
||||
// Add where from hooks
|
||||
$parameters = array('socid' => $socid);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) {
|
||||
if ($socid > 0) {
|
||||
$sql .= " AND s.rowid = ".((int) $socid);
|
||||
}
|
||||
}
|
||||
$sql .= $hookmanager->resPrint;
|
||||
$sql .= $db->order("s.tms", "DESC");
|
||||
$sql .= $db->plimit($max, 0);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user