From 826592c480899a2db6fc8ea1bf935b3f0402c9b6 Mon Sep 17 00:00:00 2001
From: Maxime Kohlhaas <maxime@atm-consulting.fr>
Date: Thu, 19 Nov 2015 14:43:00 +0100
Subject: [PATCH] Fix info and banner on societe

---
 htdocs/product/card.php                | 2 +-
 htdocs/product/class/product.class.php | 4 ++--
 htdocs/societe/info.php                | 8 +++-----
 3 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index 4c30691318f..4f029ad6727 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -1305,7 +1305,7 @@ else
             $picto=($object->type== Product::TYPE_SERVICE?'service':'product');
             dol_fiche_head($head, 'card', $titre, 0, $picto);
 
-            dol_banner_tab($object, 'ref', '', ($user->societe_id?0:1), 'ref');
+            dol_banner_tab($object, 'id', '', ($user->societe_id?0:1), 'ref');
             
             
             print '<div class="fichecenter">';
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 4a86ba549ae..8904820ce7b 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -4123,7 +4123,7 @@ class Product extends CommonObject
      */
     function info($id)
     {
-        $sql = "SELECT p.rowid, p.datec as date_creation, p.tms as date_modification,";
+        $sql = "SELECT p.rowid, p.ref, p.datec as date_creation, p.tms as date_modification,";
         $sql.= " p.fk_user_author, p.fk_user_modif";
         $sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." as p";
         $sql.= " WHERE p.rowid = ".$id;
@@ -4149,7 +4149,7 @@ class Product extends CommonObject
                     $this->user_modification = $muser;
                 }
 
-                $this->ref			     = $obj->name;
+                $this->ref			     = $obj->ref;
                 $this->date_creation     = $this->db->jdate($obj->date_creation);
                 $this->date_modification = $this->db->jdate($obj->date_modification);
             }
diff --git a/htdocs/societe/info.php b/htdocs/societe/info.php
index a415ae57b1c..3a2ecea9305 100644
--- a/htdocs/societe/info.php
+++ b/htdocs/societe/info.php
@@ -78,15 +78,13 @@ if ($socid > 0)
 		exit;
 	}
 
-	$object->info($socid);
-
 	$head = societe_prepare_head($object);
 
 	dol_fiche_head($head, 'info', $langs->trans("ThirdParty"), 0, 'company');
 
-	$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
-
-	dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '');
+	dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
+	
+	$object->info($socid);
 
 
 	print '<div class="fichecenter">';
-- 
GitLab