Fix: Log of leaves was broken on some mysql versions.
This commit is contained in:
parent
273b9029b8
commit
168f71ac18
@ -886,7 +886,7 @@ class Holiday extends CommonObject
|
|||||||
$month = date('m',$now);
|
$month = date('m',$now);
|
||||||
$lastUpdate = $this->getConfCP('lastUpdate');
|
$lastUpdate = $this->getConfCP('lastUpdate');
|
||||||
$monthLastUpdate = $lastUpdate[4].$lastUpdate[5];
|
$monthLastUpdate = $lastUpdate[4].$lastUpdate[5];
|
||||||
//print 'month: '.$month.' '.$lastUpdate.' '.$monthLastUpdate;
|
//print 'month: '.$month.' '.$lastUpdate.' '.$monthLastUpdate;exit;
|
||||||
|
|
||||||
// Si la date du mois n'est pas la même que celle sauvegardée, on met à jour le timestamp
|
// Si la date du mois n'est pas la même que celle sauvegardée, on met à jour le timestamp
|
||||||
if ($month != $monthLastUpdate)
|
if ($month != $monthLastUpdate)
|
||||||
@ -1618,7 +1618,7 @@ class Holiday extends CommonObject
|
|||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
print $sql;exit;
|
||||||
dol_syslog(get_class($this)."::addLogCP sql=".$sql, LOG_DEBUG);
|
dol_syslog(get_class($this)."::addLogCP sql=".$sql, LOG_DEBUG);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if (! $resql) {
|
if (! $resql) {
|
||||||
@ -1674,12 +1674,12 @@ class Holiday extends CommonObject
|
|||||||
|
|
||||||
// Filtrage de séléction
|
// Filtrage de séléction
|
||||||
if(!empty($filter)) {
|
if(!empty($filter)) {
|
||||||
$sql.= $filter;
|
$sql.= " ".$filter;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ordre d'affichage
|
// Ordre d'affichage
|
||||||
if(!empty($order)) {
|
if(!empty($order)) {
|
||||||
$sql.= $order;
|
$sql.= " ".$order;
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::fetchLog sql=".$sql, LOG_DEBUG);
|
dol_syslog(get_class($this)."::fetchLog sql=".$sql, LOG_DEBUG);
|
||||||
|
|||||||
@ -71,7 +71,7 @@ if ($action == 'update' && isset($_POST['update_cp']))
|
|||||||
$comment = ((isset($_POST['note_holiday'][$userID]) && !empty($_POST['note_holiday'][$userID])) ? ' ('.$_POST['note_holiday'][$userID].')' : '');
|
$comment = ((isset($_POST['note_holiday'][$userID]) && !empty($_POST['note_holiday'][$userID])) ? ' ('.$_POST['note_holiday'][$userID].')' : '');
|
||||||
|
|
||||||
// We add the modification to the log
|
// We add the modification to the log
|
||||||
$holiday->addLogCP($user->id,$userID, $langs->trans('ManualUpdate').$comment,$userValue);
|
$holiday->addLogCP($user->id,$userID, $langs->transnoentitiesnoconv('ManualUpdate').$comment,$userValue);
|
||||||
|
|
||||||
// Update of the days of the employee
|
// Update of the days of the employee
|
||||||
$holiday->updateSoldeCP($userID,$userValue);
|
$holiday->updateSoldeCP($userID,$userValue);
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2007-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
|
* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -37,7 +37,7 @@ if(!$user->rights->holiday->view_log) accessforbidden();
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$langs->load('users');
|
$langs->load('users');
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ llxHeader(array(),$langs->trans('CPTitreMenu'));
|
|||||||
|
|
||||||
|
|
||||||
$cp = new Holiday($db);
|
$cp = new Holiday($db);
|
||||||
//Recent changes are more important than old changes
|
// Recent changes are more important than old changes
|
||||||
$log_holiday = $cp->fetchLog('ORDER BY cpl.rowid DESC','');
|
$log_holiday = $cp->fetchLog('ORDER BY cpl.rowid DESC','');
|
||||||
|
|
||||||
print_fiche_titre($langs->trans('LogCP'));
|
print_fiche_titre($langs->trans('LogCP'));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user