@@ -113,9 +117,11 @@ class SkeletonApi extends DolibarrApi {
if((!DolibarrApiAccess::$user->rights->societe->client->voir&&!$socid)||$search_sale>0)$sql.=", ".MAIN_DB_PREFIX."societe_commerciaux as sc";// We need this table joined to the select in order to filter by sale
$sql.=", ".MAIN_DB_PREFIX."c_stcomm as st";
$sql.=" WHERE s.fk_stcomm = st.id";
if($only_customer)$sql.=" AND s.client IN (1, 3)";
if($only_prospect)$sql.=" AND s.client IN (2, 3)";
if($only_others)$sql.=" AND s.client IN (0)";
// Example of use $mode
//if ($mode == 1) $sql.= " AND s.client IN (1, 3)";
//if ($mode == 2) $sql.= " AND s.client IN (2, 3)";
$sql.=' AND s.entity IN ('.getEntity('skeleton',1).')';
if((!DolibarrApiAccess::$user->rights->societe->client->voir&&!$socid)||$search_sale>0)$sql.=" AND s.fk_soc = sc.fk_soc";
if($socid)$sql.=" AND s.fk_soc = ".$socid;
...
...
@@ -134,25 +140,36 @@ class SkeletonApi extends DolibarrApi {