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

Merge pull request #1815 from GPCsolutions/catbug

Fix categories bug
parents 1f0653dd 739d309a
No related branches found
No related tags found
No related merge requests found
......@@ -1122,12 +1122,29 @@ class Categorie
{
$cats = array();
$table=''; $type='';
if ($typeid == 0 || $typeid == 'product') { $typeid=0; $table='product'; $type='product'; }
else if ($typeid == 1 || $typeid == 'supplier') { $typeid=1; $table='societe'; $type='fournisseur'; }
else if ($typeid == 2 || $typeid == 'customer') { $typeid=2; $table='societe'; $type='societe'; }
else if ($typeid == 3 || $typeid == 'member') { $typeid=3; $table='member'; $type='member'; }
else if ($typeid == 4 || $typeid == 'contact') { $typeid=4; $table='socpeople'; $type='contact'; }
$table = '';
$type = '';
if ($typeid === 0 || $typeid === '0' || $typeid == 'product') {
$typeid = 0;
$table = 'product';
$type = 'product';
} else if ($typeid === 1 || $typeid === '1' || $typeid == 'supplier') {
$typeid = 1;
$table = 'societe';
$type = 'fournisseur';
} else if ($typeid === 2 || $typeid === '2' || $typeid == 'customer') {
$typeid = 2;
$table = 'societe';
$type = 'societe';
} else if ($typeid === 3 || $typeid === '3' || $typeid == 'member') {
$typeid = 3;
$table = 'member';
$type = 'member';
} else if ($typeid === 4 || $typeid === '4' || $typeid == 'contact') {
$typeid = 4;
$table = 'socpeople';
$type = 'contact';
}
$sql = "SELECT ct.fk_categorie, c.label";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie_".$type." as ct, ".MAIN_DB_PREFIX."categorie as c";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment