From 90f78429ecc16dcd886c06f538e3cf0e06faa35a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 May 2015 12:29:26 +0200 Subject: [PATCH] Fix regression after renaming field fk_soc --- htdocs/categories/card.php | 12 ++++++++---- htdocs/categories/class/categorie.class.php | 4 ++-- htdocs/categories/viewcat.php | 20 ++++++++++---------- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index 905c042a28625..db7b73998c1ec 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 @@ print_fiche_titre($langs->trans("CreateCat")); + dol_fiche_head(''); + print ''; // Ref print ''; - print ''; // Description @@ -257,9 +259,11 @@ 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 6ca5b2fad02de..20fce31515377 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -643,8 +643,8 @@ function getObjectsInCateg($type) { $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 c55f324ab0681..31580e28be86e 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -127,7 +127,7 @@ $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 @@ setEventMessages($object->error,$object->errors,'errors'); } } - + } @@ -232,7 +232,7 @@ $cats = $object->get_filles(); if ($cats < 0) { - dol_print_error(); + dol_print_error($db, $cats->error, $cats->errors); } else { @@ -286,12 +286,12 @@ $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 @@ print ''; print ''; } - + print "
"; print "\n"; print '\n"; @@ -359,7 +359,7 @@ $socs = $object->getObjectsInCateg("supplier"); if ($socs < 0) { - dol_print_error(); + dol_print_error($db, $socs->error, $socs->errors); } else { @@ -410,7 +410,7 @@ $socs = $object->getObjectsInCateg("customer"); if ($socs < 0) { - dol_print_error(); + dol_print_error($db, $socs->error, $socs->errors); } else { @@ -466,7 +466,7 @@ $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 @@ $contacts = $object->getObjectsInCateg("contact"); if ($contacts < 0) { - dol_print_error(); + dol_print_error($db, $contacts->error, $contacts->errors); } else {
'.$langs->trans("ProductsAndServices")."