Fix: W3C a label must be used if there is an "input" field only. Also it

is recommanded to have the input inside the label tags, not outside.
This solve bugs on some smatphone browsers.
This commit is contained in:
Laurent Destailleur 2014-11-28 02:05:40 +01:00
parent 1c16a2e621
commit 9ba5e9434d
3 changed files with 30 additions and 22 deletions

View File

@ -50,25 +50,23 @@ if (in_array($object->element,array('propal','facture','invoice','commande','ord
<td<?php echo (! empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>> <td<?php echo (! empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>
<div id="add"></div><span class="hideonsmartphone"><?php echo $langs->trans('AddNewLine'); ?></span><?php // echo $langs->trans("FreeZone"); ?> <div id="add"></div><span class="hideonsmartphone"><?php echo $langs->trans('AddNewLine'); ?></span><?php // echo $langs->trans("FreeZone"); ?>
</td> </td>
<td align="right"><span id="title_vat"><label for="tva_tx"><?php echo $langs->trans('VAT'); ?></label></span></td> <td align="right"><span id="title_vat"><?php echo $langs->trans('VAT'); ?></span></td>
<td align="right"><span id="title_up_ht"><label for="price_ht"><?php echo $langs->trans('PriceUHT'); ?></label></span></td> <td align="right"><span id="title_up_ht"><?php echo $langs->trans('PriceUHT'); ?></span></td>
<?php if (! empty($inputalsopricewithtax)) { ?> <?php if (! empty($inputalsopricewithtax)) { ?>
<td align="right"><span id="title_up_ttc"><label for="price_ttc"><?php echo $langs->trans('PriceUTTC'); ?></label></span></td> <td align="right"><span id="title_up_ttc"><?php echo $langs->trans('PriceUTTC'); ?></span></td>
<?php } ?> <?php } ?>
<td align="right"><label for="qty"><?php echo $langs->trans('Qty'); ?></label></td> <td align="right"><?php echo $langs->trans('Qty'); ?></td>
<td align="right"><label for="remise_percent"><?php echo $langs->trans('ReductionShort'); ?></label></td> <td align="right"><?php echo $langs->trans('ReductionShort'); ?></td>
<?php <?php
if (! empty($usemargins)) if (! empty($usemargins))
{ {
?> ?>
<td align="right" class="margininfos"> <td align="right" class="margininfos">
<?php <?php
echo '<label for="buying_price">';
if ($conf->global->MARGIN_TYPE == "1") if ($conf->global->MARGIN_TYPE == "1")
echo $langs->trans('BuyingPrice'); echo $langs->trans('BuyingPrice');
else else
echo $langs->trans('CostPrice'); echo $langs->trans('CostPrice');
echo '</label>';
?> ?>
</td> </td>
<?php <?php
@ -103,20 +101,25 @@ else {
// Show radio free line // Show radio free line
if ($forceall >= 0 && (! empty($conf->product->enabled) || ! empty($conf->service->enabled))) if ($forceall >= 0 && (! empty($conf->product->enabled) || ! empty($conf->service->enabled)))
{ {
echo '<label for="prod_entry_mode_free">';
echo '<input type="radio" name="prod_entry_mode" id="prod_entry_mode_free" value="free"'; echo '<input type="radio" name="prod_entry_mode" id="prod_entry_mode_free" value="free"';
//echo (GETPOST('prod_entry_mode')=='free' ? ' checked="true"' : ((empty($forceall) && (empty($conf->product->enabled) || empty($conf->service->enabled)))?' checked="true"':'') ); //echo (GETPOST('prod_entry_mode')=='free' ? ' checked="true"' : ((empty($forceall) && (empty($conf->product->enabled) || empty($conf->service->enabled)))?' checked="true"':'') );
echo (GETPOST('prod_entry_mode')=='free' ? ' checked="true"' : ''); echo (GETPOST('prod_entry_mode')=='free' ? ' checked="true"' : '');
echo '> '; echo '> ';
} // Show type selector
else echo '<input type="hidden" id="prod_entry_mode_free" name="prod_entry_mode" value="free">';
// Show type selector
if ($forceall >= 0)
{
echo '<label for="select_type">';
echo $langs->trans("FreeLineOfType"); echo $langs->trans("FreeLineOfType");
echo '</label>';
echo ' '; echo ' ';
echo '</label>';
}
else
{
echo '<input type="hidden" id="prod_entry_mode_free" name="prod_entry_mode" value="free">';
// Show type selector
if ($forceall >= 0)
{
echo $langs->trans("FreeLineOfType");
echo ' ';
}
} }
echo $form->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1,1,$forceall); echo $form->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1,1,$forceall);
@ -128,9 +131,8 @@ else {
{ {
if ($forceall >= 0) echo '<br>'; if ($forceall >= 0) echo '<br>';
echo '<span>'; echo '<span>';
echo '<input type="radio" name="prod_entry_mode" id="prod_entry_mode_predef" value="predef"'.(GETPOST('prod_entry_mode')=='predef'?' checked="true"':'').'> ';
echo '<label for="prod_entry_mode_predef">'; echo '<label for="prod_entry_mode_predef">';
echo '<input type="radio" name="prod_entry_mode" id="prod_entry_mode_predef" value="predef"'.(GETPOST('prod_entry_mode')=='predef'?' checked="true"':'').'> ';
if (empty($senderissupplier)) if (empty($senderissupplier))
{ {
if (! empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToSell'); if (! empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToSell');

View File

@ -434,9 +434,13 @@ if ($action == 'create' && $user->rights->projet->creer)
// Customer // Customer
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>'; print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
$text=$form->select_company(GETPOST('socid','int'),'socid','',1,1); $text=$form->select_company(GETPOST('socid','int'),'socid','',1,1);
$texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty"); if (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) && empty($conf->dol_use_jmobile))
print $form->textwithtooltip($text.' '.img_help(),$texthelp,1); {
$texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty");
print $form->textwithtooltip($text.' '.img_help(),$texthelp,1);
}
else print $text;
print '</td></tr>'; print '</td></tr>';
// Public // Public

View File

@ -782,16 +782,18 @@ else
print '<div class="hideonsmartphone float">'; print '<div class="hideonsmartphone float">';
print $langs->trans("ThirdPartyType").': &nbsp; &nbsp; '; print $langs->trans("ThirdPartyType").': &nbsp; &nbsp; ';
print '</div>'; print '</div>';
print '<input type="radio" id="radiocompany" class="flat" name="private" value="0"'.($private?'':' checked="checked"').'>';
print '<label for="radiocompany">'; print '<label for="radiocompany">';
print '<input type="radio" id="radiocompany" class="flat" name="private" value="0"'.($private?'':' checked="checked"').'>';
print '&nbsp;'; print '&nbsp;';
print $langs->trans("Company/Fundation"); print $langs->trans("Company/Fundation");
print '</label>'; print '</label>';
print ' &nbsp; &nbsp; '; print ' &nbsp; &nbsp; ';
print '<label for="radioprivate">';
print '<input type="radio" id="radioprivate" class="flat" name="private" value="1"'.($private?' checked="checked"':'').'>'; print '<input type="radio" id="radioprivate" class="flat" name="private" value="1"'.($private?' checked="checked"':'').'>';
print '&nbsp;'; print '&nbsp;';
print $langs->trans("Individual"); print $langs->trans("Individual");
print ' ('.$langs->trans("ToCreateContactWithSameName").')'; print '<div class="hideonsmartphone">('.$langs->trans("ToCreateContactWithSameName").')</div>';
print '</label>';
print '</div>'; print '</div>';
print "<br>\n"; print "<br>\n";
} }