Multi-company compatibility with transverse mode for pdf models

This commit is contained in:
Maxime Kohlhaas
2013-01-14 12:01:44 +01:00
parent fb1d99d0dd
commit 6abf682faa

View File

@@ -1250,7 +1250,7 @@ function getListOfModels($db,$type,$maxfilenamelength=0)
$sql = "SELECT nom as id, nom as lib, libelle as label, description as description";
$sql.= " FROM ".MAIN_DB_PREFIX."document_model";
$sql.= " WHERE type = '".$type."'";
$sql.= " AND entity = ".$conf->entity;
$sql.= " AND entity IN (0,".(! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)?"1,":"").$conf->entity.")";
$resql = $db->query($sql);
if ($resql)