mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix init cron when priority is not set.
This commit is contained in:
parent
5797a0db3f
commit
ecc5f90574
|
|
@ -121,7 +121,7 @@ class modDataPolicy extends DolibarrModules
|
|||
array('DATAPOLICY_ADHERENT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0),
|
||||
);
|
||||
|
||||
$country = explode(":", !getDolGlobalString('MAIN_INFO_SOCIETE_COUNTRY') ? '' : $conf->global->MAIN_INFO_SOCIETE_COUNTRY);
|
||||
//$country = explode(":", getDolGlobalString('MAIN_INFO_SOCIETE_COUNTRY'));
|
||||
|
||||
// Some keys to add into the overwriting translation tables
|
||||
/* $this->overwrite_translation = array(
|
||||
|
|
@ -176,7 +176,7 @@ class modDataPolicy extends DolibarrModules
|
|||
// Cronjobs (List of cron jobs entries to add when module is enabled)
|
||||
// unit_frequency must be 60 for minute, 3600 for hour, 86400 for day, 604800 for week
|
||||
$this->cronjobs = array(
|
||||
0 => array('label' => 'DATAPOLICYJob', 'jobtype' => 'method', 'class' => 'datapolicy/class/datapolicycron.class.php', 'objectname' => 'DataPolicyCron', 'method' => 'cleanDataForDataPolicy', 'parameters' => '', 'comment' => 'Clean data', 'frequency' => 1, 'unitfrequency' => 86400, 'status' => 1, 'test' => '$conf->datapolicy->enabled'),
|
||||
0 => array('label' => 'DATAPOLICYJob', 'jobtype' => 'method', 'class' => 'datapolicy/class/datapolicycron.class.php', 'objectname' => 'DataPolicyCron', 'method' => 'cleanDataForDataPolicy', 'parameters' => '', 'comment' => 'Clean data', 'frequency' => 1, 'unitfrequency' => 86400, 'status' => 1, 'test' => 'isModEnabled("datapolicy")'),
|
||||
);
|
||||
// Example: $this->cronjobs=array(0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'/dir/class/file.class.php', 'objectname'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true),
|
||||
// 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24, 'status'=>0, 'test'=>true)
|
||||
|
|
|
|||
|
|
@ -246,9 +246,6 @@ class Cronjob extends CommonObject
|
|||
if (isset($this->module_name)) {
|
||||
$this->module_name = trim($this->module_name);
|
||||
}
|
||||
if (isset($this->priority)) {
|
||||
$this->priority = trim($this->priority);
|
||||
}
|
||||
if (isset($this->lastoutput)) {
|
||||
$this->lastoutput = trim($this->lastoutput);
|
||||
}
|
||||
|
|
@ -351,7 +348,7 @@ class Cronjob extends CommonObject
|
|||
$sql .= "libname,";
|
||||
$sql .= "test";
|
||||
$sql .= ") VALUES (";
|
||||
$sql .= " ".(!isset($this->entity) ? $conf->entity : $this->db->escape($this->entity)).",";
|
||||
$sql .= " ".(!isset($this->entity) ? (int) $conf->entity : (int) $this->entity).",";
|
||||
$sql .= " '".$this->db->idate($now)."',";
|
||||
$sql .= " ".(!isset($this->jobtype) ? 'NULL' : "'".$this->db->escape($this->jobtype)."'").",";
|
||||
$sql .= " ".(!isset($this->label) ? 'NULL' : "'".$this->db->escape($this->label)."'").",";
|
||||
|
|
@ -362,7 +359,7 @@ class Cronjob extends CommonObject
|
|||
$sql .= " ".(!isset($this->params) ? 'NULL' : "'".$this->db->escape($this->params)."'").",";
|
||||
$sql .= " ".(!isset($this->md5params) ? 'NULL' : "'".$this->db->escape($this->md5params)."'").",";
|
||||
$sql .= " ".(!isset($this->module_name) ? 'NULL' : "'".$this->db->escape($this->module_name)."'").",";
|
||||
$sql .= " ".(!isset($this->priority) ? '0' : $this->priority).",";
|
||||
$sql .= " ".(is_numeric($this->priority) ? (int) $this->priority : 50).",";
|
||||
$sql .= " ".(!isset($this->datelastrun) || dol_strlen($this->datelastrun) == 0 ? 'NULL' : "'".$this->db->idate($this->datelastrun)."'").",";
|
||||
$sql .= " ".(!isset($this->datenextrun) || dol_strlen($this->datenextrun) == 0 ? 'NULL' : "'".$this->db->idate($this->datenextrun)."'").",";
|
||||
$sql .= " ".(!isset($this->dateend) || dol_strlen($this->dateend) == 0 ? 'NULL' : "'".$this->db->idate($this->dateend)."'").",";
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user