Rename function with a more english name.
Remove duplicated "default" preselected parameter.
This commit is contained in:
parent
2642d924d3
commit
edf8434655
@ -780,7 +780,7 @@ elseif ($fichinterid)
|
||||
|
||||
// Duration
|
||||
print '<td align="right">';
|
||||
$html->select_duree('duration',$objp->duree);
|
||||
$html->select_duration('duration',$objp->duree);
|
||||
print '</td>';
|
||||
|
||||
print '<td align="center" colspan="5" valign="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
@ -844,7 +844,7 @@ elseif ($fichinterid)
|
||||
|
||||
// Duration
|
||||
print '<td align="right">';
|
||||
$html->select_duree('duration');
|
||||
$html->select_duration('duration',3600);
|
||||
print '</td>';
|
||||
|
||||
print '<td align="center" valign="middle" colspan="4"><input type="submit" class="button" value="'.$langs->trans('Add').'" name="addligne"></td>';
|
||||
|
||||
@ -2548,11 +2548,12 @@ class Form
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Fonction servant a afficher une duree dans une liste deroulante
|
||||
* \brief Function to show a form to select a duration on a page
|
||||
* \param prefix prefix
|
||||
* \param iSecond Nombre de secondes
|
||||
* \param iSecond Default preselected duration (number of seconds)
|
||||
* \param disabled Disable the combo box
|
||||
*/
|
||||
function select_duree($prefix,$iSecond='',$default=1,$disabled=0)
|
||||
function select_duration($prefix,$iSecond='',$disabled=0)
|
||||
{
|
||||
if ($iSecond)
|
||||
{
|
||||
@ -2566,7 +2567,7 @@ class Form
|
||||
for ($hour = 0; $hour < 24; $hour++)
|
||||
{
|
||||
print '<option value="'.$hour.'"';
|
||||
if ($hourSelected == $hour || ($iSecond == '' && $hour == $default))
|
||||
if ($hourSelected == $hour)
|
||||
{
|
||||
print " selected=\"true\"";
|
||||
}
|
||||
|
||||
@ -280,7 +280,7 @@ function PLinesb(&$inc, $parent, $lines, &$level, &$projectsrole)
|
||||
print '<td nowrap="nowrap">';
|
||||
print $form->select_date('',$lines[$i]->id,'','','',"addtime");
|
||||
print ' ';
|
||||
print $form->select_duree($lines[$i]->id,'',0,$disabled);
|
||||
print $form->select_duration($lines[$i]->id,'',$disabled);
|
||||
print ' <input type="submit" class="button"'.($disabled?' disabled="true"':'').' value="'.$langs->trans("Add").'">';
|
||||
if ((! $lines[$i]->public) && $disabled) print '('.$langs->trans("YouAreNotContactOfProject").')';
|
||||
print '</td>';
|
||||
|
||||
@ -237,7 +237,7 @@ if ($_GET["id"] > 0)
|
||||
|
||||
// Duration
|
||||
print '<td nowrap="nowrap" align="right">';
|
||||
print $html->select_duree('timespent_duration',($_POST['timespent_duration']?$_POST['timespent_duration']:''));
|
||||
print $html->select_duration('timespent_duration',($_POST['timespent_duration']?$_POST['timespent_duration']:''));
|
||||
print '</td>';
|
||||
|
||||
print '<td align="center">';
|
||||
@ -343,7 +343,7 @@ if ($_GET["id"] > 0)
|
||||
if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid)
|
||||
{
|
||||
print '<input type="hidden" name="old_duration" value="'.$task_time->task_duration.'">';
|
||||
print $html->select_duree('new_duration',$task_time->task_duration);
|
||||
print $html->select_duration('new_duration',$task_time->task_duration);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user