Added ability to assign a category of product to a customer

This commit is contained in:
Regis Houssin 2008-10-27 18:29:21 +00:00
parent e8861bc524
commit b8410445ff
4 changed files with 31 additions and 7 deletions

View File

@ -826,6 +826,7 @@ class Categorie
return implode($sep, $w);
}
/**
* Retourne un tableau contenant la liste des catégories mères
*/
@ -837,13 +838,20 @@ class Categorie
$sql .= "WHERE fk_categorie_fille = ".$this->id;
$res = $this->db->query ($sql);
while ($cat = $this->db->fetch_array ($res))
if ($res)
{
$meres[] = new Categorie ($this->db, $cat['fk_categorie_mere']);
while ($cat = $this->db->fetch_array ($res))
{
$meres[] = new Categorie ($this->db, $cat['fk_categorie_mere']);
}
return $meres;
}
else
{
dolibarr_print_error ($this->db);
return -1;
}
return $meres;
}
/**

View File

@ -132,6 +132,20 @@ if ($type == 0 && $conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)
print $langs->trans("AssignedToTheCustomer").'</td><td>';
print $soc->getNomUrl(1);
print '</td></tr>';
$catsMeres = $c->get_meres ();
if ($catsMeres < 0)
{
dolibarr_print_error();
}
else if (count($catsMeres) > 0)
{
print '<tr><td width="20%" class="notopnoleft">';
print $langs->trans("CategoryContents").'</td><td>';
print ($c->visible ? $langs->trans("Visible") : $langs->trans("Invisible"));
print '</td></tr>';
}
}
else
{

View File

@ -73,4 +73,5 @@ ThisCategoryHasNoSupplier=This category does not contain any supplier.
ThisCategoryHasNoCustomer=This category does not contain any customer.
AssignedToCustomer=Assigned to a customer
AssignedToTheCustomer=Assigned to the customer
InternalCategory=Inernal category
InternalCategory=Inernal category
CategoryContents=Category contents

View File

@ -73,4 +73,5 @@ ThisCategoryHasNoSupplier=Cette cat
ThisCategoryHasNoCustomer=Cette catégorie ne contient aucun client.
AssignedToCustomer=Attribuer à un client
AssignedToTheCustomer=Attribué au client
InternalCategory=Catégorie interne
InternalCategory=Catégorie interne
CategoryContents=Contenu de la catégorie