From 9c0704ee56c7fce930deca3cb060fe145b52fd57 Mon Sep 17 00:00:00 2001 From: IC-Mathieu <95343351+IC-Mathieu@users.noreply.github.com> Date: Sun, 13 Oct 2024 21:10:42 +0200 Subject: [PATCH] NEW : care grandchild (#31314) * NEW_CARE_GRANDCHILD * Update commonobject.class.php --------- Co-authored-by: Laurent Destailleur --- htdocs/core/class/commonobject.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index ca55cd4e839..3aee2589b32 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3349,10 +3349,11 @@ abstract class CommonObject if ($resql) { $i = 0; $num = $this->db->num_rows($resql); + $grandchild = getDolGlobalInt('MAIN_CARE_GRANDCHILD'); while ($i < $num) { $row = $this->db->fetch_row($resql); $rows[] = $row[0]; // Add parent line into array rows - $children = $this->getChildrenOfLine($row[0]); + $children = $this->getChildrenOfLine($row[0], $grandchild); if (!empty($children)) { foreach ($children as $child) { array_push($rows, $child);