Verified Commit ef35d154 authored by dockx thibault's avatar dockx thibault
Browse files

:sparkles: Feat(CORE) - Add lastExec to tasks

Add last exec to tasks.
Showing with 20 additions and 2 deletions
+20 -2
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
## core-fd.schema - Needed by FusionDirectory for its basic fonctionnalities ## core-fd.schema - Needed by FusionDirectory for its basic fonctionnalities
## ##
# Last OID used : 1.3.6.1.4.1.38414.62.1.57 12/21/23
##### Attributes from gosa ###### ##### Attributes from gosa ######
attributetype ( 1.3.6.1.4.1.10098.1.1.12.30 NAME 'gosaGroupObjects' attributetype ( 1.3.6.1.4.1.10098.1.1.12.30 NAME 'gosaGroupObjects'
...@@ -167,6 +169,11 @@ attributetype ( 1.3.6.1.4.1.38414.62.1.15 NAME 'fdTasksEndDate' ...@@ -167,6 +169,11 @@ attributetype ( 1.3.6.1.4.1.38414.62.1.15 NAME 'fdTasksEndDate'
EQUALITY caseExactMatch EQUALITY caseExactMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
attributetype ( 1.3.6.1.4.1.38414.62.1.57 NAME 'fdTasksLastExec'
DESC 'Fusion Directory - Time when tasks was last executed'
EQUALITY caseExactMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
attributetype ( 1.3.6.1.4.1.38414.62.1.16 NAME 'fdTasksCreationDate' attributetype ( 1.3.6.1.4.1.38414.62.1.16 NAME 'fdTasksCreationDate'
DESC 'Fusion Directory - Task Start Date' DESC 'Fusion Directory - Task Start Date'
EQUALITY caseExactMatch EQUALITY caseExactMatch
...@@ -341,7 +348,7 @@ attributetype ( 1.3.6.1.4.1.38414.62.1.43 NAME 'fdPluginManagerSupportDownloadUr ...@@ -341,7 +348,7 @@ attributetype ( 1.3.6.1.4.1.38414.62.1.43 NAME 'fdPluginManagerSupportDownloadUr
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
attributetype ( 1.3.6.1.4.1.38414.62.1.44 NAME 'fdPluginManagerInfoTags' attributetype ( 1.3.6.1.4.1.38414.62.1.44 NAME 'fdPluginManagerInfoTags'
DESC 'FusionDirectory - Plugin Tag for identiy plugins goals' DESC 'FusionDirectory - Plugin Tag for identity plugins goals'
EQUALITY caseIgnoreIA5Match EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreSubstringsMatch SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
...@@ -476,7 +483,8 @@ objectclass ( 1.3.6.1.4.1.38414.62.2.5 NAME 'fdMailTemplateConf' ...@@ -476,7 +483,8 @@ objectclass ( 1.3.6.1.4.1.38414.62.2.5 NAME 'fdMailTemplateConf'
objectclass (1.3.6.1.4.1.38414.62.2.6 NAME 'fdTasks' objectclass (1.3.6.1.4.1.38414.62.2.6 NAME 'fdTasks'
DESC 'FusionDirectory - Tasks objects' DESC 'FusionDirectory - Tasks objects'
MUST ( cn $ fdTasksStatus $ fdTasksCreationDate ) MUST ( cn $ fdTasksStatus $ fdTasksCreationDate )
MAY ( fdTasksScheduleDate $ fdTasksEndDate $ fdTasksRepeatableSchedule $ fdTasksUpdatable $ fdTasksRepeatable ) ) MAY ( fdTasksScheduleDate $ fdTasksEndDate $ fdTasksRepeatableSchedule $ fdTasksUpdatable $ fdTasksRepeatable
$ fdTasksLastExec))
objectclass (1.3.6.1.4.1.38414.62.2.7 NAME 'fdTasksMail' objectclass (1.3.6.1.4.1.38414.62.2.7 NAME 'fdTasksMail'
DESC 'FusionDirectory - Tasks objects Mail' DESC 'FusionDirectory - Tasks objects Mail'
......
...@@ -57,6 +57,7 @@ class tasks extends simplePlugin ...@@ -57,6 +57,7 @@ class tasks extends simplePlugin
), ),
new HiddenAttribute('fdTasksStatus', TRUE, '1', '', 'Status', 'Status of the task'), new HiddenAttribute('fdTasksStatus', TRUE, '1', '', 'Status', 'Status of the task'),
new HiddenAttribute('fdTasksLastExec', FALSE, '', '', 'LastExec', 'Last exec date'),
new HiddenAttribute('fdTasksCreationDate', TRUE, date("Y-m-d h:i:sa"), '', 'StartDate', 'Start Date And Time Of A Task'), new HiddenAttribute('fdTasksCreationDate', TRUE, date("Y-m-d h:i:sa"), '', 'StartDate', 'Start Date And Time Of A Task'),
] ]
], ],
...@@ -108,4 +109,13 @@ class tasks extends simplePlugin ...@@ -108,4 +109,13 @@ class tasks extends simplePlugin
$this->attributesAccess['fdSubTasksActivation']->setInLdap(FALSE); $this->attributesAccess['fdSubTasksActivation']->setInLdap(FALSE);
} }
function save (): array
{
// Verification if the bool of activation is ticked and activate the last exec accordingly.
if ($this->fdSubTasksActivation == TRUE) {
$currentDateTime = date("Y-m-d h:i:sa", time());
$this->fdTasksLastExec = $currentDateTime;
}
return parent::save();
}
} }
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