Restore previous version

This commit is contained in:
Laurent Destailleur 2008-04-10 18:04:56 +00:00
parent 2167387eba
commit 43bcc207de

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
@ -18,15 +18,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/ */
/** /**
\file htdocs/product/price.php \file htdocs/product/price.php
\ingroup product \ingroup product
\brief Page de la fiche produit \brief Page de la fiche produit
\version $Revision$ \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -208,10 +206,7 @@ if (! $_GET["action"])
*/ */
if ($_GET["action"] == 'edit_price' && $user->rights->produit->creer) if ($_GET["action"] == 'edit_price' && $user->rights->produit->creer)
{ {
$texte = $langs->trans("NewPrice"); print_fiche_titre($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)
{ {
@ -220,7 +215,8 @@ 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%">';
print $langs->trans('SellingPrice'); $text=$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')
@ -241,39 +237,33 @@ 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 '<form action="price.php?id='.$product->id.'" method="post">';
print '<input type="hidden" name="action" value="update_price">'; print '<input type="hidden" name="action" value="update_price">';
for ( $i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++ ) {
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').' '.$i;
print ( $langs->trans('SellingPrice').' '.$i ); print $html->textwithhelp($text,$langs->trans("PrecisionUnitIsLimitedToXDecimals",$conf->global->MAIN_MAX_DECIMALS_UNIT),$direction=1,$usehelpcursor=1);
print '</td>'; print '</td>';
if ($product->multiprices_base_type["$i"] == 'TTC') { if ($product->multiprices_base_type["$i"] == 'TTC')
{
print '<td><input name="price_'.$i.'" size="10" value="'.price($product->multiprices_ttc["$i"]).'">'; print '<td><input name="price_'.$i.'" size="10" value="'.price($product->multiprices_ttc["$i"]).'">';
}
} else { else
{
print '<td><input name="price_'.$i.'" size="10" value="'.price($product->multiprices["$i"]).'">'; 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 $html->select_PriceBaseType($product->multiprices_base_type["$i"], "multiprices_base_type_".$i);
print '</td></tr>'; print '</td></tr>';
print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'">&nbsp;';
}
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 '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></td></tr>';
print '</table>'; print '</table>';
print '</form>'; print '</form>';
}
} }
} }