From 36e7d3e5ee420d4a1d767da98a3a71ae988af153 Mon Sep 17 00:00:00 2001
From: Thibault Dockx <thibault.dockx@fusiondirectory.org>
Date: Tue, 2 Apr 2024 21:38:59 +0100
Subject: [PATCH] :sparkles: (Tasks) - Trying to fully re-use existing subTasks
 attributes

Trying to fully re-use existing subTasks attributes
---
 plugins/configuration/tasks/class_tasks.inc         | 2 ++
 plugins/configuration/tasks/class_tasksGranular.inc | 6 +++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/plugins/configuration/tasks/class_tasks.inc b/plugins/configuration/tasks/class_tasks.inc
index 49f510bad..f692dce0a 100644
--- a/plugins/configuration/tasks/class_tasks.inc
+++ b/plugins/configuration/tasks/class_tasks.inc
@@ -204,6 +204,8 @@ class tasks extends simplePlugin
             $prepData['tasksGranular'] = [
               "fdTasksGranularDN"   => $dn,
               "fdTasksGranularType" => $taskType,
+              // Verification as 'ref' could potentially not be present depending on the logic of the main task.
+              "fdTasksGranularRef"  => !empty($attrs['ref']) ? $attrs['ref'] : null,
             ];
             break;
         }
diff --git a/plugins/configuration/tasks/class_tasksGranular.inc b/plugins/configuration/tasks/class_tasksGranular.inc
index 445e3ab04..2504202dd 100644
--- a/plugins/configuration/tasks/class_tasksGranular.inc
+++ b/plugins/configuration/tasks/class_tasksGranular.inc
@@ -64,9 +64,9 @@ class tasksGranular extends simplePlugin
             _('Schedule'), '',
             'fdTasksGranularSchedule', FALSE
           ),
-          // Below attribute are for tasks of type lifeCycle
-          new StringAttribute(
-            _('lifeCycleDN'), _('DN list filled by tasks lifeCycle'),
+          // Below attribute are for tasks of type lifeCycle and other tasks added as plugin
+          new StringAttribute( // Attribute is mostly used to store important DN requiring processing by Orchestrator.
+            _('Related DN'), _('DN list filled by main tasks'),
             'fdTasksGranularDN', FALSE
           ),
           // Below attributes are for tasks of type Mail
-- 
GitLab