Debug v16 (module_name missing in list, pb in searching duplicate cron)
This commit is contained in:
parent
cd2df7caef
commit
ef57cde3da
@ -1452,8 +1452,9 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
|
||||
// Search if cron entry already present
|
||||
$sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."cronjob";
|
||||
$sql .= " WHERE module_name = '".$this->db->escape(empty($this->rights_class) ?strtolower($this->name) : $this->rights_class)."'";
|
||||
if ($class) {
|
||||
//$sql .= " WHERE module_name = '".$this->db->escape(empty($this->rights_class) ?strtolower($this->name) : $this->rights_class)."'";
|
||||
$sql .= " WHERE label = '".$this->db->escape($label)."'";
|
||||
/*if ($class) {
|
||||
$sql .= " AND classesname = '".$this->db->escape($class)."'";
|
||||
}
|
||||
if ($objectname) {
|
||||
@ -1467,7 +1468,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
}
|
||||
if ($parameters) {
|
||||
$sql .= " AND params = '".$this->db->escape($parameters)."'";
|
||||
}
|
||||
}*/
|
||||
$sql .= " AND entity = ".((int) $entity); // Must be exact entity
|
||||
|
||||
$now = dol_now();
|
||||
@ -1516,7 +1517,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
$sql .= "'".$this->db->escape($priority)."', ";
|
||||
}
|
||||
if (is_int($status)) {
|
||||
$sql .= "'".$this->db->escape($status)."', ";
|
||||
$sql .= ((int) $status).", ";
|
||||
}
|
||||
$sql .= $entity.",";
|
||||
$sql .= "'".$this->db->escape($test)."'";
|
||||
|
||||
@ -283,12 +283,8 @@ if (is_array($filter) && count($filter) > 0) {
|
||||
$sql .= " AND ".$key." LIKE '%".$db->escape($value)."%'";
|
||||
}
|
||||
}
|
||||
$sqlwhere = array();
|
||||
if (!empty($search_module_name)) {
|
||||
$sqlwhere[] = "(t.module_name = '".$db->escape($search_module_name)."')";
|
||||
}
|
||||
if (count($sqlwhere) > 0) {
|
||||
$sql .= " WHERE ".implode(' AND ', $sqlwhere);
|
||||
$sql .= natural_search("t.module_name", $search_module_name);
|
||||
}
|
||||
// Add where from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||
@ -435,6 +431,7 @@ print '<td class="liste_titre">';
|
||||
print '<input type="text" class="flat" name="search_label" value="'.$search_label.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"><input type="text" class="width50" name="search_module_name" value="'.$search_module_name.'"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
//print '<td class="liste_titre"> </td>';
|
||||
@ -457,6 +454,7 @@ print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "t.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("CronLabel", $_SERVER["PHP_SELF"], "t.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Prority", $_SERVER["PHP_SELF"], "t.priority", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("CronModule", $_SERVER["PHP_SELF"], "t.module_name", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("CronType", '', '', "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("CronFrequency", '', "", "", $param, '', $sortfield, $sortorder);
|
||||
//print_liste_field_titre("CronDtStart", $_SERVER["PHP_SELF"], "t.datestart", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
@ -500,6 +498,7 @@ if ($num > 0) {
|
||||
$object->lastresult = $obj->lastresult;
|
||||
$object->datestart = $db->jdate($obj->datestart);
|
||||
$object->dateend = $db->jdate($obj->dateend);
|
||||
$object->module_name = $obj->module_name;
|
||||
|
||||
$datelastrun = $db->jdate($obj->datelastrun);
|
||||
$datelastresult = $db->jdate($obj->datelastresult);
|
||||
@ -524,9 +523,15 @@ if ($num > 0) {
|
||||
|
||||
// Priority
|
||||
print '<td class="right">';
|
||||
print $object->priority;
|
||||
print dol_escape_htmltag($object->priority);
|
||||
print '</td>';
|
||||
|
||||
// Module
|
||||
print '<td>';
|
||||
print dol_escape_htmltag($object->module_name);
|
||||
print '</td>';
|
||||
|
||||
// Class/Method
|
||||
print '<td class="nowraponall">';
|
||||
if ($obj->jobtype == 'method') {
|
||||
$text = $langs->trans("CronClass");
|
||||
@ -576,12 +581,12 @@ if ($num > 0) {
|
||||
|
||||
print '<td class="right">';
|
||||
if (!empty($obj->nbrun)) {
|
||||
print $obj->nbrun;
|
||||
print dol_escape_htmltag($obj->nbrun);
|
||||
} else {
|
||||
print '0';
|
||||
}
|
||||
if (!empty($obj->maxrun)) {
|
||||
print ' <span class="'.$langs->trans("Max").'">/ '.$obj->maxrun.'</span>';
|
||||
print ' <span class="'.$langs->trans("Max").'">/ '.dol_escape_htmltag($obj->maxrun).'</span>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
@ -606,9 +611,9 @@ if ($num > 0) {
|
||||
print '<td class="center tdlastresultcode" title="'.dol_escape_htmltag($obj->lastresult).'">';
|
||||
if ($obj->lastresult != '') {
|
||||
if (empty($obj->lastresult)) {
|
||||
print $obj->lastresult;
|
||||
print $obj->lastresult; // Print '0'
|
||||
} else {
|
||||
print '<span class="error">'.dol_trunc($obj->lastresult).'</div>';
|
||||
print '<span class="error">'.dol_escape_htmltag(dol_trunc($obj->lastresult)).'</div>';
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user