Skip to content
Snippets Groups Projects
Commit 5ed8340d authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix no record found into lists

parent 1b96bb42
No related branches found
No related tags found
No related merge requests found
......@@ -684,7 +684,10 @@ if ($resql)
}
else
{
print '<tr '.$bc[false].'>'.'<td colspan="9" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
$colspan=1;
foreach($arrayfields as $key => $val) { if (! empty($val['checked'])) $colspan++; }
print '<tr>'.'<td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
}
// Show total line
......
......@@ -194,7 +194,7 @@ if (!empty($sall))
if (empty($user->rights->holiday->read_all)) $filter.=' AND cp.fk_user IN ('.join(',',$childids).')';
if ($type) $filter.=' AND cp.fk_type IN ('.$type.')';
if ($type > 0) $filter.=' AND cp.fk_type IN ('.$db->escape($type).')';
// Récupération de l'ID de l'utilisateur
$user_id = $user->id;
......@@ -206,17 +206,18 @@ if ($id > 0)
$fuser->getrights();
$user_id = $fuser->id;
}
// Récupération des congés payés de l'utilisateur ou de tous les users
if (empty($user->rights->holiday->read_all) || $id > 0)
{
$holiday_payes = $holiday->fetchByUser($user_id,$order,$filter); // Load array $holiday->holiday
$result = $holiday->fetchByUser($user_id,$order,$filter); // Load array $holiday->holiday
}
else
{
$holiday_payes = $holiday->fetchAll($order,$filter); // Load array $holiday->holiday
$result = $holiday->fetchAll($order,$filter); // Load array $holiday->holiday
}
// Si erreur SQL
if ($holiday_payes == '-1')
if ($result == '-1')
{
print load_fiche_titre($langs->trans('CPTitreMenu'), '', 'title_hrm.png');
......@@ -446,9 +447,9 @@ if (! empty($holiday->holiday))
}
// Si il n'y a pas d'enregistrement suite à une recherche
if($holiday_payes == '2')
if ($result == '2')
{
print '<tr '.$bc[false].'>';
print '<tr>';
print '<td colspan="10" class="opacitymedium">'.$langs->trans('NoRecordFound').'</td>';
print '</tr>';
}
......
......@@ -535,6 +535,15 @@ if (isset($totalarray['totalhtfield']))
print '</tr>';
}
// 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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment