Fix: Bad selection of hour

This commit is contained in:
Laurent Destailleur 2008-03-20 21:54:56 +00:00
parent 10d051e2a2
commit 147d256a0f
2 changed files with 9 additions and 9 deletions

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -767,7 +767,7 @@ elseif ($_GET["id"] > 0)
$html->select_date($objp->date_intervention,'di',0,0,0,"date_intervention"); $html->select_date($objp->date_intervention,'di',0,0,0,"date_intervention");
print '</td>'; print '</td>';
// Dur<EFBFBD>e // Duration
print '<td>'; print '<td>';
$html->select_duree('duration',$objp->duree); $html->select_duree('duration',$objp->duree);
print '</td>'; print '</td>';

View File

@ -2683,12 +2683,12 @@ class Form
$hourSelected = ConvertSecondToTime($iSecond,'hour'); $hourSelected = ConvertSecondToTime($iSecond,'hour');
$minSelected = ConvertSecondToTime($iSecond,'min'); $minSelected = ConvertSecondToTime($iSecond,'min');
} }
print '<select class="flat" name="'.$prefix.'hour">'; print '<select class="flat" name="'.$prefix.'hour">';
print "<option value=\"0\">0</option>"; for ($hour = 0; $hour < 24; $hour++)
for ($hour = 1 ; $hour < 24 ; $hour++)
{ {
print '<option value="'.$hour.'"'; print '<option value="'.$hour.'"';
if ((!$hourSelected && $hour == 1) || ($hourSelected == $hour)) if ($hourSelected == $hour || ($iSecond == '' && $hour == 1))
{ {
print " selected=\"true\""; print " selected=\"true\"";
} }
@ -2697,7 +2697,7 @@ class Form
print "</select>"; print "</select>";
print "H &nbsp;"; print "H &nbsp;";
print '<select class="flat" name="'.$prefix.'min">'; print '<select class="flat" name="'.$prefix.'min">';
for ($min = 0 ; $min <= 55 ; $min=$min+5) for ($min = 0; $min <= 55; $min=$min+5)
{ {
print '<option value="'.$min.'"'; print '<option value="'.$min.'"';
if ($minSelected == $min) print ' selected="true"'; if ($minSelected == $min) print ' selected="true"';