diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index 905c042a286..db7b73998c1 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2006-2011 Laurent Destailleur + * Copyright (C) 2006-2015 Laurent Destailleur * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2013 Florian Henry @@ -229,11 +229,13 @@ if ($user->rights->categorie->creer) print_fiche_titre($langs->trans("CreateCat")); + dol_fiche_head(''); + print ''; // Ref print ''; - print ''; // Description @@ -257,9 +259,11 @@ if ($user->rights->categorie->creer) print '
'.$langs->trans("Ref").''; + print ''.$langs->trans("Ref").''; print'
'; - print '
'; + dol_fiche_end(''); + + print '
'; print ''; - print '     '; + print '     '; print ''; print '
'; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 6ca5b2fad02..20fce315153 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -643,8 +643,8 @@ class Categorie extends CommonObject { $field=''; $classname=''; $category_table=''; $object_table=''; if ($type=='product') { $field='product'; $classname='Product'; } - if ($type=='customer') { $field='societe'; $classname='Societe'; } - if ($type=='supplier') { $field='societe'; $classname='Fournisseur'; $category_table='fournisseur'; } + if ($type=='customer') { $field='soc'; $classname='Societe'; $category_table='societe'; $object_table='societe'; } + if ($type=='supplier') { $field='soc'; $classname='Fournisseur'; $category_table='fournisseur'; $object_table='societe'; } if ($type=='member') { $field='member'; $classname='Adherent'; $category_table=''; $object_table='adherent'; } if ($type=='contact') { $field='socpeople'; $classname='Contact'; $category_table='contact'; $object_table='socpeople'; } diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index c55f324ab06..31580e28be8 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -127,7 +127,7 @@ if ($type==0 && $elemid && $action == 'addintocategory' && ($user->rights->produ $newobject = new Product($db); $result = $newobject->fetch($elemid); $elementtype = 'product'; - + // TODO Add into categ $result=$object->add_type($newobject,$elementtype); if ($result >= 0) @@ -145,7 +145,7 @@ if ($type==0 && $elemid && $action == 'addintocategory' && ($user->rights->produ setEventMessages($object->error,$object->errors,'errors'); } } - + } @@ -232,7 +232,7 @@ print "
"; $cats = $object->get_filles(); if ($cats < 0) { - dol_print_error(); + dol_print_error($db, $cats->error, $cats->errors); } else { @@ -286,12 +286,12 @@ if ($object->type == 0) $prods = $object->getObjectsInCateg("product"); if ($prods < 0) { - dol_print_error(); + dol_print_error($db, $prods->error, $prods->errors); } else { $showclassifyform=1; $typeid=0; - + // Form to add record into a category if ($showclassifyform) { @@ -312,7 +312,7 @@ if ($object->type == 0) print ''; print ''; } - + print "
"; print "\n"; print '\n"; @@ -359,7 +359,7 @@ if ($object->type == 1) $socs = $object->getObjectsInCateg("supplier"); if ($socs < 0) { - dol_print_error(); + dol_print_error($db, $socs->error, $socs->errors); } else { @@ -410,7 +410,7 @@ if($object->type == 2) $socs = $object->getObjectsInCateg("customer"); if ($socs < 0) { - dol_print_error(); + dol_print_error($db, $socs->error, $socs->errors); } else { @@ -466,7 +466,7 @@ if ($object->type == 3) $prods = $object->getObjectsInCateg("member"); if ($prods < 0) { - dol_print_error($db,$object->error); + dol_print_error($db, $prods->error, $prods->errors); } else { @@ -518,7 +518,7 @@ if($object->type == 4) $contacts = $object->getObjectsInCateg("contact"); if ($contacts < 0) { - dol_print_error(); + dol_print_error($db, $contacts->error, $contacts->errors); } else {
'.$langs->trans("ProductsAndServices")."