introducing "mixte" mode for select_duration

If 'select' then input hour and input min is a combo,
if 'text' input hour is in text and input min is a text, 
if 'mixte' input hour is in text and input min is a combo
This commit is contained in:
BENKE Charlie 2017-03-21 23:48:06 +01:00 committed by GitHub
parent acdfd6ab9e
commit 7999cb9a46

View File

@ -4880,7 +4880,9 @@ class Form
* @param string $prefix Prefix for input fields * @param string $prefix Prefix for input fields
* @param int $iSecond Default preselected duration (number of seconds or '') * @param int $iSecond Default preselected duration (number of seconds or '')
* @param int $disabled Disable the combo box * @param int $disabled Disable the combo box
* @param string $typehour If 'select' then input hour and input min is a combo, if 'text' input hour is in text and input min is a text * @param string $typehour If 'select' then input hour and input min is a combo,
* if 'text' input hour is in text and input min is a text,
* if 'mixte' input hour is in text and input min is a combo
* @param integer $minunderhours If 1, show minutes selection under the hours * @param integer $minunderhours If 1, show minutes selection under the hours
* @param int $nooutput Do not output html string but return it * @param int $nooutput Do not output html string but return it
* @return string|null * @return string|null
@ -4916,7 +4918,7 @@ class Form
} }
$retstring.="</select>"; $retstring.="</select>";
} }
elseif ($typehour=='text') elseif ($typehour=='text' || $typehour=='mixte')
{ {
$retstring.='<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" size="1" name="'.$prefix.'hour"'.($disabled?' disabled':'').' class="flat" value="'.($hourSelected?((int) $hourSelected):'').'">'; $retstring.='<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" size="1" name="'.$prefix.'hour"'.($disabled?' disabled':'').' class="flat" value="'.($hourSelected?((int) $hourSelected):'').'">';
} }
@ -4929,7 +4931,7 @@ class Form
if ($minunderhours) $retstring.='<br>'; if ($minunderhours) $retstring.='<br>';
else $retstring.="&nbsp;"; else $retstring.="&nbsp;";
if ($typehour=='select') if ($typehour=='select' || $typehour=='mixte')
{ {
$retstring.='<select class="flat" name="'.$prefix.'min"'.($disabled?' disabled':'').'>'; $retstring.='<select class="flat" name="'.$prefix.'min"'.($disabled?' disabled':'').'>';
for ($min = 0; $min <= 55; $min=$min+5) for ($min = 0; $min <= 55; $min=$min+5)