Debug v13
This commit is contained in:
parent
0968c68cf9
commit
a3d302d91c
@ -151,7 +151,7 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes
|
||||
|
||||
if ($num == 0 || $nboutstandingbillreachedcustomers == 0) $this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center"',
|
||||
'text'=> '<span class="opacitymedium">'.$langs->trans("NoRecordedCustomers").'</span>'
|
||||
'text'=> '<span class="opacitymedium">'.$langs->trans("None").'</span>'
|
||||
);
|
||||
|
||||
$this->db->free($result);
|
||||
|
||||
@ -72,7 +72,7 @@ class box_scheduled_jobs extends ModeleBoxes
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs, $conf;
|
||||
$this->max = $max;
|
||||
|
||||
$langs->load("cron");
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxScheduledJobs", $max));
|
||||
|
||||
@ -83,9 +83,10 @@ class box_scheduled_jobs extends ModeleBoxes
|
||||
|
||||
$result = 0;
|
||||
$sql = "SELECT t.rowid, t.datelastrun, t.datenextrun,";
|
||||
$sql .= " t.label, t.status, t.lastresult";
|
||||
$sql .= " t.label, t.status, t.test, t.lastresult";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "cronjob as t";
|
||||
$sql .= " WHERE status <> ".$cronstatic::STATUS_DISABLED;
|
||||
$sql .= " AND entity IN (0, ".$conf->entity.")";
|
||||
$sql .= $this->db->order("t.datelastrun", "DESC");
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
@ -93,41 +94,53 @@ class box_scheduled_jobs extends ModeleBoxes
|
||||
$nbjobsinerror = 0;
|
||||
if ($result) {
|
||||
$num = $this->db->num_rows($result);
|
||||
|
||||
$i = 0;
|
||||
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->label = $langs->trans($objp->label);
|
||||
$cronstatic->status = $objp->status;
|
||||
$cronstatic->datenextrun = $objp->datenextrun;
|
||||
$cronstatic->datelastrun = $objp->datelastrun;
|
||||
}
|
||||
if ($line == 0) {
|
||||
$resultarray[$line] = array(
|
||||
$langs->trans("LastExecutedScheduledJob"),
|
||||
$cronstatic->getNomUrl(1),
|
||||
$this->db->jdate($cronstatic->datelastrun),
|
||||
$cronstatic->status,
|
||||
$cronstatic->getLibStatut(2)
|
||||
);
|
||||
$line++;
|
||||
}
|
||||
if (!empty($objp->lastresult)) {
|
||||
$nbjobsinerror++;
|
||||
|
||||
if (dol_eval($objp->test, 1, 1)) {
|
||||
|
||||
$nextrun = $this->db->jdate($objp->datenextrun);
|
||||
if (empty($nextrun)) $nextrun = $this->db->jdate($objp->datestart);
|
||||
|
||||
if ($line == 0 || ($nextrun < $cronstatic->datenextrun && (empty($objp->nbrun) || empty($objp->maxrun) || $objp->nbrun < $obj->maxrun))) {
|
||||
$cronstatic->id = $objp->rowid;
|
||||
$cronstatic->ref = $objp->rowid;
|
||||
$cronstatic->label = $langs->trans($objp->label);
|
||||
$cronstatic->status = $objp->status;
|
||||
$cronstatic->datenextrun = $this->db->jdate($objp->datenextrun);
|
||||
$cronstatic->datelastrun = $this->db->jdate($objp->datelastrun);
|
||||
}
|
||||
if ($line == 0) {
|
||||
$resultarray[$line] = array(
|
||||
$langs->trans("LastExecutedScheduledJob"),
|
||||
$cronstatic->getNomUrl(1),
|
||||
$cronstatic->datelastrun,
|
||||
$cronstatic->status,
|
||||
$cronstatic->getLibStatut(2)
|
||||
);
|
||||
$line++;
|
||||
}
|
||||
|
||||
if (!empty($objp->lastresult)) {
|
||||
$nbjobsinerror++;
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$resultarray[$line] = array(
|
||||
$langs->trans("NextScheduledJobExecute"),
|
||||
$cronstatic->getNomUrl(1),
|
||||
$this->db->jdate($cronstatic->datenextrun),
|
||||
$cronstatic->status,
|
||||
$cronstatic->getLibStatut(2)
|
||||
);
|
||||
$line = 0;
|
||||
while ($line < 2) {
|
||||
|
||||
if ($line) {
|
||||
$resultarray[$line] = array(
|
||||
$langs->trans("NextScheduledJobExecute"),
|
||||
$cronstatic->getNomUrl(1),
|
||||
$cronstatic->datenextrun,
|
||||
$cronstatic->status,
|
||||
$cronstatic->getLibStatut(2)
|
||||
);
|
||||
}
|
||||
|
||||
foreach($resultarray as $line => $value) {
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="left"',
|
||||
'text' => $resultarray[$line][0]
|
||||
@ -153,13 +166,13 @@ class box_scheduled_jobs extends ModeleBoxes
|
||||
);
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="right"colspan="2"',
|
||||
'text' => $nbjobsinerror
|
||||
'textnoformat' => $nbjobsinerror ? '<span class="error"><a href="'.DOL_URL_ROOT.'/cron/list.php?search_lastresult='.urlencode('<>0').'">'.$nbjobsinerror.'</a></span>'.img_error() : '0'
|
||||
);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength' => 500,
|
||||
'text' => ($this->db->error() . ' sql=' . $sql)
|
||||
'text' => ($this->db->lasterror() . ' sql=' . $sql)
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -60,7 +60,7 @@ $mode = GETPOST('mode', 'aZ09');
|
||||
$search_status = (GETPOSTISSET('search_status') ?GETPOST('search_status', 'int') : GETPOST('status', 'int'));
|
||||
$search_label = GETPOST("search_label", 'alpha');
|
||||
$search_module_name = GETPOST("search_module_name", 'alpha');
|
||||
|
||||
$search_lastresult = GETPOST("search_lastresult", "alpha");
|
||||
$securitykey = GETPOST('securitykey', 'alpha');
|
||||
|
||||
$diroutputmassaction = $conf->cronjob->dir_output.'/temp/massgeneration/'.$user->id;
|
||||
@ -99,6 +99,7 @@ if (empty($reshook))
|
||||
{
|
||||
$search_label = '';
|
||||
$search_status = -1;
|
||||
$search_lastresult = '';
|
||||
$toselect = '';
|
||||
$search_array_options = array();
|
||||
}
|
||||
@ -248,6 +249,7 @@ $sql .= " t.test";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."cronjob as t";
|
||||
$sql .= " WHERE entity IN (0,".$conf->entity.")";
|
||||
if ($search_status >= 0 && $search_status < 2 && $search_status != '') $sql .= " AND t.status = ".(empty($search_status) ? '0' : '1');
|
||||
if ($search_lastresult != '') $sql .= natural_search("t.lastresult", $search_lastresult, 1);
|
||||
//Manage filter
|
||||
if (is_array($filter) && count($filter) > 0) {
|
||||
foreach ($filter as $key => $value) {
|
||||
@ -298,6 +300,7 @@ if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($l
|
||||
if ($search_status) $param .= '&search_status='.urlencode($search_status);
|
||||
if ($search_label) $param .= '&search_label='.urlencode($search_label);
|
||||
if ($search_module_name) $param .= '&search_module_name='.urlencode($search_module_name);
|
||||
if ($search_lastresult) $param .= '&search_lastresult='.urlencode($search_lastresult);
|
||||
if ($mode) $param .= '&mode='.urlencode($mode);
|
||||
if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
|
||||
// Add $param from extra fields
|
||||
@ -384,7 +387,7 @@ print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre center"><input type="text" class="width50" name="search_lastresult" value="'.$search_lastresult.'"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
@ -589,7 +592,7 @@ if ($num > 0)
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
print '<tr><td colspan="9" class="opacitymedium">'.$langs->trans('CronNoJobs').'</td></tr>';
|
||||
print '<tr><td colspan="15" class="opacitymedium">'.$langs->trans('CronNoJobs').'</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -1882,7 +1882,7 @@ span.widthpictotitle.pictotitle {
|
||||
vertical-align: middle;
|
||||
margin-top: -3px
|
||||
}
|
||||
.pictowarning, .pictopreview {
|
||||
.pictowarning, .pictoerror, .pictopreview {
|
||||
padding-<?php echo $left; ?>: 3px;
|
||||
}
|
||||
.pictowarning {
|
||||
|
||||
@ -1816,7 +1816,7 @@ div.nopadding {
|
||||
vertical-align: middle;
|
||||
margin-top: -3px
|
||||
}
|
||||
.pictowarning, .pictopreview {
|
||||
.pictowarning, .pictoerror, .pictopreview {
|
||||
padding-<?php echo $left; ?>: 3px;
|
||||
}
|
||||
.pictowarning {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user