From 029beca3b403dac0c86ea5004ce6e007a80528e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=B4me=20Chilliet?= <come@opensides.be>
Date: Mon, 29 Oct 2018 17:25:52 +0100
Subject: [PATCH] :sparkles: feat(template) Add function to detect which
 template tab contains a given attribute

issue #5903
---
 include/class_template.inc | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/class_template.inc b/include/class_template.inc
index d6acc5d28..fb0deaea4 100644
--- a/include/class_template.inc
+++ b/include/class_template.inc
@@ -176,6 +176,15 @@ class template
     return $this->tabObject->by_object[$tab]->attributesAccess[$attr];
   }
 
+  function getAttributeTab($attr)
+  {
+    foreach ($this->tabObject->by_object as $tab => $tabObject) {
+      if (isset($tabObject->attributesAccess[$attr])) {
+        return $tab;
+      }
+    }
+  }
+
   /*! \brief Serialize this template for webservice
    */
   function serialize()
-- 
GitLab