[ Index ]
 

Code source de Dolibarr 2.0.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/htdocs/product/ -> barcode.php (source)

   1  <?php
   2  /* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   * Copyright (C) 2004-2005 Laurent Destailleur  <eldy@users.sourceforge.net>
   4   * Copyright (C) 2005      Regis Houssin        <regis.houssin@cap-networks.com>
   5   *
   6   * This program is free software; you can redistribute it and/or modify
   7   * it under the terms of the GNU General Public License as published by
   8   * the Free Software Foundation; either version 2 of the License, or
   9   * (at your option) any later version.
  10   *
  11   * This program is distributed in the hope that it will be useful,
  12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14   * GNU General Public License for more details.
  15   *
  16   * You should have received a copy of the GNU General Public License
  17   * along with this program; if not, write to the Free Software
  18   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  19   *
  20   * $Id: barcode.php,v 1.9 2005/12/09 11:54:18 hregis Exp $
  21   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/product/barcode.php,v $
  22   *
  23   */
  24  
  25  /**
  26          \file       htdocs/product/barcode.php
  27          \ingroup    product
  28          \brief      Page du code barre
  29          \version    $Revision: 1.9 $
  30  */
  31  
  32  require ("./pre.inc.php");
  33  require_once(DOL_DOCUMENT_ROOT."/product.class.php");
  34  
  35  $langs->load("products");
  36  $langs->load("bills");
  37  
  38  $user->getrights('barcode');
  39  
  40  if (!$user->rights->barcode->lire)
  41  accessforbidden();
  42  
  43  $types[0] = $langs->trans("Product");
  44  $types[1] = $langs->trans("Service");
  45  
  46  /*
  47   * Affiche historique prix
  48   */
  49  
  50  llxHeader("","",$langs->trans("BarCode"));
  51  
  52  $product = new Product($db);
  53  if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
  54  if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
  55  
  56  
  57  $h=0;
  58  
  59  $head[$h][0] = DOL_URL_ROOT."/product/fiche.php?id=".$product->id;
  60  $head[$h][1] = $langs->trans("Card");
  61  $h++;
  62  
  63  $head[$h][0] = DOL_URL_ROOT."/product/price.php?id=".$product->id;
  64  $head[$h][1] = $langs->trans("Price");
  65  $h++;
  66  
  67  if($product->type == 0)
  68  {
  69      if ($user->rights->barcode->lire)
  70      {
  71          if ($conf->barcode->enabled)
  72          {
  73              $head[$h][0] = DOL_URL_ROOT."/product/barcode.php?id=".$product->id;
  74              $head[$h][1] = $langs->trans("BarCode");
  75              $hselected=$h;
  76              $h++;
  77          }
  78      }
  79  }
  80  
  81  
  82  $head[$h][0] = DOL_URL_ROOT."/product/photos.php?id=".$product->id;
  83  $head[$h][1] = $langs->trans("Photos");
  84  $h++;
  85  
  86  if($product->type == 0)
  87  {
  88      if ($conf->stock->enabled)
  89      {
  90          $head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$product->id;
  91          $head[$h][1] = $langs->trans("Stock");
  92          $h++;
  93      }
  94  }
  95  
  96  if ($conf->fournisseur->enabled) {
  97      $head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$product->id;
  98      $head[$h][1] = $langs->trans("Suppliers");
  99      $h++;
 100  }
 101  
 102  $head[$h][0] = DOL_URL_ROOT."/product/stats/fiche.php?id=".$product->id;
 103  $head[$h][1] = $langs->trans("Statistics");
 104  $h++;
 105  
 106  //erics: pour créer des produits composés de x 'sous' produits
 107  /*
 108  $head[$h][0] = DOL_URL_ROOT."/product/pack.php?id=".$product->id;
 109  $head[$h][1] = $langs->trans('Packs');
 110  $h++;
 111  */
 112  
 113  $head[$h][0] = DOL_URL_ROOT."/product/stats/facture.php?id=".$product->id;
 114  $head[$h][1] = $langs->trans("Referers");
 115  $h++;
 116  
 117  $head[$h][0] = DOL_URL_ROOT.'/product/document.php?id='.$product->id;
 118  $head[$h][1] = $langs->trans('Documents');
 119  $h++;
 120  
 121  $titre=$langs->trans("CardProduct".$product->type);
 122  dolibarr_fiche_head($head, $hselected, $titre);
 123  
 124  print '<table class="border" width="100%">';
 125  
 126  // Reference
 127  print '<tr>';
 128  print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="2">';
 129  $product->load_previous_next_ref();
 130  $previous_ref = $product->ref_previous?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_previous.'">'.img_previous().'</a>':'';
 131  $next_ref     = $product->ref_next?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_next.'">'.img_next().'</a>':'';
 132  if ($previous_ref || $next_ref) print '<table class="nobordernopadding" width="100%"><tr class="nobordernopadding"><td class="nobordernopadding">';
 133  print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$product->id.'">'.$product->ref.'</a>';
 134  if ($previous_ref || $next_ref) print '</td><td class="nobordernopadding" align="center" width="20">'.$previous_ref.'</td><td class="nobordernopadding" align="center" width="20">'.$next_ref.'</td></tr></table>';
 135  print '</td>';
 136  print '</tr>';
 137  
 138  // Libelle
 139  print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">'.$product->libelle.'</td>';
 140  print '</tr>';
 141  
 142  // Prix
 143  print '<tr><td>'.$langs->trans("SellingPrice").'</td><td colspan="2">'.price($product->price).'</td></tr>';
 144  
 145  // Statut
 146  print '<tr><td>'.$langs->trans("Status").'</td><td colspan="2">';
 147  if ($product->envente) print $langs->trans("OnSell");
 148  else print $langs->trans("NotOnSell");
 149  print '</td></tr>';
 150  
 151  print "</table>\n";
 152        
 153  print "</div>\n";
 154  
 155  
 156  /*
 157   * Affiche code barre
 158   */
 159  
 160  
 161  
 162  
 163  $db->close();
 164  
 165  llxFooter('$Date: 2005/12/09 11:54:18 $ - $Revision: 1.9 $');
 166  ?>


Généré le : Mon Nov 26 12:29:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics