* Copyright (C) 2011 Dimitri Mouillard * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * Displays the log of actions performed in the module. * * \file htdocs/holiday/view_log.php * \ingroup holiday */ require('../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; // Protection if external user if ($user->societe_id > 0) accessforbidden(); // Si l'utilisateur n'a pas le droit de lire cette page if(!$user->rights->holiday->read_all) accessforbidden(); $year=GETPOST('year'); if (empty($year)) { $tmpdate=dol_getdate(dol_now()); $year=$tmpdate['year']; } $langs->load('users'); /* * View */ $cp = new Holiday($db); llxHeader(array(),$langs->trans('CPTitreMenu').' ('.$langs->trans("Year").' '.$year.')'); // Recent changes are more important than old changes $log_holiday = $cp->fetchLog('ORDER BY cpl.rowid DESC', " AND date_action BETWEEN '".$db->idate(dol_get_first_day($year,1,1))."' AND '".$db->idate(dol_get_last_day($year,12,1))."'"); // Load $cp->logs print load_fiche_titre($langs->trans('LogCP'), '', 'title_hrm.png'); print '
'.$langs->trans('LastUpdateCP').': '."\n"; if ($cp->getConfCP('lastUpdate')) print ''.dol_print_date($db->jdate($cp->getConfCP('lastUpdate')),'dayhour','tzuser').''; else print $langs->trans('None'); print "

\n"; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; $var=true; foreach($cp->logs as $logs_CP) { $var=!$var; $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']); print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''."\n"; } if($log_holiday == '2') { print ''; print ''; print ''; } print ''."\n"; print '
'.$langs->trans('ID').''.$langs->trans('Date').''.$langs->trans('ActionByCP').''.$langs->trans('UserUpdateCP').''.$langs->trans('Description').''.$langs->trans('Type').''.$langs->trans('PrevSoldeCP').''.$langs->trans('NewSoldeCP').'
'.$logs_CP['rowid'].''.$logs_CP['date_action'].''.$user_action->getNomUrl(1).''.$user_update->getNomUrl(1).''.$logs_CP['type_action'].''.$logs_CP['fk_type'].''.price2num($logs_CP['prev_solde'],5).' '.$langs->trans('days').''.price2num($logs_CP['new_solde'],5).' '.$langs->trans('days').'
'.$langs->trans('NoResults').'
'."\n"; llxFooter(); $db->close();