Skip to content

Commit

Permalink
[DigiriskElementClass] fix: select_digiriskelement_list, remove abili…
Browse files Browse the repository at this point in the history
…ty to select children ID
  • Loading branch information
evarisk-theo committed May 24, 2021
1 parent ebd12d7 commit 14fbb36
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion class/digiriskelement.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -389,14 +389,19 @@ public function select_digiriskelement_list($selected = '', $htmlname = 'socid',
$filter = '';
}
}

// On recherche les societes
$sql = "SELECT *";
$sql .= " FROM ".MAIN_DB_PREFIX."digiriskdolibarr_digiriskelement as s";

$sql .= " WHERE s.entity IN (".getEntity($this->table_element).")";
if ($filter) $sql .= " AND (".$filter.")";
if ($moreparam > 0 ) {
$children = $this->fetchDigiriskElementFlat($moreparam);
if (! empty($children) && $children > 0) {
foreach ($children as $key => $value) {
$sql .= " AND NOT s.rowid =" . $key;
}
}
$sql .= " AND NOT s.rowid =" . $moreparam;
}
$sql .= $this->db->order("rowid", "ASC");
Expand Down

0 comments on commit 14fbb36

Please sign in to comment.