dolibarr-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Dolibarr-dev] [bugs #9625] Changement de prix d'un produit


From: Nicolas GORALSKI
Subject: Re: [Dolibarr-dev] [bugs #9625] Changement de prix d'un produit
Date: Tue, 13 Jul 2004 10:31:57 +0200

Voici le patch avec en prime le correctif PHP_SERVER pour ce fichier.

Le 13 juil. 04, à 10:05, Nicolas GORALSKI a écrit :

This mail is an automated notification from the bugs tracker
 of the project: Dolibarr.




/ *********************************************************************** ***/
[bugs #9625] Full Item Snapshot:

URL: <http://savannah.nongnu.org/bugs/?func=detailitem&item_id=9625>
Project: Dolibarr
Submitted by: Nicolas GORALSKI
On: mar 13.07.2004 à 08:02

Severity:  5 - Average
Resolution:  None
Assigned to:  None
Status:  Open


Summary:  Changement de prix d'un produit

Original Submission: Lors du changement de prix d'un produit, la saisie devient
1.00.

For detailed info, follow this link:
<http://savannah.nongnu.org/bugs/?func=detailitem&item_id=9625>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/

_______________________________________________
Dolibarr-dev mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/dolibarr-dev


Index: fiche.php
===================================================================
RCS file: /cvsroot/dolibarr/dolibarr/htdocs/product/fiche.php,v
retrieving revision 1.29
diff -u -r1.29 fiche.php
--- fiche.php   9 Jun 2004 21:25:50 -0000       1.29
+++ fiche.php   13 Jul 2004 08:29:33 -0000
@@ -29,6 +29,12 @@
 $user->getrights('facture');
 $mesg = '';

+$liste_variable = array('id','action','type');
+foreach ($liste_variable as $rang => $valeur) {
+ if ($_GET[$liste_variable[$rang]]){ $$liste_variable[$rang] = $_GET[$liste_variable[$rang]];} + elseif ($_POST[$liste_variable[$rang]]){ $$liste_variable[$rang] = $_POST[$liste_variable[$rang]];}
+}
+
 if (!$user->rights->produit->lire)
 {
   accessforbidden();
@@ -127,8 +133,8 @@
       $product->description        = $_POST["desc"];
       $product->envente            = $_POST["statut"];
       $product->seuil_stock_alerte = $_POST["seuil_stock_alerte"];
-      $product->duration_value = $_POST["duration_value"];
-      $product->duration_unit = $_POST["duration_unit"];
+      $product->duration_value     = $_POST["duration_value"];
+      $product->duration_unit      = $_POST["duration_unit"];

       if ($product->check())
        {
@@ -184,7 +190,7 @@
 {
   $nbligne=0;

-  print "<form action=\"$PHP_SELF?type=$type\" method=\"post\">\n";
+  print "<form action=\"".$_SERVER["PHP_SELF"]."\" method=\"post\">\n";
   print "<input type=\"hidden\" name=\"action\" value=\"add\">\n";
   print '<input type="hidden" name="type" value="'.$type.'">'."\n";
   print '<div class="titre">Nouveau '.$types[$type].'</div><br>'."\n";
@@ -204,7 +210,7 @@
   print '<option value="0" SELECTED>Hors Vente</option>';
   print '</td></tr>';

-  if ($_GET["type"] == 0 && defined("MAIN_MODULE_STOCK"))
+  if ($type == 0 && defined("MAIN_MODULE_STOCK"))
     {
       print "<tr>".'<td>Seuil stock</td><td colspan="2">';
       print '<input name="seuil_stock_alerte" size="4" value="0">';
@@ -217,7 +223,7 @@
   print '<tr><td valign="top">Description</td><td>';
   print '<textarea name="desc" rows="8" cols="50">';
   print "</textarea></td></tr>";
-  if ($_GET["type"] == 1)
+  if ($type == 1)
     {
print "<tr>".'<td>Durée</td><td><input name="duration_value" size="6" maxlength="5" value="'.$product->duree.'"> &nbsp;'; print '<input name="duration_unit" type="radio" value="d">jour&nbsp;';
@@ -261,7 +267,7 @@

              print($mesg);

-         $head[0][0] = DOL_URL_ROOT."$PHP_SELF?id=".$id;
+         $head[0][0] = DOL_URL_ROOT.$SERVER["PHP_SELF"]."?id=".$id;
$head[0][1] = 'Fiche '.$types[$product->type].' : '.$product->ref;
          $h = 1;
          $a = 0;
@@ -373,8 +379,9 @@
          if ($action == 'edit_price' && $user->rights->produit->creer)
            {
              print '<div class="titre">Nouveau prix</div>';
-             print "<form action=\"$PHP_SELF?id=$id\" method=\"post\">\n";
+ print "<form action=\"".$_SERVER["PHP_SELF"]."\" method=\"post\">\n"; print '<input type="hidden" name="action" value="update_price">';
+             print '<input type="hidden" name="id" value="'.$id.'">';
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">'; print '<tr><td width="20%">Prix de vente</td><td><input name="price" size="10" value="'.price($product->price).'"></td></tr>'; print '<tr><td colspan="3" align="center"><input type="submit" value="Enregistrer">&nbsp;';
@@ -390,8 +397,9 @@
          if ($action == 'ajout_fourn' && $user->rights->produit->creer)
            {
              print_titre ("Ajouter un fournisseur");
-             print "<form action=\"$PHP_SELF?id=$id\" method=\"post\">\n";
+ print "<form action=\"".$_SERVER["PHP_SELF"]."\" method=\"post\">\n";
              print '<input type="hidden" name="action" value="add_fourn">';
+             print '<input type="hidden" name="id" value="'.$id.'">';
print '<table class="border" width="100%" cellspacing="0" cellpadding="4"><tr>';
              print '<td>Fournisseurs</td><td><select name="id_fourn">';

@@ -426,8 +434,9 @@
        {
print_fiche_titre('Edition de la fiche '.$types[$product->type].' : '.$product->ref, $mesg);

-         print "<form action=\"$PHP_SELF?id=$id\" method=\"post\">\n";
+ print "<form action=\"".$_SERVER["PHP_SELF"]."\" method=\"post\">\n";
          print '<input type="hidden" name="action" value="update">';
+         print '<input type="hidden" name="id" value="'.$id.'">';
        
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">'; print "<tr>".'<td width="20%">Référence</td><td colspan="2"><input name="ref" size="20" value="'.$product->ref.'"></td></tr>';





reply via email to

[Prev in Thread] Current Thread [Next in Thread]