Fix warning.
Module cron is more clear.
This commit is contained in:
parent
3534555909
commit
95b79094df
@ -25,6 +25,7 @@ require '../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/cron/class/cronjob.class.php';
|
||||||
|
|
||||||
if (!$user->admin)
|
if (!$user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
@ -218,10 +219,18 @@ if (empty($conf->cron->enabled)) {
|
|||||||
if (empty($conf->global->AGENDA_REMINDER_EMAIL)) {
|
if (empty($conf->global->AGENDA_REMINDER_EMAIL)) {
|
||||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_REMINDER_EMAIL&token='.newToken().'">'.img_picto($langs->trans('Disabled'), 'switch_off').'</a>';
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_REMINDER_EMAIL&token='.newToken().'">'.img_picto($langs->trans('Disabled'), 'switch_off').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_REMINDER_EMAIL&token='.newToken().'">'.img_picto($langs->trans('Enabled'), 'switch_on').'</a>';
|
|
||||||
// Get the max frequency of reminder
|
// Get the max frequency of reminder
|
||||||
|
// TODO Read frequency of the job sendEmailsReminder and if job is enabled
|
||||||
print '<br><span class="opacitymedium">'.$langs->trans("AGENDA_REMINDER_EMAIL_NOTE", $langs->transnoentitiesnoconv("Module2300Name")).'</span>';
|
$job = new Cronjob($db);
|
||||||
|
$job->fetch(0, 'ActionComm', 'sendEmailsReminder');
|
||||||
|
if ($job->id > 0) {
|
||||||
|
if ($job->status != $job::STATUS_ENABLED) {
|
||||||
|
print '<span class="opacitymedium warning">'.$langs->trans("JobXMustBeEnabled", $langs->transnoentitiesnoconv("sendEmailsReminder")).'</span>';
|
||||||
|
} else {
|
||||||
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_REMINDER_EMAIL&token='.newToken().'">'.img_picto($langs->trans('Enabled'), 'switch_on').'</a>';
|
||||||
|
print '<br><span class="opacitymedium">'.$langs->trans("AGENDA_REMINDER_EMAIL_NOTE", $langs->transnoentitiesnoconv("sendEmailsReminder")).'</span>';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|||||||
@ -1625,7 +1625,7 @@ function pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails = 0)
|
|||||||
{
|
{
|
||||||
if (empty($hidedetails) || $hidedetails > 1)
|
if (empty($hidedetails) || $hidedetails > 1)
|
||||||
{
|
{
|
||||||
$subprice = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_subprice : $object->lines[$i]->subprice);
|
$subprice = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_subprice : $object->lines[$i]->subprice);
|
||||||
$result .= price($sign * $subprice, 0, $outputlangs);
|
$result .= price($sign * $subprice, 0, $outputlangs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -290,9 +290,11 @@ class Cronjob extends CommonObject
|
|||||||
* Load object in memory from the database
|
* Load object in memory from the database
|
||||||
*
|
*
|
||||||
* @param int $id Id object
|
* @param int $id Id object
|
||||||
|
* @param string $objectname Object name
|
||||||
|
* @param string $methodname Method name
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function fetch($id)
|
public function fetch($id, $objectname = '', $methodname = '')
|
||||||
{
|
{
|
||||||
$sql = "SELECT";
|
$sql = "SELECT";
|
||||||
$sql .= " t.rowid,";
|
$sql .= " t.rowid,";
|
||||||
@ -328,7 +330,13 @@ class Cronjob extends CommonObject
|
|||||||
$sql .= " t.libname,";
|
$sql .= " t.libname,";
|
||||||
$sql .= " t.test";
|
$sql .= " t.test";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."cronjob as t";
|
$sql .= " FROM ".MAIN_DB_PREFIX."cronjob as t";
|
||||||
|
if ($id > 0) {
|
||||||
$sql .= " WHERE t.rowid = ".$id;
|
$sql .= " WHERE t.rowid = ".$id;
|
||||||
|
} else {
|
||||||
|
$sql .= " WHERE t.entity IN(0, ".getEntity('cron').")";
|
||||||
|
$sql .= " AND t.objectname = '".$this->db->escape($objectname)."'";
|
||||||
|
$sql .= " AND t.methodename = '".$this->db->escape($methodname)."'";
|
||||||
|
}
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
@ -1233,7 +1241,7 @@ class Cronjob extends CommonObject
|
|||||||
if (($this->maxrun > 0 && ($this->nbrun >= $this->maxrun))
|
if (($this->maxrun > 0 && ($this->nbrun >= $this->maxrun))
|
||||||
|| ($this->dateend && ($this->datenextrun > $this->dateend)))
|
|| ($this->dateend && ($this->datenextrun > $this->dateend)))
|
||||||
{
|
{
|
||||||
$this->status = 2;
|
$this->status = self::STATUS_ARCHIVED;
|
||||||
dol_syslog(get_class($this)."::reprogram_jobs Job will be set to archived", LOG_ERR);
|
dol_syslog(get_class($this)."::reprogram_jobs Job will be set to archived", LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -602,11 +602,6 @@ if ($mode == 'modulesetup') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print '<br><br>';
|
|
||||||
|
|
||||||
|
|
||||||
dol_print_cron_urls();
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -1741,7 +1741,7 @@ AGENDA_DEFAULT_VIEW=Which view do you want to open by default when selecting men
|
|||||||
AGENDA_REMINDER_BROWSER=Enable event reminder <b>on user's browser</b> (When remind date is reached, a popup is shown by the browser. Each user can disable such notifications from its browser notification setup).
|
AGENDA_REMINDER_BROWSER=Enable event reminder <b>on user's browser</b> (When remind date is reached, a popup is shown by the browser. Each user can disable such notifications from its browser notification setup).
|
||||||
AGENDA_REMINDER_BROWSER_SOUND=Enable sound notification
|
AGENDA_REMINDER_BROWSER_SOUND=Enable sound notification
|
||||||
AGENDA_REMINDER_EMAIL=Enable event reminder <b>by emails</b> (remind option/delay can be defined on each event).
|
AGENDA_REMINDER_EMAIL=Enable event reminder <b>by emails</b> (remind option/delay can be defined on each event).
|
||||||
AGENDA_REMINDER_EMAIL_NOTE=Note: Module <strong>%s</strong> must be enabled and correctly setup to have reminder sent at the correct frequency.
|
AGENDA_REMINDER_EMAIL_NOTE=The frequency of the task %s must be enough to be sure that the remind are sent at the correct moment.
|
||||||
AGENDA_SHOW_LINKED_OBJECT=Show linked object into agenda view
|
AGENDA_SHOW_LINKED_OBJECT=Show linked object into agenda view
|
||||||
##### Clicktodial #####
|
##### Clicktodial #####
|
||||||
ClickToDialSetup=Click To Dial module setup
|
ClickToDialSetup=Click To Dial module setup
|
||||||
|
|||||||
@ -84,3 +84,4 @@ MakeLocalDatabaseDumpShort=Local database backup
|
|||||||
MakeLocalDatabaseDump=Create a local database dump. Parameters are: compression ('gz' or 'bz' or 'none'), backup type ('mysql', 'pgsql', 'auto'), 1, 'auto' or filename to build, number of backup files to keep
|
MakeLocalDatabaseDump=Create a local database dump. Parameters are: compression ('gz' or 'bz' or 'none'), backup type ('mysql', 'pgsql', 'auto'), 1, 'auto' or filename to build, number of backup files to keep
|
||||||
WarningCronDelayed=Attention, for performance purpose, whatever is next date of execution of enabled jobs, your jobs may be delayed to a maximum of %s hours, before being run.
|
WarningCronDelayed=Attention, for performance purpose, whatever is next date of execution of enabled jobs, your jobs may be delayed to a maximum of %s hours, before being run.
|
||||||
DATAPOLICYJob=Data cleaner and anonymizer
|
DATAPOLICYJob=Data cleaner and anonymizer
|
||||||
|
JobXMustBeEnabled=Job %s must be enabled
|
||||||
Loading…
Reference in New Issue
Block a user