浏览代码

Fix loading of cronjob

Laurent Destailleur 6 年之前
父节点
当前提交
824b1924e2
共有 1 个文件被更改,包括 5 次插入9 次删除
  1. 5 9
      htdocs/core/modules/DolibarrModules.class.php

+ 5 - 9
htdocs/core/modules/DolibarrModules.class.php

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