diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index f7de102d96d..6a337766ff3 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -408,7 +408,18 @@ class Categorie extends CommonObject $error++; } } - + if (! $error) + { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_lang"; + $sql .= " WHERE fk_category = ".$this->id; + if (!$this->db->query($sql)) + { + $this->error=$this->db->lasterror(); + dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR); + $error++; + } + } + // Delete category if (! $error) { @@ -1263,7 +1274,7 @@ class Categorie extends CommonObject $result=''; $lien = ''; - $label=$langs->trans("ShowCategory").': '.$this->label; + $label=$langs->trans("ShowCategory").': '. ($this->ref?$this->ref:$this->label); $lienfin=''; $picto='category'; @@ -1271,7 +1282,7 @@ class Categorie extends CommonObject if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin); if ($withpicto && $withpicto != 2) $result.=' '; - if ($withpicto != 2) $result.=$lien.dol_trunc($this->ref,$maxlength).$lienfin; + if ($withpicto != 2) $result.=$lien.dol_trunc(($this->ref?$this->ref:$this->label),$maxlength).$lienfin; return $result; } @@ -1369,7 +1380,7 @@ class Categorie extends CommonObject // Objet $obj=array(); $obj['photo']=$photo; - if ($photo_vignette && is_file($dirthumb.$photo_vignette)) $obj['photo_vignette']=$photo_vignette; + if ($photo_vignette && is_file($dirthumb.$photo_vignette)) $obj['photo_vignette']='thumbs/' . $photo_vignette; else $obj['photo_vignette']=""; $tabobj[$nbphoto-1]=$obj; diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 69a8bb97eab..c54d7d889b2 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -241,7 +241,7 @@ if ($object->id) // Si fichier vignette disponible, on l'utilise, sinon on utilise photo origine if ($obj['photo_vignette']) { - $filename='thumbs/'.$obj['photo_vignette']; + $filename=$obj['photo_vignette']; } else { diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang index 3ee731f0824..0fe3b72b81f 100644 --- a/htdocs/langs/en_US/categories.lang +++ b/htdocs/langs/en_US/categories.lang @@ -111,4 +111,5 @@ ExtraFieldsCategories=Complementary attributes CategoriesSetup=Categories setup CategorieRecursiv=Link with parent category automatically CategorieRecursivHelp=If activated, product will also linked to parent category when adding into a subcategory -AddProductServiceIntoCategory=Add the following product/service \ No newline at end of file +AddProductServiceIntoCategory=Add the following product/service +ShowCategory=Show category \ No newline at end of file diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang index a00d97ea191..1c8d988f403 100644 --- a/htdocs/langs/fr_FR/categories.lang +++ b/htdocs/langs/fr_FR/categories.lang @@ -112,3 +112,4 @@ CategoriesSetup=Configuration du module catégories CategorieRecursiv=Lier avec les catégories parentes CategorieRecursivHelp=Si activé : quand un élément est ajouté dans une catégorie, l'ajouter aussi dans toutes les catégories parentes AddProductServiceIntoCategory=Ajouter le produit/service suivant +ShowCategory=Afficher la catégorie \ No newline at end of file