From 6fb9759864c8d17311ca7e5008b29958904ee96a Mon Sep 17 00:00:00 2001 From: Thibault Dockx <thibault.dockx@fusiondirectory.org> Date: Thu, 12 May 2022 18:38:15 +0100 Subject: [PATCH] :sparkles: Feat(Tasks) - First commit of Tasks Simple commit of the management and two sub class creation. --- plugins/addons/tasks/class_tasks.inc | 67 +++++++++++++++++++ plugins/addons/tasks/class_tasksMail.inc | 64 ++++++++++++++++++ .../addons/tasks/class_tasksManagement.inc | 46 +++++++++++++ 3 files changed, 177 insertions(+) create mode 100644 plugins/addons/tasks/class_tasks.inc create mode 100644 plugins/addons/tasks/class_tasksMail.inc create mode 100644 plugins/addons/tasks/class_tasksManagement.inc diff --git a/plugins/addons/tasks/class_tasks.inc b/plugins/addons/tasks/class_tasks.inc new file mode 100644 index 000000000..a51c7e02d --- /dev/null +++ b/plugins/addons/tasks/class_tasks.inc @@ -0,0 +1,67 @@ +<?php +/* + This code is part of FusionDirectory (http://www.fusiondirectory.org/) + + Copyright (C) 2012-2022 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 tasks extends simplePlugin +{ + protected $displayHeader = FALSE; + + static function plInfo (): array + { + return [ + 'plShortName' => _('Tasks'), + 'plDescription' => _('Tasks'), + 'plObjectClass' => ['fdTasks'], + 'plFilter' => '(objectClass=fdTasks)', + 'plPriority' => 41, + 'plObjectType' => ['tasks' => [ + 'name' => _('Tasks'), + 'ou' => get_ou('tasksRDN'), + 'icon' => 'geticon.php?context=applications&icon=dsa&size=16', + ]], + 'plProvidedAcls' => parent::generatePlProvidedAcls(static::getAttributesInfo()) + ]; + } + + static function getAttributesInfo (): array + { + return [ + // Attributes are grouped by section + 'tasks' => [ + 'name' => _('Tasks Generic'), + 'attrs' => [ + new StringAttribute( + _('Task Name'), _('Mail Template Name'), + 'cn', TRUE + ), + ] + ], + ]; + } + + + function __construct ($dn = NULL, $object = NULL, $parent = NULL, $mainTab = FALSE) + { + global $config; + parent::__construct($dn, $object, $parent, $mainTab); + + } + +} diff --git a/plugins/addons/tasks/class_tasksMail.inc b/plugins/addons/tasks/class_tasksMail.inc new file mode 100644 index 000000000..236f27e66 --- /dev/null +++ b/plugins/addons/tasks/class_tasksMail.inc @@ -0,0 +1,64 @@ +<?php +/* + This code is part of FusionDirectory (http://www.fusiondirectory.org) + + Copyright (C) 2018-2022 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 tasksMail extends simplePlugin +{ + protected $displayHeader = TRUE; + + static function plInfo (): array + { + return [ + 'plShortName' => _('Tasks Mail'), + 'plDescription' => _('Tasks Mail Object'), + 'plIcon' => 'geticon.php?context=applications&icon=supann&size=48', + 'plSmallIcon' => 'geticon.php?context=applications&icon=supann-status&size=16', + 'plPriority' => 42, + 'plObjectClass' => ['fdTasksMail'], + 'plFilter' => '(objectClass=fdTasksMail)', + 'plObjectType' => ['tasks'], + 'plConflicts' => [''], + 'plProvidedAcls' => parent::generatePlProvidedAcls(static::getAttributesInfo()) + ]; + } + + static function getAttributesInfo (): array + { + return [ + // Attributes are grouped by section + 'taskMail' => [ + 'name' => _('Task Mail Object'), + 'attrs' => [ + new StringAttribute( + _('Task Mail Template Name'), _('Mail Template Name'), + 'cn', TRUE + ), + ] + ], + ]; + } + + function __construct ($dn = NULL, $object = NULL, $parent = NULL, $mainTab = FALSE) + { + global $config; + parent::__construct($dn, $object, $parent, $mainTab); + } + +} diff --git a/plugins/addons/tasks/class_tasksManagement.inc b/plugins/addons/tasks/class_tasksManagement.inc new file mode 100644 index 000000000..d5a62a9e8 --- /dev/null +++ b/plugins/addons/tasks/class_tasksManagement.inc @@ -0,0 +1,46 @@ +<?php +/* + This code is part of FusionDirectory (http://www.fusiondirectory.org/) + Copyright (C) 2011-2022 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 tasksManagement extends management +{ + + /* Default columns */ + + public static $columns = [ + ['ObjectTypeColumn', []], + ['LinkColumn', ['attributes' => 'cn', 'label' => 'Tasks']], + ['ActionsColumn', ['label' => 'Actions']], + ]; + + static function plInfo () + { + return [ + 'plShortName' => _('Tasks'), + 'plDescription' => _('Provide a mechanism to create and manage tasks'), + 'plTitle' => _('Tasks'), + 'plIcon' => 'geticon.php?context=applications&icon=argonaut&size=48', + 'plSection' => 'conf', + 'plPriority' => 40, + 'plManages' => ['tasks'], + 'plProvidedAcls' => [], + ]; + } + +} -- GitLab