diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index df69e0265c5..d6bea994634 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -82,6 +82,11 @@ class Commande extends CommonOrder */ public $ismultientitymanaged = 1; + /** + * @var int Does object support extrafields ? 0=No, 1=Yes + */ + public $isextrafieldmanaged = 1; + /** * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user * @var integer diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index a7b625c1629..f05d0039e1c 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -90,6 +90,11 @@ class Facture extends CommonInvoice */ public $ismultientitymanaged = 1; + /** + * @var int Does object support extrafields ? 0=No, 1=Yes + */ + public $isextrafieldmanaged = 1; + /** * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user * @var integer diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 653fae23ff3..add70fd4dbf 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -60,6 +60,11 @@ class Contact extends CommonObject */ public $ismultientitymanaged = 1; + /** + * @var int Does object support extrafields ? 0=No, 1=Yes + */ + public $isextrafieldmanaged = 1; + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0169ea235b2..eecc41bd4eb 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8056,6 +8056,9 @@ class Form // Search data $sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t"; + if (!empty($objecttmp->isextrafieldmanaged)) { + $sql .= " LEFT JOIN " . $this->db->prefix() . $objecttmp->table_element . "_extrafields as e ON t.rowid=e.fk_object"; + } if (isset($objecttmp->ismultientitymanaged)) { if (!is_numeric($objecttmp->ismultientitymanaged)) { $tmparray = explode('@', $objecttmp->ismultientitymanaged); diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 0392bc8c4eb..8cc3f5aa418 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -79,6 +79,11 @@ class Expedition extends CommonObject */ public $ismultientitymanaged = 1; + /** + * @var int Does object support extrafields ? 0=No, 1=Yes + */ + public $isextrafieldmanaged = 1; + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */