Skip to content
Snippets Groups Projects
Commit ac2c7c4f authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Merge branch 'BadPixxel-develop' into develop

parents eb41fc27 58c06264
Branches
Tags
No related merge requests found
...@@ -408,6 +408,17 @@ class Categorie extends CommonObject ...@@ -408,6 +408,17 @@ class Categorie extends CommonObject
$error++; $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 // Delete category
if (! $error) if (! $error)
...@@ -1263,7 +1274,7 @@ class Categorie extends CommonObject ...@@ -1263,7 +1274,7 @@ class Categorie extends CommonObject
$result=''; $result='';
$lien = '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$this->id.'&type='.$this->type.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$this->id.'&type='.$this->type.'">';
$label=$langs->trans("ShowCategory").': '.$this->label; $label=$langs->trans("ShowCategory").': '. ($this->ref?$this->ref:$this->label);
$lienfin='</a>'; $lienfin='</a>';
$picto='category'; $picto='category';
...@@ -1271,7 +1282,7 @@ class Categorie extends CommonObject ...@@ -1271,7 +1282,7 @@ class Categorie extends CommonObject
if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin); if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin);
if ($withpicto && $withpicto != 2) $result.=' '; 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; return $result;
} }
...@@ -1369,7 +1380,7 @@ class Categorie extends CommonObject ...@@ -1369,7 +1380,7 @@ class Categorie extends CommonObject
// Objet // Objet
$obj=array(); $obj=array();
$obj['photo']=$photo; $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']=""; else $obj['photo_vignette']="";
$tabobj[$nbphoto-1]=$obj; $tabobj[$nbphoto-1]=$obj;
......
...@@ -241,7 +241,7 @@ if ($object->id) ...@@ -241,7 +241,7 @@ if ($object->id)
// Si fichier vignette disponible, on l'utilise, sinon on utilise photo origine // Si fichier vignette disponible, on l'utilise, sinon on utilise photo origine
if ($obj['photo_vignette']) if ($obj['photo_vignette'])
{ {
$filename='thumbs/'.$obj['photo_vignette']; $filename=$obj['photo_vignette'];
} }
else else
{ {
......
...@@ -112,3 +112,4 @@ CategoriesSetup=Categories setup ...@@ -112,3 +112,4 @@ CategoriesSetup=Categories setup
CategorieRecursiv=Link with parent category automatically CategorieRecursiv=Link with parent category automatically
CategorieRecursivHelp=If activated, product will also linked to parent category when adding into a subcategory CategorieRecursivHelp=If activated, product will also linked to parent category when adding into a subcategory
AddProductServiceIntoCategory=Add the following product/service AddProductServiceIntoCategory=Add the following product/service
ShowCategory=Show category
\ No newline at end of file
...@@ -112,3 +112,4 @@ CategoriesSetup=Configuration du module catégories ...@@ -112,3 +112,4 @@ CategoriesSetup=Configuration du module catégories
CategorieRecursiv=Lier avec les catégories parentes 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 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 AddProductServiceIntoCategory=Ajouter le produit/service suivant
ShowCategory=Afficher la catégorie
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment