Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API add / fix filter on extrafields in index() #24635

Merged
merged 1 commit into from Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion htdocs/adherents/class/api_members.class.php
Expand Up @@ -222,7 +222,7 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
}

$sql = "SELECT t.rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as t";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent AS t LEFT JOIN ".MAIN_DB_PREFIX."adherent_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call
if ($category > 0) {
$sql .= ", ".MAIN_DB_PREFIX."categorie_member as c";
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/adherents/class/api_memberstypes.class.php
Expand Up @@ -97,7 +97,7 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
}

$sql = "SELECT t.rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as t";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type AS t LEFT JOIN ".MAIN_DB_PREFIX."adherent_type_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields
$sql .= ' WHERE t.entity IN ('.getEntity('member_type').')';

// Add sql filters
Expand Down
2 changes: 1 addition & 1 deletion htdocs/bom/class/api_boms.class.php
Expand Up @@ -121,7 +121,7 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
if ($restrictonsocid && (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $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.$tmpobject->table_element." as t";
$sql .= " FROM ".MAIN_DB_PREFIX.$tmpobject->table_element." AS t LEFT JOIN ".MAIN_DB_PREFIX.$tmpobject->table_element."_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields

if ($restrictonsocid && (!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
Expand Down
2 changes: 1 addition & 1 deletion htdocs/categories/class/api_categories.class.php
Expand Up @@ -141,7 +141,7 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
}

$sql = "SELECT t.rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."categorie as t";
$sql .= " FROM ".MAIN_DB_PREFIX."categorie AS t LEFT JOIN ".MAIN_DB_PREFIX."categories_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields
$sql .= ' WHERE t.entity IN ('.getEntity('category').')';
if (!empty($type)) {
$sql .= ' AND t.type='.array_search($type, Categories::$TYPES);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/comm/action/class/api_agendaevents.class.php
Expand Up @@ -134,7 +134,7 @@ public function index($sortfield = "t.id", $sortorder = 'ASC', $limit = 100, $pa
$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";
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm AS t LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_extrafields AS ef ON (ef.fk_object = t.id)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields
if (isModEnabled("societe")) {
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
Expand Down
3 changes: 2 additions & 1 deletion htdocs/comm/propal/class/api_proposals.class.php
Expand Up @@ -181,7 +181,8 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
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."propal as t";
$sql .= " FROM ".MAIN_DB_PREFIX."propal AS t LEFT JOIN ".MAIN_DB_PREFIX."propal_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields


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
Expand Down
2 changes: 1 addition & 1 deletion htdocs/commande/class/api_orders.class.php
Expand Up @@ -184,7 +184,7 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
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."commande as t";
$sql .= " FROM ".MAIN_DB_PREFIX."facture AS t LEFT JOIN ".MAIN_DB_PREFIX."facture_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields

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
Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/bank/class/api_bankaccounts.class.php
Expand Up @@ -70,7 +70,7 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
throw new RestException(401);
}

$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."bank_account as t";
$sql = "SELECT t.rowid FROM ".MAIN_DB_PREFIX."bank_account AS t LEFT JOIN ".MAIN_DB_PREFIX."bank_account_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields
if ($category > 0) {
$sql .= ", ".MAIN_DB_PREFIX."categorie_account as c";
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/facture/class/api_invoices.class.php
Expand Up @@ -199,7 +199,7 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
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."facture as t";
$sql .= " FROM ".MAIN_DB_PREFIX."facture AS t LEFT JOIN ".MAIN_DB_PREFIX."facture_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields

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
Expand Down
2 changes: 1 addition & 1 deletion htdocs/contrat/class/api_contracts.class.php
Expand Up @@ -125,7 +125,7 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
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."contrat as t";
$sql .= " FROM ".MAIN_DB_PREFIX."contrat AS t LEFT JOIN ".MAIN_DB_PREFIX."contrat_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields

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
Expand Down
2 changes: 1 addition & 1 deletion htdocs/don/class/api_donations.class.php
Expand Up @@ -116,7 +116,7 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids)) {
$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."don as t";
$sql .= " FROM ".MAIN_DB_PREFIX."don AS t LEFT JOIN ".MAIN_DB_PREFIX."don_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields

$sql .= ' WHERE t.entity IN ('.getEntity('don').')';
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids)) {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/expedition/class/api_shipments.class.php
Expand Up @@ -122,7 +122,7 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
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."expedition as t";
$sql .= " FROM ".MAIN_DB_PREFIX."expedition AS t LEFT JOIN ".MAIN_DB_PREFIX."expedition_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields

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
Expand Down
2 changes: 1 addition & 1 deletion htdocs/expensereport/class/api_expensereports.class.php
Expand Up @@ -109,7 +109,7 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
//$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $societe;

$sql = "SELECT t.rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport as t";
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport AS t LEFT JOIN ".MAIN_DB_PREFIX."expensereport_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields
$sql .= ' WHERE t.entity IN ('.getEntity('expensereport').')';
if ($user_ids) {
$sql .= " AND t.fk_user_author IN (".$this->db->sanitize($user_ids).")";
Expand Down
2 changes: 1 addition & 1 deletion htdocs/fichinter/class/api_interventions.class.php
Expand Up @@ -133,7 +133,7 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
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."fichinter as t";
$sql .= " FROM ".MAIN_DB_PREFIX."fichinter AS t LEFT JOIN ".MAIN_DB_PREFIX."fichinter_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields

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
Expand Down
2 changes: 1 addition & 1 deletion htdocs/fourn/class/api_supplier_invoices.class.php
Expand Up @@ -122,7 +122,7 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
if (!DolibarrApiAccess::$user->rights->societe->client->voir || $search_sale > 0) {
$sql .= ", sc.fk_soc, sc.fk_user";
}
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as t";
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn AS t LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields

// We need this table joined to the select in order to filter by sale
if (!DolibarrApiAccess::$user->rights->societe->client->voir || $search_sale > 0) {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/fourn/class/api_supplier_orders.class.php
Expand Up @@ -120,7 +120,7 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
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."commande_fournisseur as t";
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur AS t LEFT JOIN ".MAIN_DB_PREFIX."commande_fournisseur_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields

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
Expand Down
Expand Up @@ -162,7 +162,7 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
if ($restrictonsocid && (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $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.$tmpobject->table_element." as t";
$sql .= " FROM ".MAIN_DB_PREFIX.$tmpobject->table_element." AS t LEFT JOIN ".MAIN_DB_PREFIX.$tmpobject->table_element."_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields

if ($restrictonsocid && (!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
Expand Down
2 changes: 1 addition & 1 deletion htdocs/modulebuilder/template/class/api_mymodule.class.php
Expand Up @@ -129,7 +129,7 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
if ($restrictonsocid && (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $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.$tmpobject->table_element." as t";
$sql .= " FROM ".MAIN_DB_PREFIX.$tmpobject->table_element." AS t LEFT JOIN ".MAIN_DB_PREFIX.$tmpobject->table_element."_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields

if ($restrictonsocid && (!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
Expand Down
2 changes: 1 addition & 1 deletion htdocs/mrp/class/api_mos.class.php
Expand Up @@ -119,7 +119,7 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
if ($restrictonsocid && (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $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.$tmpobject->table_element." as t";
$sql .= " FROM ".MAIN_DB_PREFIX.$tmpobject->table_element." AS t LEFT JOIN ".MAIN_DB_PREFIX.$tmpobject->table_element."_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields

if ($restrictonsocid && (!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
Expand Down
2 changes: 1 addition & 1 deletion htdocs/partnership/class/api_partnership.class.php
Expand Up @@ -127,7 +127,7 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
if ($restrictonsocid && (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $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.$tmpobject->table_element." as t";
$sql .= " FROM ".MAIN_DB_PREFIX.$tmpobject->table_element." AS t LEFT JOIN ".MAIN_DB_PREFIX.$tmpobject->table_element."_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields

if ($restrictonsocid && (!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
Expand Down
3 changes: 2 additions & 1 deletion htdocs/product/class/api_products.class.php
Expand Up @@ -873,7 +873,8 @@ public function getSupplierProducts($sortfield = "t.ref", $sortorder = 'ASC', $l
}

$sql = "SELECT t.rowid, t.ref, t.ref_ext";
$sql .= " FROM ".$this->db->prefix()."product as t";
$sql .= " FROM ".MAIN_DB_PREFIX."product AS t LEFT JOIN ".MAIN_DB_PREFIX."product_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields

if ($category > 0) {
$sql .= ", ".$this->db->prefix()."categorie_product as c";
}
Expand Down
3 changes: 2 additions & 1 deletion htdocs/product/stock/class/api_stockmovements.class.php
Expand Up @@ -104,7 +104,8 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
}

$sql = "SELECT t.rowid";
$sql .= " FROM ".$this->db->prefix()."stock_mouvement as t";
$sql .= " FROM ".MAIN_DB_PREFIX."stock_mouvement AS t LEFT JOIN ".MAIN_DB_PREFIX."stock_mouvement_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields

//$sql.= ' WHERE t.entity IN ('.getEntity('stock').')';
$sql .= ' WHERE 1 = 1';
// Add sql filters
Expand Down
2 changes: 1 addition & 1 deletion htdocs/product/stock/class/api_warehouses.class.php
Expand Up @@ -104,7 +104,7 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
}

$sql = "SELECT t.rowid";
$sql .= " FROM ".$this->db->prefix()."entrepot as t";
$sql .= " FROM ".MAIN_DB_PREFIX."entrepot AS t LEFT JOIN ".MAIN_DB_PREFIX."entrepot_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields
if ($category > 0) {
$sql .= ", ".$this->db->prefix()."categorie_societe as c";
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/projet/class/api_tasks.class.php
Expand Up @@ -127,7 +127,7 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
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."projet_task as t";
$sql .= " FROM ".MAIN_DB_PREFIX."projet_task AS t LEFT JOIN ".MAIN_DB_PREFIX."projet_task_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields

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
Expand Down