NEW Add thirdparty search on api list (#34634)

* Add thirdparty search on api list

this change allow to seach element with filter on thirdparty (ex : list of bill of with name of thidparty)

* Update api_orders.class.php

* Update api_invoices.class.php

* Update api_contracts.class.php

* Update api_shipments.class.php

* Update api_interventions.class.php

* Update api_projects.class.php

* Update api_tickets.class.php

* Update api_tickets.class.php

* Update api_projects.class.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
Charlène Benke 2025-07-18 02:35:50 +02:00 committed by GitHub
parent dbd5912658
commit 1df5ea8456
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 13 additions and 2 deletions

View file

@ -7,6 +7,7 @@
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 William Mead <william@m34d.com>
* Copyright (C) 2025 Charlene Benke <charlene@patas-monkey.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -203,6 +204,7 @@ class Proposals extends DolibarrApi
$sql = "SELECT t.rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."propal AS t";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe AS s ON (s.rowid = t.fk_soc)";
$sql .= " 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
$sql .= ' WHERE t.entity IN ('.getEntity('propal').')';
if ($socids) {

View file

@ -196,6 +196,7 @@ class Orders extends DolibarrApi
$sql = "SELECT t.rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."commande AS t";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe AS s ON (s.rowid = t.fk_soc)";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."commande_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('commande').')';
if ($socids) {

View file

@ -213,6 +213,7 @@ class Invoices extends DolibarrApi
$sql = "SELECT t.rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."facture AS t";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe AS s ON (s.rowid = t.fk_soc)";
$sql .= " 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
$sql .= ' WHERE t.entity IN ('.getEntity('invoice').')';
if ($socids) {

View file

@ -123,7 +123,9 @@ class Contracts extends DolibarrApi
}
$sql = "SELECT t.rowid";
$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
$sql .= " FROM ".MAIN_DB_PREFIX."contrat AS t";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe AS s ON (s.rowid = t.fk_soc)";
$sql .= " 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
$sql .= ' WHERE t.entity IN ('.getEntity('contrat').')';
if ($socids) {
$sql .= " AND t.fk_soc IN (".$this->db->sanitize($socids).")";

View file

@ -122,6 +122,7 @@ class Shipments extends DolibarrApi
$sql = "SELECT t.rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."expedition AS t";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe AS s ON (s.rowid = t.fk_soc)";
$sql .= " 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
$sql .= ' WHERE t.entity IN ('.getEntity('expedition').')';
if ($socids) {

View file

@ -156,7 +156,9 @@ class Interventions extends DolibarrApi
}
$sql = "SELECT t.rowid";
$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
$sql .= " FROM ".MAIN_DB_PREFIX."fichinter AS t";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe AS s ON (s.rowid = t.fk_soc)";
$sql .= " 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
$sql .= ' WHERE t.entity IN ('.getEntity('intervention').')';
if ($socids) {
$sql .= " AND t.fk_soc IN (".$this->db->sanitize($socids).")";

View file

@ -219,6 +219,7 @@ class Projects extends DolibarrApi
$sql = "SELECT t.rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."projet as t";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe AS s ON (s.rowid = t.fk_soc)";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_extrafields AS ef ON ef.fk_object = t.rowid"; // So we will be able to filter on extrafields
if ($category > 0) {
$sql .= ", ".MAIN_DB_PREFIX."categorie_project as c";

View file

@ -224,6 +224,7 @@ class Tickets extends DolibarrApi
$sql = "SELECT t.rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."ticket AS t";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe AS s ON (s.rowid = t.fk_soc)";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."ticket_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('ticket', 1).')';
if ($socid > 0) {