diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php
index f7b6cf98d28..78d01a19e19 100644
--- a/htdocs/categories/viewcat.php
+++ b/htdocs/categories/viewcat.php
@@ -173,7 +173,12 @@ 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_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_USER && $user->rights->user->user->creer) ||
+ ($type == Categorie::TYPE_ACCOUNT && $user->rights->banque->configurer)
)) {
if ($type == Categorie::TYPE_PRODUCT) {
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
@@ -191,6 +196,26 @@ if ($elemid && $action == 'addintocategory' &&
require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
$newobject = new Ticket($db);
$elementtype = 'ticket';
+ } elseif ($type == Categorie::TYPE_PROJECT) {
+ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
+ $newobject = new Project($db);
+ $elementtype = 'project';
+ } elseif ($type == Categorie::TYPE_MEMBER) {
+ 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';
+ } elseif ($type == Categorie::TYPE_USER) {
+ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
+ $newobject = new User($db);
+ $elementtype = 'user';
+ } elseif ($type == Categorie::TYPE_ACCOUNT) {
+ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
+ $newobject = new User($db);
+ $elementtype = 'bank_account';
}
$result = $newobject->fetch($elemid);
@@ -538,6 +563,7 @@ if ($type == Categorie::TYPE_PRODUCT) {
}
}
+// List of customers
if ($type == Categorie::TYPE_CUSTOMER) {
$permission = $user->rights->societe->creer;
@@ -611,7 +637,7 @@ if ($type == Categorie::TYPE_CUSTOMER) {
}
}
-
+// List of suppliers
if ($type == Categorie::TYPE_SUPPLIER) {
$permission = $user->rights->societe->creer;
@@ -696,6 +722,26 @@ if ($type == Categorie::TYPE_MEMBER) {
if ($prods < 0) {
dol_print_error($db, $object->error, $object->errors);
} else {
+ // Form to add record into a category
+ $showclassifyform = 1;
+ if ($showclassifyform) {
+ print '
';
+ print '