From 7df993c7edeac411d0dcd9e7c2d895141611f48f Mon Sep 17 00:00:00 2001 From: atm-lena Date: Tue, 25 Aug 2020 17:26:32 +0200 Subject: [PATCH] Add "select_model_mail" function + add select to create event --- htdocs/comm/action/card.php | 19 ++++++++++----- htdocs/core/class/html.form.class.php | 33 +++++++++++++++++++++++++++ htdocs/langs/fr_FR/agenda.lang | 3 +++ 3 files changed, 49 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index d3548a2505f..cda05d21784 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1118,23 +1118,30 @@ if ($action == 'create') print ''; //Reminder - print ''; - //Reminder Type - print ''; - //Notification + //Reminder Type $TRemindTypes = array(); if(!empty($conf->global->AGENDA_REMINDER_EMAIL)) $TRemindTypes['mail'] = $langs->trans('EMail'); if(!empty($conf->global->AGENDA_REMINDER_BROWSER)) $TRemindTypes['push'] = $langs->trans('OSNotif'); - print ''; + //Mail Model + //TODO : ajouter les conditions pour l'affichage de ce champs : si au moins un model existe et si Email est le type de rappel sélectionné + print ''; + + print '
'.$langs->trans("Reminder").''; + print '
'.$langs->trans("ReminderTime").''; print ''; print '
'.$langs->trans("ReminderType").''; + //Time Type + print '
'.$langs->trans("TimeType").''; print $form->select_type_duration('offsetunit'); print '
'.$langs->trans("TypeRemind").''; - print $form->selectarray('typeremind',$TRemindTypes); + print '
'.$langs->trans("ReminderType").''; + print $form->selectarray('remindertype',$TRemindTypes); print '
'.$langs->trans("Model").''; + print $form->select_model_mail('eventpush', 'event_push'); + print '
'; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d102b0133f4..8d54dc78b13 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7965,4 +7965,37 @@ class Form return $ret; } + + public function select_model_mail($prefix, $modelType = ''){ + + global $langs, $db, $user; + + $retstring = ''; + + $TModels = array(); + + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + $result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs); + + if($result > 0){ + + foreach($formmail->lines_model as $model){ + $TModels[$model->id] = $model->label; + } + + } + + $retstring .= '"; + + print $retstring; + return; + } } diff --git a/htdocs/langs/fr_FR/agenda.lang b/htdocs/langs/fr_FR/agenda.lang index 6da45f7976d..e0d3e1fcbdf 100644 --- a/htdocs/langs/fr_FR/agenda.lang +++ b/htdocs/langs/fr_FR/agenda.lang @@ -158,3 +158,6 @@ DateStartPlusOne=Date de début + 1 heure SetAllEventsToTodo=Réglez tous les événements à "A faire" SetAllEventsToInProgress=Définir tous les événements à "En cours" SetAllEventsToFinished=Définir tous les événements sur "Terminés" +ReminderTime=Durée du rappel +TimeType=Type de durée +ReminderType=Type de rappel