Skip to content

Commit

Permalink
datenextrun is mandatory as dolibarr 16.0 (#28344)
Browse files Browse the repository at this point in the history
  • Loading branch information
rycks authored Feb 22, 2024
1 parent a76eafa commit af062aa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions htdocs/core/modules/DolibarrModules.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <[email protected]>
* Copyright (C) 2004 Sebastien Di Cintio <[email protected]>
* Copyright (C) 2004 Benoit Mortier <[email protected]>
* Copyright (C) 2004 Eric Seigne <[email protected]>
* Copyright (C) 2004-2023 Eric Seigne <[email protected]>
* Copyright (C) 2005-2013 Laurent Destailleur <[email protected]>
* Copyright (C) 2005-2012 Regis Houssin <[email protected]>
* Copyright (C) 2014 Raphaël Doursenaud <[email protected]>
Expand Down Expand Up @@ -1445,6 +1445,7 @@ public function insert_cronjobs()
$frequency = isset($this->cronjobs[$key]['frequency']) ? $this->cronjobs[$key]['frequency'] : '';
$unitfrequency = isset($this->cronjobs[$key]['unitfrequency']) ? $this->cronjobs[$key]['unitfrequency'] : '';
$priority = isset($this->cronjobs[$key]['priority']) ? $this->cronjobs[$key]['priority'] : '';
$datenextrun = isset($this->cronjobs[$key]['datenextrun']) ? $this->cronjobs[$key]['datenextrun'] : '';
$datestart = isset($this->cronjobs[$key]['datestart']) ? $this->cronjobs[$key]['datestart'] : '';
$dateend = isset($this->cronjobs[$key]['dateend']) ? $this->cronjobs[$key]['dateend'] : '';
$status = isset($this->cronjobs[$key]['status']) ? $this->cronjobs[$key]['status'] : '';
Expand Down Expand Up @@ -1480,7 +1481,7 @@ public function insert_cronjobs()
$this->db->begin();

if (!$err) {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."cronjob (module_name, datec, datestart, dateend, label, jobtype, classesname, objectname, methodename, command, params, note,";
$sql = "INSERT INTO ".MAIN_DB_PREFIX."cronjob (module_name, datec, datenextrun, datestart, dateend, label, jobtype, classesname, objectname, methodename, command, params, note,";
if (is_int($frequency)) {
$sql .= ' frequency,';
}
Expand All @@ -1497,6 +1498,7 @@ public function insert_cronjobs()
$sql .= " VALUES (";
$sql .= "'".$this->db->escape(empty($this->rights_class) ?strtolower($this->name) : $this->rights_class)."', ";
$sql .= "'".$this->db->idate($now)."', ";
$sql .= ($datenextrun ? "'".$this->db->idate($datenextrun)."'" : "'".$this->db->idate($now)."'").", ";
$sql .= ($datestart ? "'".$this->db->idate($datestart)."'" : "'".$this->db->idate($now)."'").", ";
$sql .= ($dateend ? "'".$this->db->idate($dateend)."'" : "NULL").", ";
$sql .= "'".$this->db->escape($label)."', ";
Expand Down

0 comments on commit af062aa

Please sign in to comment.