diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php
index df579ba99f7..ebd147e3cb1 100644
--- a/htdocs/categories/viewcat.php
+++ b/htdocs/categories/viewcat.php
@@ -176,7 +176,8 @@ if ($elemid && $action == 'addintocategory' &&
($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)
+ ($type == Categorie::TYPE_CONTACT && $user->rights->societe->creer) ||
+ ($type == Categorie::TYPE_USER && $user->rights->user->user->creer)
)) {
if ($type == Categorie::TYPE_PRODUCT) {
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
@@ -206,6 +207,10 @@ if ($elemid && $action == 'addintocategory' &&
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
$newobject = new Contact($db);
$elementtype = 'contact';
+ } elseif ($type == Categorie::TYPE_USER) {
+ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
+ $newobject = new User($db);
+ $elementtype = 'user';
}
$result = $newobject->fetch($elemid);
@@ -1004,6 +1009,25 @@ if ($type == Categorie::TYPE_USER) {
if ($users < 0) {
dol_print_error($db, $object->error, $object->errors);
} else {
+ // Form to add record into a category
+ $showclassifyform = 1;
+ if ($showclassifyform) {
+ print '
';
+ print '