if((!DolibarrApiAccess::$user->rights->societe->client->voir&&!$socids)||$search_sale>0)$sql.=", sc.fk_soc, sc.fk_user";// We need these fields in order to filter by sale (including the case where the user can only see his prospects)
$sql.=" FROM ".MAIN_DB_PREFIX."actioncomm as t";
if((!DolibarrApiAccess::$user->rights->societe->client->voir&&!$socids)||$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.=' WHERE t.entity IN ('.getEntity('agenda').')';
if((!DolibarrApiAccess::$user->rights->societe->client->voir&&!$socids)||$search_sale>0)$sql.=" AND t.fk_soc = sc.fk_soc";
if($user_ids)$sql.=" AND t.fk_user_action IN (".$user_ids.")";
if($socid>0)$sql.=" AND t.fk_soc = ".$socid;
// Insert sale filter
...
...
@@ -298,4 +301,59 @@ class AgendaEvents extends DolibarrApi
}
return$event;
}
/**
* Clean sensible object datas
*
* @param object $object Object to clean
* @return array Array of cleaned object properties