Fix: add entity filter
This commit is contained in:
parent
602e64282c
commit
c5a2d8baa9
@ -615,6 +615,8 @@ class Categorie
|
|||||||
*/
|
*/
|
||||||
function get_full_arbo($type,$markafterid=0)
|
function get_full_arbo($type,$markafterid=0)
|
||||||
{
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
$this->cats = array();
|
$this->cats = array();
|
||||||
|
|
||||||
// Charge tableau des meres
|
// Charge tableau des meres
|
||||||
@ -643,6 +645,7 @@ class Categorie
|
|||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_association as ca";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_association as ca";
|
||||||
$sql.= " ON c.rowid=ca.fk_categorie_mere";
|
$sql.= " ON c.rowid=ca.fk_categorie_mere";
|
||||||
$sql.= " WHERE c.type = ".$type;
|
$sql.= " WHERE c.type = ".$type;
|
||||||
|
$sql.= " AND c.entity = ".$conf->entity;
|
||||||
$sql.= " ORDER BY c.label, c.rowid";
|
$sql.= " ORDER BY c.label, c.rowid";
|
||||||
|
|
||||||
dol_syslog("Categorie::get_full_arbo get category list sql=".$sql, LOG_DEBUG);
|
dol_syslog("Categorie::get_full_arbo get category list sql=".$sql, LOG_DEBUG);
|
||||||
@ -782,7 +785,10 @@ class Categorie
|
|||||||
*/
|
*/
|
||||||
function get_all_categories ()
|
function get_all_categories ()
|
||||||
{
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie";
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie";
|
||||||
|
$sql.= " WHERE entity = ".$conf->entity;
|
||||||
|
|
||||||
$res = $this->db->query($sql);
|
$res = $this->db->query($sql);
|
||||||
if ($res)
|
if ($res)
|
||||||
@ -808,8 +814,12 @@ class Categorie
|
|||||||
*/
|
*/
|
||||||
function get_nb_categories ()
|
function get_nb_categories ()
|
||||||
{
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
$sql = "SELECT count(rowid)";
|
$sql = "SELECT count(rowid)";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."categorie";
|
$sql.= " FROM ".MAIN_DB_PREFIX."categorie";
|
||||||
|
$sql.= " WHERE entity = ".$conf->entity;
|
||||||
|
|
||||||
$res = $this->db->query($sql);
|
$res = $this->db->query($sql);
|
||||||
if ($res)
|
if ($res)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user