diff --git a/contrib/openldap/core-fd.schema b/contrib/openldap/core-fd.schema index d188a2a7efaf2c890c34be751fb77e09ff33ecd3..0ab9bd7d1927077992f3ded8b06bc91f230fac18 100644 --- a/contrib/openldap/core-fd.schema +++ b/contrib/openldap/core-fd.schema @@ -1,8 +1,9 @@ ## -## core-fd.schema - Needed by FusionDirectory for its basic fonctionnalities +## core-fd.schema - Needed by FusionDirectory for its basic functionalities ## -# Last OID used : 1.3.6.1.4.1.38414.62.1.57 12/21/23 +# Last OID used for attributes : 1.3.6.1.4.1.38414.62.1.64 29/01/24 # +# Last OID used for objectClass : 1.3.6.1.4.1.38414.62.2.11 29/01/24 # ##### Attributes from gosa ###### @@ -141,6 +142,54 @@ attributetype ( 1.3.6.1.4.1.38414.62.1.10 NAME 'fdMailTemplateSubject' SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40) +##### Tasks Life Cycle Attributes ##### + +## Previous / existing states ## + +attributetype ( 1.3.6.1.4.1.38414.62.1.58 NAME 'fdTasksLifeCyclePreResource' + DESC 'Fusion Directory - Tasks for life cycle - previous supann resource' + EQUALITY caseExactMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 + SINGLE-VALUE ) + +attributetype ( 1.3.6.1.4.1.38414.62.1.59 NAME 'fdTasksLifeCyclePreState' + DESC 'Fusion Directory - Tasks for life cycle - previous supann state' + EQUALITY caseExactMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 + SINGLE-VALUE ) + +attributetype ( 1.3.6.1.4.1.38414.62.1.60 NAME 'fdTasksLifeCyclePreSubState' + DESC 'Fusion Directory - Tasks for life cycle - previous supann sub state' + EQUALITY caseExactMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 + SINGLE-VALUE ) + +## Posteriors / new desired states ## + +attributetype ( 1.3.6.1.4.1.38414.62.1.61 NAME 'fdTasksLifeCyclePostResource' + DESC 'Fusion Directory - Tasks for life cycle - new resource' + EQUALITY caseExactMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 + SINGLE-VALUE ) + +attributetype ( 1.3.6.1.4.1.38414.62.1.62 NAME 'fdTasksLifeCyclePostState' + DESC 'Fusion Directory - Tasks for life cycle - new state' + EQUALITY caseExactMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 + SINGLE-VALUE ) + +attributetype ( 1.3.6.1.4.1.38414.62.1.63 NAME 'fdTasksLifeCyclePostSubState' + DESC 'Fusion Directory - Tasks for life cycle - new sub state' + EQUALITY caseExactMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 + SINGLE-VALUE ) + +attributetype ( 1.3.6.1.4.1.38414.62.1.64 NAME 'fdTasksLifeCyclePostEndDate' + DESC 'Fusion Directory - Tasks for life cycle - days to be added to end date' + EQUALITY caseExactMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 + SINGLE-VALUE ) + ##### Tasks Attributes ##### attributetype ( 1.3.6.1.4.1.38414.62.1.11 NAME 'fdTasksMailObject' @@ -492,6 +541,12 @@ objectclass (1.3.6.1.4.1.38414.62.2.7 NAME 'fdTasksMail' MUST ( fdTasksMailObject $ fdTasksEmailSender ) MAY ( fdTasksMailUsers $ fdTasksEmailsFromDN $ fdTasksMailType $ fdTasksEmailBCC ) ) +objectclass (1.3.6.1.4.1.38414.62.2.11 NAME 'fdTasksLifeCycle' + DESC 'FusionDirectory - Tasks objects Life Cycle' + SUP top AUXILIARY + MUST ( fdTasksLifeCyclePreResource $ fdTasksLifeCyclePreState $ fdTasksLifeCyclePostResource $ fdTasksLifeCyclePostState) + MAY ( fdTasksLifeCyclePreSubState $ fdTasksLifeCyclePostEndDate $ fdTasksLifeCyclePostSubState) ) + objectclass (1.3.6.1.4.1.38414.62.2.8 NAME 'fdTasksGranular' DESC 'FusionDirectory - Tasks granular objects' MUST ( fdTasksGranularMaster $ cn $ fdTasksGranularMail $ fdTasksGranularMailFrom $ diff --git a/html/themes/breezy/less/plugin.less b/html/themes/breezy/less/plugin.less index 69ff126a0db18f5ae01df3b890f3fafffdd305e9..17ac4da1eb1a5377944cc69c00d250be00637744 100644 --- a/html/themes/breezy/less/plugin.less +++ b/html/themes/breezy/less/plugin.less @@ -244,17 +244,27 @@ html.rtl .plugin-section { fieldset.plugin-section.critical legend span, .plugin-section.critical > span.legend { font-weight: bold; - background-color: @critical-section-legend-background-color; + background-color: #bbccff; +} + +fieldset.plugin-section.information legend span, +.plugin-section.information > span.legend { + font-weight: bold; + background-color: #bbccff; } fieldset.plugin-section.critical legend span:after, .plugin-section.critical > span.legend:after { content: " (editing this can break your LDAP)"; - color: @critical-section-warning-color; + color: #dd0000; } .plugin-section.critical > div { - background-color: @critical-section-background-color; + background-color: #dfefff; +} + +.plugin-section.information > div { + background-color: #dfefff; } /* On small screens */ diff --git a/html/themes/breezy/plugin.css b/html/themes/breezy/plugin.css index 12fd99b8e6fc1cff96997a6e0756f6d9729e91fd..11ef02861e325c740d0683497a1b7076669c45f4 100644 --- a/html/themes/breezy/plugin.css +++ b/html/themes/breezy/plugin.css @@ -231,6 +231,13 @@ fieldset.plugin-section.critical legend span, font-weight: bold; background-color: #bbccff; } + +fieldset.plugin-section.information legend span, +.plugin-section.information > span.legend { + font-weight: bold; + background-color: #bbccff; +} + fieldset.plugin-section.critical legend span:after, .plugin-section.critical > span.legend:after { content: " (editing this can break your LDAP)"; @@ -239,6 +246,10 @@ fieldset.plugin-section.critical legend span:after, .plugin-section.critical > div { background-color: #dfefff; } + +.plugin-section.information > div { + background-color: #dfefff; +} /* On small screens */ @media (max-width: 640px) { .plugin-window { diff --git a/html/themes/legacy/plugin.css b/html/themes/legacy/plugin.css index 2e357ce3c5bc19782251430d5f843cd83e28214a..c8ec19c9e3eb5f68fd78fa9a46b61ea36d11844b 100644 --- a/html/themes/legacy/plugin.css +++ b/html/themes/legacy/plugin.css @@ -201,11 +201,20 @@ font-weight: bold; background-color: #bcf; } +fieldset.plugin-section.critical legend span, .plugin-section.information > span.legend { + font-weight: bold; + background-color: #bcf; +} + fieldset.plugin-section.critical legend span:after, .plugin-section.critical > span.legend:after { content: " (editing this can break your LDAP)"; color: #d00; } +.plugin-section.information > div { + background-color: #dfefff; +} + .plugin-section.critical > div { background-color: #dfefff; } diff --git a/plugins/configuration/tasks/class_tasksLifeCycle.inc b/plugins/configuration/tasks/class_tasksLifeCycle.inc new file mode 100644 index 0000000000000000000000000000000000000000..a83542af13d04300e120f0efcf1a316fc8cd1415 --- /dev/null +++ b/plugins/configuration/tasks/class_tasksLifeCycle.inc @@ -0,0 +1,148 @@ +<?php +/* + This code is part of FusionDirectory (http://www.fusiondirectory.org) + + Copyright (C) 2024 FusionDirectory + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +*/ + +class tasksLifeCycle extends simplePlugin +{ + protected $displayHeader = TRUE; + + static function plInfo (): array + { + return [ + 'plShortName' => _('Tasks Life Cycle'), + 'plDescription' => _('Tasks Life Cycle Object'), + 'plIcon' => 'geticon.php?context=applications&icon=tasks&size=16', + 'plPriority' => 42, + 'plObjectClass' => ['fdTasksLifeCycle'], + 'plFilter' => '(objectClass=fdTasksLifeCycle)', + 'plObjectType' => ['tasks'], + 'plConflicts' => ['tasksMail'], + 'plProvidedAcls' => parent::generatePlProvidedAcls(static::getAttributesInfo()), + 'plForeignKeys' => [], + ]; + } + + static function getAttributesInfo (): array + { + return [ + 'section1' => [ + 'class' => ['fullwidth', 'information'], + 'name' => _('We recommend the task redundancy to be set to daily, and the case “new members only†to be unpicked'), + 'attrs' => [ + // This hiddenAttribute is only present to show the information label on the section. + new HiddenAttribute( + _('Information'), _('Information'), + 'fdShowInformation', FALSE + ), + ] + ], + 'section3' => [ + 'name' => _('Post resources details'), + 'attrs' => [ + new SelectAttribute( + _('Resource'), _('Supann resources'), + 'fdTasksLifeCyclePostResource', TRUE + ), + new SelectAttribute( + _('State'), _('Resource state'), + 'fdTasksLifeCyclePosState', TRUE + ), + new SelectAttribute( + _('Sub state'), _('Resource sub state'), + 'fdTasksLifeCyclePostSubState', FALSE + ), + new IntAttribute( + _('Extra days to add'), _('Extra days to be added after today'), + 'fdTasksLifeCyclePostEndDate', FALSE, '0', FALSE, '0' + ), + ] + ], + // Attributes are grouped by section + 'section2' => [ + 'name' => _('Pre / existing resources details'), + 'attrs' => [ + new SelectAttribute( + _('Resource'), _('Supann resources'), + 'fdTasksLifeCyclePreResource', TRUE + ), + new SelectAttribute( + _('State'), _('Resource state'), + 'fdTasksLifeCyclePreState', TRUE + ), + new SelectAttribute( + _('Sub state'), _('Resource sub state'), + 'fdTasksLifeCyclePreSubState', FALSE + ), + ] + ], + ]; + } + + /** + * @throws NonExistingLdapNodeException + */ + function __construct ($dn = NULL, $object = NULL, $parent = NULL, $mainTab = FALSE) + { + parent::__construct($dn, $object, $parent, $mainTab); + $this->setSupannStates(); + } + + /* + * Return table of existing Population Codes containing main's and local's + */ + protected function setSupannStates () : void + { + global $config; + + $resources = ['COMPTE' => _('Account'),'MAIL' => _('Mail')]; + foreach ($config->get_cfg_value('SupannRessourceLabels', []) as $line) { + list($resource,$label) = explode(':', $line, 2); + $resources[$resource] = $label; + } + + $this->attributesAccess['fdTasksLifeCyclePreResource']->setChoices(array_keys($resources),array_keys($resources)); + + +// $this->attributesAccess['fdTasksLifeCyclePostResource']->setValue(array_keys($resources)); + + +// $this->attributesAccess['fdTasksLifeCyclePreState']->setChoice(array_values($resources)); +// $this->attributesAccess['fdTasksLifeCyclePostState']->setChoice(array_values($resources)); + + } + + public function update (): bool + { + parent::update(); + return TRUE; + } + + function save (): array + { + // Verify if this tasks has to be executed upon saving. +// $execTasks = $this->parent->getBaseObject()->fdSubTasksActivation ?? NULL; + +// if ($execTasks) { +// $this->generateSlaveTasks(); +// } + + return parent::save(); + } +} diff --git a/plugins/configuration/tasks/class_tasksMail.inc b/plugins/configuration/tasks/class_tasksMail.inc index ee4a548f41a5fbb47b7c9f08bf9f3af827e58085..1c0c3fa67247696f76ce1734f79f5b58fcb97225 100644 --- a/plugins/configuration/tasks/class_tasksMail.inc +++ b/plugins/configuration/tasks/class_tasksMail.inc @@ -33,7 +33,7 @@ class tasksMail extends simplePlugin 'plObjectClass' => ['fdTasksMail'], 'plFilter' => '(objectClass=fdTasksMail)', 'plObjectType' => ['tasks'], - 'plConflicts' => [''], + 'plConflicts' => ['tasksLifeCycle'], 'plProvidedAcls' => parent::generatePlProvidedAcls(static::getAttributesInfo()), 'plForeignKeys' => [ 'fdTasksMailUsers' => [