diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php
index ebd147e3cb1..c94a7086507 100644
--- a/htdocs/categories/viewcat.php
+++ b/htdocs/categories/viewcat.php
@@ -177,7 +177,8 @@ if ($elemid && $action == 'addintocategory' &&
($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_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';
@@ -211,6 +212,10 @@ if ($elemid && $action == 'addintocategory' &&
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);
@@ -558,6 +563,7 @@ if ($type == Categorie::TYPE_PRODUCT) {
}
}
+// List of customers
if ($type == Categorie::TYPE_CUSTOMER) {
$permission = $user->rights->societe->creer;
@@ -631,7 +637,7 @@ if ($type == Categorie::TYPE_CUSTOMER) {
}
}
-
+// List of suppliers
if ($type == Categorie::TYPE_SUPPLIER) {
$permission = $user->rights->societe->creer;
@@ -876,6 +882,26 @@ if ($type == Categorie::TYPE_ACCOUNT) {
if ($accounts < 0) {
dol_print_error($db, $object->error, $object->errors);
} else {
+ // Form to add record into a category
+ $showclassifyform = 1;
+ if ($showclassifyform) {
+ print '
';
+ print '