diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php
index adbdd83de65..6ec1e01b71f 100644
--- a/htdocs/holiday/view_log.php
+++ b/htdocs/holiday/view_log.php
@@ -42,7 +42,7 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the
$search_id = GETPOST('search_id', 'alpha');
$search_prev_solde = GETPOST('search_prev_solde', 'alpha');
$search_new_solde = GETPOST('search_new_solde', 'alpha');
-$year=GETPOST('year');
+$year = GETPOST('year');
if (empty($year))
{
$tmpdate = dol_getdate(dol_now());
@@ -104,8 +104,13 @@ if (empty($reshook))
$toselect = '';
$search_array_options = array();
}
- if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
- || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha'))
+
+ if (GETPOST('button_removefilter_x', 'alpha')
+ || GETPOST('button_removefilter.x', 'alpha')
+ || GETPOST('button_removefilter', 'alpha')
+ || GETPOST('button_search_x', 'alpha')
+ || GETPOST('button_search.x', 'alpha')
+ || GETPOST('button_search', 'alpha'))
{
$massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
}
@@ -144,10 +149,11 @@ $alltypeleaves = $object->getTypes(1, -1); // To have labels
llxHeader('', $langs->trans('CPTitreMenu').' ('.$langs->trans("Year").' '.$year.')');
+$sqlwhere = " AND date_action BETWEEN ".
+$sqlwhere.= "'".$db->idate(dol_get_first_day($year, 1, 1))."'";
+$sqlwhere.= " AND ";
+$sqlwhere.= "'".$db->idate(dol_get_last_day($year, 12, 1))."'";
-
-$sqlwhere = '';
-$sqlwhere.= " AND date_action BETWEEN '".$db->idate(dol_get_first_day($year, 1, 1))."' AND '".$db->idate(dol_get_last_day($year, 12, 1))."'";
if ($search_id != '') $sqlwhere.= natural_search('rowid', $search_id, 1);
if ($search_prev_solde != '') $sqlwhere.= natural_search('prev_solde', $search_prev_solde, 1);
if ($search_new_solde != '') $sqlwhere.= natural_search('new_solde', $search_new_solde, 1);
@@ -172,10 +178,32 @@ print '';
print '';
print '';
-$pagination = '
';
+$pagination = '';
+
print load_fiche_titre($langs->trans('LogCP'), $pagination, 'title_hrm.png');
print ''.$langs->trans('LastUpdateCP').': '."\n";
+
$lastUpdate = $object->getConfCP('lastUpdate');
if ($lastUpdate)
{
@@ -183,7 +211,11 @@ if ($lastUpdate)
$yearLastUpdate = $lastUpdate[0].$lastUpdate[1].$lastUpdate[2].$lastUpdate[3];
print ''.dol_print_date($db->jdate($object->getConfCP('lastUpdate')), 'dayhour', 'tzuser').'';
print '
'.$langs->trans("MonthOfLastMonthlyUpdate").': '.$yearLastUpdate.'-'.$monthLastUpdate.''."\n";
-} else print $langs->trans('None');
+}
+else
+{
+ print $langs->trans('None');
+}
print "
\n";
$moreforfilter = '';
@@ -231,20 +263,20 @@ print '';
foreach ($object->logs as $logs_CP)
{
- $user_action = new User($db);
- $user_action->fetch($logs_CP['fk_user_action']);
+ $user_action = new User($db);
+ $user_action->fetch($logs_CP['fk_user_action']);
- $user_update = new User($db);
- $user_update->fetch($logs_CP['fk_user_update']);
+ $user_update = new User($db);
+ $user_update->fetch($logs_CP['fk_user_update']);
- $delta = price2num($logs_CP['new_solde'] - $logs_CP['prev_solde'], 5);
- $detasign = ($delta > 0 ? '+' : '');
+ $delta = price2num($logs_CP['new_solde'] - $logs_CP['prev_solde'], 5);
+ $detasign = ($delta > 0 ? '+' : '');
- print '';
- if (!empty($arrayfields['cpl.rowid']['checked'])) print '| '.$logs_CP['rowid'].' | ';
- if (!empty($arrayfields['cpl.date_action']['checked'])) print ''.$logs_CP['date_action'].' | ';
- if (!empty($arrayfields['cpl.fk_user_action']['checked'])) print ''.$user_action->getNomUrl(-1).' | ';
- if (!empty($arrayfields['cpl.fk_user_update']['checked'])) print ''.$user_update->getNomUrl(-1).' | ';
+ print '
';
+ if (!empty($arrayfields['cpl.rowid']['checked'])) print '| '.$logs_CP['rowid'].' | ';
+ if (!empty($arrayfields['cpl.date_action']['checked'])) print ''.$logs_CP['date_action'].' | ';
+ if (!empty($arrayfields['cpl.fk_user_action']['checked'])) print ''.$user_action->getNomUrl(-1).' | ';
+ if (!empty($arrayfields['cpl.fk_user_update']['checked'])) print ''.$user_update->getNomUrl(-1).' | ';
if (!empty($arrayfields['cpl.type_action']['checked'])) print ''.$logs_CP['type_action'].' | ';
if (!empty($arrayfields['cpl.fk_type']['checked']))
{
@@ -257,8 +289,8 @@ foreach ($object->logs as $logs_CP)
if (!empty($arrayfields['cpl.prev_solde']['checked'])) print ''.price2num($logs_CP['prev_solde'], 5).' '.$langs->trans('days').' | ';
if (!empty($arrayfields['variation']['checked'])) print ''.$detasign.$delta.' | ';
if (!empty($arrayfields['cpl.new_solde']['checked'])) print ''.price2num($logs_CP['new_solde'], 5).' '.$langs->trans('days').' | ';
- print ' | ';
- print '
'."\n";
+ print ' | ';
+ print ''."\n";
}
if ($log_holiday == '2')