mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-09 01:12:33 +01:00
API add / fix filter on extrafields in index()
Add / change in api_xxx.class.php files the ability to filter on extrafields when missing in the public functions index() by changing the SQL query with the pattern " FROM ".MAIN_DB_PREFIX"xxxx AS t LEFT JOIN ".MAIN_DB_PREFIX."xxxx_extrafields AS ef ON (ef.fk_object = t.rowid)
This commit is contained in:
committed by
GitHub
parent
57cbb21f6b
commit
926aa6fec7
@@ -121,7 +121,7 @@ class Receptions extends DolibarrApi
|
||||
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."reception as t";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."reception AS t LEFT JOIN ".MAIN_DB_PREFIX."reception_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
|
||||
@@ -709,7 +709,7 @@ class Receptions extends DolibarrApi
|
||||
private function _validate($data)
|
||||
{
|
||||
$reception = array();
|
||||
foreach (Receptions::$FIELDS as $field) {
|
||||
foreach (Shipments::$FIELDS as $field) {
|
||||
if (!isset($data[$field])) {
|
||||
throw new RestException(400, "$field field missing");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user