Qual: Uniformize behaviour of product selection

This commit is contained in:
Laurent Destailleur 2012-11-26 13:37:40 +01:00
parent c9edac9cd6
commit 4abae05c26
2 changed files with 20 additions and 0 deletions

View File

@ -1461,12 +1461,22 @@ if ($id > 0 || ! empty($ref))
print '<td colspan="4">&nbsp;</td>';
print '</tr>';
// TODO Use the predefinedproductline_create.tpl.php file
// Add free products/services form
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'#add" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="addline">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<script type="text/javascript">
jQuery(document).ready(function() {
jQuery(\'#idprodfournprice\').change(function() {
if (jQuery(\'#idprodfournprice\').val() > 0) jQuery(\'#np_desc\').focus();
});
});
</script>';
$var=true;
print '<tr '.$bc[$var].'>';
print '<td>';

View File

@ -1814,10 +1814,20 @@ else
print '<td colspan="4">&nbsp;</td>';
print '</tr>';
// TODO Use the predefinedproductline_create.tpl.php file
print '<form name="addline_predef" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=addline" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="socid" value="'. $object->socid .'">';
print '<input type="hidden" name="facid" value="'.$object->id.'">';
print '<script type="text/javascript">
jQuery(document).ready(function() {
jQuery(\'#idprodfournprice\').change(function() {
if (jQuery(\'#idprodfournprice\').val() > 0) jQuery(\'#np_desc\').focus();
});
});
</script>';
$var=! $var;
print '<tr '.$bc[$var].'>';
print '<td colspan="4">';