mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix: Bad value of selected year
This commit is contained in:
parent
5c25d43473
commit
cd51211292
|
|
@ -3098,7 +3098,7 @@ class Form
|
|||
|
||||
/**
|
||||
* \brief Return HTML combo list of years
|
||||
* \param selected Preselected value
|
||||
* \param selected Preselected value (''=current year, -1=none, year otherwise)
|
||||
* \param htmlname Name of HTML select object
|
||||
* \param useempty Affiche valeur vide dans liste
|
||||
* \param $min_year Valeur minimum de l'annee dans la liste (par defaut annee courante -10)
|
||||
|
|
@ -3115,19 +3115,14 @@ class Form
|
|||
print '<select class="flat" name="' . $htmlname . '">';
|
||||
if($useempty)
|
||||
{
|
||||
if($selected == '')
|
||||
$selected_html = 'selected="selected"';
|
||||
print '<option value="" ' . $selected_html . ' > </option>';
|
||||
if ($selected == '') $selected_html = ' selected="selected"';
|
||||
print '<option value=""' . $selected_html . '> </option>';
|
||||
}
|
||||
for ($y = $max_year; $y >= $min_year; $y--)
|
||||
{
|
||||
$selected_html='';
|
||||
if ($y == $selected)
|
||||
{
|
||||
$selected_html = 'selected="selected"';
|
||||
}
|
||||
print "<option value=\"$y\" $selected_html >$y";
|
||||
print "</option>";
|
||||
if ($selected > 0 && $y == $selected) $selected_html = ' selected="selected"';
|
||||
print '<option value="'.$y.'"'.$selected_html.' >'.$y.'</option>';
|
||||
}
|
||||
print "</select>\n";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -204,10 +204,9 @@ if ($resql)
|
|||
print '<td class="liste_titre" colspan="1" align="center">';
|
||||
print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
|
||||
//print ' '.$langs->trans('Year').': ';
|
||||
$max_year = date("Y");
|
||||
$syear = $year;
|
||||
//if ($syear == '') $syear = date("Y");
|
||||
$html->select_year($syear,'year',1, '', $max_year);
|
||||
$html->select_year($syear?$syear:-1,'year',1, 10, 10);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user