Fix loading of cronjob

This commit is contained in:
Laurent Destailleur 2018-11-19 10:33:42 +01:00
parent d93d1c7e1b
commit 824b1924e2

View File

@ -1352,19 +1352,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
if (! $err) {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."cronjob (module_name, datec, datestart, dateend, label, jobtype, classesname, objectname, methodename, command, params, note,";
if(is_int($frequency)) { $sql.= ' frequency,';
}
if(is_int($unitfrequency)) { $sql.= ' unitfrequency,';
}
if(is_int($priority)) { $sql.= ' priority,';
}
if(is_int($status)) { $sql.= ' status,';
}
if (is_int($frequency)) { $sql.= ' frequency,'; }
if (is_int($unitfrequency)) { $sql.= ' unitfrequency,'; }
if (is_int($priority)) { $sql.= ' priority,'; }
if (is_int($status)) { $sql.= ' status,'; }
$sql.= " entity, test)";
$sql.= " VALUES (";
$sql.= "'".$this->db->escape(empty($this->rights_class)?strtolower($this->name):$this->rights_class)."', ";
$sql.= "'".$this->db->idate($now)."', ";
$sql.= ($datestart ? "'".$this->db->idate($datestart)."'" : "NULL").", ";
$sql.= ($datestart ? "'".$this->db->idate($datestart)."'" : "'".$this->db->idate($now)."'").", ";
$sql.= ($dateend ? "'".$this->db->idate($dateend)."'" : "NULL").", ";
$sql.= "'".$this->db->escape($label)."', ";
$sql.= "'".$this->db->escape($jobtype)."', ";