forked from Wavyzz/dolibarr
Fix: traduction du calendrier eldy
This commit is contained in:
@@ -100,6 +100,24 @@ function displayBox($selectedDate,$month,$year){
|
|||||||
<?php
|
<?php
|
||||||
$firstdate=getdate($thedate);
|
$firstdate=getdate($thedate);
|
||||||
$mydate=$firstdate;
|
$mydate=$firstdate;
|
||||||
|
$tradTemp=Array($langs->trans("January"),
|
||||||
|
$langs->trans("February"),
|
||||||
|
$langs->trans("March"),
|
||||||
|
$langs->trans("April"),
|
||||||
|
$langs->trans("May"),
|
||||||
|
$langs->trans("June"),
|
||||||
|
$langs->trans("July"),
|
||||||
|
$langs->trans("August"),
|
||||||
|
$langs->trans("September"),
|
||||||
|
$langs->trans("October"),
|
||||||
|
$langs->trans("November"),
|
||||||
|
$langs->trans("December")
|
||||||
|
);
|
||||||
|
|
||||||
|
print '<script language="Javascript">';
|
||||||
|
print 'var tradMonths = '.php2js($tradTemp);
|
||||||
|
print '</script>';
|
||||||
|
|
||||||
while($firstdate["month"]==$mydate["month"])
|
while($firstdate["month"]==$mydate["month"])
|
||||||
{
|
{
|
||||||
if($mydate["wday"]==0) echo "<TR class=\"dpWeek\">";
|
if($mydate["wday"]==0) echo "<TR class=\"dpWeek\">";
|
||||||
@@ -116,7 +134,7 @@ function displayBox($selectedDate,$month,$year){
|
|||||||
|
|
||||||
// Sur click dans calendrier, appelle fonction dpClickDay
|
// Sur click dans calendrier, appelle fonction dpClickDay
|
||||||
echo "<TD class=\"".$dayclass."\"";
|
echo "<TD class=\"".$dayclass."\"";
|
||||||
echo " onMouseOver=\"dpHighlightDay(".$mydate["year"].",".date("n",$thedate).",".$mydate["mday"].")\"";
|
echo " onMouseOver=\"dpHighlightDay(".$mydate["year"].",".date("n",$thedate).",".$mydate["mday"].",tradMonths)\"";
|
||||||
echo " onClick=\"dpClickDay(".$mydate["year"].",".date("n",$thedate).",".$mydate["mday"].",'".$conf->format_date_short_java."')\"";
|
echo " onClick=\"dpClickDay(".$mydate["year"].",".date("n",$thedate).",".$mydate["mday"].",'".$conf->format_date_short_java."')\"";
|
||||||
echo ">".sprintf("%02s",$mydate["mday"])."</TD>";
|
echo ">".sprintf("%02s",$mydate["mday"])."</TD>";
|
||||||
|
|
||||||
|
|||||||
@@ -2739,5 +2739,42 @@ function make_substitutions($chaine,$substitutionarray)
|
|||||||
}
|
}
|
||||||
return $chaine;
|
return $chaine;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* \brief Convertit une variable php en variable javascript
|
||||||
|
* \param var variable php
|
||||||
|
* \return result variable javascript
|
||||||
|
*/
|
||||||
|
function php2js($var)
|
||||||
|
{
|
||||||
|
if (is_array($var))
|
||||||
|
{
|
||||||
|
$array = array();
|
||||||
|
foreach ($var as $a_var)
|
||||||
|
{
|
||||||
|
$array[] = php2js($a_var);
|
||||||
|
}
|
||||||
|
$result = "[" . join(",", $array) . "]";
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
else if (is_bool($var))
|
||||||
|
{
|
||||||
|
$result = $var ? "true" : "false";
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
else if (is_int($var) || is_integer($var) || is_double($var) || is_float($var))
|
||||||
|
{
|
||||||
|
$result = $var;
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
else if (is_string($var))
|
||||||
|
{
|
||||||
|
$result = "\"" . addslashes(stripslashes($var)) . "\"";
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
// autres cas: objets, on ne les g<>re pas
|
||||||
|
$result = FALSE;
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -204,21 +204,9 @@ function dpClickDay(year,month,day,format)
|
|||||||
closeDPBox();
|
closeDPBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
function dpHighlightDay(year,month,day){
|
function dpHighlightDay(year,month,day,tradMonths){
|
||||||
var displayinfo=getObjectFromID("dpExp");
|
var displayinfo=getObjectFromID("dpExp");
|
||||||
var months=Array("January",
|
var months = tradMonths;
|
||||||
"February",
|
|
||||||
"March",
|
|
||||||
"April",
|
|
||||||
"May",
|
|
||||||
"June",
|
|
||||||
"July",
|
|
||||||
"August",
|
|
||||||
"September",
|
|
||||||
"October",
|
|
||||||
"November",
|
|
||||||
"December"
|
|
||||||
);
|
|
||||||
displayinfo.innerHTML=months[month-1]+" "+day+", "+year;
|
displayinfo.innerHTML=months[month-1]+" "+day+", "+year;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user