diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php
index 9158cf0dd92..df579ba99f7 100644
--- a/htdocs/categories/viewcat.php
+++ b/htdocs/categories/viewcat.php
@@ -173,9 +173,10 @@ if ($elemid && $action == 'addintocategory' &&
(($type == Categorie::TYPE_PRODUCT && ($user->rights->produit->creer || $user->rights->service->creer)) ||
($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer) ||
($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer) ||
- ($type == Categorie::TYPE_TICKET && $user->rights->ticket->write) ||
- ($type == Categorie::TYPE_PROJECT && $user->rights->projet->creer)||
- ($type == Categorie::TYPE_MEMBER && $user->rights->projet->creer)
+ ($type == Categorie::TYPE_TICKET && $user->rights->ticket->write) ||
+ ($type == Categorie::TYPE_PROJECT && $user->rights->projet->creer) ||
+ ($type == Categorie::TYPE_MEMBER && $user->rights->projet->creer) ||
+ ($type == Categorie::TYPE_CONTACT && $user->rights->societe->creer)
)) {
if ($type == Categorie::TYPE_PRODUCT) {
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
@@ -201,6 +202,10 @@ if ($elemid && $action == 'addintocategory' &&
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
$newobject = new Adherent($db);
$elementtype = 'member';
+ } elseif ($type == Categorie::TYPE_CONTACT) {
+ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
+ $newobject = new Contact($db);
+ $elementtype = 'contact';
}
$result = $newobject->fetch($elemid);
@@ -782,6 +787,25 @@ if ($type == Categorie::TYPE_CONTACT) {
if ($contacts < 0) {
dol_print_error($db, $object->error, $object->errors);
} else {
+ // Form to add record into a category
+ $showclassifyform = 1;
+ if ($showclassifyform) {
+ print '
';
+ print '