diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 441dd0a6417..07bc820e7e1 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Eric Seigne - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2008 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -324,7 +324,7 @@ if ($showbirthday) // Sort on date $sql .= ' ORDER BY birthday'; //print $sql; - + $resql=$db->query($sql); if ($resql) { @@ -343,17 +343,17 @@ if ($showbirthday) $action->type_code='BIRTHDAY'; $action->libelle=$langs->trans("Birthday").' '.$obj->firstname.' '.$obj->name; $action->percentage=100; - + $action->date_start_in_calendar=$action->datep; $action->date_end_in_calendar=$action->datef; $action->ponctuel=0; - + // Add an entry in actionarray for each day $daycursor=$action->date_start_in_calendar; $annee = date('Y',$daycursor); $mois = date('m',$daycursor); $jour = date('d',$daycursor); - + $loop=true; $daykey=dol_mktime(0,0,0,$mois,$jour,$annee); do @@ -396,15 +396,15 @@ if ($_GET["action"] != 'show_day') { echo ''; echo ' '; - echo ' \n"; - echo ' \n"; - echo ' \n"; - echo ' \n"; - echo ' \n"; - echo ' \n"; - echo ' \n"; + echo ' \n"; + echo ' \n"; + echo ' \n"; + echo ' \n"; + echo ' \n"; + echo ' \n"; + echo ' \n"; echo " \n"; - + // In loops, tmpday contains day nb in current month (can be negative for days of previous month) for($iter_week = 0; $iter_week < 6 ; $iter_week++) { @@ -456,7 +456,13 @@ else $style='cal_current_month'; $timestamp=dol_mktime(12,0,0,$month,$_GET["day"],$year); $arraytimestamp=adodb_getdate(dol_mktime(12,0,0,$month,$_GET["day"],$year)); - $dayname=array('0'=>'Sunday','1'=>'Monday','2'=>'Tuesday','3'=>'Wednesday','4'=>'Thursday','5'=>'Friday','6'=>'Saturday'); + $dayname=array( '0'=>'Sunday', + '1'=>'Monday', + '2'=>'Tuesday', + '3'=>'Wednesday', + '4'=>'Thursday', + '5'=>'Friday', + '6'=>'Saturday'); echo '
'.$langs->trans("Monday")."'.$langs->trans("Tuesday")."'.$langs->trans("Wednesday")."'.$langs->trans("Thursday")."'.$langs->trans("Friday")."'.$langs->trans("Saturday")."'.$langs->trans("Sunday")."'.$langs->trans("Day1")."'.$langs->trans("Day2")."'.$langs->trans("Day3")."'.$langs->trans("Day4")."'.$langs->trans("Day5")."'.$langs->trans("Day6")."'.$langs->trans("Day0")."
'; echo ' '; echo ' \n"; @@ -511,7 +517,7 @@ function show_day_events($db, $day, $month, $year, $style, $actionarray, $maxPri //$curtime = dol_mktime (0, 0, 0, $month, $day, $year); $i=0; - + foreach ($actionarray as $daykey => $notused) { $annee = date('Y',$daykey); @@ -532,7 +538,7 @@ function show_day_events($db, $day, $month, $year, $style, $actionarray, $maxPri //print "x".$color; print '
'.$langs->trans($dayname[$arraytimestamp['wday']])."
'; print '
'; - if ($action->type_code != 'BIRTHDAY') + if ($action->type_code != 'BIRTHDAY') { $tmpyearstart = date('Y',$action->date_start_in_calendar); $tmpmonthstart = date('m',$action->date_start_in_calendar); @@ -582,7 +588,7 @@ function show_day_events($db, $day, $month, $year, $style, $actionarray, $maxPri else { print ''.img_picto("all","1downarrow_selected.png").' ...'; - print ' +'.(sizeof($actionarray[$daykey])-$maxPrint); + print ' +'.(sizeof($actionarray[$daykey])-$maxPrint); print ''; break; //$ok=false; // To avoid to show twice the link diff --git a/htdocs/langs/ca_ES/main.lang b/htdocs/langs/ca_ES/main.lang index 23222e40746..5fbfe17d4db 100644 --- a/htdocs/langs/ca_ES/main.lang +++ b/htdocs/langs/ca_ES/main.lang @@ -500,13 +500,13 @@ Informations = Informació Page = Pàgina Notes = Notes # Week day = = -Monday = Dillus -Tuesday = Dimarts -Wednesday = Dimecres -Thursday = Dijous -Friday = Divendres -Saturday = Dissabte -Sunday = Diumenge +Day1 = Dillus +Day2 = Dimarts +Day3 = Dimecres +Day4 = Dijous +Day5 = Divendres +Day6 = Dissabte +Day0 = Diumenge ShortMonday = Dl ShortTuesday = Dm ShortWednesday = Dx diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 4c596475498..4417e150b30 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -501,13 +501,13 @@ Informations=Informations Page=Page Notes=Notes # Week day -Monday=Monday -Tuesday=Tuesday -Wednesday=Wednesday -Thursday=Thursday -Friday=Friday -Saturday=Saturday -Sunday=Sunday +Day1=Monday +Day2=Tuesday +Day3=Wednesday +Day4=Thursday +Day5=Friday +Day6=Saturday +Day0=Sunday ShortMonday=M ShortTuesday=T ShortWednesday=W diff --git a/htdocs/langs/es_ES/main.lang b/htdocs/langs/es_ES/main.lang index 2289df20bc8..1a6ec154ce2 100644 --- a/htdocs/langs/es_ES/main.lang +++ b/htdocs/langs/es_ES/main.lang @@ -500,13 +500,13 @@ Informations = Información Page = Página Notes = Notas # Week day = -Monday = Lunes -Tuesday = Martes -Wednesday = Miercoles -Thursday = Jueves -Friday = Viernes -Saturday = Sábado -Sunday = Domingo +Day1 = Lunes +Day2 = Martes +Day3 = Miercoles +Day4 = Jueves +Day5 = Viernes +Day6 = Sábado +Day0 = Domingo ShortMonday = L ShortTuesday = Ma ShortWednesday = M diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 7c60d7f8766..aa3d2b1f022 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -500,13 +500,13 @@ Informations=Informations Page=Page Notes=Notes # Week day -Monday=Lundi -Tuesday=Mardi -Wednesday=Mercredi -Thursday=Jeudi -Friday=Vendredi -Saturday=Samedi -Sunday=Dimanche +Day1=Lundi +Day2=Mardi +Day3=Mercredi +Day4=Jeudi +Day5=Vendredi +Day6=Samedi +Day0=Dimanche ShortMonday=L ShortTuesday=M ShortWednesday=M diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 5258a8b4edb..50a083fb636 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -374,6 +374,12 @@ function dol_print_date($time,$format='',$to_gmt=false,$outputlangs='',$encodeto $format=ereg_replace('%b','__b__',$format); $format=ereg_replace('%B','__B__',$format); } + if (eregi('%a',$format)) // There is some text to translate + { + // We inhibate translation to text made by strftime functions. We will use trans instead later. + $format=ereg_replace('%a','__a__',$format); + $format=ereg_replace('%A','__A__',$format); + } // Analyse de la date (deprecated) Ex: 19700101, 19700101010000 if (eregi('^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?',$time,$reg) @@ -424,6 +430,13 @@ function dol_print_date($time,$format='',$to_gmt=false,$outputlangs='',$encodeto //print 'x'.$outputlangs->charset_output.'-'.$ret.'x'; //return $ret; } + if (eregi('__a__',$format)) + { + $w=adodb_strftime('%w',$time); + $dayweek=$outputlangs->transnoentitiesnoconv('Day'.$w); + $ret=ereg_replace('__A__',$dayweek,$ret); + $ret=ereg_replace('__a__',dol_substr($dayweek,0,3),$ret); + } return $ret; } @@ -1520,8 +1533,8 @@ function dol_print_error($db='',$error='') { require_once(DOL_DOCUMENT_ROOT ."/translate.class.php"); $langs = new Translate("", $conf); + $langs->load("main"); } - $langs->load("main"); if ($_SERVER['DOCUMENT_ROOT']) // Mode web { @@ -1534,8 +1547,8 @@ function dol_print_error($db='',$error='') print "".$langs->trans("Date").": ".dol_print_date(time(),'dayhourlog')."
\n";; if (isset($conf->global->MAIN_FEATURES_LEVEL)) print "".$langs->trans("LevelOfFeature").": ".$conf->global->MAIN_FEATURES_LEVEL."
\n";; print "".$langs->trans("Server").": ".$_SERVER["SERVER_SOFTWARE"]."
\n";; - print "".$langs->trans("RequestedUrl").": ".$_SERVER["REQUEST_URI"]."
\n";; print "".$langs->trans("Referer").": ".$_SERVER["HTTP_REFERER"]."
\n";; + print "".$langs->trans("RequestedUrl").": ".$_SERVER["REQUEST_URI"]."
\n";; print "".$langs->trans("MenuManager").": ".$conf->left_menu.'/'.$conf->top_menu."
\n"; print "
\n"; $syslog.="url=".$_SERVER["REQUEST_URI"]; diff --git a/htdocs/translate.class.php b/htdocs/translate.class.php index 0987c61b6a3..2e82210ab15 100644 --- a/htdocs/translate.class.php +++ b/htdocs/translate.class.php @@ -284,8 +284,8 @@ class Translate { // Pour les langues aux fichiers parfois incomplets, on charge la langue alternative if (! $newalt && $this->defaultlang != "fr_FR" && $this->defaultlang != "en_US") { - // This function must not contains call to syslog - dol_print_error("Translate::Load loading alternate translation file (to complete ".$this->defaultlang."/".$domain.".lang file)", LOG_DEBUG); + // This function MUST NOY contains call to syslog + //dol_syslog("Translate::Load loading alternate translation file (to complete ".$this->defaultlang."/".$domain.".lang file)", LOG_DEBUG); $this->load($domain,1); }