diff --git a/htdocs/adherents/admin/adherent_emails.php b/htdocs/adherents/admin/adherent_emails.php
index 60e0b2c3b48..36c7091a47b 100644
--- a/htdocs/adherents/admin/adherent_emails.php
+++ b/htdocs/adherents/admin/adherent_emails.php
@@ -147,8 +147,9 @@ $constantes=array(
'ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER' =>'emailtemplate:member', /* old was ADHERENT_AUTOREGISTER_MAIL */
'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_VALID */
'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_COTIS */
- 'ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION' =>'emailtemplate:member',
'ADHERENT_EMAIL_TEMPLATE_CANCELATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_RESIL */
+ 'MEMBER_REMINDER_EMAIL'=>array('type'=>'yesno', 'label'=>$langs->trans('MEMBER_REMINDER_EMAIL', $langs->transnoentities("Module2300Name"))),
+ 'ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION' =>'emailtemplate:member',
);
$helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'
';
diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index 3df36ef3eda..4277b274a1d 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -2644,13 +2644,19 @@ class Adherent extends CommonObject
$blockingerrormsg = '';
- /*if (empty($conf->global->MEMBER_REMINDER_EMAIL))
+ if (empty($conf->adherent->enabled)) // Should not happen. If module disabled, cron job should not be visible.
+ {
+ $langs->load("agenda");
+ $this->output = $langs->trans('ModuleNotEnabled', $langs->transnoentitiesnoconv("Adherent"));
+ return 0;
+ }
+ if (empty($conf->global->MEMBER_REMINDER_EMAIL))
{
$langs->load("agenda");
$this->output = $langs->trans('EventRemindersByEmailNotEnabled', $langs->transnoentitiesnoconv("Adherent"));
return 0;
- }*/
-
+ }
+
$now = dol_now();
$nbok = 0;
$nbko = 0;
diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php
index 92af9fef6da..e84ef93da2d 100644
--- a/htdocs/comm/action/class/actioncomm.class.php
+++ b/htdocs/comm/action/class/actioncomm.class.php
@@ -1679,13 +1679,19 @@ class ActionComm extends CommonObject
$this->output = '';
$this->error='';
- if (empty($conf->global->AGENDA_REMINDER_EMAIL))
+ if (empty($conf->agenda->enabled)) // Should not happen. If module disabled, cron job should not be visible.
+ {
+ $langs->load("agenda");
+ $this->output = $langs->trans('ModuleNotEnabled', $langs->transnoentitiesnoconv("Agenda"));
+ return 0;
+ }
+ if (empty($conf->global->AGENDA_REMINDER_EMAIL))
{
$langs->load("agenda");
$this->output = $langs->trans('EventRemindersByEmailNotEnabled', $langs->transnoentitiesnoconv("Agenda"));
return 0;
}
-
+
$now = dol_now();
dol_syslog(__METHOD__, LOG_DEBUG);
diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php
index f5efa5c5b7e..89f511c18c2 100644
--- a/htdocs/core/lib/admin.lib.php
+++ b/htdocs/core/lib/admin.lib.php
@@ -1353,7 +1353,8 @@ function complete_elementList_with_modules(&$elementList)
/**
* Show array with constants to edit
*
- * @param array $tableau Array of constants array('key'=>type, ) where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ...
+ * @param array $tableau Array of constants array('key'=>array('type'=>type, 'label'=>label)
+ * where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ...
* @param int $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (no form into table), 2=No form nor button at all
* @param string $helptext Help
* @return void
@@ -1377,17 +1378,28 @@ function form_constantes($tableau, $strictw3c=0, $helptext='')
if (empty($strictw3c)) print '