diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 3cdb5d516f1..dbe83945832 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -125,6 +125,7 @@ if ($type == 0) $title=$langs->trans("ProductsCategoryShort"); elseif ($type == 1) $title=$langs->trans("SuppliersCategoryShort"); elseif ($type == 2) $title=$langs->trans("CustomersCategoryShort"); elseif ($type == 3) $title=$langs->trans("MembersCategoryShort"); +elseif ($type == 3) $title=$langs->trans("ContactCategoryShort"); else $title=$langs->trans("Category"); $head = categories_prepare_head($object,$type); @@ -444,6 +445,58 @@ if ($object->type == 3) } } +if($object->type == 4) +{ + $contacts = $object->get_type("socpeople","Contact",'contact',"socpeople"); + if ($contacts < 0) + { + dol_print_error(); + } + else + { + print "
"; + print ''."\n"; + print '\n"; + + if (count($contacts) > 0) + { + $i = 0; + $var=true; + foreach ($contacts as $key => $contact) + { + $i++; + $var=!$var; + print "\t\n"; + print '\n"; + // Link to delete from category + print ''; + print "\n"; + } + } + else + { + print ""; + } + print "
'.$langs->trans("Contact")."
'; + print $contact->getNomUrl(1,'category'); + print "'; + $typeid=$object->type; + $permission=0; + if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer); + if ($typeid == 1) $permission=$user->rights->societe->creer; + if ($typeid == 2) $permission=$user->rights->societe->creer; + if ($typeid == 3) $permission=$user->rights->adherent->creer; + if ($typeid == 4) $permission=$user->rights->contact->creer; + if ($permission) + { + print ""; + print img_delete($langs->trans("DeleteFromCat")).' '; + print $langs->trans("DeleteFromCat").""; + } + print '
".$langs->trans("ThisCategoryHasNoCustomer")."
\n"; + } +} + llxFooter(); $db->close();