diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php
index e34536e648a..7dfbeff82f6 100644
--- a/htdocs/admin/agenda_reminder.php
+++ b/htdocs/admin/agenda_reminder.php
@@ -179,53 +179,52 @@ print '
| '."\n";
print ''.$langs->trans("Value").' | '."\n";
print ''."\n";
+// AGENDA REMINDER BROWSER
+print ''."\n";
+print '| '.$langs->trans('AGENDA_REMINDER_BROWSER').' | '."\n";
+print ' | '."\n";
+print ''."\n";
+
+if (empty($conf->global->AGENDA_REMINDER_BROWSER)) {
+ print ''.img_picto($langs->trans('Disabled'), 'switch_off').'';
+ print ' |
'."\n";
+} else {
+ print ''.img_picto($langs->trans('Enabled'), 'switch_on').'';
+ print ''."\n";
+
+ print ''."\n";
+ print '| '.$langs->trans('AGENDA_REMINDER_BROWSER_SOUND').' | '."\n";
+ print ' | '."\n";
+ print ''."\n";
+
+ if (empty($conf->global->AGENDA_REMINDER_BROWSER_SOUND)) {
+ print ''.img_picto($langs->trans('Disabled'), 'switch_off').'';
+ } else {
+ print ''.img_picto($langs->trans('Enabled'), 'switch_on').'';
+ }
+
+ print ' |
'."\n";
+}
// AGENDA REMINDER EMAIL
-if ($conf->global->MAIN_FEATURES_LEVEL == 2)
-{
- print ''."\n";
- print '| '.$langs->trans('AGENDA_REMINDER_EMAIL', $langs->transnoentities("Module2300Name")).' | '."\n";
- print ' | '."\n";
- print ''."\n";
+print ' |
'."\n";
+print '| '.$langs->trans('AGENDA_REMINDER_EMAIL', $langs->transnoentities("Module2300Name")).' | '."\n";
+print ' | '."\n";
+print ''."\n";
+if (empty($conf->cron->enabled)) {
+ print ''.$langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("Module2300Name")).'';
+} else {
if (empty($conf->global->AGENDA_REMINDER_EMAIL)) {
print ''.img_picto($langs->trans('Disabled'), 'switch_off').'';
- print ' |
'."\n";
} else {
print ''.img_picto($langs->trans('Enabled'), 'switch_on').'';
- print ''."\n";
- }
-}
-
-// AGENDA REMINDER BROWSER
-if ($conf->global->MAIN_FEATURES_LEVEL == 2)
-{
- print ''."\n";
- print '| '.$langs->trans('AGENDA_REMINDER_BROWSER').' | '."\n";
- print ' | '."\n";
- print ''."\n";
-
- if (empty($conf->global->AGENDA_REMINDER_BROWSER)) {
- print ''.img_picto($langs->trans('Disabled'), 'switch_off').'';
- print ' |
'."\n";
- } else {
- print ''.img_picto($langs->trans('Enabled'), 'switch_on').'';
- print ''."\n";
-
- print ''."\n";
- print '| '.$langs->trans('AGENDA_REMINDER_BROWSER_SOUND').' | '."\n";
- print ' | '."\n";
- print ''."\n";
-
- if (empty($conf->global->AGENDA_REMINDER_BROWSER_SOUND)) {
- print ''.img_picto($langs->trans('Disabled'), 'switch_off').'';
- } else {
- print ''.img_picto($langs->trans('Enabled'), 'switch_on').'';
- }
-
- print ' |
'."\n";
+ // Get the max frequency of reminder
+
+ print '
'.$langs->trans("AGENDA_REMINDER_EMAIL_NOTE", $langs->transnoentitiesnoconv("Module2300Name")).'';
}
}
+print ''."\n";
print '';
diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index 0b1eba637d4..6d51a16ddc2 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -117,8 +117,8 @@ $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
$TRemindTypes = array();
-if (!empty($conf->global->AGENDA_REMINDER_EMAIL)) $TRemindTypes['email'] = $langs->trans('EMail');
-if (!empty($conf->global->AGENDA_REMINDER_BROWSER)) $TRemindTypes['browser'] = $langs->trans('BrowserPush');
+if (!empty($conf->global->AGENDA_REMINDER_BROWSER)) $TRemindTypes['browser'] = array('label'=>$langs->trans('BrowserPush'), 'disabled'=>(empty($conf->global->AGENDA_REMINDER_BROWSER) ? 1 : 0));
+if (!empty($conf->global->AGENDA_REMINDER_EMAIL)) $TRemindTypes['email'] = array('label'=>$langs->trans('EMail'), 'disabled'=>(empty($conf->global->AGENDA_REMINDER_EMAIL) ? 1 : 0));
$TDurationTypes = array('y'=>$langs->trans('Years'), 'm'=>$langs->trans('Month'), 'w'=>$langs->trans('Weeks'), 'd'=>$langs->trans('Days'), 'h'=>$langs->trans('Hours'), 'i'=>$langs->trans('Minutes'));
@@ -1247,12 +1247,7 @@ if ($action == 'create')
//Reminder
print '| '.$langs->trans("ReminderTime").' | ';
- print '';
- print ' |
';
-
- //Time Type
- print '| '.$langs->trans("TimeType").' | ';
- print $form->selectTypeDuration('offsetunit', 'i');
+ print ' '.$form->selectTypeDuration('offsetunit', 'i');
print ' |
';
//Reminder Type
@@ -1731,20 +1726,13 @@ if ($id > 0)
print '';
- //Reminder
+ // Reminder
print '| '.$langs->trans("ReminderTime").' | ';
- print '';
+ print ' '.$form->selectTypeDuration('offsetunit', $actionCommReminder->offsetunit);
print ' |
';
- //Time Type
- print '| '.$langs->trans("TimeType").' | ';
- print $form->selectTypeDuration('offsetunit', $actionCommReminder->offsetunit);
- print ' |
';
-
- //Reminder Type
+ // Reminder Type
$TRemindTypes = array();
- if (!empty($conf->global->AGENDA_REMINDER_EMAIL)) $TRemindTypes['email'] = $langs->trans('EMail');
- if (!empty($conf->global->AGENDA_REMINDER_BROWSER)) $TRemindTypes['browser'] = $langs->trans('BrowserPush');
print '| '.$langs->trans("ReminderType").' | ';
print $form->selectarray('selectremindertype', $TRemindTypes, $actionCommReminder->typeremind);
print ' |
';
@@ -1752,7 +1740,7 @@ if ($id > 0)
$hide = '';
if ($actionCommReminder->typeremind == 'browser') $hide = 'style="display:none;"';
- //Mail Model
+ // Mail Model
print '| '.$langs->trans("EMailTemplates").' | ';
print $form->selectModelMail('actioncommsend', 'actioncomm_send', 1);
print ' |
';
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 0173e03730e..a7bcc562a9b 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -6259,7 +6259,7 @@ class Form
* Note: Do not apply langs->trans function on returned content, content may be entity encoded twice.
*
* @param string $htmlname Name of html select area. Must start with "multi" if this is a multiselect
- * @param array $array Array like array(key => value) or array(key=>array('label'=>..., 'data-...'=>...))
+ * @param array $array Array like array(key => value) or array(key=>array('label'=>..., 'data-...'=>..., 'disabled'=>..., 'css'=>...))
* @param string|string[] $id Preselected key or preselected keys for multiselect
* @param int|string $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (key is -1 and value is '' or ' ' if 1, key is -1 and value is text if string), <0 to add an empty value with key that is this value.
* @param int $key_in_label 1 to show key into label with format "[key] value"
@@ -6331,10 +6331,14 @@ class Form
foreach ($array as $key => $tmpvalue)
{
- if (is_array($tmpvalue)) $value = $tmpvalue['label'];
- else $value = $tmpvalue;
-
- $disabled = ''; $style = '';
+ if (is_array($tmpvalue)) {
+ $value = $tmpvalue['label'];
+ $disabled = empty($tmpvalue['disabled']) ? '' : ' disabled';
+ $style = empty($tmpvalue['css']) ? ' class="'.$tmpvalue['css'].'"' : '';
+ } else {
+ $value = $tmpvalue;
+ $disabled = ''; $style = '';
+ }
if (!empty($disablebademail))
{
if (($disablebademail == 1 && !preg_match('/<.+@.+>/', $value))
diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php
index 599ee983296..8241b415726 100644
--- a/htdocs/core/lib/agenda.lib.php
+++ b/htdocs/core/lib/agenda.lib.php
@@ -356,13 +356,10 @@ function agenda_prepare_head()
$head[$h][2] = 'autoactions';
$h++;
- if ($conf->global->MAIN_FEATURES_LEVEL > 0)
- {
- $head[$h][0] = DOL_URL_ROOT."/admin/agenda_reminder.php";
- $head[$h][1] = $langs->trans("Reminders");
- $head[$h][2] = 'reminders';
- $h++;
- }
+ $head[$h][0] = DOL_URL_ROOT."/admin/agenda_reminder.php";
+ $head[$h][1] = $langs->trans("Reminders");
+ $head[$h][2] = 'reminders';
+ $h++;
$head[$h][0] = DOL_URL_ROOT."/admin/agenda_xcal.php";
$head[$h][1] = $langs->trans("ExportCal");
diff --git a/htdocs/core/lib/cron.lib.php b/htdocs/core/lib/cron.lib.php
index 084b781d3b4..fda122be7bf 100644
--- a/htdocs/core/lib/cron.lib.php
+++ b/htdocs/core/lib/cron.lib.php
@@ -39,6 +39,11 @@ function cronadmin_prepare_head()
$head[$h][2] = 'setup';
$h++;
+ $head[$h][0] = dol_buildpath('/cron/list.php?mode=modulesetup', 1);
+ $head[$h][1] = $langs->trans("Module2300Name");
+ $head[$h][2] = 'jobs';
+ $h++;
+
complete_head_from_modules($conf, $langs, null, $head, $h, 'cronadmin');
complete_head_from_modules($conf, $langs, null, $head, $h, 'cronadmin', 'remove');
diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php
index 0712adc59fb..559260a77c2 100644
--- a/htdocs/core/modules/modAgenda.class.php
+++ b/htdocs/core/modules/modAgenda.class.php
@@ -113,7 +113,7 @@ class modAgenda extends DolibarrModules
//------------
$datestart = dol_now();
$this->cronjobs = array(
- 0=>array('label'=>'SendEmailsReminders', 'jobtype'=>'method', 'class'=>'comm/action/class/actioncomm.class.php', 'objectname'=>'ActionComm', 'method'=>'sendEmailsReminder', 'parameters'=>'', 'comment'=>'SendEMailsReminder', 'frequency'=>10, 'unitfrequency'=>60, 'priority'=>10, 'status'=>1, 'test'=>'$conf->agenda->enabled', 'datestart'=>$datestart),
+ 0=>array('label'=>'SendEmailsReminders', 'jobtype'=>'method', 'class'=>'comm/action/class/actioncomm.class.php', 'objectname'=>'ActionComm', 'method'=>'sendEmailsReminder', 'parameters'=>'', 'comment'=>'SendEMailsReminder', 'frequency'=>5, 'unitfrequency'=>60, 'priority'=>10, 'status'=>1, 'test'=>'$conf->agenda->enabled', 'datestart'=>$datestart),
);
// Permissions
diff --git a/htdocs/cron/admin/cron.php b/htdocs/cron/admin/cron.php
index fc3ca7c63b6..b0431f40dee 100644
--- a/htdocs/cron/admin/cron.php
+++ b/htdocs/cron/admin/cron.php
@@ -35,7 +35,7 @@ $langs->loadLangs(array('admin', 'cron'));
if (!$user->admin)
accessforbidden();
-$actionsave = GETPOST("save");
+$actionsave = GETPOST("save", 'alphanohtml');
// Save parameters
if (!empty($actionsave))
@@ -75,6 +75,8 @@ print '';
print dol_get_fiche_head($head, 'setup', $langs->trans("Module2300Name"), -1, 'cron');
+print ''.$langs->trans('CronInfo').'
';
+
print "
\n";
print '';
@@ -116,7 +118,7 @@ print '';
print '
';
-print $langs->trans("UseMenuModuleToolsToAddCronJobs", dol_buildpath('/cron/list.php?leftmenu=admintools', 1)).'
';
+//print $langs->trans("UseMenuModuleToolsToAddCronJobs", dol_buildpath('/cron/list.php?leftmenu=admintools', 1)).'
';
if (!empty($conf->global->CRON_WARNING_DELAY_HOURS)) print info_admin($langs->trans("WarningCronDelayed", $conf->global->CRON_WARNING_DELAY_HOURS)).'
';
print '
';
diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php
index 9c3a2b38f02..a67b7633044 100644
--- a/htdocs/cron/card.php
+++ b/htdocs/cron/card.php
@@ -42,7 +42,9 @@ $id = GETPOST('id', 'int');
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
$cancel = GETPOST('cancel', 'alpha');
-$backtourl = GETPOST('backtourl', 'alpha');
+$backtopage = GETPOST('backtopage', 'alpha');
+$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
+
$securitykey = GETPOST('securitykey', 'alpha');
@@ -62,13 +64,13 @@ if (!empty($id))
if (!empty($cancel))
{
- if (!empty($id) && empty($backtourl))
+ if (!empty($id) && empty($backtopage))
{
$action = '';
} else {
- if ($backtourl)
+ if ($backtopage)
{
- header("Location: ".$backtourl);
+ header("Location: ".$backtopage);
exit;
} else {
header("Location: ".DOL_URL_ROOT.'/cron/list.php');
@@ -297,7 +299,7 @@ if (($action == "create") || ($action == "edit"))
{
print '