From 273b9029b8b48acdce0cec15ed502bd56a43af8e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Aug 2014 01:45:31 +0200 Subject: [PATCH 1/2] Fix: mb_strtolower function does not exists on all PHP versions. Conflicts: htdocs/core/lib/pdf.lib.php --- htdocs/core/lib/pdf.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 1f9bcc20cd7..40248cd6596 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -835,7 +835,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass } // Show page nb only on iso languages (so default Helvetica font) - if (pdf_getPDFFont($outputlangs) == 'Helvetica') + if (strtolower(pdf_getPDFFont($outputlangs)) == 'helvetica') { $pdf->SetXY(-20,-$posy); //print 'xxx'.$pdf->PageNo().'-'.$pdf->getAliasNbPages().'-'.$pdf->getAliasNumPage();exit; From 168f71ac18466a75d871c0a0e81043c3ae8a0ca3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Aug 2014 17:45:41 +0200 Subject: [PATCH 2/2] Fix: Log of leaves was broken on some mysql versions. --- htdocs/holiday/class/holiday.class.php | 8 ++++---- htdocs/holiday/define_holiday.php | 2 +- htdocs/holiday/view_log.php | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 024ab5c30a9..05fef5dd47a 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -886,7 +886,7 @@ class Holiday extends CommonObject $month = date('m',$now); $lastUpdate = $this->getConfCP('lastUpdate'); $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 if ($month != $monthLastUpdate) @@ -1618,7 +1618,7 @@ class Holiday extends CommonObject $sql.= ")"; $this->db->begin(); - +print $sql;exit; dol_syslog(get_class($this)."::addLogCP sql=".$sql, LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { @@ -1674,12 +1674,12 @@ class Holiday extends CommonObject // Filtrage de séléction if(!empty($filter)) { - $sql.= $filter; + $sql.= " ".$filter; } // Ordre d'affichage if(!empty($order)) { - $sql.= $order; + $sql.= " ".$order; } dol_syslog(get_class($this)."::fetchLog sql=".$sql, LOG_DEBUG); diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index f167422f503..1bf8a2716cc 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -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].')' : ''); // 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 $holiday->updateSoldeCP($userID,$userValue); diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index bdd855c7bad..e0a66e76dc3 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2007-2014 Laurent Destailleur * Copyright (C) 2011 Dimitri Mouillard * * This program is free software; you can redistribute it and/or modify @@ -37,7 +37,7 @@ if(!$user->rights->holiday->view_log) accessforbidden(); /* * View -*/ + */ $langs->load('users'); @@ -45,7 +45,7 @@ llxHeader(array(),$langs->trans('CPTitreMenu')); $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',''); print_fiche_titre($langs->trans('LogCP'));