Verified Commit 719ce105 authored by dockx thibault's avatar dockx thibault
Browse files

:sparkles: feat(Tasks) - Generate slave type with taskType

Adds taskType in order to have better generic description in case of added plugins to tasks
Showing with 11 additions and 3 deletions
+11 -3
...@@ -118,7 +118,15 @@ class tasks extends simplePlugin ...@@ -118,7 +118,15 @@ class tasks extends simplePlugin
return parent::save(); return parent::save();
} }
public function createSlaveTasks (array $listOfDN, string $attributeType, array $attrs = NULL): void /**
* @param array $listOfDN
* @param string $attributeType
* @param array|NULL $attrs
* @param $taskType
* @return void
* Note : $taskType is present to define the object name related to life cycle (core) and any new plugins added to tasks.
*/
public function createSlaveTasks (array $listOfDN, string $attributeType, array $attrs = NULL, string $taskType = ''): void
{ {
global $config; global $config;
$ldap = $config->get_ldap_link(); $ldap = $config->get_ldap_link();
...@@ -195,7 +203,7 @@ class tasks extends simplePlugin ...@@ -195,7 +203,7 @@ class tasks extends simplePlugin
case 'fdTasksGranularDN' : case 'fdTasksGranularDN' :
$prepData['tasksGranular'] = [ $prepData['tasksGranular'] = [
"fdTasksGranularDN" => $dn, "fdTasksGranularDN" => $dn,
"fdTasksGranularType" => 'Life Cycle', "fdTasksGranularType" => $taskType,
]; ];
break; break;
} }
......
...@@ -191,7 +191,7 @@ class tasksLifeCycle extends simplePlugin ...@@ -191,7 +191,7 @@ class tasksLifeCycle extends simplePlugin
$attributeType = 'fdTasksGranularDN'; $attributeType = 'fdTasksGranularDN';
// Call the method from parent tasks object (first tab) to create sub-tasks. // Call the method from parent tasks object (first tab) to create sub-tasks.
$this->parent->getBaseObject()->createSlaveTasks($listOfDN, $attributeType); $this->parent->getBaseObject()->createSlaveTasks($listOfDN, $attributeType, NULL, 'Life Cycle');
} }
public function update (): bool public function update (): bool
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment