Close #15729 : fix bug with nb jobs
This commit is contained in:
parent
a5cf177025
commit
54228ad256
@ -92,14 +92,16 @@ class box_scheduled_jobs extends ModeleBoxes
|
|||||||
$nbjobsinerror = 0;
|
$nbjobsinerror = 0;
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$num = $this->db->num_rows($result);
|
$num = $this->db->num_rows($result);
|
||||||
$i = 1;
|
$i = 0;
|
||||||
$objp = $this->db->fetch_object($result);
|
|
||||||
$cronstatic->id = $objp->rowid;
|
|
||||||
$cronstatic->ref = $objp->rowid;
|
|
||||||
$cronstatic->status = $objp->status;
|
|
||||||
$cronstatic->datenextrun = $objp->datenextrun;
|
|
||||||
$cronstatic->datelastrun = $objp->datelastrun;
|
|
||||||
while ($i < $num) {
|
while ($i < $num) {
|
||||||
|
$objp = $this->db->fetch_object($result);
|
||||||
|
if ($line == 0 || $objp->datenextrun < $cronstatic->datenextrun) {
|
||||||
|
$cronstatic->id = $objp->rowid;
|
||||||
|
$cronstatic->ref = $objp->rowid;
|
||||||
|
$cronstatic->status = $objp->status;
|
||||||
|
$cronstatic->datenextrun = $objp->datenextrun;
|
||||||
|
$cronstatic->datelastrun = $objp->datelastrun;
|
||||||
|
}
|
||||||
if ($line == 0) {
|
if ($line == 0) {
|
||||||
$resultarray[$line] = array(
|
$resultarray[$line] = array(
|
||||||
$langs->trans("LastExecutedScheduledJob"),
|
$langs->trans("LastExecutedScheduledJob"),
|
||||||
@ -108,16 +110,8 @@ class box_scheduled_jobs extends ModeleBoxes
|
|||||||
$cronstatic->status
|
$cronstatic->status
|
||||||
);
|
);
|
||||||
$line++;
|
$line++;
|
||||||
} else {
|
|
||||||
$objp = $this->db->fetch_object($result);
|
|
||||||
if ($objp->datenextrun < $cronstatic->datenextrun) {
|
|
||||||
$cronstatic->id = $objp->rowid;
|
|
||||||
$cronstatic->ref = $objp->rowid;
|
|
||||||
$cronstatic->status = $objp->status;
|
|
||||||
$cronstatic->datenextrun = $objp->datenextrun;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if ($obj->lastresult < 0) {
|
if (!empty($objp->lastresult)){
|
||||||
$nbjobsinerror++;
|
$nbjobsinerror++;
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
@ -141,7 +135,7 @@ class box_scheduled_jobs extends ModeleBoxes
|
|||||||
);
|
);
|
||||||
$this->info_box_contents[$line][] = array(
|
$this->info_box_contents[$line][] = array(
|
||||||
'td' => 'class="right"',
|
'td' => 'class="right"',
|
||||||
'textnoformat' => dol_print_date($resultarray[$line][2],"dayhoursec")
|
'textnoformat' => dol_print_date($resultarray[$line][2], "dayhoursec")
|
||||||
);
|
);
|
||||||
$this->info_box_contents[$line][] = array(
|
$this->info_box_contents[$line][] = array(
|
||||||
'td' => 'class="right" ',
|
'td' => 'class="right" ',
|
||||||
@ -155,7 +149,7 @@ class box_scheduled_jobs extends ModeleBoxes
|
|||||||
);
|
);
|
||||||
$this->info_box_contents[$line][] = array(
|
$this->info_box_contents[$line][] = array(
|
||||||
'td' => 'class="right"colspan="2"',
|
'td' => 'class="right"colspan="2"',
|
||||||
'text' => $nbjobsinerror . ""
|
'text' => $nbjobsinerror
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$this->info_box_contents[0][0] = array(
|
$this->info_box_contents[0][0] = array(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user