Add patch of jeremie

This commit is contained in:
Laurent Destailleur 2008-04-10 18:00:31 +00:00
parent c430b25e5c
commit 2167387eba

View File

@ -208,7 +208,10 @@ if (! $_GET["action"])
*/ */
if ($_GET["action"] == 'edit_price' && $user->rights->produit->creer) if ($_GET["action"] == 'edit_price' && $user->rights->produit->creer)
{ {
print_fiche_titre($langs->trans("NewPrice")); $texte = $langs->trans("NewPrice");
$titre = $html->textwithhelp($texte, $langs->trans("PrecisionUnitIsLimitedToXDecimals", $conf->global->MAIN_MAX_DECIMALS_UNIT), $direction=1, $usehelpcursor=1);
print_fiche_titre($titre);
if (! $conf->global->PRODUIT_MULTIPRICES) if (! $conf->global->PRODUIT_MULTIPRICES)
{ {
@ -217,8 +220,7 @@ if ($_GET["action"] == 'edit_price' && $user->rights->produit->creer)
print '<input type="hidden" name="id" value="'.$product->id.'">'; print '<input type="hidden" name="id" value="'.$product->id.'">';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td width="15%">'; print '<tr><td width="15%">';
$text=$langs->trans('SellingPrice'); print $langs->trans('SellingPrice');
print $html->textwithhelp($text,$langs->trans("PrecisionUnitIsLimitedToXDecimals",$conf->global->MAIN_MAX_DECIMALS_UNIT),$direction=1,$usehelpcursor=1);
print '</td>'; print '</td>';
if ($product->price_base_type == 'TTC') if ($product->price_base_type == 'TTC')
@ -239,33 +241,39 @@ if ($_GET["action"] == 'edit_price' && $user->rights->produit->creer)
} }
else else
{ {
for($i=1;$i<=$conf->global->PRODUIT_MULTIPRICES_LIMIT;$i++)
{
print '<form action="price.php?id='.$product->id.'" method="post">';
print '<input type="hidden" name="action" value="update_price">';
print '<input type="hidden" name="id" value="'.$product->id.'">';
print '<table class="border" width="100%">';
print '<tr><td width="15%">';
$text=$langs->trans('SellingPrice').' '.$i;
print $html->textwithhelp($text,$langs->trans("PrecisionUnitIsLimitedToXDecimals",$conf->global->MAIN_MAX_DECIMALS_UNIT),$direction=1,$usehelpcursor=1);
print '</td>';
if ($product->multiprices_base_type["$i"] == 'TTC') print '<form action="price.php?id='.$product->id.'" method="post">';
{ print '<input type="hidden" name="action" value="update_price">';
print '<td><input name="price_'.$i.'" size="10" value="'.price($product->multiprices_ttc["$i"]).'">';
} for ( $i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++ ) {
else
{ print '<input type="hidden" name="id" value="'.$product->id.'">';
print '<td><input name="price_'.$i.'" size="10" value="'.price($product->multiprices["$i"]).'">'; print '<table class="border" width="100%">';
} print '<tr><td width="15%">';
print ( $langs->trans('SellingPrice').' '.$i );
print '</td>';
if ($product->multiprices_base_type["$i"] == 'TTC') {
print '<td><input name="price_'.$i.'" size="10" value="'.price($product->multiprices_ttc["$i"]).'">';
} else {
print '<td><input name="price_'.$i.'" size="10" value="'.price($product->multiprices["$i"]).'">';
}
print $html->select_PriceBaseType($product->multiprices_base_type["$i"], "multiprices_base_type_".$i);
print '</td></tr>';
}
print '<tr><td colspan="2"><input type="submit" class="button" value="'.$langs->trans("Save").'">&nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></td></tr>';
print '</table>';
print '</form>';
print $html->select_PriceBaseType($product->multiprices_base_type["$i"], "multiprices_base_type_".$i);
print '</td></tr>';
print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'">&nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></td></tr>';
print '</table>';
print '</form>';
}
} }
} }