Fix: Renvoi chaine qd un chaine est attendue et tableau qd tableau attendu
This commit is contained in:
parent
c1a2342e3a
commit
61baa919ed
@ -3809,37 +3809,43 @@ function dol_genbarcode($code,$encoding,$generator=1,$readable='Y')
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Retourne un tableau des mois ou le mois sélectionné
|
\brief Retourne un tableau des mois ou le mois sélectionné
|
||||||
\param Mois sélectionné
|
\param selected Mois à sélectionner ou -1
|
||||||
\return month
|
\return string or array Month string or array if selected < 0
|
||||||
*/
|
*/
|
||||||
function monthArrayOrSelected($selected=0)
|
function monthArrayOrSelected($selected=0)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$month = array (1 => $langs->trans("January"),
|
$month = array (1 => $langs->trans("January"),
|
||||||
2 => $langs->trans("February"),
|
2 => $langs->trans("February"),
|
||||||
3 => $langs->trans("March"),
|
3 => $langs->trans("March"),
|
||||||
4 => $langs->trans("April"),
|
4 => $langs->trans("April"),
|
||||||
5 => $langs->trans("May"),
|
5 => $langs->trans("May"),
|
||||||
6 => $langs->trans("June"),
|
6 => $langs->trans("June"),
|
||||||
7 => $langs->trans("July"),
|
7 => $langs->trans("July"),
|
||||||
8 => $langs->trans("August"),
|
8 => $langs->trans("August"),
|
||||||
9 => $langs->trans("September"),
|
9 => $langs->trans("September"),
|
||||||
10 => $langs->trans("October"),
|
10 => $langs->trans("October"),
|
||||||
11 => $langs->trans("November"),
|
11 => $langs->trans("November"),
|
||||||
12 => $langs->trans("December")
|
12 => $langs->trans("December")
|
||||||
);
|
);
|
||||||
if ($selected)
|
|
||||||
{
|
if ($selected >=0)
|
||||||
foreach ($month as $key => $val)
|
{
|
||||||
{
|
$return='';
|
||||||
if ($selected == $key)
|
foreach ($month as $key => $val)
|
||||||
{
|
{
|
||||||
$month = $val;
|
if ($selected == $key)
|
||||||
}
|
{
|
||||||
}
|
$return = $val;
|
||||||
}
|
}
|
||||||
return $month;
|
}
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return $month;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user