diff --git a/contrib/openldap/core-fd.schema b/contrib/openldap/core-fd.schema index a90e631490b91308ce5ac679bd67cf49304cf09a..b64b48bef9269987e97b63836b3b4b48bc23f387 100644 --- a/contrib/openldap/core-fd.schema +++ b/contrib/openldap/core-fd.schema @@ -121,8 +121,8 @@ attributetype ( 1.3.6.1.4.1.38414.62.1.7 NAME 'fdMailTemplateSignature' SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40) -attributetype ( 1.3.6.1.4.1.38414.62.1.8 NAME 'fdMailTemplateAttachment' - DESC 'FusionDirectory - template mail field' +attributetype ( 1.3.6.1.4.1.38414.62.1.8 NAME 'fdMailAttachmentsContent' + DESC 'FusionDirectory - attachment data in bin format' EQUALITY octetStringMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40) @@ -447,8 +447,13 @@ objectclass (1.3.6.1.4.1.38414.62.2.3 NAME 'fdPluginManager' objectclass (1.3.6.1.4.1.38414.62.2.4 NAME 'fdMailTemplate' DESC 'FusionDirectory - template mail object' + SUP top STRUCTURAL MUST ( cn $ fdMailTemplateBody $ fdMailTemplateSubject ) - MAY ( fdMailTemplateSignature $ fdMailTemplateReadReceipt $ fdMailTemplateAttachment ) ) + MAY ( fdMailTemplateSignature $ fdMailTemplateReadReceipt)) + +objectclass (1.3.6.1.4.1.38414.62.2.10 NAME 'fdMailAttachments' + DESC 'FusionDirectory - mail template attachments' + MUST ( cn $ fdMailAttachmentsContent )) objectclass ( 1.3.6.1.4.1.38414.62.2.5 NAME 'fdMailTemplateConf' DESC 'FusionDirectory Mail Template Configuration' diff --git a/plugins/configuration/mailtemplate/class_mailTemplate.inc b/plugins/configuration/mailtemplate/class_mailTemplate.inc index e447ae0a36a7f732c34cb21cfe6b070aaa75f82c..ff3906a5e9d2135e80c4a25a6cf4431b2ebdf3ef 100644 --- a/plugins/configuration/mailtemplate/class_mailTemplate.inc +++ b/plugins/configuration/mailtemplate/class_mailTemplate.inc @@ -26,14 +26,14 @@ class mailTemplate extends simplePlugin public static function plInfo (): array { return [ - 'plShortName' => _('Mail Template'), + 'plShortName' => _('Mail Template'), 'plDescription' => _('Mail Template'), 'plObjectClass' => ['fdMailTemplate'], - 'plFilter' => '(objectClass=fdMailTemplate)', - 'plObjectType' => ['mailTemplate' => [ - 'name' => _('Mail Template'), - 'ou' => get_ou('mailTemplateRDN'), - 'icon' => 'geticon.php?context=applications&icon=mail-template&size=16', + 'plFilter' => '(objectClass=fdMailTemplate)', + 'plObjectType' => ['mailTemplate' => [ + 'name' => _('Mail Template'), + 'ou' => get_ou('mailTemplateRDN'), + 'icon' => 'geticon.php?context=applications&icon=mail-template&size=16', ]], 'plProvidedAcls' => parent::generatePlProvidedAcls(static::getAttributesInfo()) ]; @@ -45,33 +45,47 @@ class mailTemplate extends simplePlugin return [ // Attributes are grouped by section 'mailTemplate' => [ - 'name' => _('Mail Object'), + 'name' => _('Mail Object'), 'attrs' => [ - new StringAttribute( - _('Mail Template Name'), _('Mail Template Name'), - 'cn', TRUE - ), - new StringAttribute( - _('Mail Subject'), _('Mail Subject'), - 'fdMailTemplateSubject', TRUE - ), - new TextAreaAttribute( - _('Mail Template Body'), _('Text to be sent to recipient'), - 'fdMailTemplateBody', TRUE - ), - new TextAreaAttribute( - _('Mail Signature'), _('Mail Signature'), - 'fdMailTemplateSignature', FALSE - ), - new FileDownloadAttribute( - _('Attachment'), _('Import a file for this e-mail'), - 'fdMailTemplateAttachment', FALSE, '', TRUE - ), - new BooleanAttribute( - _('Read Receipt'), - _('Read Receipt'), - 'fdMailTemplateReadReceipt', FALSE - ), + new StringAttribute( + _('Mail Template Name'), _('Mail Template Name'), + 'cn', TRUE + ), + new StringAttribute( + _('Mail Subject'), _('Mail Subject'), + 'fdMailTemplateSubject', TRUE + ), + new TextAreaAttribute( + _('Mail Template Body'), _('Text to be sent to recipient'), + 'fdMailTemplateBody', TRUE + ), + new TextAreaAttribute( + _('Mail Signature'), _('Mail Signature'), + 'fdMailTemplateSignature', FALSE + ), + new BooleanAttribute( + _('Read Receipt'), + _('Read Receipt'), + 'fdMailTemplateReadReceipt', FALSE + ), + // Management of attachments files in a sub-node ldap format. + new SubNodesAttribute( + '', _('Attachments'), + 'attachments', ['fdMailAttachments'], + [ + new StringAttribute( + _('Name'), _('The name of the attachment file'), + 'cn', TRUE + ), + new FileDownloadAttribute( + _('Attachment'), _('Import a file for this e-mail'), + 'fdMailAttachmentsContent', FALSE, '', TRUE + ), + ], + FALSE, /* no order */ + [], + TRUE /* edit enabled */ + ), ] ], ]; @@ -85,4 +99,20 @@ class mailTemplate extends simplePlugin } + protected function shouldSave (): bool + { + // Trigger a save method required due to sub nodes not being triggered by default. (Modification and suppression). + return TRUE; + } + + + function ldap_save (): array + { + global $config; + $errors = parent::ldap_save(); + $this->attributesAccess['attachments']->postLdapSave($config->get_ldap_link()); + return $errors; + } + + } diff --git a/plugins/configuration/tasks/class_tasks.inc b/plugins/configuration/tasks/class_tasks.inc index 78e2c8553a06d503a52be74aba9af6e27284dc12..ccf98b0f053cb074803c36b5b0faa01f675f335b 100644 --- a/plugins/configuration/tasks/class_tasks.inc +++ b/plugins/configuration/tasks/class_tasks.inc @@ -82,7 +82,7 @@ class tasks extends simplePlugin ), new SelectAttribute( _('Repeatable Schedule'), _('Select the desired schedule.'), - 'fdTasksRepeatableSchedule', FALSE, ['Yearly', 'Monthly', 'Daily', 'Hourly'], 'Daily' + 'fdTasksRepeatableSchedule', FALSE, ['Yearly', 'Monthly', 'Weekly', 'Daily', 'Hourly'], 'Daily' ), ] ], diff --git a/plugins/configuration/tasks/class_tasksManagement.inc b/plugins/configuration/tasks/class_tasksManagement.inc index db8ab17c78593df0475baf1f0ccfd039cb9adf14..856c9cb62c286c5d5d01c84cb2186061750326d6 100644 --- a/plugins/configuration/tasks/class_tasksManagement.inc +++ b/plugins/configuration/tasks/class_tasksManagement.inc @@ -29,6 +29,7 @@ class tasksManagement extends management */ public static $columns = [ //below fdTasksMailObject must be change to have a type defined within task creation (new ldap attributes ?hidden) + ['LinkColumn', ['attributes' => 'cn', 'label' => 'Tasks']], ['TasksColumn', ['attributes' => 'fdTasksMailObject', 'label' => 'Types']], ['Column', ['attributes' => 'fdTasksCreationDate', 'label' => 'Creation Date']], ['TasksColumn', ['attributes' => 'fdTasksScheduleDate', 'label' => 'Scheduled']], diff --git a/plugins/dashboard/tasks/class_tasksDashboard.inc b/plugins/dashboard/tasks/class_tasksDashboard.inc index bf4149c3740be5dd3f0f580e630e6e68833fa099..05405973f626314b563346f52f0afb15e6cb26ef 100644 --- a/plugins/dashboard/tasks/class_tasksDashboard.inc +++ b/plugins/dashboard/tasks/class_tasksDashboard.inc @@ -29,9 +29,8 @@ class tasksDashboard extends management $this->setupFilters(); } - // Actions collumn are removed compared to parent. + // Actions column are removed compared to parent. public static $columns = [ - ['Column', ['attributes' => 'cn', 'label' => 'Tasks']], ['TasksColumn', ['attributes' => 'fdTasksGranularMaster', 'label' => 'Master Task']], ['Column', ['attributes' => 'fdTasksGranularType', 'label' => 'Types']], ['Column', ['attributes' => 'fdTasksGranularMail', 'label' => 'Email']],