Fix when nothing found, we should show message nothing found

This commit is contained in:
Laurent Destailleur 2021-02-06 00:42:53 +01:00
parent c15deff817
commit bee0849290
2 changed files with 16 additions and 0 deletions

View File

@ -497,6 +497,14 @@ while ($i < min($num, $limit)) {
// Show total line
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
// If no record found
if ($num == 0)
{
$colspan = 1;
foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; }
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
}
print "</table>";
print "</div>";
print "</form>";

View File

@ -1343,6 +1343,14 @@ while ($i < min($num, $limit))
$i++;
}
// If no record found
if ($num == 0)
{
$colspan = 1;
foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; }
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
}
$db->free($resql);
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);