diff --git a/htdocs/categories/categorie.class.php b/htdocs/categories/categorie.class.php
index 713f3ba4677..1585fe481e3 100644
--- a/htdocs/categories/categorie.class.php
+++ b/htdocs/categories/categorie.class.php
@@ -468,19 +468,22 @@ class Categorie
* \brief Reconstruit l'arborescence des catégories sous la forme d'un tableau
* Renvoi un tableau de tableau('id','id_mere',...) trié selon
* arbre et avec:
- * id = id de la categorie
- * id_mere = id de la categorie mere
- * id_children = tableau des id enfant
- * label = nom de la categorie
- * fulllabel = nom avec chemin complet de la categorie
- * fullpath = chemin complet compose des id
- * \return array Tableau de array
+ * id = id de la categorie
+ * id_mere = id de la categorie mere
+ * id_children = tableau des id enfant
+ * label = nom de la categorie
+ * fulllabel = nom avec chemin complet de la categorie
+ * fullpath = chemin complet compose des id
+ * \param type Type de categories (0=produit, 1=fournisseur, 2=client)
+ * \return array Tableau de array
*/
function get_full_arbo($type)
{
// Charge tableau des meres
$sql = "SELECT fk_categorie_mere as id_mere, fk_categorie_fille as id_fille";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie_association";
+
+ dolibarr_syslog("Categorie::get_full_arbo sql=".$sql);
$res = $this->db->query ($sql);
if ($res)
{
@@ -502,6 +505,8 @@ class Categorie
$sql.= " ON c.rowid=ca.fk_categorie_mere";
$sql.= " WHERE c.type = ".$type;
$sql.= " ORDER BY c.label, c.rowid";
+
+ dolibarr_syslog("Categorie::get_full_arbo sql=".$sql);
$res = $this->db->query ($sql);
if ($res)
{
@@ -866,7 +871,6 @@ class Categorie
$sql.= " WHERE ct.fk_".$type." = ".$id." AND c.type = ".$typeid;
$res = $this->db->query ($sql);
-
if ($res)
{
while ($cat = $this->db->fetch_array ($res))
diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php
index ccc413a927d..208300601e3 100644
--- a/htdocs/categories/categorie.php
+++ b/htdocs/categories/categorie.php
@@ -20,7 +20,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
- * $Source$
*/
/**
@@ -110,7 +109,7 @@ if (isset($_REQUEST["catMere"]) && $_REQUEST["catMere"]>=0)
$html = new Form($db);
/*
- * Fiche objet client/fournisseur
+ * Fiche categorie de client et/ou fournisseur
*/
if ($_GET["socid"])
{
@@ -186,26 +185,21 @@ if ($_GET["socid"])
if ($mesg) print($mesg);
- if ($soc->client)
- {
- formCategory($db,$soc,$type,2);
- print '
';
- }
+ if ($soc->client) formCategory($db,$soc,$type,2);
+
+ if ($soc->client && $soc->fournisseur) print '
';
+
if ($soc->fournisseur) formCategory($db,$soc,$type,1);
}
else if ($_GET["id"] || $_GET["ref"])
{
- /*
- * Fiche produit
- */
+ /*
+ * Fiche categorie de produit
+ */
+ require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php");
+ require_once(DOL_DOCUMENT_ROOT."/product.class.php");
- require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php");
- require_once(DOL_DOCUMENT_ROOT."/product.class.php");
-
- /*
- * Creation de l'objet produit correspondant à l'id
- */
-
+ // Produit
$product = new Product($db);
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
@@ -213,9 +207,9 @@ else if ($_GET["id"] || $_GET["ref"])
llxHeader("","",$langs->trans("CardProduct".$product->type));
- $head=product_prepare_head($product, $user);
- $titre=$langs->trans("CardProduct".$product->type);
- dolibarr_fiche_head($head, 'category', $titre);
+ $head=product_prepare_head($product, $user);
+ $titre=$langs->trans("CardProduct".$product->type);
+ dolibarr_fiche_head($head, 'category', $titre);
print '
';
}
diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php
index 2831d412418..2a730487608 100644
--- a/htdocs/html.form.class.php
+++ b/htdocs/html.form.class.php
@@ -1682,9 +1682,8 @@ class Form
}
/**
- * \brief Retourne la liste des catégories en fonction
- * du nombre choisi.
- * \param type Type de categories
+ * \brief Retourne la liste des catégories du type choisi
+ * \param type Type de categories (0=produit, 1=fournisseur, 2=client)
* \param selected Id categorie preselectionnee
* \param select_name Nom formulaire HTML
*/
diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang
index a60206a8802..19e4749f681 100644
--- a/htdocs/langs/fr_FR/categories.lang
+++ b/htdocs/langs/fr_FR/categories.lang
@@ -41,7 +41,8 @@ WasAddedSuccessfully=a
CategorySuccessfullyCreated=La catégorie %s a été ajouté avec succès.
ProductIsInCategories=Ce produit/service est dans les catégories suivantes
SupplierIsInCategories=Ce fournisseur est dans les catégories suivantes
-CompanyIsInCategories=Cette societé est dans les catégories suivantes
+CompanyIsInCustomersCategories=Cette societé est dans les catégories clients suivantes
+CompanyIsInSuppliersCategories=Cette societé est dans les catégories fournisseurs suivantes
ProductHasNoCategory=Ce produit/service n'est dans aucune catégorie en particulier
SupplierHasNoCategory=Ce fournisseur n'est dans aucune catégorie en particulier
CompanyHasNoCategory=Cette societé n'est dans aucune catégorie en particulier