Fix setup to enable reminder b email

This commit is contained in:
Laurent Destailleur 2018-11-03 12:37:52 +01:00
parent 7e55701774
commit 68ec172798
5 changed files with 37 additions and 11 deletions

View File

@ -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").'<br>';

View File

@ -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;

View File

@ -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);

View File

@ -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 '<td align="center" width="80">'.$langs->trans("Action").'</td>';
print "</tr>\n";
$label='';
$listofparam=array();
foreach($tableau as $key => $const) // Loop on each param
{
$label='';
// $const is a const key like 'MYMODULE_ABC'
if (is_numeric($key)) {
if (is_numeric($key)) { // Very old behaviour
$type = 'string';
}
else
{
$type = $const;
$const = $key;
if (is_array($const))
{
$type = $const['type'];
$label = $const['label'];
$const = $key;
}
else
{
$type = $const;
$const = $key;
}
}
$sql = "SELECT ";
@ -1428,7 +1440,7 @@ function form_constantes($tableau, $strictw3c=0, $helptext='')
print '<input type="hidden" name="constnote_'.$obj->name.'" value="'.nl2br(dol_escape_htmltag($obj->note)).'">';
print '<input type="hidden" name="consttype_'.$obj->name.'" value="'.($obj->type?$obj->type:'string').'">';
print $langs->trans('Desc'.$const);
print ($label ? $label : $langs->trans('Desc'.$const));
if ($const == 'ADHERENT_MAILMAN_URL')
{

View File

@ -1282,6 +1282,7 @@ AdherentLoginRequired= Manage a Login for each member
AdherentMailRequired=EMail required to create a new member
MemberSendInformationByMailByDefault=Checkbox to send mail confirmation to members (validation or new subscription) is on by default
VisitorCanChooseItsPaymentMode=Visitor can choose among available payment modes
MEMBER_REMINDER_EMAIL=Enable automatic reminder <b>by emails</b> of expired subscriptions. Note: Module <strong>%s</strong> must be enabled and correctly setup to have reminder sent.
##### LDAP setup #####
LDAPSetup=LDAP Setup
LDAPGlobalParameters=Global parameters