/[dolibarr]/dolibarr/htdocs/fourn/product/fiche.php
ViewVC logotype

Diff of /dolibarr/htdocs/fourn/product/fiche.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.13 by eldy, Sun Sep 11 16:51:41 2005 UTC revision 1.14 by eldy, Sun Sep 11 17:30:48 2005 UTC
# Line 18  Line 18 
18   *   *
19   * $Id$   * $Id$
20   * $Source$   * $Source$
  *  
21   */   */
22    
23  /**  /**
# Line 60  if ($_GET["action"] == 'fastappro') Line 59  if ($_GET["action"] == 'fastappro')
59  // Action ajout d'un produit ou service  // Action ajout d'un produit ou service
60  if ($_POST["action"] == 'add' && $user->rights->produit->creer)  if ($_POST["action"] == 'add' && $user->rights->produit->creer)
61  {  {
62    $product = new Product($db);      $product = new Product($db);
   
   $product->ref            = $_POST["ref"];  
   $product->libelle        = $_POST["libelle"];  
   $product->price          = $_POST["price"];  
   $product->catid          = $_POST["catid"];  
   $product->tva_tx         = $_POST["tva_tx"];  
   $product->type           = $_POST["type"];  
   $product->envente        = $_POST["statut"];  
   $product->description    = $_POST["desc"];  
   $product->duration_value = $_POST["duration_value"];  
   $product->duration_unit  = $_POST["duration_unit"];  
   $product->seuil_stock_alerte = $_POST["seuil_stock_alerte"];  
   
   $e_product = $product;  
63    
64    $id = $product->create($user);      $product->ref            = $_POST["ref"];
65        $product->libelle        = $_POST["libelle"];
66    if ($id > 0)      $product->price          = $_POST["price"];
67      {      $product->catid          = $_POST["catid"];
68        Header("Location: fiche.php?id=$id");      $product->tva_tx         = $_POST["tva_tx"];
69      }      $product->type           = $_POST["type"];
70    else      $product->envente        = $_POST["statut"];
71      {      $product->description    = $_POST["desc"];
72        if ($id == -3)      $product->duration_value = $_POST["duration_value"];
73          {      $product->duration_unit  = $_POST["duration_unit"];
74            $_error = 1;      $product->seuil_stock_alerte = $_POST["seuil_stock_alerte"];
75            $_GET["action"] = "create";  
76            $_GET["type"] = $_POST["type"];      $e_product = $product;
77          }  
78        $id = $product->create($user);
79        if ($id > 0)
80        {
81            Header("Location: fiche.php?id=$id");
82        }
83        else
84        {
85            if ($id == -3)
86            {
87                $mesg='<div class="error">'.$product->error.'</div>';
88                $_error = 1;
89                $_GET["action"] = "create";
90                $_GET["type"] = $_POST["type"];
91            }
92      }      }
93  }  }
94    
# Line 199  if ($_POST["cancel"] == $langs->trans("C Line 198  if ($_POST["cancel"] == $langs->trans("C
198    Header("Location: fiche.php?id=".$_POST["id"]);    Header("Location: fiche.php?id=".$_POST["id"]);
199  }  }
200    
201    
202  // Le produit n'est pas encore chargé a ce stade  // Le produit n'est pas encore chargé a ce stade
203  llxHeader("","",$langs->trans("CardProduct0"));  llxHeader("","",$langs->trans("CardProduct0"));
204    
# Line 227  if ($_GET["action"] == 'create' && $user Line 227  if ($_GET["action"] == 'create' && $user
227                
228    print '<table class="border" width="100%">';    print '<table class="border" width="100%">';
229    
230      if ($mesg) print $mesg;
231    
232    if ($conf->categorie->enabled)    if ($conf->categorie->enabled)
233      {                  {            
234        print '<tr><td>'.$langs->trans("Categorie");        print '<tr><td>'.$langs->trans("Categorie");
# Line 272  if ($_GET["action"] == 'create' && $user Line 274  if ($_GET["action"] == 'create' && $user
274        print '</td></tr>';        print '</td></tr>';
275      }      }
276        
277    print '<tr><td>&nbsp;</td><td><input type="submit" value="'.$langs->trans("Create").'"></td></tr>';    print '<tr><td>&nbsp;</td><td><input type="submit" class="button" value="'.$langs->trans("Create").'"></td></tr>';
278    print '</table>';    print '</table>';
279    print '</form>';          print '</form>';      
280  }  }
# Line 334  else Line 336  else
336    
337                dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref);                dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref);
338    
339                  if ($mesg) print($mesg);
340                print($mesg);                
341                print '<table class="border" width="100%">';                print '<table class="border" width="100%">';
342    
343                if ($conf->categorie->enabled)                if ($conf->categorie->enabled)

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26