From 44ee86310153278d49f12ca3d6f41e95f3f5b6cb Mon Sep 17 00:00:00 2001
From: Regis Houssin <regis@dolibarr.fr>
Date: Mon, 15 Feb 2010 17:05:53 +0000
Subject: [PATCH] Fix: add picto

---
 htdocs/product/barcode.php | 24 +++++++-----------------
 htdocs/product/photos.php  |  4 ++--
 2 files changed, 9 insertions(+), 19 deletions(-)

diff --git a/htdocs/product/barcode.php b/htdocs/product/barcode.php
index a2567fb5f69..ea9acdd366f 100644
--- a/htdocs/product/barcode.php
+++ b/htdocs/product/barcode.php
@@ -1,7 +1,7 @@
 <?php
 /* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  * Copyright (C) 2004-2009 Laurent Destailleur  <eldy@users.sourceforge.net>
- * Copyright (C) 2005-2009 Regis Houssin        <regis@dolibarr.fr>
+ * Copyright (C) 2005-2010 Regis Houssin        <regis@dolibarr.fr>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -62,18 +62,16 @@ if ($_POST['action'] ==	'setbarcode'	&& $user->rights->barcode->creer)
 {
 	$product =	new	Product($db);
 	$product->fetch($_GET["id"]);
-	$product->barcode = $_POST['barcode']; //Todo: ajout v�rification de la validit� du code barre en fonction du type
+	$product->barcode = $_POST['barcode']; //Todo: ajout verification de la validite du code barre en fonction du type
 	$result = $product->update_barcode($user);
 	Header("Location: barcode.php?id=".$_GET["id"]);
 	exit;
 }
 
 
-/* *****************************************/
-/*																			   */
-/* Mode vue et edition										 */
-/*																			   */
-/* *************************************** */
+/*
+ *   Mode vue et edition
+ */
 
 llxHeader("","",$langs->trans("BarCode"));
 
@@ -84,10 +82,10 @@ $product = new Product($db);
 if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
 if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
 
-
 $head=product_prepare_head($product, $user);
 $titre=$langs->trans("CardProduct".$product->type);
-dol_fiche_head($head, 'barcode', $titre);
+$picto=($product->type==1?'service':'product');
+dol_fiche_head($head, 'barcode', $titre, 0, $picto);
 
 
 print '<table class="border" width="100%">'."\n";
@@ -171,14 +169,6 @@ print '</td></tr>'."\n";
 print "</table>\n";
 print "</div>\n";
 
-
-/*
- * Affiche code barre
- */
-
-
-
-
 $db->close();
 
 llxFooter('$Date$ - $Revision$');
diff --git a/htdocs/product/photos.php b/htdocs/product/photos.php
index 7db67fbaa67..8eb84622916 100644
--- a/htdocs/product/photos.php
+++ b/htdocs/product/photos.php
@@ -2,7 +2,7 @@
 /* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  * Copyright (C) 2004-2009 Laurent Destailleur  <eldy@users.sourceforge.net>
  * Copyright (C) 2005      Eric Seigne          <eric.seigne@ryxeo.com>
- * Copyright (C) 2005-2009 Regis Houssin        <regis@dolibarr.fr>
+ * Copyright (C) 2005-2010 Regis Houssin        <regis@dolibarr.fr>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -82,8 +82,8 @@ $html = new Form($db);
 
 if ($_GET["id"] || $_GET["ref"])
 {
-
 	$product = new Product($db);
+	
 	if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
 	if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
 
-- 
GitLab